{"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\\FlowAutoTask.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowAutoTask.vue","mtime":1675071991756},{"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/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/es6.regexp.split\";\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 MessageTypeSelector = function MessageTypeSelector() {\n  return import(\"@/components/flow/MessageTypeSelector.vue\");\n};\n\nvar FlowVarSelector = function FlowVarSelector() {\n  return import(\"@/components/flow/FlowVarSelector.vue\");\n};\n\nvar FlowConditionBuildDialog = function FlowConditionBuildDialog() {\n  return import(\"@/components/flow/FlowConditionBuildDialog.vue\");\n};\n\nvar FlowNodeUserCondition = function FlowNodeUserCondition() {\n  return import(\"@/components/flow/FlowNodeUserCondition.vue\");\n};\n\nexport default {\n  name: \"FlowNodeScript\",\n  components: {\n    MessageTypeSelector: MessageTypeSelector,\n    eipScriptDialog: eipScriptDialog,\n    FlowVarSelector: FlowVarSelector,\n    FlowConditionBuildDialog: FlowConditionBuildDialog,\n    FlowNodeUserCondition: FlowNodeUserCondition\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    autoTask: {\n      type: Object,\n      required: true\n    }\n  },\n  data: function data() {\n    return {\n      curEditSetting: \"\",\n      //修改接收人配置的时候用于判断是修改富文本消息的还是修改普通消息的\n      curEditRuleIndex: \"\",\n      //下标，用于记录修改接收人配置的时候是哪条数据\n      tabType: \"message\",\n      //scriptNode:脚本任务，message：消息任务\n      dialogVisibleSetting: false,\n      titleSetting: \"设置自动任务\",\n      scriptJson: {\n        script: \"\"\n      },\n      //初始化脚本任务信息\n      nodeMessage: {\n        htmlSetting: {\n          msgType: \"\",\n          content: \"\",\n          ruleList: []\n        },\n        plainTextSetting: {\n          msgType: \"\",\n          content: \"\",\n          ruleList: []\n        }\n      },\n      //初始化消息任务信息\n      myConfig: {\n        initialFrameHeight: 240,\n        UEDITOR_HOME_URL: window.location.origin + '/' + window.location.pathname.split('/')[1] + '/static/ueditor/',\n        toolbars: [[// 'source', //源代码\n        'undo', //撤销\n        'bold', //加粗\n        'indent', //首行缩进\n        'italic', //斜体\n        'underline', //下划线\n        'strikethrough', //删除线\n        'subscript', //下标\n        'fontborder', //字符边框\n        'superscript', //上标\n        'formatmatch', //格式刷\n        'forecolor', //字体颜色\n        'justifyleft', //居左对齐\n        'justifycenter', //居中对齐\n        'justifyright', //居右对齐\n        'justifyjustify', //两端对齐\n        'fontfamily', //字体\n        'fontsize', //字号\n        'insertorderedlist', //有序列表\n        'insertunorderedlist', //无序列表\n        'lineheight', //行间距\n        'inserttable' //插入表格\n        ]],\n        // 初始容器宽度\n        initialFrameWidth: \"100%\",\n        zIndex: 9999,\n        enableAutoSave: false,\n        readonly: false\n      },\n      isEdit: false //是否编辑自动任务节点\n\n    };\n  },\n  methods: {\n    //添加接收人配置选择（消息任务）\n    addUserCondition: function addUserCondition(setting, index) {\n      this.curEditSetting = setting;\n      this.curEditRuleIndex = index;\n      var conf = {};\n\n      if (index != undefined) {\n        var ruleList = this.nodeMessage[setting].ruleList;\n        var userRule = ruleList[index];\n        conf.userRule = JSON.parse(JSON.stringify(userRule));\n      }\n\n      conf = _objectSpread(_objectSpread({}, conf), {\n        nodeType: \"signTask\",\n        nodeId: this.node.nodeId,\n        defId: this.node.defId\n      });\n      this.$refs.flowNodeUserCondition.showDialog(conf);\n    },\n    //获取接收人配置返回的值\n    nodeUserConditionConfirm: function nodeUserConditionConfirm(res) {\n      if (this.curEditRuleIndex != undefined) {\n        this.nodeMessage[this.curEditSetting].ruleList.splice(this.curEditRuleIndex, 1, res);\n      } else {\n        this.nodeMessage[this.curEditSetting].ruleList.push(res);\n      }\n\n      this.$forceUpdate();\n    },\n    //监听条件脚本确认事件(脚本任务)\n    conditionDialogConfirm: function conditionDialogConfirm(data) {\n      this.scriptJson.script = this.scriptJson.script + data;\n    },\n    //显示条件脚本对话框\n    showConditionBuild: function showConditionBuild() {\n      this.$refs.flowConditionBuildDialog.showDialog();\n    },\n    //监督可选变量的返回值(脚本任务)\n    varTreeOnConfirmScript: function varTreeOnConfirmScript(data) {\n      this.scriptJson.script = this.scriptJson.script + data.pathValue;\n    },\n    //显示常用脚本\n    showDialog: function showDialog(action) {\n      this.$refs[action].showDialog();\n    },\n    //设置自动任务\n    editAutoService: function editAutoService() {\n      var Base64 = require(\"js-base64\").Base64;\n\n      this.dialogVisibleSetting = true; //根据定义id和节点id查询该自动任务节点是否已经配置过\n\n      var this_ = this;\n      req.get(\"${bpmModel}/flow/node/v1/autoTaskManager?defId=\" + this.node.defId + \"&nodeId=\" + this.node.nodeId).then(function (data) {\n        data = data.data;\n\n        if (data.bpmPluginContext) {\n          this_.isEdit = true;\n          this_.tabType = data.bpmPluginContext.type;\n\n          if (this_.tabType == \"message\") {\n            req.get(\"${bpmModel}/flow/node/v1/autoTaskPluginGet?defId=\" + this_.node.defId + \"&nodeId=\" + this_.node.nodeId + \"&pluginType=message\").then(function (data) {\n              data = data.data;\n\n              if (data.bpmPluginDefJson) {\n                var val = Base64.decode(data.bpmPluginDefJson, \"utf-8\");\n                this_.nodeMessage = JSON.parse(val);\n              } else {\n                this_.nodeMessage = {\n                  htmlSetting: {\n                    msgType: \"\",\n                    content: \"\",\n                    ruleList: []\n                  },\n                  plainTextSetting: {\n                    msgType: \"\",\n                    content: \"\",\n                    ruleList: []\n                  }\n                };\n              }\n            });\n          } else {\n            req.get(\"${bpmModel}/flow/node/v1/autoTaskPluginGet?defId=\" + this_.node.defId + \"&nodeId=\" + this_.node.nodeId + \"&pluginType=scriptNode\").then(function (data) {\n              data = data.data;\n\n              if (data.bpmPluginDefJson) {\n                var val = Base64.decode(data.bpmPluginDefJson, \"utf-8\");\n                this_.scriptJson = JSON.parse(val);\n              } else {\n                this_.scriptJson = {\n                  script: \"\"\n                };\n              }\n            });\n          }\n        } else {\n          //第一次进入，默认初始化消息自动任务\n          this_.tabType = \"message\";\n          this_.nodeMessage = {\n            htmlSetting: {\n              msgType: \"\",\n              content: \"\",\n              ruleList: []\n            },\n            plainTextSetting: {\n              msgType: \"\",\n              content: \"\",\n              ruleList: []\n            }\n          };\n        }\n      });\n    },\n    //保存自动任务\n    saveScript: function saveScript() {\n      var this_ = this;\n      var formName = this_.tabType == \"message\" ? \"settingSave\" : \"scriptForm\";\n      this_.$validator.validateAll(formName).then(function (result) {\n        if (result) {\n          if (!this_.isEdit) {\n            this_.$confirm(\"自动节点支持一种任务节点类型（脚本、消息等）， 保存所选择的任务类型后无法修改。\", \"提示\", {\n              cancelButtonText: \"取消\",\n              confirmButtonText: \"确定\",\n              type: \"warning\",\n              closeOnClickModal: false\n            }).then(function () {\n              this_.save();\n            });\n          } else {\n            this_.save();\n          }\n        } else {\n          var arr = this_.$validator.errors.items.filter(function (item) {\n            return item.scope == \"settingSave\";\n          });\n          var errorLength = arr.length;\n          this_.$message({\n            showClose: true,\n            message: \"\\u6709\".concat(errorLength, \"\\u4E2A\\u5B57\\u6BB5\\u672A\\u901A\\u8FC7\\u6821\\u9A8C\\uFF0C\\u8BF7\\u6B63\\u786E\\u586B\\u5199\\u8868\\u5355\\u5185\\u5BB9\\u3002\"),\n            type: \"warning\"\n          });\n        }\n      });\n    },\n    save: function save() {\n      var this_ = this; //消息任务\n\n      if (this_.tabType == \"message\") {\n        this_.nodeMessage.pluginType = \"message\";\n        if (!this_.nodeMessage.htmlSetting) this_.nodeMessage.htmlSetting = {};\n        var param = {\n          defId: this_.node.defId,\n          nodeId: this_.node.nodeId,\n          jsonStr: JSON.stringify(this_.nodeMessage)\n        };\n        var isHtmlEmpt = false;\n\n        if (!this_.nodeMessage.htmlSetting.content || !this_.nodeMessage.htmlSetting.msgType || !this_.nodeMessage.htmlSetting.subject || !this_.nodeMessage.htmlSetting.ruleList || this_.nodeMessage.htmlSetting.ruleList.length == 0) {\n          isHtmlEmpt = true;\n        }\n\n        var isTextEmpt = false;\n\n        if (!this_.nodeMessage.plainTextSetting.content || !this_.nodeMessage.plainTextSetting.msgType || !this_.nodeMessage.plainTextSetting.ruleList || this_.nodeMessage.plainTextSetting.ruleList.length == 0) {\n          isTextEmpt = true;\n        }\n\n        if (isTextEmpt && isHtmlEmpt) {\n          this.$message.error(\"富文本和普通消息至少要有一种配置完整，才能发送\");\n          return;\n        }\n\n        var url = \"${bpmModel}/flow/node/v1/autoTaskPluginSave\";\n        req.post(url, param).then(function (data) {\n          data = data.data;\n\n          if (data.state) {\n            this_.dialogVisibleSetting = false;\n            var autoTask = {\n              pluginType: \"message\",\n              htmlSetting: this_.nodeMessage.htmlSetting,\n              plainTextSetting: this_.nodeMessage.plainTextSetting,\n              title: \"消息节点\",\n              externalClass: this_.nodeMessage.externalClass\n            };\n            this_.$emit(\"update:autoTask\", autoTask); //子组件更新父组件的值\n\n            Message.success(\"消息任务配置成功\");\n          } else {\n            Message.error(data.message);\n          }\n        });\n      } else if (this_.tabType == \"scriptNode\") {\n        //脚本任务\n        this_.scriptJson.pluginType = \"scriptNode\";\n        var _param = {\n          defId: this_.node.defId,\n          nodeId: this_.node.nodeId,\n          jsonStr: JSON.stringify(this_.scriptJson)\n        };\n        var _url = \"${bpmModel}/flow/node/v1/autoTaskPluginSave\";\n        req.post(_url, _param).then(function (data) {\n          data = data.data;\n\n          if (data.state) {\n            this_.dialogVisibleSetting = false;\n            var autoTask = {\n              pluginType: \"scriptNode\",\n              script: this_.scriptJson.script,\n              title: \"脚本\"\n            };\n            this_.$emit(\"update:autoTask\", autoTask); //子组件更新父组件的值\n\n            Message.success(\"脚本任务配置成功\");\n          } else {\n            Message.error(data.message);\n          }\n        });\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    }\n  },\n  mounted: function mounted() {\n    this.$validator = this.$root.$validator;\n  }\n};",null]}