{"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\\FlowOtherSetting.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowOtherSetting.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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 flow from '@/api/flow.js'\r\nimport req from '@/request.js'\r\n\r\nconst statusOptions = [\r\n  {key: 'deploy', value: '已发布', title: '可以发起和审批。'},\r\n  {key: 'forbidden', value: '禁止', title: '禁止发起,已发起的可以继续审批。'},\r\n  {key: 'forbidden_instance', value: '禁止实例', title: '禁止发起和审批。'},\r\n]\r\n\r\nconst useMainForms = [\r\n  {\r\n    key: 'mainVersion',\r\n    value: '表单主版本',\r\n    title: '表单主版本：任务审批时使用绑定表单的主版本。',\r\n  },\r\n  {\r\n    key: 'startVersion',\r\n    value: '启动时版本',\r\n    title: '启动时版本：任务审批时使用流程启动时绑定的表单版本。',\r\n  },\r\n]\r\n\r\nimport model from '@/api/flow.js'\r\nconst FlowVarSelector = () => import('@/components/flow/FlowVarSelector.vue')\r\nconst MessageTypeSelector = () =>\r\n  import('@/components/flow/MessageTypeSelector.vue')\r\nconst FlowNodeUserCondition = () =>\r\n  import('@/components/flow/FlowNodeUserCondition.vue')\r\n\r\nconst FlowAutoStartSetting = () =>\r\n  import('@/components/flow/FlowAutoStartSetting.vue')\r\n\r\nimport {mapState, mapActions} from 'vuex'\r\nimport {Message} from 'element-ui'\r\nexport default {\r\n  props: ['defId'],\r\n  components: {\r\n    FlowVarSelector,\r\n    MessageTypeSelector,\r\n    FlowNodeUserCondition,\r\n    FlowAutoStartSetting,\r\n  },\r\n  data() {\r\n    return {\r\n      curEditSetting: '', //下标，用于记录是哪一条办结抄送的人员配置\r\n      procNotifyList: [{userAssignRules: [], msgTypes: ''}], //办结抄送的配置信息\r\n      curEditRuleIndex: '', //下标，用于记录修改某一条办结抄送人员配置的时候是哪条数据\r\n      dialogEndNotifyVisible: false, //办结抄送设置对话框是否显示\r\n      loadDataUrl: '',\r\n      prop: {urgentMailTel: '', urgentSmsTel: ''},\r\n      handlerTypes: [],\r\n      skipConditionList: [],\r\n      statusArr: statusOptions,\r\n      useMainFormArr: useMainForms,\r\n      dialogUrgentMailTelVisible: false,\r\n      dialogUrgentSmsTelVisible: false,\r\n      urgentMailTel: '',\r\n      urgentSmsTel: '',\r\n      checkOpnionLimits: [\r\n        {value: 'all', label: '查看全部'},\r\n        {value: 'self', label: '本人操作'},\r\n        {value: 'back', label: '退回自己'},\r\n        {value: 'end', label: '显示终止恢复'},\r\n      ],\r\n      checkLimit: ['all', 'end'],\r\n      startLimit: ['self', 'back', 'end'],\r\n    }\r\n  },\r\n  watch: {\r\n    checkLimit: {\r\n      handler(newVal, oldVal) {\r\n        if (newVal !== oldVal && newVal.length === 0) {\r\n          this.$set(this, 'checkLimit', oldVal)\r\n        }\r\n      },\r\n    },\r\n    startLimit: {\r\n      handler(newVal, oldVal) {\r\n        if (newVal !== oldVal && newVal.length === 0) {\r\n          this.$set(this, 'startLimit', oldVal)\r\n        }\r\n      },\r\n    },\r\n  },\r\n  computed: mapState({\r\n    defConfigData: (state) => state.flow.defConfigData,\r\n  }),\r\n  methods: {\r\n    //保存办结抄送配送的信息\r\n    saveEndNotify() {\r\n      const this_ = this\r\n      let validate = true\r\n      this.procNotifyList.forEach((n) => {\r\n        if (\r\n          !n.msgTypes ||\r\n          !n.userAssignRules ||\r\n          n.userAssignRules.length == 0\r\n        ) {\r\n          validate = false\r\n        }\r\n      })\r\n      if (!validate) {\r\n        Message.warning('人员配置或通知类型不能为空')\r\n        return\r\n      }\r\n      let url = '${bpmModel}/flow/plugins/v1/procNotifySave?defId=' + this.defId\r\n      req.post(url, this.procNotifyList).then(function (data) {\r\n        data = data.data\r\n        if (data.state) {\r\n          Message.success('办结抄送配置成功')\r\n          this_.dialogEndNotifyVisible = false\r\n        } else {\r\n          Message.error(data.message)\r\n        }\r\n      })\r\n    },\r\n    //新增办结抄送\r\n    addLine() {\r\n      let procNotify = {userAssignRules: [], msgTypes: ''}\r\n      this.procNotifyList.push(procNotify)\r\n    },\r\n    //添加人员配置（办结抄送）\r\n    addUserCondition(setting, index) {\r\n      this.curEditSetting = setting\r\n      this.curEditRuleIndex = index\r\n      let conf = {}\r\n      if (index != undefined) {\r\n        let userAssignRules = this.procNotifyList[setting].userAssignRules\r\n        let userRule = userAssignRules[index]\r\n        conf.userRule = JSON.parse(JSON.stringify(userRule))\r\n      }\r\n      conf = {...conf, ...{nodeType: '', nodeId: '', defId: this.defId}}\r\n      this.$refs.flowNodeUserCondition.showDialog(conf)\r\n    },\r\n    //获取人员配置返回的值（办结抄送）\r\n    nodeUserConditionConfirm(res) {\r\n      if (this.curEditRuleIndex != undefined) {\r\n        this.procNotifyList[this.curEditSetting].userAssignRules.splice(\r\n          this.curEditRuleIndex,\r\n          1,\r\n          res\r\n        )\r\n      } else {\r\n        this.procNotifyList[this.curEditSetting].userAssignRules.push(res)\r\n      }\r\n      this.$forceUpdate()\r\n    },\r\n    //删除\r\n    deleteSetting(list, index) {\r\n      list.splice(index, 1)\r\n    },\r\n    //办结抄送设置\r\n    setEndNotify() {\r\n      this.dialogEndNotifyVisible = true\r\n      this.procNotifyList = [{userAssignRules: [], msgTypes: ''}] //清空办结抄送的配置信息\r\n      const this_ = this\r\n      req\r\n        .get('${bpmModel}/flow/plugins/v1/procNotifyEdit?defId=' + this_.defId)\r\n        .then(function (data) {\r\n          data = data.data\r\n          if (data) {\r\n            this_.procNotifyList = data\r\n          }\r\n        })\r\n    },\r\n    save() {\r\n      if (this.prop.subjectRule.length > 600) {\r\n        this.$message.warning('超出限制长度！')\r\n        return false\r\n      }\r\n      if (this.checkLimit) {\r\n        this.prop.checkLimit = this.checkLimit.join(',')\r\n      }\r\n      if (this.startLimit) {\r\n        this.prop.startLimit = this.startLimit.join(',')\r\n      }\r\n      var param = {\r\n        bpmProp: JSON.parse(JSON.stringify(this.prop)),\r\n        description: this.prop.description,\r\n        defId: this.defId,\r\n        rev: this.defConfigData.initData.bpmDefinition.rev,\r\n      }\r\n      if (!param.bpmProp.testStatus) {\r\n        param.bpmProp.testStatus = 'test'\r\n      } else {\r\n        param.bpmProp.testStatus = 'run'\r\n      }\r\n      model.flowOtherSettingSave(param).then(\r\n        (data) => {\r\n          if (data.state) {\r\n            this.$message.success(data.message)\r\n            let param = {defId: this.defId, topDefKey: this.topDefKey || ''}\r\n            //重新获取流程最新版本，以免保存流程配置的时候提示不是最新版本\r\n            this.$store.dispatch('flow/updateDefRev', this.defId)\r\n          }\r\n        },\r\n        (error) => {\r\n          this.$message.error(error || '保存失败')\r\n        }\r\n      )\r\n    },\r\n    urgentSmsTelConfirm(data) {\r\n      this.urgentSmsTel = this.urgentSmsTel + data.pathValue\r\n    },\r\n    urgentMailTelConfirm(data) {\r\n      this.urgentMailTel = this.urgentMailTel + data.pathValue\r\n      ro\r\n    },\r\n    urgentSmsTelClick() {\r\n      this.dialogUrgentSmsTelVisible = true\r\n      if (!this.prop.urgentSmsTel) return\r\n      this.urgentSmsTel = this.prop.urgentSmsTel\r\n    },\r\n    urgentMailTelClick() {\r\n      this.dialogUrgentMailTelVisible = true\r\n      if (!this.prop.urgentMailTel) return\r\n      this.urgentMailTel = this.prop.urgentMailTel\r\n    },\r\n    subjectRuleConfirm(data) {\r\n      this.prop.subjectRule = this.prop.subjectRule + data.pathValue\r\n    },\r\n    afterLoadData(data) {\r\n      this.prop = data.prop\r\n      if (data.prop.checkLimit) {\r\n        this.checkLimit = data.prop.checkLimit.split(',')\r\n      }\r\n      if (data.prop.startLimit) {\r\n        this.startLimit = data.prop.startLimit.split(',')\r\n      }\r\n      if (data.prop.testStatus == 'test') {\r\n        this.prop.testStatus = false\r\n      } else {\r\n        this.prop.testStatus = true\r\n      }\r\n      for (let key in data.handlerTypes) {\r\n        this.handlerTypes.push({key: key, value: data.handlerTypes[key]})\r\n      }\r\n      data.skipConditionList.forEach((item) => {\r\n        this.skipConditionList.push({key: item.type, value: item.title})\r\n      })\r\n    },\r\n  },\r\n  created() {\r\n    this.loadDataUrl = '/flow/def/v1/getOtherParam?defId=' + this.defId\r\n  },\r\n}\r\n",null]}