|
|
@@ -3,7 +3,8 @@
|
|
|
<el-row :gutter="20">
|
|
|
<!--机构数据-->
|
|
|
<el-col :span="4" :xs="24">
|
|
|
- <org-tree v-model="queryParams.orgId" @defaultKey="getDefaultKey" @checkChange="checkChange" @click="clickTreeNode"></org-tree>
|
|
|
+ <org-tree v-model="queryParams.orgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
|
|
|
+ @click="clickTreeNode"></org-tree>
|
|
|
</el-col>
|
|
|
<!--用户数据-->
|
|
|
<el-col :span="20" :xs="24">
|
|
|
@@ -86,36 +87,19 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="是否管理人员" align="center" key="phone" prop="phone" v-if="columns[5].visible" width="120" />
|
|
|
<el-table-column label="登录IP" align="center" key="lastIp" prop="lastIp" v-if="columns[6].visible" width="120" />
|
|
|
- <el-table-column label="登录时间" align="center" key="lastTime" prop="lastTime" v-if="columns[7].visible" width="120" />
|
|
|
- <el-table-column
|
|
|
- label="操作"
|
|
|
- align="center"
|
|
|
- width="160"
|
|
|
- class-name="small-padding fixed-width"
|
|
|
- >
|
|
|
- <template slot-scope="scope" v-if="scope.row.userId !== 1">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleExtend(scope.row)"
|
|
|
- v-hasPermi="['system:user:extend']"
|
|
|
- >扩展</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['system:user:edit']"
|
|
|
- >修改</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['system:user:remove']"
|
|
|
- >删除</el-button>
|
|
|
- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
|
|
|
+ <el-table-column label="登录时间" align="center" key="lastTime" prop="lastTime" v-if="columns[7].visible"
|
|
|
+ width="120" />
|
|
|
+ <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
|
|
+
|
|
|
+ <template slot-scope="scope" v-if="check == true">
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleExtend(scope.row)"
|
|
|
+ v-hasPermi="['system:user:extend']">扩展</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['system:user:edit']">修改</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['system:user:remove']">删除</el-button>
|
|
|
+ <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
|
|
|
+ v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
|
|
|
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
|
|
|
@@ -144,13 +128,8 @@
|
|
|
</el-col>
|
|
|
<el-col :span="14">
|
|
|
<el-form-item label="所属机构" prop="orgId">
|
|
|
- <tree-select
|
|
|
- v-model="form.orgId"
|
|
|
- :options="deptOptions"
|
|
|
- :show-count="true"
|
|
|
- :normalizer="tenantIdnormalizer"
|
|
|
- :props="{checkStrictly: true, label:'name'}"
|
|
|
- placeholder="请选择归属机构" />
|
|
|
+ <tree-select v-model="form.orgId" :options="deptOptions" :show-count="true" :normalizer="tenantIdnormalizer"
|
|
|
+ :props="{ checkStrictly: true, label: 'name' }" placeholder="请选择归属机构" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -198,8 +177,8 @@
|
|
|
<el-col :span="14">
|
|
|
<el-form-item label="状态">
|
|
|
<el-radio-group v-model="form.isLock">
|
|
|
- <el-radio v-for="dict in dict.type.sys_normal_disable" :key="`${dict.value}`"
|
|
|
- :label="dict.value">{{ dict.label }}</el-radio>
|
|
|
+ <el-radio v-for="dict in dict.type.sys_normal_disable" :key="`${dict.value}`" :label="dict.value">{{
|
|
|
+ dict.label }}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -239,14 +218,14 @@
|
|
|
import OrgTree from '@/components/orgTree'
|
|
|
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
-import {deptTreeSelect} from "@/api/system/public";
|
|
|
+import { deptTreeSelect } from "@/api/system/public";
|
|
|
import tableList from "@/mixins/tableList";
|
|
|
|
|
|
export default {
|
|
|
name: "User",
|
|
|
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
|
|
components: { OrgTree },
|
|
|
- mixins:[tableList],
|
|
|
+ mixins: [tableList],
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
@@ -263,6 +242,8 @@ export default {
|
|
|
total: 0,
|
|
|
// 用户表格数据
|
|
|
userList: null,
|
|
|
+ //是否是管理员
|
|
|
+ check: false,
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
|
@@ -329,7 +310,7 @@ export default {
|
|
|
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
|
|
|
],
|
|
|
orgId: [
|
|
|
- { required: true, message: "所属机构不能为空", trigger: "blur" }
|
|
|
+ { required: true, message: "所属机构不能为空", trigger: "blur" }
|
|
|
],
|
|
|
// email: [
|
|
|
// {
|
|
|
@@ -347,9 +328,9 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
//默认选中节点
|
|
|
- defaultKeys:null,
|
|
|
+ defaultKeys: null,
|
|
|
//修改新增中的机构树
|
|
|
- deptOptions:[],
|
|
|
+ deptOptions: [],
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -359,7 +340,7 @@ export default {
|
|
|
// this.initPassword = response.msg;
|
|
|
// });
|
|
|
},
|
|
|
- mounted(){
|
|
|
+ mounted() {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -391,16 +372,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- /** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
- /** 重置按钮操作 */
|
|
|
- resetQuery() {
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/** 查询列表 */
|
|
|
@@ -408,9 +389,10 @@ export default {
|
|
|
this.loading = true;
|
|
|
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
//兼容框架userId字段
|
|
|
- response.rows.forEach(v => { v.userId = v.id });
|
|
|
- this.userList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
+ response.data.rows.forEach(v => { v.userId = v.id });
|
|
|
+ this.userList = response.data.rows;
|
|
|
+ this.total = response.data.total;
|
|
|
+ this.check = response.check;
|
|
|
this.loading = false;
|
|
|
}
|
|
|
).catch(err => {
|
|
|
@@ -418,12 +400,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- getDefaultKey(key){
|
|
|
+ getDefaultKey(key) {
|
|
|
this.queryParams.orgId = key;
|
|
|
this.getList();
|
|
|
},
|
|
|
//单选框状态改变
|
|
|
- checkChange(state){
|
|
|
+ checkChange(state) {
|
|
|
this.queryParams.checkSub = state;
|
|
|
this.handleQuery();
|
|
|
},
|