{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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\\FlowNodeStartNewFlow.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowNodeStartNewFlow.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":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/web.dom.iterable\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/es6.function.name\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 req from '@/request.js';\nimport { mapState, mapActions } from 'vuex';\nimport { Message } from 'element-ui';\n\nvar eipScriptDialog = function eipScriptDialog() {\n  return import('@/components/dialog/EipScriptDialog.vue');\n};\n\nvar FlowNodeUserCondition = function FlowNodeUserCondition() {\n  return import('@/components/flow/FlowNodeUserCondition.vue');\n};\n\nvar eipFlowDialog = function eipFlowDialog() {\n  return import('@/components/dialog/EipFlowDialog.vue');\n};\n\nvar FlowVarSelector = function FlowVarSelector() {\n  return import('@/components/flow/FlowVarSelector.vue');\n};\n\nexport default {\n  name: 'FlowStartConf',\n  components: {\n    eipScriptDialog: eipScriptDialog,\n    FlowNodeUserCondition: FlowNodeUserCondition,\n    eipFlowDialog: eipFlowDialog,\n    FlowVarSelector: FlowVarSelector\n  },\n  props: {\n    //任务节点信息\n    node: {\n      type: Object,\n      required: true\n    },\n    //流程配置信息\n    defConfigData: {\n      type: Object,\n      required: true\n    },\n    //所有的自动触发新流程的配置\n    confList: {\n      type: Array,\n      required: true\n    },\n    flowVar: {\n      type: Array,\n      required: false\n    }\n  },\n  data: function data() {\n    return {\n      dialogVisibleSetting: false,\n      //是否显示设置节点新流程触发设置侧边栏\n      reminder: {\n        name: '',\n        triggerAction: 'agree',\n        userRule: {\n          description: ''\n        },\n        defName: '',\n        defKey: '',\n        formVarConf: [],\n        isAdd: true\n      },\n      isSave: false,\n      //判断是否可以保存\n      confListCopy: [],\n      //复制一份最开始的新流程触发设置配置的信息\n      defVarMap: {}\n    };\n  },\n  watch: {\n    'reminder.defKey': function reminderDefKey(n, o) {\n      if (n && !this.defVarMap[n]) {\n        this.getNewDefVar();\n      }\n    }\n  },\n  methods: {\n    getNewDefVar: function getNewDefVar() {\n      var me_ = this;\n      req.post(window.context.bpmModel + '/flow/node/v1/varTree', {\n        flowKey: this.reminder.defKey,\n        nodeId: this.node.nodeId,\n        includeBpmConstants: false,\n        removeSub: true,\n        bpmForm: true\n      }).then(function (response) {\n        me_.$set(me_.defVarMap, me_.reminder.defKey, response.data || []);\n      });\n    },\n    handleDialogSure: function handleDialogSure(data) {\n      var _this = this;\n\n      if (data && data.length > 0 && this.reminder.defKey == data[0].defKey || !this.reminder.defKey) {\n        this.reminder.defName = data[0].name;\n        this.reminder.defKey = data[0].defKey;\n        return;\n      }\n\n      this.$confirm(\"\\u66F4\\u6362\\u6D41\\u7A0B\\u5C06\\u4F1A\\u6E05\\u7A7A\\u5BF9\\u5E94\\u5B57\\u6BB5\\u7684\\u914D\\u7F6E,\\u662F\\u5426\\u786E\\u5B9A\\u66F4\\u6362?\").then(function () {\n        if (data && data.length > 0) {\n          _this.reminder.defName = data[0].name;\n          _this.reminder.defKey = data[0].defKey;\n        } else {\n          _this.reminder.defName = '';\n          _this.reminder.defKey = '';\n        }\n\n        _this.reminder.formVarConf = [];\n      });\n    },\n    selectDef: function selectDef() {\n      this.$refs.eipFlowDialog.showDialog();\n    },\n    addFormVarConf: function addFormVarConf() {\n      if (!this.reminder.defKey) {\n        Message.warning('要先选择要触发的流程才能配置对应字段');\n        return;\n      }\n\n      this.reminder.formVarConf.push({});\n    },\n    nodeUserConditionConfirm: function nodeUserConditionConfirm(res) {\n      this.reminder.userRule = res;\n    },\n    //添加人员配置（办结抄送）\n    addUserCondition: function addUserCondition() {\n      var conf = {};\n\n      if (this.reminder && this.reminder.userRule && this.reminder.userRule.description) {\n        conf.userRule = JSON.parse(JSON.stringify(this.reminder.userRule));\n      }\n\n      conf = _objectSpread(_objectSpread({}, conf), {\n        nodeType: '',\n        nodeId: '',\n        defId: this.defId\n      });\n      this.$refs.flowNodeUserCondition.showDialog(conf);\n    },\n    //编辑触发新流程设置\n    editTaskReminder: function editTaskReminder() {\n      this.confListCopy = JSON.parse(JSON.stringify(this.confList));\n      this.confListCopy.forEach(function (conf) {\n        conf.formVarConf = conf.formVarConf ? JSON.parse(conf.formVarConf) : [];\n        conf.userRule = conf.userRule ? JSON.parse(conf.userRule) : {};\n      });\n\n      if (this.confListCopy.length > 0) {\n        this.reminder = this.confListCopy[0];\n      } else {\n        this.restConf();\n      }\n\n      this.isSave = true;\n      this.dialogVisibleSetting = true;\n    },\n    //列表某一条数据时触发\n    orgRowClick: function orgRowClick(row, column, event) {\n      if (column.label != '操作') {\n        row.formVarConf = row.formVarConf || [];\n        row.userRule = row.userRule || {\n          description: ''\n        };\n        row.startDef = row.startDef || {};\n        this.reminder = row;\n        this.isSave = true;\n      }\n    },\n    //保存新流程触发设置\n    saveRemind: function saveRemind() {\n      var this_ = this; //判断是否有新增的数据\n\n      if (!this_.isSave) {\n        Message.warning('请先新增新流程触发设置信息再保存');\n        return;\n      } else {\n        var saveConf = JSON.parse(JSON.stringify(this_.confListCopy)); //校验是否有必填字段没有填写\n\n        for (var x = 0; x < saveConf.length; x++) {\n          if (this.validateData(saveConf[x])) {\n            this_.$message({\n              showClose: true,\n              message: '列表第' + (x + 1) + '行有字段未通过校验，请正确填写表单内容。',\n              type: 'warning'\n            });\n            return;\n          }\n\n          saveConf[x].formVarConf = JSON.stringify(saveConf[x].formVarConf);\n          saveConf[x].userRule = JSON.stringify(saveConf[x].userRule);\n        }\n\n        var remindersCopyJson = JSON.stringify(saveConf); //转json字符串\n\n        req.post('${bpmModel}/flow/plugins/v1/startNewFlowSave?defId=' + this_.node.defId + '&nodeId=' + this_.node.nodeId, remindersCopyJson).then(function (data) {\n          data = data.data;\n\n          if (data.state) {\n            Message.success('保存成功！');\n            this_.$emit('update:confList', saveConf); //子组件更新父组件的值\n\n            this_.restConf();\n            this_.dialogVisibleSetting = false;\n          } else {\n            Message.error('新流程触发设置保存出现异常：' + data.message);\n          }\n        });\n      }\n    },\n    validateData: function validateData(data) {\n      //新增数据\n      var errMsg = [];\n\n      if (!data.name) {\n        errMsg.push('名称');\n      }\n\n      if (!data.defKey) {\n        errMsg.push('新流程');\n      }\n\n      if (!data.userRule || !data.userRule.description) {\n        errMsg.push('流程发起人');\n      }\n\n      return errMsg.join(',');\n    },\n    //新增新流程触发设置\n    addRemind: function addRemind() {\n      if (this.validateData(this.reminder)) {\n        Message.warning(this.validateData(this.reminder) + '不能为空');\n        return;\n      }\n\n      this.isSave = true;\n      delete this.reminder.isAdd;\n      this.confListCopy = [];\n      this.confListCopy.push(this.reminder); //新增新流程触发设置基本信息、消息设置\n\n      this.restConf();\n      this.saveRemind();\n    },\n    clear: function clear() {\n      var _this2 = this;\n\n      this.$confirm(\"\\u662F\\u5426\\u786E\\u5B9A\\u6E05\\u7A7A\\u8BE5\\u8282\\u70B9\\u5DF2\\u6709\\u914D\\u7F6E?\").then(function () {\n        _this2.confListCopy = [];\n\n        _this2.restConf();\n\n        _this2.saveRemind();\n      });\n    },\n    //关闭设置节点新流程触发设置列弹框\n    close: function close() {\n      this.dialogVisibleSetting = false;\n    },\n    //删除新流程触发设置\n    deleteSetting: function deleteSetting(list, index) {\n      list.splice(index, 1);\n      this.isSave = true;\n      this.restConf();\n    },\n    //初始化设置\n    restConf: function restConf() {\n      this.reminder = {\n        name: '',\n        triggerAction: 'agree',\n        userRule: {\n          description: ''\n        },\n        defName: '',\n        defKey: '',\n        formVarConf: [],\n        isAdd: true\n      };\n    }\n  },\n  mounted: function mounted() {\n    this.$validator = this.$root.$validator;\n  }\n};",null]}