648540858
2022-01-25 abc65c6317db3d57c501615125b5a4e17b0448c9
web_src/src/components/dialog/chooseChannelForCatalog.vue
@@ -91,16 +91,6 @@
                    if (typeof(callback) === 'function') {
                      callback(res.data.data)
                    }
                    //
                    // if (typeof (this.$refs.tree.setCurrentKey) == "undefined") {
                    //   this.$refs.tree.setCurrentKey(this.defaultCatalogId)
                    //   let data = this.$refs.tree.getCurrentNode()
                    //   if (data != null && data.id === this.defaultCatalogId) {
                    //     this.currentCatalogChange(data, this.$refs.tree.getNode(data.id))
                    //   }
                    // }
                  }
                })
                .catch(function (error) {
@@ -121,24 +111,10 @@
          node.loaded = false
          node.expand();
        },
        refreshCatalogById: function (id, nodeIds) {
        refreshCatalogById: function (id) {
          if (id) {
            console.log("refreshCatalogById:  " + id)
            let node = this.$refs.tree.getNode(id);
            console.log(node)
            this.refreshCatalog(node);
          }
          if (nodeIds !== null) {
            let refreshNode = {}
            for (let i = 0; i < nodeIds.length; i++) {
              let node = this.$refs.tree.getNode(nodeIds[i]);
              refreshNode[node.parent.data.id] = node.parent
            }
            if (Object.values(refreshNode).length > 0) {
              for (let j = 0; j < Object.values(refreshNode).length; j++) {
                this.refreshCatalog(Object.values(refreshNode)[j]);
              }
            }
          }
        },
        editCatalog: function (data, node){
@@ -156,6 +132,7 @@
            url:`/api/platform/catalog/del`,
            params: {
              id: id,
              platformId: this.platformId,
            }
          })
            .then((res) => {
@@ -163,6 +140,9 @@
                console.log("移除成功")
                node.parent.loaded = false
                node.parent.expand();
                if (res.data.data) {
                  this.defaultCatalogId = res.data.data;
                }
              }
            })
            .catch(function (error) {
@@ -260,7 +240,15 @@
                  disabled: node.level === 1,
                  divided: true,
                  onClick: () => {
                    this.removeCatalog(data.id, node)
                    this.$confirm('确定删除?', '提示', {
                      confirmButtonText: '确定',
                      cancelButtonText: '取消',
                      type: 'warning'
                    }).then(() => {
                      this.removeCatalog(data.id, node)
                    }).catch(() => {
                    });
                  }
                },
                {