From 6ef9e5189ac1888b8c4c504d5c5d3f431807ff56 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期六, 15 三月 2025 11:57:40 +0800
Subject: [PATCH] 修改电路试验单位
---
src/components/tool/file-preview.vue | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/components/tool/file-preview.vue b/src/components/tool/file-preview.vue
index d3c4fd5..08d1757 100644
--- a/src/components/tool/file-preview.vue
+++ b/src/components/tool/file-preview.vue
@@ -1,10 +1,10 @@
<template>
<div>
<div v-if="isImage">
- <img :src="fileUrl" alt="Image Preview" />
+ <img :src="imgUrl" 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>
@@ -95,11 +95,17 @@
transformData: (workbookData) => {return workbookData}, //灏嗚幏鍙栧埌鐨別xcel鏁版嵁杩涜澶勭悊涔嬪悗涓旀覆鏌撳埌椤甸潰涔嬪墠锛屽彲閫氳繃transformData瀵瑰嵆灏嗘覆鏌撶殑鏁版嵁鍙婃牱寮忚繘琛屼慨鏀癸紝姝ゆ椂姣忎釜鍗曞厓鏍肩殑text鍊煎氨鏄嵆灏嗘覆鏌撳埌椤甸潰涓婄殑鍐呭
},
csvList:[],//csv鏂囦欢鏁版嵁
+ imgUrl:''
}
},
computed: {
isImage() {
- return /\.(jpg|jpeg|png|gif)$/i.test(this.fileUrl);
+ let state = /\.(jpg|jpeg|png|gif)$/i.test(this.fileUrl)
+ this.imgUrl = this.fileUrl
+ if(state){
+ this.imgUrl = this.fileUrl.replaceAll('word', 'img')
+ }
+ return state;
},
isPdf() {
return /\.pdf$/i.test(this.fileUrl);
@@ -155,6 +161,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,
@@ -213,7 +220,7 @@
element.setAttribute('style', style.replace(/pt/g, 'px'));
}
}
- }
+ },
}
}
</script>
--
Gitblit v1.9.3