From 32a95699e59c5c65e18c08643266c9cbfa380ee4 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期五, 07 六月 2024 09:56:05 +0800 Subject: [PATCH] 优化设备明细、检验任务附件权限 --- src/components/tool/value-table.vue | 42 ++++++++++++++++++++++++++++++++---------- 1 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue index 6e40efb..127e63e 100644 --- a/src/components/tool/value-table.vue +++ b/src/components/tool/value-table.vue @@ -49,6 +49,9 @@ .handleBtn.is-disabled { color: #C0C4CC; } + .red{ + color: red !important; + } </style> <style> /* .value-table .highlight-warning-row-border td { @@ -95,6 +98,12 @@ align-items: center; justify-content: center; } + .el-table__empty-text{ + text-align: left; + width: 100%; + display: inline-block; + margin-left: 200px; + } </style> <template> @@ -130,7 +139,7 @@ @click="handleLinkEvent(scope.row,data.linkEvent[a.label])">{{scope.row[a.label]}}</span> <img style="width: 40px;height: 40px;margin-top: 10px;" :src="javaApi+'/img/'+scope.row[a.label]" v-else-if="showUpload(a.label)&&scope.row[a.label]" alt=""> - <span v-else>{{scope.row[a.label]}}</span> + <span v-else :class="{red:getRedColor(a.label,scope.row)}" >{{scope.row[a.label]}}</span> </template> </el-table-column> <el-table-column fixed="right" align="center" label="鎿嶄綔" :width="getWidth()" v-if="data.do.length > 0"> @@ -156,7 +165,7 @@ :total="total"> </el-pagination> </div> - <el-dialog title="缂栬緫" :visible.sync="upDia" :width="data.row==1?'500px':500+data.row * 200 + 'px'" append-to-body> + <el-dialog title="缂栬緫" :visible.sync="upDia" :width="data.row==1?'500px':540+data.row * 200 + 'px'" append-to-body> <div class="body" style="max-height: 550px;overflow-y: auto;padding: 5px 10px 5px 0;"> <div v-if="data.row > 1"> <div v-for="(a, ai) in upHead" :key="ai" style="line-height: 50px;"> @@ -225,14 +234,14 @@ <el-button type="primary" @click="saveUpData" :loading="upLoad">纭� 瀹�</el-button> </span> </el-dialog> - <el-dialog title="鏂板" :visible.sync="addDia" :width="data.row==1?'500px':500+data.row * 200 + 'px'" append-to-body> + <el-dialog title="鏂板" :visible.sync="addDia" :width="data.row==1?'500px':540+data.row * 200 + 'px'" append-to-body> <div class="body" v-if="addDia" style="max-height: 550px;overflow-y: auto;padding: 5px 10px 5px 0;"> <div v-if="data.row > 1"> <div v-for="(a, ai) in upHead" :key="ai" style="line-height: 50px;"> - <el-col :span="6/data.row" style="text-align: right;"><span class="required-span" + <el-col :span="6/data.row" style="text-align: right;" :offset="1"><span class="required-span" v-if="showAddReq(a.label)">* </span>{{a.value}}锛�</el-col> - <el-col :span="16/data.row" :offset="1"> + <el-col :span="16/data.row"> <el-input v-model="upData[a.label]" size="small" clearable :placeholder="`璇疯緭鍏�${a.value}`" v-if="showType(a.label, data.selectField) == null&&!showUpload(a.label)&&!showCascader(a.label)"></el-input> <el-select v-model="upData[a.label]" size="small" v-if="showType(a.label, data.selectField) != null" @@ -303,7 +312,7 @@ <el-dialog title="鏁版嵁瀵煎叆" :visible.sync="uploadDia" width="500px"> <div style="margin: 0 auto;"> <el-upload ref="upload" drag :action="javaApi + inputUrl" :headers="token" :file-list="fileList" name="file" - :auto-upload="false" accept=".csv" :limit="1" :on-change="beforeUpload" :on-success="onSuccess" + :auto-upload="false" :accept="data.accept===undefined?'.csv':data.accept" :limit="1" :on-change="beforeUpload" :on-success="onSuccess" :on-error="onError" :data="{param: data.uploadStr}"> <i class="el-icon-upload"></i> <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div> @@ -558,14 +567,17 @@ }, sizeChange(val) { this.page.size = val - this.selectList() + this.selectList('page') }, currentChange(val) { this.page.current = val - this.selectList() + this.selectList('page') }, - selectList() { + selectList(val) { this.loading = true + if(val===undefined){ + this.page.current = 1; + } if (this.data.isPage != undefined && this.data.isPage != true) { this.page = { current: -1, @@ -587,6 +599,7 @@ this.total = res.data.body.total this.tableHead = res.data.head this.tableData = res.data.body.records + // console.log(JSON.stringify(this.tableHead)+"---------"+JSON.stringify(this.tableData)) for (var a in this.data.selectField) { if (this.data.selectField[a].choose == true) { this.tableData.map(b => { @@ -754,6 +767,7 @@ } this.$message.success('鍒犻櫎鎴愬姛') this.selectList() + this.$emit('delete') }).catch(e => { this.$message.error('鍒犻櫎澶辫触') }) @@ -954,7 +968,8 @@ this.uploadDia = true }, beforeUpload(file, fileList) { - if (file.raw.type != 'text/csv') { + console.log(file.raw.type); + if (file.raw.type != (this.data.inputType===undefined?'text/csv':this.data.inputType)) { this.$message.error('涓婁紶鏂囦欢鏍煎紡涓嶆纭�'); this.$refs.upload.clearFiles() return false; @@ -1082,6 +1097,13 @@ this.$message.error('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁') } }, + getRedColor(label,row){ + if(this.data.cellSpecialStyle&&this.data.cellSpecialStyle.redColorByKey&&label.includes(this.data.cellSpecialStyle.redColorByKey)&&row[(label.replace(this.data.cellSpecialStyle.redColorByKey, ""))]){ + return true + }else{ + return false + } + } } } </script> -- Gitblit v1.9.3