|
@@ -189,17 +189,22 @@ export default {
|
|
|
this.$snackbar.error(error)
|
|
this.$snackbar.error(error)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 创建/编辑元数据
|
|
|
async handleSubmit () {
|
|
async handleSubmit () {
|
|
|
const obj = this.$refs.form.getValue()
|
|
const obj = this.$refs.form.getValue()
|
|
|
if (!obj) {
|
|
if (!obj) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ const apiFn = obj.id ? api.metadataUpdate : api.metadataAdd
|
|
|
try {
|
|
try {
|
|
|
this.submitLoading = true
|
|
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.$snackbar.success('操作成功')
|
|
|
this.show = false
|
|
this.show = false
|