feat: 新增api接口文件
parent
8b477131a2
commit
e0080bb3e0
|
|
@ -0,0 +1,75 @@
|
|||
import type { PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiChatConversationApi {
|
||||
export interface ChatConversation {
|
||||
id: number; // ID 编号
|
||||
userId: number; // 用户编号
|
||||
title: string; // 对话标题
|
||||
pinned: boolean; // 是否置顶
|
||||
roleId: number; // 角色编号
|
||||
modelId: number; // 模型编号
|
||||
model: string; // 模型标志
|
||||
temperature: number; // 温度参数
|
||||
maxTokens: number; // 单条回复的最大 Token 数量
|
||||
maxContexts: number; // 上下文的最大 Message 数量
|
||||
createTime?: Date; // 创建时间
|
||||
// 额外字段
|
||||
systemMessage?: string; // 角色设定
|
||||
modelName?: string; // 模型名字
|
||||
roleAvatar?: string; // 角色头像
|
||||
modelMaxTokens?: string; // 模型的单条回复的最大 Token 数量
|
||||
modelMaxContexts?: string; // 模型的上下文的最大 Message 数量
|
||||
}
|
||||
}
|
||||
|
||||
// 获得【我的】聊天对话
|
||||
export function getChatConversationMy(id: number) {
|
||||
return requestClient.get<AiChatConversationApi.ChatConversation>(
|
||||
`/ai/chat/conversation/get-my?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 新增【我的】聊天对话
|
||||
export function createChatConversationMy(
|
||||
data: AiChatConversationApi.ChatConversation,
|
||||
) {
|
||||
return requestClient.post('/ai/chat/conversation/create-my', data);
|
||||
}
|
||||
|
||||
// 更新【我的】聊天对话
|
||||
export function updateChatConversationMy(
|
||||
data: AiChatConversationApi.ChatConversation,
|
||||
) {
|
||||
return requestClient.put(`/ai/chat/conversation/update-my`, data);
|
||||
}
|
||||
|
||||
// 删除【我的】聊天对话
|
||||
export function deleteChatConversationMy(id: number) {
|
||||
return requestClient.delete(`/ai/chat/conversation/delete-my?id=${id}`);
|
||||
}
|
||||
|
||||
// 删除【我的】所有对话,置顶除外
|
||||
export function deleteChatConversationMyByUnpinned() {
|
||||
return requestClient.delete(`/ai/chat/conversation/delete-by-unpinned`);
|
||||
}
|
||||
|
||||
// 获得【我的】聊天对话列表
|
||||
export function getChatConversationMyList() {
|
||||
return requestClient.get<AiChatConversationApi.ChatConversation[]>(
|
||||
`/ai/chat/conversation/my-list`,
|
||||
);
|
||||
}
|
||||
|
||||
// 获得【我的】聊天对话列表
|
||||
export function getChatConversationPage(params: any) {
|
||||
return requestClient.get<
|
||||
PageResult<AiChatConversationApi.ChatConversation[]>
|
||||
>(`/ai/chat/conversation/page`, { params });
|
||||
}
|
||||
|
||||
// 管理员删除消息
|
||||
export function deleteChatConversationByAdmin(id: number) {
|
||||
return requestClient.delete(`/ai/chat/conversation/delete-by-admin?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
import type { PageResult } from '@vben/request';
|
||||
|
||||
import { useAppConfig } from '@vben/hooks';
|
||||
import { fetchEventSource } from '@vben/request';
|
||||
import { useAccessStore } from '@vben/stores';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||
const accessStore = useAccessStore();
|
||||
export namespace AiChatMessageApi {
|
||||
export interface ChatMessage {
|
||||
id: number; // 编号
|
||||
conversationId: number; // 对话编号
|
||||
type: string; // 消息类型
|
||||
userId: string; // 用户编号
|
||||
roleId: string; // 角色编号
|
||||
model: number; // 模型标志
|
||||
modelId: number; // 模型编号
|
||||
content: string; // 聊天内容
|
||||
tokens: number; // 消耗 Token 数量
|
||||
segmentIds?: number[]; // 段落编号
|
||||
segments?: {
|
||||
content: string; // 段落内容
|
||||
documentId: number; // 文档编号
|
||||
documentName: string; // 文档名称
|
||||
id: number; // 段落编号
|
||||
}[];
|
||||
createTime: Date; // 创建时间
|
||||
roleAvatar: string; // 角色头像
|
||||
userAvatar: string; // 用户头像
|
||||
}
|
||||
}
|
||||
|
||||
// 消息列表
|
||||
export function getChatMessageListByConversationId(
|
||||
conversationId: null | number,
|
||||
) {
|
||||
return requestClient.get<AiChatMessageApi.ChatMessage[]>(
|
||||
`/ai/chat/message/list-by-conversation-id?conversationId=${conversationId}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 发送 Stream 消息
|
||||
export function sendChatMessageStream(
|
||||
conversationId: number,
|
||||
content: string,
|
||||
ctrl: any,
|
||||
enableContext: boolean,
|
||||
onMessage: any,
|
||||
onError: any,
|
||||
onClose: any,
|
||||
) {
|
||||
const token = accessStore.accessToken;
|
||||
return fetchEventSource(`${apiURL}/ai/chat/message/send-stream`, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
openWhenHidden: true,
|
||||
body: JSON.stringify({
|
||||
conversationId,
|
||||
content,
|
||||
useContext: enableContext,
|
||||
}),
|
||||
onmessage: onMessage,
|
||||
onerror: onError,
|
||||
onclose: onClose,
|
||||
signal: ctrl.signal,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除消息
|
||||
export function deleteChatMessage(id: number) {
|
||||
return requestClient.delete(`/ai/chat/message/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// 删除指定对话的消息
|
||||
export function deleteByConversationId(conversationId: number) {
|
||||
return requestClient.delete(
|
||||
`/ai/chat/message/delete-by-conversation-id?conversationId=${conversationId}`,
|
||||
);
|
||||
}
|
||||
// 获得消息分页
|
||||
export function getChatMessagePage(params: any) {
|
||||
return requestClient.get<PageResult<AiChatMessageApi.ChatMessage>>(
|
||||
'/ai/chat/message/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
// 管理员删除消息
|
||||
export function deleteChatMessageByAdmin(id: number) {
|
||||
return requestClient.delete(`/ai/chat/message/delete-by-admin?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiImageApi {
|
||||
export interface ImageMidjourneyButtons {
|
||||
customId: string; // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识
|
||||
emoji: string; // 图标 emoji
|
||||
label: string; // Make Variations 文本
|
||||
style: number; // 样式: 2(Primary)、3(Green)
|
||||
}
|
||||
// AI 绘图
|
||||
export interface Image {
|
||||
id: number; // 编号
|
||||
platform: string; // 平台
|
||||
model: string; // 模型
|
||||
prompt: string; // 提示词
|
||||
width: number; // 图片宽度
|
||||
height: number; // 图片高度
|
||||
status: number; // 状态
|
||||
publicStatus: boolean; // 公开状态
|
||||
picUrl: string; // 任务地址
|
||||
errorMessage: string; // 错误信息
|
||||
options: any; // 配置 Map<string, string>
|
||||
taskId: number; // 任务编号
|
||||
buttons: ImageMidjourneyButtons[]; // mj 操作按钮
|
||||
createTime: Date; // 创建时间
|
||||
finishTime: Date; // 完成时间
|
||||
}
|
||||
|
||||
export interface ImageDrawReq {
|
||||
prompt: string; // 提示词
|
||||
modelId: number; // 模型
|
||||
style: string; // 图像生成的风格
|
||||
width: string; // 图片宽度
|
||||
height: string; // 图片高度
|
||||
options: object; // 绘制参数,Map<String, String>
|
||||
}
|
||||
|
||||
export interface ImageMidjourneyImagineReq {
|
||||
prompt: string; // 提示词
|
||||
modelId: number; // 模型
|
||||
base64Array?: string[]; // size不能为空
|
||||
width: string; // 图片宽度
|
||||
height: string; // 图片高度
|
||||
version: string; // 版本
|
||||
}
|
||||
|
||||
export interface ImageMidjourneyAction {
|
||||
id: number; // 图片编号
|
||||
customId: string; // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识
|
||||
}
|
||||
}
|
||||
|
||||
// 获取【我的】绘图分页
|
||||
export function getImagePageMy(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiImageApi.Image>>('/ai/image/my-page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取【我的】绘图记录
|
||||
export function getImageMy(id: number) {
|
||||
return requestClient.get<AiImageApi.Image>(`/ai/image/get-my?id=${id}`);
|
||||
}
|
||||
|
||||
// 获取【我的】绘图记录列表
|
||||
export function getImageListMyByIds(ids: number[]) {
|
||||
return requestClient.get<AiImageApi.Image[]>(`/ai/image/my-list-by-ids`, {
|
||||
params: { ids: ids.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
// 生成图片
|
||||
export function drawImage(data: AiImageApi.ImageDrawReq) {
|
||||
return requestClient.post(`/ai/image/draw`, data);
|
||||
}
|
||||
|
||||
// 删除【我的】绘画记录
|
||||
export function deleteImageMy(id: number) {
|
||||
return requestClient.delete(`/ai/image/delete-my?id=${id}`);
|
||||
}
|
||||
|
||||
// ================ midjourney 专属 ================
|
||||
// 【Midjourney】生成图片
|
||||
export function midjourneyImagine(data: AiImageApi.ImageMidjourneyImagineReq) {
|
||||
return requestClient.post(`/ai/image/midjourney/imagine`, data);
|
||||
}
|
||||
|
||||
// 【Midjourney】Action 操作(二次生成图片)
|
||||
export function midjourneyAction(data: AiImageApi.ImageMidjourneyAction) {
|
||||
return requestClient.post(`/ai/image/midjourney/action`, data);
|
||||
}
|
||||
|
||||
// ================ 绘图管理 ================
|
||||
// 查询绘画分页
|
||||
export function getImagePage(params: any) {
|
||||
return requestClient.get<AiImageApi.Image[]>(`/ai/image/page`, { params });
|
||||
}
|
||||
|
||||
// 更新绘画发布状态
|
||||
export function updateImage(data: any) {
|
||||
return requestClient.put(`/ai/image/update`, data);
|
||||
}
|
||||
|
||||
// 删除绘画
|
||||
export function deleteImage(id: number) {
|
||||
return requestClient.delete(`/ai/image/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiKnowledgeDocumentApi {
|
||||
export interface KnowledgeDocument {
|
||||
id: number; // 编号
|
||||
knowledgeId: number; // 知识库编号
|
||||
name: string; // 文档名称
|
||||
contentLength: number; // 字符数
|
||||
tokens: number; // token 数
|
||||
segmentMaxTokens: number; // 分片最大 token 数
|
||||
retrievalCount: number; // 召回次数
|
||||
status: number; // 是否启用
|
||||
}
|
||||
}
|
||||
|
||||
// 查询知识库文档分页
|
||||
export function getKnowledgeDocumentPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<AiKnowledgeDocumentApi.KnowledgeDocument>
|
||||
>('/ai/knowledge/document/page', { params });
|
||||
}
|
||||
|
||||
// 查询知识库文档详情
|
||||
export function getKnowledgeDocument(id: number) {
|
||||
return requestClient.get(`/ai/knowledge/document/get?id=${id}`);
|
||||
}
|
||||
// 新增知识库文档(单个)
|
||||
export function createKnowledge(data: any) {
|
||||
return requestClient.post('/ai/knowledge/document/create', data);
|
||||
}
|
||||
// 新增知识库文档(多个)
|
||||
export function createKnowledgeDocumentList(data: any) {
|
||||
return requestClient.post('/ai/knowledge/document/create-list', data);
|
||||
}
|
||||
|
||||
// 修改知识库文档
|
||||
export function updateKnowledgeDocument(data: any) {
|
||||
return requestClient.put('/ai/knowledge/document/update', data);
|
||||
}
|
||||
|
||||
// 修改知识库文档状态
|
||||
export function updateKnowledgeDocumentStatus(data: any) {
|
||||
return requestClient.put('/ai/knowledge/document/update-status', data);
|
||||
}
|
||||
// 删除知识库文档
|
||||
export function deleteKnowledgeDocument(id: number) {
|
||||
return requestClient.delete(`/ai/knowledge/document/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiKnowledgeKnowledgeApi {
|
||||
export interface Knowledge {
|
||||
id: number; // 编号
|
||||
name: string; // 知识库名称
|
||||
description: string; // 知识库描述
|
||||
embeddingModelId: number; // 嵌入模型编号,高质量模式时维护
|
||||
topK: number; // topK
|
||||
similarityThreshold: number; // 相似度阈值
|
||||
}
|
||||
}
|
||||
|
||||
// 查询知识库分页
|
||||
export function getKnowledgePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiKnowledgeKnowledgeApi.Knowledge>>(
|
||||
'/ai/knowledge/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 查询知识库详情
|
||||
export function getKnowledge(id: number) {
|
||||
return requestClient.get<AiKnowledgeKnowledgeApi.Knowledge>(
|
||||
`/ai/knowledge/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
// 新增知识库
|
||||
export function createKnowledge(data: AiKnowledgeKnowledgeApi.Knowledge) {
|
||||
return requestClient.post('/ai/knowledge/create', data);
|
||||
}
|
||||
|
||||
// 修改知识库
|
||||
export function updateKnowledge(data: AiKnowledgeKnowledgeApi.Knowledge) {
|
||||
return requestClient.put('/ai/knowledge/update', data);
|
||||
}
|
||||
|
||||
// 删除知识库
|
||||
export function deleteKnowledge(id: number) {
|
||||
return requestClient.delete(`/ai/knowledge/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// 获取知识库简单列表
|
||||
export function getSimpleKnowledgeList() {
|
||||
return requestClient.get<AiKnowledgeKnowledgeApi.Knowledge[]>(
|
||||
'/ai/knowledge/simple-list',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiKnowledgeSegmentApi {
|
||||
// AI 知识库分段
|
||||
export interface KnowledgeSegment {
|
||||
id: number; // 编号
|
||||
documentId: number; // 文档编号
|
||||
knowledgeId: number; // 知识库编号
|
||||
vectorId: string; // 向量库编号
|
||||
content: string; // 切片内容
|
||||
contentLength: number; // 切片内容长度
|
||||
tokens: number; // token 数量
|
||||
retrievalCount: number; // 召回次数
|
||||
status: number; // 文档状态
|
||||
createTime: number; // 创建时间
|
||||
}
|
||||
}
|
||||
|
||||
// 查询知识库分段分页
|
||||
export function getKnowledgeSegmentPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiKnowledgeSegmentApi.KnowledgeSegment>>(
|
||||
'/ai/knowledge/segment/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 查询知识库分段详情
|
||||
export function getKnowledgeSegment(id: number) {
|
||||
return requestClient.get<AiKnowledgeSegmentApi.KnowledgeSegment>(
|
||||
`/ai/knowledge/segment/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
// 新增知识库分段
|
||||
export function createKnowledgeSegment(
|
||||
data: AiKnowledgeSegmentApi.KnowledgeSegment,
|
||||
) {
|
||||
return requestClient.post('/ai/knowledge/segment/create', data);
|
||||
}
|
||||
|
||||
// 修改知识库分段
|
||||
export function updateKnowledgeSegment(
|
||||
data: AiKnowledgeSegmentApi.KnowledgeSegment,
|
||||
) {
|
||||
return requestClient.put('/ai/knowledge/segment/update', data);
|
||||
}
|
||||
|
||||
// 修改知识库分段状态
|
||||
export function updateKnowledgeSegmentStatus(data: any) {
|
||||
return requestClient.put('/ai/knowledge/segment/update-status', data);
|
||||
}
|
||||
// 删除知识库分段
|
||||
export function deleteKnowledgeSegment(id: number) {
|
||||
return requestClient.delete(`/ai/knowledge/segment/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// 切片内容
|
||||
export function splitContent(url: string, segmentMaxTokens: number) {
|
||||
return requestClient.get('/ai/knowledge/segment/split', {
|
||||
params: { url, segmentMaxTokens },
|
||||
});
|
||||
}
|
||||
|
||||
// 获取文档处理列表
|
||||
export function getKnowledgeSegmentProcessList(documentIds: number[]) {
|
||||
return requestClient.get('/ai/knowledge/segment/get-process-list', {
|
||||
params: { documentIds: documentIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
// 搜索知识库分段
|
||||
export function searchKnowledgeSegment(params: any) {
|
||||
return requestClient.get('/ai/knowledge/segment/search', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
import { useAppConfig } from '@vben/hooks';
|
||||
import { fetchEventSource } from '@vben/request';
|
||||
import { useAccessStore } from '@vben/stores';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||
const accessStore = useAccessStore();
|
||||
export namespace AiMindmapApi {
|
||||
// AI 思维导图
|
||||
export interface MindMap {
|
||||
id: number; // 编号
|
||||
userId: number; // 用户编号
|
||||
prompt: string; // 生成内容提示
|
||||
generatedContent: string; // 生成的思维导图内容
|
||||
platform: string; // 平台
|
||||
model: string; // 模型
|
||||
errorMessage: string; // 错误信息
|
||||
}
|
||||
|
||||
// AI 思维导图生成
|
||||
export interface AiMindMapGenerateReq {
|
||||
prompt: string;
|
||||
}
|
||||
}
|
||||
|
||||
export function generateMindMap({
|
||||
data,
|
||||
onClose,
|
||||
onMessage,
|
||||
onError,
|
||||
ctrl,
|
||||
}: {
|
||||
ctrl: AbortController;
|
||||
data: AiMindmapApi.AiMindMapGenerateReq;
|
||||
onClose?: (...args: any[]) => void;
|
||||
onError?: (...args: any[]) => void;
|
||||
onMessage?: (res: any) => void;
|
||||
}) {
|
||||
const token = accessStore.accessToken;
|
||||
return fetchEventSource(`${apiURL}/ai/mind-map/generate-stream`, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
openWhenHidden: true,
|
||||
body: JSON.stringify(data),
|
||||
onmessage: onMessage,
|
||||
onerror: onError,
|
||||
onclose: onClose,
|
||||
signal: ctrl.signal,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询思维导图分页
|
||||
export function getMindMapPage(params: any) {
|
||||
return requestClient.get(`/ai/mind-map/page`, { params });
|
||||
}
|
||||
|
||||
// 删除思维导图
|
||||
export function deleteMindMap(id: number) {
|
||||
return requestClient.delete(`/ai/mind-map/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiModelApiKeyApi {
|
||||
export interface ApiKey {
|
||||
id: number; // 编号
|
||||
name: string; // 名称
|
||||
apiKey: string; // 密钥
|
||||
platform: string; // 平台
|
||||
url: string; // 自定义 API 地址
|
||||
status: number; // 状态
|
||||
}
|
||||
}
|
||||
|
||||
// 查询 API 密钥分页
|
||||
export function getApiKeyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiModelApiKeyApi.ApiKey>>(
|
||||
'/ai/api-key/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 获得 API 密钥列表
|
||||
export function getApiKeySimpleList() {
|
||||
return requestClient.get<AiModelApiKeyApi.ApiKey[]>(
|
||||
'/ai/api-key/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
// 查询 API 密钥详情
|
||||
export function getApiKey(id: number) {
|
||||
return requestClient.get<AiModelApiKeyApi.ApiKey>(`/ai/api-key/get?id=${id}`);
|
||||
}
|
||||
// 新增 API 密钥
|
||||
export function createApiKey(data: AiModelApiKeyApi.ApiKey) {
|
||||
return requestClient.post('/ai/api-key/create', data);
|
||||
}
|
||||
|
||||
// 修改 API 密钥
|
||||
export function updateApiKey(data: AiModelApiKeyApi.ApiKey) {
|
||||
return requestClient.put('/ai/api-key/update', data);
|
||||
}
|
||||
|
||||
// 删除 API 密钥
|
||||
export function deleteApiKey(id: number) {
|
||||
return requestClient.delete(`/ai/api-key/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiModelChatRoleApi {
|
||||
export interface ChatRole {
|
||||
id: number; // 角色编号
|
||||
modelId: number; // 模型编号
|
||||
name: string; // 角色名称
|
||||
avatar: string; // 角色头像
|
||||
category: string; // 角色类别
|
||||
sort: number; // 角色排序
|
||||
description: string; // 角色描述
|
||||
systemMessage: string; // 角色设定
|
||||
welcomeMessage: string; // 角色设定
|
||||
publicStatus: boolean; // 是否公开
|
||||
status: number; // 状态
|
||||
knowledgeIds?: number[]; // 引用的知识库 ID 列表
|
||||
toolIds?: number[]; // 引用的工具 ID 列表
|
||||
}
|
||||
|
||||
// AI 聊天角色 分页请求
|
||||
export interface ChatRolePageReq {
|
||||
name?: string; // 角色名称
|
||||
category?: string; // 角色类别
|
||||
publicStatus: boolean; // 是否公开
|
||||
pageNo: number; // 是否公开
|
||||
pageSize: number; // 是否公开
|
||||
}
|
||||
}
|
||||
|
||||
// 查询聊天角色分页
|
||||
export function getChatRolePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiModelChatRoleApi.ChatRole>>(
|
||||
'/ai/chat-role/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 查询聊天角色详情
|
||||
export function getChatRole(id: number) {
|
||||
return requestClient.get<AiModelChatRoleApi.ChatRole>(
|
||||
`/ai/chat-role/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
// 新增聊天角色
|
||||
export function createChatRole(data: AiModelChatRoleApi.ChatRole) {
|
||||
return requestClient.post('/ai/chat-role/create', data);
|
||||
}
|
||||
|
||||
// 修改聊天角色
|
||||
export function updateChatRole(data: AiModelChatRoleApi.ChatRole) {
|
||||
return requestClient.put('/ai/chat-role/update', data);
|
||||
}
|
||||
|
||||
// 删除聊天角色
|
||||
export function deleteChatRole(id: number) {
|
||||
return requestClient.delete(`/ai/chat-role/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// ======= chat 聊天
|
||||
// 获取 my role
|
||||
export function getMyPage(params: AiModelChatRoleApi.ChatRolePageReq) {
|
||||
return requestClient.get('/ai/chat-role/my-page', { params });
|
||||
}
|
||||
|
||||
// 获取角色分类
|
||||
export function getCategoryList() {
|
||||
return requestClient.get('/ai/chat-role/category-list');
|
||||
}
|
||||
|
||||
// 创建角色
|
||||
export function createMy(data: AiModelChatRoleApi.ChatRole) {
|
||||
return requestClient.post('/ai/chat-role/create-my', data);
|
||||
}
|
||||
|
||||
// 更新角色
|
||||
export function updateMy(data: AiModelChatRoleApi.ChatRole) {
|
||||
return requestClient.put('/ai/chat-role/update', data);
|
||||
}
|
||||
|
||||
// 删除角色 my
|
||||
export function deleteMy(id: number) {
|
||||
return requestClient.delete(`/ai/chat-role/delete-my?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiModelModelApi {
|
||||
export interface Model {
|
||||
id: number; // 编号
|
||||
keyId: number; // API 秘钥编号
|
||||
name: string; // 模型名字
|
||||
model: string; // 模型标识
|
||||
platform: string; // 模型平台
|
||||
type: number; // 模型类型
|
||||
sort: number; // 排序
|
||||
status: number; // 状态
|
||||
temperature?: number; // 温度参数
|
||||
maxTokens?: number; // 单条回复的最大 Token 数量
|
||||
maxContexts?: number; // 上下文的最大 Message 数量
|
||||
}
|
||||
}
|
||||
|
||||
// 查询模型分页
|
||||
export function getModelPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiModelModelApi.Model>>(
|
||||
'/ai/model/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 获得模型列表
|
||||
export function getModelSimpleList(type?: number) {
|
||||
return requestClient.get<AiModelModelApi.Model[]>('/ai/model/simple-list', {
|
||||
params: {
|
||||
type,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 查询模型详情
|
||||
export function getModel(id: number) {
|
||||
return requestClient.get<AiModelModelApi.Model>(`/ai/model/get?id=${id}`);
|
||||
}
|
||||
// 新增模型
|
||||
export function createModel(data: AiModelModelApi.Model) {
|
||||
return requestClient.post('/ai/model/create', data);
|
||||
}
|
||||
|
||||
// 修改模型
|
||||
export function updateModel(data: AiModelModelApi.Model) {
|
||||
return requestClient.put('/ai/model/update', data);
|
||||
}
|
||||
|
||||
// 删除模型
|
||||
export function deleteModel(id: number) {
|
||||
return requestClient.delete(`/ai/model/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiModelToolApi {
|
||||
export interface Tool {
|
||||
id: number; // 工具编号
|
||||
name: string; // 工具名称
|
||||
description: string; // 工具描述
|
||||
status: number; // 状态
|
||||
}
|
||||
}
|
||||
|
||||
// 查询工具分页
|
||||
export function getToolPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiModelToolApi.Tool>>('/ai/tool/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询工具详情
|
||||
export function getTool(id: number) {
|
||||
return requestClient.get<AiModelToolApi.Tool>(`/ai/tool/get?id=${id}`);
|
||||
}
|
||||
// 新增工具
|
||||
export function createTool(data: AiModelToolApi.Tool) {
|
||||
return requestClient.post('/ai/tool/create', data);
|
||||
}
|
||||
|
||||
// 修改工具
|
||||
export function updateTool(data: AiModelToolApi.Tool) {
|
||||
return requestClient.put('/ai/tool/update', data);
|
||||
}
|
||||
|
||||
// 删除工具
|
||||
export function deleteTool(id: number) {
|
||||
return requestClient.delete(`/ai/tool/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// 获取工具简单列表
|
||||
export function getToolSimpleList() {
|
||||
return requestClient.get<AiModelToolApi.Tool[]>('/ai/tool/simple-list');
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiMusicApi {
|
||||
// AI 音乐
|
||||
export interface Music {
|
||||
id: number; // 编号
|
||||
userId: number; // 用户编号
|
||||
title: string; // 音乐名称
|
||||
lyric: string; // 歌词
|
||||
imageUrl: string; // 图片地址
|
||||
audioUrl: string; // 音频地址
|
||||
videoUrl: string; // 视频地址
|
||||
status: number; // 音乐状态
|
||||
gptDescriptionPrompt: string; // 描述词
|
||||
prompt: string; // 提示词
|
||||
platform: string; // 模型平台
|
||||
model: string; // 模型
|
||||
generateMode: number; // 生成模式
|
||||
tags: string; // 音乐风格标签
|
||||
duration: number; // 音乐时长
|
||||
publicStatus: boolean; // 是否发布
|
||||
taskId: string; // 任务id
|
||||
errorMessage: string; // 错误信息
|
||||
}
|
||||
}
|
||||
|
||||
// 查询音乐分页
|
||||
export function getMusicPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiMusicApi.Music>>(`/ai/music/page`, {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新音乐
|
||||
export function updateMusic(data: any) {
|
||||
return requestClient.put('/ai/music/update', data);
|
||||
}
|
||||
|
||||
// 删除音乐
|
||||
export function deleteMusic(id: number) {
|
||||
return requestClient.delete(`/ai/music/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function getWorkflowPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<any>>('/ai/workflow/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export const getWorkflow = (id: number | string) => {
|
||||
return requestClient.get(`/ai/workflow/get?id=${id}`);
|
||||
};
|
||||
|
||||
export const createWorkflow = (data: any) => {
|
||||
return requestClient.post('/ai/workflow/create', data);
|
||||
};
|
||||
|
||||
export const updateWorkflow = (data: any) => {
|
||||
return requestClient.put('/ai/workflow/update', data);
|
||||
};
|
||||
|
||||
export const deleteWorkflow = (id: number | string) => {
|
||||
return requestClient.delete(`/ai/workflow/delete?id=${id}`);
|
||||
};
|
||||
|
||||
export const testWorkflow = (data: any) => {
|
||||
return requestClient.post('/ai/workflow/test', data);
|
||||
};
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { AiWriteTypeEnum } from '#/utils';
|
||||
|
||||
import { useAppConfig } from '@vben/hooks';
|
||||
import { fetchEventSource } from '@vben/request';
|
||||
import { useAccessStore } from '@vben/stores';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||
const accessStore = useAccessStore();
|
||||
export namespace AiWriteApi {
|
||||
export interface Write {
|
||||
type: AiWriteTypeEnum.REPLY | AiWriteTypeEnum.WRITING; // 1:撰写 2:回复
|
||||
prompt: string; // 写作内容提示 1。撰写 2回复
|
||||
originalContent: string; // 原文
|
||||
length: number; // 长度
|
||||
format: number; // 格式
|
||||
tone: number; // 语气
|
||||
language: number; // 语言
|
||||
userId?: number; // 用户编号
|
||||
platform?: string; // 平台
|
||||
model?: string; // 模型
|
||||
generatedContent?: string; // 生成的内容
|
||||
errorMessage?: string; // 错误信息
|
||||
createTime?: Date; // 创建时间
|
||||
}
|
||||
|
||||
export interface AiWritePageReq extends PageParam {
|
||||
userId?: number; // 用户编号
|
||||
type?: AiWriteTypeEnum; // 写作类型
|
||||
platform?: string; // 平台
|
||||
createTime?: [string, string]; // 创建时间
|
||||
}
|
||||
|
||||
export interface AiWriteResp {
|
||||
id: number;
|
||||
userId: number;
|
||||
type: number;
|
||||
platform: string;
|
||||
model: string;
|
||||
prompt: string;
|
||||
generatedContent: string;
|
||||
originalContent: string;
|
||||
length: number;
|
||||
format: number;
|
||||
tone: number;
|
||||
language: number;
|
||||
errorMessage: string;
|
||||
createTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
export function writeStream({
|
||||
data,
|
||||
onClose,
|
||||
onMessage,
|
||||
onError,
|
||||
ctrl,
|
||||
}: {
|
||||
ctrl: AbortController;
|
||||
data: Partial<AiWriteApi.Write>;
|
||||
onClose?: (...args: any[]) => void;
|
||||
onError?: (...args: any[]) => void;
|
||||
onMessage?: (res: any) => void;
|
||||
}) {
|
||||
const token = accessStore.accessToken;
|
||||
return fetchEventSource(`${apiURL}/ai/write/generate-stream`, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
openWhenHidden: true,
|
||||
body: JSON.stringify(data),
|
||||
onmessage: onMessage,
|
||||
onerror: onError,
|
||||
onclose: onClose,
|
||||
signal: ctrl.signal,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取写作列表
|
||||
export function getWritePage(params: any) {
|
||||
return requestClient.get<PageResult<AiWriteApi.AiWritePageReq>>(
|
||||
`/ai/write/page`,
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 删除音乐
|
||||
export function deleteWrite(id: number) {
|
||||
return requestClient.delete(`/ai/write/delete`, { params: { id } });
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace ProductUnitApi {
|
||||
/** 产品单位信息 */
|
||||
export interface ProductUnit {
|
||||
id: number; // 编号
|
||||
groupId?: number; // 分组编号
|
||||
name?: string; // 单位名称
|
||||
basic?: number; // 基础单位
|
||||
number?: number; // 单位数量/相对于基础单位
|
||||
usageType: number; // 用途
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询产品单位分页 */
|
||||
export function getProductUnitPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<ProductUnitApi.ProductUnit>>(
|
||||
'/basic/product-unit/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询产品单位详情 */
|
||||
export function getProductUnit(id: number) {
|
||||
return requestClient.get<ProductUnitApi.ProductUnit>(
|
||||
`/basic/product-unit/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增产品单位 */
|
||||
export function createProductUnit(data: ProductUnitApi.ProductUnit) {
|
||||
return requestClient.post('/basic/product-unit/create', data);
|
||||
}
|
||||
|
||||
/** 修改产品单位 */
|
||||
export function updateProductUnit(data: ProductUnitApi.ProductUnit) {
|
||||
return requestClient.put('/basic/product-unit/update', data);
|
||||
}
|
||||
|
||||
/** 删除产品单位 */
|
||||
export function deleteProductUnit(id: number) {
|
||||
return requestClient.delete(`/basic/product-unit/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除产品单位 */
|
||||
export function deleteProductUnitListByIds(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/basic/product-unit/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出产品单位 */
|
||||
export function exportProductUnit(params: any) {
|
||||
return requestClient.download('/basic/product-unit/export-excel', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace ProductUnitGroupApi {
|
||||
/** 产品单位组信息 */
|
||||
export interface ProductUnitGroup {
|
||||
id: number; // 编号
|
||||
name?: string; // 产品单位组名称
|
||||
status?: number; // 开启状态
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询产品单位组分页 */
|
||||
export function getProductUnitGroupPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<ProductUnitGroupApi.ProductUnitGroup>>(
|
||||
'/basic/product-unit-group/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询产品单位组详情 */
|
||||
export function getProductUnitGroup(id: number) {
|
||||
return requestClient.get<ProductUnitGroupApi.ProductUnitGroup>(
|
||||
`/basic/product-unit-group/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增产品单位组 */
|
||||
export function createProductUnitGroup(
|
||||
data: ProductUnitGroupApi.ProductUnitGroup,
|
||||
) {
|
||||
return requestClient.post('/basic/product-unit-group/create', data);
|
||||
}
|
||||
|
||||
/** 修改产品单位组 */
|
||||
export function updateProductUnitGroup(
|
||||
data: ProductUnitGroupApi.ProductUnitGroup,
|
||||
) {
|
||||
return requestClient.put('/basic/product-unit-group/update', data);
|
||||
}
|
||||
|
||||
/** 删除产品单位组 */
|
||||
export function deleteProductUnitGroup(id: number) {
|
||||
return requestClient.delete(`/basic/product-unit-group/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除产品单位组 */
|
||||
export function deleteProductUnitGroupListByIds(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/basic/product-unit-group/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出产品单位组 */
|
||||
export function exportProductUnitGroup(params: any) {
|
||||
return requestClient.download(
|
||||
'/basic/product-unit-group/export-excel',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmCategoryApi {
|
||||
/** 流程分类 */
|
||||
export interface Category {
|
||||
id: number;
|
||||
name: string;
|
||||
code: string;
|
||||
status: number;
|
||||
description?: string;
|
||||
sort: number; // 分类排序
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询流程分类分页 */
|
||||
export async function getCategoryPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmCategoryApi.Category>>(
|
||||
'/bpm/category/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询流程分类详情 */
|
||||
export async function getCategory(id: number) {
|
||||
return requestClient.get<BpmCategoryApi.Category>(
|
||||
`/bpm/category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增流程分类 */
|
||||
export async function createCategory(data: BpmCategoryApi.Category) {
|
||||
return requestClient.post<number>('/bpm/category/create', data);
|
||||
}
|
||||
|
||||
/** 修改流程分类 */
|
||||
export async function updateCategory(data: BpmCategoryApi.Category) {
|
||||
return requestClient.put<boolean>('/bpm/category/update', data);
|
||||
}
|
||||
|
||||
/** 删除流程分类 */
|
||||
export async function deleteCategory(id: number) {
|
||||
return requestClient.delete<boolean>(`/bpm/category/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 查询流程分类列表 */
|
||||
export async function getCategorySimpleList() {
|
||||
return requestClient.get<BpmCategoryApi.Category[]>(
|
||||
`/bpm/category/simple-list`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 批量修改流程分类的排序 */
|
||||
export async function updateCategorySortBatch(ids: number[]) {
|
||||
const params = ids.join(',');
|
||||
return requestClient.put<boolean>(
|
||||
`/bpm/category/update-sort-batch?ids=${params}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessDefinitionApi {
|
||||
/** 流程定义 */
|
||||
export interface ProcessDefinition {
|
||||
id: string;
|
||||
version: number;
|
||||
deploymentTime: number;
|
||||
suspensionState: number;
|
||||
modelType: number;
|
||||
modelId: string;
|
||||
formType?: number;
|
||||
bpmnXml?: string;
|
||||
simpleModel?: string;
|
||||
formFields?: string[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询流程定义 */
|
||||
export async function getProcessDefinition(id?: string, key?: string) {
|
||||
return requestClient.get<BpmProcessDefinitionApi.ProcessDefinition>(
|
||||
'/bpm/process-definition/get',
|
||||
{
|
||||
params: { id, key },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 分页查询流程定义 */
|
||||
export async function getProcessDefinitionPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<BpmProcessDefinitionApi.ProcessDefinition>
|
||||
>('/bpm/process-definition/page', { params });
|
||||
}
|
||||
|
||||
/** 查询流程定义列表 */
|
||||
export async function getProcessDefinitionList(params: any) {
|
||||
return requestClient.get<BpmProcessDefinitionApi.ProcessDefinition[]>(
|
||||
'/bpm/process-definition/list',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询流程定义列表(简单列表) */
|
||||
export async function getSimpleProcessDefinitionList() {
|
||||
return requestClient.get<
|
||||
PageResult<BpmProcessDefinitionApi.ProcessDefinition>
|
||||
>('/bpm/process-definition/simple-list');
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmFormApi {
|
||||
/** 流程表单 */
|
||||
export interface Form {
|
||||
id?: number | undefined;
|
||||
name: string;
|
||||
conf: string;
|
||||
fields: string[];
|
||||
status: number;
|
||||
remark: string;
|
||||
createTime: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取表单分页列表 */
|
||||
export async function getFormPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmFormApi.Form>>('/bpm/form/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取表单详情 */
|
||||
export async function getFormDetail(id: number) {
|
||||
return requestClient.get<BpmFormApi.Form>(`/bpm/form/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 创建表单 */
|
||||
export async function createForm(data: BpmFormApi.Form) {
|
||||
return requestClient.post('/bpm/form/create', data);
|
||||
}
|
||||
|
||||
/** 更新表单 */
|
||||
export async function updateForm(data: BpmFormApi.Form) {
|
||||
return requestClient.put('/bpm/form/update', data);
|
||||
}
|
||||
|
||||
/** 删除表单 */
|
||||
export async function deleteForm(id: number) {
|
||||
return requestClient.delete(`/bpm/form/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获取表单简单列表 */
|
||||
export async function getFormSimpleList() {
|
||||
return requestClient.get<BpmFormApi.Form[]>('/bpm/form/simple-list');
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmModelApi {
|
||||
/** 用户信息 TODO 这个是不是可以抽取出来定义在公共模块 */
|
||||
// TODO @芋艿:一起看看。
|
||||
export interface UserInfo {
|
||||
id: number;
|
||||
nickname: string;
|
||||
avatar?: string;
|
||||
deptId?: number;
|
||||
deptName?: string;
|
||||
}
|
||||
|
||||
/** 流程定义 */
|
||||
export interface ProcessDefinition {
|
||||
id: string;
|
||||
key?: string;
|
||||
version: number;
|
||||
deploymentTime: number;
|
||||
suspensionState: number;
|
||||
formType?: number;
|
||||
formCustomViewPath?: string;
|
||||
}
|
||||
|
||||
/** 流程模型 */
|
||||
export interface Model {
|
||||
id: number;
|
||||
key: string;
|
||||
name: string;
|
||||
icon?: string;
|
||||
description: string;
|
||||
category: string;
|
||||
formName: string;
|
||||
formType: number;
|
||||
formId: number;
|
||||
formCustomCreatePath: string;
|
||||
formCustomViewPath: string;
|
||||
processDefinition: ProcessDefinition;
|
||||
status: number;
|
||||
remark: string;
|
||||
createTime: string;
|
||||
bpmnXml: string;
|
||||
startUsers?: UserInfo[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 模型分类信息 */
|
||||
export interface ModelCategoryInfo {
|
||||
id: number;
|
||||
name: string;
|
||||
modelList: BpmModelApi.Model[];
|
||||
}
|
||||
|
||||
/** 获取流程模型列表 */
|
||||
export async function getModelList(name: string | undefined) {
|
||||
return requestClient.get<BpmModelApi.Model[]>('/bpm/model/list', {
|
||||
params: { name },
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取流程模型详情 */
|
||||
export async function getModel(id: string) {
|
||||
return requestClient.get<BpmModelApi.Model>(`/bpm/model/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 更新流程模型 */
|
||||
export async function updateModel(data: BpmModelApi.Model) {
|
||||
return requestClient.put('/bpm/model/update', data);
|
||||
}
|
||||
|
||||
/** 批量修改流程模型排序 */
|
||||
export async function updateModelSortBatch(ids: number[]) {
|
||||
const params = ids.join(',');
|
||||
return requestClient.put<boolean>(
|
||||
`/bpm/model/update-sort-batch?ids=${params}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新流程模型的 BPMN XML */
|
||||
export async function updateModelBpmn(data: BpmModelApi.Model) {
|
||||
return requestClient.put('/bpm/model/update-bpmn', data);
|
||||
}
|
||||
|
||||
/** 更新流程模型状态 */
|
||||
export async function updateModelState(id: number, state: number) {
|
||||
const data = {
|
||||
id,
|
||||
state,
|
||||
};
|
||||
return requestClient.put('/bpm/model/update-state', data);
|
||||
}
|
||||
|
||||
/** 创建流程模型 */
|
||||
export async function createModel(data: BpmModelApi.Model) {
|
||||
return requestClient.post('/bpm/model/create', data);
|
||||
}
|
||||
|
||||
/** 删除流程模型 */
|
||||
export async function deleteModel(id: number) {
|
||||
return requestClient.delete(`/bpm/model/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 部署流程模型 */
|
||||
export async function deployModel(id: number) {
|
||||
return requestClient.post(`/bpm/model/deploy?id=${id}`);
|
||||
}
|
||||
|
||||
/** 清理流程模型 */
|
||||
export async function cleanModel(id: number) {
|
||||
return requestClient.delete(`/bpm/model/clean?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmOALeaveApi {
|
||||
export interface Leave {
|
||||
id: number;
|
||||
status: number;
|
||||
type: number;
|
||||
reason: string;
|
||||
processInstanceId: string;
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
createTime: Date;
|
||||
startUserSelectAssignees?: Record<string, string[]>;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建请假申请 */
|
||||
export async function createLeave(data: BpmOALeaveApi.Leave) {
|
||||
return requestClient.post('/bpm/oa/leave/create', data);
|
||||
}
|
||||
|
||||
/** 更新请假申请 */
|
||||
export async function updateLeave(data: BpmOALeaveApi.Leave) {
|
||||
return requestClient.post('/bpm/oa/leave/update', data);
|
||||
}
|
||||
|
||||
/** 获得请假申请 */
|
||||
export async function getLeave(id: number) {
|
||||
return requestClient.get<BpmOALeaveApi.Leave>(`/bpm/oa/leave/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得请假申请分页 */
|
||||
export async function getLeavePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmOALeaveApi.Leave>>(
|
||||
'/bpm/oa/leave/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessExpressionApi {
|
||||
/** 流程表达式 */
|
||||
export interface ProcessExpression {
|
||||
id: number; // 编号
|
||||
name: string; // 表达式名字
|
||||
status: number; // 表达式状态
|
||||
expression: string; // 表达式
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询流程表达式分页 */
|
||||
export async function getProcessExpressionPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<BpmProcessExpressionApi.ProcessExpression>
|
||||
>('/bpm/process-expression/page', { params });
|
||||
}
|
||||
|
||||
/** 查询流程表达式详情 */
|
||||
export async function getProcessExpression(id: number) {
|
||||
return requestClient.get<BpmProcessExpressionApi.ProcessExpression>(
|
||||
`/bpm/process-expression/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增流程表达式 */
|
||||
export async function createProcessExpression(
|
||||
data: BpmProcessExpressionApi.ProcessExpression,
|
||||
) {
|
||||
return requestClient.post<number>('/bpm/process-expression/create', data);
|
||||
}
|
||||
|
||||
/** 修改流程表达式 */
|
||||
export async function updateProcessExpression(
|
||||
data: BpmProcessExpressionApi.ProcessExpression,
|
||||
) {
|
||||
return requestClient.put<boolean>('/bpm/process-expression/update', data);
|
||||
}
|
||||
|
||||
/** 删除流程表达式 */
|
||||
export async function deleteProcessExpression(id: number) {
|
||||
return requestClient.delete<boolean>(
|
||||
`/bpm/process-expression/delete?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出流程表达式 */
|
||||
export async function exportProcessExpression(params: any) {
|
||||
return requestClient.download('/bpm/process-expression/export-excel', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,197 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { BpmTaskApi } from '../task';
|
||||
|
||||
import type { BpmModelApi } from '#/api/bpm/model';
|
||||
import type { BpmCandidateStrategyEnum, BpmNodeTypeEnum } from '#/utils';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessInstanceApi {
|
||||
// TODO @芋艿:一些注释缺少或者不对;
|
||||
export interface Task {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
avatar: string;
|
||||
id: number;
|
||||
nickname: string;
|
||||
}
|
||||
|
||||
// 审批任务信息
|
||||
export interface ApprovalTaskInfo {
|
||||
assigneeUser: User;
|
||||
id: number;
|
||||
ownerUser: User;
|
||||
reason: string;
|
||||
signPicUrl: string;
|
||||
status: number;
|
||||
}
|
||||
|
||||
// 审批节点信息
|
||||
export interface ApprovalNodeInfo {
|
||||
candidateStrategy?: BpmCandidateStrategyEnum;
|
||||
candidateUsers?: User[];
|
||||
endTime?: Date;
|
||||
id: number;
|
||||
name: string;
|
||||
nodeType: BpmNodeTypeEnum;
|
||||
startTime?: Date;
|
||||
status: number;
|
||||
tasks: ApprovalTaskInfo[];
|
||||
}
|
||||
|
||||
/** 流程实例 */
|
||||
export interface ProcessInstance {
|
||||
businessKey: string;
|
||||
category: string;
|
||||
createTime: string;
|
||||
endTime: string;
|
||||
fields: string[];
|
||||
formVariables: Record<string, any>;
|
||||
id: number;
|
||||
name: string;
|
||||
processDefinition?: BpmModelApi.ProcessDefinition;
|
||||
processDefinitionId: string;
|
||||
remark: string;
|
||||
result: number;
|
||||
startTime?: Date;
|
||||
startUser?: User;
|
||||
status: number;
|
||||
tasks?: BpmProcessInstanceApi.Task[];
|
||||
}
|
||||
|
||||
// 审批详情
|
||||
export interface ApprovalDetail {
|
||||
activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[];
|
||||
formFieldsPermission: any;
|
||||
processDefinition: BpmModelApi.ProcessDefinition;
|
||||
processInstance: BpmProcessInstanceApi.ProcessInstance;
|
||||
status: number;
|
||||
todoTask: BpmTaskApi.Task;
|
||||
}
|
||||
|
||||
// 抄送流程实例
|
||||
export interface Copy {
|
||||
activityId: string;
|
||||
activityName: string;
|
||||
createTime: number;
|
||||
createUser: User;
|
||||
id: number;
|
||||
processInstanceId: string;
|
||||
processInstanceName: string;
|
||||
processInstanceStartTime: number;
|
||||
reason: string;
|
||||
startUser: User;
|
||||
summary: {
|
||||
key: string;
|
||||
value: string;
|
||||
}[];
|
||||
taskId: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询我的流程实例分页 */
|
||||
export async function getProcessInstanceMyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||
'/bpm/process-instance/my-page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询管理员流程实例分页 */
|
||||
export async function getProcessInstanceManagerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||
'/bpm/process-instance/manager-page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增流程实例 */
|
||||
export async function createProcessInstance(data: any) {
|
||||
return requestClient.post<BpmProcessInstanceApi.ProcessInstance>(
|
||||
'/bpm/process-instance/create',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/** 申请人主动取消流程实例 */
|
||||
export async function cancelProcessInstanceByStartUser(
|
||||
id: number,
|
||||
reason: string,
|
||||
) {
|
||||
return requestClient.delete<boolean>(
|
||||
'/bpm/process-instance/cancel-by-start-user',
|
||||
{
|
||||
data: { id, reason },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 管理员取消流程实例 */
|
||||
export async function cancelProcessInstanceByAdmin(id: number, reason: string) {
|
||||
return requestClient.delete<boolean>(
|
||||
'/bpm/process-instance/cancel-by-admin',
|
||||
{
|
||||
data: { id, reason },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询流程实例详情 */
|
||||
export async function getProcessInstance(id: number) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||
`/bpm/process-instance/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询复制流程实例分页 */
|
||||
export async function getProcessInstanceCopyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||
'/bpm/process-instance/copy/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新流程实例 */
|
||||
export async function updateProcessInstance(
|
||||
data: BpmProcessInstanceApi.ProcessInstance,
|
||||
) {
|
||||
return requestClient.put<BpmProcessInstanceApi.ProcessInstance>(
|
||||
'/bpm/process-instance/update',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取审批详情 */
|
||||
export async function getApprovalDetail(params: any) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ApprovalDetail>(
|
||||
`/bpm/process-instance/get-approval-detail`,
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取下一个执行的流程节点 */
|
||||
export async function getNextApprovalNodes(params: any) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ApprovalNodeInfo[]>(
|
||||
`/bpm/process-instance/get-next-approval-nodes`,
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取表单字段权限 */
|
||||
export async function getFormFieldsPermission(params: any) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||
`/bpm/process-instance/get-form-fields-permission`,
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取流程实例 BPMN 模型视图 */
|
||||
export async function getProcessInstanceBpmnModelView(id: string) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||
`/bpm/process-instance/get-bpmn-model-view?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessListenerApi {
|
||||
/** BPM 流程监听器 */
|
||||
export interface ProcessListener {
|
||||
id: number; // 编号
|
||||
name: string; // 监听器名字
|
||||
type: string; // 监听器类型
|
||||
status: number; // 监听器状态
|
||||
event: string; // 监听事件
|
||||
valueType: string; // 监听器值类型
|
||||
value: string; // 监听器值
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询流程监听器分页 */
|
||||
export async function getProcessListenerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmProcessListenerApi.ProcessListener>>(
|
||||
'/bpm/process-listener/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询流程监听器详情 */
|
||||
export async function getProcessListener(id: number) {
|
||||
return requestClient.get<BpmProcessListenerApi.ProcessListener>(
|
||||
`/bpm/process-listener/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增流程监听器 */
|
||||
export async function createProcessListener(
|
||||
data: BpmProcessListenerApi.ProcessListener,
|
||||
) {
|
||||
return requestClient.post<number>('/bpm/process-listener/create', data);
|
||||
}
|
||||
|
||||
/** 修改流程监听器 */
|
||||
export async function updateProcessListener(
|
||||
data: BpmProcessListenerApi.ProcessListener,
|
||||
) {
|
||||
return requestClient.put<boolean>('/bpm/process-listener/update', data);
|
||||
}
|
||||
|
||||
/** 删除流程监听器 */
|
||||
export async function deleteProcessListener(id: number) {
|
||||
return requestClient.delete<boolean>(`/bpm/process-listener/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { BpmProcessInstanceApi } from '../processInstance';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmTaskApi {
|
||||
/** BPM 流程监听器 */
|
||||
export interface Task {
|
||||
id: number; // 编号
|
||||
name: string; // 监听器名字
|
||||
type: string; // 监听器类型
|
||||
status: number; // 监听器状态
|
||||
event: string; // 监听事件
|
||||
valueType: string; // 监听器值类型
|
||||
}
|
||||
|
||||
// 流程任务
|
||||
export interface TaskManager {
|
||||
id: string; // 编号
|
||||
name: string; // 任务名称
|
||||
createTime: number; // 创建时间
|
||||
endTime: number; // 结束时间
|
||||
durationInMillis: number; // 持续时间
|
||||
status: number; // 状态
|
||||
reason: string; // 原因
|
||||
ownerUser: any; // 负责人
|
||||
assigneeUser: any; // 处理人
|
||||
taskDefinitionKey: string; // 任务定义key
|
||||
processInstanceId: string; // 流程实例id
|
||||
processInstance: BpmProcessInstanceApi.ProcessInstance; // 流程实例
|
||||
parentTaskId: any; // 父任务id
|
||||
children: any; // 子任务
|
||||
formId: any; // 表单id
|
||||
formName: any; // 表单名称
|
||||
formConf: any; // 表单配置
|
||||
formFields: any; // 表单字段
|
||||
formVariables: any; // 表单变量
|
||||
buttonsSetting: any; // 按钮设置
|
||||
signEnable: any; // 签名设置
|
||||
reasonRequire: any; // 原因设置
|
||||
nodeType: any; // 节点类型
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询待办任务分页 */
|
||||
export async function getTaskTodoPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmTaskApi.Task>>('/bpm/task/todo-page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询已办任务分页 */
|
||||
export async function getTaskDonePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmTaskApi.Task>>('/bpm/task/done-page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询任务管理分页 */
|
||||
export async function getTaskManagerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmTaskApi.Task>>(
|
||||
'/bpm/task/manager-page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 审批任务 */
|
||||
export const approveTask = async (data: any) => {
|
||||
return await requestClient.put('/bpm/task/approve', data);
|
||||
};
|
||||
|
||||
/** 驳回任务 */
|
||||
export const rejectTask = async (data: any) => {
|
||||
return await requestClient.put('/bpm/task/reject', data);
|
||||
};
|
||||
|
||||
/** 根据流程实例 ID 查询任务列表 */
|
||||
export const getTaskListByProcessInstanceId = async (id: string) => {
|
||||
return await requestClient.get(
|
||||
`/bpm/task/list-by-process-instance-id?processInstanceId=${id}`,
|
||||
);
|
||||
};
|
||||
|
||||
/** 获取所有可退回的节点 */
|
||||
export const getTaskListByReturn = async (id: string) => {
|
||||
return await requestClient.get(`/bpm/task/list-by-return?id=${id}`);
|
||||
};
|
||||
|
||||
/** 退回 */
|
||||
export const returnTask = async (data: any) => {
|
||||
return await requestClient.put('/bpm/task/return', data);
|
||||
};
|
||||
|
||||
// 委派
|
||||
export const delegateTask = async (data: any) => {
|
||||
return await requestClient.put('/bpm/task/delegate', data);
|
||||
};
|
||||
|
||||
// 转派
|
||||
export const transferTask = async (data: any) => {
|
||||
return await requestClient.put('/bpm/task/transfer', data);
|
||||
};
|
||||
|
||||
// 加签
|
||||
export const signCreateTask = async (data: any) => {
|
||||
return await requestClient.put('/bpm/task/create-sign', data);
|
||||
};
|
||||
|
||||
// 减签
|
||||
export const signDeleteTask = async (data: any) => {
|
||||
return await requestClient.delete('/bpm/task/delete-sign', data);
|
||||
};
|
||||
|
||||
// 抄送
|
||||
export const copyTask = async (data: any) => {
|
||||
return await requestClient.put('/bpm/task/copy', data);
|
||||
};
|
||||
|
||||
// 获取我的待办任务
|
||||
export const myTodoTask = async (processInstanceId: string) => {
|
||||
return await requestClient.get(
|
||||
`/bpm/task/my-todo?processInstanceId=${processInstanceId}`,
|
||||
);
|
||||
};
|
||||
|
||||
// 获取加签任务列表
|
||||
export const getChildrenTaskList = async (id: string) => {
|
||||
return await requestClient.get(
|
||||
`/bpm/task/list-by-parent-task-id?parentTaskId=${id}`,
|
||||
);
|
||||
};
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmUserGroupApi {
|
||||
/** BPM 用户组 */
|
||||
export interface UserGroup {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
userIds: number[];
|
||||
status: number;
|
||||
remark: string;
|
||||
createTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询用户组分页 */
|
||||
export async function getUserGroupPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmUserGroupApi.UserGroup>>(
|
||||
'/bpm/user-group/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询用户组详情 */
|
||||
export async function getUserGroup(id: number) {
|
||||
return requestClient.get<BpmUserGroupApi.UserGroup>(
|
||||
`/bpm/user-group/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增用户组 */
|
||||
export async function createUserGroup(data: BpmUserGroupApi.UserGroup) {
|
||||
return requestClient.post<number>('/bpm/user-group/create', data);
|
||||
}
|
||||
|
||||
/** 修改用户组 */
|
||||
export async function updateUserGroup(data: BpmUserGroupApi.UserGroup) {
|
||||
return requestClient.put<boolean>('/bpm/user-group/update', data);
|
||||
}
|
||||
|
||||
/** 删除用户组 */
|
||||
export async function deleteUserGroup(id: number) {
|
||||
return requestClient.delete<boolean>(`/bpm/user-group/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 查询用户组列表 */
|
||||
export async function getUserGroupSimpleList() {
|
||||
return requestClient.get<BpmUserGroupApi.UserGroup[]>(
|
||||
`/bpm/user-group/simple-list`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmBusinessApi {
|
||||
/** 商机产品信息 */
|
||||
export interface BusinessProduct {
|
||||
id: number;
|
||||
productId: number;
|
||||
productName: string;
|
||||
productNo: string;
|
||||
productUnit: number;
|
||||
productPrice: number;
|
||||
businessPrice: number;
|
||||
count: number;
|
||||
totalPrice: number;
|
||||
}
|
||||
|
||||
/** 商机信息 */
|
||||
export interface Business {
|
||||
id: number;
|
||||
name: string;
|
||||
customerId: number;
|
||||
customerName?: string;
|
||||
followUpStatus: boolean;
|
||||
contactLastTime: Date;
|
||||
contactNextTime: Date;
|
||||
ownerUserId: number;
|
||||
ownerUserName?: string; // 负责人的用户名称
|
||||
ownerUserDept?: string; // 负责人的部门名称
|
||||
statusTypeId: number;
|
||||
statusTypeName?: string;
|
||||
statusId: number;
|
||||
statusName?: string;
|
||||
endStatus: number;
|
||||
endRemark: string;
|
||||
dealTime: Date;
|
||||
totalProductPrice: number;
|
||||
totalPrice: number;
|
||||
discountPercent: number;
|
||||
status?: number;
|
||||
remark: string;
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
products?: BusinessProduct[];
|
||||
}
|
||||
|
||||
export interface BusinessStatus {
|
||||
id: number;
|
||||
statusId: number | undefined;
|
||||
endStatus: number | undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询商机列表 */
|
||||
export function getBusinessPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||
'/crm/business/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询商机列表,基于指定客户 */
|
||||
export function getBusinessPageByCustomer(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||
'/crm/business/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询商机详情 */
|
||||
export function getBusiness(id: number) {
|
||||
return requestClient.get<CrmBusinessApi.Business>(
|
||||
`/crm/business/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商机列表(精简) */
|
||||
export function getSimpleBusinessList() {
|
||||
return requestClient.get<CrmBusinessApi.Business[]>(
|
||||
'/crm/business/simple-all-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增商机 */
|
||||
export function createBusiness(data: CrmBusinessApi.Business) {
|
||||
return requestClient.post('/crm/business/create', data);
|
||||
}
|
||||
|
||||
/** 修改商机 */
|
||||
export function updateBusiness(data: CrmBusinessApi.Business) {
|
||||
return requestClient.put('/crm/business/update', data);
|
||||
}
|
||||
|
||||
/** 修改商机状态 */
|
||||
export function updateBusinessStatus(data: CrmBusinessApi.BusinessStatus) {
|
||||
return requestClient.put('/crm/business/update-status', data);
|
||||
}
|
||||
|
||||
/** 删除商机 */
|
||||
export function deleteBusiness(id: number) {
|
||||
return requestClient.delete(`/crm/business/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出商机 */
|
||||
export function exportBusiness(params: any) {
|
||||
return requestClient.download('/crm/business/export-excel', params);
|
||||
}
|
||||
|
||||
/** 联系人关联商机列表 */
|
||||
export function getBusinessPageByContact(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||
'/crm/business/page-by-contact',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 商机转移 */
|
||||
export function transferBusiness(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/business/transfer', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmBusinessStatusApi {
|
||||
/** 商机状态信息 */
|
||||
export interface BusinessStatusType {
|
||||
[x: string]: any;
|
||||
id?: number;
|
||||
name: string;
|
||||
percent: number;
|
||||
}
|
||||
|
||||
/** 商机状态组信息 */
|
||||
export interface BusinessStatus {
|
||||
id?: number;
|
||||
name: string;
|
||||
deptIds?: number[];
|
||||
deptNames?: string[];
|
||||
creator?: string;
|
||||
createTime?: Date;
|
||||
statuses?: BusinessStatusType[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 默认商机状态 */
|
||||
export const DEFAULT_STATUSES = [
|
||||
{
|
||||
endStatus: 1,
|
||||
key: '结束',
|
||||
name: '赢单',
|
||||
percent: 100,
|
||||
},
|
||||
{
|
||||
endStatus: 2,
|
||||
key: '结束',
|
||||
name: '输单',
|
||||
percent: 0,
|
||||
},
|
||||
{
|
||||
endStatus: 3,
|
||||
key: '结束',
|
||||
name: '无效',
|
||||
percent: 0,
|
||||
},
|
||||
];
|
||||
|
||||
/** 查询商机状态组列表 */
|
||||
export function getBusinessStatusPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmBusinessStatusApi.BusinessStatus>>(
|
||||
'/crm/business-status/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增商机状态组 */
|
||||
export function createBusinessStatus(
|
||||
data: CrmBusinessStatusApi.BusinessStatus,
|
||||
) {
|
||||
return requestClient.post('/crm/business-status/create', data);
|
||||
}
|
||||
|
||||
/** 修改商机状态组 */
|
||||
export function updateBusinessStatus(
|
||||
data: CrmBusinessStatusApi.BusinessStatus,
|
||||
) {
|
||||
return requestClient.put('/crm/business-status/update', data);
|
||||
}
|
||||
|
||||
/** 查询商机状态类型详情 */
|
||||
export function getBusinessStatus(id: number) {
|
||||
return requestClient.get<CrmBusinessStatusApi.BusinessStatus>(
|
||||
`/crm/business-status/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除商机状态 */
|
||||
export function deleteBusinessStatus(id: number) {
|
||||
return requestClient.delete(`/crm/business-status/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商机状态组列表 */
|
||||
export function getBusinessStatusTypeSimpleList() {
|
||||
return requestClient.get<CrmBusinessStatusApi.BusinessStatus[]>(
|
||||
'/crm/business-status/type-simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商机阶段列表 */
|
||||
export function getBusinessStatusSimpleList(typeId: number) {
|
||||
return requestClient.get<CrmBusinessStatusApi.BusinessStatusType[]>(
|
||||
'/crm/business-status/status-simple-list',
|
||||
{ params: { typeId } },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmClueApi {
|
||||
/** 线索信息 */
|
||||
export interface Clue {
|
||||
id: number; // 编号
|
||||
name: string; // 线索名称
|
||||
followUpStatus: boolean; // 跟进状态
|
||||
contactLastTime: Date; // 最后跟进时间
|
||||
contactLastContent: string; // 最后跟进内容
|
||||
contactNextTime: Date; // 下次联系时间
|
||||
ownerUserId: number; // 负责人的用户编号
|
||||
ownerUserName?: string; // 负责人的用户名称
|
||||
ownerUserDept?: string; // 负责人的部门名称
|
||||
transformStatus: boolean; // 转化状态
|
||||
customerId: number; // 客户编号
|
||||
customerName?: string; // 客户名称
|
||||
mobile: string; // 手机号
|
||||
telephone: string; // 电话
|
||||
qq: string; // QQ
|
||||
wechat: string; // wechat
|
||||
email: string; // email
|
||||
areaId: number; // 所在地
|
||||
areaName?: string; // 所在地名称
|
||||
detailAddress: string; // 详细地址
|
||||
industryId: number; // 所属行业
|
||||
level: number; // 客户等级
|
||||
source: number; // 客户来源
|
||||
remark: string; // 备注
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询线索列表 */
|
||||
export function getCluePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmClueApi.Clue>>('/crm/clue/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询线索详情 */
|
||||
export function getClue(id: number) {
|
||||
return requestClient.get<CrmClueApi.Clue>(`/crm/clue/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增线索 */
|
||||
export function createClue(data: CrmClueApi.Clue) {
|
||||
return requestClient.post('/crm/clue/create', data);
|
||||
}
|
||||
|
||||
/** 修改线索 */
|
||||
export function updateClue(data: CrmClueApi.Clue) {
|
||||
return requestClient.put('/crm/clue/update', data);
|
||||
}
|
||||
|
||||
/** 删除线索 */
|
||||
export function deleteClue(id: number) {
|
||||
return requestClient.delete(`/crm/clue/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出线索 */
|
||||
export function exportClue(params: any) {
|
||||
return requestClient.download('/crm/clue/export-excel', params);
|
||||
}
|
||||
|
||||
/** 线索转移 */
|
||||
export function transferClue(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/clue/transfer', data);
|
||||
}
|
||||
|
||||
/** 线索转化为客户 */
|
||||
export function transformClue(id: number) {
|
||||
return requestClient.put(`/crm/clue/transform?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得分配给我的、待跟进的线索数量 */
|
||||
export function getFollowClueCount() {
|
||||
return requestClient.get<number>('/crm/clue/follow-count');
|
||||
}
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmContactApi {
|
||||
/** 联系人信息 */
|
||||
export interface Contact {
|
||||
id: number; // 编号
|
||||
name: string; // 联系人名称
|
||||
customerId: number; // 客户编号
|
||||
customerName?: string; // 客户名称
|
||||
contactLastTime: Date; // 最后跟进时间
|
||||
contactLastContent: string; // 最后跟进内容
|
||||
contactNextTime: Date; // 下次联系时间
|
||||
ownerUserId: number; // 负责人的用户编号
|
||||
ownerUserName?: string; // 负责人的用户名称
|
||||
ownerUserDept?: string; // 负责人的部门名称
|
||||
mobile: string; // 手机号
|
||||
telephone: string; // 电话
|
||||
qq: string; // QQ
|
||||
wechat: string; // wechat
|
||||
email: string; // email
|
||||
areaId: number; // 所在地
|
||||
areaName?: string; // 所在地名称
|
||||
detailAddress: string; // 详细地址
|
||||
sex: number; // 性别
|
||||
master: boolean; // 是否主联系人
|
||||
post: string; // 职务
|
||||
parentId: number; // 上级联系人编号
|
||||
parentName?: string; // 上级联系人名称
|
||||
remark: string; // 备注
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
|
||||
/** 联系人商机关联请求 */
|
||||
export interface ContactBusinessReq {
|
||||
contactId: number;
|
||||
businessIds: number[];
|
||||
}
|
||||
|
||||
/** 商机联系人关联请求 */
|
||||
export interface BusinessContactReq {
|
||||
businessId: number;
|
||||
contactIds: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询联系人列表 */
|
||||
export function getContactPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||
'/crm/contact/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询联系人列表,基于指定客户 */
|
||||
export function getContactPageByCustomer(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||
'/crm/contact/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询联系人列表,基于指定商机 */
|
||||
export function getContactPageByBusiness(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||
'/crm/contact/page-by-business',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询联系人详情 */
|
||||
export function getContact(id: number) {
|
||||
return requestClient.get<CrmContactApi.Contact>(`/crm/contact/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增联系人 */
|
||||
export function createContact(data: CrmContactApi.Contact) {
|
||||
return requestClient.post('/crm/contact/create', data);
|
||||
}
|
||||
|
||||
/** 修改联系人 */
|
||||
export function updateContact(data: CrmContactApi.Contact) {
|
||||
return requestClient.put('/crm/contact/update', data);
|
||||
}
|
||||
|
||||
/** 删除联系人 */
|
||||
export function deleteContact(id: number) {
|
||||
return requestClient.delete(`/crm/contact/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出联系人 */
|
||||
export function exportContact(params: any) {
|
||||
return requestClient.download('/crm/contact/export-excel', params);
|
||||
}
|
||||
|
||||
/** 获得联系人列表(精简) */
|
||||
export function getSimpleContactList() {
|
||||
return requestClient.get<CrmContactApi.Contact[]>(
|
||||
'/crm/contact/simple-all-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 批量新增联系人商机关联 */
|
||||
export function createContactBusinessList(
|
||||
data: CrmContactApi.ContactBusinessReq,
|
||||
) {
|
||||
return requestClient.post('/crm/contact/create-business-list', data);
|
||||
}
|
||||
|
||||
/** 批量新增商机联系人关联 */
|
||||
export function createBusinessContactList(
|
||||
data: CrmContactApi.BusinessContactReq,
|
||||
) {
|
||||
return requestClient.post('/crm/contact/create-business-list2', data);
|
||||
}
|
||||
|
||||
/** 解除联系人商机关联 */
|
||||
export function deleteContactBusinessList(
|
||||
data: CrmContactApi.ContactBusinessReq,
|
||||
) {
|
||||
return requestClient.delete('/crm/contact/delete-business-list', { data });
|
||||
}
|
||||
|
||||
/** 解除商机联系人关联 */
|
||||
export function deleteBusinessContactList(
|
||||
data: CrmContactApi.BusinessContactReq,
|
||||
) {
|
||||
return requestClient.delete('/crm/contact/delete-business-list2', { data });
|
||||
}
|
||||
|
||||
/** 联系人转移 */
|
||||
export function transferContact(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/contact/transfer', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmContractConfigApi {
|
||||
/** 合同配置信息 */
|
||||
export interface Config {
|
||||
notifyEnabled?: boolean;
|
||||
notifyDays?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取合同配置 */
|
||||
export function getContractConfig() {
|
||||
return requestClient.get<CrmContractConfigApi.Config>(
|
||||
'/crm/contract-config/get',
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新合同配置 */
|
||||
export function saveContractConfig(data: CrmContractConfigApi.Config) {
|
||||
return requestClient.put('/crm/contract-config/save', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmContractApi {
|
||||
/** 合同产品信息 */
|
||||
export interface ContractProduct {
|
||||
id: number;
|
||||
productId: number;
|
||||
productName: string;
|
||||
productNo: string;
|
||||
productUnit: number;
|
||||
productPrice: number;
|
||||
contractPrice: number;
|
||||
count: number;
|
||||
totalPrice: number;
|
||||
}
|
||||
|
||||
/** 合同信息 */
|
||||
export interface Contract {
|
||||
id: number;
|
||||
name: string;
|
||||
no: string;
|
||||
customerId: number;
|
||||
customerName?: string;
|
||||
businessId: number;
|
||||
businessName: string;
|
||||
contactLastTime: Date;
|
||||
ownerUserId: number;
|
||||
ownerUserName?: string;
|
||||
ownerUserDeptName?: string;
|
||||
processInstanceId: number;
|
||||
auditStatus: number;
|
||||
orderDate: Date;
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
totalProductPrice: number;
|
||||
discountPercent: number;
|
||||
totalPrice: number;
|
||||
totalReceivablePrice: number;
|
||||
signContactId: number;
|
||||
signContactName?: string;
|
||||
signUserId: number;
|
||||
signUserName: string;
|
||||
remark: string;
|
||||
createTime?: Date;
|
||||
creator: string;
|
||||
creatorName: string;
|
||||
updateTime?: Date;
|
||||
products?: ContractProduct[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询合同列表 */
|
||||
export function getContractPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||
'/crm/contract/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询合同列表,基于指定客户 */
|
||||
export function getContractPageByCustomer(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||
'/crm/contract/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询合同列表,基于指定商机 */
|
||||
export function getContractPageByBusiness(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||
'/crm/contract/page-by-business',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询合同详情 */
|
||||
export function getContract(id: number) {
|
||||
return requestClient.get<CrmContractApi.Contract>(
|
||||
`/crm/contract/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询合同下拉列表 */
|
||||
export function getContractSimpleList(customerId: number) {
|
||||
return requestClient.get<CrmContractApi.Contract[]>(
|
||||
`/crm/contract/simple-list?customerId=${customerId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增合同 */
|
||||
export function createContract(data: CrmContractApi.Contract) {
|
||||
return requestClient.post('/crm/contract/create', data);
|
||||
}
|
||||
|
||||
/** 修改合同 */
|
||||
export function updateContract(data: CrmContractApi.Contract) {
|
||||
return requestClient.put('/crm/contract/update', data);
|
||||
}
|
||||
|
||||
/** 删除合同 */
|
||||
export function deleteContract(id: number) {
|
||||
return requestClient.delete(`/crm/contract/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出合同 */
|
||||
export function exportContract(params: any) {
|
||||
return requestClient.download('/crm/contract/export-excel', params);
|
||||
}
|
||||
|
||||
/** 提交审核 */
|
||||
export function submitContract(id: number) {
|
||||
return requestClient.put(`/crm/contract/submit?id=${id}`);
|
||||
}
|
||||
|
||||
/** 合同转移 */
|
||||
export function transferContract(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/contract/transfer', data);
|
||||
}
|
||||
|
||||
/** 获得待审核合同数量 */
|
||||
export function getAuditContractCount() {
|
||||
return requestClient.get<number>('/crm/contract/audit-count');
|
||||
}
|
||||
|
||||
/** 获得即将到期(提醒)的合同数量 */
|
||||
export function getRemindContractCount() {
|
||||
return requestClient.get<number>('/crm/contract/remind-count');
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmCustomerApi {
|
||||
/** 客户信息 */
|
||||
export interface Customer {
|
||||
id: number; // 编号
|
||||
name: string; // 客户名称
|
||||
followUpStatus: boolean; // 跟进状态
|
||||
contactLastTime: Date; // 最后跟进时间
|
||||
contactLastContent: string; // 最后跟进内容
|
||||
contactNextTime: Date; // 下次联系时间
|
||||
ownerUserId: number; // 负责人的用户编号
|
||||
ownerUserName?: string; // 负责人的用户名称
|
||||
ownerUserDept?: string; // 负责人的部门名称
|
||||
lockStatus?: boolean;
|
||||
dealStatus?: boolean;
|
||||
mobile: string; // 手机号
|
||||
telephone: string; // 电话
|
||||
qq: string; // QQ
|
||||
wechat: string; // wechat
|
||||
email: string; // email
|
||||
areaId: number; // 所在地
|
||||
areaName?: string; // 所在地名称
|
||||
detailAddress: string; // 详细地址
|
||||
industryId: number; // 所属行业
|
||||
level: number; // 客户等级
|
||||
source: number; // 客户来源
|
||||
remark: string; // 备注
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
export interface CustomerImport {
|
||||
ownerUserId: number;
|
||||
file: File;
|
||||
updateSupport: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询客户列表 */
|
||||
export function getCustomerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmCustomerApi.Customer>>(
|
||||
'/crm/customer/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询客户详情 */
|
||||
export function getCustomer(id: number) {
|
||||
return requestClient.get<CrmCustomerApi.Customer>(
|
||||
`/crm/customer/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增客户 */
|
||||
export function createCustomer(data: CrmCustomerApi.Customer) {
|
||||
return requestClient.post('/crm/customer/create', data);
|
||||
}
|
||||
|
||||
/** 修改客户 */
|
||||
export function updateCustomer(data: CrmCustomerApi.Customer) {
|
||||
return requestClient.put('/crm/customer/update', data);
|
||||
}
|
||||
|
||||
/** 删除客户 */
|
||||
export function deleteCustomer(id: number) {
|
||||
return requestClient.delete(`/crm/customer/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出客户 */
|
||||
export function exportCustomer(params: any) {
|
||||
return requestClient.download('/crm/customer/export-excel', params);
|
||||
}
|
||||
|
||||
/** 下载客户导入模板 */
|
||||
export function importCustomerTemplate() {
|
||||
return requestClient.download('/crm/customer/get-import-template');
|
||||
}
|
||||
|
||||
/** 导入客户 */
|
||||
export function importCustomer(data: CrmCustomerApi.CustomerImport) {
|
||||
return requestClient.upload('/crm/customer/import', data);
|
||||
}
|
||||
|
||||
/** 获取客户精简信息列表 */
|
||||
export function getCustomerSimpleList() {
|
||||
return requestClient.get<CrmCustomerApi.Customer[]>(
|
||||
'/crm/customer/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 客户转移 */
|
||||
export function transferCustomer(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/customer/transfer', data);
|
||||
}
|
||||
|
||||
/** 锁定/解锁客户 */
|
||||
export function lockCustomer(id: number, lockStatus: boolean) {
|
||||
return requestClient.put('/crm/customer/lock', { id, lockStatus });
|
||||
}
|
||||
|
||||
/** 领取公海客户 */
|
||||
export function receiveCustomer(ids: number[]) {
|
||||
return requestClient.put('/crm/customer/receive', { ids: ids.join(',') });
|
||||
}
|
||||
|
||||
/** 分配公海给对应负责人 */
|
||||
export function distributeCustomer(ids: number[], ownerUserId: number) {
|
||||
return requestClient.put('/crm/customer/distribute', { ids, ownerUserId });
|
||||
}
|
||||
|
||||
/** 客户放入公海 */
|
||||
export function putCustomerPool(id: number) {
|
||||
return requestClient.put(`/crm/customer/put-pool?id=${id}`);
|
||||
}
|
||||
|
||||
/** 更新客户的成交状态 */
|
||||
export function updateCustomerDealStatus(id: number, dealStatus: boolean) {
|
||||
return requestClient.put(
|
||||
`/crm/customer/update-deal-status?id=${id}&dealStatus=${dealStatus}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 进入公海客户提醒的客户列表 */
|
||||
export function getPutPoolRemindCustomerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmCustomerApi.Customer>>(
|
||||
'/crm/customer/put-pool-remind-page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得待进入公海客户数量 */
|
||||
export function getPutPoolRemindCustomerCount() {
|
||||
return requestClient.get<number>('/crm/customer/put-pool-remind-count');
|
||||
}
|
||||
|
||||
/** 获得今日需联系客户数量 */
|
||||
export function getTodayContactCustomerCount() {
|
||||
return requestClient.get<number>('/crm/customer/today-contact-count');
|
||||
}
|
||||
|
||||
/** 获得分配给我、待跟进的线索数量的客户数量 */
|
||||
export function getFollowCustomerCount() {
|
||||
return requestClient.get<number>('/crm/customer/follow-count');
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmCustomerLimitConfigApi {
|
||||
/** 客户限制配置 */
|
||||
export interface CustomerLimitConfig {
|
||||
id?: number;
|
||||
type?: number;
|
||||
userIds?: string;
|
||||
deptIds?: string;
|
||||
maxCount?: number;
|
||||
dealCountEnabled?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/** 客户限制配置类型 */
|
||||
export enum LimitConfType {
|
||||
/** 锁定客户数限制 */
|
||||
CUSTOMER_LOCK_LIMIT = 2,
|
||||
/** 拥有客户数限制 */
|
||||
CUSTOMER_QUANTITY_LIMIT = 1,
|
||||
}
|
||||
|
||||
/** 查询客户限制配置列表 */
|
||||
export function getCustomerLimitConfigPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<CrmCustomerLimitConfigApi.CustomerLimitConfig>
|
||||
>('/crm/customer-limit-config/page', { params });
|
||||
}
|
||||
|
||||
/** 查询客户限制配置详情 */
|
||||
export function getCustomerLimitConfig(id: number) {
|
||||
return requestClient.get<CrmCustomerLimitConfigApi.CustomerLimitConfig>(
|
||||
`/crm/customer-limit-config/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增客户限制配置 */
|
||||
export function createCustomerLimitConfig(
|
||||
data: CrmCustomerLimitConfigApi.CustomerLimitConfig,
|
||||
) {
|
||||
return requestClient.post('/crm/customer-limit-config/create', data);
|
||||
}
|
||||
|
||||
/** 修改客户限制配置 */
|
||||
export function updateCustomerLimitConfig(
|
||||
data: CrmCustomerLimitConfigApi.CustomerLimitConfig,
|
||||
) {
|
||||
return requestClient.put('/crm/customer-limit-config/update', data);
|
||||
}
|
||||
|
||||
/** 删除客户限制配置 */
|
||||
export function deleteCustomerLimitConfig(id: number) {
|
||||
return requestClient.delete(`/crm/customer-limit-config/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmCustomerPoolConfigApi {
|
||||
/** 客户公海规则设置 */
|
||||
export interface CustomerPoolConfig {
|
||||
enabled?: boolean;
|
||||
contactExpireDays?: number;
|
||||
dealExpireDays?: number;
|
||||
notifyEnabled?: boolean;
|
||||
notifyDays?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取客户公海规则设置 */
|
||||
export function getCustomerPoolConfig() {
|
||||
return requestClient.get<CrmCustomerPoolConfigApi.CustomerPoolConfig>(
|
||||
'/crm/customer-pool-config/get',
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新客户公海规则设置 */
|
||||
export function saveCustomerPoolConfig(
|
||||
data: CrmCustomerPoolConfigApi.CustomerPoolConfig,
|
||||
) {
|
||||
return requestClient.put('/crm/customer-pool-config/save', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmFollowUpApi {
|
||||
/** 关联商机信息 */
|
||||
export interface Business {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/** 关联联系人信息 */
|
||||
export interface Contact {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/** 跟进记录信息 */
|
||||
export interface FollowUpRecord {
|
||||
id: number; // 编号
|
||||
bizType: number; // 数据类型
|
||||
bizId: number; // 数据编号
|
||||
type: number; // 跟进类型
|
||||
content: string; // 跟进内容
|
||||
picUrls: string[]; // 图片
|
||||
fileUrls: string[]; // 附件
|
||||
nextTime: Date; // 下次联系时间
|
||||
businessIds: number[]; // 关联的商机编号数组
|
||||
businesses: Business[]; // 关联的商机数组
|
||||
contactIds: number[]; // 关联的联系人编号数组
|
||||
contacts: Contact[]; // 关联的联系人数组
|
||||
creator: string;
|
||||
creatorName?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询跟进记录分页 */
|
||||
export function getFollowUpRecordPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmFollowUpApi.FollowUpRecord>>(
|
||||
'/crm/follow-up-record/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增跟进记录 */
|
||||
export function createFollowUpRecord(data: CrmFollowUpApi.FollowUpRecord) {
|
||||
return requestClient.post('/crm/follow-up-record/create', data);
|
||||
}
|
||||
|
||||
/** 删除跟进记录 */
|
||||
export function deleteFollowUpRecord(id: number) {
|
||||
return requestClient.delete(`/crm/follow-up-record/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import type { PageResult } from '@vben/request';
|
||||
|
||||
import type { SystemOperateLogApi } from '#/api/system/operate-log';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmOperateLogApi {
|
||||
/** 操作日志查询参数 */
|
||||
export interface OperateLogQuery {
|
||||
bizType: number;
|
||||
bizId: number;
|
||||
}
|
||||
|
||||
/** 操作日志信息 */
|
||||
export interface OperateLog {
|
||||
id: number;
|
||||
bizType: number;
|
||||
bizId: number;
|
||||
type: number;
|
||||
content: string;
|
||||
creator: string;
|
||||
creatorName?: string;
|
||||
createTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得操作日志 */
|
||||
export function getOperateLogPage(params: CrmOperateLogApi.OperateLogQuery) {
|
||||
return requestClient.get<PageResult<SystemOperateLogApi.OperateLog>>(
|
||||
'/crm/operate-log/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmPermissionApi {
|
||||
/** 数据权限信息 */
|
||||
export interface Permission {
|
||||
id?: number; // 数据权限编号
|
||||
ids?: number[];
|
||||
userId?: number; // 用户编号
|
||||
bizType: number; // Crm 类型
|
||||
bizId: number; // Crm 类型数据编号
|
||||
level: number; // 权限级别
|
||||
toBizTypes?: number[]; // 同时添加至
|
||||
deptName?: string; // 部门名称
|
||||
nickname?: string; // 用户昵称
|
||||
postNames?: string[]; // 岗位名称数组
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
/** 数据权限转移请求 */
|
||||
export interface TransferReq {
|
||||
id: number; // 模块编号
|
||||
newOwnerUserId: number; // 新负责人的用户编号
|
||||
oldOwnerPermissionLevel?: number; // 老负责人加入团队后的权限级别
|
||||
toBizTypes?: number[]; // 转移客户时,需要额外有【联系人】【商机】【合同】的 checkbox 选择
|
||||
}
|
||||
|
||||
export interface PermissionListReq {
|
||||
bizId: number; // 模块数据编号
|
||||
bizType: number; // 模块类型
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* CRM 业务类型枚举
|
||||
*/
|
||||
export enum BizTypeEnum {
|
||||
CRM_BUSINESS = 4, // 商机
|
||||
CRM_CLUE = 1, // 线索
|
||||
CRM_CONTACT = 3, // 联系人
|
||||
CRM_CONTRACT = 5, // 合同
|
||||
CRM_CUSTOMER = 2, // 客户
|
||||
CRM_PRODUCT = 6, // 产品
|
||||
CRM_RECEIVABLE = 7, // 回款
|
||||
CRM_RECEIVABLE_PLAN = 8, // 回款计划
|
||||
}
|
||||
|
||||
/**
|
||||
* CRM 数据权限级别枚举
|
||||
*/
|
||||
export enum PermissionLevelEnum {
|
||||
OWNER = 1, // 负责人
|
||||
READ = 2, // 只读
|
||||
WRITE = 3, // 读写
|
||||
}
|
||||
|
||||
/** 获得数据权限列表(查询团队成员列表) */
|
||||
export function getPermissionList(params: CrmPermissionApi.PermissionListReq) {
|
||||
return requestClient.get<CrmPermissionApi.Permission[]>(
|
||||
'/crm/permission/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 创建数据权限(新增团队成员) */
|
||||
export function createPermission(data: CrmPermissionApi.Permission) {
|
||||
return requestClient.post('/crm/permission/create', data);
|
||||
}
|
||||
|
||||
/** 编辑数据权限(修改团队成员权限级别) */
|
||||
export function updatePermission(data: CrmPermissionApi.Permission) {
|
||||
return requestClient.put('/crm/permission/update', data);
|
||||
}
|
||||
|
||||
/** 删除数据权限(删除团队成员) */
|
||||
export function deletePermissionBatch(ids: number[]) {
|
||||
return requestClient.delete(`/crm/permission/delete?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 删除自己的数据权限(退出团队) */
|
||||
export function deleteSelfPermission(id: number) {
|
||||
return requestClient.delete(`/crm/permission/delete-self?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmProductCategoryApi {
|
||||
/** 产品分类信息 */
|
||||
export interface ProductCategory {
|
||||
id: number;
|
||||
name: string;
|
||||
parentId: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询产品分类详情 */
|
||||
export function getProductCategory(id: number) {
|
||||
return requestClient.get<CrmProductCategoryApi.ProductCategory>(
|
||||
`/crm/product-category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增产品分类 */
|
||||
export function createProductCategory(
|
||||
data: CrmProductCategoryApi.ProductCategory,
|
||||
) {
|
||||
return requestClient.post('/crm/product-category/create', data);
|
||||
}
|
||||
|
||||
/** 修改产品分类 */
|
||||
export function updateProductCategory(
|
||||
data: CrmProductCategoryApi.ProductCategory,
|
||||
) {
|
||||
return requestClient.put('/crm/product-category/update', data);
|
||||
}
|
||||
|
||||
/** 删除产品分类 */
|
||||
export function deleteProductCategory(id: number) {
|
||||
return requestClient.delete(`/crm/product-category/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 产品分类列表 */
|
||||
export function getProductCategoryList(params?: any) {
|
||||
return requestClient.get<CrmProductCategoryApi.ProductCategory[]>(
|
||||
'/crm/product-category/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmProductApi {
|
||||
/** 产品信息 */
|
||||
export interface Product {
|
||||
id: number;
|
||||
name: string;
|
||||
no: string;
|
||||
unit: number;
|
||||
price: number;
|
||||
status: number;
|
||||
categoryId: number;
|
||||
categoryName?: string;
|
||||
description: string;
|
||||
ownerUserId: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询产品列表 */
|
||||
export function getProductPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmProductApi.Product>>(
|
||||
'/crm/product/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得产品精简列表 */
|
||||
export function getProductSimpleList() {
|
||||
return requestClient.get<CrmProductApi.Product[]>('/crm/product/simple-list');
|
||||
}
|
||||
|
||||
/** 查询产品详情 */
|
||||
export function getProduct(id: number) {
|
||||
return requestClient.get<CrmProductApi.Product>(`/crm/product/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增产品 */
|
||||
export function createProduct(data: CrmProductApi.Product) {
|
||||
return requestClient.post('/crm/product/create', data);
|
||||
}
|
||||
|
||||
/** 修改产品 */
|
||||
export function updateProduct(data: CrmProductApi.Product) {
|
||||
return requestClient.put('/crm/product/update', data);
|
||||
}
|
||||
|
||||
/** 删除产品 */
|
||||
export function deleteProduct(id: number) {
|
||||
return requestClient.delete(`/crm/product/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出产品 */
|
||||
export function exportProduct(params: any) {
|
||||
return requestClient.download('/crm/product/export-excel', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmReceivableApi {
|
||||
/** 合同信息 */
|
||||
export interface Contract {
|
||||
id?: number;
|
||||
name?: string;
|
||||
no: string;
|
||||
totalPrice: number;
|
||||
}
|
||||
|
||||
/** 回款信息 */
|
||||
export interface Receivable {
|
||||
id: number;
|
||||
no: string;
|
||||
planId?: number;
|
||||
period?: number;
|
||||
customerId?: number;
|
||||
customerName?: string;
|
||||
contractId?: number;
|
||||
contract?: Contract;
|
||||
auditStatus: number;
|
||||
processInstanceId: number;
|
||||
returnTime: Date;
|
||||
returnType: number;
|
||||
price: number;
|
||||
ownerUserId: number;
|
||||
ownerUserName?: string;
|
||||
remark: string;
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
|
||||
export interface ReceivablePageParam extends PageParam {
|
||||
no?: string;
|
||||
planId?: number;
|
||||
customerId?: number;
|
||||
contractId?: number;
|
||||
sceneType?: number;
|
||||
auditStatus?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询回款列表 */
|
||||
export function getReceivablePage(
|
||||
params: CrmReceivableApi.ReceivablePageParam,
|
||||
) {
|
||||
return requestClient.get<PageResult<CrmReceivableApi.Receivable>>(
|
||||
'/crm/receivable/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款列表,基于指定客户 */
|
||||
export function getReceivablePageByCustomer(
|
||||
params: CrmReceivableApi.ReceivablePageParam,
|
||||
) {
|
||||
return requestClient.get<PageResult<CrmReceivableApi.Receivable>>(
|
||||
'/crm/receivable/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款详情 */
|
||||
export function getReceivable(id: number) {
|
||||
return requestClient.get<CrmReceivableApi.Receivable>(
|
||||
`/crm/receivable/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增回款 */
|
||||
export function createReceivable(data: CrmReceivableApi.Receivable) {
|
||||
return requestClient.post('/crm/receivable/create', data);
|
||||
}
|
||||
|
||||
/** 修改回款 */
|
||||
export function updateReceivable(data: CrmReceivableApi.Receivable) {
|
||||
return requestClient.put('/crm/receivable/update', data);
|
||||
}
|
||||
|
||||
/** 删除回款 */
|
||||
export function deleteReceivable(id: number) {
|
||||
return requestClient.delete(`/crm/receivable/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出回款 */
|
||||
export function exportReceivable(params: any) {
|
||||
return requestClient.download('/crm/receivable/export-excel', params);
|
||||
}
|
||||
|
||||
/** 提交审核 */
|
||||
export function submitReceivable(id: number) {
|
||||
return requestClient.put(`/crm/receivable/submit?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得待审核回款数量 */
|
||||
export function getAuditReceivableCount() {
|
||||
return requestClient.get<number>('/crm/receivable/audit-count');
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmReceivablePlanApi {
|
||||
/** 回款计划信息 */
|
||||
export interface Plan {
|
||||
id: number;
|
||||
period: number;
|
||||
receivableId: number;
|
||||
price: number;
|
||||
returnTime: Date;
|
||||
remindDays: number;
|
||||
returnType: number;
|
||||
remindTime: Date;
|
||||
customerId: number;
|
||||
customerName?: string;
|
||||
contractId?: number;
|
||||
contractNo?: string;
|
||||
ownerUserId: number;
|
||||
ownerUserName?: string;
|
||||
remark: string;
|
||||
creator: string;
|
||||
creatorName?: string;
|
||||
createTime: Date;
|
||||
updateTime: Date;
|
||||
receivable?: {
|
||||
price: number;
|
||||
returnTime: Date;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PlanPageParam extends PageParam {
|
||||
customerId?: number;
|
||||
contractId?: number;
|
||||
contractNo?: string;
|
||||
sceneType?: number;
|
||||
remindType?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询回款计划列表 */
|
||||
export function getReceivablePlanPage(
|
||||
params: CrmReceivablePlanApi.PlanPageParam,
|
||||
) {
|
||||
return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
|
||||
'/crm/receivable-plan/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款计划列表(按客户) */
|
||||
export function getReceivablePlanPageByCustomer(
|
||||
params: CrmReceivablePlanApi.PlanPageParam,
|
||||
) {
|
||||
return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
|
||||
'/crm/receivable-plan/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款计划详情 */
|
||||
export function getReceivablePlan(id: number) {
|
||||
return requestClient.get<CrmReceivablePlanApi.Plan>(
|
||||
'/crm/receivable-plan/get',
|
||||
{ params: { id } },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款计划下拉数据 */
|
||||
export function getReceivablePlanSimpleList(
|
||||
customerId: number,
|
||||
contractId: number,
|
||||
) {
|
||||
return requestClient.get<CrmReceivablePlanApi.Plan[]>(
|
||||
'/crm/receivable-plan/simple-list',
|
||||
{
|
||||
params: { customerId, contractId },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增回款计划 */
|
||||
export function createReceivablePlan(data: CrmReceivablePlanApi.Plan) {
|
||||
return requestClient.post('/crm/receivable-plan/create', data);
|
||||
}
|
||||
|
||||
/** 修改回款计划 */
|
||||
export function updateReceivablePlan(data: CrmReceivablePlanApi.Plan) {
|
||||
return requestClient.put('/crm/receivable-plan/update', data);
|
||||
}
|
||||
|
||||
/** 删除回款计划 */
|
||||
export function deleteReceivablePlan(id: number) {
|
||||
return requestClient.delete('/crm/receivable-plan/delete', {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出回款计划 Excel */
|
||||
export function exportReceivablePlan(params: PageParam) {
|
||||
return requestClient.download('/crm/receivable-plan/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得待回款提醒数量 */
|
||||
export function getReceivablePlanRemindCount() {
|
||||
return requestClient.get<number>('/crm/receivable-plan/remind-count');
|
||||
}
|
||||
|
|
@ -0,0 +1,285 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsCustomerApi {
|
||||
/** 客户总量分析(按日期) */
|
||||
export interface CustomerSummaryByDate {
|
||||
time: string;
|
||||
customerCreateCount: number;
|
||||
customerDealCount: number;
|
||||
}
|
||||
|
||||
/** 客户总量分析(按用户) */
|
||||
export interface CustomerSummaryByUser {
|
||||
ownerUserName: string;
|
||||
customerCreateCount: number;
|
||||
customerDealCount: number;
|
||||
contractPrice: number;
|
||||
receivablePrice: number;
|
||||
}
|
||||
|
||||
/** 客户跟进次数分析(按日期) */
|
||||
export interface FollowUpSummaryByDate {
|
||||
time: string;
|
||||
followUpRecordCount: number;
|
||||
followUpCustomerCount: number;
|
||||
}
|
||||
|
||||
/** 客户跟进次数分析(按用户) */
|
||||
export interface FollowUpSummaryByUser {
|
||||
ownerUserName: string;
|
||||
followupRecordCount: number;
|
||||
followupCustomerCount: number;
|
||||
}
|
||||
|
||||
/** 客户跟进方式统计 */
|
||||
export interface FollowUpSummaryByType {
|
||||
followUpType: string;
|
||||
followUpRecordCount: number;
|
||||
}
|
||||
|
||||
/** 合同摘要信息 */
|
||||
export interface CustomerContractSummary {
|
||||
customerName: string;
|
||||
contractName: string;
|
||||
totalPrice: number;
|
||||
receivablePrice: number;
|
||||
customerType: string;
|
||||
customerSource: string;
|
||||
ownerUserName: string;
|
||||
creatorUserName: string;
|
||||
createTime: Date;
|
||||
orderDate: Date;
|
||||
}
|
||||
|
||||
/** 客户公海分析(按日期) */
|
||||
export interface PoolSummaryByDate {
|
||||
time: string;
|
||||
customerPutCount: number;
|
||||
customerTakeCount: number;
|
||||
}
|
||||
|
||||
/** 客户公海分析(按用户) */
|
||||
export interface PoolSummaryByUser {
|
||||
ownerUserName: string;
|
||||
customerPutCount: number;
|
||||
customerTakeCount: number;
|
||||
}
|
||||
|
||||
/** 客户成交周期(按日期) */
|
||||
export interface CustomerDealCycleByDate {
|
||||
time: string;
|
||||
customerDealCycle: number;
|
||||
}
|
||||
|
||||
/** 客户成交周期(按用户) */
|
||||
export interface CustomerDealCycleByUser {
|
||||
ownerUserName: string;
|
||||
customerDealCycle: number;
|
||||
customerDealCount: number;
|
||||
}
|
||||
|
||||
/** 客户成交周期(按地区) */
|
||||
export interface CustomerDealCycleByArea {
|
||||
areaName: string;
|
||||
customerDealCycle: number;
|
||||
customerDealCount: number;
|
||||
}
|
||||
|
||||
/** 客户成交周期(按产品) */
|
||||
export interface CustomerDealCycleByProduct {
|
||||
productName: string;
|
||||
customerDealCycle: number;
|
||||
customerDealCount: number;
|
||||
}
|
||||
|
||||
export interface CustomerSummaryParams {
|
||||
times: string[];
|
||||
interval: number;
|
||||
deptId: number;
|
||||
userId: number;
|
||||
userIds: number[];
|
||||
}
|
||||
}
|
||||
|
||||
export function getDatas(activeTabName: any, params: any) {
|
||||
switch (activeTabName) {
|
||||
case 'conversionStat': {
|
||||
return getContractSummary(params);
|
||||
}
|
||||
case 'customerSummary': {
|
||||
return getCustomerSummaryByUser(params);
|
||||
}
|
||||
case 'dealCycleByArea': {
|
||||
return getCustomerDealCycleByArea(params);
|
||||
}
|
||||
case 'dealCycleByProduct': {
|
||||
return getCustomerDealCycleByProduct(params);
|
||||
}
|
||||
case 'dealCycleByUser': {
|
||||
return getCustomerDealCycleByUser(params);
|
||||
}
|
||||
case 'followUpSummary': {
|
||||
return getFollowUpSummaryByUser(params);
|
||||
}
|
||||
case 'followUpType': {
|
||||
return getFollowUpSummaryByType(params);
|
||||
}
|
||||
case 'poolSummary': {
|
||||
return getPoolSummaryByUser(params);
|
||||
}
|
||||
default: {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getChartDatas(activeTabName: any, params: any) {
|
||||
switch (activeTabName) {
|
||||
case 'conversionStat': {
|
||||
return getCustomerSummaryByDate(params);
|
||||
}
|
||||
case 'customerSummary': {
|
||||
return getCustomerSummaryByDate(params);
|
||||
}
|
||||
case 'dealCycleByArea': {
|
||||
return getCustomerDealCycleByArea(params);
|
||||
}
|
||||
case 'dealCycleByProduct': {
|
||||
return getCustomerDealCycleByProduct(params);
|
||||
}
|
||||
case 'dealCycleByUser': {
|
||||
return getCustomerDealCycleByUser(params);
|
||||
}
|
||||
case 'followUpSummary': {
|
||||
return getFollowUpSummaryByDate(params);
|
||||
}
|
||||
case 'followUpType': {
|
||||
return getFollowUpSummaryByType(params);
|
||||
}
|
||||
case 'poolSummary': {
|
||||
return getPoolSummaryByDate(params);
|
||||
}
|
||||
default: {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 客户总量分析(按日期) */
|
||||
export function getCustomerSummaryByDate(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerSummaryByDate[]>(
|
||||
'/crm/statistics-customer/get-customer-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 客户总量分析(按用户) */
|
||||
export function getCustomerSummaryByUser(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerSummaryByUser[]>(
|
||||
'/crm/statistics-customer/get-customer-summary-by-user',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 客户跟进次数分析(按日期) */
|
||||
export function getFollowUpSummaryByDate(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.FollowUpSummaryByDate[]>(
|
||||
'/crm/statistics-customer/get-follow-up-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 客户跟进次数分析(按用户) */
|
||||
export function getFollowUpSummaryByUser(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.FollowUpSummaryByUser[]>(
|
||||
'/crm/statistics-customer/get-follow-up-summary-by-user',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户跟进方式统计数 */
|
||||
export function getFollowUpSummaryByType(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.FollowUpSummaryByType[]>(
|
||||
'/crm/statistics-customer/get-follow-up-summary-by-type',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 合同摘要信息(客户转化率页面) */
|
||||
export function getContractSummary(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerContractSummary[]>(
|
||||
'/crm/statistics-customer/get-contract-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户公海分析(按日期) */
|
||||
export function getPoolSummaryByDate(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.PoolSummaryByDate[]>(
|
||||
'/crm/statistics-customer/get-pool-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户公海分析(按用户) */
|
||||
export function getPoolSummaryByUser(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.PoolSummaryByUser[]>(
|
||||
'/crm/statistics-customer/get-pool-summary-by-user',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户成交周期(按日期) */
|
||||
export function getCustomerDealCycleByDate(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerDealCycleByDate[]>(
|
||||
'/crm/statistics-customer/get-customer-deal-cycle-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户成交周期(按用户) */
|
||||
export function getCustomerDealCycleByUser(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerDealCycleByUser[]>(
|
||||
'/crm/statistics-customer/get-customer-deal-cycle-by-user',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户成交周期(按地区) */
|
||||
export function getCustomerDealCycleByArea(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerDealCycleByArea[]>(
|
||||
'/crm/statistics-customer/get-customer-deal-cycle-by-area',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户成交周期(按产品) */
|
||||
export function getCustomerDealCycleByProduct(
|
||||
params: CrmStatisticsCustomerApi.CustomerSummaryParams,
|
||||
) {
|
||||
return requestClient.get<
|
||||
CrmStatisticsCustomerApi.CustomerDealCycleByProduct[]
|
||||
>('/crm/statistics-customer/get-customer-deal-cycle-by-product', { params });
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
import type { PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsFunnelApi {
|
||||
/** 销售漏斗统计数据 */
|
||||
export interface FunnelSummary {
|
||||
customerCount: number; // 客户数
|
||||
businessCount: number; // 商机数
|
||||
businessWinCount: number; // 赢单数
|
||||
}
|
||||
|
||||
/** 商机分析(按日期) */
|
||||
export interface BusinessSummaryByDate {
|
||||
time: string; // 时间
|
||||
businessCreateCount: number; // 商机数
|
||||
totalPrice: number | string; // 商机金额
|
||||
}
|
||||
|
||||
/** 商机转化率分析(按日期) */
|
||||
export interface BusinessInversionRateSummaryByDate {
|
||||
time: string; // 时间
|
||||
businessCount: number; // 商机数量
|
||||
businessWinCount: number; // 赢单商机数
|
||||
}
|
||||
}
|
||||
|
||||
export function getDatas(activeTabName: any, params: any) {
|
||||
switch (activeTabName) {
|
||||
case 'businessInversionRateSummary': {
|
||||
return getBusinessPageByDate(params);
|
||||
}
|
||||
case 'businessSummary': {
|
||||
return getBusinessPageByDate(params);
|
||||
}
|
||||
case 'funnel': {
|
||||
return getBusinessSummaryByEndStatus(params);
|
||||
}
|
||||
default: {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getChartDatas(activeTabName: any, params: any) {
|
||||
switch (activeTabName) {
|
||||
case 'businessInversionRateSummary': {
|
||||
return getBusinessInversionRateSummaryByDate(params);
|
||||
}
|
||||
case 'businessSummary': {
|
||||
return getBusinessSummaryByDate(params);
|
||||
}
|
||||
case 'funnel': {
|
||||
return getFunnelSummary(params);
|
||||
}
|
||||
default: {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取销售漏斗统计数据 */
|
||||
export function getFunnelSummary(params: any) {
|
||||
return requestClient.get<CrmStatisticsFunnelApi.FunnelSummary>(
|
||||
'/crm/statistics-funnel/get-funnel-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取商机结束状态统计 */
|
||||
export function getBusinessSummaryByEndStatus(params: any) {
|
||||
return requestClient.get<Record<string, number>>(
|
||||
'/crm/statistics-funnel/get-business-summary-by-end-status',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取新增商机分析(按日期) */
|
||||
export function getBusinessSummaryByDate(params: any) {
|
||||
return requestClient.get<CrmStatisticsFunnelApi.BusinessSummaryByDate[]>(
|
||||
'/crm/statistics-funnel/get-business-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取商机转化率分析(按日期) */
|
||||
export function getBusinessInversionRateSummaryByDate(params: any) {
|
||||
return requestClient.get<
|
||||
CrmStatisticsFunnelApi.BusinessInversionRateSummaryByDate[]
|
||||
>('/crm/statistics-funnel/get-business-inversion-rate-summary-by-date', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取商机列表(按日期) */
|
||||
export function getBusinessPageByDate(params: any) {
|
||||
return requestClient.get<PageResult<any>>(
|
||||
'/crm/statistics-funnel/get-business-page-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsPerformanceApi {
|
||||
/** 员工业绩统计 */
|
||||
export interface Performance {
|
||||
time: string;
|
||||
currentMonthCount: number;
|
||||
lastMonthCount: number;
|
||||
lastYearCount: number;
|
||||
}
|
||||
export interface PerformanceParams {
|
||||
times: string[];
|
||||
deptId: number;
|
||||
userId: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 员工获得合同金额统计 */
|
||||
export function getContractPricePerformance(
|
||||
params: CrmStatisticsPerformanceApi.PerformanceParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsPerformanceApi.Performance[]>(
|
||||
'/crm/statistics-performance/get-contract-price-performance',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 员工获得回款统计 */
|
||||
export function getReceivablePricePerformance(
|
||||
params: CrmStatisticsPerformanceApi.PerformanceParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsPerformanceApi.Performance[]>(
|
||||
'/crm/statistics-performance/get-receivable-price-performance',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 员工获得签约合同数量统计 */
|
||||
export function getContractCountPerformance(
|
||||
params: CrmStatisticsPerformanceApi.PerformanceParams,
|
||||
) {
|
||||
return requestClient.get<CrmStatisticsPerformanceApi.Performance[]>(
|
||||
'/crm/statistics-performance/get-contract-count-performance',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsPortraitApi {
|
||||
/** 客户基础统计信息 */
|
||||
export interface CustomerBase {
|
||||
customerCount: number;
|
||||
dealCount: number;
|
||||
dealPortion: number | string;
|
||||
}
|
||||
|
||||
/** 客户行业统计信息 */
|
||||
export interface CustomerIndustry extends CustomerBase {
|
||||
industryId: number;
|
||||
industryPortion: number | string;
|
||||
}
|
||||
|
||||
/** 客户来源统计信息 */
|
||||
export interface CustomerSource extends CustomerBase {
|
||||
source: number;
|
||||
sourcePortion: number | string;
|
||||
}
|
||||
|
||||
/** 客户级别统计信息 */
|
||||
export interface CustomerLevel extends CustomerBase {
|
||||
level: number;
|
||||
levelPortion: number | string;
|
||||
}
|
||||
|
||||
/** 客户地区统计信息 */
|
||||
export interface CustomerArea extends CustomerBase {
|
||||
areaId: number;
|
||||
areaName: string;
|
||||
areaPortion: number | string;
|
||||
}
|
||||
}
|
||||
|
||||
export function getDatas(activeTabName: any, params: any) {
|
||||
switch (activeTabName) {
|
||||
case 'area': {
|
||||
return getCustomerArea(params);
|
||||
}
|
||||
case 'industry': {
|
||||
return getCustomerIndustry(params);
|
||||
}
|
||||
case 'level': {
|
||||
return getCustomerLevel(params);
|
||||
}
|
||||
case 'source': {
|
||||
return getCustomerSource(params);
|
||||
}
|
||||
default: {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取客户行业统计数据 */
|
||||
export function getCustomerIndustry(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPortraitApi.CustomerIndustry[]>(
|
||||
'/crm/statistics-portrait/get-customer-industry-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户来源统计数据 */
|
||||
export function getCustomerSource(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPortraitApi.CustomerSource[]>(
|
||||
'/crm/statistics-portrait/get-customer-source-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户级别统计数据 */
|
||||
export function getCustomerLevel(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPortraitApi.CustomerLevel[]>(
|
||||
'/crm/statistics-portrait/get-customer-level-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户地区统计数据 */
|
||||
export function getCustomerArea(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPortraitApi.CustomerArea[]>(
|
||||
'/crm/statistics-portrait/get-customer-area-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsRankApi {
|
||||
/** 排行统计数据 */
|
||||
export interface Rank {
|
||||
count: number;
|
||||
nickname: string;
|
||||
deptName: string;
|
||||
}
|
||||
}
|
||||
|
||||
export function getDatas(activeTabName: any, params: any) {
|
||||
switch (activeTabName) {
|
||||
case 'contactCountRank': {
|
||||
return getContactsCountRank(params);
|
||||
}
|
||||
case 'contractCountRank': {
|
||||
return getContractCountRank(params);
|
||||
}
|
||||
case 'contractPriceRank': {
|
||||
return getContractPriceRank(params);
|
||||
}
|
||||
case 'customerCountRank': {
|
||||
return getCustomerCountRank(params);
|
||||
}
|
||||
case 'followCountRank': {
|
||||
return getFollowCountRank(params);
|
||||
}
|
||||
case 'followCustomerCountRank': {
|
||||
return getFollowCustomerCountRank(params);
|
||||
}
|
||||
case 'productSalesRank': {
|
||||
return getProductSalesRank(params);
|
||||
}
|
||||
case 'receivablePriceRank': {
|
||||
return getReceivablePriceRank(params);
|
||||
}
|
||||
default: {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得合同排行榜 */
|
||||
export function getContractPriceRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-contract-price-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得回款排行榜 */
|
||||
export function getReceivablePriceRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-receivable-price-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 签约合同排行 */
|
||||
export function getContractCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-contract-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 产品销量排行 */
|
||||
export function getProductSalesRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-product-sales-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增客户数排行 */
|
||||
export function getCustomerCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-customer-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增联系人数排行 */
|
||||
export function getContactsCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-contacts-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 跟进次数排行 */
|
||||
export function getFollowCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-follow-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 跟进客户数排行 */
|
||||
export function getFollowCustomerCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-follow-customer-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBannerApi {
|
||||
/** Banner 信息 */
|
||||
export interface Banner {
|
||||
id: number;
|
||||
title: string;
|
||||
picUrl: string;
|
||||
status: number;
|
||||
url: string;
|
||||
position: number;
|
||||
sort: number;
|
||||
memo: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询Banner管理列表 */
|
||||
export function getBannerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBannerApi.Banner>>(
|
||||
'/promotion/banner/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询Banner管理详情 */
|
||||
export function getBanner(id: number) {
|
||||
return requestClient.get<MallBannerApi.Banner>(
|
||||
`/promotion/banner/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增Banner管理 */
|
||||
export function createBanner(data: MallBannerApi.Banner) {
|
||||
return requestClient.post('/promotion/banner/create', data);
|
||||
}
|
||||
|
||||
/** 修改Banner管理 */
|
||||
export function updateBanner(data: MallBannerApi.Banner) {
|
||||
return requestClient.put('/promotion/banner/update', data);
|
||||
}
|
||||
|
||||
/** 删除Banner管理 */
|
||||
export function deleteBanner(id: number) {
|
||||
return requestClient.delete(`/promotion/banner/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBrandApi {
|
||||
/** 商品品牌 */
|
||||
export interface Brand {
|
||||
/** 品牌编号 */
|
||||
id?: number;
|
||||
/** 品牌名称 */
|
||||
name: string;
|
||||
/** 品牌图片 */
|
||||
picUrl: string;
|
||||
/** 品牌排序 */
|
||||
sort?: number;
|
||||
/** 品牌描述 */
|
||||
description?: string;
|
||||
/** 开启状态 */
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建商品品牌 */
|
||||
export function createBrand(data: MallBrandApi.Brand) {
|
||||
return requestClient.post('/product/brand/create', data);
|
||||
}
|
||||
|
||||
/** 更新商品品牌 */
|
||||
export function updateBrand(data: MallBrandApi.Brand) {
|
||||
return requestClient.put('/product/brand/update', data);
|
||||
}
|
||||
|
||||
/** 删除商品品牌 */
|
||||
export function deleteBrand(id: number) {
|
||||
return requestClient.delete(`/product/brand/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商品品牌 */
|
||||
export function getBrand(id: number) {
|
||||
return requestClient.get<MallBrandApi.Brand>(`/product/brand/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商品品牌列表 */
|
||||
export function getBrandPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBrandApi.Brand>>(
|
||||
'/product/brand/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商品品牌精简信息列表 */
|
||||
export function getSimpleBrandList() {
|
||||
return requestClient.get<MallBrandApi.Brand[]>(
|
||||
'/product/brand/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCategoryApi {
|
||||
/** 产品分类 */
|
||||
export interface Category {
|
||||
/** 分类编号 */
|
||||
id?: number;
|
||||
/** 父分类编号 */
|
||||
parentId?: number;
|
||||
/** 分类名称 */
|
||||
name: string;
|
||||
/** 移动端分类图 */
|
||||
picUrl: string;
|
||||
/** 分类排序 */
|
||||
sort: number;
|
||||
/** 开启状态 */
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建商品分类 */
|
||||
export function createCategory(data: MallCategoryApi.Category) {
|
||||
return requestClient.post('/product/category/create', data);
|
||||
}
|
||||
|
||||
/** 更新商品分类 */
|
||||
export function updateCategory(data: MallCategoryApi.Category) {
|
||||
return requestClient.put('/product/category/update', data);
|
||||
}
|
||||
|
||||
/** 删除商品分类 */
|
||||
export function deleteCategory(id: number) {
|
||||
return requestClient.delete(`/product/category/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商品分类 */
|
||||
export function getCategory(id: number) {
|
||||
return requestClient.get<MallCategoryApi.Category>(
|
||||
`/product/category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商品分类列表 */
|
||||
export function getCategoryList(params: any) {
|
||||
return requestClient.get<MallCategoryApi.Category[]>(
|
||||
'/product/category/list',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCommentApi {
|
||||
export interface Property {
|
||||
propertyId: number;
|
||||
propertyName: string;
|
||||
valueId: number;
|
||||
valueName: string;
|
||||
}
|
||||
/** 商品评论 */
|
||||
export interface Comment {
|
||||
id: number;
|
||||
userId: number;
|
||||
userNickname: string;
|
||||
userAvatar: string;
|
||||
anonymous: boolean;
|
||||
orderId: number;
|
||||
orderItemId: number;
|
||||
spuId: number;
|
||||
spuName: string;
|
||||
skuId: number;
|
||||
visible: boolean;
|
||||
scores: number;
|
||||
descriptionScores: number;
|
||||
benefitScores: number;
|
||||
content: string;
|
||||
picUrls: string[];
|
||||
replyStatus: boolean;
|
||||
replyUserId: number;
|
||||
replyContent: string;
|
||||
replyTime: Date;
|
||||
createTime: Date;
|
||||
skuProperties: Property[];
|
||||
}
|
||||
|
||||
/** 评论可见性更新 */
|
||||
export interface CommentVisibleUpdate {
|
||||
id: number;
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
/** 评论回复 */
|
||||
export interface CommentReply {
|
||||
id: number;
|
||||
replyContent: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询商品评论列表 */
|
||||
export function getCommentPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallCommentApi.Comment>>(
|
||||
'/product/comment/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询商品评论详情 */
|
||||
export function getComment(id: number) {
|
||||
return requestClient.get<MallCommentApi.Comment>(
|
||||
`/product/comment/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 添加自评 */
|
||||
export function createComment(data: MallCommentApi.Comment) {
|
||||
return requestClient.post('/product/comment/create', data);
|
||||
}
|
||||
|
||||
/** 显示 / 隐藏评论 */
|
||||
export function updateCommentVisible(
|
||||
data: MallCommentApi.CommentVisibleUpdate,
|
||||
) {
|
||||
return requestClient.put('/product/comment/update-visible', data);
|
||||
}
|
||||
|
||||
/** 商家回复 */
|
||||
export function replyComment(data: MallCommentApi.CommentReply) {
|
||||
return requestClient.put('/product/comment/reply', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallFavoriteApi {
|
||||
/** 商品收藏 */
|
||||
export interface Favorite {
|
||||
/** 收藏编号 */
|
||||
id?: number;
|
||||
/** 用户编号 */
|
||||
userId?: string;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: null | number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得商品收藏列表 */
|
||||
export function getFavoritePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallFavoriteApi.Favorite>>(
|
||||
'/product/favorite/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallHistoryApi {
|
||||
/** 商品浏览记录 */
|
||||
export interface BrowseHistory {
|
||||
/** 记录编号 */
|
||||
id?: number;
|
||||
/** 用户编号 */
|
||||
userId?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 浏览时间 */
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得商品浏览记录分页
|
||||
*
|
||||
* @param params 请求参数
|
||||
*/
|
||||
export function getBrowseHistoryPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallHistoryApi.BrowseHistory>>(
|
||||
'/product/browse-history/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallPropertyApi {
|
||||
/** 商品属性 */
|
||||
export interface Property {
|
||||
/** 属性编号 */
|
||||
id?: number;
|
||||
/** 名称 */
|
||||
name: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 属性值 */
|
||||
export interface PropertyValue {
|
||||
/** 属性值编号 */
|
||||
id?: number;
|
||||
/** 属性项的编号 */
|
||||
propertyId?: number;
|
||||
/** 名称 */
|
||||
name: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 属性值查询参数 */
|
||||
export interface PropertyValueQuery extends PageParam {
|
||||
propertyId?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建属性项 */
|
||||
export function createProperty(data: MallPropertyApi.Property) {
|
||||
return requestClient.post('/product/property/create', data);
|
||||
}
|
||||
|
||||
/** 更新属性项 */
|
||||
export function updateProperty(data: MallPropertyApi.Property) {
|
||||
return requestClient.put('/product/property/update', data);
|
||||
}
|
||||
|
||||
/** 删除属性项 */
|
||||
export function deleteProperty(id: number) {
|
||||
return requestClient.delete(`/product/property/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得属性项 */
|
||||
export function getProperty(id: number) {
|
||||
return requestClient.get<MallPropertyApi.Property>(
|
||||
`/product/property/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得属性项分页 */
|
||||
export function getPropertyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallPropertyApi.Property>>(
|
||||
'/product/property/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得属性项精简列表 */
|
||||
export function getPropertySimpleList() {
|
||||
return requestClient.get<MallPropertyApi.Property[]>(
|
||||
'/product/property/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得属性值分页 */
|
||||
export function getPropertyValuePage(
|
||||
params: MallPropertyApi.PropertyValueQuery,
|
||||
) {
|
||||
return requestClient.get<PageResult<MallPropertyApi.PropertyValue>>(
|
||||
'/product/property/value/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得属性值 */
|
||||
export function getPropertyValue(id: number) {
|
||||
return requestClient.get<MallPropertyApi.PropertyValue>(
|
||||
`/product/property/value/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 创建属性值 */
|
||||
export function createPropertyValue(data: MallPropertyApi.PropertyValue) {
|
||||
return requestClient.post('/product/property/value/create', data);
|
||||
}
|
||||
|
||||
/** 更新属性值 */
|
||||
export function updatePropertyValue(data: MallPropertyApi.PropertyValue) {
|
||||
return requestClient.put('/product/property/value/update', data);
|
||||
}
|
||||
|
||||
/** 删除属性值 */
|
||||
export function deletePropertyValue(id: number) {
|
||||
return requestClient.delete(`/product/property/value/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得属性值精简列表 */
|
||||
export function getPropertyValueSimpleList(propertyId: number) {
|
||||
return requestClient.get<MallPropertyApi.PropertyValue[]>(
|
||||
'/product/property/value/simple-list',
|
||||
{
|
||||
params: { propertyId },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallSpuApi {
|
||||
/** 商品属性 */
|
||||
export interface Property {
|
||||
/** 属性编号 */
|
||||
propertyId?: number;
|
||||
/** 属性名称 */
|
||||
propertyName?: string;
|
||||
/** 属性值编号 */
|
||||
valueId?: number;
|
||||
/** 属性值名称 */
|
||||
valueName?: string;
|
||||
}
|
||||
|
||||
/** 商品 SKU */
|
||||
export interface Sku {
|
||||
/** 商品 SKU 编号 */
|
||||
id?: number;
|
||||
/** 商品 SKU 名称 */
|
||||
name?: string;
|
||||
/** SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 属性数组 */
|
||||
properties?: Property[];
|
||||
/** 商品价格 */
|
||||
price?: number | string;
|
||||
/** 市场价 */
|
||||
marketPrice?: number | string;
|
||||
/** 成本价 */
|
||||
costPrice?: number | string;
|
||||
/** 商品条码 */
|
||||
barCode?: string;
|
||||
/** 图片地址 */
|
||||
picUrl?: string;
|
||||
/** 库存 */
|
||||
stock?: number;
|
||||
/** 商品重量,单位:kg 千克 */
|
||||
weight?: number;
|
||||
/** 商品体积,单位:m^3 平米 */
|
||||
volume?: number;
|
||||
/** 一级分销的佣金 */
|
||||
firstBrokeragePrice?: number | string;
|
||||
/** 二级分销的佣金 */
|
||||
secondBrokeragePrice?: number | string;
|
||||
/** 商品销量 */
|
||||
salesCount?: number;
|
||||
}
|
||||
|
||||
/** 优惠券模板 */
|
||||
export interface GiveCouponTemplate {
|
||||
/** 优惠券编号 */
|
||||
id?: number;
|
||||
/** 优惠券名称 */
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/** 商品 SPU */
|
||||
export interface Spu {
|
||||
/** 商品编号 */
|
||||
id?: number;
|
||||
/** 商品名称 */
|
||||
name?: string;
|
||||
/** 商品分类 */
|
||||
categoryId?: number;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** 单位 */
|
||||
unit?: number | undefined;
|
||||
/** 商品封面图 */
|
||||
picUrl?: string;
|
||||
/** 商品轮播图 */
|
||||
sliderPicUrls?: string[];
|
||||
/** 商品简介 */
|
||||
introduction?: string;
|
||||
/** 配送方式 */
|
||||
deliveryTypes?: number[];
|
||||
/** 运费模版 */
|
||||
deliveryTemplateId?: number | undefined;
|
||||
/** 商品品牌编号 */
|
||||
brandId?: number;
|
||||
/** 商品规格 */
|
||||
specType?: boolean;
|
||||
/** 分销类型 */
|
||||
subCommissionType?: boolean;
|
||||
/** sku数组 */
|
||||
skus?: Sku[];
|
||||
/** 商品详情 */
|
||||
description?: string;
|
||||
/** 商品排序 */
|
||||
sort?: number;
|
||||
/** 赠送积分 */
|
||||
giveIntegral?: number;
|
||||
/** 虚拟销量 */
|
||||
virtualSalesCount?: number;
|
||||
/** 商品价格 */
|
||||
price?: number;
|
||||
/** 商品拼团价格 */
|
||||
combinationPrice?: number;
|
||||
/** 商品秒杀价格 */
|
||||
seckillPrice?: number;
|
||||
/** 商品销量 */
|
||||
salesCount?: number;
|
||||
/** 市场价 */
|
||||
marketPrice?: number;
|
||||
/** 成本价 */
|
||||
costPrice?: number;
|
||||
/** 商品库存 */
|
||||
stock?: number;
|
||||
/** 商品创建时间 */
|
||||
createTime?: Date;
|
||||
/** 商品状态 */
|
||||
status?: number;
|
||||
}
|
||||
|
||||
/** 商品状态更新 */
|
||||
export interface StatusUpdate {
|
||||
/** 商品编号 */
|
||||
id: number;
|
||||
/** 商品状态 */
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得商品 SPU 列表 */
|
||||
export function getSpuPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallSpuApi.Spu>>('/product/spu/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得商品 SPU 列表 tabsCount */
|
||||
export function getTabsCount() {
|
||||
return requestClient.get<Record<string, number>>('/product/spu/get-count');
|
||||
}
|
||||
|
||||
/** 创建商品 SPU */
|
||||
export function createSpu(data: MallSpuApi.Spu) {
|
||||
return requestClient.post('/product/spu/create', data);
|
||||
}
|
||||
|
||||
/** 更新商品 SPU */
|
||||
export function updateSpu(data: MallSpuApi.Spu) {
|
||||
return requestClient.put('/product/spu/update', data);
|
||||
}
|
||||
|
||||
/** 更新商品 SPU 状态 */
|
||||
export function updateStatus(data: MallSpuApi.StatusUpdate) {
|
||||
return requestClient.put('/product/spu/update-status', data);
|
||||
}
|
||||
|
||||
/** 获得商品 SPU */
|
||||
export function getSpu(id: number) {
|
||||
return requestClient.get<MallSpuApi.Spu>(`/product/spu/get-detail?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商品 SPU 详情列表 */
|
||||
export function getSpuDetailList(ids: number[]) {
|
||||
return requestClient.get<MallSpuApi.Spu[]>(`/product/spu/list?spuIds=${ids}`);
|
||||
}
|
||||
|
||||
/** 删除商品 SPU */
|
||||
export function deleteSpu(id: number) {
|
||||
return requestClient.delete(`/product/spu/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出商品 SPU Excel */
|
||||
export function exportSpu(params: PageParam) {
|
||||
return requestClient.download('/product/spu/export-excel', { params });
|
||||
}
|
||||
|
||||
/** 获得商品 SPU 精简列表 */
|
||||
export function getSpuSimpleList() {
|
||||
return requestClient.get<MallSpuApi.Spu[]>('/product/spu/list-all-simple');
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallArticleApi {
|
||||
/** 文章管理 */
|
||||
export interface Article {
|
||||
/** 文章编号 */
|
||||
id: number;
|
||||
/** 分类编号 */
|
||||
categoryId: number;
|
||||
/** 文章标题 */
|
||||
title: string;
|
||||
/** 作者 */
|
||||
author: string;
|
||||
/** 封面图 */
|
||||
picUrl: string;
|
||||
/** 文章简介 */
|
||||
introduction: string;
|
||||
/** 浏览数量 */
|
||||
browseCount: string;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 商品编号 */
|
||||
spuId: number;
|
||||
/** 是否热门 */
|
||||
recommendHot: boolean;
|
||||
/** 是否轮播图 */
|
||||
recommendBanner: boolean;
|
||||
/** 文章内容 */
|
||||
content: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询文章管理列表 */
|
||||
export function getArticlePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallArticleApi.Article>>(
|
||||
'/promotion/article/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询文章管理详情 */
|
||||
export function getArticle(id: number) {
|
||||
return requestClient.get<MallArticleApi.Article>(
|
||||
`/promotion/article/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增文章管理 */
|
||||
export function createArticle(data: MallArticleApi.Article) {
|
||||
return requestClient.post('/promotion/article/create', data);
|
||||
}
|
||||
|
||||
/** 修改文章管理 */
|
||||
export function updateArticle(data: MallArticleApi.Article) {
|
||||
return requestClient.put('/promotion/article/update', data);
|
||||
}
|
||||
|
||||
/** 删除文章管理 */
|
||||
export function deleteArticle(id: number) {
|
||||
return requestClient.delete(`/promotion/article/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallArticleCategoryApi {
|
||||
/** 文章分类 */
|
||||
export interface ArticleCategory {
|
||||
/** 分类编号 */
|
||||
id: number;
|
||||
/** 分类名称 */
|
||||
name: string;
|
||||
/** 分类图片 */
|
||||
picUrl: string;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询文章分类列表 */
|
||||
export function getArticleCategoryPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallArticleCategoryApi.ArticleCategory>>(
|
||||
'/promotion/article-category/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询文章分类精简信息列表 */
|
||||
export function getSimpleArticleCategoryList() {
|
||||
return requestClient.get<MallArticleCategoryApi.ArticleCategory[]>(
|
||||
'/promotion/article-category/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询文章分类详情 */
|
||||
export function getArticleCategory(id: number) {
|
||||
return requestClient.get<MallArticleCategoryApi.ArticleCategory>(
|
||||
`/promotion/article-category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增文章分类 */
|
||||
export function createArticleCategory(
|
||||
data: MallArticleCategoryApi.ArticleCategory,
|
||||
) {
|
||||
return requestClient.post('/promotion/article-category/create', data);
|
||||
}
|
||||
|
||||
/** 修改文章分类 */
|
||||
export function updateArticleCategory(
|
||||
data: MallArticleCategoryApi.ArticleCategory,
|
||||
) {
|
||||
return requestClient.put('/promotion/article-category/update', data);
|
||||
}
|
||||
|
||||
/** 删除文章分类 */
|
||||
export function deleteArticleCategory(id: number) {
|
||||
return requestClient.delete(`/promotion/article-category/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBargainActivityApi {
|
||||
/** 砍价活动 */
|
||||
export interface BargainActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
/** 达到该人数,才能砍到低价 */
|
||||
helpMaxCount?: number;
|
||||
/** 最大帮砍次数 */
|
||||
bargainCount?: number;
|
||||
/** 最大购买次数 */
|
||||
totalLimitCount?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 砍价起始价格,单位分 */
|
||||
bargainFirstPrice: number;
|
||||
/** 砍价底价 */
|
||||
bargainMinPrice: number;
|
||||
/** 活动库存 */
|
||||
stock: number;
|
||||
/** 用户每次砍价的最小金额,单位:分 */
|
||||
randomMinPrice?: number;
|
||||
/** 用户每次砍价的最大金额,单位:分 */
|
||||
randomMaxPrice?: number;
|
||||
}
|
||||
|
||||
/** 砍价活动所需属性。选择的商品和属性的时候使用方便使用活动的通用封装 */
|
||||
export interface BargainProduct {
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 砍价起始价格,单位分 */
|
||||
bargainFirstPrice: number;
|
||||
/** 砍价底价 */
|
||||
bargainMinPrice: number;
|
||||
/** 活动库存 */
|
||||
stock: number;
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 砍价活动配置 */
|
||||
productConfig: BargainProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询砍价活动列表 */
|
||||
export function getBargainActivityPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBargainActivityApi.BargainActivity>>(
|
||||
'/promotion/bargain-activity/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询砍价活动详情 */
|
||||
export function getBargainActivity(id: number) {
|
||||
return requestClient.get<MallBargainActivityApi.BargainActivity>(
|
||||
`/promotion/bargain-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增砍价活动 */
|
||||
export function createBargainActivity(
|
||||
data: MallBargainActivityApi.BargainActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/bargain-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改砍价活动 */
|
||||
export function updateBargainActivity(
|
||||
data: MallBargainActivityApi.BargainActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/bargain-activity/update', data);
|
||||
}
|
||||
|
||||
/** 关闭砍价活动 */
|
||||
export function closeBargainActivity(id: number) {
|
||||
return requestClient.put(`/promotion/bargain-activity/close?id=${id}`);
|
||||
}
|
||||
|
||||
/** 删除砍价活动 */
|
||||
export function deleteBargainActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/bargain-activity/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBargainHelpApi {
|
||||
/** 砍价记录 */
|
||||
export interface BargainHelp {
|
||||
/** 记录编号 */
|
||||
id: number;
|
||||
/** 砍价记录编号 */
|
||||
record: number;
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 砍掉金额 */
|
||||
reducePrice: number;
|
||||
/** 结束时间 */
|
||||
endTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询砍价记录列表 */
|
||||
export function getBargainHelpPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBargainHelpApi.BargainHelp>>(
|
||||
'/promotion/bargain-help/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBargainRecordApi {
|
||||
/** 砍价记录 */
|
||||
export interface BargainRecord {
|
||||
/** 记录编号 */
|
||||
id: number;
|
||||
/** 活动编号 */
|
||||
activityId: number;
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 砍价起始价格 */
|
||||
bargainFirstPrice: number;
|
||||
/** 砍价价格 */
|
||||
bargainPrice: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 订单编号 */
|
||||
orderId: number;
|
||||
/** 结束时间 */
|
||||
endTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询砍价记录列表 */
|
||||
export function getBargainRecordPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBargainRecordApi.BargainRecord>>(
|
||||
'/promotion/bargain-record/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCombinationActivityApi {
|
||||
/** 拼团活动所需属性 */
|
||||
export interface CombinationProduct {
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 拼团价格 */
|
||||
combinationPrice: number;
|
||||
}
|
||||
/** 拼团活动 */
|
||||
export interface CombinationActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 总限购数量 */
|
||||
totalLimitCount?: number;
|
||||
/** 单次限购数量 */
|
||||
singleLimitCount?: number;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 用户数量 */
|
||||
userSize?: number;
|
||||
/** 总数量 */
|
||||
totalCount?: number;
|
||||
/** 成功数量 */
|
||||
successCount?: number;
|
||||
/** 订单用户数量 */
|
||||
orderUserCount?: number;
|
||||
/** 虚拟成团 */
|
||||
virtualGroup?: number;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
/** 限制时长 */
|
||||
limitDuration?: number;
|
||||
/** 拼团价格 */
|
||||
combinationPrice?: number;
|
||||
/** 商品列表 */
|
||||
products: CombinationProduct[];
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 拼团活动配置 */
|
||||
productConfig: CombinationProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询拼团活动列表 */
|
||||
export function getCombinationActivityPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallCombinationActivityApi.CombinationActivity>
|
||||
>('/promotion/combination-activity/page', { params });
|
||||
}
|
||||
|
||||
/** 查询拼团活动详情 */
|
||||
export function getCombinationActivity(id: number) {
|
||||
return requestClient.get<MallCombinationActivityApi.CombinationActivity>(
|
||||
`/promotion/combination-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得拼团活动列表,基于活动编号数组 */
|
||||
export function getCombinationActivityListByIds(ids: number[]) {
|
||||
return requestClient.get<MallCombinationActivityApi.CombinationActivity[]>(
|
||||
`/promotion/combination-activity/list-by-ids?ids=${ids}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增拼团活动 */
|
||||
export function createCombinationActivity(
|
||||
data: MallCombinationActivityApi.CombinationActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/combination-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改拼团活动 */
|
||||
export function updateCombinationActivity(
|
||||
data: MallCombinationActivityApi.CombinationActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/combination-activity/update', data);
|
||||
}
|
||||
|
||||
/** 关闭拼团活动 */
|
||||
export function closeCombinationActivity(id: number) {
|
||||
return requestClient.put(`/promotion/combination-activity/close?id=${id}`);
|
||||
}
|
||||
|
||||
/** 删除拼团活动 */
|
||||
export function deleteCombinationActivity(id: number) {
|
||||
return requestClient.delete(
|
||||
`/promotion/combination-activity/delete?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCombinationRecordApi {
|
||||
/** 拼团记录 */
|
||||
export interface CombinationRecord {
|
||||
/** 拼团记录编号 */
|
||||
id: number;
|
||||
/** 拼团活动编号 */
|
||||
activityId: number;
|
||||
/** 用户昵称 */
|
||||
nickname: string;
|
||||
/** 用户头像 */
|
||||
avatar: string;
|
||||
/** 团长编号 */
|
||||
headId: number;
|
||||
/** 过期时间 */
|
||||
expireTime: string;
|
||||
/** 可参团人数 */
|
||||
userSize: number;
|
||||
/** 已参团人数 */
|
||||
userCount: number;
|
||||
/** 拼团状态 */
|
||||
status: number;
|
||||
/** 商品名字 */
|
||||
spuName: string;
|
||||
/** 商品图片 */
|
||||
picUrl: string;
|
||||
/** 是否虚拟成团 */
|
||||
virtualGroup: boolean;
|
||||
/** 开始时间 (订单付款后开始的时间) */
|
||||
startTime: string;
|
||||
/** 结束时间(成团时间/失败时间) */
|
||||
endTime: string;
|
||||
}
|
||||
|
||||
/** 拼团记录概要信息 */
|
||||
export interface RecordSummary {
|
||||
/** 待成团数量 */
|
||||
pendingCount: number;
|
||||
/** 已成团数量 */
|
||||
successCount: number;
|
||||
/** 已失败数量 */
|
||||
failCount: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询拼团记录列表 */
|
||||
export function getCombinationRecordPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallCombinationRecordApi.CombinationRecord>
|
||||
>('/promotion/combination-record/page', { params });
|
||||
}
|
||||
|
||||
/** 获得拼团记录的概要信息 */
|
||||
export function getCombinationRecordSummary() {
|
||||
return requestClient.get<MallCombinationRecordApi.RecordSummary>(
|
||||
'/promotion/combination-record/get-summary',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCouponApi {
|
||||
/** 优惠券 */
|
||||
export interface Coupon {
|
||||
/** 优惠券编号 */
|
||||
id: number;
|
||||
/** 优惠券名称 */
|
||||
name: string;
|
||||
/** 优惠券状态 */
|
||||
status: number;
|
||||
/** 优惠券类型 */
|
||||
type: number;
|
||||
/** 优惠券金额 */
|
||||
price: number;
|
||||
/** 使用门槛 */
|
||||
usePrice: number;
|
||||
/** 商品范围 */
|
||||
productScope: number;
|
||||
/** 商品编号数组 */
|
||||
productSpuIds: number[];
|
||||
/** 有效期类型 */
|
||||
validityType: number;
|
||||
/** 固定日期-生效开始时间 */
|
||||
validStartTime: Date;
|
||||
/** 固定日期-生效结束时间 */
|
||||
validEndTime: Date;
|
||||
/** 领取日期-开始天数 */
|
||||
fixedStartTerm: number;
|
||||
/** 领取日期-结束天数 */
|
||||
fixedEndTerm: number;
|
||||
/** 每人限领个数 */
|
||||
takeLimitCount: number;
|
||||
/** 是否设置满多少金额可用 */
|
||||
usePriceEnabled: boolean;
|
||||
/** 商品分类编号数组 */
|
||||
productCategoryIds: number[];
|
||||
}
|
||||
|
||||
/** 发送优惠券 */
|
||||
export interface SendCoupon {
|
||||
/** 优惠券编号 */
|
||||
couponId: number;
|
||||
/** 用户编号数组 */
|
||||
userIds: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除优惠劵 */
|
||||
export function deleteCoupon(id: number) {
|
||||
return requestClient.delete(`/promotion/coupon/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得优惠劵分页 */
|
||||
export function getCouponPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallCouponApi.Coupon>>(
|
||||
'/promotion/coupon/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 发送优惠券 */
|
||||
export function sendCoupon(data: MallCouponApi.SendCoupon) {
|
||||
return requestClient.post('/promotion/coupon/send', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCouponTemplateApi {
|
||||
/** 优惠券模板 */
|
||||
export interface CouponTemplate {
|
||||
/** 模板编号 */
|
||||
id: number;
|
||||
/** 模板名称 */
|
||||
name: string;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 发放数量 */
|
||||
totalCount: number;
|
||||
/** 每人限领个数 */
|
||||
takeLimitCount: number;
|
||||
/** 领取方式 */
|
||||
takeType: number;
|
||||
/** 使用门槛 */
|
||||
usePrice: number;
|
||||
/** 商品范围 */
|
||||
productScope: number;
|
||||
/** 商品范围值 */
|
||||
productScopeValues: number[];
|
||||
/** 有效期类型 */
|
||||
validityType: number;
|
||||
/** 固定日期-生效开始时间 */
|
||||
validStartTime: Date;
|
||||
/** 固定日期-生效结束时间 */
|
||||
validEndTime: Date;
|
||||
/** 领取日期-开始天数 */
|
||||
fixedStartTerm: number;
|
||||
/** 领取日期-结束天数 */
|
||||
fixedEndTerm: number;
|
||||
/** 优惠类型 */
|
||||
discountType: number;
|
||||
/** 折扣百分比 */
|
||||
discountPercent: number;
|
||||
/** 优惠金额 */
|
||||
discountPrice: number;
|
||||
/** 折扣上限 */
|
||||
discountLimitPrice: number;
|
||||
/** 已领取数量 */
|
||||
takeCount: number;
|
||||
/** 已使用数量 */
|
||||
useCount: number;
|
||||
}
|
||||
|
||||
/** 优惠券模板状态更新 */
|
||||
export interface StatusUpdate {
|
||||
/** 模板编号 */
|
||||
id: number;
|
||||
/** 状态 */
|
||||
status: 0 | 1;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建优惠劵模板 */
|
||||
export function createCouponTemplate(
|
||||
data: MallCouponTemplateApi.CouponTemplate,
|
||||
) {
|
||||
return requestClient.post('/promotion/coupon-template/create', data);
|
||||
}
|
||||
|
||||
/** 更新优惠劵模板 */
|
||||
export function updateCouponTemplate(
|
||||
data: MallCouponTemplateApi.CouponTemplate,
|
||||
) {
|
||||
return requestClient.put('/promotion/coupon-template/update', data);
|
||||
}
|
||||
|
||||
/** 更新优惠劵模板的状态 */
|
||||
export function updateCouponTemplateStatus(id: number, status: 0 | 1) {
|
||||
const data: MallCouponTemplateApi.StatusUpdate = { id, status };
|
||||
return requestClient.put('/promotion/coupon-template/update-status', data);
|
||||
}
|
||||
|
||||
/** 删除优惠劵模板 */
|
||||
export function deleteCouponTemplate(id: number) {
|
||||
return requestClient.delete(`/promotion/coupon-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得优惠劵模板 */
|
||||
export function getCouponTemplate(id: number) {
|
||||
return requestClient.get<MallCouponTemplateApi.CouponTemplate>(
|
||||
`/promotion/coupon-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得优惠劵模板分页 */
|
||||
export function getCouponTemplatePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallCouponTemplateApi.CouponTemplate>>(
|
||||
'/promotion/coupon-template/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得优惠劵模板列表 */
|
||||
export function getCouponTemplateList(ids: number[]) {
|
||||
return requestClient.get<MallCouponTemplateApi.CouponTemplate[]>(
|
||||
`/promotion/coupon-template/list?ids=${ids}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出优惠劵模板 Excel */
|
||||
export function exportCouponTemplateExcel(params: PageParam) {
|
||||
return requestClient.get('/promotion/coupon-template/export-excel', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDiscountActivityApi {
|
||||
/** 限时折扣相关属性 */
|
||||
export interface DiscountProduct {
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 折扣类型 */
|
||||
discountType: number;
|
||||
/** 折扣百分比 */
|
||||
discountPercent: number;
|
||||
/** 折扣价格 */
|
||||
discountPrice: number;
|
||||
}
|
||||
|
||||
/** 限时折扣活动 */
|
||||
export interface DiscountActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 商品列表 */
|
||||
products?: DiscountProduct[];
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 限时折扣配置 */
|
||||
productConfig: DiscountProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询限时折扣活动列表 */
|
||||
export function getDiscountActivityPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallDiscountActivityApi.DiscountActivity>
|
||||
>('/promotion/discount-activity/page', { params });
|
||||
}
|
||||
|
||||
/** 查询限时折扣活动详情 */
|
||||
export function getDiscountActivity(id: number) {
|
||||
return requestClient.get<MallDiscountActivityApi.DiscountActivity>(
|
||||
`/promotion/discount-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增限时折扣活动 */
|
||||
export function createDiscountActivity(
|
||||
data: MallDiscountActivityApi.DiscountActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/discount-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改限时折扣活动 */
|
||||
export function updateDiscountActivity(
|
||||
data: MallDiscountActivityApi.DiscountActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/discount-activity/update', data);
|
||||
}
|
||||
|
||||
/** 关闭限时折扣活动 */
|
||||
export function closeDiscountActivity(id: number) {
|
||||
return requestClient.put(`/promotion/discount-activity/close?id=${id}`);
|
||||
}
|
||||
|
||||
/** 删除限时折扣活动 */
|
||||
export function deleteDiscountActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/discount-activity/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDiyPageApi {
|
||||
/** 装修页面 */
|
||||
export interface DiyPage {
|
||||
/** 页面编号 */
|
||||
id?: number;
|
||||
/** 模板编号 */
|
||||
templateId?: number;
|
||||
/** 页面名称 */
|
||||
name: string;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 预览图片地址数组 */
|
||||
previewPicUrls: string[];
|
||||
/** 页面属性 */
|
||||
property: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询装修页面列表 */
|
||||
export function getDiyPagePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallDiyPageApi.DiyPage>>(
|
||||
'/promotion/diy-page/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询装修页面详情 */
|
||||
export function getDiyPage(id: number) {
|
||||
return requestClient.get<MallDiyPageApi.DiyPage>(
|
||||
`/promotion/diy-page/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增装修页面 */
|
||||
export function createDiyPage(data: MallDiyPageApi.DiyPage) {
|
||||
return requestClient.post('/promotion/diy-page/create', data);
|
||||
}
|
||||
|
||||
/** 修改装修页面 */
|
||||
export function updateDiyPage(data: MallDiyPageApi.DiyPage) {
|
||||
return requestClient.put('/promotion/diy-page/update', data);
|
||||
}
|
||||
|
||||
/** 删除装修页面 */
|
||||
export function deleteDiyPage(id: number) {
|
||||
return requestClient.delete(`/promotion/diy-page/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得装修页面属性 */
|
||||
export function getDiyPageProperty(id: number) {
|
||||
return requestClient.get<string>(`/promotion/diy-page/get-property?id=${id}`);
|
||||
}
|
||||
|
||||
/** 更新装修页面属性 */
|
||||
export function updateDiyPageProperty(data: MallDiyPageApi.DiyPage) {
|
||||
return requestClient.put('/promotion/diy-page/update-property', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallDiyPageApi } from './page';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDiyTemplateApi {
|
||||
/** 装修模板 */
|
||||
export interface DiyTemplate {
|
||||
/** 模板编号 */
|
||||
id?: number;
|
||||
/** 模板名称 */
|
||||
name: string;
|
||||
/** 是否使用 */
|
||||
used: boolean;
|
||||
/** 使用时间 */
|
||||
usedTime?: Date;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 预览图片地址数组 */
|
||||
previewPicUrls: string[];
|
||||
/** 模板属性 */
|
||||
property: string;
|
||||
}
|
||||
|
||||
/** 装修模板属性(包含页面列表) */
|
||||
export interface DiyTemplateProperty extends DiyTemplate {
|
||||
/** 页面列表 */
|
||||
pages: MallDiyPageApi.DiyPage[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询装修模板列表 */
|
||||
export function getDiyTemplatePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallDiyTemplateApi.DiyTemplate>>(
|
||||
'/promotion/diy-template/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询装修模板详情 */
|
||||
export function getDiyTemplate(id: number) {
|
||||
return requestClient.get<MallDiyTemplateApi.DiyTemplate>(
|
||||
`/promotion/diy-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增装修模板 */
|
||||
export function createDiyTemplate(data: MallDiyTemplateApi.DiyTemplate) {
|
||||
return requestClient.post('/promotion/diy-template/create', data);
|
||||
}
|
||||
|
||||
/** 修改装修模板 */
|
||||
export function updateDiyTemplate(data: MallDiyTemplateApi.DiyTemplate) {
|
||||
return requestClient.put('/promotion/diy-template/update', data);
|
||||
}
|
||||
|
||||
/** 删除装修模板 */
|
||||
export function deleteDiyTemplate(id: number) {
|
||||
return requestClient.delete(`/promotion/diy-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 使用装修模板 */
|
||||
export function useDiyTemplate(id: number) {
|
||||
return requestClient.put(`/promotion/diy-template/use?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得装修模板属性 */
|
||||
export function getDiyTemplateProperty(id: number) {
|
||||
return requestClient.get<MallDiyTemplateApi.DiyTemplateProperty>(
|
||||
`/promotion/diy-template/get-property?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新装修模板属性 */
|
||||
export function updateDiyTemplateProperty(
|
||||
data: MallDiyTemplateApi.DiyTemplate,
|
||||
) {
|
||||
return requestClient.put('/promotion/diy-template/update-property', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
import type { PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallKefuConversationApi {
|
||||
/** 客服会话 */
|
||||
export interface Conversation {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 会话所属用户 */
|
||||
userId: number;
|
||||
/** 会话所属用户头像 */
|
||||
userAvatar: string;
|
||||
/** 会话所属用户昵称 */
|
||||
userNickname: string;
|
||||
/** 最后聊天时间 */
|
||||
lastMessageTime: Date;
|
||||
/** 最后聊天内容 */
|
||||
lastMessageContent: string;
|
||||
/** 最后发送的消息类型 */
|
||||
lastMessageContentType: number;
|
||||
/** 管理端置顶 */
|
||||
adminPinned: boolean;
|
||||
/** 用户是否可见 */
|
||||
userDeleted: boolean;
|
||||
/** 管理员是否可见 */
|
||||
adminDeleted: boolean;
|
||||
/** 管理员未读消息数 */
|
||||
adminUnreadMessageCount: number;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/** 会话置顶请求 */
|
||||
export interface ConversationPinnedUpdate {
|
||||
/** 会话编号 */
|
||||
id: number;
|
||||
/** 是否置顶 */
|
||||
pinned: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得客服会话列表 */
|
||||
export function getConversationList() {
|
||||
return requestClient.get<PageResult<MallKefuConversationApi.Conversation>>(
|
||||
'/promotion/kefu-conversation/list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得客服会话 */
|
||||
export function getConversation(id: number) {
|
||||
return requestClient.get<MallKefuConversationApi.Conversation>(
|
||||
`/promotion/kefu-conversation/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 客服会话置顶 */
|
||||
export function updateConversationPinned(
|
||||
data: MallKefuConversationApi.ConversationPinnedUpdate,
|
||||
) {
|
||||
return requestClient.put(
|
||||
'/promotion/kefu-conversation/update-conversation-pinned',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除客服会话 */
|
||||
export function deleteConversation(id: number) {
|
||||
return requestClient.delete(`/promotion/kefu-conversation/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallKefuMessageApi {
|
||||
/** 客服消息 */
|
||||
export interface Message {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 会话编号 */
|
||||
conversationId: number;
|
||||
/** 发送人编号 */
|
||||
senderId: number;
|
||||
/** 发送人头像 */
|
||||
senderAvatar: string;
|
||||
/** 发送人类型 */
|
||||
senderType: number;
|
||||
/** 接收人编号 */
|
||||
receiverId: number;
|
||||
/** 接收人类型 */
|
||||
receiverType: number;
|
||||
/** 消息类型 */
|
||||
contentType: number;
|
||||
/** 消息内容 */
|
||||
content: string;
|
||||
/** 是否已读 */
|
||||
readStatus: boolean;
|
||||
/** 创建时间 */
|
||||
createTime: Date;
|
||||
}
|
||||
|
||||
/** 发送消息请求 */
|
||||
export interface MessageSend {
|
||||
/** 会话编号 */
|
||||
conversationId: number;
|
||||
/** 消息类型 */
|
||||
contentType: number;
|
||||
/** 消息内容 */
|
||||
content: string;
|
||||
}
|
||||
|
||||
/** 消息列表查询参数 */
|
||||
export interface MessageQuery extends PageParam {
|
||||
/** 会话编号 */
|
||||
conversationId: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 发送客服消息 */
|
||||
export function sendKeFuMessage(data: MallKefuMessageApi.MessageSend) {
|
||||
return requestClient.post('/promotion/kefu-message/send', data);
|
||||
}
|
||||
|
||||
/** 更新客服消息已读状态 */
|
||||
export function updateKeFuMessageReadStatus(conversationId: number) {
|
||||
return requestClient.put(
|
||||
`/promotion/kefu-message/update-read-status?conversationId=${conversationId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得消息列表(流式加载) */
|
||||
export function getKeFuMessageList(params: MallKefuMessageApi.MessageQuery) {
|
||||
return requestClient.get<PageResult<MallKefuMessageApi.Message>>(
|
||||
'/promotion/kefu-message/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallPointActivityApi {
|
||||
/** 积分商城商品 */
|
||||
export interface PointProduct {
|
||||
/** 积分商城商品编号 */
|
||||
id?: number;
|
||||
/** 积分商城活动 id */
|
||||
activityId?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 可兑换数量 */
|
||||
count: number;
|
||||
/** 兑换积分 */
|
||||
point: number;
|
||||
/** 兑换金额,单位:分 */
|
||||
price: number;
|
||||
/** 积分商城商品库存 */
|
||||
stock: number;
|
||||
/** 积分商城商品状态 */
|
||||
activityStatus?: number;
|
||||
}
|
||||
|
||||
/** 积分商城活动 */
|
||||
export interface PointActivity {
|
||||
/** 积分商城活动编号 */
|
||||
id: number;
|
||||
/** 积分商城活动商品 */
|
||||
spuId: number;
|
||||
/** 活动状态 */
|
||||
status: number;
|
||||
/** 积分商城活动库存 */
|
||||
stock: number;
|
||||
/** 积分商城活动总库存 */
|
||||
totalStock: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 积分商城商品 */
|
||||
products: PointProduct[];
|
||||
/** 商品名称 */
|
||||
spuName: string;
|
||||
/** 商品主图 */
|
||||
picUrl: string;
|
||||
/** 商品市场价,单位:分 */
|
||||
marketPrice: number;
|
||||
/** 兑换积分 */
|
||||
point: number;
|
||||
/** 兑换金额,单位:分 */
|
||||
price: number;
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 积分商城商品配置 */
|
||||
productConfig: PointProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
|
||||
/** 扩展 SPU 配置(带积分信息) */
|
||||
export interface SpuExtensionWithPoint extends MallSpuApi.Spu {
|
||||
/** 积分商城活动库存 */
|
||||
pointStock: number;
|
||||
/** 积分商城活动总库存 */
|
||||
pointTotalStock: number;
|
||||
/** 兑换积分 */
|
||||
point: number;
|
||||
/** 兑换金额,单位:分 */
|
||||
pointPrice: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询积分商城活动分页 */
|
||||
export function getPointActivityPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallPointActivityApi.PointActivity>>(
|
||||
'/promotion/point-activity/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询积分商城活动详情 */
|
||||
export function getPointActivity(id: number) {
|
||||
return requestClient.get<MallPointActivityApi.PointActivity>(
|
||||
`/promotion/point-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询积分商城活动列表,基于活动编号数组 */
|
||||
export function getPointActivityListByIds(ids: number[]) {
|
||||
return requestClient.get<MallPointActivityApi.PointActivity[]>(
|
||||
`/promotion/point-activity/list-by-ids?ids=${ids}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增积分商城活动 */
|
||||
export function createPointActivity(data: MallPointActivityApi.PointActivity) {
|
||||
return requestClient.post('/promotion/point-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改积分商城活动 */
|
||||
export function updatePointActivity(data: MallPointActivityApi.PointActivity) {
|
||||
return requestClient.put('/promotion/point-activity/update', data);
|
||||
}
|
||||
|
||||
/** 删除积分商城活动 */
|
||||
export function deletePointActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/point-activity/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 关闭积分商城活动 */
|
||||
export function closePointActivity(id: number) {
|
||||
return requestClient.put(`/promotion/point-activity/close?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallRewardActivityApi {
|
||||
/** 优惠规则 */
|
||||
export interface RewardRule {
|
||||
/** 满足金额 */
|
||||
limit?: number;
|
||||
/** 优惠金额 */
|
||||
discountPrice?: number;
|
||||
/** 是否包邮 */
|
||||
freeDelivery?: boolean;
|
||||
/** 赠送积分 */
|
||||
point: number;
|
||||
/** 赠送优惠券数量 */
|
||||
giveCouponTemplateCounts?: {
|
||||
[key: number]: number;
|
||||
};
|
||||
}
|
||||
|
||||
/** 满减送活动 */
|
||||
export interface RewardActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 开始和结束时间(仅前端使用) */
|
||||
startAndEndTime?: Date[];
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 条件类型 */
|
||||
conditionType?: number;
|
||||
/** 商品范围 */
|
||||
productScope?: number;
|
||||
/** 优惠规则列表 */
|
||||
rules: RewardRule[];
|
||||
/** 商品范围值(仅表单使用):值为品类编号列表、商品编号列表 */
|
||||
productScopeValues?: number[];
|
||||
/** 商品分类编号列表(仅表单使用) */
|
||||
productCategoryIds?: number[];
|
||||
/** 商品 SPU 编号列表(仅表单使用) */
|
||||
productSpuIds?: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 新增满减送活动 */
|
||||
export function createRewardActivity(
|
||||
data: MallRewardActivityApi.RewardActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/reward-activity/create', data);
|
||||
}
|
||||
|
||||
/** 更新满减送活动 */
|
||||
export function updateRewardActivity(
|
||||
data: MallRewardActivityApi.RewardActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/reward-activity/update', data);
|
||||
}
|
||||
|
||||
/** 查询满减送活动列表 */
|
||||
export function getRewardActivityPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallRewardActivityApi.RewardActivity>>(
|
||||
'/promotion/reward-activity/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询满减送活动详情 */
|
||||
export function getReward(id: number) {
|
||||
return requestClient.get<MallRewardActivityApi.RewardActivity>(
|
||||
`/promotion/reward-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除满减送活动 */
|
||||
export function deleteRewardActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/reward-activity/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 关闭满减送活动 */
|
||||
export function closeRewardActivity(id: number) {
|
||||
return requestClient.put(`/promotion/reward-activity/close?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallSeckillActivityApi {
|
||||
/** 秒杀商品 */
|
||||
export interface SeckillProduct {
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 秒杀价格 */
|
||||
seckillPrice: number;
|
||||
/** 秒杀库存 */
|
||||
stock: number;
|
||||
}
|
||||
|
||||
/** 秒杀活动 */
|
||||
export interface SeckillActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 活动状态 */
|
||||
status?: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 排序 */
|
||||
sort?: number;
|
||||
/** 配置编号 */
|
||||
configIds?: string;
|
||||
/** 订单数量 */
|
||||
orderCount?: number;
|
||||
/** 用户数量 */
|
||||
userCount?: number;
|
||||
/** 总金额 */
|
||||
totalPrice?: number;
|
||||
/** 总限购数量 */
|
||||
totalLimitCount?: number;
|
||||
/** 单次限购数量 */
|
||||
singleLimitCount?: number;
|
||||
/** 秒杀库存 */
|
||||
stock?: number;
|
||||
/** 秒杀总库存 */
|
||||
totalStock?: number;
|
||||
/** 秒杀价格 */
|
||||
seckillPrice?: number;
|
||||
/** 秒杀商品列表 */
|
||||
products?: SeckillProduct[];
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 秒杀商品配置 */
|
||||
productConfig: SeckillProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询秒杀活动列表 */
|
||||
export function getSeckillActivityPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallSeckillActivityApi.SeckillActivity>>(
|
||||
'/promotion/seckill-activity/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询秒杀活动列表,基于活动编号数组 */
|
||||
export function getSeckillActivityListByIds(ids: number[]) {
|
||||
return requestClient.get<MallSeckillActivityApi.SeckillActivity[]>(
|
||||
`/promotion/seckill-activity/list-by-ids?ids=${ids}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询秒杀活动详情 */
|
||||
export function getSeckillActivity(id: number) {
|
||||
return requestClient.get<MallSeckillActivityApi.SeckillActivity>(
|
||||
`/promotion/seckill-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增秒杀活动 */
|
||||
export function createSeckillActivity(
|
||||
data: MallSeckillActivityApi.SeckillActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/seckill-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改秒杀活动 */
|
||||
export function updateSeckillActivity(
|
||||
data: MallSeckillActivityApi.SeckillActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/seckill-activity/update', data);
|
||||
}
|
||||
|
||||
/** 关闭秒杀活动 */
|
||||
export function closeSeckillActivity(id: number) {
|
||||
return requestClient.put(`/promotion/seckill-activity/close?id=${id}`);
|
||||
}
|
||||
|
||||
/** 删除秒杀活动 */
|
||||
export function deleteSeckillActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/seckill-activity/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallSeckillConfigApi {
|
||||
/** 秒杀时段 */
|
||||
export interface SeckillConfig {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 秒杀时段名称 */
|
||||
name: string;
|
||||
/** 开始时间点 */
|
||||
startTime: string;
|
||||
/** 结束时间点 */
|
||||
endTime: string;
|
||||
/** 秒杀轮播图 */
|
||||
sliderPicUrls: string[];
|
||||
/** 活动状态 */
|
||||
status: number;
|
||||
}
|
||||
|
||||
/** 时段配置状态更新 */
|
||||
export interface StatusUpdate {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询秒杀时段分页 */
|
||||
export function getSeckillConfigPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallSeckillConfigApi.SeckillConfig>>(
|
||||
'/promotion/seckill-config/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询秒杀时段列表 */
|
||||
export function getSimpleSeckillConfigList() {
|
||||
return requestClient.get<MallSeckillConfigApi.SeckillConfig[]>(
|
||||
'/promotion/seckill-config/list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询秒杀时段详情 */
|
||||
export function getSeckillConfig(id: number) {
|
||||
return requestClient.get<MallSeckillConfigApi.SeckillConfig>(
|
||||
`/promotion/seckill-config/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增秒杀时段 */
|
||||
export function createSeckillConfig(data: MallSeckillConfigApi.SeckillConfig) {
|
||||
return requestClient.post('/promotion/seckill-config/create', data);
|
||||
}
|
||||
|
||||
/** 修改秒杀时段 */
|
||||
export function updateSeckillConfig(data: MallSeckillConfigApi.SeckillConfig) {
|
||||
return requestClient.put('/promotion/seckill-config/update', data);
|
||||
}
|
||||
|
||||
/** 删除秒杀时段 */
|
||||
export function deleteSeckillConfig(id: number) {
|
||||
return requestClient.delete(`/promotion/seckill-config/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 修改时段配置状态 */
|
||||
export function updateSeckillConfigStatus(id: number, status: number) {
|
||||
return requestClient.put('/promotion/seckill-config/update-status', {
|
||||
id,
|
||||
status,
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
/** 数据对照 Response */
|
||||
export interface MallDataComparisonResp<T> {
|
||||
value: T;
|
||||
reference: T;
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
import type { MallDataComparisonResp } from './common';
|
||||
|
||||
import { formatDate } from '@vben/utils';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallMemberStatisticsApi {
|
||||
/** 会员分析 Request */
|
||||
export interface AnalyseReq {
|
||||
times: Date[];
|
||||
}
|
||||
|
||||
/** 会员分析对照数据 Response */
|
||||
export interface AnalyseComparison {
|
||||
registerUserCount: number;
|
||||
visitUserCount: number;
|
||||
rechargeUserCount: number;
|
||||
}
|
||||
|
||||
/** 会员分析 Response */
|
||||
export interface Analyse {
|
||||
visitUserCount: number;
|
||||
orderUserCount: number;
|
||||
payUserCount: number;
|
||||
atv: number;
|
||||
comparison: MallDataComparisonResp<AnalyseComparison>;
|
||||
}
|
||||
|
||||
/** 会员地区统计 Response */
|
||||
export interface AreaStatistics {
|
||||
areaId: number;
|
||||
areaName: string;
|
||||
userCount: number;
|
||||
orderCreateUserCount: number;
|
||||
orderPayUserCount: number;
|
||||
orderPayPrice: number;
|
||||
}
|
||||
|
||||
/** 会员性别统计 Response */
|
||||
export interface SexStatistics {
|
||||
sex: number;
|
||||
userCount: number;
|
||||
}
|
||||
|
||||
/** 会员统计 Response */
|
||||
export interface Summary {
|
||||
userCount: number;
|
||||
rechargeUserCount: number;
|
||||
rechargePrice: number;
|
||||
expensePrice: number;
|
||||
}
|
||||
|
||||
/** 会员终端统计 Response */
|
||||
export interface TerminalStatistics {
|
||||
terminal: number;
|
||||
userCount: number;
|
||||
}
|
||||
|
||||
/** 会员数量统计 Response */
|
||||
export interface Count {
|
||||
/** 用户访问量 */
|
||||
visitUserCount: string;
|
||||
/** 注册用户数量 */
|
||||
registerUserCount: number;
|
||||
}
|
||||
|
||||
/** 会员注册数量 Response */
|
||||
export interface RegisterCount {
|
||||
date: string;
|
||||
count: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询会员统计 */
|
||||
export function getMemberSummary() {
|
||||
return requestClient.get<MallMemberStatisticsApi.Summary>(
|
||||
'/statistics/member/summary',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询会员分析数据 */
|
||||
export function getMemberAnalyse(params: MallMemberStatisticsApi.AnalyseReq) {
|
||||
return requestClient.get<MallMemberStatisticsApi.Analyse>(
|
||||
'/statistics/member/analyse',
|
||||
{
|
||||
params: {
|
||||
times: [formatDate(params.times[0]), formatDate(params.times[1])],
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 按照省份,查询会员统计列表 */
|
||||
export function getMemberAreaStatisticsList() {
|
||||
return requestClient.get<MallMemberStatisticsApi.AreaStatistics[]>(
|
||||
'/statistics/member/area-statistics-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 按照性别,查询会员统计列表 */
|
||||
export function getMemberSexStatisticsList() {
|
||||
return requestClient.get<MallMemberStatisticsApi.SexStatistics[]>(
|
||||
'/statistics/member/sex-statistics-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 按照终端,查询会员统计列表 */
|
||||
export function getMemberTerminalStatisticsList() {
|
||||
return requestClient.get<MallMemberStatisticsApi.TerminalStatistics[]>(
|
||||
'/statistics/member/terminal-statistics-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得用户数量量对照 */
|
||||
export function getUserCountComparison() {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallMemberStatisticsApi.Count>
|
||||
>('/statistics/member/user-count-comparison');
|
||||
}
|
||||
|
||||
/** 获得会员注册数量列表 */
|
||||
export function getMemberRegisterCountList(beginTime: Date, endTime: Date) {
|
||||
return requestClient.get<MallMemberStatisticsApi.RegisterCount[]>(
|
||||
'/statistics/member/register-count-list',
|
||||
{
|
||||
params: {
|
||||
times: [formatDate(beginTime), formatDate(endTime)],
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallPayStatisticsApi {
|
||||
/** 支付统计 */
|
||||
export interface PaySummaryResp {
|
||||
/** 充值金额,单位分 */
|
||||
rechargePrice: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取钱包充值金额 */
|
||||
export function getWalletRechargePrice() {
|
||||
return requestClient.get<MallPayStatisticsApi.PaySummaryResp>(
|
||||
'/statistics/pay/summary',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallDataComparisonResp } from './common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallProductStatisticsApi {
|
||||
/** 商品统计数据 */
|
||||
export interface ProductStatistics {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 统计日期 */
|
||||
day: string;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SPU 名称 */
|
||||
spuName: string;
|
||||
/** 商品 SPU 图片 */
|
||||
spuPicUrl: string;
|
||||
/** 浏览次数 */
|
||||
browseCount: number;
|
||||
/** 浏览人数 */
|
||||
browseUserCount: number;
|
||||
/** 收藏次数 */
|
||||
favoriteCount: number;
|
||||
/** 加购次数 */
|
||||
cartCount: number;
|
||||
/** 下单次数 */
|
||||
orderCount: number;
|
||||
/** 支付次数 */
|
||||
orderPayCount: number;
|
||||
/** 支付金额 */
|
||||
orderPayPrice: number;
|
||||
/** 售后次数 */
|
||||
afterSaleCount: number;
|
||||
/** 退款金额 */
|
||||
afterSaleRefundPrice: number;
|
||||
/** 浏览转化率 */
|
||||
browseConvertPercent: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得商品统计分析 */
|
||||
export function getProductStatisticsAnalyse(params: PageParam) {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallProductStatisticsApi.ProductStatistics>
|
||||
>('/statistics/product/analyse', { params });
|
||||
}
|
||||
|
||||
/** 获得商品状况明细 */
|
||||
export function getProductStatisticsList(params: PageParam) {
|
||||
return requestClient.get<MallProductStatisticsApi.ProductStatistics[]>(
|
||||
'/statistics/product/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出获得商品状况明细 Excel */
|
||||
export function exportProductStatisticsExcel(params: PageParam) {
|
||||
return requestClient.download('/statistics/product/export-excel', { params });
|
||||
}
|
||||
|
||||
/** 获得商品排行榜分页 */
|
||||
export function getProductStatisticsRankPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallProductStatisticsApi.ProductStatistics>
|
||||
>('/statistics/product/rank-page', { params });
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
import type { MallDataComparisonResp } from './common';
|
||||
|
||||
import { formatDate } from '@vben/utils';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallTradeStatisticsApi {
|
||||
/** 交易统计 Response */
|
||||
export interface TradeSummary {
|
||||
yesterdayOrderCount: number;
|
||||
monthOrderCount: number;
|
||||
yesterdayPayPrice: number;
|
||||
monthPayPrice: number;
|
||||
}
|
||||
|
||||
/** 交易状况 Request */
|
||||
export interface TradeTrendReq {
|
||||
times: [Date, Date];
|
||||
}
|
||||
|
||||
/** 交易状况统计 Response */
|
||||
export interface TradeTrendSummary {
|
||||
time: string;
|
||||
turnoverPrice: number;
|
||||
orderPayPrice: number;
|
||||
rechargePrice: number;
|
||||
expensePrice: number;
|
||||
walletPayPrice: number;
|
||||
brokerageSettlementPrice: number;
|
||||
afterSaleRefundPrice: number;
|
||||
}
|
||||
|
||||
/** 交易订单数量 Response */
|
||||
export interface TradeOrderCount {
|
||||
/** 待发货 */
|
||||
undelivered?: number;
|
||||
/** 待核销 */
|
||||
pickUp?: number;
|
||||
/** 退款中 */
|
||||
afterSaleApply?: number;
|
||||
/** 提现待审核 */
|
||||
auditingWithdraw?: number;
|
||||
}
|
||||
|
||||
/** 交易订单统计 Response */
|
||||
export interface TradeOrderSummary {
|
||||
/** 支付订单商品数 */
|
||||
orderPayCount?: number;
|
||||
/** 总支付金额,单位:分 */
|
||||
orderPayPrice?: number;
|
||||
}
|
||||
|
||||
/** 订单量趋势统计 Response */
|
||||
export interface TradeOrderTrend {
|
||||
/** 日期 */
|
||||
date: string;
|
||||
/** 订单数量 */
|
||||
orderPayCount: number;
|
||||
/** 订单支付金额 */
|
||||
orderPayPrice: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 时间参数需要格式化, 确保接口能识别 */
|
||||
const formatDateParam = (params: MallTradeStatisticsApi.TradeTrendReq) => {
|
||||
return {
|
||||
times: [formatDate(params.times[0]), formatDate(params.times[1])],
|
||||
} as MallTradeStatisticsApi.TradeTrendReq;
|
||||
};
|
||||
|
||||
/** 查询交易统计 */
|
||||
export function getTradeStatisticsSummary() {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallTradeStatisticsApi.TradeSummary>
|
||||
>('/statistics/trade/summary');
|
||||
}
|
||||
|
||||
/** 获得交易状况统计 */
|
||||
export function getTradeStatisticsAnalyse(
|
||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
||||
) {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallTradeStatisticsApi.TradeTrendSummary>
|
||||
>('/statistics/trade/analyse', { params: formatDateParam(params) });
|
||||
}
|
||||
|
||||
/** 获得交易状况明细 */
|
||||
export function getTradeStatisticsList(
|
||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
||||
) {
|
||||
return requestClient.get<MallTradeStatisticsApi.TradeTrendSummary[]>(
|
||||
'/statistics/trade/list',
|
||||
{ params: formatDateParam(params) },
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出交易状况明细 */
|
||||
export function exportTradeStatisticsExcel(
|
||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
||||
) {
|
||||
return requestClient.download('/statistics/trade/export-excel', {
|
||||
params: formatDateParam(params),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得交易订单数量 */
|
||||
export function getOrderCount() {
|
||||
return requestClient.get<MallTradeStatisticsApi.TradeOrderCount>(
|
||||
'/statistics/trade/order-count',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得交易订单数量对照 */
|
||||
export function getOrderComparison() {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallTradeStatisticsApi.TradeOrderSummary>
|
||||
>('/statistics/trade/order-comparison');
|
||||
}
|
||||
|
||||
/** 获得订单量趋势统计 */
|
||||
export function getOrderCountTrendComparison(
|
||||
type: number,
|
||||
beginTime: Date,
|
||||
endTime: Date,
|
||||
) {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallTradeStatisticsApi.TradeOrderTrend>[]
|
||||
>('/statistics/trade/order-count-trend', {
|
||||
params: {
|
||||
type,
|
||||
beginTime: formatDate(beginTime),
|
||||
endTime: formatDate(endTime),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallAfterSaleApi {
|
||||
/** 商品属性 */
|
||||
export interface ProductProperty {
|
||||
/** 属性的编号 */
|
||||
propertyId?: null | number;
|
||||
/** 属性的名称 */
|
||||
propertyName?: string;
|
||||
/** 属性值的编号 */
|
||||
valueId?: null | number;
|
||||
/** 属性值的名称 */
|
||||
valueName?: string;
|
||||
}
|
||||
|
||||
/** 交易售后 */
|
||||
export interface AfterSale {
|
||||
/** 售后编号,主键自增 */
|
||||
id?: null | number;
|
||||
/** 售后单号 */
|
||||
no?: string;
|
||||
/** 退款状态 */
|
||||
status?: null | number;
|
||||
/** 售后方式 */
|
||||
way?: null | number;
|
||||
/** 售后类型 */
|
||||
type?: null | number;
|
||||
/** 用户编号 */
|
||||
userId?: null | number;
|
||||
/** 申请原因 */
|
||||
applyReason?: string;
|
||||
/** 补充描述 */
|
||||
applyDescription?: string;
|
||||
/** 补充凭证图片 */
|
||||
applyPicUrls?: string[];
|
||||
/** 交易订单编号 */
|
||||
orderId?: null | number;
|
||||
/** 订单流水号 */
|
||||
orderNo?: string;
|
||||
/** 交易订单项编号 */
|
||||
orderItemId?: null | number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: null | number;
|
||||
/** 商品 SPU 名称 */
|
||||
spuName?: string;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId?: null | number;
|
||||
/** 属性数组 */
|
||||
properties?: ProductProperty[];
|
||||
/** 商品图片 */
|
||||
picUrl?: string;
|
||||
/** 退货商品数量 */
|
||||
count?: null | number;
|
||||
/** 审批时间 */
|
||||
auditTime?: Date;
|
||||
/** 审批人 */
|
||||
auditUserId?: null | number;
|
||||
/** 审批备注 */
|
||||
auditReason?: string;
|
||||
/** 退款金额,单位:分 */
|
||||
refundPrice?: null | number;
|
||||
/** 支付退款编号 */
|
||||
payRefundId?: null | number;
|
||||
/** 退款时间 */
|
||||
refundTime?: Date;
|
||||
/** 退货物流公司编号 */
|
||||
logisticsId?: null | number;
|
||||
/** 退货物流单号 */
|
||||
logisticsNo?: string;
|
||||
/** 退货时间 */
|
||||
deliveryTime?: Date;
|
||||
/** 收货时间 */
|
||||
receiveTime?: Date;
|
||||
/** 收货备注 */
|
||||
receiveReason?: string;
|
||||
}
|
||||
|
||||
/** 拒绝售后请求 */
|
||||
export interface DisagreeRequest {
|
||||
/** 售后编号 */
|
||||
id: number;
|
||||
/** 拒绝原因 */
|
||||
reason: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得交易售后分页 */
|
||||
export function getAfterSalePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallAfterSaleApi.AfterSale>>(
|
||||
'/trade/after-sale/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得交易售后详情 */
|
||||
export function getAfterSale(id: number) {
|
||||
return requestClient.get<MallAfterSaleApi.AfterSale>(
|
||||
`/trade/after-sale/get-detail?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 同意售后 */
|
||||
export function agree(id: number) {
|
||||
return requestClient.put(`/trade/after-sale/agree?id=${id}`);
|
||||
}
|
||||
|
||||
/** 拒绝售后 */
|
||||
export function disagree(data: MallAfterSaleApi.DisagreeRequest) {
|
||||
return requestClient.put('/trade/after-sale/disagree', data);
|
||||
}
|
||||
|
||||
/** 确认收货 */
|
||||
export function receive(id: number) {
|
||||
return requestClient.put(`/trade/after-sale/receive?id=${id}`);
|
||||
}
|
||||
|
||||
/** 拒绝收货 */
|
||||
export function refuse(id: number) {
|
||||
return requestClient.put(`/trade/after-sale/refuse?id=${id}`);
|
||||
}
|
||||
|
||||
/** 确认退款 */
|
||||
export function refund(id: number) {
|
||||
return requestClient.put(`/trade/after-sale/refund?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBrokerageRecordApi {
|
||||
/** 佣金记录 */
|
||||
export interface BrokerageRecord {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 用户昵称 */
|
||||
userNickname: string;
|
||||
/** 用户头像 */
|
||||
userAvatar: string;
|
||||
/** 佣金金额,单位:分 */
|
||||
price: number;
|
||||
/** 佣金类型 */
|
||||
type: number;
|
||||
/** 关联订单编号 */
|
||||
orderId: number;
|
||||
/** 关联订单号 */
|
||||
orderNo: string;
|
||||
/** 创建时间 */
|
||||
createTime: Date;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 结算时间 */
|
||||
settlementTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询佣金记录列表 */
|
||||
export function getBrokerageRecordPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBrokerageRecordApi.BrokerageRecord>>(
|
||||
'/trade/brokerage-record/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询佣金记录详情 */
|
||||
export function getBrokerageRecord(id: number) {
|
||||
return requestClient.get<MallBrokerageRecordApi.BrokerageRecord>(
|
||||
`/trade/brokerage-record/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBrokerageUserApi {
|
||||
/** 分销用户 */
|
||||
export interface BrokerageUser {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 推广员编号 */
|
||||
bindUserId: number;
|
||||
/** 推广员绑定时间 */
|
||||
bindUserTime: Date;
|
||||
/** 是否启用分销 */
|
||||
brokerageEnabled: boolean;
|
||||
/** 分销资格时间 */
|
||||
brokerageTime: Date;
|
||||
/** 可提现金额,单位:分 */
|
||||
price: number;
|
||||
/** 冻结金额,单位:分 */
|
||||
frozenPrice: number;
|
||||
/** 用户昵称 */
|
||||
nickname: string;
|
||||
/** 用户头像 */
|
||||
avatar: string;
|
||||
}
|
||||
|
||||
/** 创建分销用户请求 */
|
||||
export interface CreateRequest {
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 推广员编号 */
|
||||
bindUserId: number;
|
||||
}
|
||||
|
||||
/** 修改推广员请求 */
|
||||
export interface UpdateBindUserRequest {
|
||||
/** 用户编号 */
|
||||
id: number;
|
||||
/** 推广员编号 */
|
||||
bindUserId: number;
|
||||
}
|
||||
|
||||
/** 清除推广员请求 */
|
||||
export interface ClearBindUserRequest {
|
||||
/** 用户编号 */
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 修改推广资格请求 */
|
||||
export interface UpdateBrokerageEnabledRequest {
|
||||
/** 用户编号 */
|
||||
id: number;
|
||||
/** 是否启用分销 */
|
||||
enabled: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建分销用户 */
|
||||
export function createBrokerageUser(data: MallBrokerageUserApi.CreateRequest) {
|
||||
return requestClient.post('/trade/brokerage-user/create', data);
|
||||
}
|
||||
|
||||
/** 查询分销用户列表 */
|
||||
export function getBrokerageUserPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBrokerageUserApi.BrokerageUser>>(
|
||||
'/trade/brokerage-user/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询分销用户详情 */
|
||||
export function getBrokerageUser(id: number) {
|
||||
return requestClient.get<MallBrokerageUserApi.BrokerageUser>(
|
||||
`/trade/brokerage-user/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改推广员 */
|
||||
export function updateBindUser(
|
||||
data: MallBrokerageUserApi.UpdateBindUserRequest,
|
||||
) {
|
||||
return requestClient.put('/trade/brokerage-user/update-bind-user', data);
|
||||
}
|
||||
|
||||
/** 清除推广员 */
|
||||
export function clearBindUser(data: MallBrokerageUserApi.ClearBindUserRequest) {
|
||||
return requestClient.put('/trade/brokerage-user/clear-bind-user', data);
|
||||
}
|
||||
|
||||
/** 修改推广资格 */
|
||||
export function updateBrokerageEnabled(
|
||||
data: MallBrokerageUserApi.UpdateBrokerageEnabledRequest,
|
||||
) {
|
||||
return requestClient.put(
|
||||
'/trade/brokerage-user/update-brokerage-enable',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBrokerageWithdrawApi {
|
||||
/** 佣金提现 */
|
||||
export interface BrokerageWithdraw {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 提现金额,单位:分 */
|
||||
price: number;
|
||||
/** 手续费,单位:分 */
|
||||
feePrice: number;
|
||||
/** 总金额,单位:分 */
|
||||
totalPrice: number;
|
||||
/** 提现类型 */
|
||||
type: number;
|
||||
/** 用户名称 */
|
||||
userName: string;
|
||||
/** 用户账号 */
|
||||
userAccount: string;
|
||||
/** 银行名称 */
|
||||
bankName: string;
|
||||
/** 银行地址 */
|
||||
bankAddress: string;
|
||||
/** 收款码地址 */
|
||||
qrCodeUrl: string;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 审核备注 */
|
||||
auditReason: string;
|
||||
/** 审核时间 */
|
||||
auditTime: Date;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 支付转账编号 */
|
||||
payTransferId?: number;
|
||||
/** 转账渠道编码 */
|
||||
transferChannelCode?: string;
|
||||
/** 转账时间 */
|
||||
transferTime?: Date;
|
||||
/** 转账错误信息 */
|
||||
transferErrorMsg?: string;
|
||||
}
|
||||
|
||||
/** 驳回申请请求 */
|
||||
export interface RejectRequest {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 驳回原因 */
|
||||
auditReason: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询佣金提现列表 */
|
||||
export function getBrokerageWithdrawPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallBrokerageWithdrawApi.BrokerageWithdraw>
|
||||
>('/trade/brokerage-withdraw/page', { params });
|
||||
}
|
||||
|
||||
/** 查询佣金提现详情 */
|
||||
export function getBrokerageWithdraw(id: number) {
|
||||
return requestClient.get<MallBrokerageWithdrawApi.BrokerageWithdraw>(
|
||||
`/trade/brokerage-withdraw/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 佣金提现 - 通过申请 */
|
||||
export function approveBrokerageWithdraw(id: number) {
|
||||
return requestClient.put(`/trade/brokerage-withdraw/approve?id=${id}`);
|
||||
}
|
||||
|
||||
/** 审核佣金提现 - 驳回申请 */
|
||||
export function rejectBrokerageWithdraw(
|
||||
data: MallBrokerageWithdrawApi.RejectRequest,
|
||||
) {
|
||||
return requestClient.put('/trade/brokerage-withdraw/reject', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallTradeConfigApi {
|
||||
/** 交易中心配置 */
|
||||
export interface Config {
|
||||
id?: number;
|
||||
afterSaleRefundReasons?: string[];
|
||||
afterSaleReturnReasons?: string[];
|
||||
deliveryExpressFreeEnabled?: boolean;
|
||||
deliveryExpressFreePrice?: number;
|
||||
deliveryPickUpEnabled?: boolean;
|
||||
brokerageEnabled?: boolean;
|
||||
brokerageEnabledCondition?: number;
|
||||
brokerageBindMode?: number;
|
||||
brokeragePosterUrls?: string;
|
||||
brokerageFirstPercent?: number;
|
||||
brokerageSecondPercent?: number;
|
||||
brokerageWithdrawMinPrice?: number;
|
||||
brokerageFrozenDays?: number;
|
||||
brokerageWithdrawTypes?: string;
|
||||
tencentLbsKey?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询交易中心配置详情 */
|
||||
export function getTradeConfig() {
|
||||
return requestClient.get<MallTradeConfigApi.Config>('/trade/config/get');
|
||||
}
|
||||
|
||||
/** 保存交易中心配置 */
|
||||
export function saveTradeConfig(data: MallTradeConfigApi.Config) {
|
||||
return requestClient.put('/trade/config/save', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDeliveryExpressApi {
|
||||
/** 快递公司 */
|
||||
export interface DeliveryExpress {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 快递公司编码 */
|
||||
code: string;
|
||||
/** 快递公司名称 */
|
||||
name: string;
|
||||
/** 快递公司 logo */
|
||||
logo: string;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
}
|
||||
|
||||
/** 快递公司精简信息 */
|
||||
export interface SimpleDeliveryExpress {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 快递公司编码 */
|
||||
code: string;
|
||||
/** 快递公司名称 */
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询快递公司列表 */
|
||||
export function getDeliveryExpressPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallDeliveryExpressApi.DeliveryExpress>>(
|
||||
'/trade/delivery/express/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询快递公司详情 */
|
||||
export function getDeliveryExpress(id: number) {
|
||||
return requestClient.get<MallDeliveryExpressApi.DeliveryExpress>(
|
||||
`/trade/delivery/express/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得快递公司精简信息列表 */
|
||||
export function getSimpleDeliveryExpressList() {
|
||||
return requestClient.get<MallDeliveryExpressApi.SimpleDeliveryExpress[]>(
|
||||
'/trade/delivery/express/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增快递公司 */
|
||||
export function createDeliveryExpress(
|
||||
data: MallDeliveryExpressApi.DeliveryExpress,
|
||||
) {
|
||||
return requestClient.post('/trade/delivery/express/create', data);
|
||||
}
|
||||
|
||||
/** 修改快递公司 */
|
||||
export function updateDeliveryExpress(
|
||||
data: MallDeliveryExpressApi.DeliveryExpress,
|
||||
) {
|
||||
return requestClient.put('/trade/delivery/express/update', data);
|
||||
}
|
||||
|
||||
/** 删除快递公司 */
|
||||
export function deleteDeliveryExpress(id: number) {
|
||||
return requestClient.delete(`/trade/delivery/express/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出快递公司 Excel */
|
||||
export function exportDeliveryExpress(params: PageParam) {
|
||||
return requestClient.download('/trade/delivery/express/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDeliveryExpressTemplateApi {
|
||||
/** 运费模板计费 */
|
||||
export interface TemplateCharge {
|
||||
/** 区域编号列表 */
|
||||
areaIds: number[];
|
||||
/** 首件数量 */
|
||||
startCount: number;
|
||||
/** 首件价格,单位:分 */
|
||||
startPrice: number;
|
||||
/** 续件数量 */
|
||||
extraCount: number;
|
||||
/** 续件价格,单位:分 */
|
||||
extraPrice: number;
|
||||
}
|
||||
|
||||
/** 运费模板包邮 */
|
||||
export interface TemplateFree {
|
||||
/** 区域编号列表 */
|
||||
areaIds: number[];
|
||||
/** 包邮件数 */
|
||||
freeCount: number;
|
||||
/** 包邮金额,单位:分 */
|
||||
freePrice: number;
|
||||
}
|
||||
|
||||
/** 快递运费模板 */
|
||||
export interface ExpressTemplate {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 模板名称 */
|
||||
name: string;
|
||||
/** 计费方式 */
|
||||
chargeMode: number;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
/** 计费区域列表 */
|
||||
templateCharge: TemplateCharge[];
|
||||
/** 包邮区域列表 */
|
||||
templateFree: TemplateFree[];
|
||||
}
|
||||
|
||||
/** 运费模板精简信息 */
|
||||
export interface SimpleTemplate {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 模板名称 */
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询快递运费模板列表 */
|
||||
export function getDeliveryExpressTemplatePage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallDeliveryExpressTemplateApi.ExpressTemplate>
|
||||
>('/trade/delivery/express-template/page', { params });
|
||||
}
|
||||
|
||||
/** 查询快递运费模板详情 */
|
||||
export function getDeliveryExpressTemplate(id: number) {
|
||||
return requestClient.get<MallDeliveryExpressTemplateApi.ExpressTemplate>(
|
||||
`/trade/delivery/express-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询快递运费模板详情 */
|
||||
export function getSimpleTemplateList() {
|
||||
return requestClient.get<MallDeliveryExpressTemplateApi.SimpleTemplate[]>(
|
||||
'/trade/delivery/express-template/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增快递运费模板 */
|
||||
export function createDeliveryExpressTemplate(
|
||||
data: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
||||
) {
|
||||
return requestClient.post('/trade/delivery/express-template/create', data);
|
||||
}
|
||||
|
||||
/** 修改快递运费模板 */
|
||||
export function updateDeliveryExpressTemplate(
|
||||
data: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
||||
) {
|
||||
return requestClient.put('/trade/delivery/express-template/update', data);
|
||||
}
|
||||
|
||||
/** 删除快递运费模板 */
|
||||
export function deleteDeliveryExpressTemplate(id: number) {
|
||||
return requestClient.delete(
|
||||
`/trade/delivery/express-template/delete?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDeliveryPickUpStoreApi {
|
||||
/** 自提门店 */
|
||||
export interface PickUpStore {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 门店名称 */
|
||||
name: string;
|
||||
/** 门店简介 */
|
||||
introduction: string;
|
||||
/** 联系电话 */
|
||||
phone: string;
|
||||
/** 区域编号 */
|
||||
areaId: number;
|
||||
/** 详细地址 */
|
||||
detailAddress: string;
|
||||
/** 门店 logo */
|
||||
logo: string;
|
||||
/** 营业开始时间 */
|
||||
openingTime: string;
|
||||
/** 营业结束时间 */
|
||||
closingTime: string;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 绑定用户编号组数 */
|
||||
verifyUserIds: number[];
|
||||
}
|
||||
|
||||
/** 绑定自提店员请求 */
|
||||
export interface BindStaffRequest {
|
||||
id?: number;
|
||||
/** 门店名称 */
|
||||
name: string;
|
||||
/** 门店编号 */
|
||||
storeId: number;
|
||||
/** 用户编号列表 */
|
||||
userIds: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询自提门店列表 */
|
||||
export function getDeliveryPickUpStorePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallDeliveryPickUpStoreApi.PickUpStore>>(
|
||||
'/trade/delivery/pick-up-store/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询自提门店详情 */
|
||||
export function getDeliveryPickUpStore(id: number) {
|
||||
return requestClient.get<MallDeliveryPickUpStoreApi.PickUpStore>(
|
||||
`/trade/delivery/pick-up-store/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询自提门店精简列表 */
|
||||
export function getSimpleDeliveryPickUpStoreList() {
|
||||
return requestClient.get<MallDeliveryPickUpStoreApi.PickUpStore[]>(
|
||||
'/trade/delivery/pick-up-store/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增自提门店 */
|
||||
export function createDeliveryPickUpStore(
|
||||
data: MallDeliveryPickUpStoreApi.PickUpStore,
|
||||
) {
|
||||
return requestClient.post('/trade/delivery/pick-up-store/create', data);
|
||||
}
|
||||
|
||||
/** 修改自提门店 */
|
||||
export function updateDeliveryPickUpStore(
|
||||
data: MallDeliveryPickUpStoreApi.PickUpStore,
|
||||
) {
|
||||
return requestClient.put('/trade/delivery/pick-up-store/update', data);
|
||||
}
|
||||
|
||||
/** 删除自提门店 */
|
||||
export function deleteDeliveryPickUpStore(id: number) {
|
||||
return requestClient.delete(`/trade/delivery/pick-up-store/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 绑定自提店员 */
|
||||
export function bindStoreStaffId(
|
||||
data: MallDeliveryPickUpStoreApi.BindStaffRequest,
|
||||
) {
|
||||
return requestClient.post('/trade/delivery/pick-up-store/bind', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,298 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallOrderApi {
|
||||
/** 商品属性 */
|
||||
export interface ProductProperty {
|
||||
/** 属性的编号 */
|
||||
propertyId?: null | number;
|
||||
/** 属性的名称 */
|
||||
propertyName?: string;
|
||||
/** 属性值的编号 */
|
||||
valueId?: null | number;
|
||||
/** 属性值的名称 */
|
||||
valueName?: string;
|
||||
}
|
||||
|
||||
/** 订单项 */
|
||||
export interface OrderItem {
|
||||
/** 编号 */
|
||||
id?: null | number;
|
||||
/** 用户编号 */
|
||||
userId?: null | number;
|
||||
/** 订单编号 */
|
||||
orderId?: null | number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: null | number;
|
||||
/** 商品 SPU 名称 */
|
||||
spuName?: string;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId?: null | number;
|
||||
/** 商品图片 */
|
||||
picUrl?: string;
|
||||
/** 购买数量 */
|
||||
count?: null | number;
|
||||
/** 商品原价(总) */
|
||||
originalPrice?: null | number;
|
||||
/** 商品原价(单) */
|
||||
originalUnitPrice?: null | number;
|
||||
/** 商品优惠(总) */
|
||||
discountPrice?: null | number;
|
||||
/** 商品实付金额(总) */
|
||||
payPrice?: null | number;
|
||||
/** 子订单分摊金额(总) */
|
||||
orderPartPrice?: null | number;
|
||||
/** 分摊后子订单实付金额(总) */
|
||||
orderDividePrice?: null | number;
|
||||
/** 售后状态 */
|
||||
afterSaleStatus?: null | number;
|
||||
/** 属性数组 */
|
||||
properties?: ProductProperty[];
|
||||
}
|
||||
|
||||
/** 订单日志 */
|
||||
export interface OrderLog {
|
||||
/** 日志内容 */
|
||||
content?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: Date;
|
||||
/** 用户类型 */
|
||||
userType?: number;
|
||||
}
|
||||
|
||||
/** 订单 */
|
||||
export interface Order {
|
||||
/** 订单编号 */
|
||||
id?: null | number;
|
||||
/** 订单流水号 */
|
||||
no?: string;
|
||||
/** 下单时间 */
|
||||
createTime?: Date | null;
|
||||
/** 订单类型 */
|
||||
type?: null | number;
|
||||
/** 订单来源 */
|
||||
terminal?: null | number;
|
||||
/** 用户编号 */
|
||||
userId?: null | number;
|
||||
/** 用户 IP */
|
||||
userIp?: string;
|
||||
/** 用户备注 */
|
||||
userRemark?: string;
|
||||
/** 订单状态 */
|
||||
status?: null | number;
|
||||
/** 购买的商品数量 */
|
||||
productCount?: null | number;
|
||||
/** 订单完成时间 */
|
||||
finishTime?: Date | null;
|
||||
/** 订单取消时间 */
|
||||
cancelTime?: Date | null;
|
||||
/** 取消类型 */
|
||||
cancelType?: null | number;
|
||||
/** 商家备注 */
|
||||
remark?: string;
|
||||
/** 支付订单编号 */
|
||||
payOrderId?: null | number;
|
||||
/** 是否已支付 */
|
||||
payStatus?: boolean;
|
||||
/** 付款时间 */
|
||||
payTime?: Date | null;
|
||||
/** 支付渠道 */
|
||||
payChannelCode?: string;
|
||||
/** 商品原价(总) */
|
||||
totalPrice?: null | number;
|
||||
/** 订单优惠(总) */
|
||||
discountPrice?: null | number;
|
||||
/** 运费金额 */
|
||||
deliveryPrice?: null | number;
|
||||
/** 订单调价(总) */
|
||||
adjustPrice?: null | number;
|
||||
/** 应付金额(总) */
|
||||
payPrice?: null | number;
|
||||
/** 发货方式 */
|
||||
deliveryType?: null | number;
|
||||
/** 自提门店编号 */
|
||||
pickUpStoreId?: number;
|
||||
/** 自提核销码 */
|
||||
pickUpVerifyCode?: string;
|
||||
/** 配送模板编号 */
|
||||
deliveryTemplateId?: null | number;
|
||||
/** 发货物流公司编号 */
|
||||
logisticsId?: null | number;
|
||||
/** 发货物流单号 */
|
||||
logisticsNo?: string;
|
||||
/** 发货时间 */
|
||||
deliveryTime?: Date | null;
|
||||
/** 收货时间 */
|
||||
receiveTime?: Date | null;
|
||||
/** 收件人名称 */
|
||||
receiverName?: string;
|
||||
/** 收件人手机 */
|
||||
receiverMobile?: string;
|
||||
/** 收件人邮编 */
|
||||
receiverPostCode?: null | number;
|
||||
/** 收件人地区编号 */
|
||||
receiverAreaId?: null | number;
|
||||
/** 收件人地区名字 */
|
||||
receiverAreaName?: string;
|
||||
/** 收件人详细地址 */
|
||||
receiverDetailAddress?: string;
|
||||
/** 售后状态 */
|
||||
afterSaleStatus?: null | number;
|
||||
/** 退款金额 */
|
||||
refundPrice?: null | number;
|
||||
/** 优惠劵编号 */
|
||||
couponId?: null | number;
|
||||
/** 优惠劵减免金额 */
|
||||
couponPrice?: null | number;
|
||||
/** 积分抵扣的金额 */
|
||||
pointPrice?: null | number;
|
||||
/** VIP 减免金额 */
|
||||
vipPrice?: null | number;
|
||||
/** 订单项列表 */
|
||||
items?: OrderItem[];
|
||||
/** 下单用户信息 */
|
||||
user?: {
|
||||
/** 用户头像 */
|
||||
avatar?: string;
|
||||
/** 用户编号 */
|
||||
id?: null | number;
|
||||
/** 用户昵称 */
|
||||
nickname?: string;
|
||||
};
|
||||
/** 推广用户信息 */
|
||||
brokerageUser?: {
|
||||
/** 用户头像 */
|
||||
avatar?: string;
|
||||
/** 用户编号 */
|
||||
id?: null | number;
|
||||
/** 用户昵称 */
|
||||
nickname?: string;
|
||||
};
|
||||
/** 订单操作日志 */
|
||||
logs?: OrderLog[];
|
||||
}
|
||||
|
||||
/** 交易订单统计 */
|
||||
export interface OrderSummary {
|
||||
/** 订单数量 */
|
||||
orderCount: number;
|
||||
/** 订单金额 */
|
||||
orderPayPrice: number;
|
||||
/** 退款单数 */
|
||||
afterSaleCount: number;
|
||||
/** 退款金额 */
|
||||
afterSalePrice: number;
|
||||
}
|
||||
|
||||
/** 订单发货请求 */
|
||||
export interface DeliveryRequest {
|
||||
/** 订单编号 */
|
||||
id?: number;
|
||||
/** 发货方式 */
|
||||
expressType: string;
|
||||
/** 物流公司编号 */
|
||||
logisticsId: null | number;
|
||||
/** 物流编号 */
|
||||
logisticsNo: string;
|
||||
}
|
||||
|
||||
/** 订单备注请求 */
|
||||
export interface RemarkRequest {
|
||||
/** 订单编号 */
|
||||
id: number;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
}
|
||||
|
||||
/** 订单调价请求 */
|
||||
export interface PriceRequest {
|
||||
/** 订单编号 */
|
||||
id: number;
|
||||
/** 调整金额,单位:分 */
|
||||
adjustPrice: number;
|
||||
}
|
||||
|
||||
/** 订单地址请求 */
|
||||
export interface AddressRequest {
|
||||
/** 订单编号 */
|
||||
id: number;
|
||||
/** 收件人名称 */
|
||||
receiverName: string;
|
||||
/** 收件人手机 */
|
||||
receiverMobile: string;
|
||||
/** 收件人地区编号 */
|
||||
receiverAreaId: number;
|
||||
/** 收件人详细地址 */
|
||||
receiverDetailAddress: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询交易订单列表 */
|
||||
export function getOrderPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallOrderApi.Order>>(
|
||||
'/trade/order/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询交易订单统计 */
|
||||
export function getOrderSummary(params: PageParam) {
|
||||
return requestClient.get<MallOrderApi.OrderSummary>('/trade/order/summary', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询交易订单详情 */
|
||||
export function getOrder(id: number) {
|
||||
return requestClient.get<MallOrderApi.Order>(
|
||||
`/trade/order/get-detail?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询交易订单物流详情 */
|
||||
export function getExpressTrackList(id: number) {
|
||||
return requestClient.get(`/trade/order/get-express-track-list?id=${id}`);
|
||||
}
|
||||
|
||||
/** 订单发货 */
|
||||
export function deliveryOrder(data: MallOrderApi.DeliveryRequest) {
|
||||
return requestClient.put('/trade/order/delivery', data);
|
||||
}
|
||||
|
||||
/** 订单备注 */
|
||||
export function updateOrderRemark(data: MallOrderApi.RemarkRequest) {
|
||||
return requestClient.put('/trade/order/update-remark', data);
|
||||
}
|
||||
|
||||
/** 订单调价 */
|
||||
export function updateOrderPrice(data: MallOrderApi.PriceRequest) {
|
||||
return requestClient.put('/trade/order/update-price', data);
|
||||
}
|
||||
|
||||
/** 修改订单地址 */
|
||||
export function updateOrderAddress(data: MallOrderApi.AddressRequest) {
|
||||
return requestClient.put('/trade/order/update-address', data);
|
||||
}
|
||||
|
||||
/** 订单核销 */
|
||||
export function pickUpOrder(id: number) {
|
||||
return requestClient.put(`/trade/order/pick-up-by-id?id=${id}`);
|
||||
}
|
||||
|
||||
/** 订单核销 */
|
||||
export function pickUpOrderByVerifyCode(pickUpVerifyCode: string) {
|
||||
return requestClient.put('/trade/order/pick-up-by-verify-code', {
|
||||
params: { pickUpVerifyCode },
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询核销码对应的订单 */
|
||||
export function getOrderByPickUpVerifyCode(pickUpVerifyCode: string) {
|
||||
return requestClient.get<MallOrderApi.Order>(
|
||||
'/trade/order/get-by-pick-up-verify-code',
|
||||
{ params: { pickUpVerifyCode } },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberAddressApi {
|
||||
/** 收件地址信息 */
|
||||
export interface Address {
|
||||
id?: number;
|
||||
name: string;
|
||||
mobile: string;
|
||||
areaId: number;
|
||||
detailAddress: string;
|
||||
defaultStatus: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询用户收件地址列表 */
|
||||
export function getAddressList(params: any) {
|
||||
return requestClient.get<MemberAddressApi.Address[]>('/member/address/list', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberConfigApi {
|
||||
/** 积分设置信息 */
|
||||
export interface Config {
|
||||
id?: number;
|
||||
pointTradeDeductEnable: number;
|
||||
pointTradeDeductUnitPrice: number;
|
||||
pointTradeDeductMaxPrice: number;
|
||||
pointTradeGivePoint: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询积分设置详情 */
|
||||
export function getConfig() {
|
||||
return requestClient.get<MemberConfigApi.Config>('/member/config/get');
|
||||
}
|
||||
|
||||
/** 新增修改积分设置 */
|
||||
export function saveConfig(data: MemberConfigApi.Config) {
|
||||
return requestClient.put('/member/config/save', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberExperienceRecordApi {
|
||||
/** 会员经验记录信息 */
|
||||
export interface ExperienceRecord {
|
||||
id?: number;
|
||||
userId: number;
|
||||
bizId: string;
|
||||
bizType: number;
|
||||
title: string;
|
||||
description: string;
|
||||
experience: number;
|
||||
totalExperience: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询会员经验记录列表 */
|
||||
export function getExperienceRecordPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MemberExperienceRecordApi.ExperienceRecord>
|
||||
>('/member/experience-record/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询会员经验记录详情 */
|
||||
export function getExperienceRecord(id: number) {
|
||||
return requestClient.get<MemberExperienceRecordApi.ExperienceRecord>(
|
||||
`/member/experience-record/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberGroupApi {
|
||||
/** 用户分组信息 */
|
||||
export interface Group {
|
||||
id?: number;
|
||||
name: string;
|
||||
remark: string;
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询用户分组列表 */
|
||||
export function getGroupPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MemberGroupApi.Group>>(
|
||||
'/member/group/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询用户分组详情 */
|
||||
export function getGroup(id: number) {
|
||||
return requestClient.get<MemberGroupApi.Group>(`/member/group/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增用户分组 */
|
||||
export function createGroup(data: MemberGroupApi.Group) {
|
||||
return requestClient.post('/member/group/create', data);
|
||||
}
|
||||
|
||||
/** 查询用户分组 - 精简信息列表 */
|
||||
export function getSimpleGroupList() {
|
||||
return requestClient.get<MemberGroupApi.Group[]>(
|
||||
'/member/group/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改用户分组 */
|
||||
export function updateGroup(data: MemberGroupApi.Group) {
|
||||
return requestClient.put('/member/group/update', data);
|
||||
}
|
||||
|
||||
/** 删除用户分组 */
|
||||
export function deleteGroup(id: number) {
|
||||
return requestClient.delete(`/member/group/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberLevelApi {
|
||||
/** 会员等级信息 */
|
||||
export interface Level {
|
||||
id?: number;
|
||||
name: string;
|
||||
experience: number;
|
||||
value: number;
|
||||
discountPercent: number;
|
||||
icon: string;
|
||||
bgUrl: string;
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询会员等级列表 */
|
||||
export function getLevelList(params: MemberLevelApi.Level) {
|
||||
return requestClient.get<MemberLevelApi.Level[]>('/member/level/list', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询会员等级详情 */
|
||||
export function getLevel(id: number) {
|
||||
return requestClient.get<MemberLevelApi.Level>(`/member/level/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 查询会员等级 - 精简信息列表 */
|
||||
export function getSimpleLevelList() {
|
||||
return requestClient.get<MemberLevelApi.Level[]>(
|
||||
'/member/level/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增会员等级 */
|
||||
export function createLevel(data: MemberLevelApi.Level) {
|
||||
return requestClient.post('/member/level/create', data);
|
||||
}
|
||||
|
||||
/** 修改会员等级 */
|
||||
export function updateLevel(data: MemberLevelApi.Level) {
|
||||
return requestClient.put('/member/level/update', data);
|
||||
}
|
||||
|
||||
/** 删除会员等级 */
|
||||
export function deleteLevel(id: number) {
|
||||
return requestClient.delete(`/member/level/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberPointRecordApi {
|
||||
/** 用户积分记录信息 */
|
||||
export interface Record {
|
||||
id?: number;
|
||||
bizId: string;
|
||||
bizType: string;
|
||||
title: string;
|
||||
description: string;
|
||||
point: number;
|
||||
totalPoint: number;
|
||||
userId: number;
|
||||
createDate: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询用户积分记录列表 */
|
||||
export function getRecordPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MemberPointRecordApi.Record>>(
|
||||
'/member/point/record/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberSignInConfigApi {
|
||||
/** 积分签到规则信息 */
|
||||
export interface SignInConfig {
|
||||
id?: number;
|
||||
day?: number;
|
||||
point?: number;
|
||||
experience?: number;
|
||||
status?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询积分签到规则列表 */
|
||||
export function getSignInConfigList() {
|
||||
return requestClient.get<MemberSignInConfigApi.SignInConfig[]>(
|
||||
'/member/sign-in/config/list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询积分签到规则详情 */
|
||||
export function getSignInConfig(id: number) {
|
||||
return requestClient.get<MemberSignInConfigApi.SignInConfig>(
|
||||
`/member/sign-in/config/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增积分签到规则 */
|
||||
export function createSignInConfig(data: MemberSignInConfigApi.SignInConfig) {
|
||||
return requestClient.post('/member/sign-in/config/create', data);
|
||||
}
|
||||
|
||||
/** 修改积分签到规则 */
|
||||
export function updateSignInConfig(data: MemberSignInConfigApi.SignInConfig) {
|
||||
return requestClient.put('/member/sign-in/config/update', data);
|
||||
}
|
||||
|
||||
/** 删除积分签到规则 */
|
||||
export function deleteSignInConfig(id: number) {
|
||||
return requestClient.delete(`/member/sign-in/config/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberSignInRecordApi {
|
||||
/** 用户签到积分信息 */
|
||||
export interface SignInRecord {
|
||||
id?: number;
|
||||
userId: number;
|
||||
day: number;
|
||||
point: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询用户签到积分列表 */
|
||||
export function getSignInRecordPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MemberSignInRecordApi.SignInRecord>>(
|
||||
'/member/sign-in/record/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberTagApi {
|
||||
/** 会员标签信息 */
|
||||
export interface Tag {
|
||||
id?: number;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询会员标签列表 */
|
||||
export function getMemberTagPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MemberTagApi.Tag>>('/member/tag/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询会员标签详情 */
|
||||
export function getMemberTag(id: number) {
|
||||
return requestClient.get<MemberTagApi.Tag>(`/member/tag/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 查询会员标签 - 精简信息列表 */
|
||||
export function getSimpleTagList() {
|
||||
return requestClient.get<MemberTagApi.Tag[]>('/member/tag/list-all-simple');
|
||||
}
|
||||
|
||||
/** 新增会员标签 */
|
||||
export function createMemberTag(data: MemberTagApi.Tag) {
|
||||
return requestClient.post('/member/tag/create', data);
|
||||
}
|
||||
|
||||
/** 修改会员标签 */
|
||||
export function updateMemberTag(data: MemberTagApi.Tag) {
|
||||
return requestClient.put('/member/tag/update', data);
|
||||
}
|
||||
|
||||
/** 删除会员标签 */
|
||||
export function deleteMemberTag(id: number) {
|
||||
return requestClient.delete(`/member/tag/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MemberUserApi {
|
||||
/** 会员用户信息 */
|
||||
export interface User {
|
||||
id?: number;
|
||||
avatar?: string;
|
||||
birthday?: number;
|
||||
createTime?: number;
|
||||
loginDate?: number;
|
||||
loginIp: string;
|
||||
mark: string;
|
||||
mobile: string;
|
||||
name?: string;
|
||||
nickname?: string;
|
||||
registerIp: string;
|
||||
sex: number;
|
||||
status: number;
|
||||
areaId?: number;
|
||||
areaName?: string;
|
||||
levelName: null | string;
|
||||
point?: null | number;
|
||||
totalPoint?: null | number;
|
||||
experience?: null | number;
|
||||
}
|
||||
|
||||
/** 会员用户等级更新信息 */
|
||||
export interface UserLevelUpdate {
|
||||
id: number;
|
||||
levelId: number;
|
||||
}
|
||||
|
||||
/** 会员用户积分更新信息 */
|
||||
export interface UserPointUpdate {
|
||||
id: number;
|
||||
point: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询会员用户列表 */
|
||||
export function getUserPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MemberUserApi.User>>(
|
||||
'/member/user/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询会员用户详情 */
|
||||
export function getUser(id: number) {
|
||||
return requestClient.get<MemberUserApi.User>(`/member/user/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 修改会员用户 */
|
||||
export function updateUser(data: MemberUserApi.User) {
|
||||
return requestClient.put('/member/user/update', data);
|
||||
}
|
||||
|
||||
/** 修改会员用户等级 */
|
||||
export function updateUserLevel(data: MemberUserApi.UserLevelUpdate) {
|
||||
return requestClient.put('/member/user/update-level', data);
|
||||
}
|
||||
|
||||
/** 修改会员用户积分 */
|
||||
export function updateUserPoint(data: MemberUserApi.UserPointUpdate) {
|
||||
return requestClient.put('/member/user/update-point', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpAccountApi {
|
||||
/** 公众号账号信息 */
|
||||
export interface Account {
|
||||
id?: number;
|
||||
name: string;
|
||||
account: string;
|
||||
appId: string;
|
||||
appSecret: string;
|
||||
token: string;
|
||||
aesKey?: string;
|
||||
qrCodeUrl?: string;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
export interface AccountSimple {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询公众号账号列表 */
|
||||
export function getAccountPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpAccountApi.Account>>(
|
||||
'/mp/account/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询公众号账号详情 */
|
||||
export function getAccount(id: number) {
|
||||
return requestClient.get<MpAccountApi.Account>(`/mp/account/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 查询公众号账号列表 */
|
||||
export function getSimpleAccountList() {
|
||||
return requestClient.get<MpAccountApi.AccountSimple[]>(
|
||||
'/mp/account/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增公众号账号 */
|
||||
export function createAccount(data: MpAccountApi.Account) {
|
||||
return requestClient.post('/mp/account/create', data);
|
||||
}
|
||||
|
||||
/** 修改公众号账号 */
|
||||
export function updateAccount(data: MpAccountApi.Account) {
|
||||
return requestClient.put('/mp/account/update', data);
|
||||
}
|
||||
|
||||
/** 删除公众号账号 */
|
||||
export function deleteAccount(id: number) {
|
||||
return requestClient.delete(`/mp/account/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 生成公众号账号二维码 */
|
||||
export function generateAccountQrCode(id: number) {
|
||||
return requestClient.post(`/mp/account/generate-qr-code?id=${id}`);
|
||||
}
|
||||
|
||||
/** 清空公众号账号 API 配额 */
|
||||
export function clearAccountQuota(id: number) {
|
||||
return requestClient.post(`/mp/account/clear-quota?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpAutoReplyApi {
|
||||
/** 自动回复信息 */
|
||||
export interface AutoReply {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
type: number;
|
||||
keyword: string;
|
||||
content: string;
|
||||
status: number;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询自动回复列表 */
|
||||
export function getAutoReplyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpAutoReplyApi.AutoReply>>(
|
||||
'/mp/auto-reply/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询自动回复详情 */
|
||||
export function getAutoReply(id: number) {
|
||||
return requestClient.get<MpAutoReplyApi.AutoReply>(
|
||||
`/mp/auto-reply/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增自动回复 */
|
||||
export function createAutoReply(data: MpAutoReplyApi.AutoReply) {
|
||||
return requestClient.post('/mp/auto-reply/create', data);
|
||||
}
|
||||
|
||||
/** 修改自动回复 */
|
||||
export function updateAutoReply(data: MpAutoReplyApi.AutoReply) {
|
||||
return requestClient.put('/mp/auto-reply/update', data);
|
||||
}
|
||||
|
||||
/** 删除自动回复 */
|
||||
export function deleteAutoReply(id: number) {
|
||||
return requestClient.delete(`/mp/auto-reply/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpDraftApi {
|
||||
/** 草稿文章信息 */
|
||||
export interface Article {
|
||||
title: string;
|
||||
author: string;
|
||||
digest: string;
|
||||
content: string;
|
||||
contentSourceUrl: string;
|
||||
thumbMediaId: string;
|
||||
showCoverPic: number;
|
||||
needOpenComment: number;
|
||||
onlyFansCanComment: number;
|
||||
}
|
||||
|
||||
/** 草稿信息 */
|
||||
export interface Draft {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
mediaId: string;
|
||||
articles: Article[];
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询草稿列表 */
|
||||
export function getDraftPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpDraftApi.Draft>>('/mp/draft/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建草稿 */
|
||||
export function createDraft(accountId: number, articles: MpDraftApi.Article[]) {
|
||||
return requestClient.post('/mp/draft/create', articles, {
|
||||
params: { accountId },
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新草稿 */
|
||||
export function updateDraft(
|
||||
accountId: number,
|
||||
mediaId: string,
|
||||
articles: MpDraftApi.Article[],
|
||||
) {
|
||||
return requestClient.put('/mp/draft/update', articles, {
|
||||
params: { accountId, mediaId },
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除草稿 */
|
||||
export function deleteDraft(accountId: number, mediaId: string) {
|
||||
return requestClient.delete('/mp/draft/delete', {
|
||||
params: { accountId, mediaId },
|
||||
});
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue