{"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\\FlowNodeEventSetting.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowNodeEventSetting.vue","mtime":1675071991803},{"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 _typeof from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/typeof\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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';\nexport default {\n  name: \"FlowNodeEventSetting\",\n  components: {},\n  props: {\n    //某个节点事件的标题\n    titleSetting: {\n      type: String,\n      required: true,\n      default: \"节点事件设置\"\n    },\n    //节点事件配置信息\n    passConf: {\n      type: Object,\n      required: true\n    }\n  },\n  data: function data() {\n    return {\n      dialogVisibleSetting: false,\n      //是否显示设置节点事件侧边栏\n      restfulList: [],\n      //接口配置信息\n      restfulCopy: [],\n      //复制的节点事件配置信息\n      canSubmit: true\n    };\n  },\n  methods: {\n    //全局事件中是否包含节点事件\n    isGlobalNode: function isGlobalNode(callTime) {\n      if (callTime) {\n        return callTime.indexOf('taskCreate') != -1 || callTime.indexOf('taskComplete') != -1 ? true : false;\n      }\n\n      return false;\n    },\n    //显示设置节点事件侧边栏\n    showDialog: function showDialog() {\n      this.dialogVisibleSetting = true;\n      this.restfulList = [];\n      this.restfulCopy = JSON.parse(JSON.stringify(this.passConf.restful)); //复制的节点事件配置信息 （原生的）\n\n      var restfulJson = this.restfulCopy; //判断是否存在接口事件\n\n      if (!restfulJson || restfulJson.length == 0) {\n        restfulJson = '[{\"url\":\"\",\"desc\":\"\",\"invokeMode\":1,\"callTime\":\"\",\"header\":\"\",\"inParam\":\"\",\"outParam\":\"\"}]';\n        restfulJson = eval('(' + restfulJson + ')');\n      } else {\n        var len = restfulJson.length;\n\n        for (var i = 0; i < len; i++) {\n          var headerJson = restfulJson[i]['header'];\n\n          if (headerJson && _typeof(headerJson) == \"object\") {\n            restfulJson[i]['header'] = headerJson;\n          }\n        }\n      }\n\n      this.restfulList = restfulJson;\n    },\n    //判断是否JSON类型\n    fromJson: function fromJson(json) {\n      //传入的参数如果是字符串类型则转JOSN类型\n      if (this.isString(json)) {\n        this.canSubmit = true;\n        var formJson = {};\n\n        try {\n          formJson = JSON.parse(json);\n          this.canSubmit = true;\n        } catch (error) {\n          this.$message.warning(\"请求头部必须是json格式的字符串\");\n          this.canSubmit = false;\n        }\n\n        return json;\n      } else {\n        this.canSubmit = true;\n        return JSON.stringify(json);\n      }\n    },\n    //判断是否字符串类型\n    isString: function isString(value) {\n      return typeof value === 'string';\n    },\n    //保存节点事件\n    saveEvent: function saveEvent() {\n      var _this = this;\n\n      var this_ = this;\n      this_.$validator.validateAll(\"settingSave\").then(function (result) {\n        if (result) {\n          var data = JSON.parse(JSON.stringify(this_.restfulList)); //复制接口配置信息\n\n          if (data && data.length > 0) {\n            for (var i = 0; i < data.length; i++) {\n              var headerJson = data[i]['header'];\n\n              if (headerJson) {\n                data[i]['header'] = this_.fromJson(headerJson);\n              }\n            }\n          }\n\n          if (!this_.canSubmit) {\n            return;\n          }\n\n          _this.$emit(\"handle-save\", data); //点击保存了获取最新的节点事件配置信息,并发布保存事件\n\n\n          this_.dialogVisibleSetting = false; //关闭侧边栏\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    //新增节点事件\n    addEvent: function addEvent() {\n      var restful = {\n        \"url\": \"\",\n        \"desc\": \"\",\n        \"invokeMode\": 1,\n        \"callTime\": \"\",\n        \"header\": \"\",\n        \"inParam\": \"\",\n        \"outParam\": \"\"\n      };\n      this.restfulList.push(restful);\n    },\n    //关闭设置接口事件侧边栏\n    close: function close() {\n      this.restfulList = [];\n      this.passConf.restful = this.restfulCopy; //没点击保存直接关闭则获取原来复制的节点事件配置信息 （原生的）\n\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]}