From 3cd886785bb545e4e2c68a8517101e13b319a3c6 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Tue, 05 Jan 2021 20:33:41 +0800
Subject: [PATCH] 图片组件添加预览功能
---
ruoyi-ui/src/views/system/user/index.vue | 43 ++++++++++++++++++++-----------------------
1 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue
index 51c2627..5399b34 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,12 +128,14 @@
<el-col :span="1.5">
<el-button
type="warning"
+ plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:user:export']"
>导出</el-button>
</el-col>
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
@@ -157,7 +163,7 @@
<el-table-column
label="操作"
align="center"
- width="180"
+ width="160"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
@@ -208,7 +214,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>
@@ -356,6 +362,8 @@
single: true,
// 非多个禁用
multiple: true,
+ // 显示搜索条件
+ showSearch: true,
// 总条数
total: 0,
// 用户表格数据
@@ -418,14 +426,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 +437,6 @@
}
],
phonenumber: [
- { required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
@@ -579,9 +582,7 @@
cancelButtonText: "取消"
}).then(({ value }) => {
resetUserPwd(row.userId, value).then(response => {
- if (response.code === 200) {
- this.msgSuccess("修改成功,新密码是:" + value);
- }
+ this.msgSuccess("修改成功,新密码是:" + value);
});
}).catch(() => {});
},
@@ -591,19 +592,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 +618,7 @@
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
- }).catch(function() {});
+ })
},
/** 导出按钮操作 */
handleExport() {
@@ -634,7 +631,7 @@
return exportUser(queryParams);
}).then(response => {
this.download(response.msg);
- }).catch(function() {});
+ })
},
/** 导入按钮操作 */
handleImport() {
--
Gitblit v1.9.2