From c70e37453d06f8eb6eddeddb3085548541cd34b5 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 26 十二月 2024 14:33:10 +0800 Subject: [PATCH] 修改人员 --- src/components/tool/file-preview.vue | 31 ++----------------------------- 1 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/components/tool/file-preview.vue b/src/components/tool/file-preview.vue index 38ea63e..a0123c0 100644 --- a/src/components/tool/file-preview.vue +++ b/src/components/tool/file-preview.vue @@ -4,7 +4,7 @@ <img :src="fileUrl" alt="Image Preview" /> </div> <div v-if="isPdf"> - <object :data="fileUrl" type="application/pdf" width="100%" height="600px"> + <object :data="fileUrl" type="application/pdf" width="100%" height="750px"> <p>鎮ㄧ殑娴忚鍣ㄤ笉鏀寔 PDF 棰勮銆�<a :href="fileUrl">涓嬭浇 PDF 鏂囦欢</a></p> </object> </div> @@ -67,7 +67,6 @@ import VueOfficeExcel from '@vue-office/excel' //寮曞叆鐩稿叧鏍峰紡 import '@vue-office/excel/lib/index.css' -import * as XLSX from "xlsx"; export default { components: { VueOfficeDocx, @@ -156,6 +155,7 @@ column:[] } obj.tableData = this.formatCSVToTable(m.content.replaceAll('null',' ')) + // .replaceAll('MIN','=MIN').replaceAll('MAX','=MAX').replaceAll('AVERAGE','=AVERAGE') for (let item in obj.tableData[0]) { obj.column.push({ label: item, @@ -165,11 +165,6 @@ return obj }) this.csvList = arr - // console.log(333,this.csvList) - this.csvList.forEach(m=>{ - console.log(this.calculateFormulas(m.column,m.tableData)) - m.tableData = this.calculateFormulas(m.column,m.tableData) - }) }).catch( err => { console.log(err) }) @@ -210,28 +205,6 @@ } } return result - }, - /** - * 璁$畻琛ㄦ牸鍏紡 - * - * @param tableHeaders 琛ㄥご鏁版嵁 - * @param tableData 琛ㄦ牸鏁版嵁 - */ - calculateFormulas(tableHeaders,tableData){ - // 鐢熸垚 Excel Sheet 鏍煎紡 - const sheetData = [tableHeaders.map(m=>m.label), ...tableData.map((row) => Object.values(row))]; - const worksheet = XLSX.utils.aoa_to_sheet(sheetData); - // 璁$畻鍏紡 - XLSX.utils.sheet_add_aoa(worksheet, [], { origin: -1 }); - const newSheetData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }); - // 鏇存柊琛ㄥご鍜岃〃鏍兼暟鎹� - tableData = newSheetData.slice(1).map((row) => - row.reduce((obj, value, index) => { - obj[newSheetData[0][index]] = value; - return obj; - }, {}) - ); - return tableData }, resetStyle(){ const elements = document.querySelectorAll('[style*="pt"]'); -- Gitblit v1.9.3