From b403195a75a452b54fe2112158b454f6d80c0e11 Mon Sep 17 00:00:00 2001
From: gaoluyang <gaoluyang@rengu.cc>
Date: 星期四, 11 七月 2024 15:03:55 +0800
Subject: [PATCH] 科学计数法逻辑修改
---
src/components/tool/value-table.vue | 45 +++++++++++++++++++++++++++++++++------------
1 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 0387ae4..0f74844 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 {
@@ -117,7 +120,7 @@
<el-table-column type="index" align="center" label="搴忓彿" width="65" v-if="data.isIndex" :key="Math.random()">
</el-table-column>
<el-table-column :prop="a.label" :label="a.value" :sortable="data.sort==false?false:'custom'"
- v-for="(a, ai) in tableHead" :key="ai" show-overflow-tooltip min-width="155">
+ v-for="(a, ai) in tableHead" :key="ai" show-overflow-tooltip min-width="155" v-if="!data.headNoShow||(data.headNoShow&&data.headNoShow.length==0)||(data.headNoShow&&data.headNoShow.length>0&&!data.headNoShow.find(d=>d==a.label))">
<template slot-scope="scope">
<div v-if="showType(a.label, data.tagField) != null">
<template v-if="typeof(scope.row[a.label]) == 'object'">
@@ -136,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">
@@ -309,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>
@@ -764,6 +767,7 @@
}
this.$message.success('鍒犻櫎鎴愬姛')
this.selectList()
+ this.$emit('delete')
}).catch(e => {
this.$message.error('鍒犻櫎澶辫触')
})
@@ -789,21 +793,30 @@
return
}
}
- this.upLoad = true
for (var a in this.data.selectField) {
if (this.data.selectField[a].choose == true) {
this.upData[a] = JSON.stringify(this.upData[a])
}
}
- this.upHead.forEach((item, index) => {
- if (this.data.cascaderField && this.data.cascaderField[item.label]) {
- if (this.upData[item.label]) {
- this.upData[item.label] = JSON.stringify(this.upData[item.label])
- } else {
- this.upData[item.label] = ''
+ for (var i = 0; i < this.upHead.length; i++) {
+ if(this.upHead[i].label == 'password'){
+ if(this.upData[this.upHead[i].label]){
+ const reg2 =/^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)(?=.*?[~!#@$%^*&()_+{}\[\]|\\;:'",<.>\/?])[a-zA-Z\d~!#@$%^*&()_+{}\[\]|\\;:'",<.>\/?]*$/;
+ if (!reg2.test(this.upData[this.upHead[i].label])) {
+ this.$message.error('瀵嗙爜蹇呴』鍖呮嫭鏁板瓧銆佸ぇ灏忓啓瀛楁瘝浠ュ強鐗规畩瀛楃')
+ return
+ }
}
}
- })
+ if (this.data.cascaderField && this.data.cascaderField[this.upHead[i].label]) {
+ if (this.upData[this.upHead[i].label]) {
+ this.upData[this.upHead[i].label] = JSON.stringify(this.upData[this.upHead[i].label])
+ } else {
+ this.upData[this.upHead[i].label] = ''
+ }
+ }
+ }
+ this.upLoad = true
this.$axios.post(this.upUrl, this.upData, {
headers: {
'Content-Type': 'application/json'
@@ -964,7 +977,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;
@@ -1092,6 +1106,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