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/role/authUser.vue | 35 ++++++++++-------------------------
1 files changed, 10 insertions(+), 25 deletions(-)
diff --git a/ruoyi-ui/src/views/system/role/authUser.vue b/ruoyi-ui/src/views/system/role/authUser.vue
index 51edd33..9704963 100644
--- a/ruoyi-ui/src/views/system/role/authUser.vue
+++ b/ruoyi-ui/src/views/system/role/authUser.vue
@@ -1,12 +1,11 @@
<template>
<div class="app-container">
- <el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
- size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
@@ -16,7 +15,6 @@
v-model="queryParams.phonenumber"
placeholder="请输入手机号码"
clearable
- size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
@@ -69,7 +67,7 @@
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
- <dict-tag :options="statusOptions" :value="scope.row.status"/>
+ <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
@@ -107,6 +105,7 @@
export default {
name: "AuthUser",
+ dicts: ['sys_normal_disable'],
components: { selectUser },
data() {
return {
@@ -122,13 +121,10 @@
total: 0,
// 用户表格数据
userList: [],
- // 状态数据字典
- statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
- reasonable: true,
roleId: undefined,
userName: undefined,
phonenumber: undefined
@@ -140,9 +136,6 @@
if (roleId) {
this.queryParams.roleId = roleId;
this.getList();
- this.getDicts("sys_normal_disable").then(response => {
- this.statusOptions = response.data;
- });
}
},
methods: {
@@ -158,8 +151,8 @@
},
// 返回按钮
handleClose() {
- this.$store.dispatch("tagsView/delView", this.$route);
- this.$router.push({ path: "/system/role" });
+ const obj = { path: "/system/role" };
+ this.$tab.closeOpenPage(obj);
},
/** 搜索按钮操作 */
handleQuery() {
@@ -183,30 +176,22 @@
/** 取消授权按钮操作 */
cancelAuthUser(row) {
const roleId = this.queryParams.roleId;
- this.$confirm('确认要取消该用户"' + row.userName + '"角色吗?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
+ this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function() {
return authUserCancel({ userId: row.userId, roleId: roleId });
}).then(() => {
this.getList();
- this.msgSuccess("取消授权成功");
+ this.$modal.msgSuccess("取消授权成功");
}).catch(() => {});
},
/** 批量取消授权按钮操作 */
cancelAuthUserAll(row) {
const roleId = this.queryParams.roleId;
const userIds = this.userIds.join(",");
- this.$confirm('是否取消选中用户授权数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- return authUserCancelAll({ roleId: roleId, userIds: userIds });
+ this.$modal.confirm('是否取消选中用户授权数据项?').then(function() {
+ return authUserCancelAll({ roleId: roleId, userIds: userIds });
}).then(() => {
this.getList();
- this.msgSuccess("取消授权成功");
+ this.$modal.msgSuccess("取消授权成功");
}).catch(() => {});
}
}
--
Gitblit v1.9.2