diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeComponents.ftl b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeComponents.ftl index 1d61d2b9..d38ed369 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeComponents.ftl +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeComponents.ftl @@ -31,7 +31,7 @@ TimePicker, <#if need_pca> - JAreaSelect, + JAreaLinkage, <#if need_upload> JUpload, diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl index 0ac5c971..77e2fb6e 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl @@ -42,7 +42,7 @@ :options="${po.dictField}" <#if po.readonly=='Y'>disabled> <#elseif po.classType =='pca'> <#assign need_pca = true> - disabled /> + disabled /> <#elseif po.classType =='markdown'> <#assign need_markdown = true> disabled> diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeImport.ftl b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeImport.ftl index caa2e6d6..e2ea2d71 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeImport.ftl +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeImport.ftl @@ -31,7 +31,7 @@ import { TimePicker } from 'ant-design-vue'; <#if need_pca> - import JAreaSelect from '/@/components/Form/src/jeecg/components/JAreaSelect.vue'; + import JAreaLinkage from '/@/components/Form/src/jeecg/components/JAreaLinkage.vue'; <#if need_upload> import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl index 5a5903ed..a48f1282 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl @@ -39,7 +39,7 @@ <#elseif po.classType=='time'> <#if query_field_no gt 1> <#elseif po.classType=='pca'> - <#if query_field_no gt 1> + <#if query_field_no gt 1> <#elseif po.classType=='sel_tree'> <#if query_field_no gt 1> <#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}" /> <#elseif po.classType=='popup'> diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vueNativeSearchStyle.ftl b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vueNativeSearchStyle.ftl index 07c5a0f5..e3b7fd4f 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vueNativeSearchStyle.ftl +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vueNativeSearchStyle.ftl @@ -18,4 +18,5 @@ margin-bottom: 16px; height: 32px; } - } \ No newline at end of file + } + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi index 04e922ca..1376d209 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi @@ -138,6 +138,9 @@ export const searchFormSchema: FormSchema[] = [ }, <#elseif po.classType=='pca'> component: 'JAreaLinkage', + componentProps: { + saveCode: 'region', + }, <#elseif po.classType=='popup'> <#include "/common/form/vue3popup.ftl"> <#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'> @@ -249,6 +252,9 @@ export const formSchema: FormSchema[] = [ }, <#elseif po.classType =='pca'> component: 'JAreaLinkage', + componentProps: { + saveCode: 'region', + }, <#elseif po.classType =='markdown'> component: 'JMarkdownEditor',//注意string转换问题 <#elseif po.classType =='password'> diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei index de1a97b7..5c1fa5c5 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei @@ -14,6 +14,7 @@ // Emits声明 const emit = defineEmits(['register','success']); const isUpdate = ref(true); + const isDetail = ref(false); //表单配置 const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ //labelWidth: 150, @@ -27,6 +28,7 @@ await resetFields(); setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); isUpdate.value = !!data?.isUpdate; + isDetail.value = !!data?.showFooter; if (unref(isUpdate)) { //表单赋值 await setFieldsValue({ @@ -37,7 +39,7 @@ setProps({ disabled: !data?.showFooter }) }); //设置标题 - const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); + const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑')); //表单提交事件 async function handleSubmit(v) { try { @@ -57,11 +59,11 @@ \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi index e6b1e5eb..e7390cff 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi @@ -66,331 +66,6 @@ export const columns: BasicColumn[] = [ ]; -//查询数据 -export const searchFormSchema: FormSchema[] = [ -<#-- 开始循环 --> -<#list columns as po> -<#if po.fieldDbName=='bpm_status'> - <#assign bpm_flag=true> - -<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- --> -<#if po.isQuery=='Y' && po.fieldName !='delFlag'> -<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- --> -<#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: ${autoStringSuffix(po)}, -<#if po.classType=='sel_search'> - component: 'JSearchSelect', - componentProps:{ - dict: "${po.dictTable},${po.dictText},${po.dictField}" - }, -<#elseif po.classType=='sel_user'> -<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- --> - component: 'JSelectUser', -<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- --> -<#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> - dictCode: "${po.dictTable},${po.dictText},${po.dictField}" - <#elseif po.dictField?default("")?trim?length gt 1> - dictCode: "${po.dictField}" - - }, - <#elseif po.classType=='cat_tree'> - component: 'JCategorySelect', - componentProps:{ - pcode: "${po.dictField?default("")}",//back和事件未添加,暂时有问题 - }, -<#elseif po.classType=='date'> - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD' - }, -<#elseif po.classType=='datetime'> - component: 'DatePicker', - componentProps: { - showTime: true, - }, - <#elseif po.classType =='time'> - component: 'TimePicker', - componentProps: { - valueFormat: 'HH:mm:ss', - }, -<#elseif po.classType=='pca'> - component: 'JAreaLinkage', -<#elseif po.classType=='popup'> - <#include "/common/form/vue3popup.ftl"> -<#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.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> - -<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- --> -<#if po.isShow =='Y' && po.fieldName !='delFlag'> -<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- --> -<#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.classType =='date'> - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD' - }, - <#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'> -<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- --> - component: 'JSelectUser', -<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- --> - componentProps:{ - labelKey: 'realname', - }, - <#elseif po.classType =='textarea'> - component: 'InputTextArea', - <#elseif po.classType=='list'> - component: 'JDictSelectTag', - componentProps:{ - dictCode:"${form_field_dictCode}" - }, - <#elseif po.classType=='radio'> - component: 'JDictSelectTag', - componentProps:{ - dictCode:"${form_field_dictCode}", - type: "radio" - }, - <#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- --> - <#elseif po.classType=='list_multi'> - component: 'JSelectMultiple', - componentProps:{ - dictCode:"${form_field_dictCode}" - }, - <#elseif po.classType=='checkbox'> - component: 'JCheckbox', - componentProps:{ - dictCode:"${form_field_dictCode}" - }, - <#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- --> - <#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]}", - <#elseif po.dictText?split(',')[1]??> - pidField: "${po.dictText?split(',')[1]}", - <#elseif po.dictText?split(',')[3]??> - hasChildField: "${po.dictText?split(',')[3]}", - - - pidValue: "${po.dictField}", - }, - <#else> - component: 'Input', - - <#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}$|^(?=\d+\.\d+)[\d.]{7,17}$/, 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: /^[0-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, - }, - -]; - <#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- --> // 高级查询数据 export const superQuerySchema = { diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei index 9b8e4660..ac7ef232 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei @@ -245,8 +245,13 @@ if (changeParent) { reload(); } else { - // 编辑回调 - updateTableDataRecord(values.id, values); + let data = await list({ id: values.id, pageSize: 1, pageNo: 1, ${pidFieldName}: values['${pidFieldName}'] }); + if (data && data.records && data.records.length > 0) { + // 编辑回调 + updateTableDataRecord(values.id, data.records[0]); + }else{ + updateTableDataRecord(values.id, values); + } } } else { if(!values['id'] || !values['${pidFieldName}']){ diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi index d9fcb07a..c48f5678 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi @@ -141,6 +141,9 @@ export const searchFormSchema: FormSchema[] = [ }, <#elseif po.classType=='pca'> component: 'JAreaLinkage', + componentProps: { + saveCode: 'region', + }, <#elseif po.classType=='popup'> <#include "/common/form/vue3popup.ftl"> <#elseif po.classType == 'sel_tree'> @@ -280,7 +283,10 @@ export const formSchema: FormSchema[] = [ }, <#elseif po.classType =='pca'> - component: 'JAreaLinkage', + component: 'JAreaLinkage', + componentProps: { + saveCode: 'region', + }, <#elseif po.classType =='markdown'> component: 'JMarkdownEditor',//注意string转换问题 <#elseif po.classType =='password'> diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei index c5134628..a5dcd3a3 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei @@ -23,6 +23,7 @@ // 获取emit const emit = defineEmits(['register', 'success']); const isUpdate = ref(true); + const isDetail = ref(false); const expandedRowKeys = ref([]); const treeData = ref([]); // 当前编辑的数据 @@ -48,6 +49,7 @@ expandedRowKeys.value = []; setModalProps({confirmLoading: false, minHeight: 80 ,showOkBtn: !!!data?.hideFooter}); isUpdate.value = !!data?.isUpdate; + isDetail.value = !!data?.showFooter; if (data?.record) { model = data.record; //表单赋值 @@ -63,7 +65,7 @@ setProps({ disabled: !!data?.hideFooter }) }); //设置标题 - const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); + const getTitle = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑')); /** * 根据pid获取展开的节点 @@ -108,11 +110,11 @@ \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei index 671d1e27..c7ce0c49 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei @@ -220,7 +220,7 @@ */ function handleSuperQuery(params) { Object.keys(params).map((k) => { - queryParam[k] = params[k]; + queryParam.value[k] = params[k]; }); reload(); } @@ -288,8 +288,13 @@ if (changeParent) { reload(); } else { - // 编辑回调 - updateTableDataRecord(values.id, values); + let data = await list({ id: values.id, pageSize: 1, pageNo: 1, ${pidFieldName}: values['${pidFieldName}'] }); + if (data && data.records && data.records.length > 0) { + // 编辑回调 + updateTableDataRecord(values.id, data.records[0]); + }else{ + updateTableDataRecord(values.id, values); + } } } else { if (!values['id'] || !values['pid']) { @@ -528,7 +533,7 @@ */ function handleFormJoinChange(key, value) { if (typeof value != 'string') { - queryParam[key] = value.join(','); + queryParam.value[key] = value.join(','); } } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi index 9c8e6851..835486b9 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi @@ -70,360 +70,6 @@ export const columns: BasicColumn[] = [ ]; -//查询数据 -export const searchFormSchema: FormSchema[] = [ -<#-- 开始循环 --> -<#list columns as po> -<#if po.fieldDbName=='bpm_status'> - <#assign bpm_flag=true> - -<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- --> -<#if po.isQuery=='Y' && po.fieldName !='delFlag'> -<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- --> -<#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'> -<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- --> - component: 'JSelectUser', -<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- --> -<#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', - componentProps: { - valueFormat: 'YYYY-MM-DD' - }, -<#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> - -<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- --> -<#if po.isShow =='Y' && po.fieldName !='delFlag'> -<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- --> -<#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', - componentProps: { - valueFormat: 'YYYY-MM-DD' - }, - <#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'> -<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- --> - component: 'JSelectUser', -<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- --> - componentProps:{ - labelKey: 'realname', - }, - <#elseif po.classType =='textarea'> - component: 'InputTextArea', - <#elseif po.classType=='list'> - component: 'JDictSelectTag', - componentProps:{ - dictCode:"${form_field_dictCode}" - }, - <#elseif po.classType=='radio'> - component: 'JDictSelectTag', - componentProps:{ - dictCode:"${form_field_dictCode}", - type: "radio" - }, - <#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- --> - <#elseif po.classType=='list_multi'> - component: 'JSelectMultiple', - componentProps:{ - dictCode:"${form_field_dictCode}" - }, - <#elseif po.classType=='checkbox'> - component: 'JCheckbox', - componentProps:{ - dictCode:"${form_field_dictCode}" - }, - <#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- --> - <#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}$|^(?=\d+\.\d+)[\d.]{7,17}$/, 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: /^[0-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, - }, - -]; - <#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- --> // 高级查询数据 export const superQuerySchema = { diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei index 581f61f4..5a917fb1 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei @@ -17,70 +17,70 @@ <#-- 结束循环 --> -
- - - -