From c0aeef4881f5bb055a77b6c4083f87fcfac40656 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Sun, 10 Mar 2024 10:44:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=B7=BB=E5=8A=A0=E5=85=AC=E5=8F=B8=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/modules/gen/config.xml | 1 + .../templates/modules/gen/crud/vueForm.xml | 26 +++++++++++++++++++ .../templates/modules/gen/crud/vueList.xml | 14 +++++++++- .../templates/modules/gen/crud/vueSelect.xml | 14 +++++++++- .../modules/gen/include/dataGridScript.html | 4 +-- .../gen/include/dataGridSelectScript.html | 6 ++--- .../gen/include/formChildTableScript.html | 24 ++++++++++++++--- .../modules/gen/include/formControl.html | 6 +++++ .../modules/gen/include/searchForm.html | 6 +++++ 9 files changed, 91 insertions(+), 10 deletions(-) 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/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 251446fe..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 @@ -1,7 +1,7 @@