From 2d561150b91a9789d31678af14dd4840bbb56576 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期三, 29 三月 2023 16:37:27 +0800 Subject: [PATCH] 设备、场所、部门接口 --- src/views/system/user/index.vue | 63 ++++++++++--------------------- 1 files changed, 21 insertions(+), 42 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index a892e9c..8bd5f91 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -2,14 +2,13 @@ <div class="system-user-container"> <el-card shadow="hover"> <div class="system-user-search mb15"> - <el-input size="default" v-model.trim="userTableData.listQuery.searchParams.username" placeholder="请输入用户名" style="max-width: 180px"> </el-input> - <el-input size="default" v-model.trim="userTableData.listQuery.searchParams.realName" placeholder="请输入真实姓名" style="max-width: 180px; margin-left: 10px"> </el-input> - <el-button size="default" type="primary" class="ml10" @click="initUserTableData"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> +<!-- <el-input size="default" v-model.trim="userTableData.listQuery.roleId" placeholder="请输入用户名" style="max-width: 180px"> </el-input>--> +<!-- <el-button size="default" type="primary" class="ml10" @click="initUserTableData">--> +<!-- <el-icon>--> +<!-- <ele-Search />--> +<!-- </el-icon>--> +<!-- 查询--> +<!-- </el-button>--> <el-button size="default" type="success" class="ml10" @click="onOpenUserDialog('新增', '')"> <el-icon> <ele-FolderAdd /> @@ -25,14 +24,14 @@ <el-table-column prop="role.name" label="关联角色" show-overflow-tooltip></el-table-column> <el-table-column prop="department.name" label="部门" show-overflow-tooltip></el-table-column> <el-table-column prop="phone" label="手机号" show-overflow-tooltip></el-table-column> - <el-table-column prop="email" label="邮箱" show-overflow-tooltip></el-table-column> - <el-table-column prop="status" label="用户状态" show-overflow-tooltip> - <template #default="scope"> - <el-tag type="success" v-if="scope.row.status">启用</el-tag> - <el-tag type="info" v-else>禁用</el-tag> - </template> - </el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> +<!-- <el-table-column prop="email" label="邮箱" show-overflow-tooltip></el-table-column>--> +<!-- <el-table-column prop="status" label="用户状态" show-overflow-tooltip>--> +<!-- <template #default="scope">--> +<!-- <el-tag type="success" v-if="scope.row.status">启用</el-tag>--> +<!-- <el-tag type="info" v-else>禁用</el-tag>--> +<!-- </template>--> +<!-- </el-table-column>--> +<!-- <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column>--> <el-table-column label="操作" width="100"> <template #default="scope"> <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenUserDialog('修改', scope.row)">修改</el-button> @@ -79,10 +78,8 @@ total: number; loading: boolean; listQuery: { - searchParams: { - username: string | null; - realName: string | null; - }; + roleId: number | null; + usePage: boolean; pageIndex: number; pageSize: number; }; @@ -102,10 +99,8 @@ total: 0, loading: false, listQuery: { - searchParams: { - username: null, - realName: null - }, + roleId: 1, + usePage: false, pageIndex: 1, pageSize: 10 } @@ -116,7 +111,7 @@ // 初始化表格数据 const initUserTableData = async () => { let res = await userApi().getUserList(state.userTableData.listQuery); - if (res.data.code === '200') { + if (res.data.code === 100) { state.userTableData.data = res.data.data; state.userTableData.total = res.data.total; } else { @@ -127,21 +122,10 @@ } }; - const getDepartmentData = async () => { - let res = await departmentApi().getDepartmentList(); - if (res.data.code === '200') { - state.departmentList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; const getRoleData = async () => { let res = await useRoleApi().getRoleList(); - if (res.data.code === '200') { + if (res.data.code === 100) { state.roleList = res.data.data; } else { ElMessage({ @@ -193,12 +177,7 @@ }; // 页面加载时 onMounted(() => { - let a = { name: 1, c: { name: 1 } }; - let b = Object.assign({}, a); - b.c.name = 2; - console.log(a.c.name); initUserTableData(); - getDepartmentData(); getRoleData(); }); return { -- Gitblit v1.9.2