|
@@ -18,24 +18,27 @@
|
|
height="500px"
|
|
height="500px"
|
|
>
|
|
>
|
|
<el-table-column :label="$t('Edb.Detail.e_id')" align="center" prop="IndexCode"/>
|
|
<el-table-column :label="$t('Edb.Detail.e_id')" align="center" prop="IndexCode"/>
|
|
- <el-table-column :label="$t('Edb.Detail.e_name')" align="center">
|
|
|
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_name')" align="center" width="210px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
|
+ <div class="name-cell">
|
|
<el-input
|
|
<el-input
|
|
v-model="scope.row.IndexName"
|
|
v-model="scope.row.IndexName"
|
|
placeholder="请填写指标名称"
|
|
placeholder="请填写指标名称"
|
|
- style="width:100%"
|
|
|
|
|
|
+ style="width:100%;margin:5px 0;"
|
|
|
|
+ :class="existNameArr.includes(scope.row.IndexName)&&'error-ipt'"
|
|
/>
|
|
/>
|
|
- <div class="error">
|
|
|
|
- <!-- <span>指标名称已存在,请重新填写</span> -->
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="error" v-if="existNameArr.includes(scope.row.IndexName)">
|
|
|
|
+ <span>指标名称已存在,请重新填写</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column :label="$t('Edb.Detail.e_unit')" align="center" width="200px">
|
|
|
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_unit')" align="center" width="150px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<selectUnit v-model="scope.row.Unit"/>
|
|
<selectUnit v-model="scope.row.Unit"/>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column :label="$t('Edb.Detail.e_fre')" align="center" width="200px">
|
|
|
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_fre')" align="center" width="120px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-select
|
|
<el-select
|
|
v-model="scope.row.Frequency"
|
|
v-model="scope.row.Frequency"
|
|
@@ -51,8 +54,8 @@
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column align="center" width="300px">
|
|
|
|
- <template slot="header">
|
|
|
|
|
|
+ <el-table-column align="center" width="280px">
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
<span style="margin-right:40px;display:inline-block">目录</span>
|
|
<span style="margin-right:40px;display:inline-block">目录</span>
|
|
<el-radio-group
|
|
<el-radio-group
|
|
v-model="classifyType"
|
|
v-model="classifyType"
|
|
@@ -117,6 +120,8 @@ export default {
|
|
checkStrictly: true,
|
|
checkStrictly: true,
|
|
emitPath:false
|
|
emitPath:false
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ existNameArr:[]
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -151,6 +156,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
cancelHandle() {
|
|
cancelHandle() {
|
|
|
|
+ this.existNameArr = [];
|
|
this.$emit('update:isShow',false)
|
|
this.$emit('update:isShow',false)
|
|
},
|
|
},
|
|
|
|
|
|
@@ -176,16 +182,16 @@ export default {
|
|
this.tableData.map(_=>({EdbCode:_.IndexCode,EdbName:_.IndexName}))
|
|
this.tableData.map(_=>({EdbCode:_.IndexCode,EdbName:_.IndexName}))
|
|
).then(res=>{
|
|
).then(res=>{
|
|
if(res.Ret!==200) return
|
|
if(res.Ret!==200) return
|
|
- this.existNameArr = res.Data.filter(i=>i.Exist)
|
|
|
|
|
|
+ this.existNameArr = res.Data.filter(i=>i.Exist).map(_=>_.EdbName)
|
|
|
|
|
|
- if(this.existNameArr.length) return
|
|
|
|
|
|
+ if(this.existNameArr.length) return
|
|
this.handleSave()
|
|
this.handleSave()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
handleSave() {
|
|
handleSave() {
|
|
|
|
|
|
- let haveIncomplete = this.tableData.some(_ => !_.IndexName||!_.ClassifyId)
|
|
|
|
|
|
+ let haveIncomplete = this.tableData.some(_ => !_.IndexName||!_.ClassifyId||!_.Unit)
|
|
if(haveIncomplete) return this.$message.warning('指标信息填写不完整')
|
|
if(haveIncomplete) return this.$message.warning('指标信息填写不完整')
|
|
|
|
|
|
this.saveLoading = true;
|
|
this.saveLoading = true;
|
|
@@ -211,10 +217,28 @@ export default {
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.add-dialog-wrap {
|
|
|
|
+ .name-cell {
|
|
|
|
+ position: relative;
|
|
|
|
+ .error {
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: -16px;
|
|
|
|
+ color: #f00;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.add-dialog-wrap {
|
|
.add-dialog-wrap {
|
|
- .el-cascader .el-input{
|
|
|
|
|
|
+ .error-ipt .el-input__inner{
|
|
|
|
+ border-color: #f00;
|
|
|
|
+ }
|
|
|
|
+ .el-cascader .el-input{
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
+ .el-table .cell {
|
|
|
|
+ overflow: visible;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|