修复行政区划树以及业务分组树的自动展开

pull/1642/head
648540858 2024-09-27 11:17:45 +08:00
parent c3267403ba
commit 726380cec4
5 changed files with 33 additions and 20 deletions

View File

@ -29,7 +29,6 @@ public class RedisPushStreamResponseListener implements MessageListener {
@Autowired @Autowired
private ThreadPoolTaskExecutor taskExecutor; private ThreadPoolTaskExecutor taskExecutor;
private Map<String, PushStreamResponseEvent> responseEvents = new ConcurrentHashMap<>(); private Map<String, PushStreamResponseEvent> responseEvents = new ConcurrentHashMap<>();
public interface PushStreamResponseEvent{ public interface PushStreamResponseEvent{

View File

@ -29,7 +29,7 @@
> >
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span @click.stop v-if="edit"> <span @click.stop v-if="edit">
<el-radio v-if="node.data.type === 0 && node.level > 2" style="margin-right: 0" v-model="chooseId" @input="chooseIdChange(node.data.deviceId, node.data.businessGroup)" :label="node.data.deviceId">{{''}}</el-radio> <el-radio v-if="node.data.type === 0 && node.level > 2" style="margin-right: 0" v-model="chooseId" @input="chooseIdChange(node.data.treeId, node.data.deviceId, node.data.businessGroup)" :label="node.data.deviceId">{{''}}</el-radio>
</span> </span>
<span v-if="node.data.type === 0" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span> <span v-if="node.data.type === 0" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span>
<span v-if="node.data.type === 1" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span> <span v-if="node.data.type === 1" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span>
@ -57,6 +57,7 @@ export default {
return { return {
props: { props: {
label: "name", label: "name",
id: "treeId"
}, },
showCode: false, showCode: false,
searchSrt: "", searchSrt: "",
@ -128,6 +129,7 @@ export default {
} }
}).then((res) => { }).then((res) => {
console.log("移除成功") console.log("移除成功")
console.log(node)
if (this.onChannelChange) { if (this.onChannelChange) {
this.onChannelChange() this.onChannelChange()
} }
@ -275,6 +277,7 @@ export default {
if (this.onChannelChange) { if (this.onChannelChange) {
this.onChannelChange() this.onChannelChange()
} }
console.log(node)
node.loaded = false node.loaded = false
node.expand(); node.expand();
}else { }else {
@ -333,14 +336,18 @@ export default {
}) })
}, },
refreshNode: function (node) { refreshNode: function (node) {
console.log(node)
node.loaded = false node.loaded = false
node.expand(); node.expand();
}, },
refresh: function (id) { refresh: function (id) {
console.log("刷新节点: " + id)
// node // node
let node = this.$refs.veTree.getNode(id) let node = this.$refs.veTree.getNode(id)
if (node) {
node.loaded = false node.loaded = false
node.expand(); node.expand();
}
}, },
addGroup: function (id, node) { addGroup: function (id, node) {
this.$refs.groupEdit.openDialog({ this.$refs.groupEdit.openDialog({
@ -352,6 +359,7 @@ export default {
parentId: node.data.id, parentId: node.data.id,
businessGroup: node.level > 2 ? node.data.businessGroup: node.data.deviceId, businessGroup: node.level > 2 ? node.data.businessGroup: node.data.deviceId,
},form => { },form => {
console.log(node)
node.loaded = false node.loaded = false
node.expand(); node.expand();
}, id); }, id);
@ -359,6 +367,7 @@ export default {
editGroup: function (id, node) { editGroup: function (id, node) {
console.log(node) console.log(node)
this.$refs.groupEdit.openDialog(node.data,form => { this.$refs.groupEdit.openDialog(node.data,form => {
console.log(node)
node.parent.loaded = false node.parent.loaded = false
node.parent.expand(); node.parent.expand();
}, id); }, id);

View File

@ -29,7 +29,7 @@
> >
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span @click.stop v-if="edit"> <span @click.stop v-if="edit">
<el-radio v-if="node.data.type === 0 && node.level !== 1 " style="margin-right: 0" v-model="chooseId" @input="chooseIdChange" :label="node.data.deviceId">{{''}}</el-radio> <el-radio v-if="node.data.type === 0 && node.level !== 1 " style="margin-right: 0" v-model="chooseId" @input="chooseIdChange(node.data.treeId, node.data.deviceId)" :label="node.data.deviceId">{{''}}</el-radio>
</span> </span>
<span v-if="node.data.type === 0" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span> <span v-if="node.data.type === 0" style="color: #409EFF" class="iconfont icon-bianzubeifen3"></span>
<span v-if="node.data.type === 1" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span> <span v-if="node.data.type === 1" style="color: #409EFF" class="iconfont icon-shexiangtou2"></span>
@ -337,8 +337,11 @@ export default {
refresh: function (id) { refresh: function (id) {
// node // node
let node = this.$refs.veTree.getNode(id) let node = this.$refs.veTree.getNode(id)
if (node) {
node.loaded = false node.loaded = false
node.expand(); node.expand();
}
}, },
addRegion: function (id, node) { addRegion: function (id, node) {

View File

@ -113,6 +113,7 @@ export default {
total: 0, total: 0,
loading: false, loading: false,
loadSnap: {}, loadSnap: {},
groupDeviceId: "",
groupId: "", groupId: "",
businessGroup: "", businessGroup: "",
multipleSelection: [] multipleSelection: []
@ -175,12 +176,10 @@ export default {
} }
}, },
rowDblclick: function (row, rowIndex) { rowDblclick: function (row, rowIndex) {
if (row.gbParentId) {
this.$refs.groupTree.refresh(row.gbParentId)
}
}, },
add: function (row) { add: function (row) {
if (!this.groupId) { if (!this.groupDeviceId) {
this.$message.info({ this.$message.info({
showClose: true, showClose: true,
message: "请选择左侧行政区划节点" message: "请选择左侧行政区划节点"
@ -204,7 +203,7 @@ export default {
method: 'post', method: 'post',
url: `/api/common/channel/group/add`, url: `/api/common/channel/group/add`,
data: { data: {
parentId: this.groupId, parentId: this.groupDeviceId,
businessGroup: this.businessGroup, businessGroup: this.businessGroup,
channelIds: channels channelIds: channels
} }
@ -261,7 +260,7 @@ export default {
}) })
this.getChannelList() this.getChannelList()
// //
this.$refs.groupTree.refresh(this.groupId) this.$refs.groupTree.refresh(this.groupDeviceId)
}else { }else {
this.$message.error({ this.$message.error({
showClose: true, showClose: true,
@ -292,8 +291,9 @@ export default {
treeNodeClickEvent: function (device, data, isCatalog) { treeNodeClickEvent: function (device, data, isCatalog) {
}, },
chooseIdChange: function (id, businessGroup) { chooseIdChange: function (id, deviceId, businessGroup) {
this.groupId = id; this.groupId = id;
this.groupDeviceId = deviceId;
this.businessGroup = businessGroup; this.businessGroup = businessGroup;
}, },
} }

View File

@ -114,6 +114,7 @@ export default {
loading: false, loading: false,
loadSnap: {}, loadSnap: {},
regionId: "", regionId: "",
regionDeviceId: "",
multipleSelection: [] multipleSelection: []
}; };
}, },
@ -175,12 +176,12 @@ export default {
} }
}, },
rowDblclick: function (row, rowIndex) { rowDblclick: function (row, rowIndex) {
if (row.gbCivilCode) { // if (row.gbCivilCode) {
this.$refs.regionTree.refresh(row.gbCivilCode) // this.$refs.regionTree.refresh(row.gbCivilCode)
} // }
}, },
add: function (row) { add: function (row) {
if (!this.regionId) { if (!this.regionDeviceId) {
this.$message.info({ this.$message.info({
showClose: true, showClose: true,
message: "请选择左侧行政区划节点" message: "请选择左侧行政区划节点"
@ -204,7 +205,7 @@ export default {
method: 'post', method: 'post',
url: `/api/common/channel/region/add`, url: `/api/common/channel/region/add`,
data: { data: {
civilCode: this.regionId, civilCode: this.regionDeviceId,
channelIds: channels channelIds: channels
} }
}).then((res)=> { }).then((res)=> {
@ -290,7 +291,8 @@ export default {
treeNodeClickEvent: function (device, data, isCatalog) { treeNodeClickEvent: function (device, data, isCatalog) {
}, },
chooseIdChange: function (id) { chooseIdChange: function (id, deviceId) {
this.regionDeviceId = deviceId;
this.regionId = id; this.regionId = id;
}, },
} }