|
@@ -4,77 +4,28 @@ |
|
@@ -4,77 +4,28 @@ |
|
4
|
<!--部门数据-->
|
4
|
<!--部门数据-->
|
|
5
|
<el-col :span="4" :xs="24">
|
5
|
<el-col :span="4" :xs="24">
|
|
6
|
<div class="head-container">
|
6
|
<div class="head-container">
|
|
7
|
- <el-input
|
|
|
|
8
|
- v-model="deptName"
|
|
|
|
9
|
- placeholder="请输入部门名称"
|
|
|
|
10
|
- clearable
|
|
|
|
11
|
- size="small"
|
|
|
|
12
|
- prefix-icon="el-icon-search"
|
|
|
|
13
|
- style="margin-bottom: 20px"
|
|
|
|
14
|
- />
|
7
|
+ <el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
|
|
15
|
</div>
|
8
|
</div>
|
|
16
|
<div class="head-container">
|
9
|
<div class="head-container">
|
|
17
|
- <el-tree
|
|
|
|
18
|
- :data="deptOptions"
|
|
|
|
19
|
- :props="defaultProps"
|
|
|
|
20
|
- :expand-on-click-node="false"
|
|
|
|
21
|
- :filter-node-method="filterNode"
|
|
|
|
22
|
- ref="tree"
|
|
|
|
23
|
- default-expand-all
|
|
|
|
24
|
- @node-click="handleNodeClick"
|
|
|
|
25
|
- />
|
10
|
+ <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree" default-expand-all @node-click="handleNodeClick" />
|
|
26
|
</div>
|
11
|
</div>
|
|
27
|
</el-col>
|
12
|
</el-col>
|
|
28
|
<!--用户数据-->
|
13
|
<!--用户数据-->
|
|
29
|
<el-col :span="20" :xs="24">
|
14
|
<el-col :span="20" :xs="24">
|
|
30
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
15
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
31
|
<el-form-item label="用户名称" prop="userName">
|
16
|
<el-form-item label="用户名称" prop="userName">
|
|
32
|
- <el-input
|
|
|
|
33
|
- v-model="queryParams.userName"
|
|
|
|
34
|
- placeholder="请输入用户名称"
|
|
|
|
35
|
- clearable
|
|
|
|
36
|
- size="small"
|
|
|
|
37
|
- style="width: 240px"
|
|
|
|
38
|
- @keyup.enter.native="handleQuery"
|
|
|
|
39
|
- />
|
17
|
+ <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
|
|
40
|
</el-form-item>
|
18
|
</el-form-item>
|
|
41
|
<el-form-item label="手机号码" prop="phonenumber">
|
19
|
<el-form-item label="手机号码" prop="phonenumber">
|
|
42
|
- <el-input
|
|
|
|
43
|
- v-model="queryParams.phonenumber"
|
|
|
|
44
|
- placeholder="请输入手机号码"
|
|
|
|
45
|
- clearable
|
|
|
|
46
|
- size="small"
|
|
|
|
47
|
- style="width: 240px"
|
|
|
|
48
|
- @keyup.enter.native="handleQuery"
|
|
|
|
49
|
- />
|
20
|
+ <el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
|
|
50
|
</el-form-item>
|
21
|
</el-form-item>
|
|
51
|
<el-form-item label="状态" prop="status">
|
22
|
<el-form-item label="状态" prop="status">
|
|
52
|
- <el-select
|
|
|
|
53
|
- v-model="queryParams.status"
|
|
|
|
54
|
- placeholder="用户状态"
|
|
|
|
55
|
- clearable
|
|
|
|
56
|
- size="small"
|
|
|
|
57
|
- style="width: 240px"
|
|
|
|
58
|
- >
|
|
|
|
59
|
- <el-option
|
|
|
|
60
|
- v-for="dict in statusOptions"
|
|
|
|
61
|
- :key="dict.dictValue"
|
|
|
|
62
|
- :label="dict.dictLabel"
|
|
|
|
63
|
- :value="dict.dictValue"
|
|
|
|
64
|
- />
|
23
|
+ <el-select v-model="queryParams.status" placeholder="用户状态" clearable size="small" style="width: 240px">
|
|
|
|
24
|
+ <el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
|
65
|
</el-select>
|
25
|
</el-select>
|
|
66
|
</el-form-item>
|
26
|
</el-form-item>
|
|
67
|
<el-form-item label="创建时间">
|
27
|
<el-form-item label="创建时间">
|
|
68
|
- <el-date-picker
|
|
|
|
69
|
- v-model="dateRange"
|
|
|
|
70
|
- size="small"
|
|
|
|
71
|
- style="width: 240px"
|
|
|
|
72
|
- value-format="yyyy-MM-dd"
|
|
|
|
73
|
- type="daterange"
|
|
|
|
74
|
- range-separator="-"
|
|
|
|
75
|
- start-placeholder="开始日期"
|
|
|
|
76
|
- end-placeholder="结束日期"
|
|
|
|
77
|
- ></el-date-picker>
|
28
|
+ <el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
78
|
</el-form-item>
|
29
|
</el-form-item>
|
|
79
|
<el-form-item>
|
30
|
<el-form-item>
|
|
80
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
31
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
@@ -84,60 +35,21 @@ |
|
@@ -84,60 +35,21 @@ |
|
84
|
|
35
|
|
|
85
|
<el-row :gutter="10" class="mb8">
|
36
|
<el-row :gutter="10" class="mb8">
|
|
86
|
<el-col :span="1.5">
|
37
|
<el-col :span="1.5">
|
|
87
|
- <el-button
|
|
|
|
88
|
- type="primary"
|
|
|
|
89
|
- icon="el-icon-plus"
|
|
|
|
90
|
- size="mini"
|
|
|
|
91
|
- @click="handleAdd"
|
|
|
|
92
|
- v-hasPermi="['system:user:add']"
|
|
|
|
93
|
- >新增</el-button>
|
38
|
+ <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
|
|
94
|
</el-col>
|
39
|
</el-col>
|
|
95
|
<el-col :span="1.5">
|
40
|
<el-col :span="1.5">
|
|
96
|
- <el-button
|
|
|
|
97
|
- type="success"
|
|
|
|
98
|
- icon="el-icon-edit"
|
|
|
|
99
|
- size="mini"
|
|
|
|
100
|
- :disabled="single"
|
|
|
|
101
|
- @click="handleUpdate"
|
|
|
|
102
|
- v-hasPermi="['system:user:edit']"
|
|
|
|
103
|
- >修改</el-button>
|
41
|
+ <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:user:edit']">修改</el-button>
|
|
104
|
</el-col>
|
42
|
</el-col>
|
|
105
|
<el-col :span="1.5">
|
43
|
<el-col :span="1.5">
|
|
106
|
- <el-button
|
|
|
|
107
|
- type="danger"
|
|
|
|
108
|
- icon="el-icon-delete"
|
|
|
|
109
|
- size="mini"
|
|
|
|
110
|
- :disabled="multiple"
|
|
|
|
111
|
- @click="handleDelete"
|
|
|
|
112
|
- v-hasPermi="['system:user:remove']"
|
|
|
|
113
|
- >删除</el-button>
|
44
|
+ <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:user:remove']">删除</el-button>
|
|
114
|
</el-col>
|
45
|
</el-col>
|
|
115
|
<el-col :span="1.5">
|
46
|
<el-col :span="1.5">
|
|
116
|
- <el-button
|
|
|
|
117
|
- type="info"
|
|
|
|
118
|
- icon="el-icon-upload2"
|
|
|
|
119
|
- size="mini"
|
|
|
|
120
|
- @click="handleImport"
|
|
|
|
121
|
- v-hasPermi="['system:user:import']"
|
|
|
|
122
|
- >导入</el-button>
|
47
|
+ <el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
|
|
123
|
</el-col>
|
48
|
</el-col>
|
|
124
|
<el-col :span="1.5">
|
49
|
<el-col :span="1.5">
|
|
125
|
- <el-button
|
|
|
|
126
|
- type="warning"
|
|
|
|
127
|
- icon="el-icon-download"
|
|
|
|
128
|
- size="mini"
|
|
|
|
129
|
- @click="handleExport"
|
|
|
|
130
|
- v-hasPermi="['system:user:export']"
|
|
|
|
131
|
- >导出</el-button>
|
50
|
+ <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
|
|
132
|
</el-col>
|
51
|
</el-col>
|
|
133
|
- <div class="top-right-btn">
|
|
|
|
134
|
- <el-tooltip class="item" effect="dark" content="刷新" placement="top">
|
|
|
|
135
|
- <el-button size="mini" circle icon="el-icon-refresh" @click="handleQuery" />
|
|
|
|
136
|
- </el-tooltip>
|
|
|
|
137
|
- <el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
|
|
|
|
138
|
- <el-button size="mini" circle icon="el-icon-search" @click="showSearch=!showSearch" />
|
|
|
|
139
|
- </el-tooltip>
|
|
|
|
140
|
- </div>
|
52
|
+ <table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
|
|
141
|
</el-row>
|
53
|
</el-row>
|
|
142
|
|
54
|
|
|
143
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
55
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
|
@@ -149,12 +61,7 @@ |
|
@@ -149,12 +61,7 @@ |
|
149
|
<el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
|
61
|
<el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
|
|
150
|
<el-table-column label="状态" align="center">
|
62
|
<el-table-column label="状态" align="center">
|
|
151
|
<template slot-scope="scope">
|
63
|
<template slot-scope="scope">
|
|
152
|
- <el-switch
|
|
|
|
153
|
- v-model="scope.row.status"
|
|
|
|
154
|
- active-value="0"
|
|
|
|
155
|
- inactive-value="1"
|
|
|
|
156
|
- @change="handleStatusChange(scope.row)"
|
|
|
|
157
|
- ></el-switch>
|
64
|
+ <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
|
158
|
</template>
|
65
|
</template>
|
|
159
|
</el-table-column>
|
66
|
</el-table-column>
|
|
160
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
67
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
|
@@ -162,46 +69,16 @@ |
|
@@ -162,46 +69,16 @@ |
|
162
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
69
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
163
|
</template>
|
70
|
</template>
|
|
164
|
</el-table-column>
|
71
|
</el-table-column>
|
|
165
|
- <el-table-column
|
|
|
|
166
|
- label="操作"
|
|
|
|
167
|
- align="center"
|
|
|
|
168
|
- width="180"
|
|
|
|
169
|
- class-name="small-padding fixed-width"
|
|
|
|
170
|
- >
|
72
|
+ <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
|
|
171
|
<template slot-scope="scope">
|
73
|
<template slot-scope="scope">
|
|
172
|
- <el-button
|
|
|
|
173
|
- size="mini"
|
|
|
|
174
|
- type="text"
|
|
|
|
175
|
- icon="el-icon-edit"
|
|
|
|
176
|
- @click="handleUpdate(scope.row)"
|
|
|
|
177
|
- v-hasPermi="['system:user:edit']"
|
|
|
|
178
|
- >修改</el-button>
|
|
|
|
179
|
- <el-button
|
|
|
|
180
|
- v-if="scope.row.userId !== 1"
|
|
|
|
181
|
- size="mini"
|
|
|
|
182
|
- type="text"
|
|
|
|
183
|
- icon="el-icon-delete"
|
|
|
|
184
|
- @click="handleDelete(scope.row)"
|
|
|
|
185
|
- v-hasPermi="['system:user:remove']"
|
|
|
|
186
|
- >删除</el-button>
|
|
|
|
187
|
- <el-button
|
|
|
|
188
|
- size="mini"
|
|
|
|
189
|
- type="text"
|
|
|
|
190
|
- icon="el-icon-key"
|
|
|
|
191
|
- @click="handleResetPwd(scope.row)"
|
|
|
|
192
|
- v-hasPermi="['system:user:resetPwd']"
|
|
|
|
193
|
- >重置</el-button>
|
74
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
|
|
|
|
75
|
+ <el-button v-if="scope.row.userId !== 1" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
|
|
|
|
76
|
+ <el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['system:user:resetPwd']">重置</el-button>
|
|
194
|
</template>
|
77
|
</template>
|
|
195
|
</el-table-column>
|
78
|
</el-table-column>
|
|
196
|
</el-table>
|
79
|
</el-table>
|
|
197
|
|
80
|
|
|
198
|
- <pagination
|
|
|
|
199
|
- v-show="total>0"
|
|
|
|
200
|
- :total="total"
|
|
|
|
201
|
- :page.sync="queryParams.pageNum"
|
|
|
|
202
|
- :limit.sync="queryParams.pageSize"
|
|
|
|
203
|
- @pagination="getList"
|
|
|
|
204
|
- />
|
81
|
+ <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
205
|
</el-col>
|
82
|
</el-col>
|
|
206
|
</el-row>
|
83
|
</el-row>
|
|
207
|
|
84
|
|
|
@@ -248,23 +125,14 @@ |
|
@@ -248,23 +125,14 @@ |
|
248
|
<el-col :span="12">
|
125
|
<el-col :span="12">
|
|
249
|
<el-form-item label="用户性别">
|
126
|
<el-form-item label="用户性别">
|
|
250
|
<el-select v-model="form.sex" placeholder="请选择">
|
127
|
<el-select v-model="form.sex" placeholder="请选择">
|
|
251
|
- <el-option
|
|
|
|
252
|
- v-for="dict in sexOptions"
|
|
|
|
253
|
- :key="dict.dictValue"
|
|
|
|
254
|
- :label="dict.dictLabel"
|
|
|
|
255
|
- :value="dict.dictValue"
|
|
|
|
256
|
- ></el-option>
|
128
|
+ <el-option v-for="dict in sexOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
257
|
</el-select>
|
129
|
</el-select>
|
|
258
|
</el-form-item>
|
130
|
</el-form-item>
|
|
259
|
</el-col>
|
131
|
</el-col>
|
|
260
|
<el-col :span="12">
|
132
|
<el-col :span="12">
|
|
261
|
<el-form-item label="状态">
|
133
|
<el-form-item label="状态">
|
|
262
|
<el-radio-group v-model="form.status">
|
134
|
<el-radio-group v-model="form.status">
|
|
263
|
- <el-radio
|
|
|
|
264
|
- v-for="dict in statusOptions"
|
|
|
|
265
|
- :key="dict.dictValue"
|
|
|
|
266
|
- :label="dict.dictValue"
|
|
|
|
267
|
- >{{dict.dictLabel}}</el-radio>
|
135
|
+ <el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictValue">{{dict.dictLabel}}</el-radio>
|
|
268
|
</el-radio-group>
|
136
|
</el-radio-group>
|
|
269
|
</el-form-item>
|
137
|
</el-form-item>
|
|
270
|
</el-col>
|
138
|
</el-col>
|
|
@@ -273,26 +141,14 @@ |
|
@@ -273,26 +141,14 @@ |
|
273
|
<el-col :span="12">
|
141
|
<el-col :span="12">
|
|
274
|
<el-form-item label="岗位">
|
142
|
<el-form-item label="岗位">
|
|
275
|
<el-select v-model="form.postIds" multiple placeholder="请选择">
|
143
|
<el-select v-model="form.postIds" multiple placeholder="请选择">
|
|
276
|
- <el-option
|
|
|
|
277
|
- v-for="item in postOptions"
|
|
|
|
278
|
- :key="item.postId"
|
|
|
|
279
|
- :label="item.postName"
|
|
|
|
280
|
- :value="item.postId"
|
|
|
|
281
|
- :disabled="item.status == 1"
|
|
|
|
282
|
- ></el-option>
|
144
|
+ <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId" :disabled="item.status == 1"></el-option>
|
|
283
|
</el-select>
|
145
|
</el-select>
|
|
284
|
</el-form-item>
|
146
|
</el-form-item>
|
|
285
|
</el-col>
|
147
|
</el-col>
|
|
286
|
<el-col :span="12">
|
148
|
<el-col :span="12">
|
|
287
|
<el-form-item label="角色">
|
149
|
<el-form-item label="角色">
|
|
288
|
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
150
|
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
|
289
|
- <el-option
|
|
|
|
290
|
- v-for="item in roleOptions"
|
|
|
|
291
|
- :key="item.roleId"
|
|
|
|
292
|
- :label="item.roleName"
|
|
|
|
293
|
- :value="item.roleId"
|
|
|
|
294
|
- :disabled="item.status == 1"
|
|
|
|
295
|
- ></el-option>
|
151
|
+ <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
|
|
296
|
</el-select>
|
152
|
</el-select>
|
|
297
|
</el-form-item>
|
153
|
</el-form-item>
|
|
298
|
</el-col>
|
154
|
</el-col>
|
|
@@ -313,18 +169,7 @@ |
|
@@ -313,18 +169,7 @@ |
|
313
|
|
169
|
|
|
314
|
<!-- 用户导入对话框 -->
|
170
|
<!-- 用户导入对话框 -->
|
|
315
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
171
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
316
|
- <el-upload
|
|
|
|
317
|
- ref="upload"
|
|
|
|
318
|
- :limit="1"
|
|
|
|
319
|
- accept=".xlsx, .xls"
|
|
|
|
320
|
- :headers="upload.headers"
|
|
|
|
321
|
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
|
322
|
- :disabled="upload.isUploading"
|
|
|
|
323
|
- :on-progress="handleFileUploadProgress"
|
|
|
|
324
|
- :on-success="handleFileSuccess"
|
|
|
|
325
|
- :auto-upload="false"
|
|
|
|
326
|
- drag
|
|
|
|
327
|
- >
|
172
|
+ <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
|
328
|
<i class="el-icon-upload"></i>
|
173
|
<i class="el-icon-upload"></i>
|
|
329
|
<div class="el-upload__text">
|
174
|
<div class="el-upload__text">
|
|
330
|
将文件拖到此处,或
|
175
|
将文件拖到此处,或
|
|
@@ -345,7 +190,17 @@ |
|
@@ -345,7 +190,17 @@ |
|
345
|
</template>
|
190
|
</template>
|
|
346
|
|
191
|
|
|
347
|
<script>
|
192
|
<script>
|
|
348
|
-import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate } from "@/api/system/user";
|
193
|
+import {
|
|
|
|
194
|
+ listUser,
|
|
|
|
195
|
+ getUser,
|
|
|
|
196
|
+ delUser,
|
|
|
|
197
|
+ addUser,
|
|
|
|
198
|
+ updateUser,
|
|
|
|
199
|
+ exportUser,
|
|
|
|
200
|
+ resetUserPwd,
|
|
|
|
201
|
+ changeUserStatus,
|
|
|
|
202
|
+ importTemplate,
|
|
|
|
203
|
+} from "@/api/system/user";
|
|
349
|
import { getToken } from "@/utils/auth";
|
204
|
import { getToken } from "@/utils/auth";
|
|
350
|
import { treeselect } from "@/api/system/dept";
|
205
|
import { treeselect } from "@/api/system/dept";
|
|
351
|
import Treeselect from "@riophae/vue-treeselect";
|
206
|
import Treeselect from "@riophae/vue-treeselect";
|
|
@@ -394,7 +249,7 @@ export default { |
|
@@ -394,7 +249,7 @@ export default { |
|
394
|
form: {},
|
249
|
form: {},
|
|
395
|
defaultProps: {
|
250
|
defaultProps: {
|
|
396
|
children: "children",
|
251
|
children: "children",
|
|
397
|
- label: "label"
|
252
|
+ label: "label",
|
|
398
|
},
|
253
|
},
|
|
399
|
// 用户导入参数
|
254
|
// 用户导入参数
|
|
400
|
upload: {
|
255
|
upload: {
|
|
@@ -409,7 +264,7 @@ export default { |
|
@@ -409,7 +264,7 @@ export default { |
|
409
|
// 设置上传的请求头部
|
264
|
// 设置上传的请求头部
|
|
410
|
headers: { Authorization: "Bearer " + getToken() },
|
265
|
headers: { Authorization: "Bearer " + getToken() },
|
|
411
|
// 上传的地址
|
266
|
// 上传的地址
|
|
412
|
- url: process.env.VUE_APP_BASE_API + "/system/user/importData"
|
267
|
+ url: process.env.VUE_APP_BASE_API + "/system/user/importData",
|
|
413
|
},
|
268
|
},
|
|
414
|
// 查询参数
|
269
|
// 查询参数
|
|
415
|
queryParams: {
|
270
|
queryParams: {
|
|
@@ -418,57 +273,57 @@ export default { |
|
@@ -418,57 +273,57 @@ export default { |
|
418
|
userName: undefined,
|
273
|
userName: undefined,
|
|
419
|
phonenumber: undefined,
|
274
|
phonenumber: undefined,
|
|
420
|
status: undefined,
|
275
|
status: undefined,
|
|
421
|
- deptId: undefined
|
276
|
+ deptId: undefined,
|
|
422
|
},
|
277
|
},
|
|
423
|
// 表单校验
|
278
|
// 表单校验
|
|
424
|
rules: {
|
279
|
rules: {
|
|
425
|
userName: [
|
280
|
userName: [
|
|
426
|
- { required: true, message: "用户名称不能为空", trigger: "blur" }
|
281
|
+ { required: true, message: "用户名称不能为空", trigger: "blur" },
|
|
427
|
],
|
282
|
],
|
|
428
|
nickName: [
|
283
|
nickName: [
|
|
429
|
- { required: true, message: "用户昵称不能为空", trigger: "blur" }
|
284
|
+ { required: true, message: "用户昵称不能为空", trigger: "blur" },
|
|
430
|
],
|
285
|
],
|
|
431
|
deptId: [
|
286
|
deptId: [
|
|
432
|
- { required: true, message: "归属部门不能为空", trigger: "blur" }
|
287
|
+ { required: true, message: "归属部门不能为空", trigger: "blur" },
|
|
433
|
],
|
288
|
],
|
|
434
|
password: [
|
289
|
password: [
|
|
435
|
- { required: true, message: "用户密码不能为空", trigger: "blur" }
|
290
|
+ { required: true, message: "用户密码不能为空", trigger: "blur" },
|
|
436
|
],
|
291
|
],
|
|
437
|
email: [
|
292
|
email: [
|
|
438
|
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
|
293
|
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
|
|
439
|
{
|
294
|
{
|
|
440
|
type: "email",
|
295
|
type: "email",
|
|
441
|
message: "'请输入正确的邮箱地址",
|
296
|
message: "'请输入正确的邮箱地址",
|
|
442
|
- trigger: ["blur", "change"]
|
|
|
|
443
|
- }
|
297
|
+ trigger: ["blur", "change"],
|
|
|
|
298
|
+ },
|
|
444
|
],
|
299
|
],
|
|
445
|
phonenumber: [
|
300
|
phonenumber: [
|
|
446
|
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
301
|
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
|
447
|
{
|
302
|
{
|
|
448
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
303
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
449
|
message: "请输入正确的手机号码",
|
304
|
message: "请输入正确的手机号码",
|
|
450
|
- trigger: "blur"
|
|
|
|
451
|
- }
|
|
|
|
452
|
- ]
|
|
|
|
453
|
- }
|
305
|
+ trigger: "blur",
|
|
|
|
306
|
+ },
|
|
|
|
307
|
+ ],
|
|
|
|
308
|
+ },
|
|
454
|
};
|
309
|
};
|
|
455
|
},
|
310
|
},
|
|
456
|
watch: {
|
311
|
watch: {
|
|
457
|
// 根据名称筛选部门树
|
312
|
// 根据名称筛选部门树
|
|
458
|
deptName(val) {
|
313
|
deptName(val) {
|
|
459
|
this.$refs.tree.filter(val);
|
314
|
this.$refs.tree.filter(val);
|
|
460
|
- }
|
315
|
+ },
|
|
461
|
},
|
316
|
},
|
|
462
|
created() {
|
317
|
created() {
|
|
463
|
this.getList();
|
318
|
this.getList();
|
|
464
|
this.getTreeselect();
|
319
|
this.getTreeselect();
|
|
465
|
- this.getDicts("sys_normal_disable").then(response => {
|
320
|
+ this.getDicts("sys_normal_disable").then((response) => {
|
|
466
|
this.statusOptions = response.data;
|
321
|
this.statusOptions = response.data;
|
|
467
|
});
|
322
|
});
|
|
468
|
- this.getDicts("sys_user_sex").then(response => {
|
323
|
+ this.getDicts("sys_user_sex").then((response) => {
|
|
469
|
this.sexOptions = response.data;
|
324
|
this.sexOptions = response.data;
|
|
470
|
});
|
325
|
});
|
|
471
|
- this.getConfigKey("sys.user.initPassword").then(response => {
|
326
|
+ this.getConfigKey("sys.user.initPassword").then((response) => {
|
|
472
|
this.initPassword = response.msg;
|
327
|
this.initPassword = response.msg;
|
|
473
|
});
|
328
|
});
|
|
474
|
},
|
329
|
},
|
|
@@ -476,7 +331,8 @@ export default { |
|
@@ -476,7 +331,8 @@ export default { |
|
476
|
/** 查询用户列表 */
|
331
|
/** 查询用户列表 */
|
|
477
|
getList() {
|
332
|
getList() {
|
|
478
|
this.loading = true;
|
333
|
this.loading = true;
|
|
479
|
- listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
334
|
+ listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
|
|
|
|
335
|
+ (response) => {
|
|
480
|
this.userList = response.rows;
|
336
|
this.userList = response.rows;
|
|
481
|
this.total = response.total;
|
337
|
this.total = response.total;
|
|
482
|
this.loading = false;
|
338
|
this.loading = false;
|
|
@@ -485,7 +341,7 @@ export default { |
|
@@ -485,7 +341,7 @@ export default { |
|
485
|
},
|
341
|
},
|
|
486
|
/** 查询部门下拉树结构 */
|
342
|
/** 查询部门下拉树结构 */
|
|
487
|
getTreeselect() {
|
343
|
getTreeselect() {
|
|
488
|
- treeselect().then(response => {
|
344
|
+ treeselect().then((response) => {
|
|
489
|
this.deptOptions = response.data;
|
345
|
this.deptOptions = response.data;
|
|
490
|
});
|
346
|
});
|
|
491
|
},
|
347
|
},
|
|
@@ -502,15 +358,22 @@ export default { |
|
@@ -502,15 +358,22 @@ export default { |
|
502
|
// 用户状态修改
|
358
|
// 用户状态修改
|
|
503
|
handleStatusChange(row) {
|
359
|
handleStatusChange(row) {
|
|
504
|
let text = row.status === "0" ? "启用" : "停用";
|
360
|
let text = row.status === "0" ? "启用" : "停用";
|
|
505
|
- this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', "警告", {
|
361
|
+ this.$confirm(
|
|
|
|
362
|
+ '确认要"' + text + '""' + row.userName + '"用户吗?',
|
|
|
|
363
|
+ "警告",
|
|
|
|
364
|
+ {
|
|
506
|
confirmButtonText: "确定",
|
365
|
confirmButtonText: "确定",
|
|
507
|
cancelButtonText: "取消",
|
366
|
cancelButtonText: "取消",
|
|
508
|
- type: "warning"
|
|
|
|
509
|
- }).then(function() {
|
367
|
+ type: "warning",
|
|
|
|
368
|
+ }
|
|
|
|
369
|
+ )
|
|
|
|
370
|
+ .then(function () {
|
|
510
|
return changeUserStatus(row.userId, row.status);
|
371
|
return changeUserStatus(row.userId, row.status);
|
|
511
|
- }).then(() => {
|
372
|
+ })
|
|
|
|
373
|
+ .then(() => {
|
|
512
|
this.msgSuccess(text + "成功");
|
374
|
this.msgSuccess(text + "成功");
|
|
513
|
- }).catch(function() {
|
375
|
+ })
|
|
|
|
376
|
+ .catch(function () {
|
|
514
|
row.status = row.status === "0" ? "1" : "0";
|
377
|
row.status = row.status === "0" ? "1" : "0";
|
|
515
|
});
|
378
|
});
|
|
516
|
},
|
379
|
},
|
|
@@ -533,7 +396,7 @@ export default { |
|
@@ -533,7 +396,7 @@ export default { |
|
533
|
status: "0",
|
396
|
status: "0",
|
|
534
|
remark: undefined,
|
397
|
remark: undefined,
|
|
535
|
postIds: [],
|
398
|
postIds: [],
|
|
536
|
- roleIds: []
|
399
|
+ roleIds: [],
|
|
537
|
};
|
400
|
};
|
|
538
|
this.resetForm("form");
|
401
|
this.resetForm("form");
|
|
539
|
},
|
402
|
},
|
|
@@ -550,7 +413,7 @@ export default { |
|
@@ -550,7 +413,7 @@ export default { |
|
550
|
},
|
413
|
},
|
|
551
|
// 多选框选中数据
|
414
|
// 多选框选中数据
|
|
552
|
handleSelectionChange(selection) {
|
415
|
handleSelectionChange(selection) {
|
|
553
|
- this.ids = selection.map(item => item.userId);
|
416
|
+ this.ids = selection.map((item) => item.userId);
|
|
554
|
this.single = selection.length != 1;
|
417
|
this.single = selection.length != 1;
|
|
555
|
this.multiple = !selection.length;
|
418
|
this.multiple = !selection.length;
|
|
556
|
},
|
419
|
},
|
|
@@ -558,7 +421,7 @@ export default { |
|
@@ -558,7 +421,7 @@ export default { |
|
558
|
handleAdd() {
|
421
|
handleAdd() {
|
|
559
|
this.reset();
|
422
|
this.reset();
|
|
560
|
this.getTreeselect();
|
423
|
this.getTreeselect();
|
|
561
|
- getUser().then(response => {
|
424
|
+ getUser().then((response) => {
|
|
562
|
this.postOptions = response.posts;
|
425
|
this.postOptions = response.posts;
|
|
563
|
this.roleOptions = response.roles;
|
426
|
this.roleOptions = response.roles;
|
|
564
|
this.open = true;
|
427
|
this.open = true;
|
|
@@ -571,7 +434,7 @@ export default { |
|
@@ -571,7 +434,7 @@ export default { |
|
571
|
this.reset();
|
434
|
this.reset();
|
|
572
|
this.getTreeselect();
|
435
|
this.getTreeselect();
|
|
573
|
const userId = row.userId || this.ids;
|
436
|
const userId = row.userId || this.ids;
|
|
574
|
- getUser(userId).then(response => {
|
437
|
+ getUser(userId).then((response) => {
|
|
575
|
this.form = response.data;
|
438
|
this.form = response.data;
|
|
576
|
this.postOptions = response.posts;
|
439
|
this.postOptions = response.posts;
|
|
577
|
this.roleOptions = response.roles;
|
440
|
this.roleOptions = response.roles;
|
|
@@ -586,21 +449,23 @@ export default { |
|
@@ -586,21 +449,23 @@ export default { |
|
586
|
handleResetPwd(row) {
|
449
|
handleResetPwd(row) {
|
|
587
|
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
450
|
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
|
588
|
confirmButtonText: "确定",
|
451
|
confirmButtonText: "确定",
|
|
589
|
- cancelButtonText: "取消"
|
|
|
|
590
|
- }).then(({ value }) => {
|
|
|
|
591
|
- resetUserPwd(row.userId, value).then(response => {
|
452
|
+ cancelButtonText: "取消",
|
|
|
|
453
|
+ })
|
|
|
|
454
|
+ .then(({ value }) => {
|
|
|
|
455
|
+ resetUserPwd(row.userId, value).then((response) => {
|
|
592
|
if (response.code === 200) {
|
456
|
if (response.code === 200) {
|
|
593
|
this.msgSuccess("修改成功,新密码是:" + value);
|
457
|
this.msgSuccess("修改成功,新密码是:" + value);
|
|
594
|
}
|
458
|
}
|
|
595
|
});
|
459
|
});
|
|
596
|
- }).catch(() => {});
|
460
|
+ })
|
|
|
|
461
|
+ .catch(() => {});
|
|
597
|
},
|
462
|
},
|
|
598
|
/** 提交按钮 */
|
463
|
/** 提交按钮 */
|
|
599
|
- submitForm: function() {
|
|
|
|
600
|
- this.$refs["form"].validate(valid => {
|
464
|
+ submitForm: function () {
|
|
|
|
465
|
+ this.$refs["form"].validate((valid) => {
|
|
601
|
if (valid) {
|
466
|
if (valid) {
|
|
602
|
if (this.form.userId != undefined) {
|
467
|
if (this.form.userId != undefined) {
|
|
603
|
- updateUser(this.form).then(response => {
|
468
|
+ updateUser(this.form).then((response) => {
|
|
604
|
if (response.code === 200) {
|
469
|
if (response.code === 200) {
|
|
605
|
this.msgSuccess("修改成功");
|
470
|
this.msgSuccess("修改成功");
|
|
606
|
this.open = false;
|
471
|
this.open = false;
|
|
@@ -608,7 +473,7 @@ export default { |
|
@@ -608,7 +473,7 @@ export default { |
|
608
|
}
|
473
|
}
|
|
609
|
});
|
474
|
});
|
|
610
|
} else {
|
475
|
} else {
|
|
611
|
- addUser(this.form).then(response => {
|
476
|
+ addUser(this.form).then((response) => {
|
|
612
|
if (response.code === 200) {
|
477
|
if (response.code === 200) {
|
|
613
|
this.msgSuccess("新增成功");
|
478
|
this.msgSuccess("新增成功");
|
|
614
|
this.open = false;
|
479
|
this.open = false;
|
|
@@ -622,29 +487,39 @@ export default { |
|
@@ -622,29 +487,39 @@ export default { |
|
622
|
/** 删除按钮操作 */
|
487
|
/** 删除按钮操作 */
|
|
623
|
handleDelete(row) {
|
488
|
handleDelete(row) {
|
|
624
|
const userIds = row.userId || this.ids;
|
489
|
const userIds = row.userId || this.ids;
|
|
625
|
- this.$confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', "警告", {
|
490
|
+ this.$confirm(
|
|
|
|
491
|
+ '是否确认删除用户编号为"' + userIds + '"的数据项?',
|
|
|
|
492
|
+ "警告",
|
|
|
|
493
|
+ {
|
|
626
|
confirmButtonText: "确定",
|
494
|
confirmButtonText: "确定",
|
|
627
|
cancelButtonText: "取消",
|
495
|
cancelButtonText: "取消",
|
|
628
|
- type: "warning"
|
|
|
|
629
|
- }).then(function() {
|
496
|
+ type: "warning",
|
|
|
|
497
|
+ }
|
|
|
|
498
|
+ )
|
|
|
|
499
|
+ .then(function () {
|
|
630
|
return delUser(userIds);
|
500
|
return delUser(userIds);
|
|
631
|
- }).then(() => {
|
501
|
+ })
|
|
|
|
502
|
+ .then(() => {
|
|
632
|
this.getList();
|
503
|
this.getList();
|
|
633
|
this.msgSuccess("删除成功");
|
504
|
this.msgSuccess("删除成功");
|
|
634
|
- }).catch(function() {});
|
505
|
+ })
|
|
|
|
506
|
+ .catch(function () {});
|
|
635
|
},
|
507
|
},
|
|
636
|
/** 导出按钮操作 */
|
508
|
/** 导出按钮操作 */
|
|
637
|
handleExport() {
|
509
|
handleExport() {
|
|
638
|
const queryParams = this.queryParams;
|
510
|
const queryParams = this.queryParams;
|
|
639
|
- this.$confirm('是否确认导出所有用户数据项?', "警告", {
|
|
|
|
640
|
- confirmButtonText: "确定",
|
|
|
|
641
|
- cancelButtonText: "取消",
|
|
|
|
642
|
- type: "warning"
|
|
|
|
643
|
- }).then(function() {
|
511
|
+ this.$confirm("是否确认导出所有用户数据项?", "警告", {
|
|
|
|
512
|
+ confirmButtonText: "确定",
|
|
|
|
513
|
+ cancelButtonText: "取消",
|
|
|
|
514
|
+ type: "warning",
|
|
|
|
515
|
+ })
|
|
|
|
516
|
+ .then(function () {
|
|
644
|
return exportUser(queryParams);
|
517
|
return exportUser(queryParams);
|
|
645
|
- }).then(response => {
|
518
|
+ })
|
|
|
|
519
|
+ .then((response) => {
|
|
646
|
this.download(response.msg);
|
520
|
this.download(response.msg);
|
|
647
|
- }).catch(function() {});
|
521
|
+ })
|
|
|
|
522
|
+ .catch(function () {});
|
|
648
|
},
|
523
|
},
|
|
649
|
/** 导入按钮操作 */
|
524
|
/** 导入按钮操作 */
|
|
650
|
handleImport() {
|
525
|
handleImport() {
|
|
@@ -653,7 +528,7 @@ export default { |
|
@@ -653,7 +528,7 @@ export default { |
|
653
|
},
|
528
|
},
|
|
654
|
/** 下载模板操作 */
|
529
|
/** 下载模板操作 */
|
|
655
|
importTemplate() {
|
530
|
importTemplate() {
|
|
656
|
- importTemplate().then(response => {
|
531
|
+ importTemplate().then((response) => {
|
|
657
|
this.download(response.msg);
|
532
|
this.download(response.msg);
|
|
658
|
});
|
533
|
});
|
|
659
|
},
|
534
|
},
|
|
@@ -672,7 +547,7 @@ export default { |
|
@@ -672,7 +547,7 @@ export default { |
|
672
|
// 提交上传文件
|
547
|
// 提交上传文件
|
|
673
|
submitFileForm() {
|
548
|
submitFileForm() {
|
|
674
|
this.$refs.upload.submit();
|
549
|
this.$refs.upload.submit();
|
|
675
|
- }
|
|
|
|
676
|
- }
|
550
|
+ },
|
|
|
|
551
|
+ },
|
|
677
|
};
|
552
|
};
|
|
678
|
</script> |
553
|
</script> |