{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\portal\\SysTagManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\portal\\SysTagManager.vue","mtime":1675071993053},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport portal from \"@/api/portal\";\nimport styles from \"@/assets/css/element-variables.scss\";\nimport req from \"@/request.js\";\nconst HtSysTypeTree = () => import(\"@/components/common/HtSysTypeTree.vue\");\nexport default {\n  name: \"sys-tag-manager\",\n  components: {\n    HtSysTypeTree\n  },\n  data(){\n    return {\n      width: styles.aside_width,\n      asideShow: true,\n      title: \"添加标签分类\",\n      dialogVisible: false,\n      tagDialogVisible: false,\n      sysType: {\n        children: [],\n        icon: \"{}\",\n        isLeaf: \"N\",\n        typeKey: \"\",\n        name: \"\"\n      },\n      sysTag:{\n        name: \"\",\n        key: \"\",\n        typeKey: \"\",\n        typeId: \"\"\n      },\n      parentSysType: {},\n      tagDatas: [],\n      currentNode:{},\n      saveTagUrl: window.context.portal + \"/portal/sysTag/v1/save\",\n      uploadDialogVisible: false,\n      fileList: [],\n      uploadUrl: window.context.portal + \"/portal/sysTag/v1/import\",\n      typeId: \"\",\n    }\n  },\n  computed: {\n    navbarCollapseStyle: function() {\n      if (this.asideShow) {\n        return { left: parseInt(this.width) + \"px\" };\n      }\n      return { left: \"0px\" };\n    },\n    saveUrl: function () {\n\n      return `${window.context.portal}/sys/sysType/v1/save?parentId=${this.parentSysType.id}&isRoot=${this.parentSysType.parentId == 0 ? 1 : 0}&isPriNode=0`;\n    }\n  },\n  methods: {\n    handleNodeClick(node){\n      this.loadTagDatas(node);\n      this.currentNode = node;\n    },\n    handleCommand(param){\n      switch (param.action) {\n        case \"add\":\n          this.add(param.data);\n          break;\n        case \"edit\":\n          this.edit(param.data);\n          break;\n        case \"delete\":\n          this.delete(param.data);\n          break;\n        case \"addTag\":\n          this.addTag(param.data);\n          break;\n        case \"editTag\":\n          this.editTag(param.data);\n          break;\n        case \"deleteTag\":\n          this.deleteTag(param.data);\n          break;\n        case \"export\":\n          this.exportFile(param.data);\n          break;\n        case \"import\":\n            this.importFile(param.data);\n        default:\n          break;\n      }\n    },\n    handleClose(){\n      this.dialogVisible = false;\n      this.tagDialogVisible = false;\n      this.sysTag = {\n        name: \"\",\n        key: \"\",\n        typeKey: \"\",\n        typeId: \"\"\n      }\n    },\n    add(data){\n      this.dialogVisible = true;\n      this.title = \"编辑标签分类\";\n      if (data) {\n        this.sysType.id = \"\";\n        this.sysType.name = \"\";\n        this.sysType.typeKey = \"\";\n        this.sysType.parentId = data.id;\n        this.sysType.typeGroupKey = data.parentId == 0 ? data.typeKey : data.typeGroupKey;\n        this.parentSysType = data;\n      }\n    },\n    edit(data){\n      this.sysType = {...data};\n      this.title = \"编辑标签分类\";\n      this.dialogVisible = true;\n    },\n    delete(data){\n      if (data.id){\n        this.$confirm(`是否确定删除 [${data.name}]  及其子分类（包含分类下标签项数据）?`, \"提示\", {\n          confirmButtonText: \"确定\",\n          cancelButtonText: \"取消\",\n          type: \"warning\"\n        }).then(() => {\n          portal.removeTagByTypeId(data.id)\n            .then(data => {\n                if (data.state) {\n                  this.$message({type: \"success\", message: data.message || \"删除成功\"});\n                  this.$refs.htSysTypeTree.loadData();\n                  this.tagDatas = [];\n                  this.currentNode = null;\n                }\n              }\n            )\n            .catch(() => {\n              this.dialogVisible = false;\n            });\n        });\n      }\n    },\n    addTag(data){\n      debugger;\n      this.title = \"新增标签\";\n      this.tagDialogVisible = true;\n      if (data){\n        this.sysTag.id = \"\";\n        this.sysTag.name = \"\";\n        this.sysTag.key = \"\";\n        this.sysTag.typeKey = data.key;\n        this.sysTag.typeId = data.id;\n      }\n    },\n    editTag(data){\n      this.title = \"编辑标签\";\n      this.sysTag = {...data};\n      this.tagDialogVisible = true;\n    },\n    deleteTag(data){\n      if (data.id){\n        this.$confirm(`是否确定删除 [${data.name}]?`, \"提示\", {\n          confirmButtonText: \"确定\",\n          cancelButtonText: \"取消\",\n          type: \"warning\"\n        }).then(() => {\n          portal.removeTag(data.id).then(data => {\n            if (data.state){\n              this.$message({type: \"success\", message: data.message || \"删除成功\"});\n              this.loadTagDatas(this.currentNode);\n            }\n          })\n        }).catch(() => {\n          this.dialogVisible = false;\n        });\n      }\n    },\n    afterSaveData(){\n      this.dialogVisible = false;\n      this.$refs.htSysTypeTree.loadData();\n    },\n    afterSaveTagData(){\n      this.tagDialogVisible = false;\n      this.loadTagDatas(this.currentNode);\n    },\n    loadTagDatas(node){\n      if (node.id === \"11\")\n        return;\n      portal.getTagsByTypeId(node.id).then(data => {\n        this.tagDatas = [];\n        let head = {\n          id: node.id,\n          name: node.name,\n          children: data,\n          key: node.typeKey,\n          parentId: -1\n        };\n        this.tagDatas.push(head);\n      })\n    },\n    exportFile(data){\n      let id = data.id;\n      let url = window.context.portal+\"/portal/sysTag/v1/export?typeId=\"+id;\n      req.download(url);\n    },\n    beforeClose(){\n      this.uploadDialogVisible = false;\n      this.fileList = [];\n    },\n    handleImport(param){\n      let formData = new FormData();\n      formData.append(\"file\",param.file);\n      portal.importSysTags(formData,this.typeId).then(resp=>{\n        if(resp.state){\n          this.$message({type:\"success\",message:\"导入成功\"});\n          this.uploadDialogVisible = false;\n          this.fileList = [];\n          this.loadTagDatas(this.currentNode);\n        }else{\n          this.beforeClose();\n        }\n      })\n    },\n    importFile(data){\n      this.typeId = data.id;\n      this.uploadDialogVisible = true;\n    },\n    uploadSubmit(){\n    if(this.$refs.elUpload.uploadFiles.length == 0){\n      this.$message({type:\"warning\",message:\"请上传文件\"});\n    }\n    this.$refs.elUpload.submit();\n    },\n    tagClick(data){\n      this.editTag(data);\n    },\n    showEditPermission(data){\n      if(!data){\n        return false;\n      }\n      if(data.parentId === '0'){\n        return false;\n      }\n      if(data.typeKey && data.typeKey === 'yybq' || data.typeKey === 'bdbq' ){\n        return false;\n      }\n      return true;\n    }\n  }\n}\n",null]}