Explorar el Código

优化错误处理逻辑,确保 snackbar 显示更具体的错误信息;更新元数据提交逻辑,添加重复检查并引导用户前往审核页面。

Xiao_123 hace 6 horas
padre
commit
b83663a050

+ 1 - 1
src/views/dataGovernance/businessDomain/components/edit.vue

@@ -275,7 +275,7 @@ export default {
         this.$snackbar.success('保存成功')
         this.$emit('close')
       } catch (error) {
-        this.$snackbar.error(error)
+        this.$snackbar.error(error?.message || error)
       } finally {
         this.overlay = false
       }

+ 1 - 1
src/views/dataGovernance/businessDomain/index.vue

@@ -211,7 +211,7 @@ export default {
         this.showCombination = false
         this.init()
       } catch (error) {
-        this.$snackbar.error(error)
+        this.$snackbar.error(error?.message || error)
       }
     }
   }

+ 9 - 4
src/views/dataGovernance/metadata/index.vue

@@ -189,17 +189,22 @@ export default {
         this.$snackbar.error(error)
       }
     },
+    // 创建/编辑元数据
     async handleSubmit () {
       const obj = this.$refs.form.getValue()
       if (!obj) {
         return
       }
+      const apiFn = obj.id ? api.metadataUpdate : api.metadataAdd
       try {
         this.submitLoading = true
-        if (obj.id) {
-          await api.metadataUpdate(obj)
-        } else {
-          await api.metadataAdd(obj)
+        const { message } = await apiFn(obj)
+        if (message.includes('重复') || message.includes('疑似重复')) {
+          this.show = false
+          this.$confirm('系统提示', '当前创建的元数据与已存在的元数据疑似重复,是否前往审核页面?').then(async () => {
+            this.$router.push('/dataReview')
+          })
+          return
         }
         this.$snackbar.success('操作成功')
         this.show = false