Commit d5e19d1623475da4ee8ed073ffb49205ddcde721
1 parent
baae587b
vue3代码生成器模板优化
Showing
15 changed files
with
269 additions
and
62 deletions
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
... | ... | @@ -77,6 +77,9 @@ |
77 | 77 | import { getAuthCache, setAuthCache } from '/@/utils/auth'; |
78 | 78 | import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum'; |
79 | 79 | </#if> |
80 | + <#if bpm_flag==true> | |
81 | + import { startProcess } from '/@/api/common/api'; | |
82 | + </#if> | |
80 | 83 | const checkedKeys = ref<Array<string | number>>([]); |
81 | 84 | //注册model |
82 | 85 | const [registerModal, {openModal}] = useModal(); |
... | ... | @@ -196,19 +199,61 @@ |
196 | 199 | * 下拉操作栏 |
197 | 200 | */ |
198 | 201 | function getDropDownAction(record){ |
199 | - return [ | |
200 | - { | |
201 | - label: '详情', | |
202 | - onClick: handleDetail.bind(null, record), | |
203 | - }, { | |
204 | - label: '删除', | |
205 | - popConfirm: { | |
206 | - title: '是否确认删除', | |
207 | - confirm: handleDelete.bind(null, record), | |
208 | - } | |
202 | +<#if bpm_flag==true> | |
203 | + let dropDownAction = [ | |
204 | + { | |
205 | + label: '详情', | |
206 | + onClick: handleDetail.bind(null, record), | |
207 | + }, { | |
208 | + label: '删除', | |
209 | + popConfirm: { | |
210 | + title: '是否确认删除', | |
211 | + confirm: handleDelete.bind(null, record), | |
212 | + } | |
213 | + } | |
214 | + ]; | |
215 | + if(record.bpmStatus == '1'){ | |
216 | + dropDownAction.push({ | |
217 | + label: '发起流程', | |
218 | + popConfirm: { | |
219 | + title: '确认提交流程吗?', | |
220 | + confirm: handleProcess.bind(null, record), | |
221 | + } | |
222 | + }) | |
223 | + } | |
224 | + return dropDownAction; | |
225 | +<#else> | |
226 | + return [ | |
227 | + { | |
228 | + label: '详情', | |
229 | + onClick: handleDetail.bind(null, record), | |
230 | + }, { | |
231 | + label: '删除', | |
232 | + popConfirm: { | |
233 | + title: '是否确认删除', | |
234 | + confirm: handleDelete.bind(null, record), | |
209 | 235 | } |
210 | - ] | |
236 | + } | |
237 | + ] | |
238 | +</#if> | |
211 | 239 | } |
240 | + | |
241 | + <#if bpm_flag==true> | |
242 | + /** | |
243 | + * 提交流程 | |
244 | + */ | |
245 | + async function handleProcess(record) { | |
246 | + let params = { | |
247 | + flowCode: 'dev_${tableName}_001', | |
248 | + id: record.id, | |
249 | + formUrl: '${entityPackage}/modules/${entityName}Form', | |
250 | + formUrlMobile: '' | |
251 | + } | |
252 | + await startProcess(params); | |
253 | + handleSuccess(); | |
254 | + } | |
255 | + </#if> | |
256 | + | |
212 | 257 | <#if list_need_category> |
213 | 258 | /** |
214 | 259 | * 初始化字典配置 |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi
1 | 1 | import {defHttp} from '/@/utils/http/axios'; |
2 | -import {Modal} from 'ant-design-vue'; | |
2 | +import { useMessage } from "/@/hooks/web/useMessage"; | |
3 | + | |
4 | +const { createConfirm } = useMessage(); | |
3 | 5 | |
4 | 6 | enum Api { |
5 | 7 | list = '/${entityPackage}/${entityName?uncap_first}/list', |
... | ... | @@ -39,7 +41,8 @@ export const deleteOne = (params,handleSuccess) => { |
39 | 41 | * @param params |
40 | 42 | */ |
41 | 43 | export const batchDelete = (params, handleSuccess) => { |
42 | - Modal.confirm({ | |
44 | + createConfirm({ | |
45 | + iconType: 'warning', | |
43 | 46 | title: '确认删除', |
44 | 47 | content: '是否删除选中数据', |
45 | 48 | okText: '确认', |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... | ... | @@ -122,7 +122,8 @@ export const searchFormSchema: FormSchema[] = [ |
122 | 122 | <#elseif po.classType=='datetime'> |
123 | 123 | component: 'DatePicker', |
124 | 124 | componentProps: { |
125 | - showTime:true | |
125 | + showTime:true, | |
126 | + valueFormat: 'YYYY-MM-DD HH:mm:ss' | |
126 | 127 | }, |
127 | 128 | <#elseif po.classType =='time'> |
128 | 129 | component: 'TimePicker', |
... | ... | @@ -194,6 +195,15 @@ export const formSchema: FormSchema[] = [ |
194 | 195 | { |
195 | 196 | label: '${po.filedComment}', |
196 | 197 | field: ${autoStringSuffix(po)}, |
198 | + <#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> | |
199 | + <#if po.defaultVal??> | |
200 | + <#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int"> | |
201 | + defaultValue: ${po.defaultVal}, | |
202 | + <#else> | |
203 | + defaultValue: "${po.defaultVal}", | |
204 | + </#if> | |
205 | + </#if> | |
206 | + <#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> | |
197 | 207 | <#if po.classType =='date'> |
198 | 208 | component: 'DatePicker', |
199 | 209 | <#elseif po.classType =='datetime'> |
... | ... | @@ -324,7 +334,7 @@ export const formSchema: FormSchema[] = [ |
324 | 334 | { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, |
325 | 335 | <#-- 邮政编码 --> |
326 | 336 | <#elseif fieldValidType == 'p'> |
327 | - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
337 | + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
328 | 338 | <#-- 字母 --> |
329 | 339 | <#elseif fieldValidType == 's'> |
330 | 340 | { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi
1 | 1 | import { defHttp } from '/@/utils/http/axios'; |
2 | -import { Modal } from 'ant-design-vue'; | |
2 | +import { useMessage } from "/@/hooks/web/useMessage"; | |
3 | + | |
4 | +const { createConfirm } = useMessage(); | |
3 | 5 | |
4 | 6 | enum Api { |
5 | 7 | list = '/${entityPackage}/${entityName?uncap_first}/list', |
... | ... | @@ -45,7 +47,8 @@ export const deleteOne = (params,handleSuccess) => { |
45 | 47 | * @param handleSuccess |
46 | 48 | */ |
47 | 49 | export const batchDelete = (params, handleSuccess) => { |
48 | - Modal.confirm({ | |
50 | + createConfirm({ | |
51 | + iconType: 'warning', | |
49 | 52 | title: '确认删除', |
50 | 53 | content: '是否删除选中数据', |
51 | 54 | okText: '确认', |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi
... | ... | @@ -324,7 +324,7 @@ export const formSchema: FormSchema[] = [ |
324 | 324 | { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, |
325 | 325 | <#-- 邮政编码 --> |
326 | 326 | <#elseif fieldValidType == 'p'> |
327 | - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
327 | + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
328 | 328 | <#-- 字母 --> |
329 | 329 | <#elseif fieldValidType == 's'> |
330 | 330 | { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei
... | ... | @@ -64,6 +64,7 @@ |
64 | 64 | const emit = defineEmits(['register', 'ok']); |
65 | 65 | const formData = reactive<Record<string, any>>({ |
66 | 66 | <#list columns as po> |
67 | + id: '', | |
67 | 68 | <#if po.isShow == 'Y'> |
68 | 69 | <#if po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'> |
69 | 70 | ${po.fieldName}: undefined, |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
1 | 1 | <#assign pidFieldName = ""> |
2 | 2 | <#assign hasChildrenField = ""> |
3 | +<#assign bpm_flag=false> | |
3 | 4 | <#list originalColumns as po> |
4 | 5 | <#if po.fieldDbName == tableVo.extendParams.pidField> |
5 | 6 | <#assign pidFieldName = po.fieldName> |
... | ... | @@ -11,6 +12,9 @@ |
11 | 12 | <#assign list_need_pca=false> |
12 | 13 | <#-- 开始循环 --> |
13 | 14 | <#list columns as po> |
15 | + <#if po.fieldDbName=='bpm_status'> | |
16 | + <#assign bpm_flag=true> | |
17 | + </#if> | |
14 | 18 | <#if po.classType=='pca'> |
15 | 19 | <#assign list_need_pca=true> |
16 | 20 | </#if> |
... | ... | @@ -74,6 +78,9 @@ |
74 | 78 | <#if list_need_pca> |
75 | 79 | import { getAreaTextByCode } from '/@/components/Form/src/utils/Area'; |
76 | 80 | </#if> |
81 | + <#if bpm_flag==true> | |
82 | + import { startProcess } from '/@/api/common/api'; | |
83 | + </#if> | |
77 | 84 | const expandedRowKeys = ref([]); |
78 | 85 | //字典model |
79 | 86 | const [registerModal, {openModal}] = useModal(); |
... | ... | @@ -116,6 +123,7 @@ |
116 | 123 | }, |
117 | 124 | actionColumn: { |
118 | 125 | width: 240, |
126 | + fixed:'right' | |
119 | 127 | }, |
120 | 128 | }, |
121 | 129 | exportConfig: { |
... | ... | @@ -329,19 +337,61 @@ |
329 | 337 | * 下拉操作栏 |
330 | 338 | */ |
331 | 339 | function getDropDownAction(record){ |
332 | - return [ | |
333 | - { | |
334 | - label: '详情', | |
335 | - onClick: handleDetail.bind(null, record), | |
336 | - }, { | |
337 | - label: '删除', | |
338 | - popConfirm: { | |
339 | - title: '确定删除吗?', | |
340 | - confirm: handleDelete.bind(null, record), | |
341 | - } | |
342 | - } | |
343 | - ] | |
340 | + <#if bpm_flag==true> | |
341 | + let dropDownAction = [ | |
342 | + { | |
343 | + label: '详情', | |
344 | + onClick: handleDetail.bind(null, record), | |
345 | + }, { | |
346 | + label: '删除', | |
347 | + popConfirm: { | |
348 | + title: '是否确认删除', | |
349 | + confirm: handleDelete.bind(null, record) | |
350 | + } | |
351 | + } | |
352 | + ]; | |
353 | + if(record.bpmStatus == '1'){ | |
354 | + dropDownAction.push({ | |
355 | + label: '发起流程', | |
356 | + popConfirm: { | |
357 | + title: '确认提交流程吗?', | |
358 | + confirm: handleProcess.bind(null, record), | |
359 | + } | |
360 | + }) | |
361 | + } | |
362 | + return dropDownAction; | |
363 | + <#else> | |
364 | + return [ | |
365 | + { | |
366 | + label: '详情', | |
367 | + onClick: handleDetail.bind(null, record), | |
368 | + }, { | |
369 | + label: '删除', | |
370 | + popConfirm: { | |
371 | + title: '确定删除吗?', | |
372 | + confirm: handleDelete.bind(null, record), | |
373 | + } | |
374 | + } | |
375 | + ] | |
376 | + </#if> | |
344 | 377 | } |
378 | + | |
379 | + <#if bpm_flag==true> | |
380 | + /** | |
381 | + * 提交流程 | |
382 | + */ | |
383 | + async function handleProcess(record) { | |
384 | + let params = { | |
385 | + flowCode: 'dev_${tableName}_001', | |
386 | + id: record.id, | |
387 | + formUrl: '${entityPackage}/modules/${entityName}Form', | |
388 | + formUrlMobile: '' | |
389 | + } | |
390 | + await startProcess(params); | |
391 | + await reload(); | |
392 | + } | |
393 | + </#if> | |
394 | + | |
345 | 395 | </script> |
346 | 396 | |
347 | 397 | <style scoped> |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi
1 | 1 | import {defHttp} from "/@/utils/http/axios"; |
2 | -import {Modal} from 'ant-design-vue'; | |
2 | +import { useMessage } from "/@/hooks/web/useMessage"; | |
3 | + | |
4 | +const { createConfirm } = useMessage(); | |
3 | 5 | |
4 | 6 | enum Api { |
5 | 7 | list = '/${entityPackage}/${entityName?uncap_first}/rootList', |
... | ... | @@ -42,7 +44,8 @@ export const delete${entityName} = (params,handleSuccess) => { |
42 | 44 | * @param params |
43 | 45 | */ |
44 | 46 | export const batchDelete${entityName} = (params, handleSuccess) => { |
45 | - Modal.confirm({ | |
47 | + createConfirm({ | |
48 | + iconType: 'warning', | |
46 | 49 | title: '确认删除', |
47 | 50 | content: '是否删除选中数据', |
48 | 51 | okText: '确认', |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... | ... | @@ -213,6 +213,15 @@ export const formSchema: FormSchema[] = [ |
213 | 213 | { |
214 | 214 | label: '${po.filedComment}', |
215 | 215 | field: ${autoStringSuffix(po)}, |
216 | +<#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> | |
217 | + <#if po.defaultVal??> | |
218 | + <#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int"> | |
219 | + defaultValue: ${po.defaultVal}, | |
220 | + <#else> | |
221 | + defaultValue: "${po.defaultVal}", | |
222 | + </#if> | |
223 | + </#if> | |
224 | +<#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> | |
216 | 225 | <#if po.fieldDbName == tableVo.extendParams.pidField> |
217 | 226 | component: 'JTreeSelect', |
218 | 227 | componentProps: { |
... | ... | @@ -354,7 +363,7 @@ export const formSchema: FormSchema[] = [ |
354 | 363 | { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, |
355 | 364 | <#-- 邮政编码 --> |
356 | 365 | <#elseif fieldValidType == 'p'> |
357 | - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
366 | + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
358 | 367 | <#-- 字母 --> |
359 | 368 | <#elseif fieldValidType == 's'> |
360 | 369 | { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi
1 | 1 | import { defHttp } from "/@/utils/http/axios"; |
2 | -import { Modal } from 'ant-design-vue'; | |
2 | +import { useMessage } from "/@/hooks/web/useMessage"; | |
3 | + | |
4 | +const { createConfirm } = useMessage(); | |
3 | 5 | |
4 | 6 | enum Api { |
5 | 7 | list = '/${entityPackage}/${entityName?uncap_first}/rootList', |
... | ... | @@ -48,7 +50,8 @@ export const delete${entityName} = (params,handleSuccess) => { |
48 | 50 | * @param handleSuccess |
49 | 51 | */ |
50 | 52 | export const batchDelete${entityName} = (params, handleSuccess) => { |
51 | - Modal.confirm({ | |
53 | + createConfirm({ | |
54 | + iconType: 'warning', | |
52 | 55 | title: '确认删除', |
53 | 56 | content: '是否删除选中数据', |
54 | 57 | okText: '确认', |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi
... | ... | @@ -351,13 +351,13 @@ export const formSchema: FormSchema[] = [ |
351 | 351 | { pattern: /^((ht|f)tps?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/, message: '请输入正确的网址!' }, |
352 | 352 | <#-- 电子邮件 --> |
353 | 353 | <#elseif fieldValidType == 'e'> |
354 | - { pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件! }, | |
354 | + { pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件!' }, | |
355 | 355 | <#-- 手机号码 --> |
356 | 356 | <#elseif fieldValidType == 'm'> |
357 | 357 | { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!' }, |
358 | 358 | <#-- 邮政编码 --> |
359 | 359 | <#elseif fieldValidType == 'p'> |
360 | - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!' }, | |
360 | + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!' }, | |
361 | 361 | <#-- 字母 --> |
362 | 362 | <#elseif fieldValidType == 's'> |
363 | 363 | { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!' }, |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei
... | ... | @@ -39,6 +39,7 @@ |
39 | 39 | </#if> |
40 | 40 | <#if po.fieldDbName == tableVo.extendParams.pidField> |
41 | 41 | <#assign pidFieldName = po.fieldName> |
42 | + <#assign need_select_tree = true> | |
42 | 43 | <a-col :span="${form_span}"> |
43 | 44 | <a-form-item label="父级节点" v-bind="validateInfos.${autoStringSuffixForModel(po)}"> |
44 | 45 | <j-tree-select |
... | ... | @@ -67,7 +68,6 @@ |
67 | 68 | import moment from 'moment'; |
68 | 69 | <#include "/common/form/native/vue3NativeImport.ftl"> |
69 | 70 | import { getValueType } from '/@/utils'; |
70 | - import { validateDuplicateValue } from '/@/utils/helper/validator'; | |
71 | 71 | import {loadTreeData, saveOrUpdateDict} from '../${entityName}.api'; |
72 | 72 | import { Form } from 'ant-design-vue'; |
73 | 73 | <#if hasOnlyValidate == true> |
... | ... | @@ -84,6 +84,7 @@ |
84 | 84 | let model: Nullable<Recordable> = null; |
85 | 85 | const formData = reactive<Record<string, any>>({ |
86 | 86 | <#list columns as po> |
87 | + id: '', | |
87 | 88 | <#if po.isShow == 'Y'> |
88 | 89 | <#if po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'> |
89 | 90 | ${po.fieldName}: undefined, |
... | ... | @@ -125,6 +126,7 @@ |
125 | 126 | treeData.value = await loadTreeData({ async: false, pcode: '' }); |
126 | 127 | //赋值 |
127 | 128 | Object.assign(formData, record); |
129 | + model = record | |
128 | 130 | }); |
129 | 131 | } |
130 | 132 | |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
... | ... | @@ -90,6 +90,9 @@ |
90 | 90 | import { getAuthCache, setAuthCache } from '/@/utils/auth'; |
91 | 91 | import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum'; |
92 | 92 | </#if> |
93 | + <#if bpm_flag==true> | |
94 | + import { startProcess } from '/@/api/common/api'; | |
95 | + </#if> | |
93 | 96 | //注册model |
94 | 97 | const [registerModal, {openModal}] = useModal(); |
95 | 98 | //注册table数据 |
... | ... | @@ -210,23 +213,66 @@ |
210 | 213 | } |
211 | 214 | ] |
212 | 215 | } |
213 | - /** | |
214 | - * 下拉操作栏 | |
215 | - */ | |
216 | + | |
217 | + <#if bpm_flag==true> | |
218 | + /** | |
219 | + * 提交流程 | |
220 | + */ | |
221 | + async function handleProcess(record) { | |
222 | + let params = { | |
223 | + flowCode: 'dev_${tableName}_001', | |
224 | + id: record.id, | |
225 | + formUrl: '${entityPackage}/modules/${entityName}Form', | |
226 | + formUrlMobile: '' | |
227 | + } | |
228 | + await startProcess(params); | |
229 | + handleSuccess(); | |
230 | + } | |
231 | + </#if> | |
232 | + | |
233 | + /** | |
234 | + * 下拉操作栏 | |
235 | + */ | |
216 | 236 | function getDropDownAction(record){ |
217 | - return [ | |
218 | - { | |
219 | - label: '详情', | |
220 | - onClick: handleDetail.bind(null, record), | |
221 | - }, { | |
222 | - label: '删除', | |
223 | - popConfirm: { | |
224 | - title: '是否确认删除', | |
225 | - confirm: handleDelete.bind(null, record), | |
226 | - } | |
227 | - } | |
228 | - ] | |
229 | - } | |
237 | + <#if bpm_flag==true> | |
238 | + let dropDownAction = [ | |
239 | + { | |
240 | + label: '详情', | |
241 | + onClick: handleDetail.bind(null, record), | |
242 | + }, { | |
243 | + label: '删除', | |
244 | + popConfirm: { | |
245 | + title: '是否确认删除', | |
246 | + confirm: handleDelete.bind(null, record), | |
247 | + } | |
248 | + } | |
249 | + ]; | |
250 | + if(record.bpmStatus == '1'){ | |
251 | + dropDownAction.push({ | |
252 | + label: '发起流程', | |
253 | + popConfirm: { | |
254 | + title: '确认提交流程吗?', | |
255 | + confirm: handleProcess.bind(null, record), | |
256 | + } | |
257 | + }) | |
258 | + } | |
259 | + return dropDownAction; | |
260 | + <#else> | |
261 | + return [ | |
262 | + { | |
263 | + label: '详情', | |
264 | + onClick: handleDetail.bind(null, record), | |
265 | + }, { | |
266 | + label: '删除', | |
267 | + popConfirm: { | |
268 | + title: '是否确认删除', | |
269 | + confirm: handleDelete.bind(null, record), | |
270 | + } | |
271 | + } | |
272 | + ] | |
273 | + </#if> | |
274 | + } | |
275 | + | |
230 | 276 | <#if list_need_category> |
231 | 277 | /** |
232 | 278 | * 初始化字典配置 |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi
1 | 1 | import {defHttp} from '/@/utils/http/axios'; |
2 | -import {Modal} from 'ant-design-vue'; | |
2 | +import { useMessage } from "/@/hooks/web/useMessage"; | |
3 | + | |
4 | +const { createConfirm } = useMessage(); | |
3 | 5 | |
4 | 6 | enum Api { |
5 | 7 | list = '/${entityPackage}/${entityName?uncap_first}/list', |
... | ... | @@ -47,7 +49,8 @@ export const deleteOne = (params,handleSuccess) => { |
47 | 49 | * @param params |
48 | 50 | */ |
49 | 51 | export const batchDelete = (params, handleSuccess) => { |
50 | - Modal.confirm({ | |
52 | + createConfirm({ | |
53 | + iconType: 'warning', | |
51 | 54 | title: '确认删除', |
52 | 55 | content: '是否删除选中数据', |
53 | 56 | okText: '确认', |
... | ... | @@ -68,12 +71,21 @@ export const saveOrUpdate = (params, isUpdate) => { |
68 | 71 | return defHttp.post({url: url, params}); |
69 | 72 | } |
70 | 73 | <#list subTables as sub><#rt/> |
74 | + <#assign myForeignKeys=''> | |
75 | + <#list sub.foreignKeys as key> | |
76 | + <#assign myForeignKeys='${key?uncap_first}'> | |
77 | + </#list> | |
71 | 78 | /** |
72 | 79 | * 列表接口 |
73 | 80 | * @param params |
74 | 81 | */ |
75 | -export const ${sub.entityName?uncap_first}List = (params) => | |
76 | - defHttp.get({url: Api.${sub.entityName?uncap_first}List, params}); | |
82 | +export const ${sub.entityName?uncap_first}List = (params) => { | |
83 | + if(params['${myForeignKeys}']){ | |
84 | + return defHttp.get({url: Api.${sub.entityName?uncap_first}List, params}); | |
85 | + } | |
86 | + return Promise.resolve({}); | |
87 | +} | |
88 | + | |
77 | 89 | |
78 | 90 | /** |
79 | 91 | * 删除单个 |
... | ... | @@ -88,7 +100,8 @@ export const ${sub.entityName?uncap_first}Delete = (params,handleSuccess) => { |
88 | 100 | * @param params |
89 | 101 | */ |
90 | 102 | export const ${sub.entityName?uncap_first}DeleteBatch = (params, handleSuccess) => { |
91 | - Modal.confirm({ | |
103 | + createConfirm({ | |
104 | + iconType: 'warning', | |
92 | 105 | title: '确认删除', |
93 | 106 | content: '是否删除选中数据', |
94 | 107 | okText: '确认', |
... | ... |
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
... | ... | @@ -119,7 +119,8 @@ export const searchFormSchema: FormSchema[] = [ |
119 | 119 | <#elseif po.classType=='datetime'> |
120 | 120 | component: 'DatePicker', |
121 | 121 | componentProps: { |
122 | - showTime:true | |
122 | + showTime:true, | |
123 | + valueFormat: 'YYYY-MM-DD HH:mm:ss' | |
123 | 124 | }, |
124 | 125 | <#elseif po.classType=='pca'> |
125 | 126 | component: 'JAreaLinkage', |
... | ... | @@ -187,6 +188,15 @@ export const formSchema: FormSchema[] = [ |
187 | 188 | { |
188 | 189 | label: '${po.filedComment}', |
189 | 190 | field: ${autoStringSuffix(po)}, |
191 | +<#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> | |
192 | + <#if po.defaultVal??> | |
193 | + <#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int"> | |
194 | + defaultValue: ${po.defaultVal}, | |
195 | + <#else> | |
196 | + defaultValue: "${po.defaultVal}", | |
197 | + </#if> | |
198 | + </#if> | |
199 | +<#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> | |
190 | 200 | <#if po.classType =='date'> |
191 | 201 | component: 'DatePicker', |
192 | 202 | <#elseif po.classType =='datetime'> |
... | ... | @@ -318,7 +328,7 @@ export const formSchema: FormSchema[] = [ |
318 | 328 | { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, |
319 | 329 | <#-- 邮政编码 --> |
320 | 330 | <#elseif fieldValidType == 'p'> |
321 | - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
331 | + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
322 | 332 | <#-- 字母 --> |
323 | 333 | <#elseif fieldValidType == 's'> |
324 | 334 | { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, |
... | ... | @@ -448,6 +458,15 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [ |
448 | 458 | { |
449 | 459 | label: '${po.filedComment}', |
450 | 460 | field: ${autoStringSuffix(po)}, |
461 | +<#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> | |
462 | + <#if po.defaultVal??> | |
463 | + <#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int"> | |
464 | + defaultValue: ${po.defaultVal}, | |
465 | + <#else> | |
466 | + defaultValue: "${po.defaultVal}", | |
467 | + </#if> | |
468 | + </#if> | |
469 | +<#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> | |
451 | 470 | <#if po.classType =='date'> |
452 | 471 | component: 'DatePicker', |
453 | 472 | <#elseif po.classType =='datetime'> |
... | ... | @@ -579,7 +598,7 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [ |
579 | 598 | { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, |
580 | 599 | <#-- 邮政编码 --> |
581 | 600 | <#elseif fieldValidType == 'p'> |
582 | - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
601 | + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, | |
583 | 602 | <#-- 字母 --> |
584 | 603 | <#elseif fieldValidType == 's'> |
585 | 604 | { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, |
... | ... |