{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\BigScreen\\components\\subComponents\\docPreview.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\BigScreen\\components\\subComponents\\docPreview.vue","mtime":1698435711923},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport {getLocalBLob} from '@/utils/getLocalFile.js'\r\nconst docx = require('docx-preview')\r\nwindow.JSZip = require('jszip')\r\nimport Docx from '@/components/docx/index.vue'\r\nimport apiList from '@/api/bigScreen/districView.js'\r\nconst portal = window.context.portal\r\nexport default {\r\n name: 'docPreview',\r\n components: { Docx },\r\n props: {\r\n options: {\r\n type: Object,\r\n default: () => {\r\n return {}\r\n },\r\n },\r\n },\r\n data() {\r\n return {\r\n loading: false,\r\n fileId: '',\r\n noFile: false,\r\n text: '',\r\n }\r\n },\r\n mounted() {\r\n let date = JSON.parse(sessionStorage.getItem('searchDate'))\r\n if (this.options.type === 'satisfaction') {\r\n this.getSatisfaction(date)\r\n }\r\n },\r\n methods: {\r\n async initDocx() {\r\n if (this.fileId) {\r\n this.noFile = false\r\n const bLob = await apiList.previewFile(this.fileId)\r\n docx.renderAsync(bLob, this.$refs.file) // 渲染到页面预览\r\n } else if (this.fileUrl) {\r\n this.noFile = false\r\n const bLob = await getLocalBLob(this.fileUrl)\r\n docx.renderAsync(bLob, this.$refs.file)\r\n this.noFile = false // 渲染到页面预览\r\n } else if (!this.fileUrl && !this.fileId) {\r\n let searchDate = sessionStorage.getItem('searchDate')\r\n searchDate = JSON.parse(searchDate)\r\n this.noFile = true\r\n this.text = `${searchDate.year}年第${searchDate.quarter}季度暂无报告`\r\n }\r\n setTimeout(() => {\r\n this.loading = false\r\n },900)\r\n },\r\n getSatisfaction(data) {\r\n this.loading = true\r\n apiList.getSatisfaction(data, res => {\r\n if (res) {\r\n this.fileId = res.fileList[0].id\r\n this.initDocx()\r\n }\r\n })\r\n },\r\n download() {\r\n window.open(portal + `/file/v1/downloadFile?fileId=${this.fileId}`, '_self')\r\n }\r\n },\r\n}\r\n",null]}