{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\components\\docx\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\components\\docx\\index.vue","mtime":1717058010133},{"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\r\nimport apiList from '@/api/bigScreen/districView.js'\r\nimport { getLocalBLob } from '@/utils/getLocalFile.js'\r\nconst docx = require('docx-preview')\r\nwindow.JSZip = require('jszip')\r\nexport default {\r\n name: 'Docx',\r\n props: {\r\n fileUrl: {\r\n default: '',\r\n type: String,\r\n required: true,\r\n },\r\n fileId: {\r\n default: '',\r\n type: String,\r\n required: true,\r\n },\r\n },\r\n data() {\r\n return {\r\n noFile: false,\r\n text: '',\r\n }\r\n },\r\n mounted() {\r\n this.initDocx()\r\n },\r\n watch: {\r\n fileUrl(newVal, oldVal) {\r\n this.initDocx()\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 console.log(bLob, 'bLob')\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 this.$emit('closeLoading')\r\n },\r\n },\r\n}\r\n",null]}