{"remainingRequest":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5inweb-5.x-vue/src/components/o_file_kms.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/src/components/o_file_kms.vue","mtime":1739760944320},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/babel.config.js","mtime":1739760943855},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport Constant from \"@/Constant.js\";\nimport form_operation from \"@/components/form_operation_log\";\nimport controlHidden from \"@/assets/js/controlHidden.js\";\nexport default {\n name: \"o-file-kms\",\n props: [\"id\"],\n components: {\n form_operation: form_operation\n },\n computed: {\n field: function field() {\n var formData = this.$parent.findField(this.id);\n if (formData.displayType == 5 || formData.displayType == 3) {\n formData.printHiddenValue = formData.printHiddenValue ? formData.printHiddenValue.replace(/ /g, \"\") : \"\";\n }\n return this.$parent.findField(this.id);\n }\n },\n mounted: function mounted() {\n var _this = this;\n this.$nextTick(function () {\n var field = _this.field;\n if (field.isHideType) {\n var id = _this.id,\n formShowType = field.formShowType;\n controlHidden({\n id: id,\n field: field,\n formShowType: formShowType\n });\n }\n });\n },\n data: function data() {\n return {\n dialogVisible: false,\n Constant: Constant,\n isActive: false,\n errorMessage: \"\",\n searchValue: \"\",\n tableData: [],\n selectData: [],\n selectFileData: [],\n showLogsDialog: false,\n showLogsIcon: true,\n operationData: \"\"\n };\n },\n methods: {\n confirm: function confirm(item, index) {\n var name = item.name;\n // name = name.replace(/^(\\s|.)+|(\\s|.)+$/g, \"\");\n this.selectFileData[index].fileName = name + \".\" + item.suffix;\n this.selectFileData[index].isEdit = false;\n this.$forceUpdate();\n },\n cancel: function cancel(index) {\n this.selectFileData[index].isEdit = false;\n this.$forceUpdate();\n },\n editFileName: function editFileName(item, index) {\n this.selectFileData[index].isEdit = true;\n this.$forceUpdate();\n },\n handlePreview: function handlePreview(file) {\n var _this2 = this;\n this.$api.getenvironment({\n onSucess: function onSucess(res) {\n if (res.data.errcode === 0) {\n if (res.data.data === true) {\n var realName = file.filePath.split(\"/\")[file.filePath.split(\"/\").length - 1];\n var kmsPath = \"/uploads/kms/\" + file.filePath;\n _this2.$api.getHasPdfFile(kmsPath, realName, {\n onSucess: function onSucess(resp) {\n if (res.data.data === true) {\n var isEdit = _this2.field.previewEdit ? \"edit\" : \"\";\n var waterMark = _this2.field.watermark ? encodeURI(_this2.field.watermark) : undefined;\n var openWaterMark = _this2.field.openWaterMark;\n var curEditUserId = file.curEditUserId;\n var userName = _this2.$store.state.myProfile.name;\n var showTrackRevisions = _this2.field.showTrackRevisions;\n var selectEditPlug = _this2.field.selectEditPlug;\n var cp = obpmConfig.obpmFilePath;\n sessionStorage.setItem(\"obpmContextPath\", cp);\n var statiContextPath = obpmConfig.statiContextPath;\n var pdfPath = \"\";\n if (statiContextPath) {\n //5.0 trunk\n pdfPath = obpmConfig.statiContextPath;\n } else {\n //4.4 stable\n pdfPath = cp;\n }\n var url = pdfPath + \"/portal/vue/pdf/pdfviewer.html?action=\" + isEdit + \"&path=/uploads/kms/\" + file.filePath + \"&name=\" + realName + \"&showName=\" + file.fileName + \"&waterMark=\" + waterMark + \"&openWaterMark=\" + openWaterMark + \"&curEditUserId=\" + curEditUserId + \"&userName=\" + userName + \"&showTrackRevisions=\" + showTrackRevisions + \"&selectEditPlug=\" + selectEditPlug;\n window.open(url);\n }\n }\n });\n }\n }\n }\n });\n },\n hiddenLogsDialog: function hiddenLogsDialog() {\n this.showLogsIcon = false;\n this.showLogsDialog = false;\n },\n enter: function enter() {\n if (this.field.isModified) {\n this.showLogsIcon = true;\n }\n },\n getOperationLogs: function getOperationLogs() {\n var obj = {};\n obj.fieldName = this.field.name;\n this.operationData = obj;\n this.showLogsDialog = true;\n },\n downloadFile: function downloadFile(item) {\n var _this3 = this;\n var name = item.fileName;\n var path = \"/uploads/kms/\" + item.filePath;\n this.$api.templateDownload(name, path, {\n onSucess: function onSucess(response) {\n var fileName = \"\";\n var type = response.headers[\"content-type\"];\n if (response.headers[\"content-disposition\"]) {\n //fileName = decodeURIComponent(response.headers['content-disposition'].split(\"=\")[1]);\n fileName = name;\n } else {\n fileName = _this3.$t(\"report.download\");\n }\n _this3.download(response, type, fileName);\n }\n });\n },\n download: function download(res, type, filename) {\n var blob = new Blob([res.data], {\n // 如果后端没返回下载文件类型,则需要手动设置:type: 'application/pdf;chartset=UTF-8' 表示下载文档为pdf,如果是word则设置为msword,excel为excel\n type: type\n });\n var a = document.createElement(\"a\");\n var herf = window.URL.createObjectURL(blob);\n // 下载链接\n a.href = herf;\n // 下载文件名,如果后端没有返回,可以自己写a.download = '文件.pdf'\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n window.URL.revokeObjectURL(herf);\n },\n deleteFile: function deleteFile(item, index) {\n var _this4 = this;\n var field = this.field;\n this.$confirm(this.$t(\"view.goon\"), this.$t(\"tip\"), {\n confirmButtonText: this.$t(\"msg.confirm\"),\n cancelButtonText: this.$t(\"btns.cancel\"),\n type: \"warning\"\n }).then(function () {\n _this4.$api.deleteKmsFile(_this4.$root.appid, field.formId, field.docId, item.filePath, {\n onSucess: function onSucess(res) {\n if (res.data.errcode == 0) {\n _this4.selectFileData.splice(index, 1);\n _this4.$notify({\n title: \"\",\n message: res.data.data,\n type: \"success\"\n });\n }\n }\n });\n }).catch(function () {});\n },\n onOk: function onOk() {\n var list = JSON.parse(JSON.stringify(this.selectData));\n list.forEach(function (el) {\n var a1 = el.fileName.split(\".\");\n el.isEdit = false;\n el.suffix = a1[a1.length - 1];\n a1.length = a1.length - 1;\n if (a1.length > 1) {\n el.name = a1.join(\".\");\n } else {\n el.name = a1[0];\n }\n });\n this.selectFileData = list;\n this.dialogVisible = false;\n this.$refs.multipleTable.clearSelection();\n },\n handleSelectionChange: function handleSelectionChange(val) {\n this.selectData = val;\n },\n openKmDialog: function openKmDialog() {\n var _this5 = this;\n this.dialogVisible = true;\n //fileName=&orderByfield=CREATE_DATE&orderMode=desc&pageNo=1&linesPerPage=10&_=1594349604925\n var params = {\n fileName: this.searchValue,\n orderByfield: \"CREATE_DATE\",\n orderMode: \"desc\",\n pageNo: 1,\n linesPerPage: 10,\n _: new Date().getTime()\n };\n this.$api.getKmsFiles(params, {\n onSucess: function onSucess(res) {\n var newData = res.data.data.datas.map(function (item) {\n return {\n fileName: item.name,\n createDate: item.createDate,\n filePath: item.url,\n curEditUserId: item.creatorId\n };\n });\n _this5.tableData = newData;\n }\n });\n },\n onChange: function onChange() {\n if (this.field.refreshOnChanged) {\n this.$parent.refresh(this.id);\n }\n }\n }\n};",null]}