代码生成模板添加公司选择组件
This commit is contained in:
@@ -197,6 +197,7 @@
|
||||
<dict value="datetime" label="日期时间"/>
|
||||
<dict value="userselect" label="人员选择"/>
|
||||
<dict value="officeselect" label="机构选择"/>
|
||||
<dict value="companyselect" label="公司选择"/>
|
||||
<dict value="areaselect" label="区域选择"/>
|
||||
</showType>
|
||||
<!-- 字段验证 -->
|
||||
|
||||
@@ -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}',
|
||||
|
||||
@@ -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}',
|
||||
|
||||
@@ -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}',
|
||||
|
||||
@@ -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}',
|
||||
|
||||
@@ -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')){
|
||||
|
||||
@@ -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')){
|
||||
|
||||
@@ -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;
|
||||
%>
|
||||
|
||||
@@ -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('区域选择')}"
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
path="${c.attrName}" labelPath="${c.attrName2}"
|
||||
url="\${ctx}/sys/office/treeData" allowClear="true"/>
|
||||
</div>
|
||||
<% }else if(c.showType == 'companyselect'){ %>
|
||||
<div class="control-inline width-120" >
|
||||
<${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('机构选择')}"
|
||||
path="${c.attrName}" labelPath="${c.attrName2}"
|
||||
url="\${ctx}/sys/company/treeData" allowClear="true"/>
|
||||
</div>
|
||||
<% }else if(c.showType == 'areaselect'){ %>
|
||||
<div class="control-inline width-120" >
|
||||
<${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('区域选择')}"
|
||||
|
||||
Reference in New Issue
Block a user