From 90486bf726407df0e62bf719edba9ca456ebbfe8 Mon Sep 17 00:00:00 2001 From: YUJT Date: Thu, 21 Apr 2022 16:07:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/template/add-or-update.vue.vm | 34 +++++++++---------- .../src/main/resources/template/index.vue.vm | 4 +-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/epmet-cloud-generator/src/main/resources/template/add-or-update.vue.vm b/epmet-cloud-generator/src/main/resources/template/add-or-update.vue.vm index 435224d..154ff11 100644 --- a/epmet-cloud-generator/src/main/resources/template/add-or-update.vue.vm +++ b/epmet-cloud-generator/src/main/resources/template/add-or-update.vue.vm @@ -22,9 +22,9 @@ export default { data () { return { visible: false, - dataForm: {; + dataForm: { #foreach($column in $columns) - ${column.attrname}: ''#if($velocityCount != $columns.size()),;#end + ${column.attrname}: ''#if($velocityCount != $columns.size()),#end #end } @@ -32,12 +32,12 @@ export default { }, computed: { dataRule () { - return {; + return { #foreach($column in $columns) #if($column.columnName != $pk.columnName) ${column.attrname}: [ { required: true, message: this.$t('validate.required'), trigger: 'blur' } - ]#if($velocityCount != $columns.size()),;#end + ]#if($velocityCount != $columns.size()),#end #end #end @@ -46,19 +46,19 @@ export default { }, methods: { init () { - this.visible = true; + this.visible = true this.$nextTick(() => { this.$refs['dataForm'].resetFields() - if (this.dataForm.${pk.attrname}); { + if (this.dataForm.${pk.attrname}) { this.getInfo() } }) }, // 获取信息 getInfo () { - #[[this.$http.get(]];#`/${moduleName}/${pathName}/#[[${]]#this.dataForm.${pk.attrname}}`;).then(({ data: res }) => { + #[[this.$http.get(]]#`/${moduleName}/${pathName}/#[[${]]#this.dataForm.${pk.attrname}}`).then(({ data: res }) => { if (res.code !== 0) { - #[[;return this.$message.error(res.msg);]]# + #[[return this.$message.error(res.msg)]]# } this.dataForm = { ...this.dataForm, @@ -69,19 +69,19 @@ export default { // 表单提交 dataFormSubmitHandle: debounce(function () { #[[this.$refs['dataForm'].validate((valid) => {]]# - if (!valid); { + if (!valid) { return false } - #[[this.$http]];#[!this.dataForm.$;{pk.attrname} ? 'post' : 'put';]('/${moduleName}/${pathName}/', this.dataForm).then(({ data: res }) => { + #[[this.$http]]#[!this.dataForm.${pk.attrname} ? 'post' : 'put']('/${moduleName}/${pathName}/', this.dataForm).then(({ data: res }) => { if (res.code !== 0) { - #[[;return this.$message.error(res.msg);]]# + #[[return this.$message.error(res.msg)]]# } - this.$message({; - #[[message;: this.$t('prompt.success'),;]]# - type;: 'success', - duration;: 500, - onClose;: () => { - this.visible = false; + this.$message({ + #[[message: this.$t('prompt.success'),]]# + type: 'success', + duration: 500, + onClose: () => { + this.visible = false this.$emit('refreshDataList') } }) diff --git a/epmet-cloud-generator/src/main/resources/template/index.vue.vm b/epmet-cloud-generator/src/main/resources/template/index.vue.vm index f2cb759..25aba76 100644 --- a/epmet-cloud-generator/src/main/resources/template/index.vue.vm +++ b/epmet-cloud-generator/src/main/resources/template/index.vue.vm @@ -15,7 +15,7 @@ {{ $t('deleteBatch') }} - + #foreach($column in $columns) @@ -55,7 +55,7 @@ export default { deleteURL: '/${moduleName}/${pathName}', deleteIsBatch: true }, - dataForm: {; + dataForm: { ${pk.attrname}: '' } }