{"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\\FlowFormConfig.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\flow\\FlowFormConfig.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 \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 flow from '@/api/flow.js';\nimport req from '@/request.js';\nimport { mapState, mapActions } from 'vuex';\n\nvar FlowFormAuth = function FlowFormAuth() {\n  return import('@/components/flow/FlowFormAuth.vue');\n};\n\nvar FlowFormRightSubSetting = function FlowFormRightSubSetting() {\n  return import('@/components/flow/FlowFormRightSubSetting.vue');\n};\n\nvar FlowFormExtraPropSet = function FlowFormExtraPropSet() {\n  return import('@/components/flow/FlowFormExtraPropSet.vue');\n};\n\nvar EipFormDialog = function EipFormDialog() {\n  return import('@/components/dialog/EipFormDialog.vue');\n};\n\nvar HtFileUpload = function HtFileUpload() {\n  return import('@/components/common/HtFileUpload.vue');\n};\n\nexport default {\n  props: {\n    labelWidth: {\n      type: String,\n      default: '100px'\n    },\n    defId: String,\n    title: String,\n    type: String,\n    nodeId: String,\n    defkey: String,\n    nodeType: String\n  },\n  components: {\n    FlowFormAuth: FlowFormAuth,\n    FlowFormExtraPropSet: FlowFormExtraPropSet,\n    EipFormDialog: EipFormDialog,\n    HtFileUpload: HtFileUpload,\n    FlowFormRightSubSetting: FlowFormRightSubSetting\n  },\n  data: function data() {\n    return {\n      tempSettting: {},\n      bpmForm: {},\n      showAuthorizeSubData: false,\n      formDialogVisible: false,\n      formListData: [],\n      tableColumns: [{\n        prop: 'formKey',\n        label: '表单key'\n      }, {\n        prop: 'name',\n        label: '表单名称',\n        width: '300'\n      }, {\n        prop: 'version',\n        label: '版本号'\n      }],\n      pageResult: {\n        page: 1,\n        pageSize: 50,\n        total: 0\n      },\n      curSelectForm: {},\n      files: []\n    };\n  },\n  computed: mapState({\n    defConfigData: function defConfigData(state) {\n      return state.flow.defConfigData;\n    },\n    header: function header(state) {\n      return {\n        Authorization: \"Bearer \".concat(state.login.currentUser.token)\n      };\n    },\n    actionUrl: function actionUrl() {\n      return window.context.portal + '/file/v1/upload';\n    }\n  }),\n  watch: {\n    bpmForm: {\n      handler: function handler(newValue, oldValue) {\n        this.updateForm();\n      },\n      deep: true\n    }\n  },\n  mounted: function mounted() {\n    var this_ = this; //监听保存流程配置的点击事件\n\n    this.$root.$on('nodeSetUpdate', function (value) {\n      if (this_.nodeType) {\n        this_.bpmForm.pc.formValue = this_.bpmForm.pc.formValue || ''; //判断是否显示子表数据授权按钮\n\n        if ((this_.nodeType == 'userTask' || this_.nodeType == 'signTask') && this_.bpmForm.pc.formValue != '') {\n          this_.showAuthorizeSubData = true;\n        } else {\n          this_.showAuthorizeSubData = false;\n        }\n      }\n    }); //打开配件节点表单时，判断是否显示子表数据授权按钮\n\n    if (this_.bpmForm.pc.formValue && (this_.nodeType == 'userTask' || this_.nodeType == 'signTask')) {\n      this_.showAuthorizeSubData = true;\n    }\n  },\n  methods: {\n    handleTypeChange: function handleTypeChange(val) {\n      var _this = this;\n\n      if (this.bpmForm.pc.formValue || this.bpmForm.mb.formValue) {\n        var this_ = this;\n        this.$confirm('更换表单类型会清除之前的表单配置，是否确认更换？', '提示', {\n          confirmButtonText: '确定',\n          cancelButtonText: '取消',\n          type: 'warning'\n        }).then(function () {\n          if (val == 'FRAME') {\n            if (this_.bpmForm.mb.formValue) {\n              this_.doClearForm(this_.bpmForm.mb);\n            }\n\n            this_.doClearForm(this_.bpmForm.pc);\n          } else {\n            this_.$set(this_.bpmForm.pc, 'name', '');\n            this_.$set(this_.bpmForm.pc, 'formValue', '');\n            this_.$set(this_.bpmForm.mb, 'name', '');\n            this_.$set(this_.bpmForm.mb, 'formValue', '');\n          }\n        }).catch(function () {\n          _this.$set(this_.bpmForm.pc, 'type', val == 'INNER' ? 'FRAME' : 'INNER');\n        });\n      }\n    },\n    //打开子表数据授权\n    authorizeSubData: function authorizeSubData() {\n      this.$refs.flowFormRightSubSetting.showDialog();\n    },\n    dialogCancel: function dialogCancel() {},\n    formPropSetConfirm: function formPropSetConfirm(conf) {\n      this.bpmForm.pc.formExtraConf = JSON.stringify(conf);\n    },\n    setFormExtraConf: function setFormExtraConf() {\n      var param = {\n        formkey: this.bpmForm.pc.formValue,\n        propConf: this.bpmForm.pc.formExtraConf\n      };\n      this.$refs.flowFormExtraPropSet.showDialog(param);\n    },\n    dialogConfirm: function dialogConfirm(data) {\n      var _this2 = this;\n\n      if (data && data.length > 0) {\n        data = data[0];\n\n        if (this.curSelectForm.formValue && this.curSelectForm.formValue != data.formKey && this.curSelectForm.formType == 'pc') {\n          var this_ = this;\n          this.$confirm('更换表单将会清除之前表单权限配置和手机表单，是否确认更换？', '提示', {\n            cancelButtonText: '取消',\n            confirmButtonText: '确定',\n            type: 'warning',\n            closeOnClickModal: false\n          }).then(function () {\n            if (this_.bpmForm.mb.formValue) {\n              this_.doClearForm(this_.bpmForm.mb);\n            }\n\n            _this2.doClearForm(this_.curSelectForm, function () {\n              this_.curSelectForm.formValue = data.formKey;\n              this_.curSelectForm.name = data.name;\n              this_.formDialogVisible = false;\n              this_.$message.success('表单设置已清除');\n            });\n          });\n        } else {\n          this.curSelectForm.formValue = data.formKey;\n          this.curSelectForm.name = data.name;\n          this.formDialogVisible = false;\n        }\n      }\n    },\n    selectForm: function selectForm(form) {\n      if (form.formType == 'mobile' && !this.bpmForm.pc.formValue) {\n        this.$message.warning('请先选择pc表单，才能根据pc表单的数据建模筛选手机表单');\n        return;\n      }\n\n      this.curSelectForm = form;\n      this.$refs.eipFormDialog.showDialog();\n    },\n    formAuth: function formAuth() {\n      var param = {\n        flowKey: this.defConfigData.initData.bpmDefinition.defKey,\n        formKey: this.bpmForm.pc.formValue,\n        nodeId: this.nodeId,\n        parentflowKey: this.defkey == undefined ? '' : this.defkey,\n        type: this.type\n      };\n      this.$refs.flowFormAuth.showDialog(param);\n    },\n    clearForm: function clearForm(form, callBack) {\n      var _this3 = this;\n\n      if (form.formType == 'pc') {\n        this.$confirm('此操作清除之前表单权限配置和手机表单，是否确认操作？', '提示', {\n          cancelButtonText: '取消',\n          confirmButtonText: '确定',\n          type: 'warning',\n          closeOnClickModal: false\n        }).then(function () {\n          _this3.doClearForm(form);\n\n          if (_this3.bpmForm.mb.formValue) {\n            _this3.doClearForm(_this3.bpmForm.mb);\n          }\n        });\n      } else {\n        this.doClearForm(form);\n      }\n    },\n    doClearForm: function doClearForm(form, callBack) {\n      var nodeId = form.nodeId || '';\n      var this_ = this;\n      var parentFlowKey = this.defkey == undefined ? '' : this.defkey;\n      req.get('${form}/form/rights/v1/remove?flowKey=' + this.defConfigData.initData.bpmDefinition.defKey + '&nodeId=' + nodeId + '&parentFlowKey=' + parentFlowKey).then(function (resp) {\n        var data = resp.data;\n\n        if (data.state) {\n          this_.$set(form, 'name', '');\n          this_.$set(form, 'formValue', '');\n          this_.showAuthorizeSubData = false;\n\n          if (callBack) {\n            callBack();\n          } else {\n            this_.$message.success('表单设置已清除');\n          }\n        } else {\n          this_.$message.fail(data.message);\n        }\n      });\n    },\n    success: function success(response, file, fileList) {\n      this.files = [];\n\n      for (var i = 0; i < fileList.length; i++) {\n        if (fileList[i].response) {\n          var value = fileList[i].response;\n          var arrarFile = {};\n          arrarFile.id = value.fileId;\n          arrarFile.name = value.fileName;\n          arrarFile.size = value.size;\n          this.files.push(arrarFile);\n        }\n      }\n\n      this.bpmForm.pc.helpFile = JSON.stringify(this.files);\n    },\n    handleRemove: function handleRemove(file, fileList) {\n      this.$set(this.bpmForm.pc, 'helpFile', '');\n    },\n    updateForm: function updateForm() {\n      //保持pc端和移动端表单的类型一致\n      this.bpmForm.mb.type = this.bpmForm.pc.type;\n\n      if (this.type == '1') {\n        this.$store.dispatch('flow/updateConfig', {\n          'nodeSetData.bpmDefSetting.globalForm': this.bpmForm.pc\n        });\n        this.$store.dispatch('flow/updateConfig', {\n          'nodeSetData.bpmDefSetting.globalMobileForm': this.bpmForm.mb\n        });\n      } else if (this.type == '2') {\n        this.$store.dispatch('flow/updateConfig', {\n          'nodeSetData.bpmDefSetting.instForm': this.bpmForm.pc\n        });\n        this.$store.dispatch('flow/updateConfig', {\n          'nodeSetData.bpmDefSetting.instMobileForm': this.bpmForm.mb\n        });\n      } else {\n        var pcPath = 'nodeSetData.bpmDefSetting.formMap.' + this.nodeId;\n        var mbPath = 'nodeSetData.bpmDefSetting.mobileFormMap.' + this.nodeId;\n        var pcForm = {};\n        pcForm[pcPath] = this.bpmForm.pc;\n        var mbForm = {};\n        mbForm[mbPath] = this.bpmForm.mb;\n        this.$store.dispatch('flow/updateConfig', pcForm);\n        this.$store.dispatch('flow/updateConfig', mbForm);\n      }\n    }\n  },\n  created: function created() {\n    if (this.defConfigData.nodeSetData.bpmDefSetting) {\n      this.tempSettting = JSON.parse(JSON.stringify(this.defConfigData.nodeSetData.bpmDefSetting));\n\n      if (this.type == '1') {\n        this.bpmForm = {\n          pc: this.tempSettting.globalForm,\n          mb: this.tempSettting.globalMobileForm\n        };\n      } else if (this.type == '2') {\n        this.bpmForm = {\n          pc: this.tempSettting.instForm,\n          mb: this.tempSettting.instMobileForm\n        };\n      } else {\n        this.bpmForm = {\n          pc: this.tempSettting.formMap[this.nodeId],\n          mb: this.tempSettting.mobileFormMap[this.nodeId]\n        };\n      }\n\n      if (this.bpmForm.pc && this.bpmForm.pc.helpFile) {\n        this.files = JSON.parse(this.bpmForm.pc.helpFile);\n      }\n    }\n  }\n};",null]}