Commit e7bdcc1f8ddf95ca4b0bb08fbcd962a8d8a2b83a
1 parent
d5e8aa62
修复选择通道时默认节点显示错误的问题
Showing
5 changed files
with
25 additions
and
10 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java
web_src/src/components/ParentPlatformList.vue
| ... | ... | @@ -143,7 +143,8 @@ export default { |
| 143 | 143 | }); |
| 144 | 144 | }, |
| 145 | 145 | chooseChannel: function(platform) { |
| 146 | - this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, platform.name, platform.catalogId, platform.treeType, this.initData) | |
| 146 | + console.log("platform.name: " + platform.name) | |
| 147 | + this.$refs.chooseChannelDialog.openDialog(platform.serverGBId,platform.deviceGBId, platform.name, platform.catalogId, platform.treeType, this.initData) | |
| 147 | 148 | }, |
| 148 | 149 | initData: function() { |
| 149 | 150 | this.getPlatformList(); | ... | ... |
web_src/src/components/dialog/chooseChannel.vue
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | <el-tab-pane label="目录结构" name="catalog"> |
| 9 | 9 | <el-container> |
| 10 | 10 | <el-main v-bind:style="{backgroundColor: '#FFF', maxHeight: winHeight + 'px'}"> |
| 11 | - <chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" :treeType=treeType ></chooseChannelForCatalog> | |
| 11 | + <chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformDeviceId=platformDeviceId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" :treeType=treeType ></chooseChannelForCatalog> | |
| 12 | 12 | </el-main> |
| 13 | 13 | </el-container> |
| 14 | 14 | </el-tab-pane> |
| ... | ... | @@ -60,6 +60,7 @@ export default { |
| 60 | 60 | tabActiveName: "gbChannel", |
| 61 | 61 | catalogTabActiveName: "catalog", |
| 62 | 62 | platformId: "", |
| 63 | + platformDeviceId: "", | |
| 63 | 64 | catalogId: "", |
| 64 | 65 | catalogName: "", |
| 65 | 66 | currentCatalogId: "", |
| ... | ... | @@ -73,8 +74,10 @@ export default { |
| 73 | 74 | }; |
| 74 | 75 | }, |
| 75 | 76 | methods: { |
| 76 | - openDialog(platformId, platformName, defaultCatalogId, treeType, closeCallback) { | |
| 77 | + openDialog(platformId, platformDeviceId, platformName, defaultCatalogId, treeType, closeCallback) { | |
| 78 | + console.log("defaultCatalogId: " + defaultCatalogId) | |
| 77 | 79 | this.platformId = platformId |
| 80 | + this.platformDeviceId = platformDeviceId | |
| 78 | 81 | this.platformName = platformName |
| 79 | 82 | this.defaultCatalogId = defaultCatalogId |
| 80 | 83 | this.showDialog = true | ... | ... |
web_src/src/components/dialog/chooseChannelForCatalog.vue
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | import catalogEdit from './catalogEdit.vue' |
| 39 | 39 | export default { |
| 40 | 40 | name: 'chooseChannelForCatalog', |
| 41 | - props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'], | |
| 41 | + props: ['platformId', 'platformDeviceId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'], | |
| 42 | 42 | created() { |
| 43 | 43 | this.chooseId = this.defaultCatalogId; |
| 44 | 44 | this.defaultCatalogIdSign = this.defaultCatalogId; |
| ... | ... | @@ -171,6 +171,7 @@ export default { |
| 171 | 171 | }); |
| 172 | 172 | }, |
| 173 | 173 | loadNode: function(node, resolve){ |
| 174 | + console.log("this.platformDeviceId: " + this.platformDeviceId) | |
| 174 | 175 | if (node.level === 0) { |
| 175 | 176 | resolve([ |
| 176 | 177 | { |
| ... | ... | @@ -179,7 +180,7 @@ export default { |
| 179 | 180 | type: -1 |
| 180 | 181 | },{ |
| 181 | 182 | name: this.platformName, |
| 182 | - id: this.platformId, | |
| 183 | + id: this.platformDeviceId, | |
| 183 | 184 | type: 0 |
| 184 | 185 | } |
| 185 | 186 | ]); |
| ... | ... | @@ -298,6 +299,8 @@ export default { |
| 298 | 299 | return false; |
| 299 | 300 | }, |
| 300 | 301 | nodeClickHandler: function (data, node, tree){ |
| 302 | + console.log(data) | |
| 303 | + console.log(node) | |
| 301 | 304 | this.chooseId = data.id; |
| 302 | 305 | this.chooseName = data.name; |
| 303 | 306 | if (this.catalogIdChange)this.catalogIdChange(this.chooseId, this.chooseName); | ... | ... |
web_src/src/components/dialog/getCatalog.vue
| ... | ... | @@ -77,6 +77,7 @@ export default { |
| 77 | 77 | }, |
| 78 | 78 | methods: { |
| 79 | 79 | openDialog(catalogIdResult) { |
| 80 | + console.log(this.chooseId) | |
| 80 | 81 | this.showDialog = true |
| 81 | 82 | this.catalogIdResult = catalogIdResult |
| 82 | 83 | }, |
| ... | ... | @@ -107,9 +108,6 @@ export default { |
| 107 | 108 | |
| 108 | 109 | }, |
| 109 | 110 | loadNode: function(node, resolve){ |
| 110 | - | |
| 111 | - | |
| 112 | - | |
| 113 | 111 | if (node.level === 0) { |
| 114 | 112 | this.$axios({ |
| 115 | 113 | method:"get", |
| ... | ... | @@ -124,7 +122,7 @@ export default { |
| 124 | 122 | resolve([ |
| 125 | 123 | { |
| 126 | 124 | name: this.platformName, |
| 127 | - id: this.platformId, | |
| 125 | + id: res.data.data.deviceGBId, | |
| 128 | 126 | type: 0 |
| 129 | 127 | } |
| 130 | 128 | ]); |
| ... | ... | @@ -142,9 +140,19 @@ export default { |
| 142 | 140 | this.chooseId = data.id; |
| 143 | 141 | }, |
| 144 | 142 | close: function() { |
| 143 | + this.chooseId = null; | |
| 145 | 144 | this.showDialog = false; |
| 146 | 145 | }, |
| 147 | 146 | submit: function() { |
| 147 | + console.log(this.chooseId) | |
| 148 | + if (this.chooseId === null) { | |
| 149 | + this.$message({ | |
| 150 | + showClose: true, | |
| 151 | + message: '未选择任何节点,', | |
| 152 | + type: 'warning' | |
| 153 | + }); | |
| 154 | + return; | |
| 155 | + } | |
| 148 | 156 | if (this.catalogIdResult)this.catalogIdResult(this.chooseId) |
| 149 | 157 | this.showDialog = false; |
| 150 | 158 | }, | ... | ... |