648540858
2023-04-23 cb897aaeed0f3a24f91dc4265b8ff0d2b31284c6
web_src/src/components/dialog/chooseChannelForCatalog.vue
@@ -38,7 +38,7 @@
import catalogEdit from './catalogEdit.vue'
export default {
    name: 'chooseChannelForCatalog',
    props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'],
    props: ['platformId', 'platformDeviceId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'],
    created() {
        this.chooseId = this.defaultCatalogId;
        this.defaultCatalogIdSign = this.defaultCatalogId;
@@ -87,8 +87,7 @@
                        platformId: that.platformId,
                        parentId: parentId
                    }
                })
                .then((res)=> {
                }).then((res)=> {
                  if (res.data.code === 0) {
                    if (typeof(callback) === 'function') {
                      callback(res.data.data)
@@ -140,8 +139,7 @@
              id: id,
              platformId: this.platformId,
            }
          })
            .then((res) => {
          }).then((res) => {
              if (res.data.code === 0) {
                console.log("移除成功")
                node.parent.loaded = false
@@ -163,8 +161,7 @@
              platformId: this.platformId,
              catalogId: id,
            }
          })
            .then((res)=> {
          }).then((res)=> {
              if (res.data.code === 0) {
                this.defaultCatalogIdSign = id;
              }
@@ -174,6 +171,7 @@
            });
        },
        loadNode: function(node, resolve){
          console.log("this.platformDeviceId: " + this.platformDeviceId)
          if (node.level === 0) {
            resolve([
              {
@@ -182,7 +180,7 @@
              type:  -1
              },{
                name: this.platformName,
                id:  this.platformId,
                id:   this.platformDeviceId,
                type:  0
              }
            ]);
@@ -301,6 +299,8 @@
        return false;
      },
      nodeClickHandler: function (data, node, tree){
          console.log(data)
          console.log(node)
       this.chooseId = data.id;
       this.chooseName = data.name;
       if (this.catalogIdChange)this.catalogIdChange(this.chooseId, this.chooseName);