...
|
...
|
@@ -21,7 +21,7 @@ |
|
|
<el-button type="success" style="width:150px" size="medium" @click="user_getList">
|
|
|
查询用户信息
|
|
|
</el-button>
|
|
|
<el-button type="primary" style="width:150px" :loading="user_loading.listLoading" size="medium" @click="user_toAddDialog">
|
|
|
<el-button type="primary" style="width:150px" size="medium" @click="user_toAddDialog">
|
|
|
添加用户信息
|
|
|
</el-button>
|
|
|
</el-col>
|
...
|
...
|
@@ -30,15 +30,15 @@ |
|
|
<!-- 列表区域 -->
|
|
|
<div style="margin-top: 20px;">
|
|
|
<el-table :data="user_page.userInfoList" border v-loading="user_loading.listLoading"
|
|
|
@selection-change="user_selectChange"
|
|
|
@selection-change="user_selectChange" size="small"
|
|
|
element-loading-text="获取用户信息列表,拼命加载中">
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
|
|
<el-table-column type="index" align="center"></el-table-column>
|
|
|
<el-table-column label="用户名称" prop="username" align="center" width="170"></el-table-column>
|
|
|
<el-table-column label="真实姓名" prop="realName" align="center" width="170"></el-table-column>
|
|
|
<el-table-column label="服务器名称" prop="serverName" align="center" width="180"></el-table-column>
|
|
|
<el-table-column label="虚拟主机名称" prop="virtualHostName" align="center" width="300"></el-table-column>
|
|
|
<el-table-column label="操作" width="340px" align="center" fixed="right">
|
|
|
<el-table-column label="用户名称" prop="username" align="center" width="120%"></el-table-column>
|
|
|
<el-table-column label="真实姓名" prop="realName" align="center" width="120%"></el-table-column>
|
|
|
<el-table-column label="服务器名称" prop="serverName" align="center" width="120%"></el-table-column>
|
|
|
<el-table-column label="虚拟主机名称" prop="virtualHostName" align="center" width="300%"></el-table-column>
|
|
|
<el-table-column label="操作" width="340px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- 删除用户 -->
|
|
|
<el-tooltip effect="dark" content="删除用户" placement="top-start" :enterable="false">
|
...
|
...
|
@@ -48,11 +48,11 @@ |
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
<!-- 编辑关系 -->
|
|
|
<!-- <el-tooltip effect="dark" content="编辑关系" placement="top-start" :enterable="false">-->
|
|
|
<!-- <el-button type="primary" icon="el-icon-edit" size="small"-->
|
|
|
<!-- @click="user_toEditDialog(scope.$index,scope.row)">编辑关系-->
|
|
|
<!-- </el-button>-->
|
|
|
<!-- </el-tooltip>-->
|
|
|
<el-tooltip effect="dark" content="编辑关系" placement="top-start" :enterable="false">
|
|
|
<el-button type="primary" icon="el-icon-edit" size="small"
|
|
|
@click="user_toEditDialog(scope.$index,scope.row)">编辑关系
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
<!-- 删除关系 -->
|
|
|
<el-tooltip effect="dark" content="删除关系" placement="top-start" :enterable="false">
|
|
|
<el-button type="danger" icon="el-icon-edit" size="small"
|
...
|
...
|
@@ -109,15 +109,15 @@ |
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- <el-form-item label="用户密码:" prop="firstPassword">-->
|
|
|
<!-- <el-input type="password" v-model="user_addForm.firstPassword" style="width:270px"-->
|
|
|
<!-- size="small" clearable show-password placeholder="请输入用户密码"></el-input>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<!-- <el-form-item label="用户密码:" prop="firstPassword">-->
|
|
|
<!-- <el-input type="password" v-model="user_addForm.firstPassword" style="width:270px"-->
|
|
|
<!-- size="small" clearable show-password placeholder="请输入用户密码"></el-input>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<!-- <el-form-item label="重新输入密码:" prop="password">-->
|
|
|
<!-- <el-input type="password" v-model="user_addForm.password" style="width:270px"-->
|
|
|
<!-- size="small" clearable show-password placeholder="请重新输入密码"></el-input>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<!-- <el-form-item label="重新输入密码:" prop="password">-->
|
|
|
<!-- <el-input type="password" v-model="user_addForm.password" style="width:270px"-->
|
|
|
<!-- size="small" clearable show-password placeholder="请重新输入密码"></el-input>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<el-form-item label="真实姓名:" prop="realName">
|
|
|
<el-input v-model="user_addForm.realName" style="width:270px" size="small" clearable
|
|
|
placeholder="请输入真实姓名">
|
...
|
...
|
@@ -162,34 +162,34 @@ |
|
|
<el-input v-model="user_editForm.serverName" style="width:300px" size="small" clearable readonly
|
|
|
placeholder="请输入服务器名称"></el-input>
|
|
|
</el-form-item>
|
|
|
<br/>
|
|
|
<el-form-item label="现有用户关系:" prop="virtualHostIds">
|
|
|
<el-select v-model="user_editForm.virtualHostIds" prefix-icon="el-icon-search" clearable
|
|
|
style="width:300px" size="small" filterable multiple disabled
|
|
|
@change="user_editChange"
|
|
|
placeholder="选择用户关系">
|
|
|
<el-option
|
|
|
v-for="item in (user_config.virtualHostList)"
|
|
|
:key="item.id"
|
|
|
:label="item.virtualHostName"
|
|
|
:value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<br/>
|
|
|
<el-form-item label="选择用户关系:" prop="virtualHostId">
|
|
|
<el-select v-model="user_editForm.virtualHostId" prefix-icon="el-icon-search" clearable
|
|
|
style="width:300px" size="small" filterable multiple
|
|
|
@change="user_editChange"
|
|
|
placeholder="选择用户关系">
|
|
|
<el-option
|
|
|
v-for="item in (user_config.virtualHostList)"
|
|
|
:key="item.id"
|
|
|
:label="item.virtualHostName"
|
|
|
:value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<!-- <br/>-->
|
|
|
<!-- <el-form-item label="现有用户关系:" prop="virtualHostIds">-->
|
|
|
<!-- <el-select v-model="user_editForm.virtualHostIds" prefix-icon="el-icon-search" clearable-->
|
|
|
<!-- style="width:300px" size="small" filterable multiple disabled-->
|
|
|
<!-- @change="user_editChange"-->
|
|
|
<!-- placeholder="选择用户关系">-->
|
|
|
<!-- <el-option-->
|
|
|
<!-- v-for="item in (user_config.virtualHostList)"-->
|
|
|
<!-- :key="item.id"-->
|
|
|
<!-- :label="item.virtualHostName"-->
|
|
|
<!-- :value="item.id">-->
|
|
|
<!-- </el-option>-->
|
|
|
<!-- </el-select>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<!-- <br/>-->
|
|
|
<!-- <el-form-item label="选择用户关系:" prop="virtualHostId">-->
|
|
|
<!-- <el-select v-model="user_editForm.virtualHostId" prefix-icon="el-icon-search" clearable-->
|
|
|
<!-- style="width:300px" size="small" filterable multiple-->
|
|
|
<!-- @change="user_editChange"-->
|
|
|
<!-- placeholder="选择用户关系">-->
|
|
|
<!-- <el-option-->
|
|
|
<!-- v-for="item in (user_config.virtualHostList)"-->
|
|
|
<!-- :key="item.id"-->
|
|
|
<!-- :label="item.virtualHostName"-->
|
|
|
<!-- :value="item.id">-->
|
|
|
<!-- </el-option>-->
|
|
|
<!-- </el-select>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
|
<br/>
|
|
|
<el-form-item label="选择用户关系:">
|
...
|
...
|
@@ -200,8 +200,9 @@ |
|
|
:props="user_config.tree.defaultParams"
|
|
|
ref="tree_edit"
|
|
|
node-key="id"
|
|
|
:default-checked-keys='user_editForm.aliasName'
|
|
|
show-checkbox highlight-current default-expand-all>
|
|
|
:default-checked-keys='user_config.tree.edit_default_checked'
|
|
|
:highlight-current="true"
|
|
|
show-checkbox default-expand-all>
|
|
|
</el-tree>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
...
|
...
|
@@ -228,7 +229,7 @@ |
|
|
deleteUserInfo,
|
|
|
deleteUserRelation,
|
|
|
getHostList,
|
|
|
batchDeleteUser,
|
|
|
batchDeleteUser,updateUserInfo,
|
|
|
batchDeleteUserRelation
|
|
|
} from "../../api/message_bus";
|
|
|
|
...
|
...
|
@@ -251,6 +252,7 @@ |
|
|
user_config: {
|
|
|
virtualHostList: [],
|
|
|
tree: {
|
|
|
edit_default_checked: [],
|
|
|
edit_serverHostList: [],
|
|
|
// 服务器及虚拟主机列表
|
|
|
server_hostList: [],
|
...
|
...
|
@@ -471,14 +473,8 @@ |
|
|
this.selectHostList(row.serverId);
|
|
|
this.selectEditServerAndHostList(row.serverName)
|
|
|
this.user_editForm = Object.assign({}, row);
|
|
|
|
|
|
this.user_editForm.virtualHostIds = [];
|
|
|
if (this.user_editForm.virtualHostId.indexOf(",") === -1) {
|
|
|
// 队列id中不包含","
|
|
|
this.user_editForm.virtualHostIds[0] = this.user_editForm.virtualHostId;
|
|
|
} else {
|
|
|
this.user_editForm.virtualHostIds = this.user_editForm.virtualHostId.split(",")
|
|
|
}
|
|
|
this.user_config.tree.edit_default_checked = row.virtualHostId.split(",");
|
|
|
this.user_editForm.virtualHostId = this.user_config.tree.edit_default_checked.join();
|
|
|
this.user_dialog.editDialog = true;
|
|
|
},
|
|
|
|
...
|
...
|
@@ -489,27 +485,47 @@ |
|
|
//重置对话框
|
|
|
this.$refs.user_editFormRef.resetFields();
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* user,编辑对话框,改变
|
|
|
*/
|
|
|
user_editChange(value) {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* user,编辑对话框中的tree组件,改变
|
|
|
*/
|
|
|
user_editTreeChange(value) {
|
|
|
this.user_editForm.virtualHostId = this.$refs.tree_edit.getCheckedKeys().join();
|
|
|
console.log(this.user_editForm.virtualHostId)
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* user,编辑功能
|
|
|
*/
|
|
|
user_edit() {
|
|
|
this.user_addForm.virtualHostId = this.$refs.tree.getCheckedKeys().join();
|
|
|
console.log(this.user_editForm.virtualHostId)
|
|
|
console.log(this.user_editForm)
|
|
|
if (this.user_editForm.virtualHostId === '') {
|
|
|
return this.$confirm('用户关系不能为空,请务必选择用户关系', '警告', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
this.user_loading.editLoading = true;
|
|
|
updateUserInfo(this.user_editForm).then((response) => {
|
|
|
let res = response.data;
|
|
|
if (res.code !== '200') {
|
|
|
//关闭加载
|
|
|
this.user_loading.editLoading = false;
|
|
|
return this.$message.error(res.msg);
|
|
|
}
|
|
|
// 关闭加载
|
|
|
this.user_loading.editLoading = false;
|
|
|
this.$message.success(res.msg);
|
|
|
// 隐藏对话框
|
|
|
this.user_dialog.editDialog = false;
|
|
|
// 刷新列表
|
|
|
this.user_getList();
|
|
|
}).catch(error => {
|
|
|
this.user_loading.editLoading = false;
|
|
|
this.$message.error(error.toString());
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
|