feat(dormitory): 添加宿舍管理系统相关接口和组件
- 新增宿舍审批管理模块,包括申请、审核、合同等流程功能 - 新增宿舍床铺管理模块,支持床位分配、上下铺设置、充电口配置 - 新增宿舍楼栋管理模块,支持楼栋信息维护和状态管理 - 新增宿舍楼层管理模块,支持楼层信息维护和排序功能 - 新增宿舍房间记录管理模块,支持房间基本信息和设施配置 - 新增商城用户管理模块,完善用户信息和权限管理 - 新增学生选择器组件,支持双击选择和单选操作 - 新增宿舍仪表盘搜索组件,集成字段扩展、字典管理等快捷入口 - 新增小程序编辑组件,支持Logo上传、域名配置、SEO设置等功能
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
<p class="ele-text-secondary">{{ siteStore.description }}</p>
|
||||
<a-space>
|
||||
<a-tag color="green">{{ siteStore.statusText }}</a-tag>
|
||||
<a-tag color="blue">{{ siteStore.version }}</a-tag>
|
||||
<a-popover title="小程序码">
|
||||
<a-tag color="blue" v-if="siteStore.version">{{ siteStore.version }}</a-tag>
|
||||
<a-popover title="小程序码" v-if="siteStore.mpQrCode">
|
||||
<template #content>
|
||||
<p><img :src="siteStore.mpQrCode" alt="小程序码" width="300" height="300"></p>
|
||||
</template>
|
||||
|
||||
@@ -142,14 +142,13 @@ import {toDateString} from 'ele-admin-pro';
|
||||
import { utils, writeFile } from 'xlsx';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
pageUsers,
|
||||
removeUser,
|
||||
removeUsers,
|
||||
updateUserPassword,
|
||||
updateUser,
|
||||
listUsers
|
||||
} from '@/api/system/user';
|
||||
import type {User, UserParam} from '@/api/system/user/model';
|
||||
pageShopUser,
|
||||
removeShopUser,
|
||||
removeBatchShopUser,
|
||||
updateShopUser,
|
||||
listShopUser
|
||||
} from '@/api/shop/shopUser';
|
||||
import type {ShopUser, ShopUserParam} from '@/api/shop/shopUser/model';
|
||||
import {toTreeData, uuid} from 'ele-admin-pro';
|
||||
import {listRoles} from '@/api/system/role';
|
||||
import {listOrganizations} from '@/api/system/organization';
|
||||
@@ -167,9 +166,9 @@ const expandedRowKeys = ref<number[]>([]);
|
||||
// 树选中的key
|
||||
const selectedRowKeys = ref<number[]>([]);
|
||||
// 表格选中数据
|
||||
const selection = ref<User[]>([]);
|
||||
const selection = ref<ShopUser[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<User | null>(null);
|
||||
const current = ref<ShopUser | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示用户详情
|
||||
@@ -326,24 +325,23 @@ const datasource: DatasourceFunction = ({
|
||||
where = {};
|
||||
where.roleId = filters.roles;
|
||||
where.keywords = searchText.value;
|
||||
where.isAdmin = 0;
|
||||
return pageUsers({page, limit, ...where, ...orders});
|
||||
return pageShopUser({page, limit, ...where, ...orders});
|
||||
};
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: UserParam) => {
|
||||
const reload = (where?: ShopUserParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({where});
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: User) => {
|
||||
const openEdit = (row?: ShopUser) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开用户详情弹窗 */
|
||||
const openInfo = (row?: User) => {
|
||||
const openInfo = (row?: ShopUser) => {
|
||||
current.value = row ?? null;
|
||||
showInfo.value = true;
|
||||
};
|
||||
@@ -368,8 +366,6 @@ const exportData = async () => {
|
||||
'手机号',
|
||||
'邮箱',
|
||||
'性别',
|
||||
'所属部门',
|
||||
'角色',
|
||||
'状态',
|
||||
'注册时间'
|
||||
]
|
||||
@@ -382,7 +378,7 @@ const exportData = async () => {
|
||||
};
|
||||
|
||||
// 获取用户列表数据
|
||||
const list = await listUsers(params);
|
||||
const list = await listShopUser(params);
|
||||
|
||||
if (!list || list.length === 0) {
|
||||
message.warning('没有数据可以导出');
|
||||
@@ -391,7 +387,7 @@ const exportData = async () => {
|
||||
}
|
||||
|
||||
// 将数据转换为Excel行
|
||||
list.forEach((user: User) => {
|
||||
list.forEach((user: ShopUser) => {
|
||||
array.push([
|
||||
`${user.userId || ''}`,
|
||||
`${user.username || ''}`,
|
||||
@@ -399,9 +395,7 @@ const exportData = async () => {
|
||||
`${user.realName || ''}`,
|
||||
`${user.phone || ''}`,
|
||||
`${user.email || ''}`,
|
||||
`${user.sexName || ''}`,
|
||||
`${user.organizationName || ''}`,
|
||||
`${user.roles?.map(r => r.roleName).join(',') || ''}`,
|
||||
`${user.sex == 1 ? '男' : '女'}`,
|
||||
`${user.status === 0 ? '正常' : '冻结'}`,
|
||||
`${user.createTime || ''}`
|
||||
]);
|
||||
@@ -452,9 +446,9 @@ const handleTabs = (e) => {
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: User) => {
|
||||
const remove = (row: ShopUser) => {
|
||||
const hide = messageLoading('请求中..', 0);
|
||||
removeUser(row.userId)
|
||||
removeShopUser(row.userId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
@@ -479,7 +473,7 @@ const removeBatch = () => {
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = messageLoading('请求中..', 0);
|
||||
removeUsers(selection.value.map((d) => d.userId))
|
||||
removeShopUser(selection.value.map((d) => d.userId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
@@ -494,7 +488,7 @@ const removeBatch = () => {
|
||||
};
|
||||
|
||||
/* 重置用户密码 */
|
||||
const resetPsw = (row: User) => {
|
||||
const resetPsw = (row: ShopUser) => {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要重置此用户的密码吗?',
|
||||
@@ -503,7 +497,10 @@ const resetPsw = (row: User) => {
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
const password = uuid(8);
|
||||
updateUserPassword(row.userId, password)
|
||||
updateShopUser({
|
||||
...row,
|
||||
password: password
|
||||
})
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg + ',新密码:' + password);
|
||||
@@ -517,9 +514,8 @@ const resetPsw = (row: User) => {
|
||||
};
|
||||
|
||||
/* 修改用户状态 */
|
||||
const updateIsAdmin = (row: User) => {
|
||||
row.isAdmin = !row.isAdmin;
|
||||
updateUser(row)
|
||||
const updateIsAdmin = (row: ShopUser) => {
|
||||
updateShopUser(row)
|
||||
.then((msg) => {
|
||||
message.success(msg);
|
||||
})
|
||||
@@ -529,7 +525,7 @@ const updateIsAdmin = (row: User) => {
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: User) => {
|
||||
const customRow = (record: ShopUser) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
@@ -560,7 +556,7 @@ watch(
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'SystemAdmin'
|
||||
name: 'ShopUser'
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user