diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeComponents.ftl b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeComponents.ftl new file mode 100644 index 00000000..60ad6824 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeComponents.ftl @@ -0,0 +1,48 @@ +<#if need_select_tag> + JDictSelectTag, + +<#if need_switch> + JSwitch, + +<#if need_multi> + JSelectMultiple, + +<#if need_search> + JSearchSelect, + +<#if need_popup> + JPopup, + +<#if need_category> + JCategorySelect, + +<#if need_dept> + JSelectDept, + +<#if need_dept_user> + JSelectUserByDept, + +<#if need_select_tree> + JTreeSelect, + +<#if need_time> + TimePicker, + +<#if need_pca> + JAreaLinkage, + +<#if need_upload> + JUpload, + +<#if need_image_upload> + JImageUpload, + +<#if need_markdown> + JMarkdownEditor, + +<#if need_editor> + JEditor, + +<#if need_checkbox> + JCheckbox, + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl new file mode 100644 index 00000000..8d288219 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl @@ -0,0 +1,107 @@ +<#include "/common/utils.ftl"> +<#if po.isShow =='Y' && po.fieldName != 'id' && isNotPidField(tableVo, po.fieldDbName)> +<#assign form_field_dictCode=""> + <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1> + <#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}"> + <#elseif po.dictField?default("")?trim?length gt 1> + <#assign form_field_dictCode="${po.dictField}"> + + + + <#if po.classType =='date'> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType =='datetime'> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType =='time'> + <#assign need_time = true> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType =='popup'> + <#assign need_popup = true> + <#assign sourceFields = po.dictField?default("")?trim?split(",")/> + <#assign targetFields = po.dictText?default("")?trim?split(",")/> + disabled<#else>:disabled="disabled"<#rt> + /> + <#elseif po.classType =='sel_depart'> + <#assign need_dept = true> + disabled<#else>:disabled="disabled" /> + <#elseif po.classType =='switch'> + <#assign need_switch = true> + :options="${po.dictField}" <#if po.readonly=='Y'>disabled<#else>:disabled="disabled"> + <#elseif po.classType =='pca'> + <#assign need_pca = true> + disabled<#else>:disabled="disabled" /> + <#elseif po.classType =='markdown'> + <#assign need_markdown = true> + disabled<#else>:disabled="disabled"> + <#elseif po.classType =='password'> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType =='sel_user'> + <#assign need_dept_user = true> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType =='textarea'> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType=='radio'> + <#assign need_select_tag = true> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType=='list'> + <#assign need_select_tag = true> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType=='list_multi'> + <#assign need_multi = true> + disabled<#else>:disabled="disabled" :triggerChange="false"/> + <#elseif po.classType=='checkbox'> + <#assign need_checkbox = true> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType=='sel_search'> + <#assign need_search = true> + disabled<#else>:disabled="disabled" /> + <#elseif po.classType=='cat_tree'> + <#assign need_category = true> + back="${dashedToCamel(po.dictText)}" <#if po.readonly=='Y'>disabled<#else>:disabled="disabled" @change="(value) => handleFormChange('${po.fieldName}', value)" /> + <#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'> + disabled<#else>:disabled="disabled"/> + <#elseif po.classType=='file'> + <#assign need_upload = true> + disabled<#else>:disabled="disabled" <#if po.uploadnum??>:maxCount=${po.uploadnum}> + <#elseif po.classType=='image'> + <#assign need_image_upload = true> + :fileMax=${po.uploadnum} v-model:value="formData.${po.fieldName}" <#if po.readonly=='Y'>disabled<#else>:disabled="disabled"> + <#elseif po.classType=='umeditor'> + <#assign need_editor = true> + disabled<#else>:disabled="disabled"/> + <#elseif po.fieldDbType=='Blob'> + disabled<#else>:disabled="disabled"> + <#elseif po.classType == 'sel_tree'> + <#assign need_select_tree = true> + + <#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??> + dict="${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}" + <#elseif po.dictText?split(',')[1]??> + pidField="${po.dictText?split(',')[1]}" + <#elseif po.dictText?split(',')[3]??> + hasChildField="${po.dictText?split(',')[3]}" + + + pidValue="${po.dictField}" + <#if po.readonly=='Y'>disabled<#else>:disabled="disabled" + v-model:value="formData.${po.fieldName}" + @change="(value) => handleFormChange('${po.fieldName}', value)"> + + <#else> + disabled<#else>:disabled="disabled"> + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeImport.ftl b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeImport.ftl new file mode 100644 index 00000000..1c9a3f7e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeImport.ftl @@ -0,0 +1,48 @@ +<#if need_select_tag> + import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; + +<#if need_switch> + import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue'; + +<#if need_multi> + import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue'; + +<#if need_search> + import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; + +<#if need_popup> + import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue'; + +<#if need_category> + import JCategorySelect from '/@/components/Form/src/jeecg/components/JCategorySelect.vue'; + +<#if need_dept> + import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue'; + +<#if need_dept_user> + import JSelectUserByDept from '/@/components/Form/src/jeecg/components/JSelectUserByDept.vue'; + +<#if need_select_tree> + import JTreeSelect from '/@/components/Form/src/jeecg/components/JTreeSelect.vue'; + +<#if need_time> + import { TimePicker } from 'ant-design-vue'; + +<#if need_pca> + import JAreaLinkage from '/@/components/Form/src/jeecg/components/JAreaLinkage.vue'; + +<#if need_upload> + import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; + +<#if need_image_upload> + import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue'; + +<#if need_markdown> + import JMarkdownEditor from '/@/components/Form/src/jeecg/components/JMarkdownEditor.vue'; + +<#if need_editor> + import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue'; + +<#if need_checkbox> + import JCheckbox from "/@/components/Form/src/jeecg/components/JCheckbox.vue"; + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl new file mode 100644 index 00000000..a16bf89b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl @@ -0,0 +1,85 @@ +<#if po.isQuery=='Y'> +<#assign query_flag=true> + <#if query_field_no==2> + + + + + 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 new file mode 100644 index 00000000..0ff2ed7d --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi @@ -0,0 +1,90 @@ +import { defHttp } from "/@/utils/http/axios"; +import { Modal } from 'ant-design-vue'; + +enum Api { + list = '/${entityPackage}/${entityName?uncap_first}/rootList', + save='/${entityPackage}/${entityName?uncap_first}/add', + edit='/${entityPackage}/${entityName?uncap_first}/edit', + delete${entityName} = '/${entityPackage}/${entityName?uncap_first}/delete', + importExcel = '/${entityPackage}/${entityName?uncap_first}/importExcel', + exportXls = '/${entityPackage}/${entityName?uncap_first}/exportXls', + loadTreeData = '/${entityPackage}/${entityName?uncap_first}/loadTreeRoot', + getChildList = '/${entityPackage}/${entityName?uncap_first}/childList', + getChildListBatch = '/${entityPackage}/${entityName?uncap_first}/getChildListBatch', +} + +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + * @param params + */ +export const getImportUrl = Api.importExcel; + +/** + * 列表接口 + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 删除 + * @param params + * @param handleSuccess + */ +export const delete${entityName} = (params,handleSuccess) => { + return defHttp.delete({ url: Api.delete${entityName}, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); +} + +/** + * 批量删除 + * @param params + * @param handleSuccess + */ +export const batchDelete${entityName} = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({ url: Api.delete${entityName}, data: params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); + } + }); +} + +/** + * 保存或者更新 + * @param params + * @param isUpdate + */ +export const saveOrUpdateDict = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url: url, params },{ isTransformResponse:false }); +} + +/** + * 查询全部树形节点数据 + * @param params + */ +export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData,params }); + +/** + * 查询子节点数据 + * @param params + */ +export const getChildList = (params) => defHttp.get({ url: Api.getChildList, params }); + +/** + * 批量查询子节点数据 + * @param params + */ +export const getChildListBatch = (params) => defHttp.get({ url: Api.getChildListBatch, params },{ isTransformResponse:false }); 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 new file mode 100644 index 00000000..8a3ecb8d --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi @@ -0,0 +1,399 @@ +<#include "/common/utils.ftl"> +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + <#list columns as po> + <#if po.isShowList =='Y' && po.fieldName !='id'> + { + title: '${po.filedComment}', + <#if po.fieldDbName == tableVo.extendParams.textField> + align: 'left', + <#else> + align: 'center', + + <#if po.sort=='Y'> + sorter: true, + + <#if po.classType=='date'> + dataIndex: '${po.fieldName}', + customRender:({text}) =>{ + return !text?"":(text.length>10?text.substr(0,10):text); + }, + <#elseif po.fieldDbType=='Blob'> + dataIndex: '${po.fieldName}String' + <#elseif po.classType=='umeditor'> + dataIndex: '${po.fieldName}', + slots: { customRender: 'htmlSlot' }, + <#elseif po.classType=='pca'> + dataIndex: '${po.fieldName}', + slots: { customRender: 'pcaSlot' }, + <#elseif po.classType=='file'> + dataIndex: '${po.fieldName}', + slots: { customRender: 'fileSlot' }, + <#elseif po.classType=='image'> + dataIndex: '${po.fieldName}', + customRender: render.renderImage, + <#elseif po.classType=='switch'> + dataIndex: '${po.fieldName}', +<#assign switch_extend_arr=['Y','N']> +<#if po.dictField?default("")?contains("[")> +<#assign switch_extend_arr=po.dictField?eval> + +<#list switch_extend_arr as a> +<#if a_index == 0> +<#assign switch_extend_arr1=a> +<#else> +<#assign switch_extend_arr2=a> + + + customRender:({text}) => { + return render.renderSwitch(text, [{text:'是',value:'${switch_extend_arr1}'},{text:'否',value:'${switch_extend_arr2}'}]); + }, + <#elseif po.classType == 'sel_tree' || po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox' || po.classType=='sel_depart' || po.classType=='sel_user'> + dataIndex: '${po.fieldName}_dictText' + <#elseif po.classType=='cat_tree'> + dataIndex: '${po.fieldName}', + <#if po.dictText?default("")?trim?length == 0> + customRender:({text}) => { + return render.renderCategoryTree(text,'${po.dictField?default("")}'); + }, + <#else> + customRender: ({text, record}) => (text ? record['${po.dictText}'] : ''); + + <#else> + dataIndex: '${po.fieldName}' + + }, + + +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = [ +<#-- 开始循环 --> +<#list columns as po> +<#if po.fieldDbName=='bpm_status'> + <#assign bpm_flag=true> + +<#if po.isQuery=='Y'> +<#assign query_flag=true> + <#assign query_field_dictCode=""> + <#if po.dictTable?default("")?trim?length gt 1> + <#assign query_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}"> + <#elseif po.dictField?default("")?trim?length gt 1> + <#assign query_field_dictCode="${po.dictField}"> + +<#if po.queryMode=='single'> + { + label: "${po.filedComment}", + field: "${po.fieldName}", +<#if po.classType=='sel_search'> + component: 'JSearchSelect', + componentProps: { + dict:"${po.dictTable},${po.dictText},${po.dictField}" + }, +<#elseif po.classType=='sel_user'> + component: 'JSelectUserByDept', +<#elseif po.classType=='switch'> + component: 'JSwitch', + componentProps: { + <#if po.dictField != 'is_open'> + options: '${po.dictField}', + + }, + <#elseif po.classType=='sel_depart'> + component: 'JSelectDept', + <#elseif po.classType=='list_multi'> + component: 'JSelectMultiple', + componentProps: { + <#if po.dictTable?default("")?trim?length gt 1> + options: "${po.dictField}", + dictCode: "${po.dictTable},${po.dictText},${po.dictField}", + <#elseif po.dictField?default("")?trim?length gt 1> + dictCode: "${po.dictField}", + + triggerChange: true + }, + <#elseif po.classType=='cat_tree'> + component: 'JCategorySelect', + componentProps:{ + pcode:"${po.dictField?default("")}",//back和事件未添加,暂时有问题 + }, +<#elseif po.classType=='date'> + component: 'DatePicker', +<#elseif po.classType=='datetime'> + component: 'DatePicker', + componentProps: { + showTime: true + }, +<#elseif po.classType=='pca'> + component: 'JAreaLinkage', +<#elseif po.classType=='popup'> + <#include "/common/form/vue3popup.ftl"> +<#elseif po.classType == 'sel_tree'> + component: 'JTreeSelect', + componentProps: { + <#if po.dictText??> + <#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??> + dict: "${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}", + + <#if po.dictText?split(',')[1]??> + pidField: "${po.dictText?split(',')[1]}", + + <#if po.dictText?split(',')[3]??> + hasChildField: "${po.dictText?split(',')[3]}", + + + pidValue: "${po.dictField}", + }, +<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'> +<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- --> + component: 'JDictSelectTag', + componentProps:{ + <#if po.dictTable?default("")?trim?length gt 1> + dictCode: "${po.dictTable},${po.dictText},${po.dictField}" + <#elseif po.dictField?default("")?trim?length gt 1> + dictCode: "${po.dictField}" + + }, +<#else> + component: 'Input', + + colProps: {span: 6}, + }, +<#else> + { + label: "${po.filedComment}", + field: "${po.fieldName}", +<#if po.classType=='date'> + component: 'RangePicker', +<#elseif po.classType=='datetime'> + component: 'RangePicker', + componentProps: { + showTime: true + }, +<#elseif po.classType == 'time'> + component: 'TimePicker', + componentProps:{ + valueFormat: 'HH:mm:ss', + }, +<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'> + component: 'JRangeNumber', +<#else> + component: 'Input', //TODO 范围查询 + + colProps: {span: 6}, + }, + + + +<#-- 结束循环 --> +]; + +//表单数据 +export const formSchema: FormSchema[] = [ +<#assign form_cat_tree = false> +<#assign form_cat_back = ""> +<#assign bpm_flag=false> +<#assign id_exists = false> +<#list columns as po><#rt/> +<#if po.fieldDbName=='bpm_status'> + <#assign bpm_flag=true> + +<#if po.fieldDbName == 'id'> + <#assign id_exists = true> + +<#if po.isShow =='Y'> +<#assign form_field_dictCode=""> + <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1> + <#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}"> + <#elseif po.dictField?default("")?trim?length gt 1> + <#assign form_field_dictCode="${po.dictField}"> + + { + label: '${po.filedComment}', + field: ${autoStringSuffix(po)}, + <#if po.fieldDbName == tableVo.extendParams.pidField> + component: 'JTreeSelect', + componentProps: { + dict: "${tableVo.tableName},${tableVo.extendParams.textField},id", + pidField: "${tableVo.extendParams.pidField}", + pidValue: "0", + hasChildField: "${tableVo.extendParams.hasChildren}", + }, + <#elseif po.classType =='date'> + component: 'DatePicker', + <#elseif po.classType =='datetime'> + component: 'DatePicker', + componentProps: { + showTime:true, + valueFormat: 'YYYY-MM-DD hh:mm:ss' + }, + <#elseif po.classType =='time'> + component: 'TimePicker', + componentProps:{ + valueFormat: 'HH:mm:ss', + }, + <#elseif po.classType =='popup'> + <#include "/common/form/vue3popup.ftl"> + <#elseif po.classType =='sel_depart'> + component: 'JSelectDept', + <#elseif po.classType =='switch'> + component: 'JSwitch', + componentProps:{ + <#if po.dictField != 'is_open'> + options:${po.dictField} + + }, + <#elseif po.classType =='pca'> + component: 'JAreaLinkage', + <#elseif po.classType =='markdown'> + component: 'JMarkdownEditor',//注意string转换问题 + <#elseif po.classType =='password'> + component: 'InputPassword', + <#elseif po.classType =='sel_user'> + component: 'JSelectUserByDept', + componentProps:{ + labelKey: 'realname', + }, + <#elseif po.classType =='textarea'> + component: 'InputTextArea', + <#elseif po.classType=='list' || po.classType=='radio'> + component: 'JDictSelectTag', + componentProps:{ + dictCode: "${form_field_dictCode}" + }, + <#elseif po.classType=='list_multi' || po.classType=='checkbox'> + component: 'JSelectMultiple', + componentProps:{ + dictCode: "${form_field_dictCode}" + }, + <#elseif po.classType=='sel_search'> + component: 'JSearchSelect', + componentProps:{ + dict: "${form_field_dictCode}" + }, +<#elseif po.classType=='cat_tree'> + <#assign form_cat_tree = true> + component: 'JCategorySelect', + componentProps:{ + pcode: "${po.dictField?default("")}", //TODO back和事件未添加,暂时有问题 + }, + <#if po.dictText?default("")?trim?length gt 1> + <#assign form_cat_back = "${po.dictText}"> + + <#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'> + component: 'InputNumber', + <#elseif po.classType=='file'> + component: 'JUpload', + componentProps:{ + <#if po.uploadnum??> + maxCount: ${po.uploadnum} + + }, + <#elseif po.classType=='image'> + component: 'JImageUpload', + componentProps:{ + <#if po.uploadnum??> + fileMax: ${po.uploadnum} + + }, + <#elseif po.classType=='umeditor'> + component: 'JEditor', + <#elseif po.classType == 'sel_tree'> + component: 'JTreeSelect', + componentProps:{ + <#if po.dictText??> + <#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??> + dict: "${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}", + + <#if po.dictText?split(',')[1]??> + pidField: "${po.dictText?split(',')[1]}", + + <#if po.dictText?split(',')[3]??> + hasChildField: "${po.dictText?split(',')[3]}", + + + pidValue: "${po.dictField}", + }, + <#else> + component: 'Input', + + <#include "/common/utils.ftl"> + <#if po.isShow == 'Y' && poHasCheck(po)> + dynamicRules: ({ model, schema }) => { + <#if po.fieldName != 'id'> + <#assign fieldValidType = po.fieldValidType!''> + return [ + <#-- 非空校验 --> + <#if po.nullable == 'N' || fieldValidType == '*'> + { required: true, message: '请输入${po.filedComment}!' }, + <#elseif fieldValidType!=''> + { required: false }, + + <#-- 唯一校验 --> + <#if fieldValidType == 'only'> + {...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}', '${po.fieldDbName}',model,schema)[0]}, + <#-- 6到16位数字 --> + <#elseif fieldValidType == 'n6-16'> + { pattern: /^\d{6,16}$/, message: '请输入6到16位数字!' }, + <#-- 6到16位任意字符 --> + <#elseif fieldValidType == '*6-16'> + { pattern: /^.{6,16}$/, message: '请输入6到16位任意字符!' }, + <#-- 6到18位字母 --> + <#elseif fieldValidType == 's6-18'> + { pattern:/^[a-z|A-Z]{6,18}$/, message: '请输入6到18位字母!' }, + <#-- 网址 --> + <#elseif fieldValidType == 'url'> + { pattern: /^((ht|f)tps?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/, message: '请输入正确的网址!' }, + <#-- 电子邮件 --> + <#elseif fieldValidType == 'e'> + { 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: '请输入正确的邮政编码!' }, + <#-- 字母 --> + <#elseif fieldValidType == 's'> + { pattern: /^[A-Z|a-z]+$/, message: '请输入字母!' }, + <#-- 数字 --> + <#elseif fieldValidType == 'n'> + { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!' }, + <#-- 整数 --> + <#elseif fieldValidType == 'z'> + { pattern: /^-?\d+$/, message: '请输入整数!' }, + <#-- 金额 --> + <#elseif fieldValidType == 'money'> + { pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!' }, + <#-- 正则校验 --> + <#elseif fieldValidType != '' && fieldValidType != '*'> + { pattern: '${fieldValidType}', message: '不符合校验规则!' }, + <#-- 无校验 --> + <#else> + <#t> + + ]; + + }, + + <#if po.readonly=='Y'> + dynamicDisabled: true + + }, + + +<#if id_exists == false> + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + +]; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}_menu_insert.sql b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}_menu_insert.sql new file mode 100644 index 00000000..5396d5d5 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}_menu_insert.sql @@ -0,0 +1 @@ +<#include "/common/sql/menu_insert.ftl"> \ No newline at end of file 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 new file mode 100644 index 00000000..a5b550fd --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei @@ -0,0 +1,235 @@ +<#include "/common/utils.ftl"> + + + + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Modal.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Modal.vuei new file mode 100644 index 00000000..70dfb5d6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Modal.vuei @@ -0,0 +1,81 @@ + + + + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index 7bf649a8..9196325d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -1,3 +1,4 @@ +<#include "/common/utils.ftl"> package ${bussiPackage}.${entityPackage}.entity; import java.io.Serializable; @@ -31,9 +32,9 @@ public class ${entityName} implements Serializable { <#-- 生成字典Code --> <#assign list_field_dictCode=""> <#if po.classType='sel_user'> - <#assign list_field_dictCode=', dictTable = "sys_user", dicText = "realname", dicCode = "username"'> + <#assign list_field_dictCode=', dictTable = "sys_user", dicText = "${camelToDashed(po.extendParams.text?default(\"realname\")?trim)}", dicCode = "${camelToDashed(po.extendParams.store?default(\"username\")?trim)}"'> <#elseif po.classType='sel_depart'> - <#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "depart_name", dicCode = "id"'> + <#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "${camelToDashed(po.extendParams.text?default(\"depart_name\")?trim)}", dicCode = "${camelToDashed(po.extendParams.store?default(\"id\")?trim)}"'> <#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox'> <#if po.dictTable?default("")?trim?length gt 1> <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'> diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai index d549c98f..03fe3eb2 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai @@ -1,3 +1,4 @@ +<#include "/common/utils.ftl"> <#list subTables as subTab> #segment#${subTab.entityName}.java package ${bussiPackage}.${entityPackage}.entity; @@ -65,7 +66,8 @@ public class ${subTab.entityName} implements Serializable { @Dict(dicCode = "id",dicText = "name",dictTable = "sys_category") <#if po.classType =='sel_depart'> - @Dict(dicCode = "id",dicText = "depart_name",dictTable = "sys_depart") + <#assign list_field_dictCode='dicCode = "${camelToDashed(po.extendParams.store?default(\"id\")?trim)}", dicText = "${camelToDashed(po.extendParams.text?default(\"depart_name\")?trim)}", dictTable = "sys_depart"'> + @Dict(${list_field_dictCode}) <#-- 大字段转换 --> <#include "/common/blob.ftl"> diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei index 1cf248a6..494ff9f2 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei @@ -193,7 +193,7 @@ <#assign sub_seq=1> <#list subTables as sub> forceRender> - <${sub.entityName}List :mainId="selectedMainId" /> + <${sub.entityName}List :mainId="${sub.entityName?uncap_first}MainId" /> <#assign sub_seq=sub_seq+1> diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}_menu_insert.sql b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}_menu_insert.sql new file mode 100644 index 00000000..5396d5d5 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}_menu_insert.sql @@ -0,0 +1 @@ +<#include "/common/sql/menu_insert.ftl"> \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei index 120bdd0e..1df98593 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei @@ -44,7 +44,7 @@ @input="popupCallback" <#if po.readonly=='Y'>disabled/> <#elseif po.classType =='sel_depart'> - disabled/> + store="${po.extendParams.store}"<#if po.extendParams.text?default("")?trim?length gt 0> text="${po.extendParams.text}" <#if po.readonly=='Y'>disabled /> <#elseif po.classType =='switch'> :options="${po.dictField}" <#if po.readonly=='Y'>disabled> <#elseif po.classType =='pca'> @@ -54,7 +54,7 @@ <#elseif po.classType =='password'> disabled/> <#elseif po.classType =='sel_user'> - disabled/> + store="${po.extendParams.store}"<#if po.extendParams.text?default("")?trim?length gt 0> text="${po.extendParams.text}" <#if po.readonly=='Y'>disabled/> <#elseif po.classType =='textarea'> disabled/> <#elseif po.classType=='list' || po.classType=='radio'> diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Modal.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Modal.vuei index 1af2447b..37a1a118 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Modal.vuei +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Modal.vuei @@ -46,7 +46,7 @@ @input="popupCallback" <#if po.readonly=='Y'>disabled/> <#elseif po.classType =='sel_depart'> - disabled/> + store="${po.extendParams.store}"<#if po.extendParams.text?default("")?trim?length gt 0> text="${po.extendParams.text}" <#if po.readonly=='Y'>disabled /> <#elseif po.classType =='switch'> :options="${po.dictField}" <#if po.readonly=='Y'>disabled> <#elseif po.classType =='pca'> @@ -56,7 +56,7 @@ <#elseif po.classType =='password'> disabled/> <#elseif po.classType =='sel_user'> - disabled/> + store="${po.extendParams.store}"<#if po.extendParams.text?default("")?trim?length gt 0> text="${po.extendParams.text}" <#if po.readonly=='Y'>disabled/> <#elseif po.classType =='textarea'> disabled/> <#elseif po.classType=='list' || po.classType=='radio'> 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 9aa4df25..45f4359a 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 @@ -46,6 +46,10 @@ + +