|
@@ -21,7 +21,7 @@ |
|
@@ -21,7 +21,7 @@ |
21
|
<el-button type="success" style="width:150px" size="medium" @click="user_getList">
|
21
|
<el-button type="success" style="width:150px" size="medium" @click="user_getList">
|
22
|
查询用户信息
|
22
|
查询用户信息
|
23
|
</el-button>
|
23
|
</el-button>
|
24
|
- <el-button type="primary" style="width:150px" :loading="user_loading.listLoading" size="medium" @click="user_toAddDialog">
|
24
|
+ <el-button type="primary" style="width:150px" size="medium" @click="user_toAddDialog">
|
25
|
添加用户信息
|
25
|
添加用户信息
|
26
|
</el-button>
|
26
|
</el-button>
|
27
|
</el-col>
|
27
|
</el-col>
|
|
@@ -30,15 +30,15 @@ |
|
@@ -30,15 +30,15 @@ |
30
|
<!-- 列表区域 -->
|
30
|
<!-- 列表区域 -->
|
31
|
<div style="margin-top: 20px;">
|
31
|
<div style="margin-top: 20px;">
|
32
|
<el-table :data="user_page.userInfoList" border v-loading="user_loading.listLoading"
|
32
|
<el-table :data="user_page.userInfoList" border v-loading="user_loading.listLoading"
|
33
|
- @selection-change="user_selectChange"
|
33
|
+ @selection-change="user_selectChange" size="small"
|
34
|
element-loading-text="获取用户信息列表,拼命加载中">
|
34
|
element-loading-text="获取用户信息列表,拼命加载中">
|
35
|
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
35
|
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
36
|
<el-table-column type="index" align="center"></el-table-column>
|
36
|
<el-table-column type="index" align="center"></el-table-column>
|
37
|
- <el-table-column label="用户名称" prop="username" align="center" width="170"></el-table-column>
|
|
|
38
|
- <el-table-column label="真实姓名" prop="realName" align="center" width="170"></el-table-column>
|
|
|
39
|
- <el-table-column label="服务器名称" prop="serverName" align="center" width="180"></el-table-column>
|
|
|
40
|
- <el-table-column label="虚拟主机名称" prop="virtualHostName" align="center" width="300"></el-table-column>
|
|
|
41
|
- <el-table-column label="操作" width="340px" align="center" fixed="right">
|
37
|
+ <el-table-column label="用户名称" prop="username" align="center" width="120%"></el-table-column>
|
|
|
38
|
+ <el-table-column label="真实姓名" prop="realName" align="center" width="120%"></el-table-column>
|
|
|
39
|
+ <el-table-column label="服务器名称" prop="serverName" align="center" width="120%"></el-table-column>
|
|
|
40
|
+ <el-table-column label="虚拟主机名称" prop="virtualHostName" align="center" width="300%"></el-table-column>
|
|
|
41
|
+ <el-table-column label="操作" width="340px" align="center">
|
42
|
<template slot-scope="scope">
|
42
|
<template slot-scope="scope">
|
43
|
<!-- 删除用户 -->
|
43
|
<!-- 删除用户 -->
|
44
|
<el-tooltip effect="dark" content="删除用户" placement="top-start" :enterable="false">
|
44
|
<el-tooltip effect="dark" content="删除用户" placement="top-start" :enterable="false">
|
|
@@ -48,11 +48,11 @@ |
|
@@ -48,11 +48,11 @@ |
48
|
</el-button>
|
48
|
</el-button>
|
49
|
</el-tooltip>
|
49
|
</el-tooltip>
|
50
|
<!-- 编辑关系 -->
|
50
|
<!-- 编辑关系 -->
|
51
|
- <!-- <el-tooltip effect="dark" content="编辑关系" placement="top-start" :enterable="false">-->
|
|
|
52
|
- <!-- <el-button type="primary" icon="el-icon-edit" size="small"-->
|
|
|
53
|
- <!-- @click="user_toEditDialog(scope.$index,scope.row)">编辑关系-->
|
|
|
54
|
- <!-- </el-button>-->
|
|
|
55
|
- <!-- </el-tooltip>-->
|
51
|
+ <el-tooltip effect="dark" content="编辑关系" placement="top-start" :enterable="false">
|
|
|
52
|
+ <el-button type="primary" icon="el-icon-edit" size="small"
|
|
|
53
|
+ @click="user_toEditDialog(scope.$index,scope.row)">编辑关系
|
|
|
54
|
+ </el-button>
|
|
|
55
|
+ </el-tooltip>
|
56
|
<!-- 删除关系 -->
|
56
|
<!-- 删除关系 -->
|
57
|
<el-tooltip effect="dark" content="删除关系" placement="top-start" :enterable="false">
|
57
|
<el-tooltip effect="dark" content="删除关系" placement="top-start" :enterable="false">
|
58
|
<el-button type="danger" icon="el-icon-edit" size="small"
|
58
|
<el-button type="danger" icon="el-icon-edit" size="small"
|
|
@@ -109,15 +109,15 @@ |
|
@@ -109,15 +109,15 @@ |
109
|
</el-input>
|
109
|
</el-input>
|
110
|
</el-form-item>
|
110
|
</el-form-item>
|
111
|
|
111
|
|
112
|
-<!-- <el-form-item label="用户密码:" prop="firstPassword">-->
|
|
|
113
|
-<!-- <el-input type="password" v-model="user_addForm.firstPassword" style="width:270px"-->
|
|
|
114
|
-<!-- size="small" clearable show-password placeholder="请输入用户密码"></el-input>-->
|
|
|
115
|
-<!-- </el-form-item>-->
|
112
|
+ <!-- <el-form-item label="用户密码:" prop="firstPassword">-->
|
|
|
113
|
+ <!-- <el-input type="password" v-model="user_addForm.firstPassword" style="width:270px"-->
|
|
|
114
|
+ <!-- size="small" clearable show-password placeholder="请输入用户密码"></el-input>-->
|
|
|
115
|
+ <!-- </el-form-item>-->
|
116
|
|
116
|
|
117
|
-<!-- <el-form-item label="重新输入密码:" prop="password">-->
|
|
|
118
|
-<!-- <el-input type="password" v-model="user_addForm.password" style="width:270px"-->
|
|
|
119
|
-<!-- size="small" clearable show-password placeholder="请重新输入密码"></el-input>-->
|
|
|
120
|
-<!-- </el-form-item>-->
|
117
|
+ <!-- <el-form-item label="重新输入密码:" prop="password">-->
|
|
|
118
|
+ <!-- <el-input type="password" v-model="user_addForm.password" style="width:270px"-->
|
|
|
119
|
+ <!-- size="small" clearable show-password placeholder="请重新输入密码"></el-input>-->
|
|
|
120
|
+ <!-- </el-form-item>-->
|
121
|
<el-form-item label="真实姓名:" prop="realName">
|
121
|
<el-form-item label="真实姓名:" prop="realName">
|
122
|
<el-input v-model="user_addForm.realName" style="width:270px" size="small" clearable
|
122
|
<el-input v-model="user_addForm.realName" style="width:270px" size="small" clearable
|
123
|
placeholder="请输入真实姓名">
|
123
|
placeholder="请输入真实姓名">
|
|
@@ -162,34 +162,34 @@ |
|
@@ -162,34 +162,34 @@ |
162
|
<el-input v-model="user_editForm.serverName" style="width:300px" size="small" clearable readonly
|
162
|
<el-input v-model="user_editForm.serverName" style="width:300px" size="small" clearable readonly
|
163
|
placeholder="请输入服务器名称"></el-input>
|
163
|
placeholder="请输入服务器名称"></el-input>
|
164
|
</el-form-item>
|
164
|
</el-form-item>
|
165
|
- <br/>
|
|
|
166
|
- <el-form-item label="现有用户关系:" prop="virtualHostIds">
|
|
|
167
|
- <el-select v-model="user_editForm.virtualHostIds" prefix-icon="el-icon-search" clearable
|
|
|
168
|
- style="width:300px" size="small" filterable multiple disabled
|
|
|
169
|
- @change="user_editChange"
|
|
|
170
|
- placeholder="选择用户关系">
|
|
|
171
|
- <el-option
|
|
|
172
|
- v-for="item in (user_config.virtualHostList)"
|
|
|
173
|
- :key="item.id"
|
|
|
174
|
- :label="item.virtualHostName"
|
|
|
175
|
- :value="item.id">
|
|
|
176
|
- </el-option>
|
|
|
177
|
- </el-select>
|
|
|
178
|
- </el-form-item>
|
|
|
179
|
- <br/>
|
|
|
180
|
- <el-form-item label="选择用户关系:" prop="virtualHostId">
|
|
|
181
|
- <el-select v-model="user_editForm.virtualHostId" prefix-icon="el-icon-search" clearable
|
|
|
182
|
- style="width:300px" size="small" filterable multiple
|
|
|
183
|
- @change="user_editChange"
|
|
|
184
|
- placeholder="选择用户关系">
|
|
|
185
|
- <el-option
|
|
|
186
|
- v-for="item in (user_config.virtualHostList)"
|
|
|
187
|
- :key="item.id"
|
|
|
188
|
- :label="item.virtualHostName"
|
|
|
189
|
- :value="item.id">
|
|
|
190
|
- </el-option>
|
|
|
191
|
- </el-select>
|
|
|
192
|
- </el-form-item>
|
165
|
+ <!-- <br/>-->
|
|
|
166
|
+ <!-- <el-form-item label="现有用户关系:" prop="virtualHostIds">-->
|
|
|
167
|
+ <!-- <el-select v-model="user_editForm.virtualHostIds" prefix-icon="el-icon-search" clearable-->
|
|
|
168
|
+ <!-- style="width:300px" size="small" filterable multiple disabled-->
|
|
|
169
|
+ <!-- @change="user_editChange"-->
|
|
|
170
|
+ <!-- placeholder="选择用户关系">-->
|
|
|
171
|
+ <!-- <el-option-->
|
|
|
172
|
+ <!-- v-for="item in (user_config.virtualHostList)"-->
|
|
|
173
|
+ <!-- :key="item.id"-->
|
|
|
174
|
+ <!-- :label="item.virtualHostName"-->
|
|
|
175
|
+ <!-- :value="item.id">-->
|
|
|
176
|
+ <!-- </el-option>-->
|
|
|
177
|
+ <!-- </el-select>-->
|
|
|
178
|
+ <!-- </el-form-item>-->
|
|
|
179
|
+ <!-- <br/>-->
|
|
|
180
|
+ <!-- <el-form-item label="选择用户关系:" prop="virtualHostId">-->
|
|
|
181
|
+ <!-- <el-select v-model="user_editForm.virtualHostId" prefix-icon="el-icon-search" clearable-->
|
|
|
182
|
+ <!-- style="width:300px" size="small" filterable multiple-->
|
|
|
183
|
+ <!-- @change="user_editChange"-->
|
|
|
184
|
+ <!-- placeholder="选择用户关系">-->
|
|
|
185
|
+ <!-- <el-option-->
|
|
|
186
|
+ <!-- v-for="item in (user_config.virtualHostList)"-->
|
|
|
187
|
+ <!-- :key="item.id"-->
|
|
|
188
|
+ <!-- :label="item.virtualHostName"-->
|
|
|
189
|
+ <!-- :value="item.id">-->
|
|
|
190
|
+ <!-- </el-option>-->
|
|
|
191
|
+ <!-- </el-select>-->
|
|
|
192
|
+ <!-- </el-form-item>-->
|
193
|
|
193
|
|
194
|
<br/>
|
194
|
<br/>
|
195
|
<el-form-item label="选择用户关系:">
|
195
|
<el-form-item label="选择用户关系:">
|
|
@@ -200,8 +200,9 @@ |
|
@@ -200,8 +200,9 @@ |
200
|
:props="user_config.tree.defaultParams"
|
200
|
:props="user_config.tree.defaultParams"
|
201
|
ref="tree_edit"
|
201
|
ref="tree_edit"
|
202
|
node-key="id"
|
202
|
node-key="id"
|
203
|
- :default-checked-keys='user_editForm.aliasName'
|
|
|
204
|
- show-checkbox highlight-current default-expand-all>
|
203
|
+ :default-checked-keys='user_config.tree.edit_default_checked'
|
|
|
204
|
+ :highlight-current="true"
|
|
|
205
|
+ show-checkbox default-expand-all>
|
205
|
</el-tree>
|
206
|
</el-tree>
|
206
|
</el-form-item>
|
207
|
</el-form-item>
|
207
|
</el-form>
|
208
|
</el-form>
|
|
@@ -228,7 +229,7 @@ |
|
@@ -228,7 +229,7 @@ |
228
|
deleteUserInfo,
|
229
|
deleteUserInfo,
|
229
|
deleteUserRelation,
|
230
|
deleteUserRelation,
|
230
|
getHostList,
|
231
|
getHostList,
|
231
|
- batchDeleteUser,
|
232
|
+ batchDeleteUser,updateUserInfo,
|
232
|
batchDeleteUserRelation
|
233
|
batchDeleteUserRelation
|
233
|
} from "../../api/message_bus";
|
234
|
} from "../../api/message_bus";
|
234
|
|
235
|
|
|
@@ -251,6 +252,7 @@ |
|
@@ -251,6 +252,7 @@ |
251
|
user_config: {
|
252
|
user_config: {
|
252
|
virtualHostList: [],
|
253
|
virtualHostList: [],
|
253
|
tree: {
|
254
|
tree: {
|
|
|
255
|
+ edit_default_checked: [],
|
254
|
edit_serverHostList: [],
|
256
|
edit_serverHostList: [],
|
255
|
// 服务器及虚拟主机列表
|
257
|
// 服务器及虚拟主机列表
|
256
|
server_hostList: [],
|
258
|
server_hostList: [],
|
|
@@ -471,14 +473,8 @@ |
|
@@ -471,14 +473,8 @@ |
471
|
this.selectHostList(row.serverId);
|
473
|
this.selectHostList(row.serverId);
|
472
|
this.selectEditServerAndHostList(row.serverName)
|
474
|
this.selectEditServerAndHostList(row.serverName)
|
473
|
this.user_editForm = Object.assign({}, row);
|
475
|
this.user_editForm = Object.assign({}, row);
|
474
|
-
|
|
|
475
|
- this.user_editForm.virtualHostIds = [];
|
|
|
476
|
- if (this.user_editForm.virtualHostId.indexOf(",") === -1) {
|
|
|
477
|
- // 队列id中不包含","
|
|
|
478
|
- this.user_editForm.virtualHostIds[0] = this.user_editForm.virtualHostId;
|
|
|
479
|
- } else {
|
|
|
480
|
- this.user_editForm.virtualHostIds = this.user_editForm.virtualHostId.split(",")
|
|
|
481
|
- }
|
476
|
+ this.user_config.tree.edit_default_checked = row.virtualHostId.split(",");
|
|
|
477
|
+ this.user_editForm.virtualHostId = this.user_config.tree.edit_default_checked.join();
|
482
|
this.user_dialog.editDialog = true;
|
478
|
this.user_dialog.editDialog = true;
|
483
|
},
|
479
|
},
|
484
|
|
480
|
|
|
@@ -489,27 +485,47 @@ |
|
@@ -489,27 +485,47 @@ |
489
|
//重置对话框
|
485
|
//重置对话框
|
490
|
this.$refs.user_editFormRef.resetFields();
|
486
|
this.$refs.user_editFormRef.resetFields();
|
491
|
},
|
487
|
},
|
492
|
-
|
|
|
493
|
- /**
|
|
|
494
|
- * user,编辑对话框,改变
|
|
|
495
|
- */
|
|
|
496
|
- user_editChange(value) {
|
|
|
497
|
-
|
|
|
498
|
- },
|
|
|
499
|
-
|
|
|
500
|
/**
|
488
|
/**
|
501
|
* user,编辑对话框中的tree组件,改变
|
489
|
* user,编辑对话框中的tree组件,改变
|
502
|
*/
|
490
|
*/
|
503
|
user_editTreeChange(value) {
|
491
|
user_editTreeChange(value) {
|
504
|
this.user_editForm.virtualHostId = this.$refs.tree_edit.getCheckedKeys().join();
|
492
|
this.user_editForm.virtualHostId = this.$refs.tree_edit.getCheckedKeys().join();
|
505
|
- console.log(this.user_editForm.virtualHostId)
|
|
|
506
|
},
|
493
|
},
|
507
|
|
494
|
|
508
|
/**
|
495
|
/**
|
509
|
* user,编辑功能
|
496
|
* user,编辑功能
|
510
|
*/
|
497
|
*/
|
511
|
user_edit() {
|
498
|
user_edit() {
|
512
|
- this.user_addForm.virtualHostId = this.$refs.tree.getCheckedKeys().join();
|
499
|
+ console.log(this.user_editForm.virtualHostId)
|
|
|
500
|
+ console.log(this.user_editForm)
|
|
|
501
|
+ if (this.user_editForm.virtualHostId === '') {
|
|
|
502
|
+ return this.$confirm('用户关系不能为空,请务必选择用户关系', '警告', {
|
|
|
503
|
+ confirmButtonText: '确定',
|
|
|
504
|
+ cancelButtonText: '取消',
|
|
|
505
|
+ type: 'warning'
|
|
|
506
|
+ }
|
|
|
507
|
+ )
|
|
|
508
|
+ }
|
|
|
509
|
+ this.user_loading.editLoading = true;
|
|
|
510
|
+ updateUserInfo(this.user_editForm).then((response) => {
|
|
|
511
|
+ let res = response.data;
|
|
|
512
|
+ if (res.code !== '200') {
|
|
|
513
|
+ //关闭加载
|
|
|
514
|
+ this.user_loading.editLoading = false;
|
|
|
515
|
+ return this.$message.error(res.msg);
|
|
|
516
|
+ }
|
|
|
517
|
+ // 关闭加载
|
|
|
518
|
+ this.user_loading.editLoading = false;
|
|
|
519
|
+ this.$message.success(res.msg);
|
|
|
520
|
+ // 隐藏对话框
|
|
|
521
|
+ this.user_dialog.editDialog = false;
|
|
|
522
|
+ // 刷新列表
|
|
|
523
|
+ this.user_getList();
|
|
|
524
|
+ }).catch(error => {
|
|
|
525
|
+ this.user_loading.editLoading = false;
|
|
|
526
|
+ this.$message.error(error.toString());
|
|
|
527
|
+ });
|
|
|
528
|
+
|
513
|
},
|
529
|
},
|
514
|
|
530
|
|
515
|
/**
|
531
|
/**
|