fix : 取消 dashboardTemplate 增加验证
This commit is contained in:
@@ -148,9 +148,6 @@ export default {
|
||||
],
|
||||
sysObjectId: [
|
||||
{ validator: sysObjectIdInput, trigger: 'blur' }
|
||||
],
|
||||
panelId: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: ['blur', 'change'] }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -164,13 +161,6 @@ export default {
|
||||
this.editModel = JSON.parse(JSON.stringify(n))
|
||||
this.editModel.panelId = n.panelId ? n.panelId + '' : ''
|
||||
}
|
||||
},
|
||||
'editModel.panelId': {
|
||||
handler (n) {
|
||||
if (n) {
|
||||
this.$refs.dashboardTemplate.$emit('el.form.change')
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -195,6 +185,9 @@ export default {
|
||||
...this.editModel,
|
||||
panelId: Number(this.editModel.panelId)
|
||||
}
|
||||
if (Number(this.editModel.panelId) == 0) {
|
||||
delete params.panelId
|
||||
}
|
||||
if (this.editModel.id) {
|
||||
this.$put(this.url, params).then(res => {
|
||||
this.prevent_opt.save = false
|
||||
|
||||
@@ -800,9 +800,6 @@ export default {
|
||||
],
|
||||
timeout: [
|
||||
{ validator: nzNumber, trigger: 'blur' }
|
||||
],
|
||||
panelId: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: ['blur', 'change'] }
|
||||
]
|
||||
},
|
||||
projectList: [],
|
||||
@@ -1112,7 +1109,9 @@ export default {
|
||||
}
|
||||
if (valid) {
|
||||
this.prevent_opt.save = true
|
||||
if (Number(this.editModule.panelId) !== 0) {
|
||||
params.panelId = Number(this.editModule.panelId)
|
||||
}
|
||||
if (this.editModule.id) {
|
||||
this.$put('monitor/module', params).then(response => {
|
||||
if (response.code === 200) {
|
||||
@@ -1687,13 +1686,6 @@ export default {
|
||||
this.configsCopyValue = JSON.stringify(params, null, 2)
|
||||
}
|
||||
}
|
||||
},
|
||||
'editModule.panelId': {
|
||||
handler (n) {
|
||||
if (n) {
|
||||
this.$refs.dashboardTemplate.$emit('el.form.change')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user