fix: todo修复
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 348 KiB After Width: | Height: | Size: 348 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 238 KiB |
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 495 KiB After Width: | Height: | Size: 495 KiB |
|
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 177 KiB |
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
@@ -1,59 +0,0 @@
|
||||
version: '1.0'
|
||||
name: pipeline-20251103
|
||||
displayName: master-build
|
||||
triggers:
|
||||
trigger: auto
|
||||
push:
|
||||
branches:
|
||||
prefix:
|
||||
- ''
|
||||
pr:
|
||||
branches:
|
||||
prefix:
|
||||
- ''
|
||||
schedule:
|
||||
- cron: '* * * 1 * ? *'
|
||||
stages:
|
||||
- name: stage-72bb5db9
|
||||
displayName: build
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor: []
|
||||
steps:
|
||||
- step: build@nodejs
|
||||
name: build_nodejs
|
||||
displayName: Nodejs 构建
|
||||
nodeVersion: 24.5.0
|
||||
commands:
|
||||
- '# 设置NPM源,提升安装速度'
|
||||
- npm config set registry https://registry.npmmirror.com
|
||||
- '# 安装pnpm'
|
||||
- npm add -g pnpm
|
||||
- '# 安装依赖'
|
||||
- pnpm i
|
||||
- '# 检查lint'
|
||||
- pnpm lint
|
||||
- '# 检查check'
|
||||
- pnpm check
|
||||
- '# 执行编译命令antd'
|
||||
- pnpm build:antd
|
||||
- '# 执行编译命令ele'
|
||||
- pnpm build:ele
|
||||
- '# 执行编译命令naive'
|
||||
- pnpm build:naive
|
||||
- '# 执行编译命令tdesign'
|
||||
- pnpm build:tdesign
|
||||
artifacts:
|
||||
- name: BUILD_ARTIFACT
|
||||
path:
|
||||
- ./apps/web-antd/dist/
|
||||
- ./apps/web-ele/dist/
|
||||
- ./apps/web-naive/dist/
|
||||
- ./apps/web-tdesign/dist/
|
||||
caches:
|
||||
- ~/.npm
|
||||
- ~/.yarn
|
||||
- ~/.pnpm
|
||||
notify: []
|
||||
strategy:
|
||||
retry: '0'
|
||||
30
README.md
@@ -23,7 +23,7 @@
|
||||
- 采用最新 [vue-vben-admin](https://github.com/vbenjs/vue-vben-admin) v5 实现
|
||||
- 支持 [Ant Design Vue](https://www.antdv.com/) | [Element Plus](https://element-plus.org/zh-CN/) | [Naive UI](https://www.naiveui.com/) | [TDesign](https://tdesign.tencent.com/) 多种免费开源的中后台模版,具备如下特性:
|
||||
|
||||

|
||||

|
||||
|
||||
- **最新技术栈**:使用 Vue3、Vite6 等前端前沿技术开发
|
||||
- **TypeScript**: 应用程序级 JavaScript 的语言
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
## [外包项目请联系【非项目需求请勿扫码,非客服,不解答项目问题】](https://www.shuduokeji.com)
|
||||
|
||||

|
||||

|
||||
|
||||
## 技术栈
|
||||
|
||||
@@ -68,11 +68,11 @@
|
||||
|
||||
① Spring Boot 单体架构:<https://doc.iocoder.cn>
|
||||
|
||||

|
||||

|
||||
|
||||
② Spring Cloud 微服务架构:<https://cloud.iocoder.cn>
|
||||
|
||||

|
||||

|
||||
|
||||
## 内置功能
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
系统内置多种多种业务功能,可以用于快速你的业务系统:
|
||||
|
||||

|
||||

|
||||
|
||||
- 通用模块(必选):系统功能、基础设施
|
||||
- 通用模块(可选):工作流程、支付系统、数据报表、会员中心
|
||||
@@ -110,17 +110,17 @@
|
||||
| 🚀 | 应用管理 | 管理 SSO 单点登录的应用,支持多种 OAuth2 授权方式 |
|
||||
| 🚀 | 地区管理 | 展示省份、城市、区镇等城市信息,支持 IP 对应城市 |
|
||||
|
||||

|
||||

|
||||
|
||||
### 工作流程
|
||||
|
||||

|
||||

|
||||
|
||||
基于 Flowable 构建,可支持信创(国产)数据库,满足中国特色流程操作:
|
||||
|
||||
| BPMN 设计器 | 钉钉/飞书设计器 |
|
||||
| --- | --- |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
> 历经头部企业生产验证,工作流引擎须标配仿钉钉/飞书 + BPMN 双设计器!!!
|
||||
>
|
||||
@@ -186,7 +186,7 @@
|
||||
| 🚀 | 日志服务 | 轻量级日志中心,查看远程服务器的日志 |
|
||||
| 🚀 | 单元测试 | 基于 JUnit + Mockito 实现单元测试,保证功能的正确性、代码的质量等 |
|
||||
|
||||

|
||||

|
||||
|
||||
### 数据报表
|
||||
|
||||
@@ -214,26 +214,26 @@
|
||||
|
||||
演示地址:<https://doc.iocoder.cn/mall-preview/>
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
### ERP 系统
|
||||
|
||||
演示地址:<https://doc.iocoder.cn/erp-preview/>
|
||||
|
||||

|
||||

|
||||
|
||||
### CRM 系统
|
||||
|
||||
演示地址:<https://doc.iocoder.cn/crm-preview/>
|
||||
|
||||

|
||||

|
||||
|
||||
### AI 大模型
|
||||
|
||||
演示地址:<https://doc.iocoder.cn/ai-preview/>
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
@@ -15,7 +15,6 @@ export namespace AiChatConversationApi {
|
||||
maxTokens: number; // 单条回复的最大 Token 数量
|
||||
maxContexts: number; // 上下文的最大 Message 数量
|
||||
createTime?: Date; // 创建时间
|
||||
// 额外字段
|
||||
systemMessage?: string; // 角色设定
|
||||
modelName?: string; // 模型名字
|
||||
roleAvatar?: string; // 角色头像
|
||||
@@ -24,52 +23,52 @@ export namespace AiChatConversationApi {
|
||||
}
|
||||
}
|
||||
|
||||
// 获得【我的】聊天对话
|
||||
/** 获得【我的】聊天对话 */
|
||||
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}`);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export namespace AiChatMessageApi {
|
||||
}
|
||||
}
|
||||
|
||||
// 消息列表
|
||||
/** 消息列表 */
|
||||
export function getChatMessageListByConversationId(
|
||||
conversationId: null | number,
|
||||
) {
|
||||
@@ -55,7 +55,7 @@ export function getChatMessageListByConversationId(
|
||||
);
|
||||
}
|
||||
|
||||
// 发送 Stream 消息
|
||||
/** 发送 Stream 消息 */
|
||||
export function sendChatMessageStream(
|
||||
conversationId: number,
|
||||
content: string,
|
||||
@@ -89,25 +89,27 @@ export function sendChatMessageStream(
|
||||
});
|
||||
}
|
||||
|
||||
// 删除消息
|
||||
/** 删除消息 */
|
||||
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}`);
|
||||
}
|
||||
|
||||
@@ -3,14 +3,7 @@ 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; // 编号
|
||||
userId: number;
|
||||
@@ -30,7 +23,14 @@ export namespace AiImageApi {
|
||||
finishTime: Date; // 完成时间
|
||||
}
|
||||
|
||||
export interface ImageDrawReq {
|
||||
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)
|
||||
}
|
||||
|
||||
export interface ImageDrawReqVO {
|
||||
prompt: string; // 提示词
|
||||
modelId: number; // 模型
|
||||
style: string; // 图像生成的风格
|
||||
@@ -39,7 +39,7 @@ export namespace AiImageApi {
|
||||
options: object; // 绘制参数,Map<String, String>
|
||||
}
|
||||
|
||||
export interface ImageMidjourneyImagineReq {
|
||||
export interface ImageMidjourneyImagineReqVO {
|
||||
prompt: string; // 提示词
|
||||
modelId: number; // 模型
|
||||
base64Array?: string[]; // size不能为空
|
||||
@@ -54,60 +54,62 @@ export namespace AiImageApi {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取【我的】绘图分页
|
||||
/** 获取【我的】绘图分页 */
|
||||
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) {
|
||||
/** 生成图片 */
|
||||
export function drawImage(data: AiImageApi.ImageDrawReqVO) {
|
||||
return requestClient.post(`/ai/image/draw`, data);
|
||||
}
|
||||
|
||||
// 删除【我的】绘画记录
|
||||
/** 删除【我的】绘画记录 */
|
||||
export function deleteImageMy(id: number) {
|
||||
return requestClient.delete(`/ai/image/delete-my?id=${id}`);
|
||||
}
|
||||
|
||||
// ================ midjourney 专属 ================
|
||||
/** ================ midjourney 专属 ================ */
|
||||
|
||||
// 【Midjourney】生成图片
|
||||
export function midjourneyImagine(data: AiImageApi.ImageMidjourneyImagineReq) {
|
||||
/** 【Midjourney】生成图片 */
|
||||
export function midjourneyImagine(
|
||||
data: AiImageApi.ImageMidjourneyImagineReqVO,
|
||||
) {
|
||||
return requestClient.post(`/ai/image/midjourney/imagine`, data);
|
||||
}
|
||||
|
||||
// 【Midjourney】Action 操作(二次生成图片)
|
||||
/** 【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}`);
|
||||
}
|
||||
|
||||
@@ -15,39 +15,39 @@ export namespace AiKnowledgeDocumentApi {
|
||||
}
|
||||
}
|
||||
|
||||
// 查询知识库文档分页
|
||||
/** 查询知识库文档分页 */
|
||||
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}`);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export namespace AiKnowledgeKnowledgeApi {
|
||||
}
|
||||
}
|
||||
|
||||
// 查询知识库分页
|
||||
/** 查询知识库分页 */
|
||||
export function getKnowledgePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiKnowledgeKnowledgeApi.Knowledge>>(
|
||||
'/ai/knowledge/page',
|
||||
@@ -21,29 +21,29 @@ export function getKnowledgePage(params: PageParam) {
|
||||
);
|
||||
}
|
||||
|
||||
// 查询知识库详情
|
||||
/** 查询知识库详情 */
|
||||
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',
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { PageParam, PageResult } from '@vben/request';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AiKnowledgeSegmentApi {
|
||||
// AI 知识库分段
|
||||
export interface KnowledgeSegment {
|
||||
id: number; // 编号
|
||||
documentId: number; // 文档编号
|
||||
@@ -18,7 +17,7 @@ export namespace AiKnowledgeSegmentApi {
|
||||
}
|
||||
}
|
||||
|
||||
// 查询知识库分段分页
|
||||
/** 查询知识库分段分页 */
|
||||
export function getKnowledgeSegmentPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<AiKnowledgeSegmentApi.KnowledgeSegment>>(
|
||||
'/ai/knowledge/segment/page',
|
||||
@@ -26,28 +25,28 @@ export function getKnowledgeSegmentPage(params: PageParam) {
|
||||
);
|
||||
}
|
||||
|
||||
// 查询知识库分段详情
|
||||
/** 查询知识库分段详情 */
|
||||
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(id: number, status: number) {
|
||||
return requestClient.put('/ai/knowledge/segment/update-status', {
|
||||
id,
|
||||
@@ -55,26 +54,26 @@ export function updateKnowledgeSegmentStatus(id: number, status: number) {
|
||||
});
|
||||
}
|
||||
|
||||
// 删除知识库分段
|
||||
/** 删除知识库分段 */
|
||||
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,
|
||||
|
||||
@@ -8,7 +8,6 @@ const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||
const accessStore = useAccessStore();
|
||||
|
||||
export namespace AiMindmapApi {
|
||||
// AI 思维导图
|
||||
export interface MindMap {
|
||||
id: number; // 编号
|
||||
userId: number; // 用户编号
|
||||
@@ -19,12 +18,12 @@ export namespace AiMindmapApi {
|
||||
errorMessage: string; // 错误信息
|
||||
}
|
||||
|
||||
// AI 思维导图生成
|
||||
export interface AiMindMapGenerateReqVO {
|
||||
prompt: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 生成思维导图 Stream */
|
||||
export function generateMindMap({
|
||||
data,
|
||||
onClose,
|
||||
|
||||
@@ -26,19 +26,19 @@ export namespace AiMusicApi {
|
||||
}
|
||||
}
|
||||
|
||||
// 查询音乐分页
|
||||
/** 查询音乐分页 */
|
||||
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}`);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ export namespace AiWriteApi {
|
||||
}
|
||||
}
|
||||
|
||||
/** 写作 Stream */
|
||||
export function writeStream({
|
||||
data,
|
||||
onClose,
|
||||
|
||||
@@ -1,28 +1,6 @@
|
||||
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;
|
||||
formFields?: string[];
|
||||
}
|
||||
|
||||
/** 流程模型 */
|
||||
export interface Model {
|
||||
id: number;
|
||||
@@ -43,6 +21,27 @@ export namespace BpmModelApi {
|
||||
bpmnXml: string;
|
||||
startUsers?: UserInfo[];
|
||||
}
|
||||
|
||||
/** 流程定义 */
|
||||
export interface ProcessDefinition {
|
||||
id: string;
|
||||
key?: string;
|
||||
version: number;
|
||||
deploymentTime: number;
|
||||
suspensionState: number;
|
||||
formType?: number;
|
||||
formCustomViewPath?: string;
|
||||
formFields?: string[];
|
||||
}
|
||||
|
||||
/** 用户信息 */
|
||||
export interface UserInfo {
|
||||
id: number;
|
||||
nickname: string;
|
||||
avatar?: string;
|
||||
deptId?: number;
|
||||
deptName?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 模型分类信息 */
|
||||
|
||||
@@ -11,44 +11,6 @@ import type { BpmModelApi } from '#/api/bpm/model';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessInstanceApi {
|
||||
// TODO @芋艿:一些注释缺少或者不对;
|
||||
export interface Task {
|
||||
id: number;
|
||||
name: string;
|
||||
assigneeUser?: User;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
avatar: string;
|
||||
deptName?: 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: string;
|
||||
name: string;
|
||||
nodeType: BpmNodeTypeEnum;
|
||||
startTime?: Date;
|
||||
status: number;
|
||||
processInstanceId?: string;
|
||||
tasks: ApprovalTaskInfo[];
|
||||
}
|
||||
|
||||
/** 流程实例 */
|
||||
export interface ProcessInstance {
|
||||
businessKey: string;
|
||||
@@ -74,8 +36,23 @@ export namespace BpmProcessInstanceApi {
|
||||
tasks?: BpmProcessInstanceApi.Task[];
|
||||
}
|
||||
|
||||
// 审批详情
|
||||
export interface ApprovalDetail {
|
||||
/** 流程实例的任务 */
|
||||
export interface Task {
|
||||
id: number;
|
||||
name: string;
|
||||
assigneeUser?: User;
|
||||
}
|
||||
|
||||
/** 流程实例的用户信息 */
|
||||
export interface User {
|
||||
id: number;
|
||||
nickname: string;
|
||||
avatar: string;
|
||||
deptName?: string;
|
||||
}
|
||||
|
||||
/** 审批详情 */
|
||||
export interface ApprovalDetailRespVO {
|
||||
activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[];
|
||||
formFieldsPermission: any;
|
||||
processDefinition: BpmModelApi.ProcessDefinition;
|
||||
@@ -84,8 +61,32 @@ export namespace BpmProcessInstanceApi {
|
||||
todoTask: BpmTaskApi.Task;
|
||||
}
|
||||
|
||||
// 抄送流程实例
|
||||
export interface Copy {
|
||||
/** 审批详情的节点信息 */
|
||||
export interface ApprovalNodeInfo {
|
||||
candidateStrategy?: BpmCandidateStrategyEnum;
|
||||
candidateUsers?: User[];
|
||||
endTime?: Date;
|
||||
id: string;
|
||||
name: string;
|
||||
nodeType: BpmNodeTypeEnum;
|
||||
startTime?: Date;
|
||||
status: number;
|
||||
processInstanceId?: string;
|
||||
tasks: ApprovalTaskInfo[];
|
||||
}
|
||||
|
||||
/** 审批详情的节点的任务 */
|
||||
export interface ApprovalTaskInfo {
|
||||
id: number;
|
||||
assigneeUser: User;
|
||||
ownerUser: User;
|
||||
reason: string;
|
||||
signPicUrl: string;
|
||||
status: number;
|
||||
}
|
||||
|
||||
/** 抄送流程实例 */
|
||||
export interface ProcessInstanceCopyRespVO {
|
||||
activityId: string;
|
||||
activityName: string;
|
||||
createTime: number;
|
||||
@@ -103,20 +104,17 @@ export namespace BpmProcessInstanceApi {
|
||||
taskId: string;
|
||||
}
|
||||
|
||||
/** 打印数据任务信息 */
|
||||
export interface PrintTask {
|
||||
description: string;
|
||||
id: number;
|
||||
name: string;
|
||||
signPicUrl?: string;
|
||||
}
|
||||
|
||||
/** 打印数据 */
|
||||
export interface PrintData {
|
||||
/** 流程实例的打印数据响应 */
|
||||
export interface ProcessPrintDataRespVO {
|
||||
printTemplateEnable: boolean;
|
||||
printTemplateHtml?: string;
|
||||
processInstance: ProcessInstance;
|
||||
tasks: PrintTask[];
|
||||
tasks: {
|
||||
description: string;
|
||||
id: number;
|
||||
name: string;
|
||||
signPicUrl?: string;
|
||||
}[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +192,7 @@ export async function updateProcessInstance(
|
||||
|
||||
/** 获取审批详情 */
|
||||
export async function getApprovalDetail(params: any) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ApprovalDetail>(
|
||||
return requestClient.get<BpmProcessInstanceApi.ApprovalDetailRespVO>(
|
||||
`/bpm/process-instance/get-approval-detail`,
|
||||
{ params },
|
||||
);
|
||||
@@ -208,14 +206,6 @@ export async function getNextApprovalNodes(params: any) {
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取表单字段权限 */
|
||||
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>(
|
||||
@@ -225,7 +215,7 @@ export async function getProcessInstanceBpmnModelView(id: string) {
|
||||
|
||||
/** 获取流程实例打印数据 */
|
||||
export async function getProcessInstancePrintData(id: string) {
|
||||
return requestClient.get<BpmProcessInstanceApi.PrintData>(
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessPrintDataRespVO>(
|
||||
`/bpm/process-instance/get-print-data?processInstanceId=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessListenerApi {
|
||||
/** BPM 流程监听器 */
|
||||
/** 流程监听器 */
|
||||
export interface ProcessListener {
|
||||
id: number; // 编号
|
||||
name: string; // 监听器名字
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { BpmProcessInstanceApi } from '../processInstance';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmTaskApi {
|
||||
/** BPM 流程监听器 */
|
||||
/** 流程任务 */
|
||||
export interface Task {
|
||||
id: number; // 编号
|
||||
name: string; // 监听器名字
|
||||
@@ -15,33 +15,6 @@ export namespace BpmTaskApi {
|
||||
valueType: string; // 监听器值类型
|
||||
processInstance?: BpmProcessInstanceApi.ProcessInstance; // 流程实例
|
||||
}
|
||||
|
||||
// 流程任务
|
||||
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; // 节点类型
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询待办任务分页 */
|
||||
@@ -88,51 +61,44 @@ 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}`,
|
||||
);
|
||||
};
|
||||
|
||||
// 撤回任务
|
||||
/** 撤回任务 */
|
||||
export const withdrawTask = async (taskId: string) => {
|
||||
return await requestClient.put('/bpm/task/withdraw', null, {
|
||||
params: { taskId },
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmUserGroupApi {
|
||||
/** BPM 用户组 */
|
||||
/** 用户组 */
|
||||
export interface UserGroup {
|
||||
id: number;
|
||||
name: string;
|
||||
|
||||
@@ -3,12 +3,6 @@ import type { PageParam, PageResult } from '@vben/request';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCommentApi {
|
||||
export interface Property {
|
||||
propertyId: number; // 属性 ID
|
||||
propertyName: string; // 属性名称
|
||||
valueId: number; // 属性值 ID
|
||||
valueName: string; // 属性值名称
|
||||
}
|
||||
/** 商品评论 */
|
||||
export interface Comment {
|
||||
id: number; // 评论编号
|
||||
@@ -32,17 +26,22 @@ export namespace MallCommentApi {
|
||||
replyContent: string; // 回复内容
|
||||
replyTime: Date; // 回复时间
|
||||
createTime: Date; // 创建时间
|
||||
skuProperties: Property[]; // SKU 属性数组
|
||||
skuProperties: {
|
||||
propertyId: number; // 属性 ID
|
||||
propertyName: string; // 属性名称
|
||||
valueId: number; // 属性值 ID
|
||||
valueName: string; // 属性值名称
|
||||
}[]; // SKU 属性数组
|
||||
}
|
||||
|
||||
/** 评论可见性更新 */
|
||||
export interface CommentVisibleUpdate {
|
||||
/** 评论可见性更新请求 */
|
||||
export interface CommentVisibleUpdateReqVO {
|
||||
id: number; // 评论编号
|
||||
visible: boolean; // 是否可见
|
||||
}
|
||||
|
||||
/** 评论回复 */
|
||||
export interface CommentReply {
|
||||
/** 评论回复请求 */
|
||||
export interface CommentReplyReqVO {
|
||||
id: number; // 评论编号
|
||||
replyContent: string; // 回复内容
|
||||
}
|
||||
@@ -70,12 +69,12 @@ export function createComment(data: MallCommentApi.Comment) {
|
||||
|
||||
/** 显示 / 隐藏评论 */
|
||||
export function updateCommentVisible(
|
||||
data: MallCommentApi.CommentVisibleUpdate,
|
||||
data: MallCommentApi.CommentVisibleUpdateReqVO,
|
||||
) {
|
||||
return requestClient.put('/product/comment/update-visible', data);
|
||||
}
|
||||
|
||||
/** 商家回复 */
|
||||
export function replyComment(data: MallCommentApi.CommentReply) {
|
||||
export function replyComment(data: MallCommentApi.CommentReplyReqVO) {
|
||||
return requestClient.put('/product/comment/reply', data);
|
||||
}
|
||||
@@ -12,9 +12,7 @@ export namespace MallHistoryApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得商品浏览记录分页
|
||||
*/
|
||||
/** 获得商品浏览记录分页 */
|
||||
export function getBrowseHistoryPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallHistoryApi.BrowseHistory>>(
|
||||
'/product/browse-history/page',
|
||||
@@ -17,11 +17,6 @@ export namespace MallPropertyApi {
|
||||
name: string; // 名称
|
||||
remark?: string; // 备注
|
||||
}
|
||||
|
||||
/** 属性值查询参数 */
|
||||
export interface PropertyValueQuery extends PageParam {
|
||||
propertyId?: number; // 属性编号
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建属性项 */
|
||||
@@ -62,9 +57,7 @@ export function getPropertySimpleList() {
|
||||
}
|
||||
|
||||
/** 获得属性值分页 */
|
||||
export function getPropertyValuePage(
|
||||
params: MallPropertyApi.PropertyValueQuery,
|
||||
) {
|
||||
export function getPropertyValuePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallPropertyApi.PropertyValue>>(
|
||||
'/product/property/value/page',
|
||||
{ params },
|
||||
@@ -3,39 +3,6 @@ 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 {
|
||||
id?: number; // 商品 SKU 编号
|
||||
name?: string; // 商品 SKU 名称
|
||||
spuId?: number; // SPU 编号
|
||||
properties?: Property[]; // 属性数组
|
||||
price?: number | string; // 商品价格
|
||||
marketPrice?: number | string; // 市场价
|
||||
costPrice?: number | string; // 成本价
|
||||
barCode?: string; // 商品条码
|
||||
picUrl?: string; // 图片地址
|
||||
stock?: number; // 库存
|
||||
weight?: number; // 商品重量,单位:kg 千克
|
||||
volume?: number; // 商品体积,单位:m^3 平米
|
||||
firstBrokeragePrice?: number | string; // 一级分销的佣金
|
||||
secondBrokeragePrice?: number | string; // 二级分销的佣金
|
||||
salesCount?: number; // 商品销量
|
||||
}
|
||||
|
||||
/** 优惠券模板 */
|
||||
export interface GiveCouponTemplate {
|
||||
id?: number; // 优惠券编号
|
||||
name?: string; // 优惠券名称
|
||||
}
|
||||
|
||||
/** 商品 SPU */
|
||||
export interface Spu {
|
||||
id?: number; // 商品编号
|
||||
@@ -68,8 +35,42 @@ export namespace MallSpuApi {
|
||||
browseCount?: number; // 浏览量
|
||||
}
|
||||
|
||||
/** 商品状态更新 */
|
||||
export interface StatusUpdate {
|
||||
/** 商品 SKU */
|
||||
export interface Sku {
|
||||
id?: number; // 商品 SKU 编号
|
||||
name?: string; // 商品 SKU 名称
|
||||
spuId?: number; // SPU 编号
|
||||
properties?: Property[]; // 属性数组
|
||||
price?: number | string; // 商品价格
|
||||
marketPrice?: number | string; // 市场价
|
||||
costPrice?: number | string; // 成本价
|
||||
barCode?: string; // 商品条码
|
||||
picUrl?: string; // 图片地址
|
||||
stock?: number; // 库存
|
||||
weight?: number; // 商品重量,单位:kg 千克
|
||||
volume?: number; // 商品体积,单位:m^3 平米
|
||||
firstBrokeragePrice?: number | string; // 一级分销的佣金
|
||||
secondBrokeragePrice?: number | string; // 二级分销的佣金
|
||||
salesCount?: number; // 商品销量
|
||||
}
|
||||
|
||||
/** 商品属性 */
|
||||
export interface Property {
|
||||
propertyId?: number; // 属性编号
|
||||
propertyName?: string; // 属性名称
|
||||
valueId?: number; // 属性值编号
|
||||
valueName?: string; // 属性值名称
|
||||
}
|
||||
|
||||
// TODO @puhui999:这个还要么?
|
||||
/** 优惠券模板 */
|
||||
export interface GiveCouponTemplate {
|
||||
id?: number; // 优惠券编号
|
||||
name?: string; // 优惠券名称
|
||||
}
|
||||
|
||||
/** 商品状态更新请求 */
|
||||
export interface SpuStatusUpdateReqVO {
|
||||
id: number; // 商品编号
|
||||
status: number; // 商品状态
|
||||
}
|
||||
@@ -98,7 +99,7 @@ export function updateSpu(data: MallSpuApi.Spu) {
|
||||
}
|
||||
|
||||
/** 更新商品 SPU 状态 */
|
||||
export function updateStatus(data: MallSpuApi.StatusUpdate) {
|
||||
export function updateStatus(data: MallSpuApi.SpuStatusUpdateReqVO) {
|
||||
return requestClient.put('/product/spu/update-status', data);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export namespace MallBargainActivityApi {
|
||||
stock: number; // 活动库存
|
||||
}
|
||||
|
||||
// TODO @puhui999:要不要删除?
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
productConfig: BargainProduct; // 砍价活动配置
|
||||
|
||||
@@ -5,12 +5,6 @@ import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCombinationActivityApi {
|
||||
/** 拼团活动所需属性 */
|
||||
export interface CombinationProduct {
|
||||
spuId: number; // 商品 SPU 编号
|
||||
skuId: number; // 商品 SKU 编号
|
||||
combinationPrice: number; // 拼团价格
|
||||
}
|
||||
/** 拼团活动 */
|
||||
export interface CombinationActivity {
|
||||
id?: number; // 活动编号
|
||||
@@ -31,6 +25,14 @@ export namespace MallCombinationActivityApi {
|
||||
products: CombinationProduct[]; // 商品列表
|
||||
}
|
||||
|
||||
// TODO @puhui999:要不要删除?
|
||||
/** 拼团活动所需属性 */
|
||||
export interface CombinationProduct {
|
||||
spuId: number; // 商品 SPU 编号
|
||||
skuId: number; // 商品 SKU 编号
|
||||
combinationPrice: number; // 拼团价格
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
productConfig: CombinationProduct; // 拼团活动配置
|
||||
|
||||
@@ -26,6 +26,7 @@ export namespace MallDiscountActivityApi {
|
||||
products?: DiscountProduct[]; // 商品列表
|
||||
}
|
||||
|
||||
// TODO @puhui999:要不要删除?
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
productConfig: DiscountProduct; // 限时折扣配置
|
||||
|
||||
@@ -5,18 +5,12 @@ import { requestClient } from '#/api/request';
|
||||
export namespace MallDiyPageApi {
|
||||
/** 装修页面 */
|
||||
export interface DiyPage {
|
||||
/** 页面编号 */
|
||||
id?: number;
|
||||
/** 模板编号 */
|
||||
templateId?: number;
|
||||
/** 页面名称 */
|
||||
name: string;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 预览图片地址数组 */
|
||||
previewPicUrls: string[];
|
||||
/** 页面属性 */
|
||||
property: string;
|
||||
id?: number; // 页面编号
|
||||
templateId?: number; // 模板编号
|
||||
name: string; // 页面名称
|
||||
remark: string; // 备注
|
||||
previewPicUrls: string[]; // 预览图片地址数组
|
||||
property: string; // 页面属性
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,26 +7,18 @@ 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;
|
||||
id?: number; // 模板编号
|
||||
name: string; // 模板名称
|
||||
used: boolean; // 是否使用
|
||||
usedTime?: Date; // 使用时间
|
||||
remark: string; // 备注
|
||||
previewPicUrls: string[]; // 预览图片地址数组
|
||||
property: string; // 模板属性
|
||||
}
|
||||
|
||||
/** 装修模板属性(包含页面列表) */
|
||||
export interface DiyTemplateProperty extends DiyTemplate {
|
||||
/** 页面列表 */
|
||||
pages: MallDiyPageApi.DiyPage[];
|
||||
pages: MallDiyPageApi.DiyPage[]; // 页面列表
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export namespace MallKefuConversationApi {
|
||||
}
|
||||
|
||||
/** 会话置顶请求 */
|
||||
export interface ConversationPinnedUpdate {
|
||||
export interface ConversationPinnedUpdateReqVO {
|
||||
id: number; // 会话编号
|
||||
pinned: boolean; // 是否置顶
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export function getConversation(id: number) {
|
||||
|
||||
/** 客服会话置顶 */
|
||||
export function updateConversationPinned(
|
||||
data: MallKefuConversationApi.ConversationPinnedUpdate,
|
||||
data: MallKefuConversationApi.ConversationPinnedUpdateReqVO,
|
||||
) {
|
||||
return requestClient.put(
|
||||
'/promotion/kefu-conversation/update-conversation-pinned',
|
||||
|
||||
@@ -24,11 +24,6 @@ export namespace MallKefuMessageApi {
|
||||
contentType: number; // 消息类型
|
||||
content: string; // 消息内容
|
||||
}
|
||||
|
||||
/** 消息列表查询参数 */
|
||||
export interface MessageQuery extends PageParam {
|
||||
conversationId: number; // 会话编号
|
||||
}
|
||||
}
|
||||
|
||||
/** 发送客服消息 */
|
||||
@@ -44,7 +39,7 @@ export function updateKeFuMessageReadStatus(conversationId: number) {
|
||||
}
|
||||
|
||||
/** 获得消息列表(流式加载) */
|
||||
export function getKeFuMessageList(params: MallKefuMessageApi.MessageQuery) {
|
||||
export function getKeFuMessageList(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallKefuMessageApi.Message>>(
|
||||
'/promotion/kefu-message/list',
|
||||
{ params },
|
||||
|
||||
@@ -36,6 +36,7 @@ export namespace MallPointActivityApi {
|
||||
price: number; // 兑换金额,单位:分
|
||||
}
|
||||
|
||||
// TODO @puhui999:这些还需要么?
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
productConfig: PointProduct; // 积分商城商品配置
|
||||
|
||||
@@ -35,6 +35,7 @@ export namespace MallSeckillActivityApi {
|
||||
products?: SeckillProduct[]; // 秒杀商品列表
|
||||
}
|
||||
|
||||
// TODO @puhui999:这些还需要么?
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
productConfig: SeckillProduct; // 秒杀商品配置
|
||||
|
||||
@@ -12,12 +12,6 @@ export namespace MallSeckillConfigApi {
|
||||
sliderPicUrls: string[]; // 秒杀轮播图
|
||||
status: number; // 活动状态
|
||||
}
|
||||
|
||||
/** 时段配置状态更新 */
|
||||
export interface StatusUpdate {
|
||||
id: number; // 编号
|
||||
status: number; // 状态
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询秒杀时段分页 */
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
import { MaterialType } from '@vben/constants';
|
||||
|
||||
/** 素材类型枚举 */
|
||||
// TODO @xingyu:芋艿,可能要整理下枚举;
|
||||
export enum MaterialType {
|
||||
IMAGE = 1, // 图片
|
||||
THUMB = 4, // 缩略图
|
||||
VIDEO = 3, // 视频
|
||||
VOICE = 2, // 语音
|
||||
}
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpMaterialApi {
|
||||
/** 素材信息 */
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
import { MenuType } from '@vben/constants';
|
||||
|
||||
/** 菜单类型枚举 */
|
||||
// TODO @xingyu:芋艿,可能要整理下枚举;
|
||||
export enum MenuType {
|
||||
CLICK = 'click', // 点击推事件
|
||||
LOCATION_SELECT = 'location_select', // 发送位置
|
||||
MEDIA_ID = 'media_id', // 下发消息
|
||||
MINIPROGRAM = 'miniprogram', // 小程序
|
||||
PIC_PHOTO_OR_ALBUM = 'pic_photo_or_album', // 拍照或者相册发图
|
||||
PIC_SYSPHOTO = 'pic_sysphoto', // 系统拍照发图
|
||||
PIC_WEIXIN = 'pic_weixin', // 微信相册发图
|
||||
SCANCODE_PUSH = 'scancode_push', // 扫码推事件
|
||||
SCANCODE_WAITMSG = 'scancode_waitmsg', // 扫码带提示
|
||||
VIEW = 'view', // 跳转 URL
|
||||
VIEW_LIMITED = 'view_limited', // 跳转图文消息URL
|
||||
}
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpMenuApi {
|
||||
/** 菜单按钮信息 */
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
import { MessageType } from '@vben/constants';
|
||||
|
||||
/** 消息类型枚举 */
|
||||
// TODO @xingyu:芋艿,可能要整理下枚举;
|
||||
export enum MessageType {
|
||||
IMAGE = 'image', // 图片消息
|
||||
MPNEWS = 'mpnews', // 公众号图文消息
|
||||
MUSIC = 'music', // 音乐消息
|
||||
NEWS = 'news', // 图文消息
|
||||
TEXT = 'text', // 文本消息
|
||||
VIDEO = 'video', // 视频消息
|
||||
VOICE = 'voice', // 语音消息
|
||||
WXCARD = 'wxcard', // 卡券消息
|
||||
}
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpMessageApi {
|
||||
/** 消息信息 */
|
||||
|
||||
@@ -20,21 +20,14 @@ export namespace PayAppApi {
|
||||
}
|
||||
|
||||
/** 更新状态请求 */
|
||||
export interface UpdateStatusReq {
|
||||
export interface AppUpdateStatusReqVO {
|
||||
id: number;
|
||||
status: number;
|
||||
}
|
||||
|
||||
export interface AppPageReqVO extends PageParam {
|
||||
name?: string;
|
||||
appKey?: string;
|
||||
status?: number;
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询支付应用列表 */
|
||||
export function getAppPage(params: PayAppApi.AppPageReqVO) {
|
||||
export function getAppPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayAppApi.App>>('/pay/app/page', {
|
||||
params,
|
||||
});
|
||||
@@ -56,7 +49,7 @@ export function updateApp(data: PayAppApi.App) {
|
||||
}
|
||||
|
||||
/** 修改支付应用状态 */
|
||||
export function updateAppStatus(data: PayAppApi.UpdateStatusReq) {
|
||||
export function updateAppStatus(data: PayAppApi.AppUpdateStatusReqVO) {
|
||||
return requestClient.put('/pay/app/update-status', data);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayChannelApi {
|
||||
@@ -16,16 +14,6 @@ export namespace PayChannelApi {
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询支付渠道列表 */
|
||||
export function getChannelPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayChannelApi.Channel>>(
|
||||
'/pay/channel/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询支付渠道详情 */
|
||||
export function getChannel(appId: number, code: string) {
|
||||
return requestClient.get<PayChannelApi.Channel>('/pay/channel/get', {
|
||||
@@ -42,13 +30,3 @@ export function createChannel(data: PayChannelApi.Channel) {
|
||||
export function updateChannel(data: PayChannelApi.Channel) {
|
||||
return requestClient.put('/pay/channel/update', data);
|
||||
}
|
||||
|
||||
/** 删除支付渠道 */
|
||||
export function deleteChannel(id: number) {
|
||||
return requestClient.delete(`/pay/channel/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出支付渠道 */
|
||||
export function exportChannel(params: PageParam) {
|
||||
return requestClient.download('/pay/channel/export-excel', { params });
|
||||
}
|
||||
|
||||
@@ -19,11 +19,6 @@ export namespace DemoOrderApi {
|
||||
spuId?: number;
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
export interface OrderPageReqVO extends PageParam {
|
||||
spuId?: number;
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建示例订单 */
|
||||
@@ -32,7 +27,7 @@ export function createDemoOrder(data: DemoOrderApi.Order) {
|
||||
}
|
||||
|
||||
/** 获得示例订单分页 */
|
||||
export function getDemoOrderPage(params: DemoOrderApi.OrderPageReqVO) {
|
||||
export function getDemoOrderPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<DemoOrderApi.Order>>(
|
||||
'/pay/demo-order/page',
|
||||
{
|
||||
|
||||
@@ -22,18 +22,6 @@ export namespace PayNotifyApi {
|
||||
updateTime: Date;
|
||||
logs?: any[];
|
||||
}
|
||||
|
||||
/** 支付通知任务分页请求 */
|
||||
export interface NotifyTaskPageReqVO extends PageParam {
|
||||
appId?: number;
|
||||
type?: number;
|
||||
dataId?: number;
|
||||
status?: number;
|
||||
merchantOrderId?: string;
|
||||
merchantRefundId?: string;
|
||||
merchantTransferId?: string;
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得支付通知明细 */
|
||||
@@ -42,7 +30,7 @@ export function getNotifyTaskDetail(id: number) {
|
||||
}
|
||||
|
||||
/** 获得支付通知分页 */
|
||||
export function getNotifyTaskPage(params: PayNotifyApi.NotifyTaskPageReqVO) {
|
||||
export function getNotifyTaskPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayNotifyApi.NotifyTask>>(
|
||||
'/pay/notify/page',
|
||||
{
|
||||
|
||||
@@ -38,21 +38,10 @@ export namespace PayOrderApi {
|
||||
createTime: Date;
|
||||
updateTime: Date;
|
||||
}
|
||||
|
||||
/** 支付订单分页请求 */
|
||||
export interface OrderPageReqVO extends PageParam {
|
||||
appId?: number;
|
||||
channelCode?: string;
|
||||
merchantOrderId?: string;
|
||||
channelOrderNo?: string;
|
||||
no?: string;
|
||||
status?: number;
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询支付订单列表 */
|
||||
export function getOrderPage(params: PayOrderApi.OrderPageReqVO) {
|
||||
export function getOrderPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayOrderApi.Order>>('/pay/order/page', {
|
||||
params,
|
||||
});
|
||||
|
||||
@@ -36,39 +36,10 @@ export namespace PayRefundApi {
|
||||
createTime: Date;
|
||||
updateTime: Date;
|
||||
}
|
||||
|
||||
/** 退款订单分页请求 */
|
||||
export interface RefundPageReqVO extends PageParam {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
channelCode?: string;
|
||||
orderId?: string;
|
||||
tradeNo?: string;
|
||||
merchantOrderId?: string;
|
||||
merchantRefundNo?: string;
|
||||
notifyUrl?: string;
|
||||
notifyStatus?: number;
|
||||
status?: number;
|
||||
type?: number;
|
||||
payAmount?: number;
|
||||
refundAmount?: number;
|
||||
reason?: string;
|
||||
userIp?: string;
|
||||
channelOrderNo?: string;
|
||||
channelRefundNo?: string;
|
||||
channelErrorCode?: string;
|
||||
channelErrorMsg?: string;
|
||||
channelExtras?: string;
|
||||
expireTime?: Date[];
|
||||
successTime?: Date[];
|
||||
notifyTime?: Date[];
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询退款订单列表 */
|
||||
export function getRefundPage(params: PayRefundApi.RefundPageReqVO) {
|
||||
export function getRefundPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayRefundApi.Refund>>(
|
||||
'/pay/refund/page',
|
||||
{
|
||||
|
||||
@@ -25,23 +25,10 @@ export namespace PayTransferApi {
|
||||
notifyUrl: string;
|
||||
channelNotifyData: string;
|
||||
}
|
||||
|
||||
/** 转账单分页请求 */
|
||||
export interface TransferPageReqVO extends PageParam {
|
||||
no?: string;
|
||||
appId?: number;
|
||||
channelCode?: string;
|
||||
merchantOrderId?: string;
|
||||
status?: number;
|
||||
userName?: string;
|
||||
userAccount?: string;
|
||||
channelTransferNo?: string;
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询转账单列表 */
|
||||
export function getTransferPage(params: PayTransferApi.TransferPageReqVO) {
|
||||
export function getTransferPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayTransferApi.Transfer>>(
|
||||
'/pay/transfer/page',
|
||||
{
|
||||
|
||||
@@ -3,11 +3,6 @@ import type { PageParam, PageResult } from '@vben/request';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayWalletApi {
|
||||
/** 用户钱包查询参数 */
|
||||
export interface PayWalletUserReq {
|
||||
userId: number;
|
||||
}
|
||||
|
||||
/** 钱包信息 */
|
||||
export interface Wallet {
|
||||
id: number;
|
||||
@@ -19,32 +14,27 @@ export namespace PayWalletApi {
|
||||
freezePrice: number;
|
||||
}
|
||||
|
||||
/** 钱包分页请求 */
|
||||
export interface WalletPageReqVO extends PageParam {
|
||||
userId?: number;
|
||||
userType?: number;
|
||||
balance?: number;
|
||||
totalExpense?: number;
|
||||
totalRecharge?: number;
|
||||
freezePrice?: number;
|
||||
/** 钱包查询参数 */
|
||||
export interface WalletUserQueryReqVO {
|
||||
userId: number;
|
||||
}
|
||||
|
||||
/** 钱包修改余额 */
|
||||
export interface PayWalletUpdateBalanceReqVO {
|
||||
export interface WalletUpdateBalanceReqVO {
|
||||
userId: number;
|
||||
balance: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询用户钱包详情 */
|
||||
export function getWallet(params: PayWalletApi.PayWalletUserReq) {
|
||||
export function getWallet(params: PayWalletApi.WalletUserQueryReqVO) {
|
||||
return requestClient.get<PayWalletApi.Wallet>('/pay/wallet/get', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询会员钱包列表 */
|
||||
export function getWalletPage(params: PayWalletApi.WalletPageReqVO) {
|
||||
export function getWalletPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayWalletApi.Wallet>>(
|
||||
'/pay/wallet/page',
|
||||
{
|
||||
@@ -55,7 +45,7 @@ export function getWalletPage(params: PayWalletApi.WalletPageReqVO) {
|
||||
|
||||
/** 修改会员钱包余额 */
|
||||
export function updateWalletBalance(
|
||||
data: PayWalletApi.PayWalletUpdateBalanceReqVO,
|
||||
data: PayWalletApi.WalletUpdateBalanceReqVO,
|
||||
) {
|
||||
return requestClient.put('/pay/wallet/update-balance', data);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
placeholder: '请输入温度参数',
|
||||
class: 'w-full',
|
||||
precision: 2,
|
||||
min: 0,
|
||||
max: 2,
|
||||
@@ -55,7 +54,6 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
placeholder: '请输入回复数 Token 数',
|
||||
class: 'w-full',
|
||||
min: 0,
|
||||
max: 8192,
|
||||
},
|
||||
@@ -67,7 +65,6 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
placeholder: '请输入上下文数量',
|
||||
class: 'w-full',
|
||||
min: 0,
|
||||
max: 20,
|
||||
},
|
||||
|
||||
@@ -230,31 +230,28 @@ async function updateConversationTitle(
|
||||
async function deleteChatConversation(
|
||||
conversation: AiChatConversationApi.ChatConversation,
|
||||
) {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await confirm(`是否确认删除对话 - ${conversation.title}?`);
|
||||
// 发起删除
|
||||
await deleteChatConversationMy(conversation.id);
|
||||
message.success('对话已删除');
|
||||
// 刷新列表
|
||||
await getChatConversationList();
|
||||
// 回调
|
||||
emits('onConversationDelete', conversation);
|
||||
} catch {}
|
||||
// 删除的二次确认
|
||||
await confirm(`是否确认删除对话 - ${conversation.title}?`);
|
||||
// 发起删除
|
||||
await deleteChatConversationMy(conversation.id);
|
||||
message.success('对话已删除');
|
||||
// 刷新列表
|
||||
await getChatConversationList();
|
||||
// 回调
|
||||
emits('onConversationDelete', conversation);
|
||||
}
|
||||
|
||||
/** 清空未置顶的对话 */
|
||||
async function handleClearConversation() {
|
||||
try {
|
||||
await confirm('确认后对话会全部清空,置顶的对话除外。');
|
||||
await deleteChatConversationMyByUnpinned();
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
// 清空对话、对话内容
|
||||
activeConversationId.value = null;
|
||||
// 获取对话列表
|
||||
await getChatConversationList();
|
||||
// 回调 方法
|
||||
emits('onConversationClear');
|
||||
} catch {}
|
||||
await confirm('确认后对话会全部清空,置顶的对话除外。');
|
||||
await deleteChatConversationMyByUnpinned();
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
// 清空对话、对话内容
|
||||
activeConversationId.value = null;
|
||||
// 获取对话列表
|
||||
await getChatConversationList();
|
||||
// 回调 方法
|
||||
emits('onConversationClear');
|
||||
}
|
||||
|
||||
/** 对话置顶 */
|
||||
|
||||
@@ -18,11 +18,9 @@ async function handlerPromptClick(prompt: any) {
|
||||
</script>
|
||||
<template>
|
||||
<div class="relative flex h-full w-full flex-row justify-center">
|
||||
<!-- center-container -->
|
||||
<div class="flex flex-col justify-center">
|
||||
<!-- title -->
|
||||
<div class="text-center text-3xl font-bold">芋道 AI</div>
|
||||
|
||||
<!-- role-list -->
|
||||
<div class="mt-5 flex w-96 flex-wrap items-center justify-center">
|
||||
<div
|
||||
|
||||
@@ -88,6 +88,7 @@ async function copyContent(content: string) {
|
||||
await copy(content);
|
||||
message.success('复制成功!');
|
||||
}
|
||||
|
||||
/** 删除 */
|
||||
async function handleDelete(id: number) {
|
||||
// 删除 message
|
||||
|
||||
@@ -24,7 +24,7 @@ async function handleCategoryClick(category: string) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-wrap items-center">
|
||||
<div class="mx-0 flex flex-wrap items-center">
|
||||
<div
|
||||
class="mr-2 flex flex-row"
|
||||
v-for="category in categoryList"
|
||||
|
||||
@@ -58,67 +58,67 @@ async function handleTabsScroll() {
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="relative flex h-full flex-wrap content-start items-start overflow-auto px-6 pb-36"
|
||||
class="relative flex h-full flex-wrap content-start items-start overflow-auto pb-36"
|
||||
ref="tabsRef"
|
||||
@scroll="handleTabsScroll"
|
||||
>
|
||||
<div class="mb-5 mr-5 inline-block" v-for="role in roleList" :key="role.id">
|
||||
<div class="mb-3 mr-3 inline-block" v-for="role in roleList" :key="role.id">
|
||||
<Card
|
||||
class="relative rounded-lg"
|
||||
:body-style="{
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'flex-start',
|
||||
width: '240px',
|
||||
maxWidth: '240px',
|
||||
padding: '15px 15px 10px',
|
||||
padding: '15px',
|
||||
}"
|
||||
>
|
||||
<!-- 更多操作 -->
|
||||
<div v-if="showMore" class="absolute right-2 top-0">
|
||||
<Dropdown>
|
||||
<Button type="link">
|
||||
<IconifyIcon icon="lucide:ellipsis-vertical" />
|
||||
<!-- 头部:头像、名称 -->
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex min-w-0 flex-1 items-center">
|
||||
<Avatar
|
||||
:src="role.avatar"
|
||||
class="h-8 w-8 flex-shrink-0 overflow-hidden"
|
||||
/>
|
||||
<div class="ml-2 truncate text-base font-medium">
|
||||
{{ role.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 描述信息 -->
|
||||
<div
|
||||
class="mt-2 line-clamp-2 h-10 overflow-hidden text-sm text-gray-600"
|
||||
>
|
||||
{{ role.description }}
|
||||
</div>
|
||||
<!-- 底部操作按钮 -->
|
||||
<div class="flex items-center justify-end gap-2">
|
||||
<Dropdown v-if="showMore">
|
||||
<Button size="small">
|
||||
<IconifyIcon icon="lucide:ellipsis" />
|
||||
</Button>
|
||||
<template #overlay>
|
||||
<Menu>
|
||||
<Menu.Item @click="handleMoreClick(['edit', role])">
|
||||
<div class="flex items-center">
|
||||
<IconifyIcon icon="lucide:edit" color="#787878" />
|
||||
<span class="text-primary">编辑</span>
|
||||
</div>
|
||||
</Menu.Item>
|
||||
<Menu.Item @click="handleMoreClick(['delete', role])">
|
||||
<div class="flex items-center">
|
||||
<IconifyIcon icon="lucide:trash" color="red" />
|
||||
<span class="text-red-500">删除</span>
|
||||
<span class="ml-2 text-red-500">删除</span>
|
||||
</div>
|
||||
</Menu.Item>
|
||||
<Menu.Item @click="handleMoreClick(['edit', role])">
|
||||
<div class="flex items-center">
|
||||
<IconifyIcon icon="lucide:edit" color="#787878" />
|
||||
<span class="text-primary ml-2">编辑</span>
|
||||
</div>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
</template>
|
||||
</Dropdown>
|
||||
</div>
|
||||
|
||||
<!-- 角色信息 -->
|
||||
<div>
|
||||
<Avatar :src="role.avatar" class="h-10 w-10 overflow-hidden" />
|
||||
</div>
|
||||
|
||||
<div class="ml-2 w-4/5">
|
||||
<div class="h-20">
|
||||
<div class="max-w-32 text-lg font-bold">
|
||||
{{ role.name }}
|
||||
</div>
|
||||
<div class="mt-2 text-sm">
|
||||
{{ role.description }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-1 flex flex-row-reverse">
|
||||
<Button type="primary" size="small" @click="handleUseClick(role)">
|
||||
使用
|
||||
</Button>
|
||||
</div>
|
||||
<Button type="primary" size="small" @click="handleUseClick(role)">
|
||||
使用
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -112,6 +112,7 @@ async function handlerCategoryClick(category: string) {
|
||||
async function handlerAddRole() {
|
||||
formModalApi.setData({ formType: 'my-create' }).open();
|
||||
}
|
||||
|
||||
/** 编辑角色 */
|
||||
async function handlerCardEdit(role: any) {
|
||||
formModalApi.setData({ formType: 'my-update', id: role.id }).open();
|
||||
@@ -199,7 +200,6 @@ onMounted(async () => {
|
||||
添加角色
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<!-- 标签页内容 -->
|
||||
<Tabs
|
||||
v-model:value="activeTab"
|
||||
@@ -219,10 +219,8 @@ onMounted(async () => {
|
||||
@on-edit="handlerCardEdit"
|
||||
@on-use="handlerCardUse"
|
||||
@on-page="handlerCardPage('my')"
|
||||
class="mt-5"
|
||||
/>
|
||||
</Tabs.TabPane>
|
||||
|
||||
<Tabs.TabPane
|
||||
key="public-role"
|
||||
class="flex h-full flex-col overflow-y-auto"
|
||||
|
||||
@@ -63,7 +63,7 @@ async function handleGenerateImage() {
|
||||
width: width.value, // 图片宽度
|
||||
height: height.value, // 图片高度
|
||||
options: {},
|
||||
} as unknown as AiImageApi.ImageDrawReq;
|
||||
} as unknown as AiImageApi.ImageDrawReqVO;
|
||||
await drawImage(form);
|
||||
} finally {
|
||||
// 回调
|
||||
|
||||
@@ -116,7 +116,7 @@ async function handleGenerateImage() {
|
||||
options: {
|
||||
style: style.value, // 图像生成的风格
|
||||
},
|
||||
} as AiImageApi.ImageDrawReq;
|
||||
} as AiImageApi.ImageDrawReqVO;
|
||||
// 发送请求
|
||||
await drawImage(form);
|
||||
} finally {
|
||||
|
||||
@@ -103,7 +103,7 @@ async function handleGenerateImage() {
|
||||
height: imageSize.height,
|
||||
version: selectVersion.value,
|
||||
referImageUrl: referImageUrl.value,
|
||||
} as AiImageApi.ImageMidjourneyImagineReq;
|
||||
} as AiImageApi.ImageMidjourneyImagineReqVO;
|
||||
await midjourneyImagine(req);
|
||||
} finally {
|
||||
// 回调
|
||||
|
||||
@@ -103,7 +103,7 @@ async function handleGenerateImage() {
|
||||
clipGuidancePreset: clipGuidancePreset.value, // 文本提示相匹配的图像 CLIP
|
||||
stylePreset: stylePreset.value, // 风格
|
||||
},
|
||||
} as unknown as AiImageApi.ImageDrawReq;
|
||||
} as unknown as AiImageApi.ImageDrawReqVO;
|
||||
await drawImage(form);
|
||||
} finally {
|
||||
// 回调
|
||||
|
||||
@@ -18,7 +18,7 @@ import { decodeFields } from '#/components/form-create';
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
const printData = ref<BpmProcessInstanceApi.PrintData>();
|
||||
const printData = ref<BpmProcessInstanceApi.ProcessPrintDataRespVO>();
|
||||
const userName = computed(() => userStore.userInfo?.nickname ?? '');
|
||||
const printTime = ref(formatDate(new Date(), 'YYYY-MM-DD HH:mm'));
|
||||
const formFields = ref<any[]>([]);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useGridColumns, useGridFormSchema } from './data';
|
||||
defineOptions({ name: 'BpmCopyTask' });
|
||||
|
||||
/** 任务详情 */
|
||||
function handleDetail(row: BpmProcessInstanceApi.Copy) {
|
||||
function handleDetail(row: BpmProcessInstanceApi.ProcessInstanceCopyRespVO) {
|
||||
const query = {
|
||||
id: row.processInstanceId,
|
||||
...(row.activityId && { activityId: row.activityId }),
|
||||
@@ -52,7 +52,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<BpmProcessInstanceApi.Copy>,
|
||||
} as VxeTableGridOptions<BpmProcessInstanceApi.ProcessInstanceCopyRespVO>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
|
||||
} as VxeTableGridOptions<BpmTaskApi.Task>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { MallArticleCategoryApi } from '#/api/mall/promotion/articleCategory';
|
||||
import type { MallArticleCategoryApi } from '#/api/mall/promotion/article/category';
|
||||
|
||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteArticleCategory,
|
||||
getArticleCategoryPage,
|
||||
} from '#/api/mall/promotion/articleCategory';
|
||||
} from '#/api/mall/promotion/article/category';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { MallArticleCategoryApi } from '#/api/mall/promotion/articleCategory';
|
||||
import type { MallArticleCategoryApi } from '#/api/mall/promotion/article/category';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
createArticleCategory,
|
||||
getArticleCategory,
|
||||
updateArticleCategory,
|
||||
} from '#/api/mall/promotion/articleCategory';
|
||||
} from '#/api/mall/promotion/article/category';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeGridPropTypes } from '#/adapter/vxe-table';
|
||||
import type { MallArticleCategoryApi } from '#/api/mall/promotion/articleCategory';
|
||||
import type { MallArticleCategoryApi } from '#/api/mall/promotion/article/category';
|
||||
|
||||
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { z } from '#/adapter/form';
|
||||
import { getSimpleArticleCategoryList } from '#/api/mall/promotion/articleCategory';
|
||||
import { getSimpleArticleCategoryList } from '#/api/mall/promotion/article/category';
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 关联数据 */
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { MallBannerApi } from '#/api/mall/market/banner';
|
||||
import type { MallBannerApi } from '#/api/mall/promotion/banner';
|
||||
|
||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { deleteBanner, getBannerPage } from '#/api/mall/market/banner';
|
||||
import { deleteBanner, getBannerPage } from '#/api/mall/promotion/banner';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { MallBannerApi } from '#/api/mall/market/banner';
|
||||
import type { MallBannerApi } from '#/api/mall/promotion/banner';
|
||||
import type { SystemUserApi } from '#/api/system/user';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
@@ -12,7 +13,7 @@ import {
|
||||
createBanner,
|
||||
getBanner,
|
||||
updateBanner,
|
||||
} from '#/api/mall/market/banner';
|
||||
} from '#/api/mall/promotion/banner';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeGridPropTypes } from '#/adapter/vxe-table';
|
||||
import type { MpAccountApi } from '#/api/mp/account';
|
||||
|
||||
import { markRaw } from 'vue';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { DICT_TYPE, AutoReplyMsgType as MsgType } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { getSimpleAccountList } from '#/api/mp/account';
|
||||
import { WxReply } from '#/views/mp/components';
|
||||
|
||||
import { MsgType } from './types';
|
||||
|
||||
/** 关联数据 */
|
||||
let accountList: MpAccountApi.AccountSimple[] = [];
|
||||
getSimpleAccountList().then((data) => (accountList = data));
|
||||
|
||||
// TODO @芋艿:要不要使用统一枚举?
|
||||
const RequestMessageTypes = new Set([
|
||||
'image',
|
||||
@@ -155,21 +147,12 @@ export function useFormSchema(msgType: MsgType): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
// TODO @芋艿:貌似可能微信号拿不到。
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'accountId',
|
||||
label: '公众号',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
options: accountList.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
})),
|
||||
placeholder: '请选择公众号',
|
||||
},
|
||||
defaultValue: accountList[0]?.id,
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { MpAutoReplyApi } from '#/api/mp/autoReply';
|
||||
import { computed, nextTick, ref } from 'vue';
|
||||
|
||||
import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||
import { AutoReplyMsgType as MsgType } from '@vben/constants';
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
import { message, Row, Tabs } from 'ant-design-vue';
|
||||
@@ -16,11 +17,11 @@ import {
|
||||
getAutoReplyPage,
|
||||
} from '#/api/mp/autoReply';
|
||||
import { $t } from '#/locales';
|
||||
import { WxAccountSelect } from '#/views/mp/components';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import ReplyContentCell from './modules/content.vue';
|
||||
import Form from './modules/form.vue';
|
||||
import { MsgType } from './types';
|
||||
|
||||
defineOptions({ name: 'MpAutoReply' });
|
||||
|
||||
@@ -43,6 +44,12 @@ function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 公众号变化时查询数据 */
|
||||
function handleAccountChange(accountId: number) {
|
||||
gridApi.formApi.setValues({ accountId });
|
||||
gridApi.formApi.submitForm();
|
||||
}
|
||||
|
||||
/** 切换回复类型 */
|
||||
async function onTabChange(tabName: any) {
|
||||
msgType.value = tabName;
|
||||
@@ -106,7 +113,6 @@ const [FormModal, formModalApi] = useVbenModal({
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
submitOnChange: true, // 表单值变化时自动提交,这样 accountId 会被正确传递到查询函数
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(Number(msgType.value) as MsgType),
|
||||
@@ -123,6 +129,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
});
|
||||
},
|
||||
},
|
||||
autoLoad: false,
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
@@ -144,6 +151,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
|
||||
<FormModal @success="handleRefresh" />
|
||||
<Grid>
|
||||
<template #form-accountId>
|
||||
<WxAccountSelect @change="handleAccountChange" />
|
||||
</template>
|
||||
<template #toolbar-actions>
|
||||
<Tabs
|
||||
v-model:active-key="msgType"
|
||||
|
||||
@@ -4,16 +4,15 @@ import type { Reply } from '#/views/mp/components';
|
||||
import { computed, nextTick, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { AutoReplyMsgType as MsgType, ReplyType } from '@vben/constants';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createAutoReply, updateAutoReply } from '#/api/mp/autoReply';
|
||||
import { $t } from '#/locales';
|
||||
import { ReplyType } from '#/views/mp/components/constants';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
import { MsgType } from '../types';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
// 消息类型(Follow: 关注时回复;Message: 消息回复;Keyword: 关键词回复)
|
||||
// 作为 tab.name,enum 的数字不能随意修改,与 api 参数相关
|
||||
export enum MsgType {
|
||||
Follow = 1,
|
||||
Keyword = 3,
|
||||
Message = 2,
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
export enum ReplyType {
|
||||
Image = 'image',
|
||||
Music = 'music',
|
||||
News = 'news',
|
||||
Text = 'text',
|
||||
Video = 'video',
|
||||
Voice = 'voice',
|
||||
}
|
||||
|
||||
export enum NewsType {
|
||||
Draft = '2',
|
||||
Published = '1',
|
||||
}
|
||||
|
||||
export enum MaterialType {
|
||||
Image = 'image',
|
||||
News = 'news',
|
||||
Video = 'video',
|
||||
Voice = 'voice',
|
||||
}
|
||||
|
||||
export enum MsgType {
|
||||
Event = 'event',
|
||||
Image = 'image',
|
||||
Link = 'link',
|
||||
Location = 'location',
|
||||
Music = 'music',
|
||||
News = 'news',
|
||||
Text = 'text',
|
||||
Video = 'video',
|
||||
Voice = 'voice',
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
export * from './constants';
|
||||
|
||||
export * from './wx-account-select';
|
||||
export * from './wx-location';
|
||||
export * from './wx-material-select';
|
||||
export * from './wx-msg';
|
||||
export * from './wx-music';
|
||||
export * from './wx-news';
|
||||
export * from './wx-reply';
|
||||
export * from './wx-video-play';
|
||||
export * from './wx-voice-play';
|
||||
export { default as WxAccountSelect } from './wx-account-select/account-select.vue';
|
||||
export { default as WxLocation } from './wx-location/wx-location.vue';
|
||||
export { default as WxMaterialSelect } from './wx-material-select/wx-material-select.vue';
|
||||
export { default as WxMsg } from './wx-msg/msg.vue';
|
||||
export { default as WxMusic } from './wx-music/wx-music.vue';
|
||||
export { default as WxNews } from './wx-news/wx-news.vue';
|
||||
export { default as WxReply } from './wx-reply/wx-reply.vue';
|
||||
export { default as WxVideoPlayer } from './wx-video-play/wx-video-play.vue';
|
||||
export { default as WxVoicePlayer } from './wx-voice-play/wx-voice-play.vue';
|
||||
|
||||
@@ -59,7 +59,7 @@ onMounted(handleQuery);
|
||||
<Select
|
||||
v-model:value="account.id"
|
||||
placeholder="请选择公众号"
|
||||
class="!w-[240px]"
|
||||
class="!w-full"
|
||||
@change="onChanged"
|
||||
>
|
||||
<Select.Option v-for="item in accountList" :key="item.id" :value="item.id">
|
||||
|
||||
@@ -4,6 +4,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { NewsType } from '@vben/constants';
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
import { Button, Pagination, Row, Spin } from 'ant-design-vue';
|
||||
@@ -14,8 +15,6 @@ import { getFreePublishPage } from '#/api/mp/freePublish';
|
||||
import { getMaterialPage } from '#/api/mp/material';
|
||||
import { WxNews, WxVideoPlayer, WxVoicePlayer } from '#/views/mp/components';
|
||||
|
||||
import { NewsType } from '../constants';
|
||||
|
||||
defineOptions({ name: 'WxMaterialSelect' });
|
||||
|
||||
const props = withDefaults(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { MpMsgType as MsgType } from '@vben/constants';
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
import {
|
||||
@@ -9,7 +10,6 @@ import {
|
||||
WxVoicePlayer,
|
||||
} from '#/views/mp/components';
|
||||
|
||||
import { MsgType } from '../constants';
|
||||
import MsgEvent from './msg-event.vue';
|
||||
|
||||
defineOptions({ name: 'Msg' });
|
||||
|
||||
@@ -3,14 +3,13 @@ import type { Reply } from './types';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { NewsType } from '@vben/constants';
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
import { Button, Col, Modal, Row } from 'ant-design-vue';
|
||||
|
||||
import { WxMaterialSelect, WxNews } from '#/views/mp/components';
|
||||
|
||||
import { NewsType } from '../constants';
|
||||
|
||||
defineOptions({ name: 'TabNews' });
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
import type { ReplyType } from '../constants';
|
||||
import type { ReplyType } from '@vben/constants';
|
||||
|
||||
import { unref } from 'vue';
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ import type { Reply } from './types';
|
||||
|
||||
import { computed, ref, unref, watch } from 'vue';
|
||||
|
||||
import { NewsType, ReplyType } from '@vben/constants';
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
import { Row, Tabs } from 'ant-design-vue';
|
||||
|
||||
import { NewsType, ReplyType } from '../constants';
|
||||
import TabImage from './tab-image.vue';
|
||||
import TabMusic from './tab-music.vue';
|
||||
import TabNews from './tab-news.vue';
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { MpAccountApi } from '#/api/mp/account';
|
||||
|
||||
import { getSimpleAccountList } from '#/api/mp/account';
|
||||
|
||||
/** 关联数据 */
|
||||
let accountList: MpAccountApi.AccountSimple[] = [];
|
||||
getSimpleAccountList().then((data) => (accountList = data));
|
||||
|
||||
/** 获取表格列配置 */
|
||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
@@ -32,15 +25,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
{
|
||||
fieldName: 'accountId',
|
||||
label: '公众号',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
options: accountList.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
})),
|
||||
placeholder: '请选择公众号',
|
||||
},
|
||||
defaultValue: accountList[0]?.id,
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { message } from 'ant-design-vue';
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { createEmptyNewsItem, deleteDraft, getDraftPage } from '#/api/mp/draft';
|
||||
import { submitFreePublish } from '#/api/mp/freePublish';
|
||||
import { WxAccountSelect } from '#/views/mp/components';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import DraftTableCell from './modules/draft-table.vue';
|
||||
@@ -22,6 +23,12 @@ function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 公众号变化时查询数据 */
|
||||
function handleAccountChange(accountId: number) {
|
||||
gridApi.formApi.setValues({ accountId });
|
||||
gridApi.formApi.submitForm();
|
||||
}
|
||||
|
||||
/** 新增草稿 */
|
||||
async function handleCreate() {
|
||||
const formValues = await gridApi.formApi.getValues();
|
||||
@@ -113,7 +120,6 @@ const [FormModal, formModalApi] = useVbenModal({
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
submitOnChange: true,
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
@@ -142,6 +148,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
};
|
||||
},
|
||||
},
|
||||
autoLoad: false,
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'mediaId',
|
||||
@@ -164,6 +171,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<FormModal @success="handleRefresh" />
|
||||
|
||||
<Grid table-title="草稿列表">
|
||||
<template #form-accountId>
|
||||
<WxAccountSelect @change="handleAccountChange" />
|
||||
</template>
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
|
||||
@@ -34,8 +34,6 @@ const [Modal, modalApi] = useVbenModal({
|
||||
if (!formData.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
// DONE @hw:是不是 isSubmitting 非必须哈?因为 modal 已经去 lock 啦。
|
||||
modalApi.lock();
|
||||
try {
|
||||
if (formData.value.mediaId) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { message } from 'ant-design-vue';
|
||||
// TODO @xingyu:这种,要想办法全局共享起来么?
|
||||
|
||||
import { $t } from '#/locales';
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
|
||||
import { onMounted, watch } from 'vue';
|
||||
|
||||
import { MpMsgType as MsgType } from '@vben/constants';
|
||||
import { formatDate2 } from '@vben/utils';
|
||||
|
||||
import { Button, Image, Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
MsgType,
|
||||
WxLocation,
|
||||
WxMusic,
|
||||
WxNews,
|
||||
|
||||