From 63ba32711e04a6c0ccb2263e1b879f2380327121 Mon Sep 17 00:00:00 2001 From: zch Date: Fri, 6 Jun 2025 10:08:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(os-common):=20=E4=BC=98=E5=8C=96=20Excel?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改前端导入的权限,不下载模板,不更新原有数据 - 后端更新common,从ruoyi的gitee复制的 - 添加单元格样式封装,支持自定义样式 - 增加字典值和标签的互转方法 - 优化图片数据处理,支持多图片导出 - 改进下拉列表和提示信息的设置 - 修复导入导出的一些小问题 --- src/plugins/download.js | 11 ++ src/views/ems/info/dailyFaultRecord/index.vue | 10 +- .../ems/info/faultHandlingRecord/index.vue | 10 +- .../info/plcBufferBatteryLifecycle/index.vue | 10 +- .../securityDoorBatteryLifecycle/index.vue | 10 +- .../ems/info/sparePartsInventory/index.vue | 10 +- .../info/sparePartsInventoryCheck/index.vue | 10 +- .../ems/info/sparePartsRegistration/index.vue | 10 +- .../ems/info/sparePartsUsageRecord/index.vue | 118 +++++++++--------- .../ems/info/supervisionChecklist/index.vue | 10 +- .../ems/info/upsBatteryLifecycle/index.vue | 2 +- 11 files changed, 111 insertions(+), 100 deletions(-) diff --git a/src/plugins/download.js b/src/plugins/download.js index 42acd00..4f00b28 100644 --- a/src/plugins/download.js +++ b/src/plugins/download.js @@ -66,6 +66,17 @@ export default { downloadLoadingInstance.close(); }) }, + // excel(data, name) { + // const isBlob = blobValidate(data); + // if (isBlob) { + // const blob = new Blob([data], { + // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' + // }) + // this.saveAs(blob, name) + // } else { + // this.printErrMsg(data); + // } + // }, saveAs(text, name, opts) { saveAs(text, name, opts); }, diff --git a/src/views/ems/info/dailyFaultRecord/index.vue b/src/views/ems/info/dailyFaultRecord/index.vue index cd19af8..9ffbd4d 100644 --- a/src/views/ems/info/dailyFaultRecord/index.vue +++ b/src/views/ems/info/dailyFaultRecord/index.vue @@ -139,7 +139,7 @@ icon="el-icon-upload2" size="mini" @click="handleImport" - v-hasPermi="['ems/info:dailyFaultRecord:import']" + v-hasPermi="['ems/info:dailyFaultRecord:add']" >导入 @@ -259,11 +259,11 @@
将文件拖到此处,或点击上传
-
- 是否更新已经存在的数据 -
+ + + 仅允许导入xls、xlsx格式文件。 - 下载模板 +