diff --git a/.image/common/ai-feature.png b/.image/common/ai-feature.png new file mode 100644 index 00000000..b4a55f54 Binary files /dev/null and b/.image/common/ai-feature.png differ diff --git a/.image/common/ai-preview.gif b/.image/common/ai-preview.gif new file mode 100644 index 00000000..5f13ac4f Binary files /dev/null and b/.image/common/ai-preview.gif differ diff --git a/README.md b/README.md index f69861f0..ce6f2b45 100644 --- a/README.md +++ b/README.md @@ -191,26 +191,24 @@ ps:核心功能已经实现,正在对接微信小程序中... ### 商城系统 +演示地址: + ![功能图](/.image/common/mall-feature.png) ![功能图](/.image/common/mall-preview.png) -_前端基于 crmeb uniapp 经过授权重构,优化代码实现,接入芋道快速开发平台_ - -演示地址: - ### ERP 系统 -![功能图](/.image/common/erp-feature.png) - 演示地址: +![功能图](/.image/common/erp-feature.png) + ### CRM 系统 -![功能图](/.image/common/crm-feature.png) - 演示地址: +![功能图](/.image/common/crm-feature.png) + ## 🐷 演示图 ### 系统功能 diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index 43ddc7ec..5f8f13ca 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -56,6 +56,10 @@ export const ImageApi = { getImagePageMy: async (params: PageParam) => { return await request.get({ url: `/ai/image/my-page`, params }) }, + // 获取公开的绘图记录 + getImagePagePublic: async (params: PageParam) => { + return await request.get({ url: `/ai/image/public-page`, params }) + }, // 获取【我的】绘图记录 getImageMy: async (id: number) => { return await request.get({ url: `/ai/image/get-my?id=${id}` }) diff --git a/src/api/ai/write/index.ts b/src/api/ai/write/index.ts new file mode 100644 index 00000000..013f998f --- /dev/null +++ b/src/api/ai/write/index.ts @@ -0,0 +1,85 @@ +import { fetchEventSource } from '@microsoft/fetch-event-source' + +import { getAccessToken } from '@/utils/auth' +import { config } from '@/config/axios/config' +import { AiWriteTypeEnum } from '@/views/ai/utils/constants' +import request from '@/config/axios' + +export interface WriteVO { + type: AiWriteTypeEnum.WRITING | AiWriteTypeEnum.REPLY // 1:撰写 2:回复 + prompt: string // 写作内容提示 1。撰写 2回复 + originalContent: string // 原文 + length: number // 长度 + format: number // 格式 + tone: number // 语气 + language: number // 语言 + userId?: number // 用户编号 + platform?: string // 平台 + model?: string // 模型 + generatedContent?: string // 生成的内容 + errorMessage?: string // 错误信息 + createTime?: Date // 创建时间 +} + +export interface AiWritePageReqVO extends PageParam { + userId?: number // 用户编号 + type?: AiWriteTypeEnum // 写作类型 + platform?: string // 平台 + createTime?: [string, string] // 创建时间 +} + +export interface AiWriteRespVo { + id: number + userId: number + type: number + platform: string + model: string + prompt: string + generatedContent: string + originalContent: string + length: number + format: number + tone: number + language: number + errorMessage: string + createTime: string +} + +export const WriteApi = { + writeStream: ({ + data, + onClose, + onMessage, + onError, + ctrl + }: { + data: WriteVO + onMessage?: (res: any) => void + onError?: (...args: any[]) => void + onClose?: (...args: any[]) => void + ctrl: AbortController + }) => { + const token = getAccessToken() + return fetchEventSource(`${config.base_url}/ai/write/generate-stream`, { + method: 'post', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + }, + openWhenHidden: true, + body: JSON.stringify(data), + onmessage: onMessage, + onerror: onError, + onclose: onClose, + signal: ctrl.signal + }) + }, + // 获取写作列表 + getWritePage: (params: AiWritePageReqVO) => { + return request.get>({ url: `/ai/write/page`, params }) + }, + // 删除写作 + deleteWrite(id: number) { + return request.delete({ url: `/ai/write/delete`, params: { id } }) + } +} diff --git a/src/api/ai/writer/index.ts b/src/api/ai/writer/index.ts deleted file mode 100644 index 7494b259..00000000 --- a/src/api/ai/writer/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { fetchEventSource } from '@microsoft/fetch-event-source' -import request from '@/config/axios' - -import { getAccessToken } from '@/utils/auth' -import { config } from '@/config/axios/config' -import { AiWriteTypeEnum } from '@/views/ai/utils/constants' - -export interface WriteVO { - type: AiWriteTypeEnum.WRITING | AiWriteTypeEnum.REPLY // 1:撰写 2:回复 - prompt: string // 写作内容提示 1。撰写 2回复 - originalContent: string // 原文 - length: number // 长度 - format: number // 格式 - tone: number // 语气 - language: number // 语言 - userId?: number // 用户编号 - platform?: string // 平台 - model?: string // 模型 - generatedContent?: string // 生成的内容 - errorMessage: string // 错误信息 - createTime?: Date // 创建时间 -} - -// TODO @hhero:搞成 WriteApi,类似 ConversationApi 一样。这样更有类的概念,后续引入某个 Api,然后调用它的方法就可以了。 -export const writeStream = ({ - data, - onClose, - onMessage, - onError, - ctrl -}: { - data: WriteVO - onMessage?: (res: any) => void - onError?: (...args: any[]) => void - onClose?: (...args: any[]) => void - ctrl: AbortController -}) => { - const token = getAccessToken() - return fetchEventSource(`${config.base_url}/ai/write/generate-stream`, { - method: 'post', - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${token}` - }, - openWhenHidden: true, - body: JSON.stringify(data), - onmessage: onMessage, - onerror: onError, - onclose: onClose, - signal: ctrl.signal - }) -} - -// AI 写作 API -export const WriteApi = { - // 查询AI 写作分页 - getWritePage: async (params: any) => { - return await request.get({ url: `/ai/write/page`, params }) - }, - - // 删除AI 写作 - deleteWrite: async (id: number) => { - return await request.delete({ url: `/ai/write/delete?id=` + id }) - } -} diff --git a/src/views/ai/image/index/components/other/index.vue b/src/views/ai/image/index/components/other/index.vue index 375c15b6..a688be18 100644 --- a/src/views/ai/image/index/components/other/index.vue +++ b/src/views/ai/image/index/components/other/index.vue @@ -36,7 +36,13 @@ 平台 - + - + @@ -77,12 +78,14 @@ diff --git a/src/views/ai/image/square/index.vue b/src/views/ai/image/square/index.vue new file mode 100644 index 00000000..81643d19 --- /dev/null +++ b/src/views/ai/image/square/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/views/ai/music/components/index.vue b/src/views/ai/music/components/index.vue index 21272522..e1395b56 100644 --- a/src/views/ai/music/components/index.vue +++ b/src/views/ai/music/components/index.vue @@ -1,5 +1,5 @@