From b7446f8d0ffd282d7f22d775e896d066219856a4 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期四, 03 六月 2021 13:26:09 +0800
Subject: [PATCH] 富文本工具栏配置视频
---
ruoyi-ui/src/views/system/user/index.vue | 74 +++++++++++++++++++++---------------
1 files changed, 43 insertions(+), 31 deletions(-)
diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue
index 51c2627..471a66c 100644
--- a/ruoyi-ui/src/views/system/user/index.vue
+++ b/ruoyi-ui/src/views/system/user/index.vue
@@ -27,7 +27,7 @@
</el-col>
<!--鐢ㄦ埛鏁版嵁-->
<el-col :span="20" :xs="24">
- <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="鐢ㄦ埛鍚嶇О" prop="userName">
<el-input
v-model="queryParams.userName"
@@ -86,6 +86,7 @@
<el-col :span="1.5">
<el-button
type="primary"
+ plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@@ -95,6 +96,7 @@
<el-col :span="1.5">
<el-button
type="success"
+ plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@@ -105,6 +107,7 @@
<el-col :span="1.5">
<el-button
type="danger"
+ plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@@ -115,6 +118,7 @@
<el-col :span="1.5">
<el-button
type="info"
+ plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
@@ -124,22 +128,25 @@
<el-col :span="1.5">
<el-button
type="warning"
+ plain
icon="el-icon-download"
size="mini"
+ :loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:user:export']"
>瀵煎嚭</el-button>
</el-col>
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
- <el-table-column label="鐢ㄦ埛缂栧彿" align="center" prop="userId" />
- <el-table-column label="鐢ㄦ埛鍚嶇О" align="center" prop="userName" :show-overflow-tooltip="true" />
- <el-table-column label="鐢ㄦ埛鏄电О" align="center" prop="nickName" :show-overflow-tooltip="true" />
- <el-table-column label="閮ㄩ棬" align="center" prop="dept.deptName" :show-overflow-tooltip="true" />
- <el-table-column label="鎵嬫満鍙风爜" align="center" prop="phonenumber" width="120" />
- <el-table-column label="鐘舵��" align="center">
+ <el-table-column label="鐢ㄦ埛缂栧彿" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
+ <el-table-column label="鐢ㄦ埛鍚嶇О" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
+ <el-table-column label="鐢ㄦ埛鏄电О" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
+ <el-table-column label="閮ㄩ棬" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
+ <el-table-column label="鎵嬫満鍙风爜" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
+ <el-table-column label="鐘舵��" align="center" key="status" v-if="columns[5].visible">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
@@ -149,7 +156,7 @@
></el-switch>
</template>
</el-table-column>
- <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="160">
+ <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" v-if="columns[6].visible" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
@@ -157,7 +164,7 @@
<el-table-column
label="鎿嶄綔"
align="center"
- width="180"
+ width="160"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
@@ -208,7 +215,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="褰掑睘閮ㄩ棬" prop="deptId">
- <treeselect v-model="form.deptId" :options="deptOptions" :disable-branch-nodes="true" :show-count="true" placeholder="璇烽�夋嫨褰掑睘閮ㄩ棬" />
+ <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="璇烽�夋嫨褰掑睘閮ㄩ棬" />
</el-form-item>
</el-col>
</el-row>
@@ -350,12 +357,16 @@
return {
// 閬僵灞�
loading: true,
+ // 瀵煎嚭閬僵灞�
+ exportLoading: false,
// 閫変腑鏁扮粍
ids: [],
// 闈炲崟涓鐢�
single: true,
// 闈炲涓鐢�
multiple: true,
+ // 鏄剧ず鎼滅储鏉′欢
+ showSearch: true,
// 鎬绘潯鏁�
total: 0,
// 鐢ㄦ埛琛ㄦ牸鏁版嵁
@@ -410,6 +421,16 @@
status: undefined,
deptId: undefined
},
+ // 鍒椾俊鎭�
+ columns: [
+ { key: 0, label: `鐢ㄦ埛缂栧彿`, visible: true },
+ { key: 1, label: `鐢ㄦ埛鍚嶇О`, visible: true },
+ { key: 2, label: `鐢ㄦ埛鏄电О`, visible: true },
+ { key: 3, label: `閮ㄩ棬`, visible: true },
+ { key: 4, label: `鎵嬫満鍙风爜`, visible: true },
+ { key: 5, label: `鐘舵�乣, visible: true },
+ { key: 6, label: `鍒涘缓鏃堕棿`, visible: true }
+ ],
// 琛ㄥ崟鏍¢獙
rules: {
userName: [
@@ -418,14 +439,10 @@
nickName: [
{ required: true, message: "鐢ㄦ埛鏄电О涓嶈兘涓虹┖", trigger: "blur" }
],
- deptId: [
- { required: true, message: "褰掑睘閮ㄩ棬涓嶈兘涓虹┖", trigger: "blur" }
- ],
password: [
{ required: true, message: "鐢ㄦ埛瀵嗙爜涓嶈兘涓虹┖", trigger: "blur" }
],
email: [
- { required: true, message: "閭鍦板潃涓嶈兘涓虹┖", trigger: "blur" },
{
type: "email",
message: "'璇疯緭鍏ユ纭殑閭鍦板潃",
@@ -433,7 +450,6 @@
}
],
phonenumber: [
- { required: true, message: "鎵嬫満鍙风爜涓嶈兘涓虹┖", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "璇疯緭鍏ユ纭殑鎵嬫満鍙风爜",
@@ -579,9 +595,7 @@
cancelButtonText: "鍙栨秷"
}).then(({ value }) => {
resetUserPwd(row.userId, value).then(response => {
- if (response.code === 200) {
- this.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value);
- }
+ this.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value);
});
}).catch(() => {});
},
@@ -591,19 +605,15 @@
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then(response => {
- if (response.code === 200) {
- this.msgSuccess("淇敼鎴愬姛");
- this.open = false;
- this.getList();
- }
+ this.msgSuccess("淇敼鎴愬姛");
+ this.open = false;
+ this.getList();
});
} else {
addUser(this.form).then(response => {
- if (response.code === 200) {
- this.msgSuccess("鏂板鎴愬姛");
- this.open = false;
- this.getList();
- }
+ this.msgSuccess("鏂板鎴愬姛");
+ this.open = false;
+ this.getList();
});
}
}
@@ -621,7 +631,7 @@
}).then(() => {
this.getList();
this.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(function() {});
+ }).catch(() => {});
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
@@ -630,11 +640,13 @@
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
- }).then(function() {
+ }).then(() => {
+ this.exportLoading = true;
return exportUser(queryParams);
}).then(response => {
this.download(response.msg);
- }).catch(function() {});
+ this.exportLoading = false;
+ }).catch(() => {});
},
/** 瀵煎叆鎸夐挳鎿嶄綔 */
handleImport() {
--
Gitblit v1.9.3