{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\form\\MobileFormManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\form\\MobileFormManager.vue","mtime":1675071992913},{"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":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport {mapState} from 'vuex'\r\nimport form from '@/api/form.js'\r\nimport req from '@/request.js'\r\nconst htAsideTree = () => import('@/components/common/HtAsideTree.vue')\r\nconst EipSysTypeSelector = () =>\r\n  import('@/components/selector/EipSysTypeSelector.vue')\r\nconst FormDesigner = () => import('@/components/form/FormDesigner.vue')\r\nconst EipBoSelector = () => import('@/components/selector/EipBoSelector.vue')\r\nconst FlowFormAuth = () => import('@/components/flow/FlowFormAuth.vue')\r\nconst FormVersionManager = () => import('@/views/form/FormVersionManager.vue')\r\nconst eipSysTypeDialog = () =>\r\n  import('@/components/dialog/EipSysTypeDialog.vue')\r\nconst eipBoDialog = () => import('@/components/dialog/EipBoDialog.vue')\r\n\r\nexport default {\r\n  components: {\r\n    htAsideTree,\r\n    EipSysTypeSelector,\r\n    FormDesigner,\r\n    EipBoSelector,\r\n    FlowFormAuth,\r\n    FormVersionManager,\r\n    eipSysTypeDialog,\r\n    eipBoDialog,\r\n  },\r\n  data() {\r\n    return {\r\n      formTypeSelectorCatName: '',\r\n      fullscreenLoading: false,\r\n      importDialogVisible: false,\r\n      asideShow: true,\r\n      treeData: [],\r\n      defaultProps: {\r\n        children: 'children',\r\n        label: 'name',\r\n      },\r\n      data: [],\r\n      pageResult: {\r\n        page: 1,\r\n        pageSize: 20,\r\n        total: 0,\r\n      },\r\n      dialogVisible: false,\r\n      formEditorDialogVisible: false,\r\n      dialogSaveCopyVisible: false,\r\n      formId: null,\r\n      formDefId: null,\r\n      bpmForm: {\r\n        formKey: '',\r\n        bos: '',\r\n        desc: '',\r\n        formType: 'mobile',\r\n      },\r\n      typeIdQuery: null,\r\n      formVersionVisible: false,\r\n      formKey: null,\r\n      updateTableData: [],\r\n      formRow: {},\r\n      newForm: {id: '', name: '', formKey: '', typeId: '', typeName: ''},\r\n    }\r\n  },\r\n  watch: {\r\n    formEditorDialogVisible: function (newVal, oldVal) {\r\n      if (newVal == false && oldVal == true) {\r\n        this.handleCloseFormEditor()\r\n      }\r\n    },\r\n  },\r\n  computed: {\r\n    ...mapState({\r\n      currentUser: (state) => state.login.currentUser,\r\n      formDeleteUrl: function () {\r\n        return `${window.context.form}/form/form/v1/remove`\r\n      },\r\n      uploadHeaders: function (mapState) {\r\n        return {Authorization: 'Bearer ' + mapState.login.currentUser.token}\r\n      },\r\n      imporCheckUrl: function (mapState) {\r\n        return (\r\n          window.context.form +\r\n          '/form/form/v1/importCheck?typeId=' +\r\n          this.formTypeSelectorCatId\r\n        )\r\n      },\r\n    }),\r\n  },\r\n  mounted() {\r\n    this.$validator = this.$root.$validator\r\n    if (this.$route.query.formId && this.$route.query.defId) {\r\n      let row = {\r\n        id: this.$route.query.formId,\r\n        defId: this.$route.query.defId,\r\n      }\r\n      this.handleCommand({row: row, command: 'edit'})\r\n      this.$router.push('form#mobileFormManager')\r\n    }\r\n  },\r\n  methods: {\r\n    handleImportSuccess() {\r\n      this.$message.success('表单导入成功')\r\n      this.importDialogVisible = false\r\n      this.$refs.htTable.load()\r\n      this.$refs.upload.clearFiles()\r\n    },\r\n    submitImport() {\r\n      if (\r\n        !this.$refs.upload.uploadFiles ||\r\n        this.$refs.upload.uploadFiles.length == 0\r\n      ) {\r\n        this.$message.warning('请选择要导入的表单!')\r\n        return false\r\n      }\r\n      if (!this.formTypeSelectorCatId) {\r\n        this.$message.warning('请选择要导入的分类!')\r\n        return false\r\n      }\r\n      this.$refs.upload.submit()\r\n    },\r\n    onExceed(file) {\r\n      this.$message.warning('只能选择一个zip文件!')\r\n    },\r\n    hadleUploadResult(response, file, fileList) {\r\n      var height =\r\n        (document.documentElement.clientHeight || document.body.clientHeight) *\r\n          0.85 +\r\n        'px'\r\n      this.fullscreenLoading = false\r\n      let this_ = this\r\n      if (response.state) {\r\n        this_.handleImportSuccess()\r\n      } else {\r\n        if (response.message) {\r\n          if (response.message.indexOf('是否继续为其新增版本') > 0) {\r\n            this.$confirm(\r\n              '<div style=\"overflow-x:hidden;overflow-y:auto ;max-height:' +\r\n                height +\r\n                '\">' +\r\n                response.message +\r\n                '</div>',\r\n              '提示',\r\n              {\r\n                cancelButtonText: '取消',\r\n                dangerouslyUseHTMLString: true,\r\n                confirmButtonText: '确定',\r\n                type: 'warning',\r\n                closeOnClickModal: false,\r\n              }\r\n            )\r\n              .then(() => {\r\n                this_.fullscreenLoading = true\r\n                this_.$http\r\n                  .post(\r\n                    `${window.context.form}/form/form/v1/importSave?cacheFileId=` +\r\n                      response.value +\r\n                      '&confirmImport=true&typeId=' +\r\n                      this.formTypeSelectorCatId\r\n                  )\r\n                  .then(function (resp) {\r\n                    this_.fullscreenLoading = false\r\n                    let data = resp.data\r\n                    if (data.state) {\r\n                      this_.handleImportSuccess()\r\n                    } else {\r\n                      this_.$message.error(data.message)\r\n                    }\r\n                  })\r\n              })\r\n              .catch((action) => {\r\n                this_.$http.post(\r\n                  `${window.context.form}/form/form/v1/importSave?confirmImport=false&cacheFileId=` +\r\n                    response.value\r\n                )\r\n                this_.importDialogVisible = false\r\n                this.$refs.upload.clearFiles()\r\n              })\r\n          } else {\r\n            this.$message.error(response.message)\r\n          }\r\n        }\r\n      }\r\n    },\r\n    beforeUpload(file) {\r\n      if (!file.name.endsWith('.zip')) {\r\n        this.$message.warning('只能导入zip文件!')\r\n        return false\r\n      }\r\n      this.imporActionUrl = this.imporCheckUrl\r\n      this.fullscreenLoading = true\r\n    },\r\n    //表格选中数据\r\n    tableSelect(selection) {\r\n      this.updateTableData = selection\r\n    },\r\n    handExport() {\r\n      let selection = this.$refs.htTable.$refs.htTable.selection\r\n      if (selection.length == 0) {\r\n        this.$message.warning('请选择至少一项记录')\r\n        return\r\n      }\r\n      let ids = []\r\n      for (let item of selection) {\r\n        ids.push(item['id'])\r\n      }\r\n      if (ids.length == 0) {\r\n        this.$message.warning('请选择至少一项记录')\r\n        return\r\n      }\r\n      let url = `${window.context.form}/form/form/v1/exportForm?formIds=${ids}`\r\n      req.download(url)\r\n    },\r\n    handleDialogSure(data, boo) {\r\n      if (Array.isArray(data)) {\r\n        this.bpmForm.bos = data\r\n        this.bpmForm.templateConf = {}\r\n      } else {\r\n        this.bpmForm.bos = data.selection\r\n        this.bpmForm.templateConf = data.templateConf\r\n      }\r\n      this.bpmForm.formType = 'mobile'\r\n      //this.bpmForm.name = this.bpmForm.formName;\r\n      this.formId = ''\r\n      this.formDefId = ''\r\n      this.formEditorDialogVisible = true\r\n      if (!boo) {\r\n        this.$refs.eipBoDialog.handleClose()\r\n      }\r\n    },\r\n    //设置分类\r\n    openTypeSetDialog() {\r\n      this.updateTableData = this.$refs.htTable.$refs.htTable.selection\r\n      if (this.updateTableData.length == 0) {\r\n        this.$message({\r\n          message: '请先选择需要设置分类的数据',\r\n          type: 'warning',\r\n        })\r\n        return\r\n      }\r\n      this.$refs.typeSetDialog.showDialog({})\r\n    },\r\n    sysTypeDialogOnConfirm(data) {\r\n      var id = []\r\n      for (let i = 0; i < this.updateTableData.length; i++) {\r\n        id.push(this.updateTableData[i].id)\r\n      }\r\n      let this_ = this\r\n      this.$http\r\n        .get(\r\n          '${portal}/sys/sysType/v1/updateEntitySysType?typeID=' +\r\n            data.id +\r\n            '&entityIds=' +\r\n            id.join(',')\r\n        )\r\n        .then(function (resp) {\r\n          if (resp.data && resp.data.state) {\r\n            this_.$message({message: resp.data.message, type: 'success'})\r\n            setTimeout(function () {\r\n              this_.dialogVisible = false\r\n              this_.$refs.htTable.load()\r\n            }, 3000)\r\n\r\n            return\r\n          }\r\n          this_.$message.error(resp.data.message)\r\n        })\r\n    },\r\n    handleCloseFormVersion() {\r\n      this.formVersionVisible = false\r\n    },\r\n    formAuth(formKey) {\r\n      let param = {\r\n        flowKey: '',\r\n        formKey: formKey,\r\n        nodeId: '',\r\n        parentflowKey: '',\r\n        type: '1',\r\n      }\r\n      this.$refs.flowFormAuth.showDialog(param)\r\n    },\r\n    handleNodeClick(node) {\r\n      if (node.typeKey == 'FORM_TYPE') {\r\n        this.typeIdQuery = null\r\n      } else {\r\n        this.bpmForm.typeName = node.name\r\n        this.typeIdQuery = {\r\n          property: 'typeId',\r\n          value: node.id,\r\n          group: 'typeId',\r\n          operation: 'EQUAL',\r\n          relation: 'AND',\r\n        }\r\n      }\r\n      this.$refs.htTable.load()\r\n    },\r\n    check(data, checkObj) {\r\n      if (checkObj.checkedKeys.length == 0) {\r\n        this.typeIdQuery = null\r\n      } else {\r\n        this.typeIdQuery = {\r\n          property: 'typeId',\r\n          value: checkObj.checkedKeys.join(','),\r\n          group: 'typeId',\r\n          operation: 'IN',\r\n          relation: 'AND',\r\n        }\r\n      }\r\n      this.$refs.htTable.load()\r\n    },\r\n    rowClick(row, column, event) {\r\n      this.$refs.htTable.$refs.htTable.toggleRowSelection(row)\r\n    },\r\n    loadData(param, cb) {\r\n      let _param = {}\r\n      _param = {..._param, ...param}\r\n      if (this.typeIdQuery) {\r\n        _param.querys.push(this.typeIdQuery)\r\n      }\r\n\r\n      form\r\n        .getPageJson(_param)\r\n        .then((response) => {\r\n          this.data = response.rows\r\n\r\n          this.pageResult = {\r\n            page: response.page,\r\n            pageSize: response.pageSize,\r\n            total: response.total,\r\n          }\r\n        })\r\n        .finally(() => cb())\r\n    },\r\n    handleCommand(params) {\r\n      this.formRow = params.row\r\n      switch (params.command) {\r\n        case 'edit':\r\n          this.bpmForm.bos = []\r\n          this.formId = params.row.id\r\n          this.formDefId = params.row.defId\r\n          this.formEditorDialogVisible = true\r\n          break\r\n        case 'preview':\r\n          if (this.currentUser && this.currentUser.account) {\r\n            let routeUrl = this.$router.resolve({\r\n              path: '/previewForm/' + params.row.id,\r\n            })\r\n            window.open(routeUrl.href, '_blank')\r\n            // window.open(\r\n            //   window.context.mobile +\r\n            //     \"/previewForm/\" +\r\n            //     params.row.id +\r\n            //     \"?token=\" +\r\n            //     this.currentUser.token,\r\n            //   // Base64.encode(this.currentUser.account),\r\n            //   \"_blank\"\r\n            // );\r\n          }\r\n          break\r\n        case 'publish':\r\n          this.$confirm('是否确定发布表单?', '提示', {\r\n            confirmButtonText: '确定',\r\n            cancelButtonText: '取消',\r\n            type: 'warning',\r\n          })\r\n            .then(() => {\r\n              this.$http\r\n                .post(\r\n                  '${form}/form/form/v1/publish',\r\n                  {},\r\n                  {formId: params.row.id}\r\n                )\r\n                .then((response) => {\r\n                  if (response.data.state) {\r\n                    this.$message({\r\n                      type: 'success',\r\n                      message: response.data.message,\r\n                    })\r\n                    this.$refs.htTable.load()\r\n                  } else {\r\n                    this.$message.$error(response.data.message)\r\n                  }\r\n                })\r\n            })\r\n            .catch(() => {})\r\n\r\n          break\r\n        case 'formRight':\r\n          this.formAuth(params.row.formKey)\r\n          break\r\n        case 'mobileForm':\r\n          this.$confirm('是否确定生成手机表单?', '提示', {\r\n            confirmButtonText: '确定',\r\n            cancelButtonText: '取消',\r\n            type: 'warning',\r\n          })\r\n            .then(() => {\r\n              this.createMobileForm(params.row)\r\n            })\r\n            .catch(() => {})\r\n\r\n          break\r\n        case 'copy':\r\n          this.saveCopy()\r\n          break\r\n        default:\r\n          break\r\n      }\r\n    },\r\n    saveCopy() {\r\n      this.newForm.id = this.formRow.id\r\n      this.dialogSaveCopyVisible = true\r\n    },\r\n    handleCloseSaveCopy() {\r\n      this.newForm = {id: '', name: '', formKey: '', typeId: '', typeName: ''}\r\n      this.dialogSaveCopyVisible = false\r\n      this.$refs.htTable.load()\r\n    },\r\n    afterSaveData() {\r\n      this.handleCloseSaveCopy()\r\n    },\r\n    handleClose() {\r\n      this.dialogVisible = false\r\n    },\r\n    openAddDailog() {\r\n      this.$refs.eipBoDialog.showDialog([], 'mobile')\r\n      // this.dialogVisible = true;\r\n      this.$set(this.bpmForm, 'formKey', '')\r\n      this.$set(this.bpmForm, 'bos', '')\r\n      this.$set(this.bpmForm, 'desc', '')\r\n      this.$set(this.bpmForm, 'formName', '')\r\n      this.$set(this.bpmForm, 'name', '')\r\n      if (this.bpmForm.typeName) {\r\n        this.$set(this.bpmForm, 'typeName', this.bpmForm.typeName)\r\n      } else {\r\n        this.$set(this.bpmForm, 'typeName', '')\r\n      }\r\n      this.$set(this.bpmForm, 'typeId', '')\r\n      this.$set(this.bpmForm, 'id', '')\r\n      this.$set(this.bpmForm, 'defId', '')\r\n      this.$set(this.bpmForm, 'rev', 1)\r\n    },\r\n    handleCloseFormEditor() {\r\n      this.formEditorDialogVisible = false\r\n      this.$refs.htTable.load()\r\n    },\r\n    toFormDesigner() {\r\n      this.$validator.validateAll('addBpmForm').then((result) => {\r\n        if (result) {\r\n          this.bpmForm.formType = 'mobile'\r\n          this.bpmForm.name = this.bpmForm.formName\r\n          this.formId = ''\r\n          this.formDefId = ''\r\n          this.formEditorDialogVisible = true\r\n          this.handleClose()\r\n        } else {\r\n          this.$message.error('表单未正确填写')\r\n        }\r\n      })\r\n    },\r\n  },\r\n}\r\n",null]}