feat(dormitory): 添加宿舍管理系统相关接口和组件
- 新增宿舍审批管理模块,包括申请、审核、合同等流程功能 - 新增宿舍床铺管理模块,支持床位分配、上下铺设置、充电口配置 - 新增宿舍楼栋管理模块,支持楼栋信息维护和状态管理 - 新增宿舍楼层管理模块,支持楼层信息维护和排序功能 - 新增宿舍房间记录管理模块,支持房间基本信息和设施配置 - 新增商城用户管理模块,完善用户信息和权限管理 - 新增学生选择器组件,支持双击选择和单选操作 - 新增宿舍仪表盘搜索组件,集成字段扩展、字典管理等快捷入口 - 新增小程序编辑组件,支持Logo上传、域名配置、SEO设置等功能
This commit is contained in:
106
src/api/dormitory/dormitoryApply/index.ts
Normal file
106
src/api/dormitory/dormitoryApply/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DormitoryApply, DormitoryApplyParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询审批管理
|
||||
*/
|
||||
export async function pageDormitoryApply(params: DormitoryApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DormitoryApply>>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-apply/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询审批管理列表
|
||||
*/
|
||||
export async function listDormitoryApply(params?: DormitoryApplyParam) {
|
||||
const res = await request.get<ApiResult<DormitoryApply[]>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-apply',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加审批管理
|
||||
*/
|
||||
export async function addDormitoryApply(data: DormitoryApply) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改审批管理
|
||||
*/
|
||||
export async function updateDormitoryApply(data: DormitoryApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除审批管理
|
||||
*/
|
||||
export async function removeDormitoryApply(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除审批管理
|
||||
*/
|
||||
export async function removeBatchDormitoryApply(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询审批管理
|
||||
*/
|
||||
export async function getDormitoryApply(id: number) {
|
||||
const res = await request.get<ApiResult<DormitoryApply>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
src/api/dormitory/dormitoryApply/model/index.ts
Normal file
57
src/api/dormitory/dormitoryApply/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 审批管理
|
||||
*/
|
||||
export interface DormitoryApply {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 类型
|
||||
type?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 手机号
|
||||
mobile?: string;
|
||||
// 客户名称
|
||||
dealerName?: string;
|
||||
// 客户编号
|
||||
dealerCode?: string;
|
||||
// 详细地址
|
||||
address?: string;
|
||||
// 签约价格
|
||||
money?: string;
|
||||
// 推荐人用户ID
|
||||
refereeId?: number;
|
||||
// 申请方式(10需后台审核 20无需审核)
|
||||
applyType?: number;
|
||||
// 审核状态 (10待审核 20审核通过 30驳回)
|
||||
applyStatus?: number;
|
||||
// 申请时间
|
||||
applyTime?: string;
|
||||
// 审核时间
|
||||
auditTime?: string;
|
||||
// 合同时间
|
||||
contractTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 驳回原因
|
||||
rejectReason?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批管理搜索条件
|
||||
*/
|
||||
export interface DormitoryApplyParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/dormitory/dormitoryBed/index.ts
Normal file
106
src/api/dormitory/dormitoryBed/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DormitoryBed, DormitoryBedParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询宿舍床铺
|
||||
*/
|
||||
export async function pageDormitoryBed(params: DormitoryBedParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DormitoryBed>>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-bed/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询宿舍床铺列表
|
||||
*/
|
||||
export async function listDormitoryBed(params?: DormitoryBedParam) {
|
||||
const res = await request.get<ApiResult<DormitoryBed[]>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-bed',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加宿舍床铺
|
||||
*/
|
||||
export async function addDormitoryBed(data: DormitoryBed) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-bed',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍床铺
|
||||
*/
|
||||
export async function updateDormitoryBed(data: DormitoryBed) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-bed',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除宿舍床铺
|
||||
*/
|
||||
export async function removeDormitoryBed(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-bed/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除宿舍床铺
|
||||
*/
|
||||
export async function removeBatchDormitoryBed(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-bed/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询宿舍床铺
|
||||
*/
|
||||
export async function getDormitoryBed(id: number) {
|
||||
const res = await request.get<ApiResult<DormitoryBed>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-bed/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
src/api/dormitory/dormitoryBed/model/index.ts
Normal file
55
src/api/dormitory/dormitoryBed/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 宿舍床铺
|
||||
*/
|
||||
export interface DormitoryBed {
|
||||
// ID
|
||||
id?: number;
|
||||
// 宿舍名称
|
||||
name?: string;
|
||||
// 编号
|
||||
code?: string;
|
||||
// 楼栋ID
|
||||
buildingId?: number;
|
||||
// 楼栋名称
|
||||
buildingName?: string;
|
||||
// 楼层ID
|
||||
floorId?: number;
|
||||
// 楼层名称
|
||||
floorName?: string;
|
||||
// 房间ID
|
||||
recordId?: number;
|
||||
// 房间名称
|
||||
recordName?: string;
|
||||
// 上下铺 1下铺 2上铺 0无
|
||||
bunk?: number;
|
||||
// 充电口
|
||||
chargingPort?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1报修
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍床铺搜索条件
|
||||
*/
|
||||
export interface DormitoryBedParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/dormitory/dormitoryBuilding/index.ts
Normal file
106
src/api/dormitory/dormitoryBuilding/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DormitoryBuilding, DormitoryBuildingParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询宿舍楼栋
|
||||
*/
|
||||
export async function pageDormitoryBuilding(params: DormitoryBuildingParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DormitoryBuilding>>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-building/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询宿舍楼栋列表
|
||||
*/
|
||||
export async function listDormitoryBuilding(params?: DormitoryBuildingParam) {
|
||||
const res = await request.get<ApiResult<DormitoryBuilding[]>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-building',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加宿舍楼栋
|
||||
*/
|
||||
export async function addDormitoryBuilding(data: DormitoryBuilding) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-building',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍楼栋
|
||||
*/
|
||||
export async function updateDormitoryBuilding(data: DormitoryBuilding) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-building',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除宿舍楼栋
|
||||
*/
|
||||
export async function removeDormitoryBuilding(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-building/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除宿舍楼栋
|
||||
*/
|
||||
export async function removeBatchDormitoryBuilding(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-building/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询宿舍楼栋
|
||||
*/
|
||||
export async function getDormitoryBuilding(id: number) {
|
||||
const res = await request.get<ApiResult<DormitoryBuilding>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-building/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/dormitory/dormitoryBuilding/model/index.ts
Normal file
31
src/api/dormitory/dormitoryBuilding/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 宿舍楼栋
|
||||
*/
|
||||
export interface DormitoryBuilding {
|
||||
// ID
|
||||
id?: number;
|
||||
// 楼栋名称
|
||||
name?: string;
|
||||
// 楼栋编号
|
||||
code?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍楼栋搜索条件
|
||||
*/
|
||||
export interface DormitoryBuildingParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/dormitory/dormitoryFloor/index.ts
Normal file
106
src/api/dormitory/dormitoryFloor/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DormitoryFloor, DormitoryFloorParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询宿舍楼层
|
||||
*/
|
||||
export async function pageDormitoryFloor(params: DormitoryFloorParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DormitoryFloor>>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-floor/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询宿舍楼层列表
|
||||
*/
|
||||
export async function listDormitoryFloor(params?: DormitoryFloorParam) {
|
||||
const res = await request.get<ApiResult<DormitoryFloor[]>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-floor',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加宿舍楼层
|
||||
*/
|
||||
export async function addDormitoryFloor(data: DormitoryFloor) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-floor',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍楼层
|
||||
*/
|
||||
export async function updateDormitoryFloor(data: DormitoryFloor) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-floor',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除宿舍楼层
|
||||
*/
|
||||
export async function removeDormitoryFloor(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-floor/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除宿舍楼层
|
||||
*/
|
||||
export async function removeBatchDormitoryFloor(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-floor/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询宿舍楼层
|
||||
*/
|
||||
export async function getDormitoryFloor(id: number) {
|
||||
const res = await request.get<ApiResult<DormitoryFloor>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-floor/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/dormitory/dormitoryFloor/model/index.ts
Normal file
35
src/api/dormitory/dormitoryFloor/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 宿舍楼层
|
||||
*/
|
||||
export interface DormitoryFloor {
|
||||
// ID
|
||||
id?: number;
|
||||
// 楼层
|
||||
name?: string;
|
||||
// 编号
|
||||
code?: string;
|
||||
// 楼栋ID
|
||||
buildingId?: number;
|
||||
// 楼栋名称
|
||||
buildingName?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍楼层搜索条件
|
||||
*/
|
||||
export interface DormitoryFloorParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/dormitory/dormitoryRecord/index.ts
Normal file
106
src/api/dormitory/dormitoryRecord/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DormitoryRecord, DormitoryRecordParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询宿舍记录
|
||||
*/
|
||||
export async function pageDormitoryRecord(params: DormitoryRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DormitoryRecord>>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-record/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询宿舍记录列表
|
||||
*/
|
||||
export async function listDormitoryRecord(params?: DormitoryRecordParam) {
|
||||
const res = await request.get<ApiResult<DormitoryRecord[]>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-record',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加宿舍记录
|
||||
*/
|
||||
export async function addDormitoryRecord(data: DormitoryRecord) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宿舍记录
|
||||
*/
|
||||
export async function updateDormitoryRecord(data: DormitoryRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除宿舍记录
|
||||
*/
|
||||
export async function removeDormitoryRecord(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-record/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除宿舍记录
|
||||
*/
|
||||
export async function removeBatchDormitoryRecord(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-record/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询宿舍记录
|
||||
*/
|
||||
export async function getDormitoryRecord(id: number) {
|
||||
const res = await request.get<ApiResult<DormitoryRecord>>(
|
||||
MODULES_API_URL + '/dormitory/dormitory-record/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/dormitory/dormitoryRecord/model/index.ts
Normal file
43
src/api/dormitory/dormitoryRecord/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 宿舍记录
|
||||
*/
|
||||
export interface DormitoryRecord {
|
||||
// ID
|
||||
id?: number;
|
||||
// 宿舍名称
|
||||
name?: string;
|
||||
// 编号
|
||||
code?: string;
|
||||
// 楼栋ID
|
||||
buildingId?: number;
|
||||
// 楼栋名称
|
||||
buildingName?: string;
|
||||
// 楼层ID
|
||||
floorId?: number;
|
||||
// 楼层名称
|
||||
floorName?: string;
|
||||
// 床铺数
|
||||
beds?: number;
|
||||
// 独立卫生间
|
||||
toilet?: boolean;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍记录搜索条件
|
||||
*/
|
||||
export interface DormitoryRecordParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/shopUser/index.ts
Normal file
106
src/api/shop/shopUser/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopUser, ShopUserParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询用户记录表
|
||||
*/
|
||||
export async function pageShopUser(params: ShopUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopUser>>>(
|
||||
MODULES_API_URL + '/shop/shop-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户记录表列表
|
||||
*/
|
||||
export async function listShopUser(params?: ShopUserParam) {
|
||||
const res = await request.get<ApiResult<ShopUser[]>>(
|
||||
MODULES_API_URL + '/shop/shop-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户记录表
|
||||
*/
|
||||
export async function addShopUser(data: ShopUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户记录表
|
||||
*/
|
||||
export async function updateShopUser(data: ShopUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户记录表
|
||||
*/
|
||||
export async function removeShopUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户记录表
|
||||
*/
|
||||
export async function removeBatchShopUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户记录表
|
||||
*/
|
||||
export async function getShopUser(id: number) {
|
||||
const res = await request.get<ApiResult<ShopUser>>(
|
||||
MODULES_API_URL + '/shop/shop-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
163
src/api/shop/shopUser/model/index.ts
Normal file
163
src/api/shop/shopUser/model/index.ts
Normal file
@@ -0,0 +1,163 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户记录表
|
||||
*/
|
||||
export interface ShopUser {
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 用户类型 0个人用户 1企业用户 2其他
|
||||
type?: number;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 性别 1男 2女
|
||||
sex?: number;
|
||||
// 职务
|
||||
position?: string;
|
||||
// 注册来源客户端 (APP、H5、MP-WEIXIN等)
|
||||
platform?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 邮箱是否验证, 0否, 1是
|
||||
emailVerified?: number;
|
||||
// 别名
|
||||
alias?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 证件号码
|
||||
idCard?: string;
|
||||
// 出生日期
|
||||
birthday?: string;
|
||||
// 所在国家
|
||||
country?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 街道地址
|
||||
address?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 用户可用余额
|
||||
balance?: string;
|
||||
// 已提现金额
|
||||
cashedMoney?: string;
|
||||
// 用户可用积分
|
||||
points?: number;
|
||||
// 用户总支付的金额
|
||||
payMoney?: string;
|
||||
// 实际消费的金额(不含退款)
|
||||
expendMoney?: string;
|
||||
// 密码
|
||||
payPassword?: string;
|
||||
// 会员等级ID
|
||||
gradeId?: number;
|
||||
// 行业分类
|
||||
category?: string;
|
||||
// 个人简介
|
||||
introduction?: string;
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 会员分组ID
|
||||
groupId?: number;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 背景图
|
||||
bgImage?: string;
|
||||
// 用户编码
|
||||
userCode?: string;
|
||||
// 是否已实名认证
|
||||
certification?: number;
|
||||
// 年龄
|
||||
age?: number;
|
||||
// 是否线下会员
|
||||
offline?: string;
|
||||
// 关注数
|
||||
followers?: number;
|
||||
// 粉丝数
|
||||
fans?: number;
|
||||
// 点赞数
|
||||
likes?: number;
|
||||
// 评论数
|
||||
commentNumbers?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 微信openid
|
||||
openid?: string;
|
||||
// 微信公众号openid
|
||||
officeOpenid?: string;
|
||||
// 微信unionID
|
||||
unionid?: string;
|
||||
// 客户端ID
|
||||
clientId?: string;
|
||||
// 不允许办卡
|
||||
notAllowVip?: string;
|
||||
// 是否管理员
|
||||
isAdmin?: string;
|
||||
// 是否企业管理员
|
||||
isOrganizationAdmin?: string;
|
||||
// 累计登录次数
|
||||
loginNum?: number;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 可管理的场馆
|
||||
merchants?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户头像
|
||||
merchantAvatar?: string;
|
||||
// 第三方系统的用户ID
|
||||
uid?: number;
|
||||
// 专家角色
|
||||
expertType?: string;
|
||||
// 过期时间
|
||||
expireTime?: number;
|
||||
// 最后结算时间
|
||||
settlementTime?: string;
|
||||
// 资质
|
||||
aptitude?: string;
|
||||
// 行业类型(父级)
|
||||
industryParent?: string;
|
||||
// 行业类型(子级)
|
||||
industryChild?: string;
|
||||
// 头衔
|
||||
title?: string;
|
||||
// 安装的产品ID
|
||||
templateId?: number;
|
||||
// 插件安装状态(仅对超超管判断) 0未安装 1已安装
|
||||
installed?: number;
|
||||
// 特长
|
||||
speciality?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0在线, 1离线
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户记录表搜索条件
|
||||
*/
|
||||
export interface ShopUserParam extends PageParam {
|
||||
userId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user