代码优化
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.jeesite.common.utils.excel.fieldtype;
|
package com.jeesite.common.utils.excel.fieldtype;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.jeesite.common.collect.ListUtils;
|
import com.jeesite.common.collect.ListUtils;
|
||||||
@@ -31,14 +32,15 @@ public class PostListType implements FieldType {
|
|||||||
* 获取对象值(导入)
|
* 获取对象值(导入)
|
||||||
*/
|
*/
|
||||||
public Object getValue(String val) {
|
public Object getValue(String val) {
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
for (String s : StringUtils.split(val, ",")) {
|
for (String s : StringUtils.split(val, ",")) {
|
||||||
for (Post e : postList) {
|
for (Post e : postList) {
|
||||||
if (StringUtils.trimToEmpty(s).equals(e.getPostName())) {
|
if (StringUtils.trimToEmpty(s).equals(e.getPostName())) {
|
||||||
postList.add(e);
|
list.add(e.getPostCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return postList.size() > 0 ? postList : null;
|
return list.size() > 0 ? list.toArray(new String[list.size()]) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +52,7 @@ public class PostListType implements FieldType {
|
|||||||
List<Post> postList = (List<Post>) val;
|
List<Post> postList = (List<Post>) val;
|
||||||
return ListUtils.extractToString(postList, "postName", ", ");
|
return ListUtils.extractToString(postList, "postName", ", ");
|
||||||
}
|
}
|
||||||
return "";
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.jeesite.common.utils.excel.fieldtype;
|
package com.jeesite.common.utils.excel.fieldtype;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.jeesite.common.collect.ListUtils;
|
import com.jeesite.common.collect.ListUtils;
|
||||||
@@ -31,14 +32,15 @@ public class RoleListType implements FieldType {
|
|||||||
* 获取对象值(导入)
|
* 获取对象值(导入)
|
||||||
*/
|
*/
|
||||||
public Object getValue(String val) {
|
public Object getValue(String val) {
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
for (String s : StringUtils.split(val, ",")) {
|
for (String s : StringUtils.split(val, ",")) {
|
||||||
for (Role e : roleList) {
|
for (Role e : roleList) {
|
||||||
if (StringUtils.trimToEmpty(s).equals(e.getRoleName())) {
|
if (StringUtils.trimToEmpty(s).equals(e.getRoleName())) {
|
||||||
roleList.add(e);
|
list.add(e.getRoleCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return roleList.size() > 0 ? roleList : null;
|
return list.size() > 0 ? list.toArray(new String[list.size()]) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +52,7 @@ public class RoleListType implements FieldType {
|
|||||||
List<Role> roleList = (List<Role>) val;
|
List<Role> roleList = (List<Role>) val;
|
||||||
return ListUtils.extractToString(roleList, "roleName", ", ");
|
return ListUtils.extractToString(roleList, "roleName", ", ");
|
||||||
}
|
}
|
||||||
return "";
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,9 @@ for(c in table.columnList){
|
|||||||
component: 'TreeSelect',
|
component: 'TreeSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
|
style: 'width: calc(50% - 60px)',
|
||||||
},
|
},
|
||||||
|
colProps: { lg: 24, md: 24 },
|
||||||
},
|
},
|
||||||
<% }
|
<% }
|
||||||
for (c in table.columnList){
|
for (c in table.columnList){
|
||||||
@@ -108,7 +110,7 @@ for (c in table.columnList){
|
|||||||
field: '${c.attrName}',
|
field: '${c.attrName}',
|
||||||
<% if(c.showType == 'input' || c.showType == 'textarea'){ %>
|
<% if(c.showType == 'input' || c.showType == 'textarea'){ %>
|
||||||
<% if (c.simpleAttrType == 'Integer' && c.attrName == 'treeSort'){ %>
|
<% if (c.simpleAttrType == 'Integer' && c.attrName == 'treeSort'){ %>
|
||||||
helpMessage: '升序${c.dataLength}',
|
helpMessage: '升序',
|
||||||
component: 'InputNumber',
|
component: 'InputNumber',
|
||||||
defaultValue: '30',
|
defaultValue: '30',
|
||||||
<% }else{ %>
|
<% }else{ %>
|
||||||
|
|||||||
Reference in New Issue
Block a user