diff --git a/.env b/.env index 424b022b..4b0f5bf6 100644 --- a/.env +++ b/.env @@ -18,3 +18,8 @@ VITE_APP_DOCALERT_ENABLE=true # 百度统计 VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc + +# 默认账户密码 +VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码 +VITE_APP_DEFAULT_LOGIN_USERNAME = admin +VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123 diff --git a/README.md b/README.md index 55d1abf8..f69861f0 100644 --- a/README.md +++ b/README.md @@ -54,17 +54,16 @@ 推荐 VS Code 开发,配合插件如下: -| 插件名 | 功能 | -|-------------------------------|--------------------------| -| TypeScript Vue Plugin (Volar) | 用于 TypeScript 的 Vue 插件 | -| Vue Language Features (Volar) | Vue3.0 语法支持 | -| unocss | unocss for vscode | -| Iconify IntelliSense | Iconify 预览和搜索 | -| i18n Ally | 国际化智能提示 | -| Stylelint | Css 格式化 | -| Prettier | 代码格式化 | -| ESLint | 脚本代码检查 | -| DotENV | env 文件高亮 | +| 插件名 | 功能 | +|-------------------------------|---------------------| +| Vue - Official | Vue 与 TypeScript 支持 | +| unocss | unocss for vscode | +| Iconify IntelliSense | Iconify 预览和搜索 | +| i18n Ally | 国际化智能提示 | +| Stylelint | Css 格式化 | +| Prettier | 代码格式化 | +| ESLint | 脚本代码检查 | +| DotENV | env 文件高亮 | ## 🔥 后端架构 diff --git a/src/api/ai/chat/conversation/index.ts b/src/api/ai/chat/conversation/index.ts index 08ad26a1..9f5f70f2 100644 --- a/src/api/ai/chat/conversation/index.ts +++ b/src/api/ai/chat/conversation/index.ts @@ -43,8 +43,8 @@ export const ChatConversationApi = { }, // 删除【我的】所有对话,置顶除外 - deleteMyAllExceptPinned: async () => { - return await request.delete({ url: `/ai/chat/conversation/delete-my-all-except-pinned` }) + deleteChatConversationMyByUnpinned: async () => { + return await request.delete({ url: `/ai/chat/conversation/delete-by-unpinned` }) }, // 获得【我的】聊天对话列表 diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index 4fd35abe..496fac53 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -1,51 +1,29 @@ import request from '@/config/axios' -// AI API 密钥 VO -// TODO @fan:要不前端不弄太多 VO,就用这个 ImageDetailVO?! -export interface ImageDetailVO { +// AI 绘图 VO +export interface ImageVO { id: number // 编号 - prompt: string // 提示词 - status: number // 状态 - errorMessage: string // 错误信息 - type: string // 模型下分不同的类型(清晰、真实...) - taskId: number // dr 任务id - picUrl: string // 任务地址 - originalPicUrl: string // 绘制图片地址 platform: string // 平台 model: string // 模型 - style: string // 图像生成的风格 - size: string // 图片尺寸 + prompt: string // 提示词 + width: number // 图片宽度 + height: number // 图片高度 + status: number // 状态 + publicStatus: boolean // 公开状态 + picUrl: string // 任务地址 + errorMessage: string // 错误信息 + options: object // 配置 Map + taskId: number // 任务编号 buttons: ImageMjButtonsVO[] // mj 操作按钮 createTime: string // 创建时间 - updateTime: string // 更新事件 + finishTime: string // 完成时间 } -export interface ImageMjButtonsVO { - 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 ImageMjActionVO { - id: string // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识 - customId: string // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识 -} - - export interface ImagePageReqVO { pageNo: number // 分页编号 pageSize: number // 分页大小 } -export interface ImageDallReqVO { - prompt: string // 提示词 - model: string // 模型 - style: string // 图像生成的风格 - width: string // 图片宽度 - height: string // 图片高度 -} - export interface ImageDrawReqVO { platform: string // 平台 prompt: string // 提示词 @@ -65,34 +43,66 @@ export interface ImageMidjourneyImagineReqVO { version: string // 版本 } -// TODO 芋艿:review 下整体注释、方法名 +export interface ImageMjActionVO { + id: number // 图片编号 + customId: string // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识 +} + +export interface ImageMjButtonsVO { + 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 API 密钥 API export const ImageApi = { - // 获取 image 列表 - getImageList: async (params: ImagePageReqVO) => { + // 获取【我的】绘图分页 + getImagePageMy: async (params: ImagePageReqVO) => { return await request.get({ url: `/ai/image/my-page`, params }) }, - // 获取 image 详细信息 - getImageDetail: async (id: number) => { - return await request.get({ url: `/ai/image/get-my?id=${id}`}) + // 获取【我的】绘图记录 + getImageMy: async (id: number) => { + return await request.get({ url: `/ai/image/get-my?id=${id}` }) + }, + // 获取【我的】绘图记录列表 + getImageListMyByIds: async (ids: number[]) => { + return await request.get({ url: `/ai/image/my-list-by-ids`, params: { ids: ids.join(',') } }) }, // 生成图片 - drawImage: async (data: ImageDrawReqVO)=> { + drawImage: async (data: ImageDrawReqVO) => { return await request.post({ url: `/ai/image/draw`, data }) }, - // 删除 - deleteImage: async (id: number)=> { - return await request.delete({ url: `/ai/image/delete-my?id=${id}`}) + // 删除【我的】绘画记录 + deleteImageMy: async (id: number) => { + return await request.delete({ url: `/ai/image/delete-my?id=${id}` }) }, - // ------------ midjourney + // ================ midjourney 专属 ================ - // midjourney - imagine - midjourneyImagine: async (data: ImageMidjourneyImagineReqVO)=> { + // 【Midjourney】生成图片 + midjourneyImagine: async (data: ImageMidjourneyImagineReqVO) => { return await request.post({ url: `/ai/image/midjourney/imagine`, data }) }, - // midjourney - action - midjourneyAction: async (params: ImageMjActionVO)=> { - return await request.get({ url: `/ai/image/midjourney/action`, params }) + // 【Midjourney】Action 操作(二次生成图片) + midjourneyAction: async (data: ImageMjActionVO) => { + return await request.post({ url: `/ai/image/midjourney/action`, data }) }, + + // ================ 绘图管理 ================ + + // 查询绘画分页 + getImagePage: async (params: any) => { + return await request.get({ url: `/ai/image/page`, params }) + }, + + // 更新绘画发布状态 + updateImage: async (data: any) => { + return await request.put({ url: '/ai/image/update-public-status', data }) + }, + + // 删除绘画 + deleteImage: async (id: number) => { + return await request.delete({ url: `/ai/image/delete?id=` + id }) + } } diff --git a/src/api/ai/music/index.ts b/src/api/ai/music/index.ts new file mode 100644 index 00000000..74b85268 --- /dev/null +++ b/src/api/ai/music/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +// AI 音乐 VO +export interface MusicVO { + id: number // 编号 + userId: number // 用户编号 + title: string // 音乐名称 + lyric: string // 歌词 + imageUrl: string // 图片地址 + audioUrl: string // 音频地址 + videoUrl: string // 视频地址 + status: number // 音乐状态 + gptDescriptionPrompt: string // 描述词 + prompt: string // 提示词 + platform: string // 模型平台 + model: string // 模型 + generateMode: number // 生成模式 + tags: string // 音乐风格标签 + duration: number // 音乐时长 + publicStatus: boolean // 是否发布 + taskId: string // 任务id + errorMessage: string // 错误信息 +} + +// AI 音乐 API +export const MusicApi = { + // 查询音乐分页 + getMusicPage: async (params: any) => { + return await request.get({ url: `/ai/music/page`, params }) + }, + + // 更新音乐 + updateMusic: async (data: any) => { + return await request.put({ url: '/ai/music/update', data }) + }, + + // 删除音乐 + deleteMusic: async (id: number) => { + return await request.delete({ url: `/ai/music/delete?id=` + id }) + } +} diff --git a/src/api/infra/jobLog/index.ts b/src/api/infra/jobLog/index.ts index dc80f1d9..ed54761c 100644 --- a/src/api/infra/jobLog/index.ts +++ b/src/api/infra/jobLog/index.ts @@ -12,6 +12,7 @@ export interface JobLogVO { duration: string status: number createTime: string + result: string } // 任务日志列表 diff --git a/src/api/mall/promotion/kefu/conversation/index.ts b/src/api/mall/promotion/kefu/conversation/index.ts new file mode 100644 index 00000000..2dbf3316 --- /dev/null +++ b/src/api/mall/promotion/kefu/conversation/index.ts @@ -0,0 +1,35 @@ +import request from '@/config/axios' + +export interface KeFuConversationRespVO { + id: number // 编号 + userId: number // 会话所属用户 + userAvatar: string // 会话所属用户头像 + userNickname: string // 会话所属用户昵称 + lastMessageTime: Date // 最后聊天时间 + lastMessageContent: string // 最后聊天内容 + lastMessageContentType: number // 最后发送的消息类型 + adminPinned: boolean // 管理端置顶 + userDeleted: boolean // 用户是否可见 + adminDeleted: boolean // 管理员是否可见 + adminUnreadMessageCount: number // 管理员未读消息数 + createTime?: string // 创建时间 +} + +// 客服会话 API +export const KeFuConversationApi = { + // 获得客服会话列表 + getConversationList: async () => { + return await request.get({ url: '/promotion/kefu-conversation/list' }) + }, + // 客服会话置顶 + updateConversationPinned: async (data: any) => { + return await request.put({ + url: '/promotion/kefu-conversation/update-conversation-pinned', + data + }) + }, + // 删除客服会话 + deleteConversation: async (id: number) => { + return await request.get({ url: '/promotion/kefu-conversation/delete?id' + id }) + } +} diff --git a/src/api/mall/promotion/kefu/message/index.ts b/src/api/mall/promotion/kefu/message/index.ts new file mode 100644 index 00000000..a12167fa --- /dev/null +++ b/src/api/mall/promotion/kefu/message/index.ts @@ -0,0 +1,36 @@ +import request from '@/config/axios' + +export interface KeFuMessageRespVO { + id: number // 编号 + conversationId: number // 会话编号 + senderId: number // 发送人编号 + senderAvatar: string // 发送人头像 + senderType: number // 发送人类型 + receiverId: number // 接收人编号 + receiverType: number // 接收人类型 + contentType: number // 消息类型 + content: string // 消息 + readStatus: boolean // 是否已读 + createTime: Date // 创建时间 +} + +// 客服会话 API +export const KeFuMessageApi = { + // 发送客服消息 + sendKeFuMessage: async (data: any) => { + return await request.post({ + url: '/promotion/kefu-message/send', + data + }) + }, + // 更新客服消息已读状态 + updateKeFuMessageReadStatus: async (conversationId: number) => { + return await request.put({ + url: '/promotion/kefu-message/update-read-status?conversationId=' + conversationId + }) + }, + // 获得消息分页数据 + getKeFuMessagePage: async (params: any) => { + return await request.get({ url: '/promotion/kefu-message/page', params }) + } +} diff --git a/src/api/mall/promotion/seckill/seckillConfig.ts b/src/api/mall/promotion/seckill/seckillConfig.ts index 66857df8..37d9b543 100644 --- a/src/api/mall/promotion/seckill/seckillConfig.ts +++ b/src/api/mall/promotion/seckill/seckillConfig.ts @@ -19,7 +19,7 @@ export const SeckillConfigApi = { // 查询秒杀时段列表 getSimpleSeckillConfigList: async () => { - return await request.get({ url: `/promotion/seckill-config/simple-list` }) + return await request.get({ url: `/promotion/seckill-config/list` }) }, // 查询秒杀时段详情 diff --git a/src/assets/ai/dall2.jpg b/src/assets/ai/dall2.jpg new file mode 100644 index 00000000..c07374dc Binary files /dev/null and b/src/assets/ai/dall2.jpg differ diff --git a/src/assets/ai/dall3.jpg b/src/assets/ai/dall3.jpg new file mode 100644 index 00000000..7f45803b Binary files /dev/null and b/src/assets/ai/dall3.jpg differ diff --git a/src/assets/ai/qingxi.jpg b/src/assets/ai/qingxi.jpg new file mode 100644 index 00000000..d76b8156 Binary files /dev/null and b/src/assets/ai/qingxi.jpg differ diff --git a/src/assets/ai/ziran.jpg b/src/assets/ai/ziran.jpg new file mode 100644 index 00000000..62907242 Binary files /dev/null and b/src/assets/ai/ziran.jpg differ diff --git a/src/components/ContentWrap/src/ContentWrap.vue b/src/components/ContentWrap/src/ContentWrap.vue index 454e95c9..c75e4b71 100644 --- a/src/components/ContentWrap/src/ContentWrap.vue +++ b/src/components/ContentWrap/src/ContentWrap.vue @@ -10,12 +10,13 @@ const prefixCls = getPrefixCls('content-wrap') defineProps({ title: propTypes.string.def(''), - message: propTypes.string.def('') + message: propTypes.string.def(''), + bodyStyle: propTypes.object.def({ padding: '20px' }) }) diff --git a/src/components/Icon/src/Icon.vue b/src/components/Icon/src/Icon.vue index 4246539f..a90bb37e 100644 --- a/src/components/Icon/src/Icon.vue +++ b/src/components/Icon/src/Icon.vue @@ -22,7 +22,7 @@ const props = defineProps({ const elRef = ref(null) -const isLocal = computed(() => props.icon.startsWith('svg-icon:')) +const isLocal = computed(() => props.icon?.startsWith('svg-icon:')) const symbolId = computed(() => { return unref(isLocal) ? `#icon-${props.icon.split('svg-icon:')[1]}` : props.icon diff --git a/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue b/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue index 1715d73b..304630d9 100644 --- a/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue +++ b/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue @@ -129,7 +129,7 @@ const updateFlowType = (flowType) => { conditionExpression: null }) bpmnInstances().modeling.updateProperties(toRaw(bpmnElementSource.value), { - default: bpmnElement.value + default: toRaw(bpmnElement.value) }) return } diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 25936068..aed40908 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -174,6 +174,7 @@ service.interceptors.response.use( if (msg === '无效的刷新令牌') { // hard coding:忽略这个提示,直接登出 console.log(msg) + return handleAuthorized() } else { ElNotification.error({ title: msg }) } diff --git a/src/layout/components/AppView.vue b/src/layout/components/AppView.vue index 44341873..88d5f0cc 100644 --- a/src/layout/components/AppView.vue +++ b/src/layout/components/AppView.vue @@ -38,24 +38,24 @@ provide('reload', reload) :class="[ 'p-[var(--app-content-padding)] w-[calc(100%-var(--app-content-padding)-var(--app-content-padding))] bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]', { - '!min-h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]': + '!h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]': (fixedHeader && (layout === 'classic' || layout === 'topLeft' || layout === 'top') && footer) || (!tagsView && layout === 'top' && footer), - '!min-h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height)-var(--tags-view-height))]': + '!h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height)-var(--tags-view-height))]': tagsView && layout === 'top' && footer, - '!min-h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--top-tool-height)-var(--app-footer-height))]': + '!h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--top-tool-height)-var(--app-footer-height))]': !fixedHeader && layout === 'classic' && footer, - '!min-h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]': + '!h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]': !fixedHeader && layout === 'topLeft' && footer, - '!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding))]': + '!h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding))]': fixedHeader && layout === 'cutMenu' && footer, - '!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]': + '!h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]': !fixedHeader && layout === 'cutMenu' && footer } ]" diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index bc62a3c4..6da3b0a4 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -70,6 +70,26 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, + { + path: '/ai/music', + component: Layout, + redirect: '/index', + name: 'AIMusic', + meta: {}, + children: [ + { + path: 'index', + component: () => import('@/views/ai/music/components/index.vue'), + name: 'AIMusicIndex', + meta: { + title: 'AI 音乐', + icon: 'ep:home-filled', + noCache: false, + affix: true + } + } + ] + }, { path: '/user', component: Layout, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index f4d67b4e..cfa785b0 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -109,6 +109,14 @@ export const PayChannelEnum = { code: 'wx_app', name: '微信 APP 支付' }, + WX_NATIVE: { + code: 'wx_native', + name: '微信 Native 支付' + }, + WX_WAP: { + code: 'wx_wap', + name: '微信 WAP 网站支付' + }, WX_BAR: { code: 'wx_bar', name: '微信条码支付' diff --git a/src/utils/dict.ts b/src/utils/dict.ts index ab6e2923..556c8d01 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -24,6 +24,10 @@ export interface NumberDictDataType extends DictDataType { value: number } +export interface StringDictDataType extends DictDataType { + value: string +} + export const getDictOptions = (dictType: string) => { return dictStore.getDictByType(dictType) || [] } @@ -44,8 +48,11 @@ export const getIntDictOptions = (dictType: string): NumberDictDataType[] => { } export const getStrDictOptions = (dictType: string) => { - const dictOption: DictDataType[] = [] + // 获得通用的 DictDataType 列表 const dictOptions: DictDataType[] = getDictOptions(dictType) + // 转换成 string 类型的 StringDictDataType 类型 + // why 需要特殊转换:避免 IDEA 在 v-for="dict in getStrDictOptions(...)" 时,el-option 的 key 会告警 + const dictOption: StringDictDataType[] = [] dictOptions.forEach((dict: DictDataType) => { dictOption.push({ ...dict, @@ -212,5 +219,8 @@ export enum DICT_TYPE { ERP_STOCK_RECORD_BIZ_TYPE = 'erp_stock_record_biz_type', // 库存明细的业务类型 // ========== AI - 人工智能模块 ========== - AI_PLATFORM = 'ai_platform' // AI 平台 + AI_PLATFORM = 'ai_platform', // AI 平台 + AI_IMAGE_STATUS = 'ai_image_status', // AI 图片状态 + AI_MUSIC_STATUS = 'ai_music_status', // AI 音乐状态 + AI_GENERATE_MODE = 'ai_generate_mode' // AI 生成模式 } diff --git a/src/utils/download.ts b/src/utils/download.ts index fe24ee27..4e8b8c60 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -29,10 +29,29 @@ const download = { html: (data: Blob, fileName: string) => { download0(data, fileName, 'text/html') }, - // 下载 MarkdownView 方法 + // 下载 Markdown 方法 markdown: (data: Blob, fileName: string) => { download0(data, fileName, 'text/markdown') } } export default download + +/** 图片下载(通过浏览器图片下载) */ +export const downloadImage = async (imageUrl) => { + const image = new Image() + image.setAttribute('crossOrigin', 'anonymous') + image.src = imageUrl + image.onload = () => { + const canvas = document.createElement('canvas') + canvas.width = image.width + canvas.height = image.height + const ctx = canvas.getContext('2d') as CanvasDrawImage + ctx.drawImage(image, 0, 0, image.width, image.height) + const url = canvas.toDataURL('image/png') + const a = document.createElement('a') + a.href = url + a.download = 'image.png' + a.click() + } +} diff --git a/src/utils/index.ts b/src/utils/index.ts index 2590bce8..2c2fbbd0 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -313,7 +313,7 @@ export const fenToYuan = (price: string | number): string => { */ export const calculateRelativeRate = (value?: number, reference?: number) => { // 防止除0 - if (!reference) return 0 + if (!reference || reference == 0) return 0 return ((100 * ((value || 0) - reference)) / reference).toFixed(0) } diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index e61ccbe9..3dbaff3f 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -184,9 +184,9 @@ const loginData = reactive({ captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE, tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE, loginForm: { - tenantName: '芋道源码', - username: 'admin', - password: 'admin123', + tenantName: import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT || '', + username: import.meta.env.VITE_APP_DEFAULT_LOGIN_USERNAME || '', + password: import.meta.env.VITE_APP_DEFAULT_LOGIN_PASSWORD || '', captchaVerification: '', rememberMe: true // 默认记录我。如果不需要,可手动修改 } diff --git a/src/views/ai/chat/ChatEmpty.vue b/src/views/ai/chat/index/ChatEmpty.vue similarity index 100% rename from src/views/ai/chat/ChatEmpty.vue rename to src/views/ai/chat/index/ChatEmpty.vue diff --git a/src/views/ai/chat/Conversation.vue b/src/views/ai/chat/index/Conversation.vue similarity index 85% rename from src/views/ai/chat/Conversation.vue rename to src/views/ai/chat/index/Conversation.vue index 2afeb9ac..be184cf8 100644 --- a/src/views/ai/chat/Conversation.vue +++ b/src/views/ai/chat/index/Conversation.vue @@ -1,11 +1,10 @@ - - diff --git a/src/views/ai/image/ImageTaskCard.vue b/src/views/ai/image/ImageTaskCard.vue deleted file mode 100644 index 6da2214c..00000000 --- a/src/views/ai/image/ImageTaskCard.vue +++ /dev/null @@ -1,133 +0,0 @@ - - - - diff --git a/src/views/ai/image/index.vue b/src/views/ai/image/index.vue deleted file mode 100644 index 6d89680b..00000000 --- a/src/views/ai/image/index.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - diff --git a/src/views/ai/image/ImageDetailDrawer.vue b/src/views/ai/image/index/ImageDetailDrawer.vue similarity index 64% rename from src/views/ai/image/ImageDetailDrawer.vue rename to src/views/ai/image/index/ImageDetailDrawer.vue index 9814de5b..b3641ffb 100644 --- a/src/views/ai/image/ImageDetailDrawer.vue +++ b/src/views/ai/image/index/ImageDetailDrawer.vue @@ -2,16 +2,16 @@
- - - - - + + + + +
@@ -21,57 +21,49 @@
时间
-
提交时间:{{imageDetail.createTime}}
- -
生成时间:{{imageDetail.updateTime}}
+
提交时间:{{ imageDetail.createTime }}
+
生成时间:{{ imageDetail.finishTime }}
模型
- {{imageDetail.model}}({{imageDetail.height}}x{{imageDetail.width}}) + {{ imageDetail.model }}({{ imageDetail.height }}x{{ imageDetail.width }})
提示词
- {{imageDetail.prompt}} + {{ imageDetail.prompt }}
图片地址
- {{imageDetail.picUrl}} -
-
- -
-
生成地址
-
- {{imageDetail.originalPicUrl}} + {{ imageDetail.picUrl }}
-
+
风格
- {{imageDetail.options.style}} + {{ imageDetail?.options?.style }}
+ + diff --git a/src/views/ai/image/index/ImageTaskCard.vue b/src/views/ai/image/index/ImageTaskCard.vue new file mode 100644 index 00000000..0fbcc3ec --- /dev/null +++ b/src/views/ai/image/index/ImageTaskCard.vue @@ -0,0 +1,164 @@ + + + + diff --git a/src/views/ai/image/dall3/index.vue b/src/views/ai/image/index/dall3/index.vue similarity index 72% rename from src/views/ai/image/dall3/index.vue rename to src/views/ai/image/index/dall3/index.vue index 51baeb0b..52f0dbed 100644 --- a/src/views/ai/image/dall3/index.vue +++ b/src/views/ai/image/index/dall3/index.vue @@ -25,7 +25,7 @@ :type="(selectHotWord === hotWord ? 'primary' : 'default')" v-for="hotWord in hotWords" :key="hotWord" - @click="handlerHotWordClick(hotWord)" + @click="handleHotWordClick(hotWord)" > {{ hotWord }} @@ -37,7 +37,7 @@
{{model.name}}
@@ -57,14 +57,14 @@
{{imageStyle.name}}
@@ -78,8 +78,8 @@
-
+ @click="handleSizeClick(imageSize)"> +
{{ imageSize.name }}
@@ -91,13 +91,13 @@ size="large" round :loading="drawIn" - @click="handlerGenerateImage"> + @click="handleGenerateImage"> {{drawIn ? '生成中' : '生成内容'}}
diff --git a/src/views/ai/image/midjourney/index.vue b/src/views/ai/image/index/midjourney/index.vue similarity index 68% rename from src/views/ai/image/midjourney/index.vue rename to src/views/ai/image/index/midjourney/index.vue index aad47d83..5207bd22 100644 --- a/src/views/ai/image/midjourney/index.vue +++ b/src/views/ai/image/index/midjourney/index.vue @@ -24,7 +24,7 @@ :type="(selectHotWord === hotWord ? 'primary' : 'default')" v-for="hotWord in hotWords" :key="hotWord" - @click="handlerHotWordClick(hotWord)" + @click="handleHotWordClick(hotWord)" > {{ hotWord }} @@ -38,8 +38,8 @@
-
+ @click="handleSizeClick(imageSize)"> +
{{ imageSize.key }}
@@ -57,7 +57,7 @@ clearable placeholder="请选择版本" style="width: 350px" - @change="handlerChangeVersion" + @change="handleChangeVersion" >
{{model.name}}
+
+
+ 参考图 +
+ + + +
- 生成内容 + 生成内容
diff --git a/src/views/ai/image/manager/index.vue b/src/views/ai/image/manager/index.vue new file mode 100644 index 00000000..84403f35 --- /dev/null +++ b/src/views/ai/image/manager/index.vue @@ -0,0 +1,251 @@ + + + diff --git a/src/views/ai/music/components/index.vue b/src/views/ai/music/components/index.vue new file mode 100644 index 00000000..21272522 --- /dev/null +++ b/src/views/ai/music/components/index.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/views/ai/music/components/list/audioBar/index.vue b/src/views/ai/music/components/list/audioBar/index.vue new file mode 100644 index 00000000..2b25e40f --- /dev/null +++ b/src/views/ai/music/components/list/audioBar/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/src/views/ai/music/components/list/index.vue b/src/views/ai/music/components/list/index.vue new file mode 100644 index 00000000..6dce9b8c --- /dev/null +++ b/src/views/ai/music/components/list/index.vue @@ -0,0 +1,94 @@ + + + + + + diff --git a/src/views/ai/music/components/list/songCard/index.vue b/src/views/ai/music/components/list/songCard/index.vue new file mode 100644 index 00000000..dc1ffa8b --- /dev/null +++ b/src/views/ai/music/components/list/songCard/index.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/views/ai/music/components/list/songInfo/index.vue b/src/views/ai/music/components/list/songInfo/index.vue new file mode 100644 index 00000000..4832bfcb --- /dev/null +++ b/src/views/ai/music/components/list/songInfo/index.vue @@ -0,0 +1,33 @@ + + + diff --git a/src/views/ai/music/components/mode/desc.vue b/src/views/ai/music/components/mode/desc.vue new file mode 100644 index 00000000..4488461e --- /dev/null +++ b/src/views/ai/music/components/mode/desc.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/views/ai/music/components/mode/index.vue b/src/views/ai/music/components/mode/index.vue new file mode 100644 index 00000000..bb6cf116 --- /dev/null +++ b/src/views/ai/music/components/mode/index.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/views/ai/music/components/mode/lyric.vue b/src/views/ai/music/components/mode/lyric.vue new file mode 100644 index 00000000..f774003a --- /dev/null +++ b/src/views/ai/music/components/mode/lyric.vue @@ -0,0 +1,83 @@ + + + diff --git a/src/views/ai/music/components/title/index.vue b/src/views/ai/music/components/title/index.vue new file mode 100644 index 00000000..a0658027 --- /dev/null +++ b/src/views/ai/music/components/title/index.vue @@ -0,0 +1,25 @@ + + + diff --git a/src/views/ai/music/manager/index.vue b/src/views/ai/music/manager/index.vue new file mode 100644 index 00000000..342f8dd8 --- /dev/null +++ b/src/views/ai/music/manager/index.vue @@ -0,0 +1,286 @@ + + + diff --git a/src/views/ai/utils/constants.ts b/src/views/ai/utils/constants.ts new file mode 100644 index 00000000..337cfda3 --- /dev/null +++ b/src/views/ai/utils/constants.ts @@ -0,0 +1,42 @@ +/** + * Created by 芋道源码 + * + * AI 枚举类 + * + * 问题:为什么不放在 src/utils/constants.ts 呢? + * 回答:主要 AI 是可选模块,考虑到独立、解耦,所以放在了 /views/ai/utils/constants.ts + */ + +/** + * AI 平台的枚举 + */ +export const AiPlatformEnum = { + TONG_YI: 'TongYi', // 阿里 + YI_YAN: 'YiYan', // 百度 + DEEP_SEEK: 'DeepSeek', // DeepSeek + ZHI_PU: 'ZhiPu', // 智谱 AI + XING_HUO: 'XingHuo', // 讯飞 + OPENAI: 'OpenAI', + Ollama: 'Ollama', + STABLE_DIFFUSION: 'StableDiffusion', // Stability AI + MIDJOURNEY: 'Midjourney', // Midjourney + SUNO: 'Suno' // Suno AI +} + +/** + * AI 图像生成状态的枚举 + */ +export const AiImageStatusEnum = { + IN_PROGRESS: 10, // 进行中 + SUCCESS: 20, // 已完成 + FAIL: 30 // 已失败 +} + +/** + * AI 音乐生成状态的枚举 + */ +export const AiMusicStatusEnum = { + IN_PROGRESS: 10, // 进行中 + SUCCESS: 20, // 已完成 + FAIL: 30 // 已失败 +} diff --git a/src/views/ai/utils/utils.ts b/src/views/ai/utils/utils.ts new file mode 100644 index 00000000..fc4f8e6c --- /dev/null +++ b/src/views/ai/utils/utils.ts @@ -0,0 +1,13 @@ +/** + * Created by 芋道源码 + * + * AI 枚举类 + * + * 问题:为什么不放在 src/utils/common-utils.ts 呢? + * 回答:主要 AI 是可选模块,考虑到独立、解耦,所以放在了 /views/ai/utils/common-utils.ts + */ + +/** 判断字符串是否包含中文 */ +export const hasChinese = async (str) => { + return /[\u4e00-\u9fa5]/.test(str) +} diff --git a/src/views/bpm/oa/leave/index.vue b/src/views/bpm/oa/leave/index.vue index 2cb53247..27dbc19e 100644 --- a/src/views/bpm/oa/leave/index.vue +++ b/src/views/bpm/oa/leave/index.vue @@ -36,9 +36,9 @@ value-format="YYYY-MM-DD HH:mm:ss" /> - + - + diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue index f3072e56..da54769d 100644 --- a/src/views/bpm/processInstance/detail/index.vue +++ b/src/views/bpm/processInstance/detail/index.vue @@ -363,7 +363,7 @@ const loadRunningTask = (tasks) => { // 2.4 处理 approve 表单 if (task.formId && task.formConf) { const approveForm = {} - setConfAndFields2(approveForm, task.formConf, task.formFields, task.formVariable) + setConfAndFields2(approveForm, task.formConf, task.formFields, task.formVariables) approveForms.value.push(approveForm) } else { approveForms.value.push({}) // 占位,避免为空 diff --git a/src/views/crm/contract/detail/index.vue b/src/views/crm/contract/detail/index.vue index 0829e100..1369a355 100644 --- a/src/views/crm/contract/detail/index.vue +++ b/src/views/crm/contract/detail/index.vue @@ -36,7 +36,7 @@ ref="permissionListRef" :biz-id="contract.id!" :biz-type="BizTypeEnum.CRM_CONTRACT" - :show-action="false" + :show-action="!permissionListRef?.isPool || false" @quit-team="close" /> diff --git a/src/views/infra/job/index.vue b/src/views/infra/job/index.vue index a9ab332b..29460030 100644 --- a/src/views/infra/job/index.vue +++ b/src/views/infra/job/index.vue @@ -235,11 +235,7 @@ const handleChangeStatus = async (row: JobApi.JobVO) => { message.success(text + '成功') // 刷新列表 await getList() - } catch { - // 取消后,进行恢复按钮 - row.status = - row.status === InfraJobStatusEnum.NORMAL ? InfraJobStatusEnum.STOP : InfraJobStatusEnum.NORMAL - } + } catch {} } /** 删除按钮操作 */ diff --git a/src/views/infra/job/logger/JobLogDetail.vue b/src/views/infra/job/logger/JobLogDetail.vue index 1a84e4e8..7216f527 100644 --- a/src/views/infra/job/logger/JobLogDetail.vue +++ b/src/views/infra/job/logger/JobLogDetail.vue @@ -26,7 +26,7 @@ - {{ detailData.duration + ' result' }} + {{ detailData.result }} diff --git a/src/views/infra/webSocket/index.vue b/src/views/infra/webSocket/index.vue index 0f0e351f..d83327d4 100644 --- a/src/views/infra/webSocket/index.vue +++ b/src/views/infra/webSocket/index.vue @@ -29,8 +29,8 @@ :autosize="{ minRows: 2, maxRows: 4 }" :disabled="!getIsOpen" clearable - type="textarea" placeholder="请输入你要发送的消息" + type="textarea" /> diff --git a/src/views/mall/home/components/TradeTrendCard.vue b/src/views/mall/home/components/TradeTrendCard.vue index a8cab828..7930e212 100644 --- a/src/views/mall/home/components/TradeTrendCard.vue +++ b/src/views/mall/home/components/TradeTrendCard.vue @@ -186,7 +186,7 @@ const getOrderCountTrendComparison = async ( dates.push(item.value.date) if (series.length === 2) { series[0].data.push(fenToYuan(item?.value?.orderPayPrice || 0)) // 当前金额 - series[1].data.push(fenToYuan(item?.value?.orderPayCount || 0)) // 当前数量 + series[1].data.push(item?.value?.orderPayCount || 0) // 当前数量 } else { series[0].data.push(fenToYuan(item?.reference?.orderPayPrice || 0)) // 对照金额 series[1].data.push(fenToYuan(item?.value?.orderPayPrice || 0)) // 当前金额 diff --git a/src/views/mall/product/spu/form/ProductPropertyAddForm.vue b/src/views/mall/product/spu/form/ProductPropertyAddForm.vue index 9a8eee00..15c5a8d5 100644 --- a/src/views/mall/product/spu/form/ProductPropertyAddForm.vue +++ b/src/views/mall/product/spu/form/ProductPropertyAddForm.vue @@ -7,6 +7,7 @@ :model="formData" :rules="formRules" label-width="80px" + @keydown.enter.prevent="submitForm" > diff --git a/src/views/mall/promotion/kefu/components/KeFuChatBox.vue b/src/views/mall/promotion/kefu/components/KeFuChatBox.vue new file mode 100644 index 00000000..872de7ab --- /dev/null +++ b/src/views/mall/promotion/kefu/components/KeFuChatBox.vue @@ -0,0 +1,286 @@ + + + + + diff --git a/src/views/mall/promotion/kefu/components/KeFuConversationBox.vue b/src/views/mall/promotion/kefu/components/KeFuConversationBox.vue new file mode 100644 index 00000000..947a7ad6 --- /dev/null +++ b/src/views/mall/promotion/kefu/components/KeFuConversationBox.vue @@ -0,0 +1,230 @@ + + + + + diff --git a/src/views/mall/promotion/kefu/components/images/a.png b/src/views/mall/promotion/kefu/components/images/a.png new file mode 100644 index 00000000..32939004 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/a.png differ diff --git a/src/views/mall/promotion/kefu/components/images/aini.png b/src/views/mall/promotion/kefu/components/images/aini.png new file mode 100644 index 00000000..02cf5c49 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/aini.png differ diff --git a/src/views/mall/promotion/kefu/components/images/aixin.png b/src/views/mall/promotion/kefu/components/images/aixin.png new file mode 100644 index 00000000..25e64223 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/aixin.png differ diff --git a/src/views/mall/promotion/kefu/components/images/baiyan.png b/src/views/mall/promotion/kefu/components/images/baiyan.png new file mode 100644 index 00000000..d16260af Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/baiyan.png differ diff --git a/src/views/mall/promotion/kefu/components/images/bizui.png b/src/views/mall/promotion/kefu/components/images/bizui.png new file mode 100644 index 00000000..a3b18002 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/bizui.png differ diff --git a/src/views/mall/promotion/kefu/components/images/buhaoyisi.png b/src/views/mall/promotion/kefu/components/images/buhaoyisi.png new file mode 100644 index 00000000..54c4b3f7 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/buhaoyisi.png differ diff --git a/src/views/mall/promotion/kefu/components/images/bukesiyi.png b/src/views/mall/promotion/kefu/components/images/bukesiyi.png new file mode 100644 index 00000000..5f272e3e Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/bukesiyi.png differ diff --git a/src/views/mall/promotion/kefu/components/images/dajing.png b/src/views/mall/promotion/kefu/components/images/dajing.png new file mode 100644 index 00000000..8649727e Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/dajing.png differ diff --git a/src/views/mall/promotion/kefu/components/images/danao.png b/src/views/mall/promotion/kefu/components/images/danao.png new file mode 100644 index 00000000..aa85a294 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/danao.png differ diff --git a/src/views/mall/promotion/kefu/components/images/daxiao.png b/src/views/mall/promotion/kefu/components/images/daxiao.png new file mode 100644 index 00000000..26206bc0 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/daxiao.png differ diff --git a/src/views/mall/promotion/kefu/components/images/dianzan.png b/src/views/mall/promotion/kefu/components/images/dianzan.png new file mode 100644 index 00000000..2e7f00eb Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/dianzan.png differ diff --git a/src/views/mall/promotion/kefu/components/images/emo.png b/src/views/mall/promotion/kefu/components/images/emo.png new file mode 100644 index 00000000..9c845516 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/emo.png differ diff --git a/src/views/mall/promotion/kefu/components/images/esi.png b/src/views/mall/promotion/kefu/components/images/esi.png new file mode 100644 index 00000000..84e9726f Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/esi.png differ diff --git a/src/views/mall/promotion/kefu/components/images/fadai.png b/src/views/mall/promotion/kefu/components/images/fadai.png new file mode 100644 index 00000000..0772de26 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/fadai.png differ diff --git a/src/views/mall/promotion/kefu/components/images/fankun.png b/src/views/mall/promotion/kefu/components/images/fankun.png new file mode 100644 index 00000000..6e18dac3 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/fankun.png differ diff --git a/src/views/mall/promotion/kefu/components/images/feiwen.png b/src/views/mall/promotion/kefu/components/images/feiwen.png new file mode 100644 index 00000000..be976165 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/feiwen.png differ diff --git a/src/views/mall/promotion/kefu/components/images/fennu.png b/src/views/mall/promotion/kefu/components/images/fennu.png new file mode 100644 index 00000000..20c57338 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/fennu.png differ diff --git a/src/views/mall/promotion/kefu/components/images/ganga.png b/src/views/mall/promotion/kefu/components/images/ganga.png new file mode 100644 index 00000000..30ec329d Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/ganga.png differ diff --git a/src/views/mall/promotion/kefu/components/images/ganmao.png b/src/views/mall/promotion/kefu/components/images/ganmao.png new file mode 100644 index 00000000..35bbb89f Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/ganmao.png differ diff --git a/src/views/mall/promotion/kefu/components/images/hanyan.png b/src/views/mall/promotion/kefu/components/images/hanyan.png new file mode 100644 index 00000000..a0bc838b Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/hanyan.png differ diff --git a/src/views/mall/promotion/kefu/components/images/haochi.png b/src/views/mall/promotion/kefu/components/images/haochi.png new file mode 100644 index 00000000..2e52b6be Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/haochi.png differ diff --git a/src/views/mall/promotion/kefu/components/images/hongxin.png b/src/views/mall/promotion/kefu/components/images/hongxin.png new file mode 100644 index 00000000..65b5de8f Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/hongxin.png differ diff --git a/src/views/mall/promotion/kefu/components/images/huaixiao.png b/src/views/mall/promotion/kefu/components/images/huaixiao.png new file mode 100644 index 00000000..bc0e76c4 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/huaixiao.png differ diff --git a/src/views/mall/promotion/kefu/components/images/jingkong.png b/src/views/mall/promotion/kefu/components/images/jingkong.png new file mode 100644 index 00000000..7aa65845 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/jingkong.png differ diff --git a/src/views/mall/promotion/kefu/components/images/jingshu.png b/src/views/mall/promotion/kefu/components/images/jingshu.png new file mode 100644 index 00000000..0e984d68 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/jingshu.png differ diff --git a/src/views/mall/promotion/kefu/components/images/jingya.png b/src/views/mall/promotion/kefu/components/images/jingya.png new file mode 100644 index 00000000..9ba6bab3 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/jingya.png differ diff --git a/src/views/mall/promotion/kefu/components/images/kaixin.png b/src/views/mall/promotion/kefu/components/images/kaixin.png new file mode 100644 index 00000000..29c9f5dd Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/kaixin.png differ diff --git a/src/views/mall/promotion/kefu/components/images/keai.png b/src/views/mall/promotion/kefu/components/images/keai.png new file mode 100644 index 00000000..d3b582c6 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/keai.png differ diff --git a/src/views/mall/promotion/kefu/components/images/keshui.png b/src/views/mall/promotion/kefu/components/images/keshui.png new file mode 100644 index 00000000..cef489ea Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/keshui.png differ diff --git a/src/views/mall/promotion/kefu/components/images/kun.png b/src/views/mall/promotion/kefu/components/images/kun.png new file mode 100644 index 00000000..1ddc388a Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/kun.png differ diff --git a/src/views/mall/promotion/kefu/components/images/lengku.png b/src/views/mall/promotion/kefu/components/images/lengku.png new file mode 100644 index 00000000..c5c6feeb Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/lengku.png differ diff --git a/src/views/mall/promotion/kefu/components/images/liuhan.png b/src/views/mall/promotion/kefu/components/images/liuhan.png new file mode 100644 index 00000000..e6ddc6f4 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/liuhan.png differ diff --git a/src/views/mall/promotion/kefu/components/images/liukoushui.png b/src/views/mall/promotion/kefu/components/images/liukoushui.png new file mode 100644 index 00000000..3e2fba65 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/liukoushui.png differ diff --git a/src/views/mall/promotion/kefu/components/images/liulei.png b/src/views/mall/promotion/kefu/components/images/liulei.png new file mode 100644 index 00000000..dbf82040 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/liulei.png differ diff --git a/src/views/mall/promotion/kefu/components/images/mengbi.png b/src/views/mall/promotion/kefu/components/images/mengbi.png new file mode 100644 index 00000000..a4206eef Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/mengbi.png differ diff --git a/src/views/mall/promotion/kefu/components/images/mianwubiaoqing.png b/src/views/mall/promotion/kefu/components/images/mianwubiaoqing.png new file mode 100644 index 00000000..6f315b98 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/mianwubiaoqing.png differ diff --git a/src/views/mall/promotion/kefu/components/images/nanguo.png b/src/views/mall/promotion/kefu/components/images/nanguo.png new file mode 100644 index 00000000..19b9fb94 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/nanguo.png differ diff --git a/src/views/mall/promotion/kefu/components/images/outu.png b/src/views/mall/promotion/kefu/components/images/outu.png new file mode 100644 index 00000000..2f9a06d6 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/outu.png differ diff --git a/src/views/mall/promotion/kefu/components/images/picture.svg b/src/views/mall/promotion/kefu/components/images/picture.svg new file mode 100644 index 00000000..8811d495 --- /dev/null +++ b/src/views/mall/promotion/kefu/components/images/picture.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/src/views/mall/promotion/kefu/components/images/shengqi.png b/src/views/mall/promotion/kefu/components/images/shengqi.png new file mode 100644 index 00000000..7dce41dc Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/shengqi.png differ diff --git a/src/views/mall/promotion/kefu/components/images/shuizhuo.png b/src/views/mall/promotion/kefu/components/images/shuizhuo.png new file mode 100644 index 00000000..97d0f0a6 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/shuizhuo.png differ diff --git a/src/views/mall/promotion/kefu/components/images/tianshi.png b/src/views/mall/promotion/kefu/components/images/tianshi.png new file mode 100644 index 00000000..eb922dd7 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/tianshi.png differ diff --git a/src/views/mall/promotion/kefu/components/images/xiaodiaoya.png b/src/views/mall/promotion/kefu/components/images/xiaodiaoya.png new file mode 100644 index 00000000..29fbc0e1 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/xiaodiaoya.png differ diff --git a/src/views/mall/promotion/kefu/components/images/xiaoku.png b/src/views/mall/promotion/kefu/components/images/xiaoku.png new file mode 100644 index 00000000..88a169d4 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/xiaoku.png differ diff --git a/src/views/mall/promotion/kefu/components/images/xinsui.png b/src/views/mall/promotion/kefu/components/images/xinsui.png new file mode 100644 index 00000000..a0f572a1 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/xinsui.png differ diff --git a/src/views/mall/promotion/kefu/components/images/xiong.png b/src/views/mall/promotion/kefu/components/images/xiong.png new file mode 100644 index 00000000..43dfd709 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/xiong.png differ diff --git a/src/views/mall/promotion/kefu/components/images/yiwen.png b/src/views/mall/promotion/kefu/components/images/yiwen.png new file mode 100644 index 00000000..4c0da709 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/yiwen.png differ diff --git a/src/views/mall/promotion/kefu/components/images/yun.png b/src/views/mall/promotion/kefu/components/images/yun.png new file mode 100644 index 00000000..56e5d021 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/yun.png differ diff --git a/src/views/mall/promotion/kefu/components/images/ziya.png b/src/views/mall/promotion/kefu/components/images/ziya.png new file mode 100644 index 00000000..593ef5e6 Binary files /dev/null and b/src/views/mall/promotion/kefu/components/images/ziya.png differ diff --git a/src/views/mall/promotion/kefu/components/index.ts b/src/views/mall/promotion/kefu/components/index.ts new file mode 100644 index 00000000..65234629 --- /dev/null +++ b/src/views/mall/promotion/kefu/components/index.ts @@ -0,0 +1,4 @@ +import KeFuConversationBox from './KeFuConversationBox.vue' +import KeFuChatBox from './KeFuChatBox.vue' + +export { KeFuConversationBox, KeFuChatBox } diff --git a/src/views/mall/promotion/kefu/components/message/ImageMessageItem.vue b/src/views/mall/promotion/kefu/components/message/ImageMessageItem.vue new file mode 100644 index 00000000..c8d5f650 --- /dev/null +++ b/src/views/mall/promotion/kefu/components/message/ImageMessageItem.vue @@ -0,0 +1,39 @@ + + + diff --git a/src/views/mall/promotion/kefu/components/message/TextMessageItem.vue b/src/views/mall/promotion/kefu/components/message/TextMessageItem.vue new file mode 100644 index 00000000..fd4b6edb --- /dev/null +++ b/src/views/mall/promotion/kefu/components/message/TextMessageItem.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/views/mall/promotion/kefu/components/tools/EmojiSelectPopover.vue b/src/views/mall/promotion/kefu/components/tools/EmojiSelectPopover.vue new file mode 100644 index 00000000..116246a6 --- /dev/null +++ b/src/views/mall/promotion/kefu/components/tools/EmojiSelectPopover.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/views/mall/promotion/kefu/components/tools/PictureSelectUpload.vue b/src/views/mall/promotion/kefu/components/tools/PictureSelectUpload.vue new file mode 100644 index 00000000..481df591 --- /dev/null +++ b/src/views/mall/promotion/kefu/components/tools/PictureSelectUpload.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/src/views/mall/promotion/kefu/components/tools/constants.ts b/src/views/mall/promotion/kefu/components/tools/constants.ts new file mode 100644 index 00000000..e171e363 --- /dev/null +++ b/src/views/mall/promotion/kefu/components/tools/constants.ts @@ -0,0 +1,16 @@ +// 客服消息类型枚举类 +export const KeFuMessageContentTypeEnum = { + TEXT: 1, // 文本消息 + IMAGE: 2, // 图片消息 + VOICE: 3, // 语音消息 + VIDEO: 4, // 视频消息 + SYSTEM: 5, // 系统消息 + // ========== 商城特殊消息 ========== + PRODUCT: 10, // 商品消息 + ORDER: 11 // 订单消息" +} +// Promotion 的 WebSocket 消息类型枚举类 +export const WebSocketMessageTypeConstants = { + KEFU_MESSAGE_TYPE: 'kefu_message_type', // 客服消息类型 + KEFU_MESSAGE_ADMIN_READ: 'kefu_message_read_status_change' // 客服消息管理员已读 +} diff --git a/src/views/mall/promotion/kefu/components/tools/emoji.ts b/src/views/mall/promotion/kefu/components/tools/emoji.ts new file mode 100644 index 00000000..449f51c0 --- /dev/null +++ b/src/views/mall/promotion/kefu/components/tools/emoji.ts @@ -0,0 +1,115 @@ +import { isEmpty } from '@/utils/is' + +const emojiList = [ + { name: '[笑掉牙]', file: 'xiaodiaoya.png' }, + { name: '[可爱]', file: 'keai.png' }, + { name: '[冷酷]', file: 'lengku.png' }, + { name: '[闭嘴]', file: 'bizui.png' }, + { name: '[生气]', file: 'shengqi.png' }, + { name: '[惊恐]', file: 'jingkong.png' }, + { name: '[瞌睡]', file: 'keshui.png' }, + { name: '[大笑]', file: 'daxiao.png' }, + { name: '[爱心]', file: 'aixin.png' }, + { name: '[坏笑]', file: 'huaixiao.png' }, + { name: '[飞吻]', file: 'feiwen.png' }, + { name: '[疑问]', file: 'yiwen.png' }, + { name: '[开心]', file: 'kaixin.png' }, + { name: '[发呆]', file: 'fadai.png' }, + { name: '[流泪]', file: 'liulei.png' }, + { name: '[汗颜]', file: 'hanyan.png' }, + { name: '[惊悚]', file: 'jingshu.png' }, + { name: '[困~]', file: 'kun.png' }, + { name: '[心碎]', file: 'xinsui.png' }, + { name: '[天使]', file: 'tianshi.png' }, + { name: '[晕]', file: 'yun.png' }, + { name: '[啊]', file: 'a.png' }, + { name: '[愤怒]', file: 'fennu.png' }, + { name: '[睡着]', file: 'shuizhuo.png' }, + { name: '[面无表情]', file: 'mianwubiaoqing.png' }, + { name: '[难过]', file: 'nanguo.png' }, + { name: '[犯困]', file: 'fankun.png' }, + { name: '[好吃]', file: 'haochi.png' }, + { name: '[呕吐]', file: 'outu.png' }, + { name: '[龇牙]', file: 'ziya.png' }, + { name: '[懵比]', file: 'mengbi.png' }, + { name: '[白眼]', file: 'baiyan.png' }, + { name: '[饿死]', file: 'esi.png' }, + { name: '[凶]', file: 'xiong.png' }, + { name: '[感冒]', file: 'ganmao.png' }, + { name: '[流汗]', file: 'liuhan.png' }, + { name: '[笑哭]', file: 'xiaoku.png' }, + { name: '[流口水]', file: 'liukoushui.png' }, + { name: '[尴尬]', file: 'ganga.png' }, + { name: '[惊讶]', file: 'jingya.png' }, + { name: '[大惊]', file: 'dajing.png' }, + { name: '[不好意思]', file: 'buhaoyisi.png' }, + { name: '[大闹]', file: 'danao.png' }, + { name: '[不可思议]', file: 'bukesiyi.png' }, + { name: '[爱你]', file: 'aini.png' }, + { name: '[红心]', file: 'hongxin.png' }, + { name: '[点赞]', file: 'dianzan.png' }, + { name: '[恶魔]', file: 'emo.png' } +] + +export interface Emoji { + name: string + url: string +} + +export const useEmoji = () => { + const emojiPathList = ref([]) + // 加载本地图片 + const getStaticEmojiPath = async () => { + const pathList = import.meta.glob( + '@/views/mall/promotion/kefu/components/images/*.{png,jpg,jpeg,svg}' + ) + for (const path in pathList) { + const imageModule: any = await pathList[path]() + emojiPathList.value.push(imageModule.default) + } + } + // 初始化 + onMounted(async () => { + if (isEmpty(emojiPathList.value)) { + await getStaticEmojiPath() + } + }) + + // 处理表情 + function replaceEmoji(data: string) { + let newData = data + if (typeof newData !== 'object') { + const reg = /\[(.+?)\]/g // [] 中括号 + const zhEmojiName = newData.match(reg) + if (zhEmojiName) { + zhEmojiName.forEach((item) => { + const emojiFile = selEmojiFile(item) + newData = newData.replace( + item, + `` + ) + }) + } + } + return newData + } + + // 获得所有表情 + function getEmojiList(): Emoji[] { + return emojiList.map((item) => ({ + url: selEmojiFile(item.name), + name: item.name + })) as Emoji[] + } + + function selEmojiFile(name: string) { + for (const emoji of emojiList) { + if (emoji.name === name) { + return emojiPathList.value.find((item: string) => item.indexOf(emoji.file) > -1) + } + } + return false + } + + return { replaceEmoji, getEmojiList } +} diff --git a/src/views/mall/promotion/kefu/index.vue b/src/views/mall/promotion/kefu/index.vue new file mode 100644 index 00000000..4eb5d240 --- /dev/null +++ b/src/views/mall/promotion/kefu/index.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/views/mall/trade/afterSale/index.vue b/src/views/mall/trade/afterSale/index.vue index 23ff967f..52051c35 100644 --- a/src/views/mall/trade/afterSale/index.vue +++ b/src/views/mall/trade/afterSale/index.vue @@ -246,7 +246,7 @@ const openAfterSaleDetail = (id: number) => { /** 查看订单详情 */ const openOrderDetail = (id: number) => { - push({ name: 'TradeOrderDetail', params: { orderId: id } }) + push({ name: 'TradeOrderDetail', params: { id } }) } /** 商品图预览 */ diff --git a/src/views/member/user/detail/UserOrderList.vue b/src/views/member/user/detail/UserOrderList.vue index b6870bc3..bae0bf0d 100644 --- a/src/views/member/user/detail/UserOrderList.vue +++ b/src/views/member/user/detail/UserOrderList.vue @@ -267,7 +267,7 @@ const getList = async () => { /** 查看订单详情 */ const openDetail = (id: number) => { - push({ name: 'TradeOrderDetail', params: { orderId: id } }) + push({ name: 'TradeOrderDetail', params: { id } }) } /** 初始化 **/ diff --git a/src/views/mp/account/index.vue b/src/views/mp/account/index.vue index 212035a2..65517070 100644 --- a/src/views/mp/account/index.vue +++ b/src/views/mp/account/index.vue @@ -37,7 +37,7 @@ diff --git a/src/views/pay/app/components/channel/WeixinChannelForm.vue b/src/views/pay/app/components/channel/WeixinChannelForm.vue index 34e92c69..cfd46bc0 100644 --- a/src/views/pay/app/components/channel/WeixinChannelForm.vue +++ b/src/views/pay/app/components/channel/WeixinChannelForm.vue @@ -80,7 +80,8 @@ :http-request="keyContentUpload" > - 点击上传 + + 点击上传 @@ -120,7 +121,8 @@ :http-request="privateKeyContentUpload" > - 点击上传 + + 点击上传 @@ -148,7 +150,8 @@ :http-request="privateCertContentUpload" > - 点击上传 + + 点击上传 @@ -310,7 +313,7 @@ const pemFileBeforeUpload = (file) => { /** * 读取 apiclient_key.pem 到 privateKeyContent 字段 */ -const privateKeyContentUpload = (event) => { +const privateKeyContentUpload = async (event) => { const readFile = new FileReader() readFile.onload = (e: any) => { formData.value.config.privateKeyContent = e.target.result @@ -321,7 +324,7 @@ const privateKeyContentUpload = (event) => { /** * 读取 apiclient_cert.pem 到 privateCertContent 字段 */ -const privateCertContentUpload = (event) => { +const privateCertContentUpload = async (event) => { const readFile = new FileReader() readFile.onload = (e: any) => { formData.value.config.privateCertContent = e.target.result @@ -332,7 +335,7 @@ const privateCertContentUpload = (event) => { /** * 读取 apiclient_cert.p12 到 keyContent 字段 */ -const keyContentUpload = (event) => { +const keyContentUpload = async (event) => { const readFile = new FileReader() readFile.onload = (e: any) => { formData.value.config.keyContent = e.target.result.split(',')[1] diff --git a/src/views/pay/app/index.vue b/src/views/pay/app/index.vue index 2f4a9c1e..6b60d9b1 100644 --- a/src/views/pay/app/index.vue +++ b/src/views/pay/app/index.vue @@ -45,10 +45,17 @@ /> - 搜索 - 重置 + + + 搜索 + + + + 重置 + - 新增 + + 新增 @@ -70,12 +77,17 @@ - + - - - - - - - - - - - -