修复选择通道时默认节点显示错误的问题
parent
d5e8aa62a1
commit
e7bdcc1f8d
|
@ -53,7 +53,7 @@ public class ParentPlatform {
|
||||||
/**
|
/**
|
||||||
* 设备国标编号
|
* 设备国标编号
|
||||||
*/
|
*/
|
||||||
@Schema(description = "11111")
|
@Schema(description = "设备国标编号")
|
||||||
private String deviceGBId;
|
private String deviceGBId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -143,7 +143,8 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
chooseChannel: function(platform) {
|
chooseChannel: function(platform) {
|
||||||
this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, platform.name, platform.catalogId, platform.treeType, this.initData)
|
console.log("platform.name: " + platform.name)
|
||||||
|
this.$refs.chooseChannelDialog.openDialog(platform.serverGBId,platform.deviceGBId, platform.name, platform.catalogId, platform.treeType, this.initData)
|
||||||
},
|
},
|
||||||
initData: function() {
|
initData: function() {
|
||||||
this.getPlatformList();
|
this.getPlatformList();
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<el-tab-pane label="目录结构" name="catalog">
|
<el-tab-pane label="目录结构" name="catalog">
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-main v-bind:style="{backgroundColor: '#FFF', maxHeight: winHeight + 'px'}">
|
<el-main v-bind:style="{backgroundColor: '#FFF', maxHeight: winHeight + 'px'}">
|
||||||
<chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" :treeType=treeType ></chooseChannelForCatalog>
|
<chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformDeviceId=platformDeviceId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange" :treeType=treeType ></chooseChannelForCatalog>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
@ -60,6 +60,7 @@ export default {
|
||||||
tabActiveName: "gbChannel",
|
tabActiveName: "gbChannel",
|
||||||
catalogTabActiveName: "catalog",
|
catalogTabActiveName: "catalog",
|
||||||
platformId: "",
|
platformId: "",
|
||||||
|
platformDeviceId: "",
|
||||||
catalogId: "",
|
catalogId: "",
|
||||||
catalogName: "",
|
catalogName: "",
|
||||||
currentCatalogId: "",
|
currentCatalogId: "",
|
||||||
|
@ -73,8 +74,10 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openDialog(platformId, platformName, defaultCatalogId, treeType, closeCallback) {
|
openDialog(platformId, platformDeviceId, platformName, defaultCatalogId, treeType, closeCallback) {
|
||||||
|
console.log("defaultCatalogId: " + defaultCatalogId)
|
||||||
this.platformId = platformId
|
this.platformId = platformId
|
||||||
|
this.platformDeviceId = platformDeviceId
|
||||||
this.platformName = platformName
|
this.platformName = platformName
|
||||||
this.defaultCatalogId = defaultCatalogId
|
this.defaultCatalogId = defaultCatalogId
|
||||||
this.showDialog = true
|
this.showDialog = true
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
import catalogEdit from './catalogEdit.vue'
|
import catalogEdit from './catalogEdit.vue'
|
||||||
export default {
|
export default {
|
||||||
name: 'chooseChannelForCatalog',
|
name: 'chooseChannelForCatalog',
|
||||||
props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'],
|
props: ['platformId', 'platformDeviceId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'],
|
||||||
created() {
|
created() {
|
||||||
this.chooseId = this.defaultCatalogId;
|
this.chooseId = this.defaultCatalogId;
|
||||||
this.defaultCatalogIdSign = this.defaultCatalogId;
|
this.defaultCatalogIdSign = this.defaultCatalogId;
|
||||||
|
@ -171,6 +171,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadNode: function(node, resolve){
|
loadNode: function(node, resolve){
|
||||||
|
console.log("this.platformDeviceId: " + this.platformDeviceId)
|
||||||
if (node.level === 0) {
|
if (node.level === 0) {
|
||||||
resolve([
|
resolve([
|
||||||
{
|
{
|
||||||
|
@ -179,7 +180,7 @@ export default {
|
||||||
type: -1
|
type: -1
|
||||||
},{
|
},{
|
||||||
name: this.platformName,
|
name: this.platformName,
|
||||||
id: this.platformId,
|
id: this.platformDeviceId,
|
||||||
type: 0
|
type: 0
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
@ -298,6 +299,8 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
nodeClickHandler: function (data, node, tree){
|
nodeClickHandler: function (data, node, tree){
|
||||||
|
console.log(data)
|
||||||
|
console.log(node)
|
||||||
this.chooseId = data.id;
|
this.chooseId = data.id;
|
||||||
this.chooseName = data.name;
|
this.chooseName = data.name;
|
||||||
if (this.catalogIdChange)this.catalogIdChange(this.chooseId, this.chooseName);
|
if (this.catalogIdChange)this.catalogIdChange(this.chooseId, this.chooseName);
|
||||||
|
|
|
@ -77,6 +77,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openDialog(catalogIdResult) {
|
openDialog(catalogIdResult) {
|
||||||
|
console.log(this.chooseId)
|
||||||
this.showDialog = true
|
this.showDialog = true
|
||||||
this.catalogIdResult = catalogIdResult
|
this.catalogIdResult = catalogIdResult
|
||||||
},
|
},
|
||||||
|
@ -107,9 +108,6 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
loadNode: function(node, resolve){
|
loadNode: function(node, resolve){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (node.level === 0) {
|
if (node.level === 0) {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method:"get",
|
method:"get",
|
||||||
|
@ -124,7 +122,7 @@ export default {
|
||||||
resolve([
|
resolve([
|
||||||
{
|
{
|
||||||
name: this.platformName,
|
name: this.platformName,
|
||||||
id: this.platformId,
|
id: res.data.data.deviceGBId,
|
||||||
type: 0
|
type: 0
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
@ -142,9 +140,19 @@ export default {
|
||||||
this.chooseId = data.id;
|
this.chooseId = data.id;
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
|
this.chooseId = null;
|
||||||
this.showDialog = false;
|
this.showDialog = false;
|
||||||
},
|
},
|
||||||
submit: function() {
|
submit: function() {
|
||||||
|
console.log(this.chooseId)
|
||||||
|
if (this.chooseId === null) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: '未选择任何节点,',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.catalogIdResult)this.catalogIdResult(this.chooseId)
|
if (this.catalogIdResult)this.catalogIdResult(this.chooseId)
|
||||||
this.showDialog = false;
|
this.showDialog = false;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue