优化分组树,行政区划树的展示
parent
97b0616039
commit
c3267403ba
|
@ -10,7 +10,7 @@ import lombok.Data;
|
||||||
@Schema(description = "业务分组树")
|
@Schema(description = "业务分组树")
|
||||||
public class GroupTree extends Group{
|
public class GroupTree extends Group{
|
||||||
|
|
||||||
@Schema(description = "是否有子节点")
|
@Schema(description = "树节点ID")
|
||||||
private String treeId;
|
private String treeId;
|
||||||
|
|
||||||
@Schema(description = "是否有子节点")
|
@Schema(description = "是否有子节点")
|
||||||
|
|
|
@ -10,6 +10,9 @@ import lombok.Data;
|
||||||
@Schema(description = "区域树")
|
@Schema(description = "区域树")
|
||||||
public class RegionTree extends Region {
|
public class RegionTree extends Region {
|
||||||
|
|
||||||
|
@Schema(description = "树节点ID")
|
||||||
|
private String treeId;
|
||||||
|
|
||||||
@Schema(description = "是否有子节点")
|
@Schema(description = "是否有子节点")
|
||||||
private boolean isLeaf;
|
private boolean isLeaf;
|
||||||
|
|
||||||
|
|
|
@ -263,6 +263,7 @@ public interface CommonGBChannelMapper {
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
" select " +
|
" select " +
|
||||||
" id," +
|
" id," +
|
||||||
|
" concat('channel', id) as tree_id," +
|
||||||
" coalesce(gb_device_id, device_id) as device_id," +
|
" coalesce(gb_device_id, device_id) as device_id," +
|
||||||
" coalesce(gb_name, name) as name, " +
|
" coalesce(gb_name, name) as name, " +
|
||||||
" coalesce(gb_parent_id, parent_id) as parent_device_id, " +
|
" coalesce(gb_parent_id, parent_id) as parent_device_id, " +
|
||||||
|
@ -352,6 +353,7 @@ public interface CommonGBChannelMapper {
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
" select " +
|
" select " +
|
||||||
" id," +
|
" id," +
|
||||||
|
" concat('channel', id) as tree_id," +
|
||||||
" coalesce(gb_device_id, device_id) as device_id," +
|
" coalesce(gb_device_id, device_id) as device_id," +
|
||||||
" coalesce(gb_name, name) as name, " +
|
" coalesce(gb_name, name) as name, " +
|
||||||
" coalesce(gb_parent_id, parent_id) as parent_device_id, " +
|
" coalesce(gb_parent_id, parent_id) as parent_device_id, " +
|
||||||
|
|
|
@ -67,6 +67,7 @@ public interface GroupMapper {
|
||||||
@Select(" <script>" +
|
@Select(" <script>" +
|
||||||
" SELECT " +
|
" SELECT " +
|
||||||
" * , " +
|
" * , " +
|
||||||
|
" concat('group', id) as tree_id," +
|
||||||
" 0 as type," +
|
" 0 as type," +
|
||||||
" false as is_leaf" +
|
" false as is_leaf" +
|
||||||
" from wvp_common_group " +
|
" from wvp_common_group " +
|
||||||
|
|
|
@ -72,6 +72,7 @@ public interface RegionMapper {
|
||||||
@Select(" <script>" +
|
@Select(" <script>" +
|
||||||
" SELECT " +
|
" SELECT " +
|
||||||
" *, " +
|
" *, " +
|
||||||
|
" concat('region', id) as tree_id," +
|
||||||
" 0 as type," +
|
" 0 as type," +
|
||||||
" false as is_leaf" +
|
" false as is_leaf" +
|
||||||
" from wvp_common_region " +
|
" from wvp_common_region " +
|
||||||
|
|
|
@ -96,10 +96,10 @@ public class ChannelProvider {
|
||||||
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) is null");
|
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) is null");
|
||||||
}
|
}
|
||||||
if (params.get("hasGroup") != null && (Boolean)params.get("hasGroup")) {
|
if (params.get("hasGroup") != null && (Boolean)params.get("hasGroup")) {
|
||||||
sqlBuild.append(" AND coalesce(gb_business_group_id, business_group_id) is not null");
|
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is not null");
|
||||||
}
|
}
|
||||||
if (params.get("hasGroup") != null && !(Boolean)params.get("hasGroup")) {
|
if (params.get("hasGroup") != null && !(Boolean)params.get("hasGroup")) {
|
||||||
sqlBuild.append(" AND coalesce(gb_business_group_id, business_group_id) is null");
|
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null");
|
||||||
}
|
}
|
||||||
return sqlBuild.toString();
|
return sqlBuild.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<vue-easy-tree
|
<vue-easy-tree
|
||||||
class="flow-tree"
|
class="flow-tree"
|
||||||
ref="veTree"
|
ref="veTree"
|
||||||
node-key="deviceId"
|
node-key="treeId"
|
||||||
height="78vh"
|
height="78vh"
|
||||||
lazy
|
lazy
|
||||||
style="padding: 0 0 2rem 0.5rem"
|
style="padding: 0 0 2rem 0.5rem"
|
||||||
|
@ -74,6 +74,7 @@ export default {
|
||||||
loadNode: function (node, resolve) {
|
loadNode: function (node, resolve) {
|
||||||
if (node.level === 0) {
|
if (node.level === 0) {
|
||||||
resolve([{
|
resolve([{
|
||||||
|
treeId: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
name: "根资源组",
|
name: "根资源组",
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<vue-easy-tree
|
<vue-easy-tree
|
||||||
class="flow-tree"
|
class="flow-tree"
|
||||||
ref="veTree"
|
ref="veTree"
|
||||||
node-key="deviceId"
|
node-key="treeId"
|
||||||
height="78vh"
|
height="78vh"
|
||||||
lazy
|
lazy
|
||||||
style="padding: 0 0 2rem 0.5rem"
|
style="padding: 0 0 2rem 0.5rem"
|
||||||
|
@ -74,6 +74,7 @@ export default {
|
||||||
loadNode: function (node, resolve) {
|
loadNode: function (node, resolve) {
|
||||||
if (node.level === 0) {
|
if (node.level === 0) {
|
||||||
resolve([{
|
resolve([{
|
||||||
|
treeId: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
name: "根资源组",
|
name: "根资源组",
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
|
|
|
@ -67,8 +67,8 @@
|
||||||
<el-table-column label="添加状态" min-width="100">
|
<el-table-column label="添加状态" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div slot="reference" class="name-wrapper">
|
<div slot="reference" class="name-wrapper">
|
||||||
<el-tag size="medium" :title="scope.row.gbBusinessGroupId" v-if="scope.row.gbBusinessGroupId">已添加</el-tag>
|
<el-tag size="medium" :title="scope.row.gbParentId" v-if="scope.row.gbParentId">已添加</el-tag>
|
||||||
<el-tag size="medium" type="info" v-if="!scope.row.gbBusinessGroupId">未添加</el-tag>
|
<el-tag size="medium" type="info" v-if="!scope.row.gbParentId">未添加</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
Loading…
Reference in New Issue