diff --git a/modules/core/src/main/resources/templates/modules/gen/config.xml b/modules/core/src/main/resources/templates/modules/gen/config.xml index 04d37b26..7cdf648f 100644 --- a/modules/core/src/main/resources/templates/modules/gen/config.xml +++ b/modules/core/src/main/resources/templates/modules/gen/config.xml @@ -197,6 +197,7 @@ + diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml index cc751e7d..f44c3441 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml @@ -78,6 +78,7 @@ <% var userselectExists = false; var officeselectExists = false; +var companyselectExists = false; var areaselectExists = false; for(c in table.columnList){ if(c.isQuery == "1" && !c.isTreeEntityColumn){ @@ -85,6 +86,8 @@ for(c in table.columnList){ userselectExists = true; }else if(c.showType == 'officeselect'){ officeselectExists = true; + }else if(c.showType == 'companyselect'){ + companyselectExists = true; }else if(c.showType == 'areaselect'){ areaselectExists = true; } @@ -94,6 +97,9 @@ for(c in table.columnList){ <% if(userselectExists || officeselectExists) { %> import { officeTreeData } from '/@/api/sys/office'; <% } %> +<% if(companyselectExists) { %> + import { companyTreeData } from '/@/api/sys/company'; +<% } %> <% if(areaselectExists) { %> import { areaTreeData } from '/@/api/sys/area'; <% } %> @@ -206,6 +212,16 @@ for (c in table.columnList){ canSelectParent: false, allowClear: true, }, + <% }else if(c.showType == 'companyselect'){ + if (isNotBlank(c.attrName2)){ %> + fieldLabel: '${c.attrName2}', + <% } %> + component: 'TreeSelect', + componentProps: { + api: companyTreeData, + canSelectParent: false, + allowClear: true, + }, <% }else if(c.showType == 'areaselect'){ if (isNotBlank(c.attrName2)){ %> fieldLabel: '${c.attrName2}', @@ -532,6 +548,16 @@ for (c in table.columnList){ canSelectParent: false, allowClear: true, }, + <% }else if(c.showType == 'companyselect'){ + if (isNotBlank(c.attrName2)){ %> + dataLabel: '${c.attrName2}', + <% } %> + editComponent: 'TreeSelect', + editComponentProps: { + api: companyTreeData, + canSelectParent: false, + allowClear: true, + }, <% }else if(c.showType == 'areaselect'){ if (isNotBlank(c.attrName2)){ %> dataLabel: '${c.attrName2}', diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueFormRoute.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueFormRoute.xml index 311d8471..9827f0b8 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueFormRoute.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueFormRoute.xml @@ -76,6 +76,7 @@ <% var userselectExists = false; var officeselectExists = false; +var companyselectExists = false; var areaselectExists = false; for(c in table.columnList){ if(c.isQuery == "1" && !c.isTreeEntityColumn){ @@ -83,6 +84,8 @@ for(c in table.columnList){ userselectExists = true; }else if(c.showType == 'officeselect'){ officeselectExists = true; + }else if(c.showType == 'companyselect'){ + companyselectExists = true; }else if(c.showType == 'areaselect'){ areaselectExists = true; } @@ -92,6 +95,9 @@ for(c in table.columnList){ <% if(userselectExists || officeselectExists) { %> import { officeTreeData } from '/@/api/sys/office'; <% } %> +<% if(companyselectExists) { %> + import { companyTreeData } from '/@/api/sys/company'; +<% } %> <% if(areaselectExists) { %> import { areaTreeData } from '/@/api/sys/area'; <% } %> @@ -220,6 +226,16 @@ for (c in table.columnList){ canSelectParent: false, allowClear: true, }, + <% }else if(c.showType == 'companyselect'){ + if (isNotBlank(c.attrName2)){ %> + fieldLabel: '${c.attrName2}', + <% } %> + component: 'TreeSelect', + componentProps: { + api: companyTreeData, + canSelectParent: false, + allowClear: true, + }, <% }else if(c.showType == 'areaselect'){ if (isNotBlank(c.attrName2)){ %> fieldLabel: '${c.attrName2}', @@ -559,6 +575,16 @@ for (c in table.columnList){ canSelectParent: false, allowClear: true, }, + <% }else if(c.showType == 'companyselect'){ + if (isNotBlank(c.attrName2)){ %> + dataLabel: '${c.attrName2}', + <% } %> + editComponent: 'TreeSelect', + editComponentProps: { + api: companyTreeData, + canSelectParent: false, + allowClear: true, + }, <% }else if(c.showType == 'areaselect'){ if (isNotBlank(c.attrName2)){ %> dataLabel: '${c.attrName2}', diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml index a1720547..3350a24e 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml @@ -115,6 +115,7 @@ if(table.isTreeEntity){ <% var userselectExists = false; var officeselectExists = false; +var companyselectExists = false; var areaselectExists = false; for(c in table.columnList){ if(c.isQuery == "1" && !c.isTreeEntityColumn){ @@ -122,6 +123,8 @@ for(c in table.columnList){ userselectExists = true; }else if(c.showType == 'officeselect'){ officeselectExists = true; + }else if(c.showType == 'companyselect'){ + companyselectExists = true; }else if(c.showType == 'areaselect'){ areaselectExists = true; } @@ -131,6 +134,9 @@ for(c in table.columnList){ <% if(userselectExists || officeselectExists) { %> import { officeTreeData } from '/@/api/sys/office'; <% } %> +<% if(companyselectExists) { %> + import { companyTreeData } from '/@/api/sys/company'; +<% } %> <% if(areaselectExists) { %> import { areaTreeData } from '/@/api/sys/area'; <% } %> @@ -239,6 +245,12 @@ for(c in table.columnList){ api: officeTreeData, allowClear: true, }, + <% }else if(c.showType == 'companyselect'){ %> + component: 'TreeSelect', + componentProps: { + api: companyTreeData, + allowClear: true, + }, <% }else if(c.showType == 'areaselect'){ %> component: 'TreeSelect', componentProps: { @@ -287,7 +299,7 @@ for(c in table.columnList){ %> { title: t('${c.columnLabel}'), - <% if(c.showType == "userselect" || c.showType == "officeselect" || c.showType == "areaselect"){ %> + <% if(c.showType == "userselect" || c.showType == "officeselect" || c.showType == "companyselect" || c.showType == "areaselect"){ %> dataIndex: '${c.attrName2}', <% }else{ %> dataIndex: '${c.attrName}', diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueSelect.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueSelect.xml index a74f36c7..d71c5d5a 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueSelect.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueSelect.xml @@ -12,6 +12,7 @@ import { ${className}ListData } from '/@/api/${moduleName}${isNotEmpty(subModule <% var userselectExists = false; var officeselectExists = false; +var companyselectExists = false; var areaselectExists = false; for(c in table.columnList){ if(c.isQuery == "1" && !c.isTreeEntityColumn){ @@ -19,6 +20,8 @@ for(c in table.columnList){ userselectExists = true; }else if(c.showType == 'officeselect'){ officeselectExists = true; + }else if(c.showType == 'companyselect'){ + companyselectExists = true; }else if(c.showType == 'areaselect'){ areaselectExists = true; } @@ -28,6 +31,9 @@ for(c in table.columnList){ <% if(userselectExists || officeselectExists) { %> import { officeTreeData } from '/@/api/sys/office'; <% } %> +<% if(companyselectExists) { %> +import { companyTreeData } from '/@/api/sys/company'; +<% } %> <% if(areaselectExists) { %> import { areaTreeData } from '/@/api/sys/area'; <% } %> @@ -103,6 +109,12 @@ const searchForm: FormProps = { api: officeTreeData, allowClear: true, }, + <% }else if(c.showType == 'companyselect'){ %> + component: 'TreeSelect', + componentProps: { + api: companyTreeData, + allowClear: true, + }, <% }else if(c.showType == 'areaselect'){ %> component: 'TreeSelect', componentProps: { @@ -151,7 +163,7 @@ for(c in table.columnList){ %> { title: t('${c.columnLabel}'), - <% if(c.showType == "userselect" || c.showType == "officeselect" || c.showType == "areaselect"){ %> + <% if(c.showType == "userselect" || c.showType == "officeselect" || c.showType == "companyselect" || c.showType == "areaselect"){ %> dataIndex: '${c.attrName2}', <% }else{ %> dataIndex: '${c.attrName}', diff --git a/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html b/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html index ad8f4869..ac566ad4 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html @@ -48,7 +48,7 @@ $('#dataGrid').dataGrid({ {header:'\${text("${c.columnLabel}")}', name:'${c.attrName}', index:'a.${c.columnName}', width:150, align:"center", formatter: function(val, obj, row, act){ return js.getDictLabel(\"#{@DictUtils.getDictListJson('${c.optionMap['dictType']}')}", val, '\${text("未知")}', true); }}, - <% }else if(c.showType == "userselect" || c.showType == "officeselect" || c.showType == "areaselect"){ %> + <% }else if(c.showType == "userselect" || c.showType == "officeselect" || c.showType == "companyselect" || c.showType == "areaselect"){ %> {header:'\${text("${c.columnLabel}")}', name:'${c.attrName2}', index:'a.${c.columnName}', width:150, align:"center"}, <% }else{ if (@StringUtils.inString(c.attrType, 'java.util.Date', 'Integer', 'Long')){ diff --git a/modules/core/src/main/resources/templates/modules/gen/include/dataGridSelectScript.html b/modules/core/src/main/resources/templates/modules/gen/include/dataGridSelectScript.html index c47a7299..2812fe63 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/dataGridSelectScript.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/dataGridSelectScript.html @@ -44,7 +44,7 @@ selectNum = 0, dataGrid = $('#dataGrid').dataGrid({ {header:'\${text("${c.columnLabel}")}', name:'${c.attrName}', index:'a.${c.columnName}', width:150, align:"center", formatter: function(val, obj, row, act){ return js.getDictLabel(\"#{@DictUtils.getDictListJson('${c.optionMap['dictType']}')}", val, '\${text("未知")}', true); }}, - <% }else if(c.showType == "userselect" || c.showType == "officeselect" || c.showType == "areaselect"){ %> + <% }else if(c.showType == "userselect" || c.showType == "officeselect" || c.showType == "companyselect" || c.showType == "areaselect"){ %> {header:'\${text("${c.columnLabel}")}', name:'${c.attrName2}', index:'a.${c.columnName}', width:150, align:"center"}, <% }else{ if (@StringUtils.inString(c.attrType, 'java.util.Date', 'Integer', 'Long')){ diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html b/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html index 315fc28e..d1e860af 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html @@ -120,7 +120,25 @@ for (c in child.columnList){ } } }, -<% +<% + }else if(c.showType == 'companyselect'){ + treeselectExists = true; +%> + {header:'\${text("${c.columnLabel}")}', name:'${c.simpleAttrName}', width:150, + formatter: function(val, obj, row, act){ + return js.val(row, '${c.attrName}')+'|'+js.val(row, '${c.attrName2}'); + }, editable: true, edittype: "custom", editoptions: { + custom_element: function(val, editOptions) { + return js.template('treeselectTpl', { + id: 'company_'+editOptions.id, title: '公司选择', + name: '${c.attrName}', value: val.split('|')[0], + labelName: '${c.attrName2}', labelValue: val.split('|')[1], + url: '\${ctx}/sys/company/treeData', cssClass: '${cssClass}' + }); + } + } + }, +<% }else if(c.showType == 'areaselect'){ treeselectExists = true; %> diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html index 115fd26f..02cb3c60 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html @@ -147,6 +147,12 @@ path="${c.attrName}" labelPath="${c.attrName2}" url="\${ctx}/sys/office/treeData" class="${cssClass}" allowClear="true"/> + <% + } else if (c.showType == 'companyselect') { + %><${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('公司选择')}" + path="${c.attrName}" labelPath="${c.attrName2}" + url="\${ctx}/sys/company/treeData" + class="${cssClass}" allowClear="true"/> <% } else if (c.showType == 'areaselect') { %><${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('区域选择')}" diff --git a/modules/core/src/main/resources/templates/modules/gen/include/searchForm.html b/modules/core/src/main/resources/templates/modules/gen/include/searchForm.html index 481e7688..a80ef67e 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/searchForm.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/searchForm.html @@ -56,6 +56,12 @@ path="${c.attrName}" labelPath="${c.attrName2}" url="\${ctx}/sys/office/treeData" allowClear="true"/> + <% }else if(c.showType == 'companyselect'){ %> +
+ <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('机构选择')}" + path="${c.attrName}" labelPath="${c.attrName2}" + url="\${ctx}/sys/company/treeData" allowClear="true"/> +
<% }else if(c.showType == 'areaselect'){ %>
<${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('区域选择')}"