From 61034d4ddecd0b3056a7fb38a737b0e0cfc33b9c Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期日, 27 三月 2022 14:36:31 +0800
Subject: [PATCH] 优化导出excel单元格验证,包含变更为开头.防止正常内容被替换
---
ruoyi-ui/src/views/system/post/index.vue | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue
index e206968..444bf63 100644
--- a/ruoyi-ui/src/views/system/post/index.vue
+++ b/ruoyi-ui/src/views/system/post/index.vue
@@ -1,12 +1,11 @@
<template>
<div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="岗位编码" prop="postCode">
<el-input
v-model="queryParams.postCode"
placeholder="请输入岗位编码"
clearable
- size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@@ -15,12 +14,11 @@
v-model="queryParams.postName"
placeholder="请输入岗位名称"
clearable
- size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
- <el-select v-model="queryParams.status" placeholder="岗位状态" clearable size="small">
+ <el-select v-model="queryParams.status" placeholder="岗位状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
@@ -74,7 +72,6 @@
plain
icon="el-icon-download"
size="mini"
- :loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:post:export']"
>导出</el-button>
@@ -160,7 +157,7 @@
</template>
<script>
-import { listPost, getPost, delPost, addPost, updatePost, exportPost } from "@/api/system/post";
+import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
export default {
name: "Post",
@@ -169,8 +166,6 @@
return {
// 遮罩层
loading: true,
- // 导出遮罩层
- exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
@@ -305,14 +300,9 @@
},
/** 导出按钮操作 */
handleExport() {
- const queryParams = this.queryParams;
- this.$modal.confirm('是否确认导出所有岗位数据项?').then(() => {
- this.exportLoading = true;
- return exportPost(queryParams);
- }).then(response => {
- this.$download.name(response.msg);
- this.exportLoading = false;
- }).catch(() => {});
+ this.download('system/post/export', {
+ ...this.queryParams
+ }, `post_${new Date().getTime()}.xlsx`)
}
}
};
--
Gitblit v1.9.2