<#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]}"#if> #if>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[] = [
#list>
];
-//查询数据
-export const searchFormSchema: FormSchema[] = [
-<#-- 开始循环 -->
-<#list columns as po>
-<#if po.fieldDbName=='bpm_status'>
- <#assign bpm_flag=true>
-#if>
-<#-- 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>
-<#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}"
- #if>
- },
- <#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}"
- #if>
- },
- <#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}"
- #if>
- },
-<#else>
- component: 'Input',
-#if>
- //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 范围查询
-#if>
- //colProps: {span: 6},
- },
-#if>
-#if>
-#list>
-<#-- 结束循环 -->
-];
-
-//表单数据
-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>
-<#if po.fieldDbName == 'id'>
- <#assign id_exists = true>
-#if>
-<#-- 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}">
- #if>
- {
- 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}
- #if>
- },
- <#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}">
- #if>
- <#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}
- #if>
- },
- <#elseif po.classType=='image'>
- component: 'JImageUpload',
- componentProps:{
- <#if po.uploadnum??>
- fileMax: ${po.uploadnum}
- #if>
- },
- <#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]}",
- #if>
- #if>
- pidValue: "${po.dictField}",
- },
- <#else>
- component: 'Input',
- #if>
- <#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>
- <#-- 唯一校验 -->
- <#if fieldValidType == 'only'>
- {...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'#if>, '${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>
- ];
- #if>
- },
- #if>
- <#if po.readonly=='Y'>
- dynamicDisabled: true
- #if>
- },
-#if>
-#list>
-<#if id_exists == false>
- // TODO 主键隐藏字段,目前写死为ID
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false,
- },
-#if>
-];
-
<#-- 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[] = [
#if>
},
<#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(',');
}
}
#if>
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[] = [
#list>
];
-//查询数据
-export const searchFormSchema: FormSchema[] = [
-<#-- 开始循环 -->
-<#list columns as po>
-<#if po.fieldDbName=='bpm_status'>
- <#assign bpm_flag=true>
-#if>
-<#-- 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>
-<#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}',
- #if>
- },
- <#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}",
- #if>
- 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>
- <#if po.dictText?split(',')[1]??>
- pidField: "${po.dictText?split(',')[1]}",
- #if>
- <#if po.dictText?split(',')[3]??>
- hasChildField: "${po.dictText?split(',')[3]}",
- #if>
- #if>
- 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}"
- #if>
- },
-<#else>
- component: 'Input',
-#if>
- //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 范围查询
-#if>
- //colProps: {span: 6},
- },
-#if>
-#if>
-#list>
-<#-- 结束循环 -->
-];
-
-//表单数据
-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>
-<#if po.fieldDbName == 'id'>
- <#assign id_exists = true>
-#if>
-<#-- 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}">
- #if>
- {
- 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}
- #if>
- },
- <#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}">
- #if>
- <#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}
- #if>
- },
- <#elseif po.classType=='image'>
- component: 'JImageUpload',
- componentProps:{
- <#if po.uploadnum??>
- fileMax: ${po.uploadnum}
- #if>
- },
- <#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>
- <#if po.dictText?split(',')[1]??>
- pidField: "${po.dictText?split(',')[1]}",
- #if>
- <#if po.dictText?split(',')[3]??>
- hasChildField: "${po.dictText?split(',')[3]}",
- #if>
- #if>
- pidValue: "${po.dictField}",
- },
- <#else>
- component: 'Input',
- #if>
- <#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>
- <#-- 唯一校验 -->
- <#if fieldValidType == 'only'>
- {...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'#if>, '${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>
- ];
- #if>
- },
- #if>
- <#if po.readonly=='Y'>
- dynamicDisabled: true
- #if>
- },
-#if>
-#list>
-<#if id_exists == false>
- // TODO 主键隐藏字段,目前写死为ID
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false,
- },
-#if>
-];
-
<#-- 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 @@
#if>
#list>
<#-- 结束循环 -->
-
-
-
-
-
+
+
+
+
+
新增
- 导出
- 导入
+ 导出
+ 导入
-
-
-
-
- 删除
-
-
-
- 批量操作
-
-
-
+
+
+
+
+ 删除
+
+
+
+ 批量操作
+
+
+
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
-
-
+
+
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
-
-
-
-
-
-
-
- <#list columns as po>
- <#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
-
- <#if po.classType=='umeditor'>
-
-
- #if>
- <#if po.classType=='pca'>
-
- {{ getAreaTextByCode(text) }}
- #if>
- <#if po.classType=='file'>
-
- 无文件
- 下载
- #if>
- #if>
- #list>
-
-
-
-
+
+
+
+
+
+
+ <#list columns as po>
+ <#if po.classType=='umeditor' || po.classType=='pca' || po.classType=='file'>
+
+ <#if po.classType=='umeditor'>
+
+
+ #if>
+ <#if po.classType=='pca'>
+
+ {{ getAreaTextByCode(text) }}
+ #if>
+ <#if po.classType=='file'>
+
+ 无文件
+ 下载
+ #if>
+
+ #if>
+ #list>
+
+
+
+
<#assign sub_seq=1>
<#list subTables as sub>
forceRender#if>>
- <${sub.entityName}List/>
+ <${sub.entityName}List />
<#assign sub_seq=sub_seq+1>
#list>
-
-
+
+
<${entityName}Modal @register="registerModal" @success="handleSuccess">${entityName}Modal>
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
index 1c65925d..23dfc4c8 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
@@ -127,9 +127,12 @@ export const searchFormSchema: FormSchema[] = [
componentProps: {
showTime:true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
- },
+ },
<#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'>
@@ -242,6 +245,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'>
@@ -531,6 +537,9 @@ export const ${sub.entityName?uncap_first}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/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
index fcfbb02e..5c1fa5c5 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/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/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/[1-n]Modal.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/[1-n]Modal.vuei
index c437c380..772b4072 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/[1-n]Modal.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/[1-n]Modal.vuei
@@ -19,6 +19,7 @@
// Emits声明
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
+ const isDetail = ref(false);
//表单配置
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
//labelWidth: 150,
@@ -32,6 +33,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({
@@ -42,7 +44,7 @@
setProps({ disabled: !data?.showFooter })
});
//设置标题
- const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
+ const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//表单提交事件
async function handleSubmit(v) {
try {
@@ -66,12 +68,12 @@
#list>
\ No newline at end of file
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei
index 4974f34a..3ae935cc 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei
@@ -201,6 +201,11 @@
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
+ pagination: {
+ current: 1,
+ pageSize: 5,
+ pageSizeOptions: ['5', '10', '20'],
+ },
},
exportConfig: {
name:"${tableVo.ftlDescription}",
@@ -211,7 +216,7 @@
url: getImportUrl,
success: handleSuccess,
},
- })
+ })
const [registerTable, { reload },{ rowSelection, selectedRowKeys }] = tableContext
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi
index 47005490..c1e7b9c8 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi
@@ -65,339 +65,6 @@ export const columns: BasicColumn[] = [
#if>
#list>
];
-//查询数据
-export const searchFormSchema: FormSchema[] = [
-<#-- 开始循环 -->
-<#list columns as po>
-<#-- 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>
-<#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:{
- query:true,
- <#if po.dictField != 'is_open'>
- options:${po.dictField}
- #if>
- },
- <#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}",
- #if>
- 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,
- valueFormat: 'YYYY-MM-DD 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}"
- #if>
- },
-<#else>
- component: 'Input',
-#if>
- //colProps: {span: 6},
- },
-<#else>
- {
- label: "${po.filedComment}",
- field: "${po.fieldName}",
-<#if po.classType=='date'>
- component: 'RangePicker',
- componentProps: {
- valueType: 'Date',
- },
-<#elseif po.classType=='datetime'>
- component: 'RangePicker',
- componentProps: {
- valueType: 'Date',
- showTime:true
- },
-<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
- component: 'JRangeNumber',
-<#else>
- component: 'Input', //TODO 范围查询
-#if>
- //colProps: {span: 6},
- },
-#if>
-#if>
-#list>
-<#-- 结束循环 -->
-];
-
-//表单数据
-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>
-<#if po.fieldDbName == 'id'>
- <#assign id_exists = true>
-#if>
-<#-- 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}">
- #if>
- {
- 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'>
- component: 'DatePicker',
- componentProps: {
- valueFormat: 'YYYY-MM-DD'
- },
- 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}
- #if>
- },
- <#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',//TODO 注意string转换问题
- <#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}">
- #if>
- <#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}
- #if>
- },
- <#elseif po.classType=='image'>
- component: 'JImageUpload',
- componentProps:{
- <#if po.uploadnum??>
- fileMax:${po.uploadnum}
- #if>
- },
- <#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]}",
- #if>
- #if>
- pidValue:"${po.dictField}",
- },
- <#else>
- component: 'Input',
- #if>
- <#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>
- <#-- 唯一校验 -->
- <#if fieldValidType == 'only'>
- {...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'#if>, '${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>
- ];
- #if>
- },
- #if>
- <#if po.readonly=='Y'>
- dynamicDisabled:true,
- #if>
- },
-#if>
-#list>
-<#if id_exists == false>
- // TODO 主键隐藏字段,目前写死为ID
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false
- },
-#if>
-];
<#list subTables as sub>
//子表列表数据
@@ -462,222 +129,6 @@ export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
#if>
#list>
];
-//子表表单数据
-export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
-<#assign form_cat_tree = false>
-<#assign form_cat_back = "">
-<#assign bpm_flag=false>
-<#list sub.originalColumns as po><#rt/>
-<#if po.fieldName == 'id'>
- // TODO 子表隐藏字段,目前写死为ID
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false
- },
-#if>
-<#-- 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}">
- #if>
- {
- 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',
- 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}
- #if>
- },
- <#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}">
- #if>
- <#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}
- #if>
- },
- <#elseif po.classType=='image'>
- component: 'JImageUpload',
- componentProps:{
- <#if po.uploadnum??>
- fileMax:${po.uploadnum}
- #if>
- },
- <#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]}",
- #if>
- #if>
- pidValue:"${po.dictField}",
- },
- <#else>
- component: 'Input',
- #if>
- <#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>
- <#-- 唯一校验 -->
- <#if fieldValidType == 'only'>
- {...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'#if>, '${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>
- ];
- #if>
- },
- #if>
- <#if po.readonly=='Y'>
- dynamicDisabled:true,
- #if>
- },
-#if>
-#list>
-];
#list>
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
index 0c822ed7..873d4ff9 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
@@ -134,6 +134,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'>
@@ -245,6 +248,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'>
@@ -530,6 +536,9 @@ export const ${sub.entityName?uncap_first}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/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
index 6d583260..bb40e85e 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
@@ -202,11 +202,11 @@
\ No newline at end of file
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
index 1b134e4e..00c89cf4 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
@@ -2,34 +2,34 @@
-
-
-<#list subTables as sub><#rt/>
- <#assign refKey = sub.entityName?uncap_first/>
- <#if sub.foreignRelationType =='1'>
-
- <${sub.entityName}Form ref="${sub.entityName?uncap_first}Form" :disabled="formDisabled">${sub.entityName}Form>
-
-
- <#else>
-
-
-
- #if>
-#list>
-
+
+
+ <#list subTables as sub><#rt/>
+ <#assign refKey = sub.entityName?uncap_first/>
+ <#if sub.foreignRelationType =='1'>
+
+ <${sub.entityName}Form ref="${sub.entityName?uncap_first}Form" :disabled="formDisabled">${sub.entityName}Form>
+
+
+ <#else>
+
+
+
+ #if>
+ #list>
+
@@ -112,7 +112,7 @@
const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys<#if hasOne2One==true>,validateSubForm#if>);
//设置标题
- const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
+ const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(formDisabled) ? '编辑' : '详情'));
async function reset(){
await resetFields();
@@ -182,11 +182,11 @@
\ No newline at end of file
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
index f0f1730e..c039fa26 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
@@ -134,6 +134,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'>
@@ -245,6 +248,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'>
@@ -470,6 +476,9 @@ export const ${sub.entityName?uncap_first}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/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
index 4621df6d..1a13f91f 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
@@ -4,32 +4,31 @@
- <#list subTables as sub><#rt/>
- <#assign refKey = sub.entityName?uncap_first/>
- <#if sub.foreignRelationType =='1'>
-
- <${sub.entityName}Form ref="${sub.entityName?uncap_first}Form" :disabled="formDisabled">${sub.entityName}Form>
-
-
- <#else>
-
-
-
- #if>
- #list>
+ <#list subTables as sub><#rt/>
+ <#assign refKey = sub.entityName?uncap_first/>
+ <#if sub.foreignRelationType =='1'>
+
+ <${sub.entityName}Form ref="${sub.entityName?uncap_first}Form" :disabled="formDisabled">${sub.entityName}Form>
+
+ <#else>
+
+
+
+ #if>
+ #list>
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
index ac54465b..696a895d 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
@@ -112,7 +112,7 @@
const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys<#if hasOne2One==true>,validateSubForm#if>);
//设置标题
- const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
+ const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(formDisabled) ? '编辑' : '详情'));
async function reset(){
await resetFields();
@@ -182,11 +182,11 @@
\ No newline at end of file
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei
index 1a52aef6..c10f5fac 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei
@@ -148,7 +148,7 @@
import { useListPage } from '/@/hooks/system/useListPage'
import {useModal} from '/@/components/Modal';
import ${entityName}Modal from './components/${entityName}Modal.vue'
- import {columns, searchFormSchema, superQuerySchema} from './${entityName}.data';
+ import {columns, superQuerySchema} from './${entityName}.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
import {downloadFile} from '/@/utils/common/renderUtils';
<#include "/common/form/native/vue3NativeImport.ftl">
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi
index b775bfd5..c7983d53 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__data.tsi
@@ -66,544 +66,7 @@ export const columns: BasicColumn[] = [
#if>
#list>
];
-//查询数据
-export const searchFormSchema: FormSchema[] = [
-<#-- 开始循环 -->
-<#list columns as po>
-<#if po.fieldDbName=='bpm_status'>
- <#assign bpm_flag=true>
-#if>
-<#-- 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>
-<#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}"
- #if>
- },
- <#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}",
- #if>
- 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,
- valueFormat: 'YYYY-MM-DD 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}"
- #if>
- },
-<#else>
- component: 'Input',
-#if>
- //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 范围查询
-#if>
- //colProps: {span: 6},
- },
-#if>
-#if>
-#list>
-<#-- 结束循环 -->
-];
-//表单数据
-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>
-<#if po.fieldDbName == 'id'>
- <#assign id_exists = true>
-#if>
-<#-- 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}">
- #if>
- {
- 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}
- #if>
- },
- <#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}">
- #if>
- <#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}
- #if>
- },
- <#elseif po.classType=='image'>
- component: 'JImageUpload',
- componentProps:{
- <#if po.uploadnum??>
- fileMax:${po.uploadnum}
- #if>
- },
- <#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]}",
- #if>
- #if>
- pidValue:"${po.dictField}",
- },
- <#else>
- component: 'Input',
- #if>
- <#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>
- <#-- 唯一校验 -->
- <#if fieldValidType == 'only'>
- {...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'#if>, '${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>
- ];
- #if>
- },
- #if>
- <#if po.readonly=='Y'>
- dynamicDisabled:true
- #if>
- },
-#if>
-#list>
-<#if id_exists == false>
- // TODO 主键隐藏字段,目前写死为ID
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false
- },
-#if>
-];
-//子表单数据
-<#list subTables as sub>
-<#if sub.foreignRelationType =='1'>
-export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
-<#assign form_cat_tree = false>
-<#assign form_cat_back = "">
-<#assign bpm_flag=false>
-<#assign sub_id_exists=false>
-<#list sub.colums as po><#rt/>
-<#if po.fieldDbName=='bpm_status'>
- <#assign bpm_flag=true>
-#if>
-<#if po.fieldDbName=='id'>
- <#assign sub_id_exists=true>
-#if>
-<#-- 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}">
- #if>
- {
- label: '${po.filedComment}',
- field: ${autoStringSuffix(po)},
- <#if po.classType =='date'>
- component: 'DatePicker',
- <#elseif po.classType =='datetime'>
- component: 'DatePicker',
- componentProps: {
- valueFormat: 'YYYY-MM-DD'
- },
- 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}
- #if>
- },
- <#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}">
- #if>
- <#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}
- #if>
- },
- <#elseif po.classType=='image'>
- component: 'JImageUpload',
- componentProps:{
- <#if po.uploadnum??>
- fileMax:${po.uploadnum}
- #if>
- },
- <#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]}",
- #if>
- #if>
- pidValue:"${po.dictField}",
- },
- <#else>
- component: 'Input',
- #if>
- <#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>
- <#-- 唯一校验 -->
- <#if fieldValidType == 'only'>
- {...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'#if>, '${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>
- ];
- #if>
- },
- #if>
- <#if po.readonly=='Y'>
- dynamicDisabled:true
- #if>
- },
-#if>
-#list>
-<#if sub_id_exists == false>
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false
- },
-#if>
-];
-#if>
-#list>
+
//子表表格配置
<#list subTables as sub>
<#if sub.foreignRelationType =='0'>
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Modal.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Modal.vuei
index ef6c0310..d3f2690d 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Modal.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Modal.vuei
@@ -27,10 +27,9 @@
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
isUpdate.value = !!data?.isUpdate;
- title.value = data?.isUpdate?'编辑':'新增'
formDisabled.value = !data?.showFooter;
+ title.value = data?.isUpdate ? (unref(formDisabled) ? '详情' : '编辑') : '新增';
if (unref(isUpdate)) {
- console.log('data', data)
formComponent.value.edit(data.record)
}else{
formComponent.value.add()
@@ -59,11 +58,11 @@
\ No newline at end of file
diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
index 8d23797b..297bac2e 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
@@ -134,6 +134,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'>
@@ -245,6 +248,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'>
@@ -470,6 +476,9 @@ export const ${sub.entityName?uncap_first}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/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
index 12de1f6b..9502e822 100644
--- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
+++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
@@ -214,14 +214,14 @@