feat: 修改报错提示 以及 显示input的问题
This commit is contained in:
@@ -63,7 +63,6 @@ export default {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler () {
|
||||
console.log(this.chartData)
|
||||
}
|
||||
},
|
||||
chartInfo: {
|
||||
|
||||
@@ -152,7 +152,6 @@ export default {
|
||||
!severityData.P3 && (severityData.P3 = 0)
|
||||
moduleStateData.push({ ...alertTopModules[i], alert: [severityData] })
|
||||
})
|
||||
console.log(moduleStateData)
|
||||
resolve(moduleStateData)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -173,7 +173,6 @@ export default {
|
||||
deep: true,
|
||||
handler (n) {
|
||||
this.init()
|
||||
console.log(n)
|
||||
}
|
||||
},
|
||||
col: { // 列数
|
||||
|
||||
@@ -41,11 +41,13 @@
|
||||
}">
|
||||
<i class="nz-icon nz-icon-arrow-down" :class="expressionsShow[index-1].show?'':'is-active'" @click.stop="showExpression(index)"></i>
|
||||
<el-input
|
||||
@mousedown.stop
|
||||
v-model="expressionName[index-1]"
|
||||
size="small"
|
||||
@input="(val)=>{expressionNameInput(val,index-1)}"
|
||||
@change="expressionNameChange(index-1)" style="width: 120px"
|
||||
@focus="showInput(index-1)"
|
||||
@focus.stop="showInput(index-1,false)"
|
||||
@blur="showInput(index-1,true)"
|
||||
/>
|
||||
<div v-if="expressionsShow[index-1].error" class="el-form-item__error" style="top: 10px;left: 164px"> {{expressionsShow[index-1].error}}</div>
|
||||
</span>
|
||||
@@ -796,13 +798,13 @@ export default {
|
||||
},
|
||||
end (event) {
|
||||
this.expressions = []
|
||||
this.expressionsShow = []
|
||||
this.expressionName = []
|
||||
if (!this.chartConfig.elements.length) {
|
||||
this.addExpression()
|
||||
} else {
|
||||
this.chartConfig.elements.forEach(item => {
|
||||
this.addExpression(item)
|
||||
this.expressions.push(item.expression)
|
||||
this.expressionName.push(item.name)
|
||||
})
|
||||
}
|
||||
this.change()
|
||||
|
||||
@@ -162,10 +162,11 @@ export default {
|
||||
if (this.expressionsShow[index].error) {
|
||||
this.expressionName[index] = this.expressionsShow[index].oldName
|
||||
this.expressionsShow[index].error = ''
|
||||
} else if (!this.expressionName[index]) {
|
||||
this.expressionName[index] = this.expressionsShow[index].oldName
|
||||
} else {
|
||||
this.expressionsShow[index].oldName = this.expressionName[index]
|
||||
}
|
||||
this.expressionsShow[index].hideInput = true
|
||||
this.$refs.chartForm.clearValidate('elements.' + (index - 1) + '.expression')
|
||||
this.expressionChange()
|
||||
},
|
||||
@@ -173,13 +174,15 @@ export default {
|
||||
const findIndex = this.expressionName.indexOf(val)
|
||||
const lastIndex = this.expressionName.lastIndexOf(val)
|
||||
if (findIndex !== -1 && lastIndex != -1 && lastIndex !== findIndex) {
|
||||
this.expressionsShow[index].error = 'The name duplicate'
|
||||
this.expressionsShow[index].error = this.$t('error.nameDuplicate')
|
||||
} else if (!val) {
|
||||
this.expressionsShow[index].error = this.$t('validate.required')
|
||||
} else {
|
||||
this.expressionsShow[index].error = ''
|
||||
}
|
||||
},
|
||||
showInput (index) {
|
||||
this.expressionsShow[index].hideInput = false
|
||||
showInput (index, flag) {
|
||||
this.expressionsShow[index].hideInput = flag
|
||||
},
|
||||
transformNumToLetter (num) { // 相当于26进制 获取id
|
||||
const self = this
|
||||
@@ -220,6 +223,7 @@ export default {
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
getExpressionName () {
|
||||
let name = ''
|
||||
for (let i = 0; i <= this.expressionName.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user