diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm index ac0c2b2c8..753cd25e5 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -165,7 +165,7 @@ - + #foreach($column in $columns) #set($field=$column.javaField) @@ -467,7 +467,7 @@ export default { }, /** 提交按钮 */ submitForm() { - this.#[[$]]#refs["form"].validate(valid => { + this.#[[$]]#refs["form"].validate((valid, obj) => { if (valid) { this.buttonLoading = true; #foreach ($column in $columns) @@ -492,6 +492,13 @@ export default { this.buttonLoading = false; }); } + } else { + const a = []; + for (let key in obj) { + a.push(obj[key][0].message); + } + this.$modal.msgError(a[0]); + return false; } }); }, @@ -511,3 +518,23 @@ export default { } }; + + diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm index 7a597f389..d7eed7575 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -180,7 +180,7 @@ /> - + #foreach($column in $columns) #set($field=$column.javaField) @@ -520,7 +520,7 @@ export default { }, /** 提交按钮 */ submitForm() { - this.#[[$]]#refs["form"].validate(valid => { + this.#[[$]]#refs["form"].validate((valid, obj) => { if (valid) { this.buttonLoading = true; #foreach ($column in $columns) @@ -548,6 +548,13 @@ export default { this.buttonLoading = false; }); } + } else { + const a = []; + for (let key in obj) { + a.push(obj[key][0].message); + } + this.$modal.msgError(a[0]); + return false; } }); }, @@ -607,3 +614,24 @@ export default { } }; + + + diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm index 6776687d9..2192f4be2 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -159,7 +159,7 @@ - + #foreach($column in $columns) #set($field=$column.javaField) @@ -447,7 +447,7 @@ async function handleUpdate(row) { /** 提交按钮 */ function submitForm() { - proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => { + proxy.#[[$]]#refs["${businessName}Ref"].validate((valid, obj) => { if (valid) { buttonLoading.value = true; #foreach ($column in $columns) @@ -472,6 +472,13 @@ function submitForm() { buttonLoading.value = false; }); } + } else { + const a = []; + for (let key in obj) { + a.push(obj[key][0].message); + } + this.$modal.msgError(a[0]); + return false; } }); } @@ -492,3 +499,23 @@ function handleDelete(row) { getList(); + + diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm index 6c9cdd612..6615b376c 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm @@ -173,7 +173,7 @@ /> - + #foreach($column in $columns) #set($field=$column.javaField) @@ -511,7 +511,7 @@ function handleUpdate(row) { /** 提交按钮 */ function submitForm() { - proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => { + proxy.#[[$]]#refs["${businessName}Ref"].validate((valid, obj) => { if (valid) { buttonLoading.value = true; #foreach ($column in $columns) @@ -539,6 +539,13 @@ function submitForm() { buttonLoading.value = false; }); } + } else { + const a = []; + for (let key in obj) { + a.push(obj[key][0].message); + } + this.$modal.msgError(a[0]); + return false; } }); } @@ -604,3 +611,24 @@ function handleExport() { getList(); + + + diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 1e0144f40..5556cf521 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -73,6 +73,10 @@ DictData.install() * please remove it before going online! ! ! */ + +// 修改 el-dialog 默认点击遮照为不关闭 +Element.Dialog.props.closeOnClickModal.default = false + Vue.use(Element, { size: Cookies.get('size') || 'medium' // set element-ui default size })