zxl
2025-06-12 9f16b5c553b479ea12fe368a7ecc748872ea8b98
web_src/src/components/dialog/chooseChannelForCatalog.vue
old mode 100644 new mode 100755
@@ -28,7 +28,7 @@
      </span>
     </el-tree>
   </div>
    <catalogEdit ref="catalogEdit" :platformId="platformId"></catalogEdit>
    <catalogEdit ref="catalogEdit" :platformId="platformId" :platformDeviceId="platformDeviceId"></catalogEdit>
</div>
</template>
@@ -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'],
    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)
@@ -102,9 +101,10 @@
        },
        addCatalog: function (parentId, node){
          let that = this;
          console.log(this.treeType)
          console.log(this.platformId)
          console.log(parentId)
          // 打开添加弹窗
          that.$refs.catalogEdit.openDialog(false, null, null, parentId, this.treeType, node.level, ()=>{
          that.$refs.catalogEdit.openDialog(false, null, null, parentId, node.level, ()=>{
            node.loaded = false
            node.expand();
          });
@@ -140,8 +140,7 @@
              id: id,
              platformId: this.platformId,
            }
          })
            .then((res) => {
          }).then((res) => {
              if (res.data.code === 0) {
                console.log("移除成功")
                node.parent.loaded = false
@@ -163,8 +162,7 @@
              platformId: this.platformId,
              catalogId: id,
            }
          })
            .then((res)=> {
          }).then((res)=> {
              if (res.data.code === 0) {
                this.defaultCatalogIdSign = id;
              }
@@ -174,6 +172,7 @@
            });
        },
        loadNode: function(node, resolve){
          console.log("this.platformDeviceId: " + this.platformDeviceId)
          if (node.level === 0) {
            resolve([
              {
@@ -182,7 +181,7 @@
              type:  -1
              },{
                name: this.platformName,
                id:  this.platformId,
                id:   this.platformDeviceId,
                type:  0
              }
            ]);
@@ -301,6 +300,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);