1
This commit is contained in:
@@ -82,7 +82,10 @@ public class SysUnitController {
|
||||
// cnd.and("unitTypeCode", "=", "1");
|
||||
cnd.asc("unitcode");
|
||||
cnd.and(Cnd.likeEX("name", unitName));
|
||||
|
||||
SqlExpressionGroup group = Cnd.NEW().where();
|
||||
group.and("delFlag", "=", false);
|
||||
group.orIsNull("delFlag");
|
||||
cnd.and(group);
|
||||
Pagination<Sys_unit> listPage = sysUnitService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), Sys_unit.class, cnd);
|
||||
return Result.success(listPage);
|
||||
}
|
||||
@@ -201,12 +204,22 @@ public class SysUnitController {
|
||||
} else {
|
||||
cnd.and("parentId", "=", pid);
|
||||
}
|
||||
SqlExpressionGroup group = Cnd.NEW().where();
|
||||
group.and("delFlag", "=", false);
|
||||
group.orIsNull("delFlag");
|
||||
cnd.and(group);
|
||||
cnd.asc("location").asc("path");
|
||||
list = sysUnitService.query(cnd);
|
||||
} else {
|
||||
Sys_user user = sysUserService.getUserById(SecurityUtil.getUserId());
|
||||
if (user != null && Strings.isBlank(pid)) {
|
||||
list = sysUnitService.query(Cnd.where("id", "=", user.getUnitId()).asc("path"));
|
||||
Cnd cnd = Cnd.where("id", "=", user.getUnitId());
|
||||
SqlExpressionGroup group = Cnd.NEW().where();
|
||||
group.and("delFlag", "=", false);
|
||||
group.orIsNull("delFlag");
|
||||
cnd.and(group);
|
||||
cnd.asc("path");
|
||||
list = sysUnitService.query(cnd);
|
||||
} else {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (Strings.isBlank(pid)) {
|
||||
@@ -214,6 +227,10 @@ public class SysUnitController {
|
||||
} else {
|
||||
cnd.and("parentId", "=", pid);
|
||||
}
|
||||
SqlExpressionGroup group = Cnd.NEW().where();
|
||||
group.and("delFlag", "=", false);
|
||||
group.orIsNull("delFlag");
|
||||
cnd.and(group);
|
||||
cnd.asc("location").asc("path");
|
||||
list = sysUnitService.query(cnd);
|
||||
}
|
||||
@@ -285,6 +302,10 @@ public class SysUnitController {
|
||||
try {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("id", "=", pid);
|
||||
SqlExpressionGroup group = Cnd.NEW().where();
|
||||
group.and("delFlag", "=", false);
|
||||
group.orIsNull("delFlag");
|
||||
cnd.and(group);
|
||||
cnd.asc("unitcode");
|
||||
List<Sys_unit> list = sysUnitService.query(cnd);
|
||||
|
||||
|
||||
@@ -99,9 +99,9 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl<Sys_unit> implem
|
||||
|
||||
if (StringUtils.isNotBlank(unit.getDelFlagStr())) {
|
||||
if (unit.getDelFlagStr().equals("1")) {
|
||||
unit.setDelFlag(true);
|
||||
} else {
|
||||
unit.setDelFlag(false);
|
||||
} else {
|
||||
unit.setDelFlag(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ public class CommonController {
|
||||
cnd.andEX("unit.unionId", "=", unionId);
|
||||
cnd.and("unit.unitTypeCode", "=", "1");
|
||||
cnd.asc("unit.unitcode");
|
||||
cnd.and("unit.delFlag", "=", false);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> unitList = sysUserService.listMap(sql);
|
||||
return Result.success(unitList);
|
||||
|
||||
@@ -82,7 +82,7 @@ layout("/layouts/platform.html"){
|
||||
:expand-on-click-node="false"
|
||||
:props="{ children: 'children', label: 'name' }"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
:default-expanded-keys="firstLevelExpandedKeys"
|
||||
@node-click="treeNodeClick"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
@@ -157,6 +157,7 @@ layout("/layouts/platform.html"){
|
||||
filterText: null,
|
||||
currentTreeNode: null,
|
||||
currentTreeData: null,
|
||||
firstLevelExpandedKeys: [],
|
||||
treeData: []
|
||||
}
|
||||
},
|
||||
@@ -176,6 +177,10 @@ layout("/layouts/platform.html"){
|
||||
this.treeData = res.data
|
||||
if (this.treeData) {
|
||||
this.currentTreeData = this.treeData[0]
|
||||
// 默认只展开树的第一层级,避免多级单位数据一次性全部展开。
|
||||
this.firstLevelExpandedKeys = this.treeData.map(function (item) {
|
||||
return item.id
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user