diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei index 3a85e4b..32f1e39 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei +++ b/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 @@ import { getAuthCache, setAuthCache } from '/@/utils/auth'; import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum'; </#if> + <#if bpm_flag==true> + import { startProcess } from '/@/api/common/api'; + </#if> const checkedKeys = ref<Array<string | number>>([]); //注册model const [registerModal, {openModal}] = useModal(); @@ -196,19 +199,61 @@ * 下拉操作栏 */ function getDropDownAction(record){ - return [ - { - label: '详情', - onClick: handleDetail.bind(null, record), - }, { - label: '删除', - popConfirm: { - title: '是否确认删除', - confirm: handleDelete.bind(null, record), - } +<#if bpm_flag==true> + let dropDownAction = [ + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, { + label: '删除', + popConfirm: { + title: '是否确认删除', + confirm: handleDelete.bind(null, record), + } + } + ]; + if(record.bpmStatus == '1'){ + dropDownAction.push({ + label: '发起流程', + popConfirm: { + title: '确认提交流程吗?', + confirm: handleProcess.bind(null, record), + } + }) + } + return dropDownAction; +<#else> + return [ + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, { + label: '删除', + popConfirm: { + title: '是否确认删除', + confirm: handleDelete.bind(null, record), } - ] + } + ] +</#if> } + + <#if bpm_flag==true> + /** + * 提交流程 + */ + async function handleProcess(record) { + let params = { + flowCode: 'dev_${tableName}_001', + id: record.id, + formUrl: '${entityPackage}/modules/${entityName}Form', + formUrlMobile: '' + } + await startProcess(params); + handleSuccess(); + } + </#if> + <#if list_need_category> /** * 初始化字典配置 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi index c579f91..c3a9d5d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi @@ -1,5 +1,7 @@ import {defHttp} from '/@/utils/http/axios'; -import {Modal} from 'ant-design-vue'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); enum Api { list = '/${entityPackage}/${entityName?uncap_first}/list', @@ -39,7 +41,8 @@ export const deleteOne = (params,handleSuccess) => { * @param params */ export const batchDelete = (params, handleSuccess) => { - Modal.confirm({ + createConfirm({ + iconType: 'warning', title: '确认删除', content: '是否删除选中数据', okText: '确认', diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi index 7087240..a335249 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi +++ b/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[] = [ <#elseif po.classType=='datetime'> component: 'DatePicker', componentProps: { - showTime:true + showTime:true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' }, <#elseif po.classType =='time'> component: 'TimePicker', @@ -194,6 +195,15 @@ export const formSchema: FormSchema[] = [ { label: '${po.filedComment}', field: ${autoStringSuffix(po)}, + <#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> + <#if po.defaultVal??> + <#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int"> + defaultValue: ${po.defaultVal}, + <#else> + defaultValue: "${po.defaultVal}", + </#if> + </#if> + <#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> <#if po.classType =='date'> component: 'DatePicker', <#elseif po.classType =='datetime'> @@ -324,7 +334,7 @@ export const formSchema: FormSchema[] = [ { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, <#-- 邮政编码 --> <#elseif fieldValidType == 'p'> - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, <#-- 字母 --> <#elseif fieldValidType == 's'> { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi index 75dfbdf..d51805c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi @@ -1,5 +1,7 @@ import { defHttp } from '/@/utils/http/axios'; -import { Modal } from 'ant-design-vue'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); enum Api { list = '/${entityPackage}/${entityName?uncap_first}/list', @@ -45,7 +47,8 @@ export const deleteOne = (params,handleSuccess) => { * @param handleSuccess */ export const batchDelete = (params, handleSuccess) => { - Modal.confirm({ + createConfirm({ + iconType: 'warning', title: '确认删除', content: '是否删除选中数据', okText: '确认', diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi index 03a5779..b5272c9 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi +++ b/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[] = [ { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, <#-- 邮政编码 --> <#elseif fieldValidType == 'p'> - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, <#-- 字母 --> <#elseif fieldValidType == 's'> { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei index 0a835d2..e66fa64 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei +++ b/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 @@ const emit = defineEmits(['register', 'ok']); const formData = reactive<Record<string, any>>({ <#list columns as po> + id: '', <#if po.isShow == 'Y'> <#if po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'> ${po.fieldName}: undefined, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei index d71792a..85cb7ff 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei @@ -1,5 +1,6 @@ <#assign pidFieldName = ""> <#assign hasChildrenField = ""> +<#assign bpm_flag=false> <#list originalColumns as po> <#if po.fieldDbName == tableVo.extendParams.pidField> <#assign pidFieldName = po.fieldName> @@ -11,6 +12,9 @@ <#assign list_need_pca=false> <#-- 开始循环 --> <#list columns as po> + <#if po.fieldDbName=='bpm_status'> + <#assign bpm_flag=true> + </#if> <#if po.classType=='pca'> <#assign list_need_pca=true> </#if> @@ -74,6 +78,9 @@ <#if list_need_pca> import { getAreaTextByCode } from '/@/components/Form/src/utils/Area'; </#if> + <#if bpm_flag==true> + import { startProcess } from '/@/api/common/api'; + </#if> const expandedRowKeys = ref([]); //字典model const [registerModal, {openModal}] = useModal(); @@ -116,6 +123,7 @@ }, actionColumn: { width: 240, + fixed:'right' }, }, exportConfig: { @@ -329,19 +337,61 @@ * 下拉操作栏 */ function getDropDownAction(record){ - return [ - { - label: '详情', - onClick: handleDetail.bind(null, record), - }, { - label: '删除', - popConfirm: { - title: '确定删除吗?', - confirm: handleDelete.bind(null, record), - } - } - ] + <#if bpm_flag==true> + let dropDownAction = [ + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, { + label: '删除', + popConfirm: { + title: '是否确认删除', + confirm: handleDelete.bind(null, record) + } + } + ]; + if(record.bpmStatus == '1'){ + dropDownAction.push({ + label: '发起流程', + popConfirm: { + title: '确认提交流程吗?', + confirm: handleProcess.bind(null, record), + } + }) + } + return dropDownAction; + <#else> + return [ + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, { + label: '删除', + popConfirm: { + title: '确定删除吗?', + confirm: handleDelete.bind(null, record), + } + } + ] + </#if> } + + <#if bpm_flag==true> + /** + * 提交流程 + */ + async function handleProcess(record) { + let params = { + flowCode: 'dev_${tableName}_001', + id: record.id, + formUrl: '${entityPackage}/modules/${entityName}Form', + formUrlMobile: '' + } + await startProcess(params); + await reload(); + } + </#if> + </script> <style scoped> diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi index 8b52377..e1addeb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi @@ -1,5 +1,7 @@ import {defHttp} from "/@/utils/http/axios"; -import {Modal} from 'ant-design-vue'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); enum Api { list = '/${entityPackage}/${entityName?uncap_first}/rootList', @@ -42,7 +44,8 @@ export const delete${entityName} = (params,handleSuccess) => { * @param params */ export const batchDelete${entityName} = (params, handleSuccess) => { - Modal.confirm({ + createConfirm({ + iconType: 'warning', title: '确认删除', content: '是否删除选中数据', okText: '确认', diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi index f9e2486..690d3c9 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi +++ b/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[] = [ { label: '${po.filedComment}', field: ${autoStringSuffix(po)}, +<#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> + <#if po.defaultVal??> + <#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int"> + defaultValue: ${po.defaultVal}, + <#else> + defaultValue: "${po.defaultVal}", + </#if> + </#if> +<#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> <#if po.fieldDbName == tableVo.extendParams.pidField> component: 'JTreeSelect', componentProps: { @@ -354,7 +363,7 @@ export const formSchema: FormSchema[] = [ { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, <#-- 邮政编码 --> <#elseif fieldValidType == 'p'> - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, <#-- 字母 --> <#elseif fieldValidType == 's'> { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi index 0ff2ed7..94b450c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi @@ -1,5 +1,7 @@ import { defHttp } from "/@/utils/http/axios"; -import { Modal } from 'ant-design-vue'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); enum Api { list = '/${entityPackage}/${entityName?uncap_first}/rootList', @@ -48,7 +50,8 @@ export const delete${entityName} = (params,handleSuccess) => { * @param handleSuccess */ export const batchDelete${entityName} = (params, handleSuccess) => { - Modal.confirm({ + createConfirm({ + iconType: 'warning', title: '确认删除', content: '是否删除选中数据', okText: '确认', diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi index 8a3ecb8..7f245f8 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi +++ b/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[] = [ { pattern: /^((ht|f)tps?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/, message: '请输入正确的网址!' }, <#-- 电子邮件 --> <#elseif fieldValidType == 'e'> - { pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件! }, + { pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件!' }, <#-- 手机号码 --> <#elseif fieldValidType == 'm'> { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!' }, <#-- 邮政编码 --> <#elseif fieldValidType == 'p'> - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!' }, + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!' }, <#-- 字母 --> <#elseif fieldValidType == 's'> { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!' }, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei index a5b550f..2e27c15 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei +++ b/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 @@ </#if> <#if po.fieldDbName == tableVo.extendParams.pidField> <#assign pidFieldName = po.fieldName> + <#assign need_select_tree = true> <a-col :span="${form_span}"> <a-form-item label="父级节点" v-bind="validateInfos.${autoStringSuffixForModel(po)}"> <j-tree-select @@ -67,7 +68,6 @@ import moment from 'moment'; <#include "/common/form/native/vue3NativeImport.ftl"> import { getValueType } from '/@/utils'; - import { validateDuplicateValue } from '/@/utils/helper/validator'; import {loadTreeData, saveOrUpdateDict} from '../${entityName}.api'; import { Form } from 'ant-design-vue'; <#if hasOnlyValidate == true> @@ -84,6 +84,7 @@ let model: Nullable<Recordable> = null; const formData = reactive<Record<string, any>>({ <#list columns as po> + id: '', <#if po.isShow == 'Y'> <#if po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'> ${po.fieldName}: undefined, @@ -125,6 +126,7 @@ treeData.value = await loadTreeData({ async: false, pcode: '' }); //赋值 Object.assign(formData, record); + model = record }); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei index 45f4359..0a6404c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei +++ b/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 @@ import { getAuthCache, setAuthCache } from '/@/utils/auth'; import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum'; </#if> + <#if bpm_flag==true> + import { startProcess } from '/@/api/common/api'; + </#if> //注册model const [registerModal, {openModal}] = useModal(); //注册table数据 @@ -210,23 +213,66 @@ } ] } - /** - * 下拉操作栏 - */ + + <#if bpm_flag==true> + /** + * 提交流程 + */ + async function handleProcess(record) { + let params = { + flowCode: 'dev_${tableName}_001', + id: record.id, + formUrl: '${entityPackage}/modules/${entityName}Form', + formUrlMobile: '' + } + await startProcess(params); + handleSuccess(); + } + </#if> + + /** + * 下拉操作栏 + */ function getDropDownAction(record){ - return [ - { - label: '详情', - onClick: handleDetail.bind(null, record), - }, { - label: '删除', - popConfirm: { - title: '是否确认删除', - confirm: handleDelete.bind(null, record), - } - } - ] - } + <#if bpm_flag==true> + let dropDownAction = [ + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, { + label: '删除', + popConfirm: { + title: '是否确认删除', + confirm: handleDelete.bind(null, record), + } + } + ]; + if(record.bpmStatus == '1'){ + dropDownAction.push({ + label: '发起流程', + popConfirm: { + title: '确认提交流程吗?', + confirm: handleProcess.bind(null, record), + } + }) + } + return dropDownAction; + <#else> + return [ + { + label: '详情', + onClick: handleDetail.bind(null, record), + }, { + label: '删除', + popConfirm: { + title: '是否确认删除', + confirm: handleDelete.bind(null, record), + } + } + ] + </#if> + } + <#if list_need_category> /** * 初始化字典配置 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi index 29a805e..418c386 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi @@ -1,5 +1,7 @@ import {defHttp} from '/@/utils/http/axios'; -import {Modal} from 'ant-design-vue'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); enum Api { list = '/${entityPackage}/${entityName?uncap_first}/list', @@ -47,7 +49,8 @@ export const deleteOne = (params,handleSuccess) => { * @param params */ export const batchDelete = (params, handleSuccess) => { - Modal.confirm({ + createConfirm({ + iconType: 'warning', title: '确认删除', content: '是否删除选中数据', okText: '确认', @@ -68,12 +71,21 @@ export const saveOrUpdate = (params, isUpdate) => { return defHttp.post({url: url, params}); } <#list subTables as sub><#rt/> + <#assign myForeignKeys=''> + <#list sub.foreignKeys as key> + <#assign myForeignKeys='${key?uncap_first}'> + </#list> /** * 列表接口 * @param params */ -export const ${sub.entityName?uncap_first}List = (params) => - defHttp.get({url: Api.${sub.entityName?uncap_first}List, params}); +export const ${sub.entityName?uncap_first}List = (params) => { + if(params['${myForeignKeys}']){ + return defHttp.get({url: Api.${sub.entityName?uncap_first}List, params}); + } + return Promise.resolve({}); +} + /** * 删除单个 @@ -88,7 +100,8 @@ export const ${sub.entityName?uncap_first}Delete = (params,handleSuccess) => { * @param params */ export const ${sub.entityName?uncap_first}DeleteBatch = (params, handleSuccess) => { - Modal.confirm({ + createConfirm({ + iconType: 'warning', title: '确认删除', content: '是否删除选中数据', okText: '确认', diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi index 47f36da..1d7e41d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi +++ b/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[] = [ <#elseif po.classType=='datetime'> component: 'DatePicker', componentProps: { - showTime:true + showTime:true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' }, <#elseif po.classType=='pca'> component: 'JAreaLinkage', @@ -187,6 +188,15 @@ export const formSchema: FormSchema[] = [ { label: '${po.filedComment}', field: ${autoStringSuffix(po)}, +<#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> + <#if po.defaultVal??> + <#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int"> + defaultValue: ${po.defaultVal}, + <#else> + defaultValue: "${po.defaultVal}", + </#if> + </#if> +<#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> <#if po.classType =='date'> component: 'DatePicker', <#elseif po.classType =='datetime'> @@ -318,7 +328,7 @@ export const formSchema: FormSchema[] = [ { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, <#-- 邮政编码 --> <#elseif fieldValidType == 'p'> - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, <#-- 字母 --> <#elseif fieldValidType == 's'> { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'}, @@ -448,6 +458,15 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [ { label: '${po.filedComment}', field: ${autoStringSuffix(po)}, +<#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> + <#if po.defaultVal??> + <#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int"> + defaultValue: ${po.defaultVal}, + <#else> + defaultValue: "${po.defaultVal}", + </#if> + </#if> +<#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 --> <#if po.classType =='date'> component: 'DatePicker', <#elseif po.classType =='datetime'> @@ -579,7 +598,7 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [ { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, <#-- 邮政编码 --> <#elseif fieldValidType == 'p'> - { pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, + { pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'}, <#-- 字母 --> <#elseif fieldValidType == 's'> { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'},