Compare commits

..

1 Commits

Author SHA1 Message Date
WangXuewen
363f9b0ea6
Pre Merge pull request !34 from WangXuewen/master 2025-07-02 22:45:28 +00:00
4 changed files with 23 additions and 18 deletions

View File

@ -5,7 +5,7 @@
:show-header="true" :show-header="true"
:edit="true" :edit="true"
@clickEvent="treeNodeClickEvent" @clickEvent="treeNodeClickEvent"
@onChannelChange="onChannelChange" :on-channel-change="onChannelChange"
:enable-add-channel="true" :enable-add-channel="true"
:add-channel-to-group="addChannelToGroup" :add-channel-to-group="addChannelToGroup"
/> />
@ -306,10 +306,7 @@ export default {
}) })
}, },
onChannelChange: function(deviceId) { onChannelChange: function(deviceId) {
//
if (this.groupDeviceId === deviceId) {
this.getChannelList()
}
}, },
showUnusualChanel: function() { showUnusualChanel: function() {
this.$refs.unusualGroupChannelSelect.openDialog() this.$refs.unusualGroupChannelSelect.openDialog()

View File

@ -5,7 +5,7 @@
:show-header="true" :show-header="true"
:edit="true" :edit="true"
@clickEvent="treeNodeClickEvent" @clickEvent="treeNodeClickEvent"
@onChannelChange="onChannelChange" :on-channel-change="onChannelChange"
:enable-add-channel="true" :enable-add-channel="true"
:add-channel-to-civil-code="addChannelToCivilCode" :add-channel-to-civil-code="addChannelToCivilCode"
/> />
@ -296,9 +296,7 @@ export default {
console.log(selectedData) console.log(selectedData)
}, },
onChannelChange: function(deviceId) { onChannelChange: function(deviceId) {
if (this.regionDeviceId === deviceId) { //
this.getChannelList()
}
} }
} }
} }

View File

@ -130,7 +130,7 @@ export default {
GbChannelSelect, GbChannelSelect,
VueEasyTree, groupEdit, gbDeviceSelect VueEasyTree, groupEdit, gbDeviceSelect
}, },
props: ['edit', 'enableAddChannel', 'showHeader', 'hasChannel', 'addChannelToGroup', 'treeHeight'], props: ['edit', 'enableAddChannel', 'onChannelChange', 'showHeader', 'hasChannel', 'addChannelToGroup', 'treeHeight'],
data() { data() {
return { return {
props: { props: {
@ -328,7 +328,9 @@ export default {
.then(data => { .then(data => {
node.parent.loaded = false node.parent.loaded = false
node.parent.expand() node.parent.expand()
this.$emit('onChannelChange', node.data.deviceId) if (this.onChannelChange) {
this.onChannelChange(node.data.deviceId)
}
}) })
}, },
addChannelFormDevice: function(id, node) { addChannelFormDevice: function(id, node) {
@ -337,7 +339,7 @@ export default {
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
deviceIds.push(rows[i].id) deviceIds.push(rows[i].id)
} }
this.$store.dispatch('commonChanel/addDeviceToGroup', { this.$store.dispatch('group/add', {
parentId: node.data.deviceId, parentId: node.data.deviceId,
businessGroup: node.data.businessGroup, businessGroup: node.data.businessGroup,
deviceIds: deviceIds deviceIds: deviceIds
@ -347,7 +349,10 @@ export default {
showClose: true, showClose: true,
message: '保存成功' message: '保存成功'
}) })
this.$emit('onChannelChange', node.data.deviceId) if (this.onChannelChange) {
this.onChannelChange()
}
console.log(node)
node.loaded = false node.loaded = false
node.expand() node.expand()
}).finally(() => { }).finally(() => {
@ -367,7 +372,9 @@ export default {
showClose: true, showClose: true,
message: '保存成功' message: '保存成功'
}) })
this.$emit('onChannelChange', node.data.deviceId) if (this.onChannelChange) {
this.onChannelChange()
}
node.loaded = false node.loaded = false
node.expand() node.expand()
}).finally(() => { }).finally(() => {

View File

@ -131,7 +131,7 @@ export default {
GbChannelSelect, GbChannelSelect,
VueEasyTree, regionEdit, gbDeviceSelect VueEasyTree, regionEdit, gbDeviceSelect
}, },
props: ['edit', 'enableAddChannel', 'showHeader', 'hasChannel', 'addChannelToCivilCode', 'treeHeight'], props: ['edit', 'enableAddChannel', 'onChannelChange', 'showHeader', 'hasChannel', 'addChannelToCivilCode', 'treeHeight'],
data() { data() {
return { return {
props: { props: {
@ -331,7 +331,6 @@ export default {
this.$store.dispatch('region/deleteRegion', node.data.id) this.$store.dispatch('region/deleteRegion', node.data.id)
.then((data) => { .then((data) => {
console.log('移除成功') console.log('移除成功')
this.$emit('onChannelChange', node.data.deviceId)
node.parent.loaded = false node.parent.loaded = false
node.parent.expand() node.parent.expand()
}).catch(function(error) { }).catch(function(error) {
@ -352,7 +351,9 @@ export default {
showClose: true, showClose: true,
message: '保存成功' message: '保存成功'
}) })
this.$emit('onChannelChange', node.data.deviceId) if (this.onChannelChange) {
this.onChannelChange()
}
node.loaded = false node.loaded = false
node.expand() node.expand()
}).catch(function(error) { }).catch(function(error) {
@ -374,7 +375,9 @@ export default {
showClose: true, showClose: true,
message: '保存成功' message: '保存成功'
}) })
this.$emit('onChannelChange', node.data.deviceId) if (this.onChannelChange) {
this.onChannelChange(node.data.deviceId)
}
node.loaded = false node.loaded = false
node.expand() node.expand()
}).catch(function(error) { }).catch(function(error) {