{"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\\views\\form\\FormPrintTemplateManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\form\\FormPrintTemplateManager.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":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/defineProperty\";\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//\n//\n//\n//\n//\n//\n//\nimport { mapState } from \"vuex\";\nimport { Loading } from \"element-ui\";\nimport utils from \"@/hotent-ui-util.js\";\nimport req from \"@/request.js\";\nimport form from \"@/api/form.js\";\n\nvar EipSysTypeSelector = function EipSysTypeSelector() {\n return import(\"@/components/selector/EipSysTypeSelector.vue\");\n};\n\nvar FormDesigner = function FormDesigner() {\n return import(\"@/components/form/FormDesigner.vue\");\n};\n\nexport default {\n name: \"FormPrintTemlateManager\",\n props: {\n formKey: {\n type: String,\n required: true\n },\n visible: {\n type: Boolean\n },\n formRow: {\n type: Object\n }\n },\n components: {\n EipSysTypeSelector: EipSysTypeSelector,\n FormDesigner: FormDesigner\n },\n data: function data() {\n return {\n selecRow: {},\n scriptStr: \"\",\n scriptStrDialog: false,\n dialogSaveCopyVisible: false,\n formEditorDialogVisible: false,\n formId: null,\n formDefId: null,\n bpmForm: {\n formKey: \"\",\n bos: \"\",\n desc: \"\"\n },\n newForm: {\n id: \"\",\n name: \"\",\n formKey: \"\",\n typeId: \"\",\n typeName: \"\"\n },\n oldForm: {},\n data: [],\n pageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n cmOptions2: {\n value: \"\",\n mode: \"groovy\",\n readOnly: false,\n smartIndent: true,\n tabSize: 1,\n theme: 'base16-light',\n lineNumbers: true,\n line: true\n }\n };\n },\n computed: _objectSpread({}, mapState({\n currentUser: function currentUser(state) {\n return state.login.currentUser;\n },\n header: function header(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n },\n actionUrl: function actionUrl() {\n return \"\".concat(window.context.portal, \"/file/v1/upload\");\n },\n formDeleteUrl: function formDeleteUrl() {\n return \"\".concat(window.context.form, \"/form/printTemplate/v1/removes\");\n }\n })),\n mounted: function mounted() {\n this.$validator = this.$root.$validator;\n this.$root.$emit(\"resize\");\n this.oldForm = this.formRow;\n },\n methods: {\n updateScriptStr: function updateScriptStr() {\n var _this = this;\n\n this.selecRow.scriptStr = this.scriptStr;\n req.request({\n \"url\": \"${form}/form/printTemplate/v1/\",\n \"data\": this.selecRow,\n \"method\": \"PUT\"\n }).then(function (res) {\n if (res.data.state) {\n _this.$message({\n message: '保存成功',\n type: 'success'\n });\n } else {\n _this.$message.error('保存失败');\n }\n\n _this.scriptStrDialog = false;\n });\n },\n downloadTemplate: function downloadTemplate() {\n window.location.href = window.context.manage + '/static/docx/打印设置模板.docx';\n },\n handleCommand: function handleCommand(params) {\n var _this2 = this;\n\n switch (params.command) {\n case \"setMainVersion\":\n var url = \"${form}/form/printTemplate/v1/setDefaultVersion?id=\" + params.row.id + \"&formKey=\" + params.row.formKey + \"&printType=\" + params.row.printType;\n req.get(url).then(function (res) {\n _this2.$message({\n type: \"success\",\n message: res.data.message\n });\n\n _this2.$refs.htTable.load();\n });\n break;\n\n case \"download\":\n if (params.row.printType == \"word\") {\n req.download(\"${portal}/file/v1/downloadFile?fileId=\" + params.row.fileId);\n } else if (params.row.printType == \"form\") {\n //编辑表单\n this.bpmForm.bos = [];\n this.formId = params.row.formId;\n this.formDefId = params.row.defId;\n this.formEditorDialogVisible = true;\n }\n\n break;\n\n case \"setScriptStr\":\n this.selecRow = params.row;\n this.scriptStr = params.row.scriptStr;\n this.scriptStrDialog = true;\n break;\n\n default:\n break;\n }\n },\n progress: function progress() {\n Loading.service(\"文件上传中\");\n },\n setParamIsMain: function setParamIsMain(param) {\n var files = this.$refs.printTemplateFile.uploadFiles;\n\n if (files && files.length > 0) {\n if (files[0].name != param.fileName) {\n param['isMain'] = '';\n }\n\n var successSize = 0;\n files.forEach(function (f) {\n if (f.status == 'success') {\n ++successSize;\n }\n });\n\n if (successSize == files.length) {\n this.$refs.printTemplateFile.clearFiles();\n }\n }\n },\n success: function success(response) {\n var _this3 = this;\n\n var loadingInstance = Loading.service(\"文件上传中\");\n\n if (response.success) {\n var param = {\n fileId: response.fileId,\n fileName: response.fileName,\n formKey: this.formKey,\n printType: \"word\"\n };\n this.setParamIsMain(param);\n req.post(\"${form}/form/printTemplate/v1/save\", param).then(function (response) {\n _this3.$message({\n type: \"success\",\n message: \"上传模板成功\"\n });\n\n var param = {\n sorter: [{\n direction: \"DESC\",\n property: \"createTime\"\n }],\n querys: [{\n group: \"defaultQueryGroup\",\n operation: \"EQUAL\",\n relation: \"AND\",\n property: \"formKey\",\n value: _this3.formKey\n }]\n };\n\n _this3.$refs.htTable.load();\n });\n } else {\n this.$message({\n type: \"error\",\n message: \"模板上传失败\"\n });\n }\n\n this.$nextTick(function () {\n // 以服务的方式调用的 Loading 需要异步关闭\n loadingInstance.close();\n });\n },\n beforeAvatarUpload: function beforeAvatarUpload(file) {\n var FileExt = file.name.replace(/.+\\./, \"\");\n\n if (\"docx\" != FileExt.toLowerCase()) {\n this.$message({\n type: \"warning\",\n message: \"请上传后缀名为docx的文档\"\n });\n return false;\n }\n },\n close: function close() {\n this.$emit(\"update:visible\", false);\n },\n loadData: function loadData(param, cb) {\n var _this4 = this;\n\n req.post(\"${form}/form/printTemplate/v1/getPrintList\", param).then(function (response) {\n _this4.data = response.data.rows;\n _this4.pageResult = {\n page: response.data.page,\n pageSize: response.data.pageSize,\n total: response.data.total\n };\n }).finally(function () {\n return cb();\n });\n },\n handleClose: function handleClose() {\n this.dialogVisible = false;\n },\n //添加表单模板\n addFormTemplate: function addFormTemplate() {\n this.newForm.id = this.oldForm.id;\n this.dialogSaveCopyVisible = true;\n },\n handleCloseSaveCopy: function handleCloseSaveCopy() {\n this.newForm = {\n id: \"\",\n name: \"\",\n formKey: \"\",\n typeId: \"\",\n typeName: \"\"\n };\n this.dialogSaveCopyVisible = false;\n },\n save: function save() {\n var _this5 = this;\n\n utils.validateForm(this, \"saveCopyForm\").then(function () {\n form.savePrintTemplate(_this5.newForm).then(function (resp) {\n if (resp.state) {\n _this5.dialogSaveCopyVisible = false;\n\n _this5.handleCloseSaveCopy();\n\n _this5.$refs.htTable.load();\n }\n });\n }).catch(function (reason) {\n var rules = reason.map(function (obj) {\n return obj.rule;\n });\n\n if (rules.includes(\"isExist\")) {\n _this5.$message.error(\"已存在同名模板\");\n }\n\n if (rules.includes(\"regex\")) {\n _this5.$message.error(\"只能输入字母、数字、下划线,且以字母开头\");\n }\n });\n },\n handleCloseFormEditor: function handleCloseFormEditor() {\n this.formEditorDialogVisible = false;\n this.$refs.htTable.load();\n }\n }\n};",null]}