{"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\\uc\\reportlinetree\\ReportLineAsideTree.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\reportlinetree\\ReportLineAsideTree.vue","mtime":1675071993475},{"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\r\nimport styles from \"@/assets/css/element-variables.scss\";\r\nimport ucApi from \"@/api/uc.js\";\r\nconst diastrbutionAdmin = () =>\r\n import(\"@/views/uc/reportlinetree/DiastrbutionAdmin.vue\");\r\nconst reportLineTree = () =>\r\n import(\"@/views/uc/reportlinetree/ReportLineTree.vue\");\r\nconst eipUserDialog = () => import(\"@/components/dialog/EipUserDialog.vue\");\r\nconst eipOrgDialog = () => import(\"@/components/dialog/EipOrgDialog.vue\");\r\nconst eipPostDialog = () => import(\"@/components/dialog/EipPostDialog.vue\");\r\nconst eipRoleDialog = () => import(\"@/components/dialog/EipRoleDialog.vue\");\r\nexport default {\r\n name: \"report-line-aside-tree\",\r\n components: {\r\n reportLineTree,\r\n eipUserDialog,\r\n eipOrgDialog,\r\n eipPostDialog,\r\n eipRoleDialog,\r\n diastrbutionAdmin\r\n },\r\n props: {\r\n width: {\r\n type: String,\r\n default: \"100%\"\r\n },\r\n typeId: {\r\n type: String,\r\n default: \"\"\r\n },\r\n typeKey: {\r\n type: String,\r\n default: \"\"\r\n },\r\n supportFilter: {\r\n type: Boolean,\r\n default: false\r\n },\r\n hasFooter: {\r\n type: Boolean,\r\n default: true\r\n },\r\n hasNavbarCollapse: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n computed: {\r\n navbarCollapseStyle: function() {\r\n if (this.asideShow) {\r\n return { left: parseInt(this.width) + 16 + \"px\" };\r\n }\r\n return { left: \"0px\" };\r\n }\r\n },\r\n data() {\r\n return {\r\n asideShow: true,\r\n isExpand: true,\r\n showCheckbox: false,\r\n dialogVisible: false,\r\n sysType: {\r\n children: [],\r\n icon: \"{}\",\r\n isLeaf: \"N\",\r\n struType: 1,\r\n typeKey: \"\",\r\n name: \"\"\r\n },\r\n parentSysType: {\r\n name: \"\"\r\n },\r\n param: {\r\n //记录请求参数\r\n type: \"user\", // 用户组类型\r\n value: \"\",\r\n parentAlias: \"\",\r\n alias: \"\"\r\n },\r\n userType: [\r\n { key: \"user\", value: \"用户\" },\r\n { key: \"org\", value: \"组织\" },\r\n { key: \"pos\", value: \"岗位\" },\r\n { key: \"role\", value: \"角色\" }\r\n ],\r\n selectName: \"\", //当前选择的名称\r\n dialogType: \"\",\r\n isDistributionAdmin: false,\r\n selectRoleAlias: \"\",\r\n dialogTitle: \"\",\r\n isEditFirstChange: false\r\n };\r\n },\r\n watch: {\r\n typeId: function(newVal, oldVal) {\r\n if (newVal && newVal != oldVal) {\r\n setTimeout(() => {\r\n this.$refs.htSysTypeTree.loadData();\r\n });\r\n }\r\n },\r\n \"param.type\": function(newVal, oldVal) {\r\n if (newVal && newVal != oldVal && !this.isEditFirstChange) {\r\n this.param.value = \"\";\r\n this.param.alias = \"\";\r\n this.$set(this, \"selectName\", \"\");\r\n } else {\r\n this.isEditFirstChange = false;\r\n }\r\n }\r\n },\r\n methods: {\r\n clickNode(node,data){\r\n if(node.level == 1){\r\n this.$message({type:\"warning\",message:\"请选择下级菜单\"})\r\n return ;\r\n }\r\n this.dialogType = \"edit\";\r\n this.param.id = data.id;\r\n this.dialogTitle = \"编辑汇报线\";\r\n this.$emit(\"showReportLineForm\",data, node.parent.data.id, \"edit\")\r\n },\r\n check(data, checkedObj) {\r\n this.$emit(\"check\", data, checkedObj);\r\n },\r\n syncTree() {\r\n this.$refs.htSysTypeTree.loadData();\r\n },\r\n handleExpand() {\r\n this.isExpand = !this.isExpand;\r\n let elTree = this.$refs.htSysTypeTree.$refs.htTree.$refs.elTree;\r\n for (var i = 0; i < elTree.store._getAllNodes().length; i++) {\r\n elTree.store._getAllNodes()[i].expanded = this.isExpand;\r\n }\r\n },\r\n handleCommand(command) {\r\n let node = command.node;\r\n let data = command.data;\r\n let action = command.action;\r\n switch (action) {\r\n case \"add\":\r\n this.dialogType = \"add\";\r\n this.dialogTitle = \"新增汇报线\";\r\n this.$emit(\"showReportLineForm\",data, action, \"add\")\r\n // this.showDialog(data, action);\r\n break;\r\n case \"edit\":\r\n this.dialogType = \"edit\";\r\n this.param.id = data.id;\r\n this.dialogTitle = \"编辑汇报线\";\r\n this.$emit(\"showReportLineForm\",data, node.parent.data.id, \"edit\")\r\n // this.showDialog(data, node.parent.data.id);\r\n break;\r\n case \"delete\":\r\n this.delSysType(data);\r\n break;\r\n case \"refresh\":\r\n this.refresh();\r\n break;\r\n default:\r\n break;\r\n }\r\n },\r\n distributionAdmin(alias){\r\n this.selectRoleAlias = alias;\r\n this.isDistributionAdmin = false;\r\n this.$nextTick(() => {\r\n this.isDistributionAdmin = true;\r\n });\r\n },\r\n refresh(){\r\n this.syncTree();\r\n },\r\n showDialog(data, id) {\r\n if (this.dialogType === \"edit\") {\r\n this.param.alias = data.alias;\r\n this.param.value = data.id;\r\n this.selectName = data.name;\r\n this.param.parentAlias = id;\r\n if (this.param.type != data.groupType) {\r\n this.param.type = data.groupType;\r\n this.isEditFirstChange = true;\r\n }\r\n } else {\r\n this.selectName = \"\";\r\n this.param = { parentAlias: data.alias, type: \"user\" };\r\n }\r\n this.dialogVisible = true;\r\n },\r\n delSysType(data) {\r\n this.$confirm(`是否确定删除 [${data.name}] ?`, \"提示\", {\r\n confirmButtonText: \"确定\",\r\n cancelButtonText: \"取消\",\r\n type: \"warning\"\r\n }).then(() => {\r\n ucApi\r\n .deleteUserRel(data.alias)\r\n .then(\r\n data => {\r\n if (data.state) {\r\n this.$message({\r\n type: \"success\",\r\n message: data.message || \"删除成功\"\r\n });\r\n this.$refs.htSysTypeTree.loadData();\r\n } else {\r\n this.$message.error(data.message || \"删除成功\");\r\n }\r\n },\r\n error => {\r\n this.$message.error(error || \"删除失败\");\r\n }\r\n )\r\n .catch(() => {\r\n this.dialogVisible = false;\r\n });\r\n });\r\n },\r\n handleClose() {\r\n this.param = { type: \"user\", value: \"\", parentAlias: \"\", alias: \"\" };\r\n setTimeout(() => {\r\n this.$refs.htSysTypeTree.loadData();\r\n });\r\n this.dialogVisible = false;\r\n this.isDistributionAdmin = false;\r\n },\r\n afterSaveData() {\r\n this.$refs.htSysTypeTree.loadData();\r\n if (this.sysType.id) {\r\n this.dialogVisible = false;\r\n return;\r\n }\r\n this.sysType.name = \"\";\r\n this.sysType.typeKey = \"\";\r\n this.$confirm(\"是否继续?\", \"提示\", {\r\n confirmButtonText: \"确定\",\r\n cancelButtonText: \"取消\",\r\n type: \"success\"\r\n })\r\n .then(() => {})\r\n .catch(() => {\r\n this.dialogVisible = false;\r\n });\r\n },\r\n submit() {\r\n if (this.dialogType === \"add\") {\r\n ucApi.addUserRel([this.param]).then(resp => {\r\n this.dialogVisible = false;\r\n this.$message({\r\n message: \"新增成功\",\r\n type: \"success\"\r\n });\r\n this.$refs.htSysTypeTree.loadData();\r\n });\r\n } else if (this.dialogType === \"edit\") {\r\n ucApi.updateUserRel(this.param).then(resp => {\r\n this.dialogVisible = false;\r\n this.$message({\r\n message: \"新增成功\",\r\n type: \"success\"\r\n });\r\n this.$refs.htSysTypeTree.loadData();\r\n });\r\n }\r\n this.selectName = \"\"; //保存成功清楚数据\r\n // this.param = { type: \"user\", value: \"\", parentAlias: \"\", alias: \"\" };\r\n },\r\n select() {\r\n if (this.param.type === \"user\") {\r\n this.$refs.eipUserDialog.showDialog();\r\n } else if (this.param.type === \"pos\") {\r\n this.$refs.eipPostDialog.showDialog();\r\n } else if (this.param.type === \"org\") {\r\n this.$refs.eipOrgDialog.showDialog();\r\n } else if (this.param.type === \"role\") {\r\n this.$refs.eipRoleDialog.showDialog();\r\n }\r\n },\r\n selectUser(data) {\r\n this.param.value = data[0].id; this.param.alias = data[0].account;\r\n this.selectName = data[0].fullname;\r\n },\r\n selectOrg(data) {\r\n this.param.value = data[0].id;\r\n this.param.alias = data[0].code;\r\n this.selectName = data[0].name;\r\n },\r\n selectPost(data) {\r\n this.param.value = data[0].id;\r\n this.param.alias = data[0].code;\r\n this.selectName = data[0].name;\r\n },\r\n selectRole(data) {\r\n this.param.value = data[0].id;\r\n this.param.alias = data[0].code;\r\n this.selectName = data[0].name;\r\n }\r\n }\r\n};\r\n",null]}