初始化
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Card, CardParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员卡
|
||||
*/
|
||||
export async function pageCard(params: CardParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Card>>>(
|
||||
MODULES_API_URL + '/booking/card/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡列表
|
||||
*/
|
||||
export async function listCard(params?: CardParam) {
|
||||
const res = await request.get<ApiResult<Card[]>>(
|
||||
MODULES_API_URL + '/booking/card',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡
|
||||
*/
|
||||
export async function addCard(data: Card) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡
|
||||
*/
|
||||
export async function updateCard(data: Card) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡
|
||||
*/
|
||||
export async function removeCard(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡
|
||||
*/
|
||||
export async function removeBatchCard(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡
|
||||
*/
|
||||
export async function getCard(id: number) {
|
||||
const res = await request.get<ApiResult<Card>>(
|
||||
MODULES_API_URL + '/booking/card/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡
|
||||
*/
|
||||
export interface Card {
|
||||
// ID
|
||||
cardId?: number;
|
||||
// 会员卡名称
|
||||
cardName?: string;
|
||||
// 会员卡标识
|
||||
cardCode?: string;
|
||||
// 会员卡图片
|
||||
image?: string;
|
||||
// 价格
|
||||
price?: number;
|
||||
// 次数
|
||||
number?: number;
|
||||
// 月份
|
||||
month?: number;
|
||||
// 折扣
|
||||
discount?: number;
|
||||
// 老师介绍
|
||||
content?: string;
|
||||
// 关联用户
|
||||
userId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户类型
|
||||
merchantType?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡搜索条件
|
||||
*/
|
||||
export interface CardParam extends PageParam {
|
||||
cardId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CardPlan, CardPlanParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员卡类型
|
||||
*/
|
||||
export async function pageCardPlan(params: CardPlanParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CardPlan>>>(
|
||||
MODULES_API_URL + '/booking/card-plan/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡类型列表
|
||||
*/
|
||||
export async function listCardPlan(params?: CardPlanParam) {
|
||||
const res = await request.get<ApiResult<CardPlan[]>>(
|
||||
MODULES_API_URL + '/booking/card-plan',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡类型
|
||||
*/
|
||||
export async function addCardPlan(data: CardPlan) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card-plan',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡类型
|
||||
*/
|
||||
export async function updateCardPlan(data: CardPlan) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card-plan',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡类型
|
||||
*/
|
||||
export async function removeCardPlan(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card-plan/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡类型
|
||||
*/
|
||||
export async function removeBatchCardPlan(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card-plan/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡类型
|
||||
*/
|
||||
export async function getCardPlan(id: number) {
|
||||
const res = await request.get<ApiResult<CardPlan>>(
|
||||
MODULES_API_URL + '/booking/card-plan/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡类型
|
||||
*/
|
||||
export interface CardPlan {
|
||||
// ID
|
||||
cardPlanId?: number;
|
||||
// 会员卡名称
|
||||
name?: string;
|
||||
// 标识
|
||||
code?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡类型搜索条件
|
||||
*/
|
||||
export interface CardPlanParam extends PageParam {
|
||||
cardPlanId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Category, CategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程分类
|
||||
*/
|
||||
export async function pageCategory(params: CategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Category>>>(
|
||||
MODULES_API_URL + '/booking/category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程分类列表
|
||||
*/
|
||||
export async function listCategory(params?: CategoryParam) {
|
||||
const res = await request.get<ApiResult<Category[]>>(
|
||||
MODULES_API_URL + '/booking/category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程分类
|
||||
*/
|
||||
export async function addCategory(data: Category) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程分类
|
||||
*/
|
||||
export async function updateCategory(data: Category) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程分类
|
||||
*/
|
||||
export async function removeCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程分类
|
||||
*/
|
||||
export async function removeBatchCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程分类
|
||||
*/
|
||||
export async function getCategory(id: number) {
|
||||
const res = await request.get<ApiResult<Category>>(
|
||||
MODULES_API_URL + '/booking/category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程分类
|
||||
*/
|
||||
export interface Category {
|
||||
// 商品分类ID
|
||||
categoryId?: number;
|
||||
// 分类标识
|
||||
categoryCode?: string;
|
||||
// 分类名称
|
||||
title?: string;
|
||||
// 类型 0列表 1单页 2外链
|
||||
type?: number;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 路由/链接地址
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 绑定的页面
|
||||
pageId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 商品数量
|
||||
count?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程分类搜索条件
|
||||
*/
|
||||
export interface CategoryParam extends PageParam {
|
||||
categoryId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Cooperate, CooperateParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商务合作
|
||||
*/
|
||||
export async function pageCooperate(params: CooperateParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Cooperate>>>(
|
||||
MODULES_API_URL + '/booking/cooperate/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商务合作列表
|
||||
*/
|
||||
export async function listCooperate(params?: CooperateParam) {
|
||||
const res = await request.get<ApiResult<Cooperate[]>>(
|
||||
MODULES_API_URL + '/booking/cooperate',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商务合作
|
||||
*/
|
||||
export async function addCooperate(data: Cooperate) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商务合作
|
||||
*/
|
||||
export async function updateCooperate(data: Cooperate) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商务合作
|
||||
*/
|
||||
export async function removeCooperate(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商务合作
|
||||
*/
|
||||
export async function removeBatchCooperate(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商务合作
|
||||
*/
|
||||
export async function getCooperate(id: number) {
|
||||
const res = await request.get<ApiResult<Cooperate>>(
|
||||
MODULES_API_URL + '/booking/cooperate/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商务合作
|
||||
*/
|
||||
export interface Cooperate {
|
||||
// ID
|
||||
cooperateId?: number;
|
||||
// 部门名称
|
||||
name?: string;
|
||||
// 咨询电话
|
||||
phone?: string;
|
||||
// 图片
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商务合作搜索条件
|
||||
*/
|
||||
export interface CooperateParam extends PageParam {
|
||||
cooperateId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CooperateLog, CooperateLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商务合作留言记录
|
||||
*/
|
||||
export async function pageCooperateLog(params: CooperateLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CooperateLog>>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商务合作留言记录列表
|
||||
*/
|
||||
export async function listCooperateLog(params?: CooperateLogParam) {
|
||||
const res = await request.get<ApiResult<CooperateLog[]>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商务合作留言记录
|
||||
*/
|
||||
export async function addCooperateLog(data: CooperateLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商务合作留言记录
|
||||
*/
|
||||
export async function updateCooperateLog(data: CooperateLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商务合作留言记录
|
||||
*/
|
||||
export async function removeCooperateLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商务合作留言记录
|
||||
*/
|
||||
export async function removeBatchCooperateLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商务合作留言记录
|
||||
*/
|
||||
export async function getCooperateLog(id: number) {
|
||||
const res = await request.get<ApiResult<CooperateLog>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商务合作留言记录
|
||||
*/
|
||||
export interface CooperateLog {
|
||||
// ID
|
||||
logId?: number;
|
||||
// 关联ID
|
||||
cooperateId?: number;
|
||||
// 部门名称
|
||||
name?: string;
|
||||
// 咨询电话
|
||||
phone?: string;
|
||||
// 图片
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商务合作留言记录搜索条件
|
||||
*/
|
||||
export interface CooperateLogParam extends PageParam {
|
||||
logId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Coupon, CouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询我的优惠券
|
||||
*/
|
||||
export async function pageCoupon(params: CouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Coupon>>>(
|
||||
MODULES_API_URL + '/booking/coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的优惠券列表
|
||||
*/
|
||||
export async function listCoupon(params?: CouponParam) {
|
||||
const res = await request.get<ApiResult<Coupon[]>>(
|
||||
MODULES_API_URL + '/booking/coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加我的优惠券
|
||||
*/
|
||||
export async function addCoupon(data: Coupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改我的优惠券
|
||||
*/
|
||||
export async function updateCoupon(data: Coupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除我的优惠券
|
||||
*/
|
||||
export async function removeCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除我的优惠券
|
||||
*/
|
||||
export async function removeBatchCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询我的优惠券
|
||||
*/
|
||||
export async function getCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<Coupon>>(
|
||||
MODULES_API_URL + '/booking/coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 我的优惠券
|
||||
*/
|
||||
export interface Coupon {
|
||||
// id
|
||||
id?: number;
|
||||
// 优惠劵id
|
||||
couponId?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券类型(10满减券 20折扣券)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 到期类型(10领取后生效 20固定时间)
|
||||
expireType?: number;
|
||||
// 领取后生效-有效天数
|
||||
expireDay?: number;
|
||||
// 有效期开始时间
|
||||
startTime?: string;
|
||||
// 有效期结束时间
|
||||
endTime?: string;
|
||||
// 适用范围(10全部商品 20指定商品)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 是否过期(0未过期 1已过期)
|
||||
isExpire?: number;
|
||||
// 是否已使用(0未使用 1已使用)
|
||||
isUse?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的优惠券搜索条件
|
||||
*/
|
||||
export interface CouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Course, CourseParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程管理
|
||||
*/
|
||||
export async function pageCourse(params: CourseParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Course>>>(
|
||||
MODULES_API_URL + '/booking/course/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程管理列表
|
||||
*/
|
||||
export async function listCourse(params?: CourseParam) {
|
||||
const res = await request.get<ApiResult<Course[]>>(
|
||||
MODULES_API_URL + '/booking/course',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程管理
|
||||
*/
|
||||
export async function addCourse(data: Course) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程管理
|
||||
*/
|
||||
export async function updateCourse(data: Course) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程管理
|
||||
*/
|
||||
export async function removeCourse(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程管理
|
||||
*/
|
||||
export async function removeBatchCourse(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程管理
|
||||
*/
|
||||
export async function getCourse(id: number) {
|
||||
const res = await request.get<ApiResult<Course>>(
|
||||
MODULES_API_URL + '/booking/course/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程管理
|
||||
*/
|
||||
export interface Course {
|
||||
// ID
|
||||
lessonId?: number;
|
||||
// 课程名称
|
||||
lessonName?: string;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 分类ID
|
||||
categoryId?: number;
|
||||
// 课程价格
|
||||
price?: string;
|
||||
// 老师ID
|
||||
teacherId?: number;
|
||||
// 上课时间
|
||||
startTime?: string;
|
||||
// 课时
|
||||
classPeriod?: number;
|
||||
// 报名人数上限
|
||||
maxNumber?: number;
|
||||
// 上课地点
|
||||
address?: string;
|
||||
// 详细介绍
|
||||
content?: string;
|
||||
// 课程相册
|
||||
files?: string;
|
||||
// 年龄限制
|
||||
ageLimit?: string;
|
||||
// 报名时间
|
||||
bmTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程管理搜索条件
|
||||
*/
|
||||
export interface CourseParam extends PageParam {
|
||||
lessonId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CourseCategory, CourseCategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程分类
|
||||
*/
|
||||
export async function pageCourseCategory(params: CourseCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CourseCategory>>>(
|
||||
MODULES_API_URL + '/booking/course-category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程分类列表
|
||||
*/
|
||||
export async function listCourseCategory(params?: CourseCategoryParam) {
|
||||
const res = await request.get<ApiResult<CourseCategory[]>>(
|
||||
MODULES_API_URL + '/booking/course-category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程分类
|
||||
*/
|
||||
export async function addCourseCategory(data: CourseCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程分类
|
||||
*/
|
||||
export async function updateCourseCategory(data: CourseCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程分类
|
||||
*/
|
||||
export async function removeCourseCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course-category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程分类
|
||||
*/
|
||||
export async function removeBatchCourseCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course-category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程分类
|
||||
*/
|
||||
export async function getCourseCategory(id: number) {
|
||||
const res = await request.get<ApiResult<CourseCategory>>(
|
||||
MODULES_API_URL + '/booking/course-category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程分类
|
||||
*/
|
||||
export interface CourseCategory {
|
||||
// 商品分类ID
|
||||
id?: number;
|
||||
// 分类名称
|
||||
name?: string;
|
||||
// 分类标识
|
||||
code?: string;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程分类搜索条件
|
||||
*/
|
||||
export interface CourseCategoryParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Emergency, EmergencyParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询紧急联系人管理
|
||||
*/
|
||||
export async function pageEmergency(params: EmergencyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Emergency>>>(
|
||||
MODULES_API_URL + '/booking/emergency/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询紧急联系人管理列表
|
||||
*/
|
||||
export async function listEmergency(params?: EmergencyParam) {
|
||||
const res = await request.get<ApiResult<Emergency[]>>(
|
||||
MODULES_API_URL + '/booking/emergency',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加紧急联系人管理
|
||||
*/
|
||||
export async function addEmergency(data: Emergency) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/emergency',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改紧急联系人管理
|
||||
*/
|
||||
export async function updateEmergency(data: Emergency) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/emergency',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除紧急联系人管理
|
||||
*/
|
||||
export async function removeEmergency(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/emergency/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除紧急联系人管理
|
||||
*/
|
||||
export async function removeBatchEmergency(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/emergency/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询紧急联系人管理
|
||||
*/
|
||||
export async function getEmergency(id: number) {
|
||||
const res = await request.get<ApiResult<Emergency>>(
|
||||
MODULES_API_URL + '/booking/emergency/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 紧急联系人管理
|
||||
*/
|
||||
export interface Emergency {
|
||||
// ID
|
||||
emergencyId?: number;
|
||||
// 姓名
|
||||
name?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 关联用户
|
||||
userId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 紧急联系人管理搜索条件
|
||||
*/
|
||||
export interface EmergencyParam extends PageParam {
|
||||
emergencyId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Field, FieldParam } from './model';
|
||||
import type { Order } from '@/api/booking/field/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询场馆场地
|
||||
*/
|
||||
export async function pageField(params: FieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Field>>>(
|
||||
MODULES_API_URL + '/booking/field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场馆场地列表
|
||||
*/
|
||||
export async function listField(params?: FieldParam) {
|
||||
const res = await request.get<ApiResult<Field[]>>(
|
||||
MODULES_API_URL + '/booking/field',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加场馆场地
|
||||
*/
|
||||
export async function addField(data: Field) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场馆场地
|
||||
*/
|
||||
export async function updateField(data: Field) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场馆场地
|
||||
*/
|
||||
export async function removeField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场馆场地
|
||||
*/
|
||||
export async function removeBatchField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/field/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询场馆场地
|
||||
*/
|
||||
export async function getField(id: number) {
|
||||
const res = await request.get<ApiResult<Field>>(
|
||||
MODULES_API_URL + '/booking/field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据orderNo核销订单
|
||||
*/
|
||||
export async function verification(orderNo : string) {
|
||||
const res = await request.get<ApiResult<Order>>(
|
||||
MODULES_API_URL + '/booking/field/verification/' + orderNo
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 场馆场地
|
||||
*/
|
||||
export interface Field {
|
||||
// ID
|
||||
fieldId?: number;
|
||||
// 场地名称
|
||||
fieldName?: string;
|
||||
// 图标
|
||||
image?: string;
|
||||
// 分类ID
|
||||
categoryId?: number;
|
||||
// 关联用户
|
||||
userId?: number;
|
||||
// 老师ID
|
||||
teacherId?: number;
|
||||
// 是否支持半场
|
||||
isHalf?: number;
|
||||
// 可重复订阅数
|
||||
isRepeat?: number;
|
||||
// 是否厕所
|
||||
isToilet?: number;
|
||||
// 是否支持儿童价
|
||||
isChildren?: number;
|
||||
// 显示在第几行
|
||||
row?: number;
|
||||
num?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 上课时间
|
||||
startTime?: string;
|
||||
// 报名人数上限
|
||||
maxNumber?: number;
|
||||
// 上课地点
|
||||
address?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 场地状态
|
||||
isStatus?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 场馆场地搜索条件
|
||||
*/
|
||||
export interface FieldParam extends PageParam {
|
||||
fieldId?: number;
|
||||
fieldName?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Integral, IntegralParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询签到积分
|
||||
*/
|
||||
export async function pageIntegral(params: IntegralParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Integral>>>(
|
||||
MODULES_API_URL + '/booking/integral/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询签到积分列表
|
||||
*/
|
||||
export async function listIntegral(params?: IntegralParam) {
|
||||
const res = await request.get<ApiResult<Integral[]>>(
|
||||
MODULES_API_URL + '/booking/integral',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加签到积分
|
||||
*/
|
||||
export async function addIntegral(data: Integral) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改签到积分
|
||||
*/
|
||||
export async function updateIntegral(data: Integral) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除签到积分
|
||||
*/
|
||||
export async function removeIntegral(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除签到积分
|
||||
*/
|
||||
export async function removeBatchIntegral(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询签到积分
|
||||
*/
|
||||
export async function getIntegral(id: number) {
|
||||
const res = await request.get<ApiResult<Integral>>(
|
||||
MODULES_API_URL + '/booking/integral/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getSignData(params?: IntegralParam) {
|
||||
const res = await request.get<ApiResult<Integral[]>>(
|
||||
MODULES_API_URL + '/booking/integral/getSignData',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 签到积分
|
||||
*/
|
||||
export interface Integral {
|
||||
//
|
||||
id?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 微信昵称
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 获得积分
|
||||
integral?: string;
|
||||
// 日期
|
||||
dateTime?: string;
|
||||
// 天
|
||||
day?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 签到时间
|
||||
createTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到积分搜索条件
|
||||
*/
|
||||
export interface IntegralParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { IntegralLog, IntegralLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询积分明细
|
||||
*/
|
||||
export async function pageIntegralLog(params: IntegralLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<IntegralLog>>>(
|
||||
MODULES_API_URL + '/booking/integral-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询积分明细列表
|
||||
*/
|
||||
export async function listIntegralLog(params?: IntegralLogParam) {
|
||||
const res = await request.get<ApiResult<IntegralLog[]>>(
|
||||
MODULES_API_URL + '/booking/integral-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加积分明细
|
||||
*/
|
||||
export async function addIntegralLog(data: IntegralLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改积分明细
|
||||
*/
|
||||
export async function updateIntegralLog(data: IntegralLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除积分明细
|
||||
*/
|
||||
export async function removeIntegralLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除积分明细
|
||||
*/
|
||||
export async function removeBatchIntegralLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询积分明细
|
||||
*/
|
||||
export async function getIntegralLog(id: number) {
|
||||
const res = await request.get<ApiResult<IntegralLog>>(
|
||||
MODULES_API_URL + '/booking/integral-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 积分明细
|
||||
*/
|
||||
export interface IntegralLog {
|
||||
//
|
||||
id?: number;
|
||||
// 场馆订单号
|
||||
orderNum?: string;
|
||||
// 订单id
|
||||
oid?: number;
|
||||
// 场馆名称
|
||||
siteName?: string;
|
||||
// 微信昵称
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 获得积分
|
||||
integral?: string;
|
||||
// 变化前积分
|
||||
oldMoney?: string;
|
||||
// 变化后积分
|
||||
newMoney?: string;
|
||||
// 描述
|
||||
info?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 记录时间
|
||||
createTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分明细搜索条件
|
||||
*/
|
||||
export interface IntegralLogParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Item, ItemParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询项目类型
|
||||
*/
|
||||
export async function pageItem(params: ItemParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Item>>>(
|
||||
MODULES_API_URL + '/booking/item/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目类型列表
|
||||
*/
|
||||
export async function listItem(params?: ItemParam) {
|
||||
const res = await request.get<ApiResult<Item[]>>(
|
||||
MODULES_API_URL + '/booking/item',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目类型
|
||||
*/
|
||||
export async function addItem(data: Item) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目类型
|
||||
*/
|
||||
export async function updateItem(data: Item) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目类型
|
||||
*/
|
||||
export async function removeItem(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/item/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目类型
|
||||
*/
|
||||
export async function removeBatchItem(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/item/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目类型
|
||||
*/
|
||||
export async function getItem(id: number) {
|
||||
const res = await request.get<ApiResult<Item>>(
|
||||
MODULES_API_URL + '/booking/item/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
export interface Item {
|
||||
// ID
|
||||
id?: number;
|
||||
// 项目类型
|
||||
name?: string;
|
||||
// 项目备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目类型搜索条件
|
||||
*/
|
||||
export interface ItemParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* 默认字典数据
|
||||
*/
|
||||
export async function getLinkType() {
|
||||
return {
|
||||
list: [
|
||||
{ value: '0', label: '应用组件', text: '应用组件', comments: '' },
|
||||
{ value: '1', label: '外部链接', text: '外部链接', comments: '' }
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
// 默认字典数据
|
||||
export function getJson(dictName) {
|
||||
if (dictName == 'customerFollowStatus') {
|
||||
return [
|
||||
{ value: '1', label: '初访', text: '初访', comments: '' },
|
||||
{ value: '2', label: '意向', text: '意向', comments: '' },
|
||||
{ value: '3', label: '报价', text: '报价', comments: '' },
|
||||
{ value: '4', label: '成交', text: '成交', comments: '' },
|
||||
{ value: '5', label: '暂时搁置', text: '暂时搁置', comments: '' },
|
||||
{ value: '6', label: '未成交', text: '未成交', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'customerCategory') {
|
||||
return [
|
||||
{ value: 'my', label: '我创建的', text: '我创建的', comments: '' },
|
||||
{ value: 'stars', label: '标星客户', text: '标星客户', comments: '' },
|
||||
{ value: 'join', label: '我协作的', text: '我协作的', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'orderType') {
|
||||
return [
|
||||
{ value: 'all', label: '全部订单', text: '全部订单', comments: '' },
|
||||
{ value: 'delivery', label: '待发货', text: '待发货', comments: '' },
|
||||
{ value: 'receipt', label: '待收货', text: '待收货', comments: '' },
|
||||
{ value: 'pay', label: '待付款', text: '待付款', comments: '' },
|
||||
{ value: 'complete', label: '已完成', text: '已完成', comments: '' },
|
||||
{ value: 'cancel', label: '已取消', text: '已取消', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'customerSource') {
|
||||
return [
|
||||
{ value: '搜索引擎', label: '搜索引擎', text: '搜索引擎', comments: '' },
|
||||
{ value: '客户介绍', label: '客户介绍', text: '客户介绍', comments: '' },
|
||||
{ value: '代理商', label: '代理商', text: '代理商', comments: '' },
|
||||
{ value: '社交推广', label: '社交推广', text: '社交推广', comments: '' },
|
||||
{ value: '其他', label: '其他', text: '其他', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'serverBrand') {
|
||||
return [
|
||||
{ value: '阿里云', label: '阿里云', text: '阿里云', comments: '' },
|
||||
{ value: '腾讯云', label: '腾讯云', text: '腾讯云', comments: '' },
|
||||
{ value: '华为云', label: '华为云', text: '华为云', comments: '' },
|
||||
{ value: '西部数码', label: '西部数码', text: '西部数码', comments: '' },
|
||||
{ value: '其他', label: '其他', text: '其他', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'orderType') {
|
||||
return [
|
||||
{ value: 'all', label: '全部订单', text: '全部订单', comments: '' },
|
||||
{ value: 'delivery', label: '待发货', text: '待发货', comments: '' },
|
||||
{ value: 'receipt', label: '待收货', text: '待收货', comments: '' },
|
||||
{ value: 'pay', label: '待付款', text: '待付款', comments: '' },
|
||||
{ value: 'complete', label: '已完成', text: '已完成', comments: '' },
|
||||
{ value: 'cancel', label: '已取消', text: '已取消', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'sex') {
|
||||
return [
|
||||
{ value: '1', label: '男', text: '男', comments: null },
|
||||
{ value: '2', label: '女', text: '女', comments: null }
|
||||
];
|
||||
}
|
||||
if (dictName == 'payMethod') {
|
||||
return [
|
||||
{
|
||||
value: '余额支付',
|
||||
label: '余额支付',
|
||||
text: '余额支付'
|
||||
},
|
||||
{
|
||||
value: '微信支付',
|
||||
label: '微信支付',
|
||||
text: '微信支付'
|
||||
},
|
||||
{ value: '支付宝', label: '支付宝', text: '支付宝' }
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Lesson, LessonParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程管理
|
||||
*/
|
||||
export async function pageLesson(params: LessonParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Lesson>>>(
|
||||
MODULES_API_URL + '/booking/lesson/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程管理列表
|
||||
*/
|
||||
export async function listLesson(params?: LessonParam) {
|
||||
const res = await request.get<ApiResult<Lesson[]>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程管理
|
||||
*/
|
||||
export async function addLesson(data: Lesson) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程管理
|
||||
*/
|
||||
export async function updateLesson(data: Lesson) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程管理
|
||||
*/
|
||||
export async function removeLesson(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程管理
|
||||
*/
|
||||
export async function removeBatchLesson(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程管理
|
||||
*/
|
||||
export async function getLesson(id: number) {
|
||||
const res = await request.get<ApiResult<Lesson>>(
|
||||
MODULES_API_URL + '/booking/lesson/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程管理
|
||||
*/
|
||||
export interface Lesson {
|
||||
// ID
|
||||
lessonId?: number;
|
||||
// 课程名称
|
||||
lessonName?: string;
|
||||
// 图标
|
||||
image?: string;
|
||||
// 分类ID
|
||||
categoryId?: number;
|
||||
// 老师ID
|
||||
teacherId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 上课时间
|
||||
startTime?: string;
|
||||
// 报名人数上限
|
||||
maxNumber?: number;
|
||||
// 上课地点
|
||||
address?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程管理搜索条件
|
||||
*/
|
||||
export interface LessonParam extends PageParam {
|
||||
lessonId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Match, MatchParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询比赛信息表
|
||||
*/
|
||||
export async function pageMatch(params: MatchParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Match>>>(
|
||||
MODULES_API_URL + '/booking/match/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询比赛信息表列表
|
||||
*/
|
||||
export async function listMatch(params?: MatchParam) {
|
||||
const res = await request.get<ApiResult<Match[]>>(
|
||||
MODULES_API_URL + '/booking/match',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加比赛信息表
|
||||
*/
|
||||
export async function addMatch(data: Match) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改比赛信息表
|
||||
*/
|
||||
export async function updateMatch(data: Match) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除比赛信息表
|
||||
*/
|
||||
export async function removeMatch(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除比赛信息表
|
||||
*/
|
||||
export async function removeBatchMatch(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询比赛信息表
|
||||
*/
|
||||
export async function getMatch(id: number) {
|
||||
const res = await request.get<ApiResult<Match>>(
|
||||
MODULES_API_URL + '/booking/match/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 比赛信息表
|
||||
*/
|
||||
export interface Match {
|
||||
// 赛事ID
|
||||
matchId?: number;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 比赛类型 0常规比赛
|
||||
type?: number;
|
||||
// 活动开始时间
|
||||
matchStartTime?: number;
|
||||
// 活动结束时间
|
||||
matchEndTime?: number;
|
||||
// 报名时间
|
||||
bmStartTime?: number;
|
||||
// 报名时间
|
||||
bmEndTime?: number;
|
||||
// 文章分类ID
|
||||
categoryId?: number;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 虚拟阅读量(仅用作展示)
|
||||
virtualViews?: number;
|
||||
// 实际阅读量
|
||||
actualViews?: number;
|
||||
// 文章附件
|
||||
files?: string;
|
||||
// 视频地址
|
||||
video?: string;
|
||||
// 退费规则
|
||||
refundRule?: string;
|
||||
// 活动介绍
|
||||
content?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 比赛活动地点
|
||||
address?: string;
|
||||
// 报名费用
|
||||
price?: string;
|
||||
// 已报名人数
|
||||
users?: number;
|
||||
// 报名人数限制
|
||||
maxUsers?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0未开始, 1进行中,2已结束
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 比赛信息表搜索条件
|
||||
*/
|
||||
export interface MatchParam extends PageParam {
|
||||
matchId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MatchOrder, MatchOrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询比赛报名记录表
|
||||
*/
|
||||
export async function pageMatchOrder(params: MatchOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MatchOrder>>>(
|
||||
MODULES_API_URL + '/booking/match-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询比赛报名记录表列表
|
||||
*/
|
||||
export async function listMatchOrder(params?: MatchOrderParam) {
|
||||
const res = await request.get<ApiResult<MatchOrder[]>>(
|
||||
MODULES_API_URL + '/booking/match-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加比赛报名记录表
|
||||
*/
|
||||
export async function addMatchOrder(data: MatchOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改比赛报名记录表
|
||||
*/
|
||||
export async function updateMatchOrder(data: MatchOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加
|
||||
*/
|
||||
export async function addBatchMatchOrder(data: MatchOrder[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除比赛报名记录表
|
||||
*/
|
||||
export async function removeMatchOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除比赛报名记录表
|
||||
*/
|
||||
export async function removeBatchMatchOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询比赛报名记录表
|
||||
*/
|
||||
export async function getMatchOrder(id: number) {
|
||||
const res = await request.get<ApiResult<MatchOrder>>(
|
||||
MODULES_API_URL + '/booking/match-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 比赛报名记录表
|
||||
*/
|
||||
export interface MatchOrder {
|
||||
// 赛事ID
|
||||
matchOrderId?: number;
|
||||
// 赛事ID
|
||||
matchId?: number;
|
||||
// 场次
|
||||
session?: number;
|
||||
// 比赛活动地点
|
||||
address?: string;
|
||||
// 姓名
|
||||
name?: number;
|
||||
// 性别
|
||||
sex?: number;
|
||||
// 身份证号码
|
||||
idCardNo?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0未开始, 1进行中,2已结束
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 比赛报名记录表搜索条件
|
||||
*/
|
||||
export interface MatchOrderParam extends PageParam {
|
||||
matchOrderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Order, OrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询预约订单
|
||||
*/
|
||||
export async function pageOrder(params : OrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Order>>>(
|
||||
MODULES_API_URL + '/booking/order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预约订单列表
|
||||
*/
|
||||
export async function listOrder(params ?: OrderParam) {
|
||||
const res = await request.get<ApiResult<Order[]>>(
|
||||
MODULES_API_URL + '/booking/order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加预约订单
|
||||
*/
|
||||
export async function addOrder(data : Order) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改预约订单
|
||||
*/
|
||||
export async function updateOrder(data : Order) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除预约订单
|
||||
*/
|
||||
export async function removeOrder(id ?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除预约订单
|
||||
*/
|
||||
export async function removeBatchOrder(data : (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询预约订单
|
||||
*/
|
||||
export async function getOrder(id : number) {
|
||||
const res = await request.get<ApiResult<Order>>(
|
||||
MODULES_API_URL + '/booking/order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { OrderInfo } from '@/api/booking/orderInfo';
|
||||
|
||||
/**
|
||||
* 预约订单
|
||||
*/
|
||||
export interface Order {
|
||||
// 订单号
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 微信支付订单号
|
||||
wechatOrder?: string;
|
||||
// 微信退款订单号
|
||||
refundOrder?: string;
|
||||
// 场馆id用于权限判断
|
||||
merchantId?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 使用的优惠券id
|
||||
couponId?: number;
|
||||
// 使用的会员卡id
|
||||
cardId?: number;
|
||||
// 关联管理员id
|
||||
aid?: number;
|
||||
// 核销管理员id
|
||||
adminId?: number;
|
||||
// IC卡号
|
||||
code?: string;
|
||||
// 真实姓名
|
||||
name?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 订单总额
|
||||
totalPrice?: string;
|
||||
// 减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
|
||||
reducePrice?: string;
|
||||
// 实际付款
|
||||
payPrice?: string;
|
||||
// 用于统计
|
||||
price?: string;
|
||||
// 价钱,用于积分赠送
|
||||
money?: string;
|
||||
// 退款金额
|
||||
refundMoney?: string;
|
||||
// 教练价格
|
||||
coachPrice?: string;
|
||||
// 教练id
|
||||
coachId?: number;
|
||||
// 1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡
|
||||
payType?: string;
|
||||
// 1已付款,2未付款
|
||||
payStatus?: string;
|
||||
// 1已完成,2未使用,3已取消,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: string;
|
||||
// 优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
|
||||
type?: string;
|
||||
// 二维码地址,保存订单号,支付成功后才生成
|
||||
qrcode?: string;
|
||||
// 优惠说明
|
||||
desc?: string;
|
||||
// vip月卡年卡、ic月卡年卡回退次数
|
||||
returnNum?: number;
|
||||
// vip充值回退金额
|
||||
returnMoney?: string;
|
||||
// 预约详情开始时间数组
|
||||
startTime?: string;
|
||||
// 是否已开具发票:1已开发票,2未开发票,3不能开具发票
|
||||
isInvoice?: string;
|
||||
// 下单时间
|
||||
createTime?: number;
|
||||
//
|
||||
updateTime?: number;
|
||||
// 付款时间
|
||||
payTime?: number;
|
||||
// 退款时间
|
||||
refundTime?: number;
|
||||
// 申请退款时间
|
||||
refundApplyTime?: number;
|
||||
// 对账情况:1=已对账;2=未对账;3=已对账,金额对不上;4=未查询到该订单
|
||||
checkBill?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 订单信息
|
||||
orderInfo?: OrderInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预约订单搜索条件
|
||||
*/
|
||||
export interface OrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderInfo, OrderInfoParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageOrderInfo(params: OrderInfoParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderInfo>>>(
|
||||
MODULES_API_URL + '/shop/order-info/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listOrderInfo(params?: OrderInfoParam) {
|
||||
const res = await request.get<ApiResult<OrderInfo[]>>(
|
||||
MODULES_API_URL + '/shop/order-info',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addOrderInfo(data: OrderInfo) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-info',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateOrderInfo(data: OrderInfo) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-info',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeOrderInfo(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-info/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchOrderInfo(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-info/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getOrderInfo(id: number) {
|
||||
const res = await request.get<ApiResult<OrderInfo>>(
|
||||
MODULES_API_URL + '/shop/order-info/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface OrderInfo {
|
||||
//
|
||||
id?: number;
|
||||
// 关联订单表id
|
||||
oid?: number;
|
||||
// 关联场馆id
|
||||
sid?: number;
|
||||
// 关联场地id
|
||||
fid?: number;
|
||||
// 场馆
|
||||
siteName?: string;
|
||||
// 场地
|
||||
fieldName?: string;
|
||||
// 预约时间段
|
||||
dateTime?: string;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 儿童价
|
||||
childrenPrice?: string;
|
||||
// 成人人数
|
||||
adultNum?: string;
|
||||
// 儿童人数
|
||||
childrenNum?: string;
|
||||
// 1已付款,2未付款,3无需付款或占用状态
|
||||
payStatus?: string;
|
||||
// 是否免费:1免费、2收费
|
||||
isFree?: string;
|
||||
// 是否支持儿童票:1支持,2不支持
|
||||
isChildren?: string;
|
||||
// 预订类型:1全场,2半场
|
||||
type?: string;
|
||||
// 组合数据:日期+时间段+场馆id+场地id
|
||||
mergeData?: string;
|
||||
// 开场时间
|
||||
startTime?: number;
|
||||
// 下单时间
|
||||
orderTime?: number;
|
||||
// 毫秒时间戳
|
||||
timeFlag?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface OrderInfoParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Period, PeriodParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询场地时段
|
||||
*/
|
||||
export async function pagePeriod(params: PeriodParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Period>>>(
|
||||
MODULES_API_URL + '/booking/period/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场地时段列表
|
||||
*/
|
||||
export async function listPeriod(params?: PeriodParam) {
|
||||
const res = await request.get<ApiResult<Period[]>>(
|
||||
MODULES_API_URL + '/booking/period',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加场地时段
|
||||
*/
|
||||
export async function addPeriod(data: Period) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/period',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场地时段
|
||||
*/
|
||||
export async function updatePeriod(data: Period) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/period',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场地时段
|
||||
*/
|
||||
export async function removePeriod(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/period/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场地时段
|
||||
*/
|
||||
export async function removeBatchPeriod(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/period/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询场地时段
|
||||
*/
|
||||
export async function getPeriod(id: number) {
|
||||
const res = await request.get<ApiResult<Period>>(
|
||||
MODULES_API_URL + '/booking/period/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 场地时段
|
||||
*/
|
||||
export interface Period {
|
||||
//
|
||||
periodId?: number;
|
||||
// 时段
|
||||
timePeriod?: string;
|
||||
timePeriod1?: string;
|
||||
timePeriod2?: string;
|
||||
// 价格
|
||||
price?: number;
|
||||
// 每日不同价格
|
||||
prices?: string;
|
||||
// 半场价格
|
||||
halfPrice?: number;
|
||||
// 每日不同半场价格
|
||||
halfPrices?: string;
|
||||
// 儿童价
|
||||
childrenPrice?: number;
|
||||
// 星期选择
|
||||
week?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 关联id
|
||||
merchantId?: number;
|
||||
// 是否关闭,1开启,2关闭
|
||||
isStatus?: number;
|
||||
// 是否免费:1免费,2收费
|
||||
isFree?: number;
|
||||
// 开始时间
|
||||
startTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 场地时段搜索条件
|
||||
*/
|
||||
export interface PeriodParam extends PageParam {
|
||||
periodId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Student, StudentParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询学生管理
|
||||
*/
|
||||
export async function pageStudent(params: StudentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Student>>>(
|
||||
MODULES_API_URL + '/booking/student/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询学生管理列表
|
||||
*/
|
||||
export async function listStudent(params?: StudentParam) {
|
||||
const res = await request.get<ApiResult<Student[]>>(
|
||||
MODULES_API_URL + '/booking/student',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加学生管理
|
||||
*/
|
||||
export async function addStudent(data: Student) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/student',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生管理
|
||||
*/
|
||||
export async function updateStudent(data: Student) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/student',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生管理
|
||||
*/
|
||||
export async function removeStudent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/student/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除学生管理
|
||||
*/
|
||||
export async function removeBatchStudent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/student/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询学生管理
|
||||
*/
|
||||
export async function getStudent(id: number) {
|
||||
const res = await request.get<ApiResult<Student>>(
|
||||
MODULES_API_URL + '/booking/student/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 学生管理
|
||||
*/
|
||||
export interface Student {
|
||||
// ID
|
||||
studentId?: number;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 学生姓名
|
||||
studentName?: string;
|
||||
// 学生头像
|
||||
image?: string;
|
||||
// 老师介绍
|
||||
content?: string;
|
||||
// 性别
|
||||
sex?: number;
|
||||
// 出生年月
|
||||
birthday?: string;
|
||||
// 证件号码
|
||||
idCard?: string;
|
||||
// 服装尺寸
|
||||
clothingSize?: string;
|
||||
// 身高
|
||||
height?: string;
|
||||
// 体重
|
||||
weight?: string;
|
||||
// 关联家长ID
|
||||
userId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生管理搜索条件
|
||||
*/
|
||||
export interface StudentParam extends PageParam {
|
||||
studentId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Teacher, TeacherParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询老师管理
|
||||
*/
|
||||
export async function pageTeacher(params: TeacherParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Teacher>>>(
|
||||
MODULES_API_URL + '/booking/teacher/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询老师管理列表
|
||||
*/
|
||||
export async function listTeacher(params?: TeacherParam) {
|
||||
const res = await request.get<ApiResult<Teacher[]>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加老师管理
|
||||
*/
|
||||
export async function addTeacher(data: Teacher) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改老师管理
|
||||
*/
|
||||
export async function updateTeacher(data: Teacher) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除老师管理
|
||||
*/
|
||||
export async function removeTeacher(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除老师管理
|
||||
*/
|
||||
export async function removeBatchTeacher(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询老师管理
|
||||
*/
|
||||
export async function getTeacher(id: number) {
|
||||
const res = await request.get<ApiResult<Teacher>>(
|
||||
MODULES_API_URL + '/booking/teacher/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 老师管理
|
||||
*/
|
||||
export interface Teacher {
|
||||
// ID
|
||||
teacherId?: number;
|
||||
// 老师姓名
|
||||
teacherName?: string;
|
||||
// 老师照片
|
||||
image?: string;
|
||||
// 老师介绍
|
||||
content?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 老师管理搜索条件
|
||||
*/
|
||||
export interface TeacherParam extends PageParam {
|
||||
teacherId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCard, UserCardParam } from './model';
|
||||
import type { OrderParam } from '@/shop/order/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询可用的会员卡
|
||||
* @param {UserCardParam} params
|
||||
* @return
|
||||
*/
|
||||
export async function findUseCard(params: OrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCard>>>(
|
||||
MODULES_API_URL + '/booking/user-card/findUseCard',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询会员卡
|
||||
*/
|
||||
export async function pageUserCard(params: UserCardParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCard>>>(
|
||||
MODULES_API_URL + '/booking/user-card/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡列表
|
||||
*/
|
||||
export async function listUserCard(params?: UserCardParam) {
|
||||
const res = await request.get<ApiResult<UserCard[]>>(
|
||||
MODULES_API_URL + '/booking/user-card',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡
|
||||
*/
|
||||
export async function addUserCard(data: UserCard) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡
|
||||
*/
|
||||
export async function updateUserCard(data: UserCard) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡
|
||||
*/
|
||||
export async function removeUserCard(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡
|
||||
*/
|
||||
export async function removeBatchUserCard(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡
|
||||
*/
|
||||
export async function getUserCard(id: number) {
|
||||
const res = await request.get<ApiResult<UserCard>>(
|
||||
MODULES_API_URL + '/booking/user-card/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡
|
||||
*/
|
||||
export interface UserCard {
|
||||
//
|
||||
id?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// sid场馆id集合,适用的场馆
|
||||
sid?: string;
|
||||
// 用户id(旧)
|
||||
uid?: number;
|
||||
// vip卡id
|
||||
vid?: number;
|
||||
// 开卡人id
|
||||
aid?: number;
|
||||
// 微信订单号
|
||||
wechatOrder?: string;
|
||||
// 卡号
|
||||
code?: string;
|
||||
// 会员卡名称
|
||||
name?: string;
|
||||
// 真实姓名
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// vip购卡价格
|
||||
price?: string;
|
||||
// 会员卡介绍
|
||||
desc?: string;
|
||||
// 会员卡说明
|
||||
info?: string;
|
||||
// vip卡折扣率
|
||||
discount?: string;
|
||||
// 使用次数
|
||||
count?: number;
|
||||
// 每使用一次减少的金额
|
||||
eachMoney?: string;
|
||||
// 剩余金额
|
||||
remainingMoney?: string;
|
||||
// 续费累加次数
|
||||
number?: number;
|
||||
// 剩余次数
|
||||
num?: number;
|
||||
// 付款状态,1已付款,2未付款
|
||||
status?: number;
|
||||
// 会员卡年限
|
||||
term?: number;
|
||||
// 月限
|
||||
month?: number;
|
||||
// IC卡类型:1年卡,2次卡,3月卡,4会员IC卡,5充值卡
|
||||
type?: number;
|
||||
// 卡类型:1成人卡,2儿童卡
|
||||
cardType?: number;
|
||||
// vip卡等级类型:1特殊vip卡,2普通vip卡
|
||||
vipType?: number;
|
||||
// 特殊卡开发凭证图
|
||||
pic?: string;
|
||||
// 价格组
|
||||
prices?: string;
|
||||
// 1微信支付,2支付宝支付,3现金,4POS机刷卡,15平安健康卡
|
||||
payType?: number;
|
||||
// 是否赠送积分:1赠送,2不赠送
|
||||
isIntegral?: number;
|
||||
// 是否已开具发票:1已开发票,2未开发票
|
||||
isInvoice?: number;
|
||||
// vip卡到期时间
|
||||
expireTime?: number;
|
||||
// 紧急联系人
|
||||
urgentName?: string;
|
||||
// 紧急联系人号码
|
||||
urgentPhone?: string;
|
||||
// 卡号
|
||||
cardNum?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 使用时间
|
||||
useTime?: number;
|
||||
// 创建时间
|
||||
createTime?: number;
|
||||
//
|
||||
updateTime?: number;
|
||||
@TableField("IDCard")
|
||||
// 身份证号码
|
||||
idcard?: string;
|
||||
// 备注
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡搜索条件
|
||||
*/
|
||||
export interface UserCardParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCardLog, UserCardLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询明细表
|
||||
*/
|
||||
export async function pageUserCardLog(params: UserCardLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCardLog>>>(
|
||||
MODULES_API_URL + '/booking/user-card-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询明细表列表
|
||||
*/
|
||||
export async function listUserCardLog(params?: UserCardLogParam) {
|
||||
const res = await request.get<ApiResult<UserCardLog[]>>(
|
||||
MODULES_API_URL + '/booking/user-card-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加明细表
|
||||
*/
|
||||
export async function addUserCardLog(data: UserCardLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改明细表
|
||||
*/
|
||||
export async function updateUserCardLog(data: UserCardLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除明细表
|
||||
*/
|
||||
export async function removeUserCardLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除明细表
|
||||
*/
|
||||
export async function removeBatchUserCardLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询明细表
|
||||
*/
|
||||
export async function getUserCardLog(id: number) {
|
||||
const res = await request.get<ApiResult<UserCardLog>>(
|
||||
MODULES_API_URL + '/booking/user-card-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 明细表
|
||||
*/
|
||||
export interface UserCardLog {
|
||||
// 主键ID
|
||||
logId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// IC卡类型:1年卡,2次卡,3月卡,4会员IC卡,5充值卡
|
||||
type?: number;
|
||||
// 变动金额
|
||||
money?: string;
|
||||
// 变动后余额
|
||||
balance?: string;
|
||||
// 管理员备注
|
||||
remark?: string;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 操作人ID
|
||||
adminId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户编码
|
||||
merchantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 明细表搜索条件
|
||||
*/
|
||||
export interface UserCardLogParam extends PageParam {
|
||||
logId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCoupon, UserCouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
|
||||
export async function data() {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/data',
|
||||
{
|
||||
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询我的优惠券
|
||||
*/
|
||||
export async function pageUserCoupon(params : UserCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCoupon>>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的优惠券列表
|
||||
*/
|
||||
export async function listUserCoupon(params ?: UserCouponParam) {
|
||||
const res = await request.get<ApiResult<UserCoupon[]>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加我的优惠券
|
||||
*/
|
||||
export async function addUserCoupon(data : UserCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改我的优惠券
|
||||
*/
|
||||
export async function updateUserCoupon(data : UserCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除我的优惠券
|
||||
*/
|
||||
export async function removeUserCoupon(id ?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除我的优惠券
|
||||
*/
|
||||
export async function removeBatchUserCoupon(data : (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询我的优惠券
|
||||
*/
|
||||
export async function getUserCoupon(id : number) {
|
||||
const res = await request.get<ApiResult<UserCoupon>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 我的优惠券
|
||||
*/
|
||||
export interface UserCoupon {
|
||||
// id
|
||||
id?: number;
|
||||
// 优惠劵id
|
||||
couponId?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券类型(10满减券 20折扣券)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 到期类型(10领取后生效 20固定时间)
|
||||
expireType?: number;
|
||||
// 领取后生效-有效天数
|
||||
expireDay?: number;
|
||||
// 有效期开始时间
|
||||
startTime?: number;
|
||||
// 有效期结束时间
|
||||
endTime?: number;
|
||||
// 适用范围(10全部商品 20指定商品)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 是否过期(0未过期 1已过期)
|
||||
isExpire?: number;
|
||||
// 是否已使用(0未使用 1已使用)
|
||||
isUse?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的优惠券搜索条件
|
||||
*/
|
||||
export interface UserCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserInvoice, UserInvoiceParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询发票
|
||||
*/
|
||||
export async function pageUserInvoice(params: UserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserInvoice>>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询发票列表
|
||||
*/
|
||||
export async function listUserInvoice(params?: UserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<UserInvoice[]>>(
|
||||
MODULES_API_URL + '/booking/user-invoice',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加发票
|
||||
*/
|
||||
export async function addUserInvoice(data: UserInvoice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发票
|
||||
*/
|
||||
export async function updateUserInvoice(data: UserInvoice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发票
|
||||
*/
|
||||
export async function removeUserInvoice(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除发票
|
||||
*/
|
||||
export async function removeBatchUserInvoice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询发票
|
||||
*/
|
||||
export async function getUserInvoice(id: number) {
|
||||
const res = await request.get<ApiResult<UserInvoice>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开具发票
|
||||
*/
|
||||
export async function doInvoice(data: UserInvoice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/doInvoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据orderNo查询发票
|
||||
*/
|
||||
export async function showInvoice(orderNo: string) {
|
||||
const res = await request.get<ApiResult<UserInvoice>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/showInvoice/' + orderNo
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 发票
|
||||
*/
|
||||
export interface UserInvoice {
|
||||
// id
|
||||
id?: number;
|
||||
// 发票类型(0纸质 1电子)
|
||||
type?: number;
|
||||
// 发票名称
|
||||
name?: string;
|
||||
// 开票类型(0铺票 1专票)
|
||||
invoiceType?: string;
|
||||
// 税号
|
||||
invoiceCode?: string;
|
||||
// 公司地址
|
||||
address?: string;
|
||||
// 公司电话
|
||||
tel?: string;
|
||||
// 开户行
|
||||
bankName?: string;
|
||||
// 开户账号
|
||||
bankAccount?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 电子邮箱
|
||||
email?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票搜索条件
|
||||
*/
|
||||
export interface UserInvoiceParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Users, UsersParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询用户
|
||||
*/
|
||||
export async function pageUsers(params: UsersParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Users>>>(
|
||||
MODULES_API_URL + '/shop/users/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*/
|
||||
export async function listUsers(params?: UsersParam) {
|
||||
const res = await request.get<ApiResult<Users[]>>(
|
||||
MODULES_API_URL + '/shop/users',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户
|
||||
*/
|
||||
export async function addUsers(data: Users) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/users',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
export async function updateUsers(data: Users) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/users',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
export async function removeUsers(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/users/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户
|
||||
*/
|
||||
export async function removeBatchUsers(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/users/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户
|
||||
*/
|
||||
export async function getUsers(id: number) {
|
||||
const res = await request.get<ApiResult<Users>>(
|
||||
MODULES_API_URL + '/shop/users/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getByPhone(params: UsersParam) {
|
||||
const res = await request.get<ApiResult<Users>>(
|
||||
MODULES_API_URL + '/shop/users/getByPhone',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
export interface Users {
|
||||
//
|
||||
userId?: number;
|
||||
// 用户唯一小程序id
|
||||
openid?: string;
|
||||
// 小程序用户秘钥
|
||||
sessionKey?: string;
|
||||
// 用户名
|
||||
username?: string;
|
||||
// 头像地址
|
||||
avatarUrl?: string;
|
||||
// 1男,2女
|
||||
sex?: string;
|
||||
// 国家
|
||||
country?: string;
|
||||
// 省份
|
||||
province?: string;
|
||||
// 城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 邮箱是否验证, 0否, 1是
|
||||
emailVerified?: number;
|
||||
// 积分
|
||||
points?: string;
|
||||
// 余额
|
||||
balance?: string;
|
||||
// 注册时间
|
||||
addTime?: number;
|
||||
// 身份证号码
|
||||
idCard?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 是否管理员:1是;2否
|
||||
isAdmin?: string;
|
||||
// 客户端ID
|
||||
clientId?: string;
|
||||
// 注册来源客户端 (APP、H5、小程序等)
|
||||
platform?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UsersParam extends PageParam {
|
||||
userId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Ad, AdParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询广告位
|
||||
*/
|
||||
export async function pageAd(params: AdParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Ad>>>('/cms/ad/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询广告位列表
|
||||
*/
|
||||
export async function listAd(params?: AdParam) {
|
||||
const res = await request.get<ApiResult<Ad[]>>('/cms/ad', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加广告位
|
||||
*/
|
||||
export async function addAd(data: Ad) {
|
||||
const res = await request.post<ApiResult<unknown>>('/cms/ad', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广告位
|
||||
*/
|
||||
export async function updateAd(data: Ad) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/ad', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广告位
|
||||
*/
|
||||
export async function removeAd(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/cms/ad/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除广告位
|
||||
*/
|
||||
export async function removeBatchAd(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/cms/ad/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateAdStatus(adId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/ad/status', {
|
||||
adId,
|
||||
status
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询广告位
|
||||
*/
|
||||
export async function getAd(id: number) {
|
||||
const res = await request.get<ApiResult<Ad>>('/cms/ad/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/cms/ad/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 广告位
|
||||
*/
|
||||
export interface Ad {
|
||||
// 广告位id
|
||||
adId?: number;
|
||||
// 广告位名称
|
||||
adType?: string;
|
||||
// 类型
|
||||
type?: string;
|
||||
// 宽
|
||||
width?: string;
|
||||
// 高
|
||||
height?: string;
|
||||
// 附件
|
||||
images?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告位搜索条件
|
||||
*/
|
||||
export interface AdParam extends PageParam {
|
||||
adId?: string;
|
||||
name?: number;
|
||||
type?: number;
|
||||
userId?: number;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Article, ArticleParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询文章
|
||||
*/
|
||||
export async function pageArticle(params : ArticleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Article>>>(
|
||||
MODULES_API_URL + '/cms/article/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
export async function listArticle(params ?: ArticleParam) {
|
||||
const res = await request.get<ApiResult<Article[]>>(MODULES_API_URL + '/cms/article', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章
|
||||
*/
|
||||
export async function addArticle(data : Article) {
|
||||
const res = await request.post<ApiResult<unknown>>(MODULES_API_URL + '/cms/article', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章
|
||||
*/
|
||||
export async function updateArticle(data : Article) {
|
||||
const res = await request.put<ApiResult<unknown>>(MODULES_API_URL + '/cms/article', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
*/
|
||||
export async function removeArticle(id ?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(MODULES_API_URL + '/cms/article/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章
|
||||
*/
|
||||
export async function removeBatchArticle(data : (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(MODULES_API_URL + '/cms/article/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateArticleStatus(articleId ?: number, status ?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(MODULES_API_URL + '/cms/article/status', {
|
||||
articleId,
|
||||
status
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文章
|
||||
*/
|
||||
export async function getArticle(id : number) {
|
||||
const res = await request.get<ApiResult<Article>>(MODULES_API_URL + '/cms/article/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field : string,
|
||||
value : string,
|
||||
id ?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/article/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章
|
||||
*/
|
||||
export interface Article {
|
||||
// 文章id
|
||||
articleId?: number;
|
||||
// 文章标题
|
||||
title?: string;
|
||||
// 展现方式
|
||||
showType?: number;
|
||||
// 文章类型
|
||||
categoryId?: number;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 附件
|
||||
files?: string;
|
||||
// 缩列图
|
||||
thumbnail?: string;
|
||||
// 视频地址
|
||||
video?: string;
|
||||
// 上传的文件类型
|
||||
accept?: string;
|
||||
// 来源
|
||||
source?: string;
|
||||
// 文章内容
|
||||
content?: string;
|
||||
// 虚拟阅读量
|
||||
virtualViews?: string;
|
||||
// 实际阅读量
|
||||
actualViews?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 用户头像
|
||||
userAvatar?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
//
|
||||
likes?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章搜索条件
|
||||
*/
|
||||
export interface ArticleParam extends PageParam {
|
||||
title?: string;
|
||||
articleId?: number;
|
||||
categoryId?: string;
|
||||
status?: string;
|
||||
sortNumber?: string;
|
||||
createTime?: string;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
userId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ArticleCategory, ArticleCategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询文章分类
|
||||
*/
|
||||
export async function pageArticleCategory(params: ArticleCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ArticleCategory>>>(
|
||||
MODULES_API_URL + '/cms/article-category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章分类列表
|
||||
*/
|
||||
export async function listArticleCategory(params?: ArticleCategoryParam) {
|
||||
const res = await request.get<ApiResult<ArticleCategory[]>>(
|
||||
MODULES_API_URL + '/cms/article-category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文章分类
|
||||
*/
|
||||
export async function getArticleCategory(id: number) {
|
||||
const res = await request.get<ApiResult<ArticleCategory>>(
|
||||
MODULES_API_URL + '/cms/article-category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章分类
|
||||
*/
|
||||
export async function addArticleCategory(data: ArticleCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分类
|
||||
*/
|
||||
export async function updateArticleCategory(data: ArticleCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章分类
|
||||
*/
|
||||
export async function removeArticleCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章分类
|
||||
*/
|
||||
export async function removeBatchArticleCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章分类
|
||||
*/
|
||||
export interface ArticleCategory {
|
||||
// 文章分类id
|
||||
categoryId?: number;
|
||||
// 分类类型 0列表 1页面 2链接
|
||||
type?: number;
|
||||
// 文章分类
|
||||
title?: string;
|
||||
// 文章分类图片
|
||||
image?: string;
|
||||
// 路由/链接
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 页面ID
|
||||
pageId?: number;
|
||||
// 页面名称
|
||||
pageName?: string;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
key?: number;
|
||||
value?: number;
|
||||
// 子菜单
|
||||
children?: ArticleCategory[];
|
||||
tempPath?: string;
|
||||
disabled?: boolean;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 整理分类用于网站导航栏
|
||||
*/
|
||||
export interface ArrangeCategory {
|
||||
categoryId?: number;
|
||||
type?: number;
|
||||
title?: string;
|
||||
parentId?: number;
|
||||
avatar?: string;
|
||||
path?: string;
|
||||
component?: string;
|
||||
pageId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
children?: ArrangeCategory[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章分类搜索条件
|
||||
*/
|
||||
export interface ArticleCategoryParam extends PageParam {
|
||||
title?: string;
|
||||
categoryId?: number;
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DocsContent, DocsContentParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询文档
|
||||
*/
|
||||
export async function pageDocsContent(params: DocsContentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DocsContent>>>(
|
||||
'/cms/docs-content/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档列表
|
||||
*/
|
||||
export async function listDocsContent(params?: DocsContentParam) {
|
||||
const res = await request.get<ApiResult<DocsContent[]>>('/cms/docs-content', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文档
|
||||
*/
|
||||
export async function addDocsContent(data: DocsContent) {
|
||||
const res = await request.post<ApiResult<unknown>>('/cms/docs-content', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档
|
||||
*/
|
||||
export async function updateDocsContent(data: DocsContent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/cms/docs-content',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文档
|
||||
*/
|
||||
export async function removeDocsContent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/cms/docs-content/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文档
|
||||
*/
|
||||
export async function removeBatchDocsContent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/cms/docs-content/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDocsContentStatus(
|
||||
docsId?: number,
|
||||
status?: number
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/docs-content/status', {
|
||||
docsId,
|
||||
status
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文档
|
||||
*/
|
||||
export async function getDocsContent(id: number) {
|
||||
const res = await request.get<ApiResult<DocsContent>>(
|
||||
'/cms/docs-content/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/cms/docs-content/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文档内容
|
||||
*/
|
||||
export interface DocsContent {
|
||||
// 自增ID
|
||||
docsContentId?: number;
|
||||
// 文档内容id
|
||||
docsId?: number;
|
||||
// 文档内容
|
||||
content?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档内容搜索条件
|
||||
*/
|
||||
export interface DocsContentParam extends PageParam {
|
||||
docsId?: number;
|
||||
content?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Docs, DocsParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询文档
|
||||
*/
|
||||
export async function pageDocs(params: DocsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Docs>>>('/cms/docs/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档列表
|
||||
*/
|
||||
export async function listDocs(params?: DocsParam) {
|
||||
const res = await request.get<ApiResult<Docs[]>>('/cms/docs', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文档
|
||||
*/
|
||||
export async function addDocs(data: Docs) {
|
||||
const res = await request.post<ApiResult<unknown>>('/cms/docs', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档
|
||||
*/
|
||||
export async function updateDocs(data: Docs) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/docs', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文档
|
||||
*/
|
||||
export async function removeDocs(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/cms/docs/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文档
|
||||
*/
|
||||
export async function removeBatchDocs(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/cms/docs/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDocsStatus(docsId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/docs/status', {
|
||||
docsId,
|
||||
status
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文档
|
||||
*/
|
||||
export async function getDocs(id: number) {
|
||||
const res = await request.get<ApiResult<Docs>>('/cms/docs/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/cms/docs/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文档
|
||||
*/
|
||||
export interface Docs {
|
||||
// 文档id
|
||||
docsId?: number;
|
||||
// 文档标题
|
||||
title?: string;
|
||||
// 文档类型 0目录 1文档
|
||||
type?: number;
|
||||
// 展现方式
|
||||
showType?: number;
|
||||
// 文档类型
|
||||
categoryId?: number;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 来源
|
||||
source?: string;
|
||||
// 文档内容
|
||||
content?: string;
|
||||
// 虚拟阅读量
|
||||
virtualViews?: string;
|
||||
// 实际阅读量
|
||||
actualViews?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 用户头像
|
||||
userAvatar?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
docsContentId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档搜索条件
|
||||
*/
|
||||
export interface DocsParam extends PageParam {
|
||||
title?: string;
|
||||
docsId?: number;
|
||||
categoryId?: string;
|
||||
status?: string;
|
||||
sortNumber?: string;
|
||||
createTime?: string;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MpMenu, MpMenuParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询小程序端菜单
|
||||
*/
|
||||
export async function pageMpMenu(params: MpMenuParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MpMenu>>>(
|
||||
MODULES_API_URL + '/cms/mp-menu/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小程序端菜单列表
|
||||
*/
|
||||
export async function listMpMenu(params?: MpMenuParam) {
|
||||
const res = await request.get<ApiResult<MpMenu[]>>(
|
||||
MODULES_API_URL + '/cms/mp-menu',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加小程序端菜单
|
||||
*/
|
||||
export async function addMpMenu(data: MpMenu) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-menu',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小程序端菜单
|
||||
*/
|
||||
export async function updateMpMenu(data: MpMenu) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-menu',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除小程序端菜单
|
||||
*/
|
||||
export async function removeMpMenu(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-menu/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除小程序端菜单
|
||||
*/
|
||||
export async function removeBatchMpMenu(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-menu/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询小程序端菜单
|
||||
*/
|
||||
export async function getMpMenu(id: number) {
|
||||
const res = await request.get<ApiResult<MpMenu>>(
|
||||
MODULES_API_URL + '/cms/mp-menu/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 小程序端菜单
|
||||
*/
|
||||
export interface MpMenu {
|
||||
// ID
|
||||
menuId?: number;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 菜单名称
|
||||
title?: string;
|
||||
// 类型 0自定义 1单页内容2外部链接
|
||||
type?: number;
|
||||
// 是否微信小程序菜单
|
||||
isMpWeixin?: boolean;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 菜单组件地址, 目录可为空
|
||||
component?: string;
|
||||
// 打开位置
|
||||
target?: string;
|
||||
// 菜单图标
|
||||
icon?: string;
|
||||
// 图标颜色
|
||||
color?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 位置 0不限 1顶部 2底部
|
||||
position?: number;
|
||||
// 菜单侧栏选中的path
|
||||
active?: string;
|
||||
// 其它路由元信息
|
||||
meta?: string;
|
||||
// 绑定的页面
|
||||
pageId?: number;
|
||||
// 绑定的文章分类ID
|
||||
articleCategoryId?: number;
|
||||
// 绑定的文章ID
|
||||
articleId?: number;
|
||||
// 绑定的表单ID
|
||||
formId?: number;
|
||||
// 绑定的书籍标识
|
||||
bookCode?: string;
|
||||
// 绑定的商品分类ID
|
||||
goodsCategoryId?: number;
|
||||
// 绑定的商品ID
|
||||
goodsId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 设为首页
|
||||
home?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 子菜单
|
||||
children?: MpMenu[];
|
||||
pageName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序端菜单搜索条件
|
||||
*/
|
||||
export interface MpMenuParam extends PageParam {
|
||||
menuId?: number;
|
||||
type?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Navigation, NavigationParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询导航
|
||||
*/
|
||||
export async function pageNavigation(params: NavigationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Navigation>>>(
|
||||
MODULES_API_URL + '/cms/navigation/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询导航列表
|
||||
*/
|
||||
export async function listNavigation(params?: NavigationParam) {
|
||||
const res = await request.get<ApiResult<Navigation[]>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加导航
|
||||
*/
|
||||
export async function addNavigation(data: Navigation) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改导航
|
||||
*/
|
||||
export async function updateNavigation(data: Navigation) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除导航
|
||||
*/
|
||||
export async function removeNavigation(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除导航
|
||||
*/
|
||||
export async function removeBatchNavigation(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateNavigationStatus(navigationId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/status',
|
||||
{
|
||||
navigationId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询导航
|
||||
*/
|
||||
export async function getNavigation(id: number) {
|
||||
const res = await request.get<ApiResult<Navigation>>(
|
||||
MODULES_API_URL + '/cms/navigation/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
export interface Navigation {
|
||||
navigationId?: number;
|
||||
parentId?: number;
|
||||
title?: string;
|
||||
path?: string;
|
||||
icon?: string;
|
||||
component?: string;
|
||||
type?: number;
|
||||
sortNumber?: number;
|
||||
hide?: number;
|
||||
home?: number;
|
||||
position?: number;
|
||||
meta?: string;
|
||||
children?: Navigation[];
|
||||
disabled?: boolean;
|
||||
tenantId?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
pageId?: number;
|
||||
articleCategoryId?: number;
|
||||
articleId?: number;
|
||||
goodsCategoryId?: number;
|
||||
goodsId?: number;
|
||||
bookCode?: string;
|
||||
formId?: number;
|
||||
pageName?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单搜索参数
|
||||
*/
|
||||
export interface NavigationParam {
|
||||
title?: string;
|
||||
path?: string;
|
||||
authority?: string;
|
||||
parentId?: number;
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
WebsiteField,
|
||||
WebsiteFieldParam
|
||||
} from '@/api/cms/website/field/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询项目参数
|
||||
*/
|
||||
export async function pageWebsiteField(params: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<WebsiteField>>>(
|
||||
MODULES_API_URL + '/cms/website-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目参数列表
|
||||
*/
|
||||
export async function listWebsiteField(params?: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<WebsiteField[]>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目参数
|
||||
*/
|
||||
export async function getWebsiteField(id: number) {
|
||||
const res = await request.get<ApiResult<WebsiteField>>(
|
||||
MODULES_API_URL + '/cms/website-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目参数
|
||||
*/
|
||||
export async function addWebsiteField(data: WebsiteField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目参数
|
||||
*/
|
||||
export async function updateWebsiteField(data: WebsiteField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目参数
|
||||
*/
|
||||
export async function removeWebsiteField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目参数
|
||||
*/
|
||||
export async function removeBatchWebsiteField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 网站参数
|
||||
*/
|
||||
export interface WebsiteField {
|
||||
id?: number;
|
||||
name?: string;
|
||||
value?: string;
|
||||
comments?: string;
|
||||
userId?: number;
|
||||
websiteId?: number;
|
||||
status?: any;
|
||||
sortNumber?: any;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
export interface WebsiteParam {
|
||||
// 网站名称
|
||||
site_logo?: string;
|
||||
// 登录页面标题
|
||||
login_name?: string;
|
||||
// 登录页面的背景图片
|
||||
login_bg_img?: string;
|
||||
}
|
||||
|
||||
// 约定的小程序参数名称
|
||||
export interface MpWeixinParam {
|
||||
// 我的页面顶部背景图片
|
||||
mp_user_top?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站参数搜索条件
|
||||
*/
|
||||
export interface WebsiteFieldParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
websiteId?: number;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Website, WebsiteParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询网站列表
|
||||
*/
|
||||
export async function pageWebsite(params: WebsiteParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Website>>>(
|
||||
'/cms/website/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询网站列表
|
||||
*/
|
||||
export async function listWebsite(params?: WebsiteParam) {
|
||||
const res = await request.get<ApiResult<Website[]>>(
|
||||
'/cms/website',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加网站
|
||||
*/
|
||||
export async function addWebsite(data: Website) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/cms/website',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改网站
|
||||
*/
|
||||
export async function updateWebsite(data: Website) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/cms/website',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除网站
|
||||
*/
|
||||
export async function removeWebsite(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/cms/website/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除网站
|
||||
*/
|
||||
export async function removeBatchWebsite(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/cms/website/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/cms/website/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { WebsiteField } from '@/api/cms/website/field/model';
|
||||
import type { Navigation } from "@/api/cms/navigation/model";
|
||||
import type { Link } from "@/api/oa/link/model";
|
||||
import type { ArrangeCategory } from "@/api/cms/category/model";
|
||||
|
||||
/**
|
||||
* 网站
|
||||
*/
|
||||
export interface Website {
|
||||
websiteId ?: number;
|
||||
websiteName ?: string;
|
||||
websiteCode ?: string;
|
||||
websiteIcon ?: string;
|
||||
websiteLogo ?: string;
|
||||
websiteDarkLogo ?: string;
|
||||
keywords ?: string;
|
||||
address ?: string;
|
||||
phone ?: string;
|
||||
email ?: string;
|
||||
websiteType ?: string;
|
||||
expirationTime ?: string;
|
||||
templateId ?: string;
|
||||
industryParent ?: string;
|
||||
industryChild ?: string;
|
||||
companyId ?: number;
|
||||
domain ?: string;
|
||||
icpNo ?: string;
|
||||
policeNo ?: string;
|
||||
comments ?: string;
|
||||
sortNumber ?: number;
|
||||
createTime ?: string;
|
||||
disabled ?: boolean;
|
||||
country ?: string;
|
||||
province ?: string;
|
||||
city ?: string;
|
||||
region ?: string;
|
||||
appId ?: number;
|
||||
fields ?: WebsiteField[];
|
||||
status ?: number;
|
||||
tenantId ?: number;
|
||||
tenantName ?: string;
|
||||
navigations ?: Navigation[];
|
||||
categoryList ?: ArrangeCategory[];
|
||||
links ?: Link[];
|
||||
// 配置信息
|
||||
config ?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站搜索条件
|
||||
*/
|
||||
export interface WebsiteParam extends PageParam {
|
||||
title ?: string;
|
||||
path ?: string;
|
||||
authority ?: string;
|
||||
parentId ?: number;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 接口统一返回结果
|
||||
*/
|
||||
export interface ApiResult<T> {
|
||||
// 状态码
|
||||
code: number;
|
||||
// 状态信息
|
||||
message?: string;
|
||||
// 返回数据
|
||||
data?: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询统一结果
|
||||
*/
|
||||
export interface PageResult<T> {
|
||||
// 返回数据
|
||||
list: T[];
|
||||
// 总数量
|
||||
count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询基本参数
|
||||
*/
|
||||
export interface PageParam {
|
||||
// 第几页
|
||||
page?: number;
|
||||
// 每页多少条
|
||||
limit?: number;
|
||||
// 排序字段
|
||||
sort?: string;
|
||||
// 排序方式, asc升序, desc降序
|
||||
order?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 搜素关键词
|
||||
keywords?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* 默认字典数据
|
||||
*/
|
||||
export async function getLinkType() {
|
||||
return {
|
||||
list: [
|
||||
{ value: '0', label: '应用组件', text: '应用组件', comments: '' },
|
||||
{ value: '1', label: '外部链接', text: '外部链接', comments: '' }
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
// 默认字典数据
|
||||
export async function getJson(dictName) {
|
||||
if (dictName == 'customerFollowStatus') {
|
||||
return [
|
||||
{ value: '1', label: '初访', text: '初访', comments: '' },
|
||||
{ value: '2', label: '意向', text: '意向', comments: '' },
|
||||
{ value: '3', label: '报价', text: '报价', comments: '' },
|
||||
{ value: '4', label: '成交', text: '成交', comments: '' },
|
||||
{ value: '5', label: '暂时搁置', text: '暂时搁置', comments: '' },
|
||||
{ value: '6', label: '未成交', text: '未成交', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'customerCategory') {
|
||||
return [
|
||||
{ value: 'my', label: '我创建的', text: '我创建的', comments: '' },
|
||||
{ value: 'stars', label: '标星客户', text: '标星客户', comments: '' },
|
||||
{ value: 'join', label: '我协作的', text: '我协作的', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'orderType') {
|
||||
return [
|
||||
{ value: 'all', label: '全部订单', text: '全部订单', comments: '' },
|
||||
{ value: 'delivery', label: '待发货', text: '待发货', comments: '' },
|
||||
{ value: 'receipt', label: '待收货', text: '待收货', comments: '' },
|
||||
{ value: 'pay', label: '待付款', text: '待付款', comments: '' },
|
||||
{ value: 'complete', label: '已完成', text: '已完成', comments: '' },
|
||||
{ value: 'cancel', label: '已取消', text: '已取消', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'customerSource') {
|
||||
return [
|
||||
{ value: '搜索引擎', label: '搜索引擎', text: '搜索引擎', comments: '' },
|
||||
{ value: '客户介绍', label: '客户介绍', text: '客户介绍', comments: '' },
|
||||
{ value: '代理商', label: '代理商', text: '代理商', comments: '' },
|
||||
{ value: '社交推广', label: '社交推广', text: '社交推广', comments: '' },
|
||||
{ value: '其他', label: '其他', text: '其他', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'serverBrand') {
|
||||
return [
|
||||
{ value: '阿里云', label: '阿里云', text: '阿里云', comments: '' },
|
||||
{ value: '腾讯云', label: '腾讯云', text: '腾讯云', comments: '' },
|
||||
{ value: '华为云', label: '华为云', text: '华为云', comments: '' },
|
||||
{ value: '西部数码', label: '西部数码', text: '西部数码', comments: '' },
|
||||
{ value: '其他', label: '其他', text: '其他', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'orderType') {
|
||||
return [
|
||||
{ value: 'all', label: '全部订单', text: '全部订单', comments: '' },
|
||||
{ value: 'delivery', label: '待发货', text: '待发货', comments: '' },
|
||||
{ value: 'receipt', label: '待收货', text: '待收货', comments: '' },
|
||||
{ value: 'pay', label: '待付款', text: '待付款', comments: '' },
|
||||
{ value: 'complete', label: '已完成', text: '已完成', comments: '' },
|
||||
{ value: 'cancel', label: '已取消', text: '已取消', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'sex') {
|
||||
return [
|
||||
{ value: '1', label: '男', text: '男', comments: null },
|
||||
{ value: '2', label: '女', text: '女', comments: null }
|
||||
];
|
||||
}
|
||||
if (dictName == 'payMethod') {
|
||||
return [
|
||||
{
|
||||
value: '余额支付',
|
||||
label: '余额支付',
|
||||
text: '余额支付'
|
||||
},
|
||||
{
|
||||
value: '微信支付',
|
||||
label: '微信支付',
|
||||
text: '微信支付'
|
||||
},
|
||||
{ value: '支付宝', label: '支付宝', text: '支付宝' }
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import type { UpdatePasswordParam, NoticeResult } from './model';
|
||||
import { MODULES_API_URL, SERVER_API_URL } from '@/config/setting';
|
||||
import type { Company } from '@/api/system/company/model';
|
||||
import type { Website } from '@/api/cms/website/model';
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前登录的用户信息、菜单、权限、角色
|
||||
*/
|
||||
export async function getTenantInfo() : Promise<Company> {
|
||||
const res = await request.get<ApiResult<Company>>(
|
||||
SERVER_API_URL + '/auth/tenant'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取网站信息
|
||||
*/
|
||||
export async function getSiteInfo() {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
MODULES_API_URL + '/cms/website/getSiteInfo'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录的用户信息、菜单、权限、角色
|
||||
*/
|
||||
export async function getUserInfo() : Promise<User> {
|
||||
const res = await request.get<ApiResult<User>>(SERVER_API_URL + '/auth/user');
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 向子模块传递token
|
||||
* @param url
|
||||
*/
|
||||
export async function transferToken(url : string) : Promise<string> {
|
||||
const res = await request.get<ApiResult<unknown>>(url);
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改当前登录的用户密码
|
||||
*/
|
||||
export async function updatePassword(
|
||||
data : UpdatePasswordParam
|
||||
) : Promise<string> {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/auth/password',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message ?? '修改成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取未来7天的日期
|
||||
* @return
|
||||
*/
|
||||
export async function getNext7day() {
|
||||
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getNext7day');
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器时间(实时)
|
||||
* @return
|
||||
*/
|
||||
export async function getServerTime() {
|
||||
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getServerTime');
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地区信息
|
||||
* https://modules.gxwebsoft.com/json/regions-data.json
|
||||
*/
|
||||
export async function getRegions() {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'https://modules.gxwebsoft.com/json/regions-data.json'
|
||||
);
|
||||
console.log('res: ',res);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未读通知
|
||||
*/
|
||||
export async function getUnreadNotice() : Promise<NoticeResult> {
|
||||
return {
|
||||
notice: [
|
||||
{
|
||||
color: '#60B2FC',
|
||||
icon: 'NotificationFilled',
|
||||
title: '你收到了一封14份新周报',
|
||||
time: '2020-07-27 18:30:18'
|
||||
},
|
||||
{
|
||||
color: '#F5686F',
|
||||
icon: 'PushpinFilled',
|
||||
title: '许经理同意了你的请假申请',
|
||||
time: '2020-07-27 09:08:36'
|
||||
},
|
||||
{
|
||||
color: '#7CD734',
|
||||
icon: 'VideoCameraFilled',
|
||||
title: '陈总邀请你参加视频会议',
|
||||
time: '2020-07-26 18:30:01'
|
||||
},
|
||||
{
|
||||
color: '#FAAD14',
|
||||
icon: 'CarryOutFilled',
|
||||
title: '你推荐的刘诗雨已通过第三轮面试',
|
||||
time: '2020-07-25 16:38:46'
|
||||
},
|
||||
{
|
||||
color: '#2BCACD',
|
||||
icon: 'BellFilled',
|
||||
title: '你的6月加班奖金已发放',
|
||||
time: '2020-07-25 11:03:31'
|
||||
}
|
||||
],
|
||||
letter: [
|
||||
{
|
||||
avatar:
|
||||
'https://cdn.eleadmin.com/20200609/c184eef391ae48dba87e3057e70238fb.jpg',
|
||||
title: 'SunSmile 评论了你的日志',
|
||||
content: '写的不错, 以后多多向你学习~',
|
||||
time: '2020-07-27 18:30:18'
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
'https://cdn.eleadmin.com/20200609/948344a2a77c47a7a7b332fe12ff749a.jpg',
|
||||
title: '刘诗雨 点赞了你的日志',
|
||||
content: '写的不错, 以后多多向你学习~',
|
||||
time: '2020-07-27 09:08:36'
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
'https://cdn.eleadmin.com/20200609/2d98970a51b34b6b859339c96b240dcd.jpg',
|
||||
title: '酷酷的大叔 评论了你的周报',
|
||||
content: '写的不错, 以后多多向你学习~',
|
||||
time: '2020-07-26 18:30:01'
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
'https://cdn.eleadmin.com/20200609/f6bc05af944a4f738b54128717952107.jpg',
|
||||
title: 'Jasmine 点赞了你的周报',
|
||||
content: '写的不错, 以后多多向你学习~',
|
||||
time: '2020-07-25 11:03:31'
|
||||
}
|
||||
],
|
||||
todo: [
|
||||
{
|
||||
status: 0,
|
||||
title: '刘诗雨的请假审批',
|
||||
description: '刘诗雨在 07-27 18:30 提交的请假申请'
|
||||
},
|
||||
{
|
||||
status: 1,
|
||||
title: '第三方代码紧急变更',
|
||||
description: '需要在 2020-07-27 之前完成'
|
||||
},
|
||||
{
|
||||
status: 2,
|
||||
title: '信息安全考试',
|
||||
description: '需要在 2020-07-26 18:30 前完成'
|
||||
},
|
||||
{
|
||||
status: 2,
|
||||
title: 'EleAdmin发布新版本',
|
||||
description: '需要在 2020-07-25 11:03 前完成'
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* 首页布局样式
|
||||
*/
|
||||
export interface Layout {
|
||||
// 内容区域的宽度
|
||||
width?: string;
|
||||
// 文字颜色
|
||||
color?: string;
|
||||
// 高亮颜色
|
||||
hover?: string;
|
||||
// 背景颜色
|
||||
backgroundColor?: string;
|
||||
headerStyle?: any;
|
||||
siteNameStyle?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码参数
|
||||
*/
|
||||
export interface UpdatePasswordParam {
|
||||
// 新密码
|
||||
password: string;
|
||||
// 原始密码
|
||||
oldPassword: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知数据格式
|
||||
*/
|
||||
export interface NoticeModel {
|
||||
// 图标颜色
|
||||
color?: string;
|
||||
// 图标
|
||||
icon?: string;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 时间
|
||||
time?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 私信数据格式
|
||||
*/
|
||||
export interface LetterModel {
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 内容
|
||||
content?: string;
|
||||
// 时间
|
||||
time?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代办数据格式
|
||||
*/
|
||||
export interface TodoModel {
|
||||
// 状态
|
||||
status?: number;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 描述
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未读通知返回结果
|
||||
*/
|
||||
export interface NoticeResult {
|
||||
notice: NoticeModel[];
|
||||
letter: LetterModel[];
|
||||
todo: TodoModel[];
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { App, AppParam } from './model/index';
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pageApp(params: AppParam) {
|
||||
const res = await request.get<ApiResult<PageResult<App>>>('/oa/app/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用列表
|
||||
*/
|
||||
export async function listApp(params?: AppParam) {
|
||||
const res = await request.get<ApiResult<App[]>>('/oa/app', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用
|
||||
*/
|
||||
export async function getApp(id: number) {
|
||||
const res = await request.get<ApiResult<App>>('/oa/app/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用
|
||||
*/
|
||||
export async function addApp(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
*/
|
||||
export async function updateApp(data: App) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/app', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用
|
||||
*/
|
||||
export async function removeApp(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用
|
||||
*/
|
||||
export async function removeBatchApp(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/oa/app/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getAppSecret(data: App) {
|
||||
const res = await request.post<ApiResult<App>>(
|
||||
'/open/app/getAppSecret',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function updateAppSecret(data: App) {
|
||||
const res = await request.post<ApiResult<App>>(
|
||||
'/oa/app/updateAppSecret',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单
|
||||
export async function saveMenu(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app/saveMenu', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单按钮
|
||||
export async function saveAuthority(data: any[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/oa/app/saveAuthority',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { AppUser } from '@/api/oa/app/user/model';
|
||||
|
||||
/**
|
||||
* 应用
|
||||
*/
|
||||
export interface App {
|
||||
// 应用id
|
||||
appId?: number;
|
||||
// 应用秘钥
|
||||
appSecret?: string;
|
||||
// 英文名称
|
||||
enName?: string;
|
||||
// 应用名称
|
||||
appName?: string;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 应用编号
|
||||
appCode?: string;
|
||||
// 应用图标
|
||||
appIcon?: string;
|
||||
appQrcode?: string;
|
||||
// 应用截图
|
||||
images?: string;
|
||||
// 应用类型
|
||||
appType?: string;
|
||||
appTypeMultiple?: string[];
|
||||
// 菜单类型
|
||||
menuType?: number;
|
||||
// 应用地址
|
||||
appUrl?: string;
|
||||
// 后台管理地址
|
||||
adminUrl?: string;
|
||||
// 原型图地址
|
||||
prototypeUrl?: string;
|
||||
// 下载地址
|
||||
downUrl?: string;
|
||||
// 服务器接口地址
|
||||
serverUrl?: string;
|
||||
// 模块接口地址
|
||||
modulesUrl?: string;
|
||||
// 回调地址
|
||||
callbackUrl?: string;
|
||||
// 腾讯文档地址
|
||||
gitUrl?: string;
|
||||
docsUrl?: string;
|
||||
ipAddress?: string;
|
||||
fileUrl?: string;
|
||||
// 应用包名
|
||||
packageName?: string;
|
||||
// 点击次数
|
||||
clicks?: string;
|
||||
// 安装次数
|
||||
installs?: string;
|
||||
// 应用介绍
|
||||
content?: string;
|
||||
// 开发者(个人)
|
||||
developer?: string;
|
||||
director?: string;
|
||||
projectDirector?: string;
|
||||
salesman?: string;
|
||||
// 续费金额
|
||||
renewMoney?: string;
|
||||
// 软件定价
|
||||
price?: string;
|
||||
// 评分
|
||||
score?: string;
|
||||
// 星级
|
||||
star?: string;
|
||||
// 菜单组件地址
|
||||
component?: string;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 权限标识
|
||||
authority?: string;
|
||||
// 打开位置
|
||||
target?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 菜单侧栏选中的path
|
||||
active?: string;
|
||||
// 其它路由元信息
|
||||
meta?: string;
|
||||
// 版本
|
||||
edition?: string;
|
||||
// 版本号
|
||||
version?: string;
|
||||
// 是否已安装
|
||||
isUse?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: any;
|
||||
tenantName?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
// 租户编号
|
||||
tenantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 应用状态
|
||||
appStatus?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 发布者
|
||||
userId?: any;
|
||||
// 发布者昵称
|
||||
nickname?: string;
|
||||
// 子菜单
|
||||
children?: App[];
|
||||
// 权限树回显选中状态, 0未选中, 1选中
|
||||
checked?: boolean;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
parentIds?: number[];
|
||||
//
|
||||
openType?: number;
|
||||
//
|
||||
search?: any;
|
||||
// 成员管理
|
||||
users?: AppUser[];
|
||||
// 项目需求
|
||||
requirement?: string;
|
||||
file1?: string;
|
||||
file2?: string;
|
||||
file3?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用搜索条件
|
||||
*/
|
||||
export interface AppParam extends PageParam {
|
||||
userId?: number;
|
||||
appName?: any;
|
||||
appCode?: string;
|
||||
appId?: number;
|
||||
developer?: string;
|
||||
tenantCode?: string;
|
||||
parentId?: string;
|
||||
tenantName?: string;
|
||||
companyName?: string;
|
||||
companyId?: number;
|
||||
status?: number;
|
||||
nickname?: string;
|
||||
appStatus?: any;
|
||||
showExpiration?: boolean;
|
||||
keywords?: any;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppRenew, AppRenewParam } from '@/api/oa/app/renew/model';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAppRenew(params: AppRenewParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppRenew>>>(
|
||||
'/oa/app-renew/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAppRenew(params?: AppRenewParam) {
|
||||
const res = await request.get<ApiResult<AppRenew[]>>('/oa/app-renew', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询开发成员
|
||||
*/
|
||||
export async function getAppRenew(id: number) {
|
||||
const res = await request.get<ApiResult<AppRenew>>('/oa/app-renew/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加开发成员
|
||||
*/
|
||||
export async function addAppRenew(data: AppRenew) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app-renew', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAppRenew(data: AppRenew) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/app-renew', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAppRenew(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app-renew/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAppRenew(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app-renew/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/oa/app-renew/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AppRenew {
|
||||
appRenewId?: number;
|
||||
money?: any;
|
||||
comments?: string;
|
||||
startTime?: any;
|
||||
endTime?: any;
|
||||
userId?: number;
|
||||
nickname?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
mobile?: string;
|
||||
appId?: number;
|
||||
companyId?: number;
|
||||
status?: any;
|
||||
images?: string;
|
||||
files?: any;
|
||||
createTime?: string;
|
||||
editStatus?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AppRenewParam extends PageParam {
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppUser, AppUserParam } from '@/api/oa/app/user/model';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAppUser(params: AppUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppUser>>>(
|
||||
'/oa/app-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAppUser(params?: AppUserParam) {
|
||||
const res = await request.get<ApiResult<AppUser[]>>('/oa/app-user', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询开发成员
|
||||
*/
|
||||
export async function getAppUser(id: number) {
|
||||
const res = await request.get<ApiResult<AppUser>>('/oa/app-user/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加开发成员
|
||||
*/
|
||||
export async function addAppUser(data: AppUser) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app-user', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAppUser(data: AppUser) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/app-user', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAppUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/oa/app-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAppUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/oa/app-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/oa/app-user/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AppUser {
|
||||
// 开发成员id
|
||||
appUserId?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
mobile?: string;
|
||||
appId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AppUserParam extends PageParam {
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Customer } from './model';
|
||||
|
||||
/**
|
||||
* 申请免费体验
|
||||
*/
|
||||
export async function apply(data: Customer) {
|
||||
const res = await request.post<ApiResult<unknown>>('/customer-apply', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
export interface Customer {
|
||||
// 客户id
|
||||
customerId?: number;
|
||||
// 客户类型
|
||||
customerType?: string;
|
||||
// 客户标识
|
||||
customerCode: string;
|
||||
// 客户名称
|
||||
customerName?: string;
|
||||
// 客户头像
|
||||
customerAvatar?: string;
|
||||
// 座机电话
|
||||
customerPhone?: string;
|
||||
// 手机号码
|
||||
customerMobile?: string;
|
||||
// 联系人
|
||||
customerContacts?: string;
|
||||
// 联系地址
|
||||
customerAddress?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户搜索条件
|
||||
*/
|
||||
export interface CustomerParam extends PageParam {
|
||||
customerName?: string;
|
||||
customerCode?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Assets, AssetsParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询资产
|
||||
*/
|
||||
export async function pageAssets(params: AssetsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Assets>>>(
|
||||
'/oa/assets/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产列表
|
||||
*/
|
||||
export async function listAssets(params?: AssetsParam) {
|
||||
const res = await request.get<ApiResult<Assets[]>>('/oa/assets', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询服务器
|
||||
*/
|
||||
export async function getAssets(id: number) {
|
||||
const res = await request.get<ApiResult<Assets>>('/oa/assets/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加资产
|
||||
*/
|
||||
export async function addAssets(data: Assets) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/assets', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产
|
||||
*/
|
||||
export async function updateAssets(data: Assets) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/assets', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产
|
||||
*/
|
||||
export async function removeAssets(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/assets/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除资产
|
||||
*/
|
||||
export async function removeBatchAssets(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/assets/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/oa/assets/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
|
||||
/**
|
||||
* 资产
|
||||
*/
|
||||
export interface Assets {
|
||||
// 资产id
|
||||
assetsId?: number;
|
||||
// 资产类型
|
||||
type?: string;
|
||||
// 资产标识
|
||||
code: string;
|
||||
// 资产名称
|
||||
name?: string;
|
||||
//
|
||||
account?: string;
|
||||
//
|
||||
password?: string;
|
||||
//
|
||||
panel?: string;
|
||||
//
|
||||
panelAccount?: string;
|
||||
//
|
||||
panelPassword?: string;
|
||||
//
|
||||
configuration?: any;
|
||||
root?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
financeAmount?: any;
|
||||
financeYears?: any;
|
||||
financeRenew?: any;
|
||||
financeCustomerName?: string;
|
||||
financeCustomerContact?: string;
|
||||
financeCustomerPhone?: string;
|
||||
//
|
||||
brandAccount?: string;
|
||||
brandPassword?: string;
|
||||
btSign?: string;
|
||||
openPort?: any;
|
||||
comments?: string;
|
||||
// 所属客户
|
||||
customerId?: number;
|
||||
customerName?: string;
|
||||
// 品牌
|
||||
brand?: string;
|
||||
// 购买时间
|
||||
startTime?: string;
|
||||
// 到期时间
|
||||
endTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
userId?: number;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
nickname?: string;
|
||||
// 可见性类型
|
||||
visibility?: string;
|
||||
// 可见用户ID
|
||||
userList?: User[];
|
||||
systemTotal?: Object;
|
||||
diskInfo?: Object;
|
||||
netWork?: Object;
|
||||
sites?: Object;
|
||||
}
|
||||
|
||||
/**
|
||||
* 资产搜索条件
|
||||
*/
|
||||
export interface AssetsParam extends PageParam {
|
||||
name?: string;
|
||||
code?: string;
|
||||
isExpire?: string;
|
||||
status?: string;
|
||||
brand?: string;
|
||||
customerId?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
userId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
AssetsUser,
|
||||
AssetsUserParam
|
||||
} from '@/api/oa/assets/user/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAssetsUser(params: AssetsUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AssetsUser>>>(
|
||||
'/oa/assets-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAssetsUser(params?: AssetsUserParam) {
|
||||
const res = await request.get<ApiResult<AssetsUser[]>>('/oa/assets-user', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询开发成员
|
||||
*/
|
||||
export async function getAssetsUser(id: number) {
|
||||
const res = await request.get<ApiResult<AssetsUser>>('/oa/assets-user/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加开发成员
|
||||
*/
|
||||
export async function addAssetsUser(data: AssetsUser) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/assets-user', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAssetsUser(data: AssetsUser) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/assets-user', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAssetsUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/assets-user/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAssetsUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/assets-user/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/oa/assets-user/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AssetsUser {
|
||||
// 开发成员id
|
||||
id?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
assetsId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AssetsUserParam extends PageParam {
|
||||
userId?: number;
|
||||
assetsId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { ChatParam } from '@/api/oa/chatgpt/model';
|
||||
|
||||
/**
|
||||
* 发送
|
||||
*/
|
||||
export async function send(data: ChatParam) {
|
||||
const res = await request.post<ApiResult<unknown>>('/open/chat/send', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求openAI
|
||||
* /open/chat/chat
|
||||
* 'https://chatgpt.websoft.top/api/open/chat/chat',
|
||||
*/
|
||||
export async function chat(data: ChatParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'https://chatgpt.websoft.top/api/open/chat/chat',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
export interface Chat {
|
||||
noticeId?: number;
|
||||
content?: any;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务搜索条件
|
||||
*/
|
||||
export interface ChatParam {
|
||||
tenantId?: number;
|
||||
content?: string;
|
||||
noticeId?: number;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Customer, CustomerParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询客户
|
||||
*/
|
||||
export async function pageCustomer(params: CustomerParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Customer>>>(
|
||||
'/oa/customer/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户列表
|
||||
*/
|
||||
export async function listCustomer(params?: CustomerParam) {
|
||||
const res = await request.get<ApiResult<Customer[]>>('/oa/customer', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询客户
|
||||
*/
|
||||
export async function getCustomer(id: number) {
|
||||
const res = await request.get<ApiResult<Customer>>('/oa/customer/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加客户
|
||||
*/
|
||||
export async function addCustomer(data: Customer) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/customer', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户
|
||||
*/
|
||||
export async function updateCustomer(data: Customer) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/customer', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改客户
|
||||
*/
|
||||
export async function updateBatchCustomer(data: Customer[]) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/customer/batch', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户
|
||||
*/
|
||||
export async function removeCustomer(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/customer/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户
|
||||
*/
|
||||
export async function removeBatchCustomer(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/customer/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/oa/customer/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
export interface Customer {
|
||||
// 客户id
|
||||
customerId?: number;
|
||||
// 客户类型
|
||||
customerType?: string;
|
||||
// 客户来源
|
||||
customerSource?: string;
|
||||
// 客户标识
|
||||
customerCode: string;
|
||||
// 客户名称
|
||||
customerName?: string;
|
||||
// 客户全称
|
||||
customerFullName?: string;
|
||||
// 客户头像
|
||||
customerAvatar?: string;
|
||||
// 座机电话
|
||||
customerPhone?: string;
|
||||
// 手机号码
|
||||
customerMobile?: string;
|
||||
// 联系人
|
||||
customerContacts?: string;
|
||||
// 联系地址
|
||||
customerAddress?: string;
|
||||
customerProvince?: string;
|
||||
customerCity?: string;
|
||||
customerRegion?: string;
|
||||
longitude?: string;
|
||||
latitude?: string;
|
||||
// 跟进状态
|
||||
progress?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
// 用户ID
|
||||
userId?: any;
|
||||
// 发布者昵称
|
||||
nickname?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户搜索条件
|
||||
*/
|
||||
export interface CustomerParam extends PageParam {
|
||||
customerName?: string;
|
||||
customerCode?: string;
|
||||
customerType?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
customerCategory?: string;
|
||||
progress?: string;
|
||||
customerSource?: string;
|
||||
betweenTime?: any;
|
||||
userId?: number;
|
||||
nickname?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Link, LinkParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询链接
|
||||
*/
|
||||
export async function pageLink(params: LinkParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Link>>>(
|
||||
MODULES_API_URL + '/oa/link/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询链接列表
|
||||
*/
|
||||
export async function listLink(params?: LinkParam) {
|
||||
const res = await request.get<ApiResult<Link[]>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加链接
|
||||
*/
|
||||
export async function addLink(data: Link) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改链接
|
||||
*/
|
||||
export async function updateLink(data: Link) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除链接
|
||||
*/
|
||||
export async function removeLink(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除链接
|
||||
*/
|
||||
export async function removeBatchLink(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 链接
|
||||
*/
|
||||
export interface Link {
|
||||
id?: number;
|
||||
name?: string;
|
||||
icon?: string;
|
||||
url?: string;
|
||||
linkType?: string;
|
||||
appId?: number;
|
||||
userId?: number;
|
||||
comments?: string;
|
||||
recommend?: number;
|
||||
sortNumber?: number;
|
||||
deleted?: number;
|
||||
status?: number;
|
||||
createTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 链接搜索条件
|
||||
*/
|
||||
export interface LinkParam extends PageParam {
|
||||
id?: number;
|
||||
linkType?: string;
|
||||
name?: string;
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Notice, NoticeParam } from './model/index';
|
||||
import { TabsParam } from '@/api/tabs';
|
||||
|
||||
/**
|
||||
* 分页查询消息
|
||||
*/
|
||||
export async function pageNotice(params: NoticeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Notice>>>(
|
||||
'/oa/notice/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询消息列表
|
||||
*/
|
||||
export async function listNotice(params?: NoticeParam) {
|
||||
const res = await request.get<ApiResult<Notice[]>>('/oa/notice', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询消息
|
||||
*/
|
||||
export async function getNotice(id: number) {
|
||||
const res = await request.get<ApiResult<Notice>>('/oa/notice/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加消息
|
||||
*/
|
||||
export async function addNotice(data: Notice) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/notice', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息
|
||||
*/
|
||||
export async function updateNotice(data: Notice) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/notice', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
*/
|
||||
export async function removeNotice(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/notice/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改消息
|
||||
*/
|
||||
export async function updateBatchNotices(data: Notice[]) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/notice/batch', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除消息
|
||||
*/
|
||||
export async function removeBatchNotice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/notice/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getCount(params?: TabsParam) {
|
||||
const res = await request.get<ApiResult<TabsParam>>('/oa/notice/count', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
export interface Notice {
|
||||
// 消息id
|
||||
noticeRecordId?: number;
|
||||
noticeId?: number;
|
||||
title?: string;
|
||||
channel?: string;
|
||||
avatar?: string;
|
||||
content?: string;
|
||||
files?: string;
|
||||
developerId?: number;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息搜索条件
|
||||
*/
|
||||
export interface NoticeParam extends PageParam {
|
||||
type?: string;
|
||||
noticeRecordId?: number;
|
||||
noticeId?: number;
|
||||
userId?: number;
|
||||
developerId?: number;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
// 查询未读数量
|
||||
export interface NnReadNum {
|
||||
notice?: string;
|
||||
letter?: number;
|
||||
todo?: number;
|
||||
chatGPT?: number;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Project, ProjectParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询项目
|
||||
*/
|
||||
export async function pageProject(params: ProjectParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Project>>>(
|
||||
'/oa/project/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目列表
|
||||
*/
|
||||
export async function listProject(params?: ProjectParam) {
|
||||
const res = await request.get<ApiResult<Project[]>>('/oa/project', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目
|
||||
*/
|
||||
export async function getProject(id: number) {
|
||||
const res = await request.get<ApiResult<Project>>('/oa/project/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目
|
||||
*/
|
||||
export async function addProject(data: Project) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/project', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目
|
||||
*/
|
||||
export async function updateProject(data: Project) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/project', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目
|
||||
*/
|
||||
export async function removeProject(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/project/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目
|
||||
*/
|
||||
export async function removeBatchProject(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/project/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/oa/project/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目
|
||||
*/
|
||||
export interface Project {
|
||||
// 项目id
|
||||
projectId?: number;
|
||||
// 项目类型
|
||||
projectType?: string;
|
||||
// 项目分类
|
||||
projectCategory?: string;
|
||||
// 项目标识
|
||||
projectCode: string;
|
||||
// 项目名称
|
||||
projectName?: string;
|
||||
// 项目图标
|
||||
projectAvatar?: string;
|
||||
url?: string;
|
||||
urlDev?: string;
|
||||
urlAdmin?: string;
|
||||
account?: string;
|
||||
money?: string;
|
||||
realMoney?: string;
|
||||
annualFee?: string;
|
||||
qrcode?: string;
|
||||
progress?: string;
|
||||
views?: string;
|
||||
// 项目详情
|
||||
content?: string;
|
||||
// 客户ID
|
||||
customerId?: number;
|
||||
// 客户名称
|
||||
customerName?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目搜索条件
|
||||
*/
|
||||
export interface ProjectParam extends PageParam {
|
||||
projectName?: string;
|
||||
projectCode?: string;
|
||||
status?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { TaskCount, TaskCountParam } from './model/index';
|
||||
import { TabsParam } from '@/api/tabs';
|
||||
|
||||
/**
|
||||
* 分页查询统计
|
||||
*/
|
||||
export async function pageTaskCount(params: TaskCountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TaskCount>>>(
|
||||
'/oa/task-count/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询统计列表
|
||||
*/
|
||||
export async function listTaskCount(params?: TaskCountParam) {
|
||||
const res = await request.get<ApiResult<TaskCount[]>>('/oa/task-count', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询统计
|
||||
*/
|
||||
export async function getTaskCount(id: number) {
|
||||
const res = await request.get<ApiResult<TaskCount>>('/oa/task-count/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加统计
|
||||
*/
|
||||
export async function addTaskCount(data: TaskCount) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/task-count', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改统计
|
||||
*/
|
||||
export async function updateTaskCount(data: TaskCount) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/task-count', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除统计
|
||||
*/
|
||||
export async function removeTaskCount(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/task-count/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除统计
|
||||
*/
|
||||
export async function removeBatchTaskCount(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/task-count/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getCount(params?: TabsParam) {
|
||||
const res = await request.get<ApiResult<TabsParam>>('/oa/task-count/count', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*/
|
||||
export interface TaskCount {
|
||||
// 统计id
|
||||
taskCountId?: number;
|
||||
userId?: number;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
phone?: string;
|
||||
pending?: number;
|
||||
unused?: number;
|
||||
today?: number;
|
||||
month?: number;
|
||||
year?: number;
|
||||
total?: number;
|
||||
commander?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计搜索条件
|
||||
*/
|
||||
export interface TaskCountParam extends PageParam {
|
||||
taskCountId?: number;
|
||||
userId?: number;
|
||||
roleId?: number;
|
||||
roleCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { TaskRecord, TaskRecordParam } from './model/index';
|
||||
import { TabsParam } from '@/api/tabs';
|
||||
|
||||
/**
|
||||
* 分页查询任务
|
||||
*/
|
||||
export async function pageTaskRecord(params: TaskRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TaskRecord>>>(
|
||||
'/oa/task-record/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务列表
|
||||
*/
|
||||
export async function listTaskRecord(params?: TaskRecordParam) {
|
||||
const res = await request.get<ApiResult<TaskRecord[]>>('/oa/task-record', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询任务
|
||||
*/
|
||||
export async function getTaskRecord(id: number) {
|
||||
const res = await request.get<ApiResult<TaskRecord>>('/oa/task-record/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加任务
|
||||
*/
|
||||
export async function addTaskRecord(data: TaskRecord) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/task-record', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务
|
||||
*/
|
||||
export async function updateTaskRecord(data: TaskRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/task-record', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*/
|
||||
export async function removeTaskRecord(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/task-record/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除任务
|
||||
*/
|
||||
export async function removeBatchTaskRecord(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/oa/task-record/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getCount(params?: TabsParam) {
|
||||
const res = await request.get<ApiResult<TabsParam>>('/oa/task-record/count', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user