{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\SecretaryEdit.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\SecretaryEdit.vue","mtime":1675071991850},{"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\nimport flow from \"@/api/flow.js\"\nconst eipUserSelector = () => import(\"@/components/selector/EipUserSelector.vue\");\nconst eipFlowDialog = () => import(\"@/components/dialog/EipFlowDialog.vue\");\nconst eipSysTypeDialog = () => import(\"@/components/dialog/EipSysTypeDialog.vue\");\nexport default {\n  components:{\n    eipUserSelector,\n    eipFlowDialog,\n    eipSysTypeDialog\n  },\n  props:{\n    editData:{},\n  },\n  updated(){\n    if(((navigator.appName == 'Microsoft Internet Explorer') || ((navigator.appName == 'Netscape') && (new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\").exec(navigator.userAgent) != null)))) {\n      this.isIe = true\n    }\n  },\n  data(){\n    return{\n      initData:{\n        enabled:\"1\",\n        shareType:\"1\",\n        shareRight:\"1,2\"\n      },\n      entityList:[],\n      flowList:[],\n      catList:[],\n      data:{},\n      dialogVisible:false,\n      isIe: false\n    }\n  },\n  methods:{\n    beforeClose(){\n      this.dialogVisible = false;\n      this.entityList = [];\n      this.catList=[];\n      this.flowList=[];\n    },\n    handleOpen(){\n      this.dialogVisible = true;\n      this.$nextTick(()=>{\n        if (!this.editData.leaderName){\n          this.data = {...this.initData};\n        }else{\n          this.data = this.editData;\n          this.initList();\n        }\n      })\n    },\n    initList(){\n      let entityKey = this.data.shareKey.split(\",\");\n      let entityName = this.data.shareName.split(\",\");\n      this.flowList = [];\n      this.catList = [];\n      if (this.data.shareType===\"1\"){\n        for (let i=0;i<entityKey.length;i++){\n          this.flowList.push({key:entityKey[i],name:entityName[i]});\n        }\n      }else{\n        for (let i=0;i<entityKey.length;i++){\n          this.catList.push({key:entityKey[i],name:entityName[i]});\n        }\n      }\n    },\n    close(){\n      this.$set(this,\"flowList\",[]);\n      this.$set(this,\"catList\",[]);\n      this.dialogVisible = false;\n      this.isIe = false;\n    },\n    save(){\n      if(!this.data.leaderId){\n        this.$message({type:\"warning\",message:'请选择领导'});\n        return;\n      }\n      if(!this.data.secretaryId){\n        this.$message({type:\"warning\",message:'请选择秘书'});\n        return;\n      }\n      if (this.data.secretaryId.indexOf(',')!==0){\n        this.data.secretaryId=\",\"+this.data.secretaryId+\",\";\n      }\n      if(!this.data.shareRight){\n        this.$message({type:\"warning\",message:'请选择共享的权限'});\n        return;\n      }\n      if(this.data.secretaryId.indexOf(\",\"+this.data.leaderId+\",\")>-1){\n        this.$message({type:\"warning\",message:'领导的秘书不能包含领导'});\n        return;\n      }\n      if (this.data.shareType===\"1\"){\n        this.entityList = this.flowList;\n      }else{\n        this.entityList = this.catList;\n      }\n      if(!this.entityList || this.entityList.length===0){\n        this.$message({type:\"warning\",message:'请选择要共享的流程'+(this.data.shareType ==='1'?'定义':'分类')});\n        return;\n      }\n      this.data.shareKey = '';\n      this.data.shareName = '';\n      for(let i=0;i<this.entityList.length;i++){\n        if(i===0){\n          this.data.shareName +=this.entityList[i].name;\n          this.data.shareKey +=this.entityList[i].key;\n        }else{\n          this.data.shareName +=','+this.entityList[i].name;\n          this.data.shareKey +=','+this.entityList[i].key;\n        }\n      }\n\n      let _this = this;\n      flow\n        .saveSecretary(this.data)\n        .then(resp=>{\n          if(!resp.state){\n            _this.$message.error(resp.message);\n          }else{\n            _this.$message({type:\"success\",message:resp.message});\n            _this.beforeClose();\n            _this.close();\n            _this.$emit(\"after-save\",{});\n          }\n        });\n    },\n    deleteRow(index, rows) {\n      rows.splice(index, 1);\n    },\n    showDialog(){\n      if (this.data.shareType===\"1\"){\n        this.$refs.eipFlowDialog.showDialog();\n      }else{\n        this.$refs.flowTypeDialog.showDialog();\n      }\n    },\n    dialogOnConfirm(data){\n      for (let i=0;i<data.length;i++){\n        this.flowList.push({key:data[i].defKey,name:data[i].name});\n      }\n      this.flowList = this.flowList.unique(\"key\");\n    },\n    sysTypeDialogOnConfirm(data){\n      for (let i=0;i<data.length;i++){\n        this.catList.push({key:data[i].id,name:data[i].name});\n      }\n      this.catList = this.catList.unique(\"key\");\n    }\n  }\n}\n",null]}