Commit e7bdcc1f8ddf95ca4b0bb08fbcd962a8d8a2b83a

Authored by 648540858
1 parent d5e8aa62

修复选择通道时默认节点显示错误的问题

src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java
@@ -53,7 +53,7 @@ public class ParentPlatform { @@ -53,7 +53,7 @@ public class ParentPlatform {
53 /** 53 /**
54 * 设备国标编号 54 * 设备国标编号
55 */ 55 */
56 - @Schema(description = "11111") 56 + @Schema(description = "设备国标编号")
57 private String deviceGBId; 57 private String deviceGBId;
58 58
59 /** 59 /**
web_src/src/components/ParentPlatformList.vue
@@ -143,7 +143,8 @@ export default { @@ -143,7 +143,8 @@ export default {
143 }); 143 });
144 }, 144 },
145 chooseChannel: function(platform) { 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 initData: function() { 149 initData: function() {
149 this.getPlatformList(); 150 this.getPlatformList();
web_src/src/components/dialog/chooseChannel.vue
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 <el-tab-pane label="目录结构" name="catalog"> 8 <el-tab-pane label="目录结构" name="catalog">
9 <el-container> 9 <el-container>
10 <el-main v-bind:style="{backgroundColor: '#FFF', maxHeight: winHeight + 'px'}"> 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 </el-main> 12 </el-main>
13 </el-container> 13 </el-container>
14 </el-tab-pane> 14 </el-tab-pane>
@@ -60,6 +60,7 @@ export default { @@ -60,6 +60,7 @@ export default {
60 tabActiveName: "gbChannel", 60 tabActiveName: "gbChannel",
61 catalogTabActiveName: "catalog", 61 catalogTabActiveName: "catalog",
62 platformId: "", 62 platformId: "",
  63 + platformDeviceId: "",
63 catalogId: "", 64 catalogId: "",
64 catalogName: "", 65 catalogName: "",
65 currentCatalogId: "", 66 currentCatalogId: "",
@@ -73,8 +74,10 @@ export default { @@ -73,8 +74,10 @@ export default {
73 }; 74 };
74 }, 75 },
75 methods: { 76 methods: {
76 - openDialog(platformId, platformName, defaultCatalogId, treeType, closeCallback) { 77 + openDialog(platformId, platformDeviceId, platformName, defaultCatalogId, treeType, closeCallback) {
  78 + console.log("defaultCatalogId: " + defaultCatalogId)
77 this.platformId = platformId 79 this.platformId = platformId
  80 + this.platformDeviceId = platformDeviceId
78 this.platformName = platformName 81 this.platformName = platformName
79 this.defaultCatalogId = defaultCatalogId 82 this.defaultCatalogId = defaultCatalogId
80 this.showDialog = true 83 this.showDialog = true
web_src/src/components/dialog/chooseChannelForCatalog.vue
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 import catalogEdit from './catalogEdit.vue' 38 import catalogEdit from './catalogEdit.vue'
39 export default { 39 export default {
40 name: 'chooseChannelForCatalog', 40 name: 'chooseChannelForCatalog',
41 - props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'], 41 + props: ['platformId', 'platformDeviceId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'],
42 created() { 42 created() {
43 this.chooseId = this.defaultCatalogId; 43 this.chooseId = this.defaultCatalogId;
44 this.defaultCatalogIdSign = this.defaultCatalogId; 44 this.defaultCatalogIdSign = this.defaultCatalogId;
@@ -171,6 +171,7 @@ export default { @@ -171,6 +171,7 @@ export default {
171 }); 171 });
172 }, 172 },
173 loadNode: function(node, resolve){ 173 loadNode: function(node, resolve){
  174 + console.log("this.platformDeviceId: " + this.platformDeviceId)
174 if (node.level === 0) { 175 if (node.level === 0) {
175 resolve([ 176 resolve([
176 { 177 {
@@ -179,7 +180,7 @@ export default { @@ -179,7 +180,7 @@ export default {
179 type: -1 180 type: -1
180 },{ 181 },{
181 name: this.platformName, 182 name: this.platformName,
182 - id: this.platformId, 183 + id: this.platformDeviceId,
183 type: 0 184 type: 0
184 } 185 }
185 ]); 186 ]);
@@ -298,6 +299,8 @@ export default { @@ -298,6 +299,8 @@ export default {
298 return false; 299 return false;
299 }, 300 },
300 nodeClickHandler: function (data, node, tree){ 301 nodeClickHandler: function (data, node, tree){
  302 + console.log(data)
  303 + console.log(node)
301 this.chooseId = data.id; 304 this.chooseId = data.id;
302 this.chooseName = data.name; 305 this.chooseName = data.name;
303 if (this.catalogIdChange)this.catalogIdChange(this.chooseId, this.chooseName); 306 if (this.catalogIdChange)this.catalogIdChange(this.chooseId, this.chooseName);
web_src/src/components/dialog/getCatalog.vue
@@ -77,6 +77,7 @@ export default { @@ -77,6 +77,7 @@ export default {
77 }, 77 },
78 methods: { 78 methods: {
79 openDialog(catalogIdResult) { 79 openDialog(catalogIdResult) {
  80 + console.log(this.chooseId)
80 this.showDialog = true 81 this.showDialog = true
81 this.catalogIdResult = catalogIdResult 82 this.catalogIdResult = catalogIdResult
82 }, 83 },
@@ -107,9 +108,6 @@ export default { @@ -107,9 +108,6 @@ export default {
107 108
108 }, 109 },
109 loadNode: function(node, resolve){ 110 loadNode: function(node, resolve){
110 -  
111 -  
112 -  
113 if (node.level === 0) { 111 if (node.level === 0) {
114 this.$axios({ 112 this.$axios({
115 method:"get", 113 method:"get",
@@ -124,7 +122,7 @@ export default { @@ -124,7 +122,7 @@ export default {
124 resolve([ 122 resolve([
125 { 123 {
126 name: this.platformName, 124 name: this.platformName,
127 - id: this.platformId, 125 + id: res.data.data.deviceGBId,
128 type: 0 126 type: 0
129 } 127 }
130 ]); 128 ]);
@@ -142,9 +140,19 @@ export default { @@ -142,9 +140,19 @@ export default {
142 this.chooseId = data.id; 140 this.chooseId = data.id;
143 }, 141 },
144 close: function() { 142 close: function() {
  143 + this.chooseId = null;
145 this.showDialog = false; 144 this.showDialog = false;
146 }, 145 },
147 submit: function() { 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 if (this.catalogIdResult)this.catalogIdResult(this.chooseId) 156 if (this.catalogIdResult)this.catalogIdResult(this.chooseId)
149 this.showDialog = false; 157 this.showDialog = false;
150 }, 158 },