From c7e615c7b4c1e29145cb070f015efde5a86bf734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=AF=BA?= <1253070437@qq.com> Date: Sun, 12 Mar 2023 23:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=A2=9E=E5=8A=A0=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E8=B7=9F=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E4=BC=98=EF=BC=8C=E8=A7=A3=E5=86=B3=E4=BA=86?= =?UTF-8?q?iss=E4=B8=AD=E6=8F=90=E5=87=BA=E7=9A=84=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=90=8E=E4=BB=A3=E7=A0=81=E4=B8=8D=E8=83=BD=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=AD=89=E4=B8=80=E7=B3=BB=E5=88=97=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=85=B6=E6=AC=A1=E4=BC=98=E5=8C=96=E5=90=8E=E7=AB=AF=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E7=B1=BB=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/backend/Entity.java.btl | 5 +- .../src/main/resources/frontend/form.vue.btl | 40 ++++----- .../src/main/resources/frontend/index.vue.btl | 86 +++++++++---------- 3 files changed, 60 insertions(+), 71 deletions(-) diff --git a/snowy-plugin/snowy-plugin-gen/src/main/resources/backend/Entity.java.btl b/snowy-plugin/snowy-plugin-gen/src/main/resources/backend/Entity.java.btl index fb54a8e0..5e0d05d1 100644 --- a/snowy-plugin/snowy-plugin-gen/src/main/resources/backend/Entity.java.btl +++ b/snowy-plugin/snowy-plugin-gen/src/main/resources/backend/Entity.java.btl @@ -12,10 +12,7 @@ */ package ${packageName}.${moduleName}.modular.${busName}.entity; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.*; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; diff --git a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl index 00c566fe..a7600641 100644 --- a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl +++ b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl @@ -147,30 +147,28 @@ } // 验证并提交数据 const onSubmit = () => { - formRef.value - .validate() - .then(() => { - submitLoading.value = true - const formDataParam = cloneDeep(formData.value) + formRef.value.validate().then(() => { + submitLoading.value = true + const formDataParam = cloneDeep(formData.value) + <% for(var i = 0; i < configList.~size; i++) { %> + <% if(configList[i].whetherAddUpdate && configList[i].effectType == 'checkbox') { %> + formDataParam.${configList[i].fieldNameCamelCase} = JSON.stringify(formDataParam.${configList[i].fieldNameCamelCase}) + <% } %> + <% } %> + ${classNameFirstLower}Api <% for(var i = 0; i < configList.~size; i++) { %> - <% if(configList[i].whetherAddUpdate && configList[i].effectType == 'checkbox') { %> - formDataParam.${configList[i].fieldNameCamelCase} = JSON.stringify(formDataParam.${configList[i].fieldNameCamelCase}) + <% if(configList[i].needTableId) { %> + .${classNameFirstLower}SubmitForm(formDataParam, !formDataParam.${configList[i].fieldNameCamelCase}) <% } %> <% } %> - ${classNameFirstLower}Api - <% for(var i = 0; i < configList.~size; i++) { %> - <% if(configList[i].needTableId) { %> - .${classNameFirstLower}SubmitForm(formDataParam, !formDataParam.${configList[i].fieldNameCamelCase}) - <% } %> - <% } %> - .then(() => { - onClose() - emit('successful') - }) - .finally(() => { - submitLoading.value = false - }) - }) + .then(() => { + onClose() + emit('successful') + }) + .finally(() => { + submitLoading.value = false + }) + }) } // 抛出函数 defineExpose({ diff --git a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl index cc9eb182..a317144d 100644 --- a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl +++ b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl @@ -8,7 +8,7 @@ <% } %> <% if (searchCount > 0) { %> - + <% for(var i = 0; i < configList.~size; i++) { %> <% if(!configList[i].needTableId && configList[i].needPage) { row ++; %> @@ -37,37 +37,35 @@ <% } %> <% } else { %> - + + <% if(configList[i].effectType == 'input' || configList[i].effectType == 'textarea') { %> + + + + <% } else if (configList[i].effectType == 'select' || configList[i].effectType == 'radio' || configList[i].effectType == 'checkbox') {%> + + + + <% } else if (configList[i].effectType == 'inputNumber' || configList[i].effectType == 'slider') {%> + + + + <% } else if (configList[i].effectType == 'datepicker') {%> + + + + <% } else {%> + + + + <% } %> + <% } %> <% } %> <% } %> 查询 - 重置 + 重置 <% if(searchCount > 3) { %> {{ advanced ? '收起' : '展开' }} @@ -98,7 +96,11 @@ 新增 - 删除 +