{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\components\\flow\\startByKey.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\flow\\startByKey.vue","mtime":1675214577089},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 FormContent from \"@/components/flow/formContent.vue\";\nimport TaskSelectDestination from \"@/components/flow/task/taskSelectDestination.vue\";\nimport utils from \"@/utils.js\";\nimport { Base64 } from \"js-base64\";\nimport { debuglog } from \"util\";\nexport default {\n  name: \"startByKey\",\n  components: {\n    FormContent: FormContent,\n    TaskSelectDestination: TaskSelectDestination\n  },\n  props: [\"defKey\"],\n  data: function data() {\n    return {\n      disabled: true,\n      nodeDef: {},\n      instId: \"\",\n      leaderId: 0,\n      flowId: \"\",\n      defName: \"\",\n      defId: \"\",\n      isShowStartBtn: true\n    };\n  },\n  computed: mapState({// curOrgPost: state => state.user.postCharge,\n    // defId: async function() {\n    //   var defId = \"\";\n    //   if (this.defKey) {\n    //     var p = await this.getDef();\n    //     p.then(res => {\n    //       debugger;\n    //       defId = res;\n    //     });\n    //     // return \"1245909504526516224\";\n    //   }\n    //   return defId;\n    // }\n  }),\n  mounted: function mounted() {\n    var _this = this; //如果该字段的校验受另一个字段影响。则监听另一个字段控件发布的值改变事件\n\n\n    this.$root.$on(\"startFlowBtnChange\", function (value) {\n      _this.isShowStartBtn = value;\n    }); //监听表单加载完成发布事件\n\n    this.$root.$on(\"formLoading\", function (value) {\n      _this.disabled = value;\n    });\n  },\n  methods: {\n    getDef: function () {\n      var _getDef = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n        var this_, promise;\n        return regeneratorRuntime.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                this_ = this;\n                promise = new Promise(function (resolve, reject) {\n                  req.get(window.context.bpmModel + \"/flow/def/v1/getJson?defKey=\" + this_.defKey).then(function (res) {\n                    resolve(res.data.defId);\n                  });\n                });\n                _context.next = 4;\n                return promise;\n\n              case 4:\n                return _context.abrupt(\"return\", _context.sent);\n\n              case 5:\n              case \"end\":\n                return _context.stop();\n            }\n          }\n        }, _callee, this);\n      }));\n\n      function getDef() {\n        return _getDef.apply(this, arguments);\n      }\n\n      return getDef;\n    }(),\n    // 准备数据\n    handleData: function handleData(formDataStr) {\n      var data = {\n        defId: this.defId\n      }; // URL表单\n\n      if (formDataStr.constructor == Object) {\n        data.formType = \"frame\";\n\n        if (formDataStr.businessKey) {\n          data.businessKey = formDataStr.businessKey;\n        }\n\n        if (formDataStr.sysCode) {\n          data.sysCode = formDataStr.sysCode;\n        }\n\n        if (formDataStr.vars) {\n          data.vars = formDataStr.vars;\n        }\n      } else if (formDataStr.constructor == String) {\n        data.data = Base64.encode(formDataStr);\n        data.formType = \"inner\";\n      }\n\n      data.supportMobile = 0;\n\n      if (this.instId) {\n        data.proInstId = this.instId;\n      }\n\n      if (this.curOrgPost && this.curOrgPost.org) {\n        data.startOrgId = this.curOrgPost.org.id;\n      }\n\n      if (window.urgentStateValue) {\n        data.urgentStateValue = window.urgentStateValue;\n      }\n\n      if (this.leaderId && this.leaderId != 0) {\n        data.agentLeaderId = this.leaderId;\n      }\n\n      return data;\n    },\n    start: function start() {\n      var _this2 = this;\n\n      var this_ = this; //获取VUE表单实例(判断是否是在线表单)\n\n      if (document.getElementsByName(\"online-form\")[0]) {\n        var tables = document.getElementsByName(\"online-form\")[0].__vue__.permission.table; //获取子表权限\n\n\n        var boData = document.getElementsByName(\"online-form\")[0].__vue__.data; //获取表单bo对象\n\n\n        var zData = {};\n\n        for (var k in boData) {\n          zData = boData[k];\n        }\n\n        for (var key in tables) {\n          //如果有导入属性，则表明不是子表而是数据报表，不做必填校验\n          if (tables[key] && tables[key].hasOwnProperty(\"export\")) {\n            continue;\n          }\n\n          if ((tables[key].required == true || tables[key].required == \"true\") && zData[\"sub_\" + key] && zData[\"sub_\" + key].length == 0) {\n            this.$message({\n              message: \"子表必填一条记录\",\n              type: \"warning\"\n            });\n            return;\n          }\n        }\n      }\n\n      utils.getOnlineFormData(true).then(function (formDataStr) {\n        utils.closeAllNotification();\n\n        if (!_this2.nodeDef.localProperties.jumpType && !_this2.nodeDef.localProperties.choiceExcutor) {\n          _this2.processStart(formDataStr);\n        } else {\n          _this2.$store.dispatch(\"storeProcess/getAfterJumpNodes\", {\n            taskId: \"\",\n            data: Base64.encode(formDataStr),\n            defId: _this2.defId || \"\",\n            instId: _this2.instId || \"\"\n          }).then(function (data) {\n            if (data.afterNodes.length == 0 || data.afterNodes.length == 1 && data.afterNodes[0].excutorList != undefined && data.afterNodes[0].excutorList.length == 1) {\n              _this2.processStart(formDataStr);\n            } else {\n              var formData = {};\n\n              if (formDataStr.constructor == Object) {\n                formData = formDataStr;\n                formData.data = \"\";\n              } else if (formDataStr.constructor == String) {\n                formData.data = Base64.encode(formDataStr);\n              }\n\n              _this2.$refs.taskSelectDestination.showDialog(formData, \"\", \"\"); //父组件调用子组件方法\n\n            }\n          });\n        }\n      }).catch(function (reason) {\n        return utils.handleGetFormDataReject(reason, true).then(function () {\n          return this_.processStart();\n        });\n      });\n    },\n    //流程发起\n    processStart: function processStart(formDataStr) {\n      var _this3 = this;\n\n      var formKey = this.$refs.formContent.formKey;\n      var data = this.handleData(formDataStr);\n\n      if (sessionStorage.getItem('formImportTempJson')) {\n        data.updateSubTableJson = sessionStorage.getItem('formImportTempJson');\n      }\n\n      this.disabled = true;\n      this.$store.dispatch(\"storeProcess/start\", data).then(function (row) {\n        _this3.$store.dispatch(\"storeProcess/getInstanceByInstId\", row.instId).then(function (insts) {\n          if (row.curBoPkVal) {\n            sessionStorage.setItem('formImportTempRefId', row.curBoPkVal);\n          }\n\n          sessionStorage.removeItem('formImportTempJson');\n\n          _this3.$router.push(\"/v-flow/v-done/\" + _this3.defKey);\n          /* if (insts.status != \"end\") {\r\n             this.$router.push(\"/v-flow/v-done\");\r\n             this.$router.push(\"/inst/\" + row.instId + \"/request\");\r\n           } else {\r\n             this.$router.push(\"/instRead/\" + row.instId + \"/myRequest\");\r\n           }*/\n\n        });\n      }).finally(function () {\n        _this3.disabled = false;\n      });\n    },\n    //保存\n    saveDraft: function saveDraft() {\n      var _this4 = this;\n\n      var formKey = this.$refs.formContent.formKey;\n      var this_ = this;\n      utils.getOnlineFormData(true).then(function (formDataStr) {\n        utils.closeAllNotification();\n        var data = this_.handleData(formDataStr);\n        data.formKey = formKey;\n\n        if (sessionStorage.getItem('formImportTempJson')) {\n          data.updateSubTableJson = sessionStorage.getItem('formImportTempJson');\n        }\n\n        this_.$store.dispatch(\"storeProcess/saveDraft\", data).then(function (row) {\n          if (row.curBoPkVal) {\n            sessionStorage.setItem('formImportTempRefId', row.curBoPkVal);\n          }\n\n          sessionStorage.removeItem('formImportTempJson');\n          this_.isMyRequest = true;\n          this_.$router.replace(\"/start/\" + this_.defId + \"/\" + row.instId);\n        }).catch(function (r) {});\n      }).catch(function (reason) {\n        return utils.handleGetFormDataReject(reason).then(function () {\n          return _this4.processStart();\n        });\n      });\n    },\n    //返回\n    back: function back() {\n      utils.closeAllNotification();\n\n      if (this.isMyRequest) {\n        this.$router.push(\"/v-flow/v-request\");\n      } else {\n        if (JSON.stringify(this.$route.query) == \"{}\") {\n          this.$router.go(-1);\n        } else {\n          this.$router.push(\"/home\");\n        }\n      }\n    }\n  },\n  created: function created() {\n    var _this5 = this;\n\n    var p = this.getDef();\n    p.then(function (res) {\n      _this5.defId = res; //取发起节点的属性用于判断是否可以选择路径跳转\n\n      window.agentLeaderId = _this5.leaderId;\n\n      _this5.$store.dispatch(\"storeProcess/getCurNodeProperties\", {\n        defId: _this5.defId || \"\",\n        instId: _this5.instId || \"\",\n        taskId: \"\"\n      }).then(function (NodeDef) {\n        _this5.nodeDef = NodeDef;\n\n        if (NodeDef.nodeProperties && NodeDef.nodeProperties[0].initFillData) {\n          _this.initFillData = NodeDef.nodeProperties[0].initFillData;\n\n          _this.$refs['formContent'].setInitFillData(_this.initFillData);\n        }\n      }); //获取流程信息\n\n\n      req.get(window.context.bpmModel + \"/flow/def/v1/defGet?defId=\" + _this5.defId).then(function (res) {\n        _this5.defName = res.data.name;\n      });\n    });\n  }\n};",null]}