diff --git a/apps/web-antd/src/adapter/vxe-table.ts b/apps/web-antd/src/adapter/vxe-table.ts index 7afff14f..f2816cb1 100644 --- a/apps/web-antd/src/adapter/vxe-table.ts +++ b/apps/web-antd/src/adapter/vxe-table.ts @@ -24,6 +24,7 @@ import { ImagePreviewGroup, Popconfirm, Switch, + Tag, } from 'ant-design-vue'; import { DictTag } from '#/components/dict-tag'; @@ -113,6 +114,35 @@ setupVbenVxeTable({ }, }); + // 表格配置项可以用 cellRender: { name: 'CellTag' }, + vxeUI.renderer.add('CellTag', { + renderTableDefault(renderOpts, params) { + const { props } = renderOpts; + const { column, row } = params; + return h(Tag, { color: props?.color }, () => row[column.field]); + }, + }); + + vxeUI.renderer.add('CellTags', { + renderTableDefault(renderOpts, params) { + const { props } = renderOpts; + const { column, row } = params; + if (!row[column.field] || row[column.field].length === 0) { + return ''; + } + return h( + 'div', + { class: 'flex items-center justify-center' }, + { + default: () => + row[column.field].map((item: any) => + h(Tag, { color: props?.color }, { default: () => item }), + ), + }, + ); + }, + }); + // 表格配置项可以用 cellRender: { name: 'CellDict', props:{dictType: ''} }, vxeUI.renderer.add('CellDict', { renderTableDefault(renderOpts, params) { diff --git a/apps/web-antd/src/api/ai/chat/conversation/index.ts b/apps/web-antd/src/api/ai/chat/conversation/index.ts index f937f4f3..fe26a316 100644 --- a/apps/web-antd/src/api/ai/chat/conversation/index.ts +++ b/apps/web-antd/src/api/ai/chat/conversation/index.ts @@ -3,7 +3,7 @@ import type { PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiChatConversationApi { - export interface ChatConversationVO { + export interface ChatConversation { id: number; // ID 编号 userId: number; // 用户编号 title: string; // 对话标题 @@ -26,21 +26,21 @@ export namespace AiChatConversationApi { // 获得【我的】聊天对话 export function getChatConversationMy(id: number) { - return requestClient.get( + return requestClient.get( `/ai/chat/conversation/get-my?id=${id}`, ); } // 新增【我的】聊天对话 export function createChatConversationMy( - data: AiChatConversationApi.ChatConversationVO, + data: AiChatConversationApi.ChatConversation, ) { return requestClient.post('/ai/chat/conversation/create-my', data); } // 更新【我的】聊天对话 export function updateChatConversationMy( - data: AiChatConversationApi.ChatConversationVO, + data: AiChatConversationApi.ChatConversation, ) { return requestClient.put(`/ai/chat/conversation/update-my`, data); } @@ -57,7 +57,7 @@ export function deleteChatConversationMyByUnpinned() { // 获得【我的】聊天对话列表 export function getChatConversationMyList() { - return requestClient.get( + return requestClient.get( `/ai/chat/conversation/my-list`, ); } @@ -65,7 +65,7 @@ export function getChatConversationMyList() { // 获得【我的】聊天对话列表 export function getChatConversationPage(params: any) { return requestClient.get< - PageResult + PageResult >(`/ai/chat/conversation/page`, { params }); } diff --git a/apps/web-antd/src/api/ai/chat/message/index.ts b/apps/web-antd/src/api/ai/chat/message/index.ts index ce5fac0c..9de92702 100644 --- a/apps/web-antd/src/api/ai/chat/message/index.ts +++ b/apps/web-antd/src/api/ai/chat/message/index.ts @@ -9,7 +9,7 @@ import { requestClient } from '#/api/request'; const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD); const accessStore = useAccessStore(); export namespace AiChatMessageApi { - export interface ChatMessageVO { + export interface ChatMessage { id: number; // 编号 conversationId: number; // 对话编号 type: string; // 消息类型 @@ -36,7 +36,7 @@ export namespace AiChatMessageApi { export function getChatMessageListByConversationId( conversationId: null | number, ) { - return requestClient.get( + return requestClient.get( `/ai/chat/message/list-by-conversation-id?conversationId=${conversationId}`, ); } @@ -84,7 +84,7 @@ export function deleteByConversationId(conversationId: number) { } // 获得消息分页 export function getChatMessagePage(params: any) { - return requestClient.get>( + return requestClient.get>( '/ai/chat/message/page', { params }, ); diff --git a/apps/web-antd/src/api/ai/image/index.ts b/apps/web-antd/src/api/ai/image/index.ts index 8e2856d7..19970eea 100644 --- a/apps/web-antd/src/api/ai/image/index.ts +++ b/apps/web-antd/src/api/ai/image/index.ts @@ -3,14 +3,14 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiImageApi { - export interface ImageMidjourneyButtonsVO { + 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 绘图 VO - export interface ImageVO { + // AI 绘图 + export interface Image { id: number; // 编号 platform: string; // 平台 model: string; // 模型 @@ -23,12 +23,12 @@ export namespace AiImageApi { errorMessage: string; // 错误信息 options: any; // 配置 Map taskId: number; // 任务编号 - buttons: ImageMidjourneyButtonsVO[]; // mj 操作按钮 + buttons: ImageMidjourneyButtons[]; // mj 操作按钮 createTime: Date; // 创建时间 finishTime: Date; // 完成时间 } - export interface ImageDrawReqVO { + export interface ImageDrawReq { prompt: string; // 提示词 modelId: number; // 模型 style: string; // 图像生成的风格 @@ -37,7 +37,7 @@ export namespace AiImageApi { options: object; // 绘制参数,Map } - export interface ImageMidjourneyImagineReqVO { + export interface ImageMidjourneyImagineReq { prompt: string; // 提示词 modelId: number; // 模型 base64Array?: string[]; // size不能为空 @@ -46,7 +46,7 @@ export namespace AiImageApi { version: string; // 版本 } - export interface ImageMidjourneyActionVO { + export interface ImageMidjourneyAction { id: number; // 图片编号 customId: string; // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识 } @@ -54,26 +54,25 @@ export namespace AiImageApi { // 获取【我的】绘图分页 export function getImagePageMy(params: PageParam) { - return requestClient.get>( - '/ai/image/my-page', - { params }, - ); + return requestClient.get>('/ai/image/my-page', { + params, + }); } // 获取【我的】绘图记录 export function getImageMy(id: number) { - return requestClient.get(`/ai/image/get-my?id=${id}`); + return requestClient.get(`/ai/image/get-my?id=${id}`); } // 获取【我的】绘图记录列表 export function getImageListMyByIds(ids: number[]) { - return requestClient.get(`/ai/image/my-list-by-ids`, { + return requestClient.get(`/ai/image/my-list-by-ids`, { params: { ids: ids.join(',') }, }); } // 生成图片 -export function drawImage(data: AiImageApi.ImageDrawReqVO) { +export function drawImage(data: AiImageApi.ImageDrawReq) { return requestClient.post(`/ai/image/draw`, data); } @@ -84,21 +83,19 @@ export function deleteImageMy(id: number) { // ================ midjourney 专属 ================ // 【Midjourney】生成图片 -export function midjourneyImagine( - data: AiImageApi.ImageMidjourneyImagineReqVO, -) { +export function midjourneyImagine(data: AiImageApi.ImageMidjourneyImagineReq) { return requestClient.post(`/ai/image/midjourney/imagine`, data); } // 【Midjourney】Action 操作(二次生成图片) -export function midjourneyAction(data: AiImageApi.ImageMidjourneyActionVO) { +export function midjourneyAction(data: AiImageApi.ImageMidjourneyAction) { return requestClient.post(`/ai/image/midjourney/action`, data); } // ================ 绘图管理 ================ // 查询绘画分页 export function getImagePage(params: any) { - return requestClient.get(`/ai/image/page`, { params }); + return requestClient.get(`/ai/image/page`, { params }); } // 更新绘画发布状态 diff --git a/apps/web-antd/src/api/ai/knowledge/document/index.ts b/apps/web-antd/src/api/ai/knowledge/document/index.ts index 6c29804e..a26e80e7 100644 --- a/apps/web-antd/src/api/ai/knowledge/document/index.ts +++ b/apps/web-antd/src/api/ai/knowledge/document/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiKnowledgeDocumentApi { - export interface KnowledgeDocumentVO { + export interface KnowledgeDocument { id: number; // 编号 knowledgeId: number; // 知识库编号 name: string; // 文档名称 @@ -18,7 +18,7 @@ export namespace AiKnowledgeDocumentApi { // 查询知识库文档分页 export function getKnowledgeDocumentPage(params: PageParam) { return requestClient.get< - PageResult + PageResult >('/ai/knowledge/document/page', { params }); } diff --git a/apps/web-antd/src/api/ai/knowledge/knowledge/index.ts b/apps/web-antd/src/api/ai/knowledge/knowledge/index.ts index 0ff7281f..7140d8b4 100644 --- a/apps/web-antd/src/api/ai/knowledge/knowledge/index.ts +++ b/apps/web-antd/src/api/ai/knowledge/knowledge/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiKnowledgeKnowledgeApi { - export interface KnowledgeVO { + export interface Knowledge { id: number; // 编号 name: string; // 知识库名称 description: string; // 知识库描述 @@ -15,7 +15,7 @@ export namespace AiKnowledgeKnowledgeApi { // 查询知识库分页 export function getKnowledgePage(params: PageParam) { - return requestClient.get>( + return requestClient.get>( '/ai/knowledge/page', { params }, ); @@ -23,17 +23,17 @@ export function getKnowledgePage(params: PageParam) { // 查询知识库详情 export function getKnowledge(id: number) { - return requestClient.get( + return requestClient.get( `/ai/knowledge/get?id=${id}`, ); } // 新增知识库 -export function createKnowledge(data: AiKnowledgeKnowledgeApi.KnowledgeVO) { +export function createKnowledge(data: AiKnowledgeKnowledgeApi.Knowledge) { return requestClient.post('/ai/knowledge/create', data); } // 修改知识库 -export function updateKnowledge(data: AiKnowledgeKnowledgeApi.KnowledgeVO) { +export function updateKnowledge(data: AiKnowledgeKnowledgeApi.Knowledge) { return requestClient.put('/ai/knowledge/update', data); } @@ -44,7 +44,7 @@ export function deleteKnowledge(id: number) { // 获取知识库简单列表 export function getSimpleKnowledgeList() { - return requestClient.get( + return requestClient.get( '/ai/knowledge/simple-list', ); } diff --git a/apps/web-antd/src/api/ai/knowledge/segment/index.ts b/apps/web-antd/src/api/ai/knowledge/segment/index.ts index 359479e2..63ea4e75 100644 --- a/apps/web-antd/src/api/ai/knowledge/segment/index.ts +++ b/apps/web-antd/src/api/ai/knowledge/segment/index.ts @@ -3,8 +3,8 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiKnowledgeSegmentApi { - // AI 知识库分段 VO - export interface KnowledgeSegmentVO { + // AI 知识库分段 + export interface KnowledgeSegment { id: number; // 编号 documentId: number; // 文档编号 knowledgeId: number; // 知识库编号 @@ -20,27 +20,28 @@ export namespace AiKnowledgeSegmentApi { // 查询知识库分段分页 export function getKnowledgeSegmentPage(params: PageParam) { - return requestClient.get< - PageResult - >('/ai/knowledge/segment/page', { params }); + return requestClient.get>( + '/ai/knowledge/segment/page', + { params }, + ); } // 查询知识库分段详情 export function getKnowledgeSegment(id: number) { - return requestClient.get( + return requestClient.get( `/ai/knowledge/segment/get?id=${id}`, ); } // 新增知识库分段 export function createKnowledgeSegment( - data: AiKnowledgeSegmentApi.KnowledgeSegmentVO, + data: AiKnowledgeSegmentApi.KnowledgeSegment, ) { return requestClient.post('/ai/knowledge/segment/create', data); } // 修改知识库分段 export function updateKnowledgeSegment( - data: AiKnowledgeSegmentApi.KnowledgeSegmentVO, + data: AiKnowledgeSegmentApi.KnowledgeSegment, ) { return requestClient.put('/ai/knowledge/segment/update', data); } diff --git a/apps/web-antd/src/api/ai/mindmap/index.ts b/apps/web-antd/src/api/ai/mindmap/index.ts index 5d32ce91..69e43734 100644 --- a/apps/web-antd/src/api/ai/mindmap/index.ts +++ b/apps/web-antd/src/api/ai/mindmap/index.ts @@ -7,8 +7,8 @@ import { requestClient } from '#/api/request'; const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD); const accessStore = useAccessStore(); export namespace AiMindmapApi { - // AI 思维导图 VO - export interface MindMapVO { + // AI 思维导图 + export interface MindMap { id: number; // 编号 userId: number; // 用户编号 prompt: string; // 生成内容提示 @@ -18,8 +18,8 @@ export namespace AiMindmapApi { errorMessage: string; // 错误信息 } - // AI 思维导图生成 VO - export interface AiMindMapGenerateReqVO { + // AI 思维导图生成 + export interface AiMindMapGenerateReq { prompt: string; } } @@ -32,7 +32,7 @@ export function generateMindMap({ ctrl, }: { ctrl: AbortController; - data: AiMindmapApi.AiMindMapGenerateReqVO; + data: AiMindmapApi.AiMindMapGenerateReq; onClose?: (...args: any[]) => void; onError?: (...args: any[]) => void; onMessage?: (res: any) => void; diff --git a/apps/web-antd/src/api/ai/model/apiKey/index.ts b/apps/web-antd/src/api/ai/model/apiKey/index.ts index 6ae5a1fa..80dcbec1 100644 --- a/apps/web-antd/src/api/ai/model/apiKey/index.ts +++ b/apps/web-antd/src/api/ai/model/apiKey/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiModelApiKeyApi { - export interface ApiKeyVO { + export interface ApiKey { id: number; // 编号 name: string; // 名称 apiKey: string; // 密钥 @@ -15,7 +15,7 @@ export namespace AiModelApiKeyApi { // 查询 API 密钥分页 export function getApiKeyPage(params: PageParam) { - return requestClient.get>( + return requestClient.get>( '/ai/api-key/page', { params }, ); @@ -23,24 +23,22 @@ export function getApiKeyPage(params: PageParam) { // 获得 API 密钥列表 export function getApiKeySimpleList() { - return requestClient.get( + return requestClient.get( '/ai/api-key/simple-list', ); } // 查询 API 密钥详情 export function getApiKey(id: number) { - return requestClient.get( - `/ai/api-key/get?id=${id}`, - ); + return requestClient.get(`/ai/api-key/get?id=${id}`); } // 新增 API 密钥 -export function createApiKey(data: AiModelApiKeyApi.ApiKeyVO) { +export function createApiKey(data: AiModelApiKeyApi.ApiKey) { return requestClient.post('/ai/api-key/create', data); } // 修改 API 密钥 -export function updateApiKey(data: AiModelApiKeyApi.ApiKeyVO) { +export function updateApiKey(data: AiModelApiKeyApi.ApiKey) { return requestClient.put('/ai/api-key/update', data); } diff --git a/apps/web-antd/src/api/ai/model/chatRole/index.ts b/apps/web-antd/src/api/ai/model/chatRole/index.ts index 1c6306c3..d52dbfee 100644 --- a/apps/web-antd/src/api/ai/model/chatRole/index.ts +++ b/apps/web-antd/src/api/ai/model/chatRole/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiModelChatRoleApi { - export interface ChatRoleVO { + export interface ChatRole { id: number; // 角色编号 modelId: number; // 模型编号 name: string; // 角色名称 @@ -19,8 +19,8 @@ export namespace AiModelChatRoleApi { toolIds?: number[]; // 引用的工具 ID 列表 } - // AI 聊天角色 分页请求 vo - export interface ChatRolePageReqVO { + // AI 聊天角色 分页请求 + export interface ChatRolePageReq { name?: string; // 角色名称 category?: string; // 角色类别 publicStatus: boolean; // 是否公开 @@ -31,7 +31,7 @@ export namespace AiModelChatRoleApi { // 查询聊天角色分页 export function getChatRolePage(params: PageParam) { - return requestClient.get>( + return requestClient.get>( '/ai/chat-role/page', { params }, ); @@ -39,17 +39,17 @@ export function getChatRolePage(params: PageParam) { // 查询聊天角色详情 export function getChatRole(id: number) { - return requestClient.get( + return requestClient.get( `/ai/chat-role/get?id=${id}`, ); } // 新增聊天角色 -export function createChatRole(data: AiModelChatRoleApi.ChatRoleVO) { +export function createChatRole(data: AiModelChatRoleApi.ChatRole) { return requestClient.post('/ai/chat-role/create', data); } // 修改聊天角色 -export function updateChatRole(data: AiModelChatRoleApi.ChatRoleVO) { +export function updateChatRole(data: AiModelChatRoleApi.ChatRole) { return requestClient.put('/ai/chat-role/update', data); } @@ -60,7 +60,7 @@ export function deleteChatRole(id: number) { // ======= chat 聊天 // 获取 my role -export function getMyPage(params: AiModelChatRoleApi.ChatRolePageReqVO) { +export function getMyPage(params: AiModelChatRoleApi.ChatRolePageReq) { return requestClient.get('/ai/chat-role/my-page', { params }); } @@ -70,12 +70,12 @@ export function getCategoryList() { } // 创建角色 -export function createMy(data: AiModelChatRoleApi.ChatRoleVO) { +export function createMy(data: AiModelChatRoleApi.ChatRole) { return requestClient.post('/ai/chat-role/create-my', data); } // 更新角色 -export function updateMy(data: AiModelChatRoleApi.ChatRoleVO) { +export function updateMy(data: AiModelChatRoleApi.ChatRole) { return requestClient.put('/ai/chat-role/update', data); } diff --git a/apps/web-antd/src/api/ai/model/model/index.ts b/apps/web-antd/src/api/ai/model/model/index.ts index eefa0878..deafcee8 100644 --- a/apps/web-antd/src/api/ai/model/model/index.ts +++ b/apps/web-antd/src/api/ai/model/model/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiModelModelApi { - export interface ModelVO { + export interface Model { id: number; // 编号 keyId: number; // API 秘钥编号 name: string; // 模型名字 @@ -20,7 +20,7 @@ export namespace AiModelModelApi { // 查询模型分页 export function getModelPage(params: PageParam) { - return requestClient.get>( + return requestClient.get>( '/ai/model/page', { params }, ); @@ -28,7 +28,7 @@ export function getModelPage(params: PageParam) { // 获得模型列表 export function getModelSimpleList(type?: number) { - return requestClient.get('/ai/model/simple-list', { + return requestClient.get('/ai/model/simple-list', { params: { type, }, @@ -37,15 +37,15 @@ export function getModelSimpleList(type?: number) { // 查询模型详情 export function getModel(id: number) { - return requestClient.get(`/ai/model/get?id=${id}`); + return requestClient.get(`/ai/model/get?id=${id}`); } // 新增模型 -export function createModel(data: AiModelModelApi.ModelVO) { +export function createModel(data: AiModelModelApi.Model) { return requestClient.post('/ai/model/create', data); } // 修改模型 -export function updateModel(data: AiModelModelApi.ModelVO) { +export function updateModel(data: AiModelModelApi.Model) { return requestClient.put('/ai/model/update', data); } diff --git a/apps/web-antd/src/api/ai/model/tool/index.ts b/apps/web-antd/src/api/ai/model/tool/index.ts index a6a878f9..6fac9d74 100644 --- a/apps/web-antd/src/api/ai/model/tool/index.ts +++ b/apps/web-antd/src/api/ai/model/tool/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiModelToolApi { - export interface ToolVO { + export interface Tool { id: number; // 工具编号 name: string; // 工具名称 description: string; // 工具描述 @@ -13,22 +13,22 @@ export namespace AiModelToolApi { // 查询工具分页 export function getToolPage(params: PageParam) { - return requestClient.get>('/ai/tool/page', { + return requestClient.get>('/ai/tool/page', { params, }); } // 查询工具详情 export function getTool(id: number) { - return requestClient.get(`/ai/tool/get?id=${id}`); + return requestClient.get(`/ai/tool/get?id=${id}`); } // 新增工具 -export function createTool(data: AiModelToolApi.ToolVO) { +export function createTool(data: AiModelToolApi.Tool) { return requestClient.post('/ai/tool/create', data); } // 修改工具 -export function updateTool(data: AiModelToolApi.ToolVO) { +export function updateTool(data: AiModelToolApi.Tool) { return requestClient.put('/ai/tool/update', data); } @@ -39,5 +39,5 @@ export function deleteTool(id: number) { // 获取工具简单列表 export function getToolSimpleList() { - return requestClient.get('/ai/tool/simple-list'); + return requestClient.get('/ai/tool/simple-list'); } diff --git a/apps/web-antd/src/api/ai/music/index.ts b/apps/web-antd/src/api/ai/music/index.ts index a3a60ffc..384fdf8e 100644 --- a/apps/web-antd/src/api/ai/music/index.ts +++ b/apps/web-antd/src/api/ai/music/index.ts @@ -3,8 +3,8 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace AiMusicApi { - // AI 音乐 VO - export interface MusicVO { + // AI 音乐 + export interface Music { id: number; // 编号 userId: number; // 用户编号 title: string; // 音乐名称 @@ -28,7 +28,7 @@ export namespace AiMusicApi { // 查询音乐分页 export function getMusicPage(params: PageParam) { - return requestClient.get>(`/ai/music/page`, { + return requestClient.get>(`/ai/music/page`, { params, }); } diff --git a/apps/web-antd/src/api/ai/write/index.ts b/apps/web-antd/src/api/ai/write/index.ts index cd9413e1..919f1750 100644 --- a/apps/web-antd/src/api/ai/write/index.ts +++ b/apps/web-antd/src/api/ai/write/index.ts @@ -11,7 +11,7 @@ import { requestClient } from '#/api/request'; const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD); const accessStore = useAccessStore(); export namespace AiWriteApi { - export interface WriteVO { + export interface Write { type: AiWriteTypeEnum.REPLY | AiWriteTypeEnum.WRITING; // 1:撰写 2:回复 prompt: string; // 写作内容提示 1。撰写 2回复 originalContent: string; // 原文 @@ -27,14 +27,14 @@ export namespace AiWriteApi { createTime?: Date; // 创建时间 } - export interface AiWritePageReqVO extends PageParam { + export interface AiWritePageReq extends PageParam { userId?: number; // 用户编号 type?: AiWriteTypeEnum; // 写作类型 platform?: string; // 平台 createTime?: [string, string]; // 创建时间 } - export interface AiWriteRespVo { + export interface AiWriteResp { id: number; userId: number; type: number; @@ -60,7 +60,7 @@ export function writeStream({ ctrl, }: { ctrl: AbortController; - data: Partial; + data: Partial; onClose?: (...args: any[]) => void; onError?: (...args: any[]) => void; onMessage?: (res: any) => void; @@ -83,7 +83,7 @@ export function writeStream({ // 获取写作列表 export function getWritePage(params: any) { - return requestClient.get>( + return requestClient.get>( `/ai/write/page`, { params }, ); diff --git a/apps/web-antd/src/api/crm/business/status/index.ts b/apps/web-antd/src/api/crm/business/status/index.ts index 9445938f..00001feb 100644 --- a/apps/web-antd/src/api/crm/business/status/index.ts +++ b/apps/web-antd/src/api/crm/business/status/index.ts @@ -5,20 +5,20 @@ import { requestClient } from '#/api/request'; export namespace CrmBusinessStatusApi { /** 商机状态信息 */ export interface BusinessStatusType { - id: number; + [x: string]: any; + id?: number; name: string; percent: number; - sort: number; } /** 商机状态组信息 */ export interface BusinessStatus { - id: number; + id?: number; name: string; - deptIds: number[]; - deptNames: string[]; - creator: string; - createTime: Date; + deptIds?: number[]; + deptNames?: string[]; + creator?: string; + createTime?: Date; statuses?: BusinessStatusType[]; } } diff --git a/apps/web-antd/src/api/crm/customer/index.ts b/apps/web-antd/src/api/crm/customer/index.ts index 611d56bc..73b786b8 100644 --- a/apps/web-antd/src/api/crm/customer/index.ts +++ b/apps/web-antd/src/api/crm/customer/index.ts @@ -121,10 +121,9 @@ export function putCustomerPool(id: number) { /** 更新客户的成交状态 */ export function updateCustomerDealStatus(id: number, dealStatus: boolean) { - return requestClient.put('/crm/customer/update-deal-status', { - id, - dealStatus, - }); + return requestClient.put( + `/crm/customer/update-deal-status?id=${id}&dealStatus=${dealStatus}`, + ); } /** 进入公海客户提醒的客户列表 */ diff --git a/apps/web-antd/src/api/crm/statistics/customer.ts b/apps/web-antd/src/api/crm/statistics/customer.ts index e661ba81..cfc47e6b 100644 --- a/apps/web-antd/src/api/crm/statistics/customer.ts +++ b/apps/web-antd/src/api/crm/statistics/customer.ts @@ -1,5 +1,3 @@ -import type { PageParam } from '@vben/request'; - import { requestClient } from '#/api/request'; export namespace CrmStatisticsCustomerApi { @@ -93,10 +91,84 @@ export namespace CrmStatisticsCustomerApi { 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: PageParam) { +export function getCustomerSummaryByDate( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-customer-summary-by-date', { params }, @@ -104,7 +176,9 @@ export function getCustomerSummaryByDate(params: PageParam) { } /** 客户总量分析(按用户) */ -export function getCustomerSummaryByUser(params: PageParam) { +export function getCustomerSummaryByUser( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-customer-summary-by-user', { params }, @@ -112,7 +186,9 @@ export function getCustomerSummaryByUser(params: PageParam) { } /** 客户跟进次数分析(按日期) */ -export function getFollowUpSummaryByDate(params: PageParam) { +export function getFollowUpSummaryByDate( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-follow-up-summary-by-date', { params }, @@ -120,7 +196,9 @@ export function getFollowUpSummaryByDate(params: PageParam) { } /** 客户跟进次数分析(按用户) */ -export function getFollowUpSummaryByUser(params: PageParam) { +export function getFollowUpSummaryByUser( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-follow-up-summary-by-user', { params }, @@ -128,7 +206,9 @@ export function getFollowUpSummaryByUser(params: PageParam) { } /** 获取客户跟进方式统计数 */ -export function getFollowUpSummaryByType(params: PageParam) { +export function getFollowUpSummaryByType( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-follow-up-summary-by-type', { params }, @@ -136,7 +216,9 @@ export function getFollowUpSummaryByType(params: PageParam) { } /** 合同摘要信息(客户转化率页面) */ -export function getContractSummary(params: PageParam) { +export function getContractSummary( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-contract-summary', { params }, @@ -144,7 +226,9 @@ export function getContractSummary(params: PageParam) { } /** 获取客户公海分析(按日期) */ -export function getPoolSummaryByDate(params: PageParam) { +export function getPoolSummaryByDate( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-pool-summary-by-date', { params }, @@ -152,7 +236,9 @@ export function getPoolSummaryByDate(params: PageParam) { } /** 获取客户公海分析(按用户) */ -export function getPoolSummaryByUser(params: PageParam) { +export function getPoolSummaryByUser( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-pool-summary-by-user', { params }, @@ -160,7 +246,9 @@ export function getPoolSummaryByUser(params: PageParam) { } /** 获取客户成交周期(按日期) */ -export function getCustomerDealCycleByDate(params: PageParam) { +export function getCustomerDealCycleByDate( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-customer-deal-cycle-by-date', { params }, @@ -168,7 +256,9 @@ export function getCustomerDealCycleByDate(params: PageParam) { } /** 获取客户成交周期(按用户) */ -export function getCustomerDealCycleByUser(params: PageParam) { +export function getCustomerDealCycleByUser( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-customer-deal-cycle-by-user', { params }, @@ -176,7 +266,9 @@ export function getCustomerDealCycleByUser(params: PageParam) { } /** 获取客户成交周期(按地区) */ -export function getCustomerDealCycleByArea(params: PageParam) { +export function getCustomerDealCycleByArea( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get( '/crm/statistics-customer/get-customer-deal-cycle-by-area', { params }, @@ -184,7 +276,9 @@ export function getCustomerDealCycleByArea(params: PageParam) { } /** 获取客户成交周期(按产品) */ -export function getCustomerDealCycleByProduct(params: PageParam) { +export function getCustomerDealCycleByProduct( + params: CrmStatisticsCustomerApi.CustomerSummaryParams, +) { return requestClient.get< CrmStatisticsCustomerApi.CustomerDealCycleByProduct[] >('/crm/statistics-customer/get-customer-deal-cycle-by-product', { params }); diff --git a/apps/web-antd/src/api/crm/statistics/funnel.ts b/apps/web-antd/src/api/crm/statistics/funnel.ts index a4948e60..8e023d1b 100644 --- a/apps/web-antd/src/api/crm/statistics/funnel.ts +++ b/apps/web-antd/src/api/crm/statistics/funnel.ts @@ -1,4 +1,4 @@ -import type { PageParam, PageResult } from '@vben/request'; +import type { PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; @@ -25,8 +25,42 @@ export namespace CrmStatisticsFunnelApi { } } +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: PageParam) { +export function getFunnelSummary(params: any) { return requestClient.get( '/crm/statistics-funnel/get-funnel-summary', { params }, @@ -34,7 +68,7 @@ export function getFunnelSummary(params: PageParam) { } /** 获取商机结束状态统计 */ -export function getBusinessSummaryByEndStatus(params: PageParam) { +export function getBusinessSummaryByEndStatus(params: any) { return requestClient.get>( '/crm/statistics-funnel/get-business-summary-by-end-status', { params }, @@ -42,7 +76,7 @@ export function getBusinessSummaryByEndStatus(params: PageParam) { } /** 获取新增商机分析(按日期) */ -export function getBusinessSummaryByDate(params: PageParam) { +export function getBusinessSummaryByDate(params: any) { return requestClient.get( '/crm/statistics-funnel/get-business-summary-by-date', { params }, @@ -50,7 +84,7 @@ export function getBusinessSummaryByDate(params: PageParam) { } /** 获取商机转化率分析(按日期) */ -export function getBusinessInversionRateSummaryByDate(params: PageParam) { +export function getBusinessInversionRateSummaryByDate(params: any) { return requestClient.get< CrmStatisticsFunnelApi.BusinessInversionRateSummaryByDate[] >('/crm/statistics-funnel/get-business-inversion-rate-summary-by-date', { @@ -59,7 +93,7 @@ export function getBusinessInversionRateSummaryByDate(params: PageParam) { } /** 获取商机列表(按日期) */ -export function getBusinessPageByDate(params: PageParam) { +export function getBusinessPageByDate(params: any) { return requestClient.get>( '/crm/statistics-funnel/get-business-page-by-date', { params }, diff --git a/apps/web-antd/src/api/crm/statistics/performance.ts b/apps/web-antd/src/api/crm/statistics/performance.ts index ab345125..2bfcdd57 100644 --- a/apps/web-antd/src/api/crm/statistics/performance.ts +++ b/apps/web-antd/src/api/crm/statistics/performance.ts @@ -1,5 +1,3 @@ -import type { PageParam } from '@vben/request'; - import { requestClient } from '#/api/request'; export namespace CrmStatisticsPerformanceApi { @@ -10,10 +8,17 @@ export namespace CrmStatisticsPerformanceApi { lastMonthCount: number; lastYearCount: number; } + export interface PerformanceParams { + times: string[]; + deptId: number; + userId: number; + } } /** 员工获得合同金额统计 */ -export function getContractPricePerformance(params: PageParam) { +export function getContractPricePerformance( + params: CrmStatisticsPerformanceApi.PerformanceParams, +) { return requestClient.get( '/crm/statistics-performance/get-contract-price-performance', { params }, @@ -21,7 +26,9 @@ export function getContractPricePerformance(params: PageParam) { } /** 员工获得回款统计 */ -export function getReceivablePricePerformance(params: PageParam) { +export function getReceivablePricePerformance( + params: CrmStatisticsPerformanceApi.PerformanceParams, +) { return requestClient.get( '/crm/statistics-performance/get-receivable-price-performance', { params }, @@ -29,7 +36,9 @@ export function getReceivablePricePerformance(params: PageParam) { } /** 员工获得签约合同数量统计 */ -export function getContractCountPerformance(params: PageParam) { +export function getContractCountPerformance( + params: CrmStatisticsPerformanceApi.PerformanceParams, +) { return requestClient.get( '/crm/statistics-performance/get-contract-count-performance', { params }, diff --git a/apps/web-antd/src/api/crm/statistics/portrait.ts b/apps/web-antd/src/api/crm/statistics/portrait.ts index 88ff518d..ecbe9c9d 100644 --- a/apps/web-antd/src/api/crm/statistics/portrait.ts +++ b/apps/web-antd/src/api/crm/statistics/portrait.ts @@ -36,6 +36,26 @@ export namespace CrmStatisticsPortraitApi { } } +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( diff --git a/apps/web-antd/src/api/crm/statistics/rank.ts b/apps/web-antd/src/api/crm/statistics/rank.ts index f5fcfb16..216696c8 100644 --- a/apps/web-antd/src/api/crm/statistics/rank.ts +++ b/apps/web-antd/src/api/crm/statistics/rank.ts @@ -11,6 +11,38 @@ export namespace CrmStatisticsRankApi { } } +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( diff --git a/apps/web-antd/src/components/form-create/rules/data.ts b/apps/web-antd/src/components/form-create/rules/data.ts index 2c6cee2c..3d34bf7a 100644 --- a/apps/web-antd/src/components/form-create/rules/data.ts +++ b/apps/web-antd/src/components/form-create/rules/data.ts @@ -121,7 +121,7 @@ const apiSelectRule = [ field: 'data', title: '请求参数 JSON 格式', props: { - autosize: true, + autoSize: true, type: 'textarea', placeholder: '{"type": 1}', }, @@ -155,7 +155,7 @@ const apiSelectRule = [ info: `data 为接口返回值,需要写一个匿名函数解析返回值为选择器 options 列表 (data: any)=>{ label: string; value: any }[]`, props: { - autosize: true, + autoSize: true, rows: { minRows: 2, maxRows: 6 }, type: 'textarea', placeholder: ` diff --git a/apps/web-antd/src/components/simple-process-design/components/nodes-config/modules/condition-dialog.vue b/apps/web-antd/src/components/simple-process-design/components/nodes-config/modules/condition-dialog.vue index dc8d6a86..6e82fc26 100644 --- a/apps/web-antd/src/components/simple-process-design/components/nodes-config/modules/condition-dialog.vue +++ b/apps/web-antd/src/components/simple-process-design/components/nodes-config/modules/condition-dialog.vue @@ -63,6 +63,7 @@ const [Modal, modalApi] = useVbenModal({ }); // TODO xingyu 暴露 modalApi 给父组件是否合适? trigger-node-config.vue 会有多个 conditionDialog 实例 +// 不用暴露啊,用 useVbenModal 就可以了 defineExpose({ modalApi });