Commit 246fb433f2614f09e7f5cafebe3e3e3e030da91b

Authored by zhangdaiscott
1 parent f0c6d33b

vue3代码生成器功能优化,几个bug处理

Showing 12 changed files with 118 additions and 28 deletions
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
... ... @@ -24,7 +24,7 @@
24 24 <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
25 25 <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
26 26 <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
27   - <a-dropdown v-if="checkedKeys.length > 0">
  27 + <a-dropdown v-if="selectedRowKeys.length > 0">
28 28 <template #overlay>
29 29 <a-menu>
30 30 <a-menu-item key="1" @click="batchHandleDelete">
... ... @@ -107,7 +107,8 @@
107 107 url: getExportUrl,
108 108 },
109 109 importConfig: {
110   - url: getImportUrl
  110 + url: getImportUrl,
  111 + success: handleSuccess
111 112 },
112 113 })
113 114  
... ... @@ -146,19 +147,19 @@
146 147 * 删除事件
147 148 */
148 149 async function handleDelete(record) {
149   - await deleteOne({id: record.id}, reload);
  150 + await deleteOne({id: record.id}, handleSuccess);
150 151 }
151 152 /**
152 153 * 批量删除事件
153 154 */
154 155 async function batchHandleDelete() {
155   - await batchDelete({ids: checkedKeys.value}, reload);
  156 + await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
156 157 }
157 158 /**
158 159 * 成功回调
159 160 */
160 161 function handleSuccess() {
161   - reload();
  162 + (selectedRowKeys.value = []) && reload();
162 163 }
163 164 /**
164 165 * 操作栏
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... ... @@ -171,10 +171,14 @@ export const formSchema: FormSchema[] = [
171 171 <#assign form_cat_tree = false>
172 172 <#assign form_cat_back = "">
173 173 <#assign bpm_flag=false>
  174 +<#assign id_exists = false>
174 175 <#list columns as po><#rt/>
175 176 <#if po.fieldDbName=='bpm_status'>
176 177 <#assign bpm_flag=true>
177 178 </#if>
  179 +<#if po.fieldDbName == 'id'>
  180 + <#assign id_exists = true>
  181 +</#if>
178 182 <#if po.isShow =='Y'>
179 183 <#assign form_field_dictCode="">
180 184 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
... ... @@ -351,4 +355,13 @@ export const formSchema: FormSchema[] = [
351 355 },
352 356 </#if>
353 357 </#list>
  358 +<#if id_exists == false>
  359 + // TODO 主键隐藏字段,目前写死为ID
  360 + {
  361 + label: '',
  362 + field: 'id',
  363 + component: 'Input',
  364 + show: false
  365 + },
  366 +</#if>
354 367 ];
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... ... @@ -171,10 +171,14 @@ export const formSchema: FormSchema[] = [
171 171 <#assign form_cat_tree = false>
172 172 <#assign form_cat_back = "">
173 173 <#assign bpm_flag=false>
  174 +<#assign id_exists = false>
174 175 <#list columns as po><#rt/>
175 176 <#if po.fieldDbName=='bpm_status'>
176 177 <#assign bpm_flag=true>
177 178 </#if>
  179 +<#if po.fieldDbName == 'id'>
  180 + <#assign id_exists = true>
  181 +</#if>
178 182 <#if po.isShow =='Y'>
179 183 <#assign form_field_dictCode="">
180 184 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
... ... @@ -351,4 +355,13 @@ export const formSchema: FormSchema[] = [
351 355 },
352 356 </#if>
353 357 </#list>
  358 +<#if id_exists == false>
  359 + // TODO 主键隐藏字段,目前写死为ID
  360 + {
  361 + label: '',
  362 + field: 'id',
  363 + component: 'Input',
  364 + show: false
  365 + },
  366 +</#if>
354 367 ];
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
... ... @@ -122,7 +122,8 @@
122 122 url: getExportUrl,
123 123 },
124 124 importConfig: {
125   - url: getImportUrl
  125 + url: getImportUrl,
  126 + success: handleSuccess
126 127 },
127 128 })
128 129  
... ... @@ -164,19 +165,19 @@
164 165 * 删除事件
165 166 */
166 167 async function handleDelete(record) {
167   - await deleteOne({id: record.id}, reload);
  168 + await deleteOne({id: record.id}, handleSuccess);
168 169 }
169 170 /**
170 171 * 批量删除事件
171 172 */
172 173 async function batchHandleDelete() {
173   - await batchDelete({ids: selectedRowKeys.value}, reload);
  174 + await batchDelete({ids: selectedRowKeys.value},handleSuccess);
174 175 }
175 176 /**
176 177 * 成功回调
177 178 */
178 179 function handleSuccess() {
179   - reload();
  180 + (selectedRowKeys.value = []) && reload();
180 181 }
181 182 /**
182 183 * 操作栏
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... ... @@ -169,10 +169,14 @@ export const formSchema: FormSchema[] = [
169 169 <#assign form_cat_tree = false>
170 170 <#assign form_cat_back = "">
171 171 <#assign bpm_flag=false>
  172 +<#assign id_exists = false>
172 173 <#list columns as po><#rt/>
173 174 <#if po.fieldDbName=='bpm_status'>
174 175 <#assign bpm_flag=true>
175 176 </#if>
  177 +<#if po.fieldDbName == 'id'>
  178 + <#assign id_exists = true>
  179 +</#if>
176 180 <#if po.isShow =='Y'>
177 181 <#assign form_field_dictCode="">
178 182 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
... ... @@ -349,6 +353,15 @@ export const formSchema: FormSchema[] = [
349 353 },
350 354 </#if>
351 355 </#list>
  356 +<#if id_exists == false>
  357 + // TODO 主键隐藏字段,目前写死为ID
  358 + {
  359 + label: '',
  360 + field: 'id',
  361 + component: 'Input',
  362 + show: false
  363 + },
  364 +</#if>
352 365 ];
353 366  
354 367 <#list subTables as sub>
... ... @@ -421,6 +434,15 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
421 434 <#assign form_cat_back = "">
422 435 <#assign bpm_flag=false>
423 436 <#list sub.originalColumns as po><#rt/>
  437 +<#if po.fieldName == 'id'>
  438 + // TODO 子表隐藏字段,目前写死为ID
  439 + {
  440 + label: '',
  441 + field: 'id',
  442 + component: 'Input',
  443 + show: false
  444 + },
  445 +</#if>
424 446 <#if po.isShow =='Y'>
425 447 <#assign form_field_dictCode="">
426 448 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/[1-n]List.vuei
... ... @@ -117,23 +117,21 @@
117 117 * 删除事件
118 118 */
119 119 async function handleDelete(record) {
120   - await ${sub.entityName?uncap_first}Delete({id: record.id}, reload);
  120 + await ${sub.entityName?uncap_first}Delete({id: record.id}, handleSuccess);
121 121 }
122 122  
123 123 /**
124 124 * 批量删除事件
125 125 */
126 126 async function batchHandleDelete() {
127   - await ${sub.entityName?uncap_first}DeleteBatch({ids: selectedRowKeys.value}, () => {
128   - reload()
129   - })
  127 + await ${sub.entityName?uncap_first}DeleteBatch({ids: selectedRowKeys.value}, handleSuccess)
130 128 }
131 129  
132 130 /**
133 131 * 成功回调
134 132 */
135 133 function handleSuccess() {
136   - reload();
  134 + (selectedRowKeys.value = []) && reload();
137 135 }
138 136  
139 137 /**
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
... ... @@ -125,7 +125,8 @@
125 125 url: getExportUrl,
126 126 },
127 127 importConfig: {
128   - url: getImportUrl
  128 + url: getImportUrl,
  129 + success: handleSuccess
129 130 },
130 131 })
131 132  
... ... @@ -172,19 +173,19 @@
172 173 * 删除事件
173 174 */
174 175 async function handleDelete(record) {
175   - await deleteOne({id: record.id}, reload);
  176 + await deleteOne({id: record.id}, handleSuccess);
176 177 }
177 178 /**
178 179 * 批量删除事件
179 180 */
180 181 async function batchHandleDelete() {
181   - await batchDelete({ids: selectedRowKeys.value}, reload);
  182 + await batchDelete({ids: selectedRowKeys.value},handleSuccess);
182 183 }
183 184 /**
184 185 * 成功回调
185 186 */
186 187 function handleSuccess() {
187   - reload();
  188 + (selectedRowKeys.value = []) && reload();
188 189 }
189 190 /**
190 191 * 操作栏
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... ... @@ -172,10 +172,14 @@ export const formSchema: FormSchema[] = [
172 172 <#assign form_cat_tree = false>
173 173 <#assign form_cat_back = "">
174 174 <#assign bpm_flag=false>
  175 +<#assign id_exists = false>
175 176 <#list columns as po><#rt/>
176 177 <#if po.fieldDbName=='bpm_status'>
177 178 <#assign bpm_flag=true>
178 179 </#if>
  180 +<#if po.fieldDbName == 'id'>
  181 + <#assign id_exists = true>
  182 +</#if>
179 183 <#if po.isShow =='Y'>
180 184 <#assign form_field_dictCode="">
181 185 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
... ... @@ -352,6 +356,15 @@ export const formSchema: FormSchema[] = [
352 356 },
353 357 </#if>
354 358 </#list>
  359 +<#if id_exists == false>
  360 + // TODO 主键隐藏字段,目前写死为ID
  361 + {
  362 + label: '',
  363 + field: 'id',
  364 + component: 'Input',
  365 + show: false
  366 + },
  367 +</#if>
355 368 ];
356 369 //子表单数据
357 370 <#list subTables as sub>
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
... ... @@ -24,7 +24,7 @@
24 24 <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
25 25 <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
26 26 <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
27   - <a-dropdown v-if="checkedKeys.length > 0">
  27 + <a-dropdown v-if="selectedRowKeys.length > 0">
28 28 <template #overlay>
29 29 <a-menu>
30 30 <a-menu-item key="1" @click="batchHandleDelete">
... ... @@ -107,7 +107,8 @@
107 107 url: getExportUrl,
108 108 },
109 109 importConfig: {
110   - url: getImportUrl
  110 + url: getImportUrl,
  111 + success: handleSuccess
111 112 },
112 113 })
113 114  
... ... @@ -146,19 +147,19 @@
146 147 * 删除事件
147 148 */
148 149 async function handleDelete(record) {
149   - await deleteOne({id: record.id}, reload);
  150 + await deleteOne({id: record.id}, handleSuccess);
150 151 }
151 152 /**
152 153 * 批量删除事件
153 154 */
154 155 async function batchHandleDelete() {
155   - await batchDelete({ids: checkedKeys.value}, reload);
  156 + await batchDelete({ids: selectedRowKeys.value},handleSuccess);
156 157 }
157 158 /**
158 159 * 成功回调
159 160 */
160 161 function handleSuccess() {
161   - reload();
  162 + (selectedRowKeys.value = []) && reload();
162 163 }
163 164 /**
164 165 * 操作栏
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... ... @@ -172,10 +172,14 @@ export const formSchema: FormSchema[] = [
172 172 <#assign form_cat_tree = false>
173 173 <#assign form_cat_back = "">
174 174 <#assign bpm_flag=false>
  175 +<#assign id_exists = false>
175 176 <#list columns as po><#rt/>
176 177 <#if po.fieldDbName=='bpm_status'>
177 178 <#assign bpm_flag=true>
178 179 </#if>
  180 +<#if po.fieldDbName == 'id'>
  181 + <#assign id_exists = true>
  182 +</#if>
179 183 <#if po.isShow =='Y'>
180 184 <#assign form_field_dictCode="">
181 185 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
... ... @@ -352,6 +356,15 @@ export const formSchema: FormSchema[] = [
352 356 },
353 357 </#if>
354 358 </#list>
  359 +<#if id_exists == false>
  360 + // TODO 主键隐藏字段,目前写死为ID
  361 + {
  362 + label: '',
  363 + field: 'id',
  364 + component: 'Input',
  365 + show: false
  366 + },
  367 +</#if>
355 368 ];
356 369 //子表单数据
357 370 <#list subTables as sub>
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
... ... @@ -24,7 +24,7 @@
24 24 <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
25 25 <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
26 26 <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
27   - <a-dropdown v-if="checkedKeys.length > 0">
  27 + <a-dropdown v-if="selectedRowKeys.length > 0">
28 28 <template #overlay>
29 29 <a-menu>
30 30 <a-menu-item key="1" @click="batchHandleDelete">
... ... @@ -107,7 +107,8 @@
107 107 url: getExportUrl,
108 108 },
109 109 importConfig: {
110   - url: getImportUrl
  110 + url: getImportUrl,
  111 + success: handleSuccess
111 112 },
112 113 })
113 114  
... ... @@ -146,19 +147,19 @@
146 147 * 删除事件
147 148 */
148 149 async function handleDelete(record) {
149   - await deleteOne({id: record.id}, reload);
  150 + await deleteOne({id: record.id}, handleSuccess);
150 151 }
151 152 /**
152 153 * 批量删除事件
153 154 */
154 155 async function batchHandleDelete() {
155   - await batchDelete({ids: checkedKeys.value}, reload);
  156 + await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
156 157 }
157 158 /**
158 159 * 成功回调
159 160 */
160 161 function handleSuccess() {
161   - reload();
  162 + (selectedRowKeys.value = []) && reload();
162 163 }
163 164 /**
164 165 * 操作栏
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... ... @@ -172,10 +172,14 @@ export const formSchema: FormSchema[] = [
172 172 <#assign form_cat_tree = false>
173 173 <#assign form_cat_back = "">
174 174 <#assign bpm_flag=false>
  175 +<#assign id_exists = false>
175 176 <#list columns as po><#rt/>
176 177 <#if po.fieldDbName=='bpm_status'>
177 178 <#assign bpm_flag=true>
178 179 </#if>
  180 +<#if po.fieldDbName == 'id'>
  181 + <#assign id_exists = true>
  182 +</#if>
179 183 <#if po.isShow =='Y'>
180 184 <#assign form_field_dictCode="">
181 185 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
... ... @@ -352,6 +356,15 @@ export const formSchema: FormSchema[] = [
352 356 },
353 357 </#if>
354 358 </#list>
  359 +<#if id_exists == false>
  360 + // TODO 主键隐藏字段,目前写死为ID
  361 + {
  362 + label: '',
  363 + field: 'id',
  364 + component: 'Input',
  365 + show: false
  366 + },
  367 +</#if>
355 368 ];
356 369 //子表单数据
357 370 <#list subTables as sub>
... ...