From 43ef195543c087d88ac3eea98067b81d7e2b10c2 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 03 七月 2023 16:54:09 +0800 Subject: [PATCH] Merge branch '2.6.8' into wvp-28181-2.0 --- web_src/src/components/dialog/catalogEdit.vue | 59 +++++++++++++++++++++++++++++------------------------------ 1 files changed, 29 insertions(+), 30 deletions(-) diff --git a/web_src/src/components/dialog/catalogEdit.vue b/web_src/src/components/dialog/catalogEdit.vue index e2fe59b..9a5e3a3 100644 --- a/web_src/src/components/dialog/catalogEdit.vue +++ b/web_src/src/components/dialog/catalogEdit.vue @@ -12,15 +12,6 @@ > <div id="shared" style="margin-top: 1rem;margin-right: 100px;"> <el-form ref="form" :rules="rules" :model="form" label-width="140px" > -<!-- <el-form-item >--> -<!-- 寤鸿鐨勭被鍨嬶細--> -<!-- <br/>--> -<!--   琛屾斂鍖哄垝锛堝彲閫�2浣�/4浣�/6浣�/8浣�/10浣嶆暟瀛楋紝渚嬪锛�130432锛岃〃绀烘渤鍖楃渷閭兏甯傚箍骞冲幙锛�--> -<!-- <br/>--> -<!--   涓氬姟鍒嗙粍锛堢11銆�12銆�13浣�215锛屼緥濡傦細34020000002150000001锛�--> -<!-- <br/>--> -<!--   铏氭嫙缁勭粐锛堢11銆�12銆�13浣�216锛屼緥濡傦細34020000002160000001锛�--> -<!-- </el-form-item>--> <el-form-item label="鑺傜偣缂栧彿" prop="id" > <el-input v-model="form.id" :disabled="isEdit" clearable></el-input> </el-form-item> @@ -63,7 +54,11 @@ return callback(new Error('琛屾斂鍖哄垝缂栧彿蹇呴』涓�2/4/6/8浣�')); } if (this.form.parentId !== this.platformDeviceId && this.form.parentId.length >= value.trim().length) { - return callback(new Error('琛屾斂鍖哄垝缂栧彿闀垮害搴旇姣忔涓や綅閫掑')); + if (this.form.parentId.length === 20) { + return callback(new Error('涓氬姟鍒嗙粍/铏氭嫙缁勭粐涓嬩笉鍙垱寤鸿鏀垮尯鍒�')); + }else { + return callback(new Error('琛屾斂鍖哄垝缂栧彿闀垮害搴旇姣忔涓や綅閫掑')); + } } }else { if (value.trim().length !== 20) { @@ -122,27 +117,31 @@ this.level = level; }, onSubmit: function () { - console.log("onSubmit"); - console.log(this.form); - this.$axios({ - method:"post", - url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`, - data: this.form - }).then((res)=> { - if (res.data.code === 0) { - if (this.submitCallback)this.submitCallback(this.form) - }else { - this.$message({ - showClose: true, - message: res.data.msg, - type: "error", + this.$refs["form"].validate((valid) => { + if (valid) { + this.$axios({ + method:"post", + url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`, + data: this.form + }).then((res)=> { + if (res.data.code === 0) { + if (this.submitCallback)this.submitCallback(this.form) + }else { + this.$message({ + showClose: true, + message: res.data.msg, + type: "error", + }); + } + this.close(); + }) + .catch((error)=> { + console.log(error); }); - } - this.close(); - }) - .catch((error)=> { - console.log(error); - }); + } else { + return false; + } + }); }, close: function () { this.isEdit = false; -- Gitblit v1.8.0