diff options
| author | 刘洪洪 <[email protected]> | 2024-11-21 14:59:00 +0800 |
|---|---|---|
| committer | 刘洪洪 <[email protected]> | 2024-11-21 14:59:00 +0800 |
| commit | b567592cfe942e1c8fac370b4ca5e88356a643de (patch) | |
| tree | 08132beca05b0bc5b2e8fd863a3a0feb7d2d9cc1 | |
| parent | 872182dd06a7daf7396874ea8586aee823ecccef (diff) | |
fix: 修复source编辑时校验提示为空的问题
| -rw-r--r-- | src/mixins/data-list.js | 5 | ||||
| -rw-r--r-- | src/views/setting/sources/SourcesForm.vue | 15 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/mixins/data-list.js b/src/mixins/data-list.js index 9e534ed5..6b0f18a0 100644 --- a/src/mixins/data-list.js +++ b/src/mixins/data-list.js @@ -90,13 +90,12 @@ export default { this.batchDeleteObjs.push(obj) } }) - if (this.batchDeleteObjs.length > 1) { - this.disableEdit = true - } else this.disableEdit = objs[0]?.usage > 0 + this.disableEdit = this.batchDeleteObjs.length !== 1 this.disableDelete = this.batchDeleteObjs.length < 1 const obj = objs.find(d => d.usage > 0) if (obj) { this.disableDelete = true + this.disableEdit = true } }, getTableData (params, isAll, isClearType) { diff --git a/src/views/setting/sources/SourcesForm.vue b/src/views/setting/sources/SourcesForm.vue index de67a156..0e13086b 100644 --- a/src/views/setting/sources/SourcesForm.vue +++ b/src/views/setting/sources/SourcesForm.vue @@ -339,14 +339,25 @@ export default { if (valid1 && valid2) { this.sourceObj.fields = JSON.stringify(this.sourceObj.fieldsData.data) this.sourceObj.lookups = JSON.stringify(this.sourceObj.lookupsData.data) - if (this.sourceObj.fieldsData.data.length === 0 || this.sourceObj.lookupsData.data.length > 0) { + if (this.sourceObj.fieldsData.data.length === 0) { ElMessageBox.alert(this.$t('detection.create.informationFilled'), this.$t('overall.tip'), { confirmButtonText: 'OK', callback: () => {} }) - this.$refs.lookupsForm.validate(() => null) return true } + if (this.sourceObj.lookupsData.data.length > 0) { + const valid3 = await this.$refs.lookupsForm.validate((valid) => { + return valid + }) + if (!valid3) { + ElMessageBox.alert(this.$t('detection.create.informationFilled'), this.$t('overall.tip'), { + confirmButtonText: 'OK', + callback: () => {} + }) + return true + } + } delete this.sourceObj.enable this.myLoading = true if (!this.sourceId) { |
