{
userId: 283,
userAvatar:
'https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKMezSxtOImrC9lbhwHiazYwck3xwrEcO7VJfG6WQo260whaeVNoByE5RreiaGsGfOMlIiaDhSaA991w/132',
- nickname: '辉辉鸭' + i,
+ userNickname: '辉辉鸭' + i,
lastMessageTime: getNowDateTime(),
lastMessageContent: '[爱心][爱心]你好哇',
lastMessageContentType: 1,
@@ -54,12 +54,12 @@ const getConversationList = async () => {
}
defineExpose({ getConversationList })
const emits = defineEmits<{
- (e: 'change', v: number): void
+ (e: 'change', v: KeFuConversationRespVO): void
}>()
// 打开右侧消息
const openRightMessage = (item: KeFuConversationRespVO, index: number) => {
activeConversationIndex.value = index
- emits('change', item.id)
+ emits('change', item)
}
diff --git a/src/views/mall/promotion/kefu/components/KefuChatBox.vue b/src/views/mall/promotion/kefu/components/KefuChatBox.vue
deleted file mode 100644
index 394c8424..00000000
--- a/src/views/mall/promotion/kefu/components/KefuChatBox.vue
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
- 芋道
-
-
-
-
-
Lorem Ipsum,也称乱数假文或者哑元文本
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/mall/promotion/kefu/components/constants.ts b/src/views/mall/promotion/kefu/components/constants.ts
index 015b46a7..f8599160 100644
--- a/src/views/mall/promotion/kefu/components/constants.ts
+++ b/src/views/mall/promotion/kefu/components/constants.ts
@@ -8,7 +8,3 @@ export const KeFuMessageContentTypeEnum = {
PRODUCT: 10, // 商品消息
ORDER: 11 // 订单消息"
}
-export const UserTypeEnum = {
- MEMBER: 1, // 会员 面向 c 端,普通用户
- ADMIN: 2 // 管理员 面向 b 端,管理后台
-}
diff --git a/src/views/mall/promotion/kefu/components/index.ts b/src/views/mall/promotion/kefu/components/index.ts
index afd2fd76..fcf6bd5b 100644
--- a/src/views/mall/promotion/kefu/components/index.ts
+++ b/src/views/mall/promotion/kefu/components/index.ts
@@ -1,5 +1,5 @@
import KeFuConversationBox from './KeFuConversationBox.vue'
-import KeFuChatBox from './KefuChatBox.vue'
+import KeFuChatBox from './KeFuChatBox.vue'
import * as Constants from './constants'
export { KeFuConversationBox, KeFuChatBox, Constants }
diff --git a/src/views/mall/promotion/kefu/index.vue b/src/views/mall/promotion/kefu/index.vue
index 52c6f2ba..1204b8dc 100644
--- a/src/views/mall/promotion/kefu/index.vue
+++ b/src/views/mall/promotion/kefu/index.vue
@@ -15,12 +15,17 @@
diff --git a/src/views/ai/image/manager/index.vue b/src/views/ai/image/manager/index.vue
index f0e94faa..84403f35 100644
--- a/src/views/ai/image/manager/index.vue
+++ b/src/views/ai/image/manager/index.vue
@@ -121,7 +121,7 @@
:active-value="true"
:inactive-value="false"
@change="handleUpdatePublicStatusChange(scope.row)"
- :disabled="scope.row.status !== 20"
+ :disabled="scope.row.status !== AiImageStatusEnum.SUCCESS"
/>
@@ -165,6 +165,7 @@ import { getIntDictOptions, DICT_TYPE, getStrDictOptions, getBoolDictOptions } f
import { dateFormatter } from '@/utils/formatTime'
import { ImageApi, ImageVO } from '@/api/ai/image'
import * as UserApi from '@/api/system/user'
+import { AiImageStatusEnum } from '@/views/ai/utils/constants'
/** AI 绘画 列表 */
defineOptions({ name: 'AiImageManager' })
diff --git a/src/views/ai/music/manager/index.vue b/src/views/ai/music/manager/index.vue
index ec3c12b0..342f8dd8 100644
--- a/src/views/ai/music/manager/index.vue
+++ b/src/views/ai/music/manager/index.vue
@@ -158,7 +158,7 @@
:active-value="true"
:inactive-value="false"
@change="handleUpdatePublicStatusChange(scope.row)"
- :disabled="scope.row.status !== 20"
+ :disabled="scope.row.status !== AiMusicStatusEnum.SUCCESS"
/>
@@ -199,6 +199,7 @@ import { getIntDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import { MusicApi, MusicVO } from '@/api/ai/music'
import * as UserApi from '@/api/system/user'
+import { AiMusicStatusEnum } from '@/views/ai/utils/constants'
/** AI 音乐 列表 */
defineOptions({ name: 'AiMusicManager' })
diff --git a/src/views/ai/utils/constants.ts b/src/views/ai/utils/constants.ts
new file mode 100644
index 00000000..2e7b9ac5
--- /dev/null
+++ b/src/views/ai/utils/constants.ts
@@ -0,0 +1,41 @@
+/**
+ * Created by 芋道源码
+ *
+ * AI 枚举类
+ *
+ * 问题:为什么不放在 src/utils/constants.ts 呢?
+ * 回答:主要 AI 是可选模块,考虑到独立、解耦,所以放在了 /views/ai/utils/constants.ts
+ */
+
+/**
+ * AI 平台的枚举
+ */
+export const AiPlatformEnum = {
+ OPENAI: 'OpenAI',
+ Ollama: 'Ollama',
+ YI_YAN: 'YiYan', // 百度
+ XING_HUO: 'XingHuo', // 讯飞
+ QIAN_WEN: 'QianWen', // 阿里
+ GEMIR: 'gemir', // 谷歌
+ 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 // 已失败
+}
From b0b62eb2506d80726f22505a8109f5d4a28ee87c Mon Sep 17 00:00:00 2001
From: puhui999
Date: Wed, 3 Jul 2024 17:51:58 +0800
Subject: [PATCH 54/86] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?=
=?UTF-8?q?=EF=BC=9Amall=20=E5=AE=A2=E6=9C=8D=E8=A1=A8=E6=83=85=E5=8C=85?=
=?UTF-8?q?=E5=AD=98=E6=94=BE=E5=88=B0=E6=9C=AC=E5=9C=B0=E4=BD=BF=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.local | 4 -
.../kefu/components/EmojiSelectPopover.vue | 3 +-
.../promotion/kefu/components/KeFuChatBox.vue | 4 +-
.../kefu/components/KeFuConversationBox.vue | 3 +-
.../mall/promotion/kefu/components/emoji.ts | 101 ++++++++++--------
.../promotion/kefu/components/images/a.png | Bin 0 -> 4237 bytes
.../promotion/kefu/components/images/aini.png | Bin 0 -> 2309 bytes
.../kefu/components/images/aixin.png | Bin 0 -> 4431 bytes
.../kefu/components/images/baiyan.png | Bin 0 -> 3792 bytes
.../kefu/components/images/bizui.png | Bin 0 -> 3768 bytes
.../kefu/components/images/buhaoyisi.png | Bin 0 -> 4443 bytes
.../kefu/components/images/bukesiyi.png | Bin 0 -> 3979 bytes
.../kefu/components/images/dajing.png | Bin 0 -> 4298 bytes
.../kefu/components/images/danao.png | Bin 0 -> 4568 bytes
.../kefu/components/images/daxiao.png | Bin 0 -> 4382 bytes
.../kefu/components/images/dianzan.png | Bin 0 -> 1878 bytes
.../promotion/kefu/components/images/emo.png | Bin 0 -> 4956 bytes
.../promotion/kefu/components/images/esi.png | Bin 0 -> 3873 bytes
.../kefu/components/images/fadai.png | Bin 0 -> 3823 bytes
.../kefu/components/images/fankun.png | Bin 0 -> 4236 bytes
.../kefu/components/images/feiwen.png | Bin 0 -> 6873 bytes
.../kefu/components/images/fennu.png | Bin 0 -> 4590 bytes
.../kefu/components/images/ganga.png | Bin 0 -> 4396 bytes
.../kefu/components/images/ganmao.png | Bin 0 -> 4727 bytes
.../kefu/components/images/hanyan.png | Bin 0 -> 2966 bytes
.../kefu/components/images/haochi.png | Bin 0 -> 3794 bytes
.../kefu/components/images/hongxin.png | Bin 0 -> 3844 bytes
.../kefu/components/images/huaixiao.png | Bin 0 -> 4234 bytes
.../kefu/components/images/jingkong.png | Bin 0 -> 4272 bytes
.../kefu/components/images/jingshu.png | Bin 0 -> 4702 bytes
.../kefu/components/images/jingya.png | Bin 0 -> 4167 bytes
.../kefu/components/images/kaixin.png | Bin 0 -> 4008 bytes
.../promotion/kefu/components/images/keai.png | Bin 0 -> 4060 bytes
.../kefu/components/images/keshui.png | Bin 0 -> 3975 bytes
.../promotion/kefu/components/images/kun.png | Bin 0 -> 4460 bytes
.../kefu/components/images/lengku.png | Bin 0 -> 4630 bytes
.../kefu/components/images/liuhan.png | Bin 0 -> 3823 bytes
.../kefu/components/images/liukoushui.png | Bin 0 -> 4072 bytes
.../kefu/components/images/liulei.png | Bin 0 -> 4246 bytes
.../kefu/components/images/mengbi.png | Bin 0 -> 3345 bytes
.../kefu/components/images/mianwubiaoqing.png | Bin 0 -> 2928 bytes
.../kefu/components/images/nanguo.png | Bin 0 -> 3882 bytes
.../promotion/kefu/components/images/outu.png | Bin 0 -> 4403 bytes
.../kefu/components/images/shengqi.png | Bin 0 -> 4629 bytes
.../kefu/components/images/shuizhuo.png | Bin 0 -> 4641 bytes
.../kefu/components/images/tianshi.png | Bin 0 -> 4192 bytes
.../kefu/components/images/xiaodiaoya.png | Bin 0 -> 4326 bytes
.../kefu/components/images/xiaoku.png | Bin 0 -> 4725 bytes
.../kefu/components/images/xinsui.png | Bin 0 -> 4377 bytes
.../kefu/components/images/xiong.png | Bin 0 -> 4525 bytes
.../kefu/components/images/yiwen.png | Bin 0 -> 4615 bytes
.../promotion/kefu/components/images/yun.png | Bin 0 -> 5991 bytes
.../promotion/kefu/components/images/ziya.png | Bin 0 -> 4126 bytes
53 files changed, 62 insertions(+), 53 deletions(-)
create mode 100644 src/views/mall/promotion/kefu/components/images/a.png
create mode 100644 src/views/mall/promotion/kefu/components/images/aini.png
create mode 100644 src/views/mall/promotion/kefu/components/images/aixin.png
create mode 100644 src/views/mall/promotion/kefu/components/images/baiyan.png
create mode 100644 src/views/mall/promotion/kefu/components/images/bizui.png
create mode 100644 src/views/mall/promotion/kefu/components/images/buhaoyisi.png
create mode 100644 src/views/mall/promotion/kefu/components/images/bukesiyi.png
create mode 100644 src/views/mall/promotion/kefu/components/images/dajing.png
create mode 100644 src/views/mall/promotion/kefu/components/images/danao.png
create mode 100644 src/views/mall/promotion/kefu/components/images/daxiao.png
create mode 100644 src/views/mall/promotion/kefu/components/images/dianzan.png
create mode 100644 src/views/mall/promotion/kefu/components/images/emo.png
create mode 100644 src/views/mall/promotion/kefu/components/images/esi.png
create mode 100644 src/views/mall/promotion/kefu/components/images/fadai.png
create mode 100644 src/views/mall/promotion/kefu/components/images/fankun.png
create mode 100644 src/views/mall/promotion/kefu/components/images/feiwen.png
create mode 100644 src/views/mall/promotion/kefu/components/images/fennu.png
create mode 100644 src/views/mall/promotion/kefu/components/images/ganga.png
create mode 100644 src/views/mall/promotion/kefu/components/images/ganmao.png
create mode 100644 src/views/mall/promotion/kefu/components/images/hanyan.png
create mode 100644 src/views/mall/promotion/kefu/components/images/haochi.png
create mode 100644 src/views/mall/promotion/kefu/components/images/hongxin.png
create mode 100644 src/views/mall/promotion/kefu/components/images/huaixiao.png
create mode 100644 src/views/mall/promotion/kefu/components/images/jingkong.png
create mode 100644 src/views/mall/promotion/kefu/components/images/jingshu.png
create mode 100644 src/views/mall/promotion/kefu/components/images/jingya.png
create mode 100644 src/views/mall/promotion/kefu/components/images/kaixin.png
create mode 100644 src/views/mall/promotion/kefu/components/images/keai.png
create mode 100644 src/views/mall/promotion/kefu/components/images/keshui.png
create mode 100644 src/views/mall/promotion/kefu/components/images/kun.png
create mode 100644 src/views/mall/promotion/kefu/components/images/lengku.png
create mode 100644 src/views/mall/promotion/kefu/components/images/liuhan.png
create mode 100644 src/views/mall/promotion/kefu/components/images/liukoushui.png
create mode 100644 src/views/mall/promotion/kefu/components/images/liulei.png
create mode 100644 src/views/mall/promotion/kefu/components/images/mengbi.png
create mode 100644 src/views/mall/promotion/kefu/components/images/mianwubiaoqing.png
create mode 100644 src/views/mall/promotion/kefu/components/images/nanguo.png
create mode 100644 src/views/mall/promotion/kefu/components/images/outu.png
create mode 100644 src/views/mall/promotion/kefu/components/images/shengqi.png
create mode 100644 src/views/mall/promotion/kefu/components/images/shuizhuo.png
create mode 100644 src/views/mall/promotion/kefu/components/images/tianshi.png
create mode 100644 src/views/mall/promotion/kefu/components/images/xiaodiaoya.png
create mode 100644 src/views/mall/promotion/kefu/components/images/xiaoku.png
create mode 100644 src/views/mall/promotion/kefu/components/images/xinsui.png
create mode 100644 src/views/mall/promotion/kefu/components/images/xiong.png
create mode 100644 src/views/mall/promotion/kefu/components/images/yiwen.png
create mode 100644 src/views/mall/promotion/kefu/components/images/yun.png
create mode 100644 src/views/mall/promotion/kefu/components/images/ziya.png
diff --git a/.env.local b/.env.local
index 82a3f72a..005d2f0d 100644
--- a/.env.local
+++ b/.env.local
@@ -29,9 +29,5 @@ VITE_BASE_PATH=/
# 商城H5会员端域名
VITE_MALL_H5_DOMAIN='http://localhost:3000'
-# TODO puhui999:这个可以不走 cdn 地址么?
-# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀
-VITE_STATIC_URL = https://file.sheepjs.com
-
# 验证码的开关
VITE_APP_CAPTCHA_ENABLE=false
diff --git a/src/views/mall/promotion/kefu/components/EmojiSelectPopover.vue b/src/views/mall/promotion/kefu/components/EmojiSelectPopover.vue
index 03a963c6..4c777efb 100644
--- a/src/views/mall/promotion/kefu/components/EmojiSelectPopover.vue
+++ b/src/views/mall/promotion/kefu/components/EmojiSelectPopover.vue
@@ -26,8 +26,9 @@
diff --git a/src/views/mall/promotion/kefu/components/constants.ts b/src/views/mall/promotion/kefu/components/tools/constants.ts
similarity index 100%
rename from src/views/mall/promotion/kefu/components/constants.ts
rename to src/views/mall/promotion/kefu/components/tools/constants.ts
diff --git a/src/views/mall/promotion/kefu/components/emoji.ts b/src/views/mall/promotion/kefu/components/tools/emoji.ts
similarity index 100%
rename from src/views/mall/promotion/kefu/components/emoji.ts
rename to src/views/mall/promotion/kefu/components/tools/emoji.ts
From e89b274e3f66d8c0ac539b62e22f00d4577290e0 Mon Sep 17 00:00:00 2001
From: puhui999
Date: Thu, 4 Jul 2024 15:41:15 +0800
Subject: [PATCH 66/86] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?=
=?UTF-8?q?=EF=BC=9Amall=20=E5=AE=A2=E6=9C=8D=E6=B6=88=E6=81=AF=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E6=8A=BD=E7=A6=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../promotion/kefu/components/KeFuChatBox.vue | 52 +++----------------
.../components/message/ImageMessageItem.vue | 40 ++++++++++++++
.../components/message/TextMessageItem.vue | 29 +++++++++++
3 files changed, 76 insertions(+), 45 deletions(-)
create mode 100644 src/views/mall/promotion/kefu/components/message/ImageMessageItem.vue
create mode 100644 src/views/mall/promotion/kefu/components/message/TextMessageItem.vue
diff --git a/src/views/mall/promotion/kefu/components/KeFuChatBox.vue b/src/views/mall/promotion/kefu/components/KeFuChatBox.vue
index cba5869b..da25c9d9 100644
--- a/src/views/mall/promotion/kefu/components/KeFuChatBox.vue
+++ b/src/views/mall/promotion/kefu/components/KeFuChatBox.vue
@@ -19,49 +19,18 @@
class="flex mb-20px w-[100%]"
>
@@ -94,14 +63,14 @@ import { KeFuMessageApi, KeFuMessageRespVO } from '@/api/mall/promotion/kefu/mes
import { KeFuConversationRespVO } from '@/api/mall/promotion/kefu/conversation'
import EmojiSelectPopover from './tools/EmojiSelectPopover.vue'
import PictureSelectUpload from './tools/PictureSelectUpload.vue'
-import { Emoji, useEmoji } from './tools/emoji'
+import TextMessageItem from './message/TextMessageItem.vue'
+import ImageMessageItem from './message/ImageMessageItem.vue'
+import { Emoji } from './tools/emoji'
import { KeFuMessageContentTypeEnum } from './tools/constants'
import { isEmpty } from '@/utils/is'
import { UserTypeEnum } from '@/utils/constants'
-import { createImageViewer } from '@/components/ImageViewer'
defineOptions({ name: 'KeFuMessageBox' })
-const { replaceEmoji } = useEmoji()
const messageTool = useMessage()
const message = ref('') // 消息
const messageList = ref([]) // 消息列表
@@ -175,13 +144,6 @@ const scrollToBottom = async () => {
scrollbarRef.value!.setScrollTop(innerRef.value!.clientHeight)
}
-/** 图预览 */
-const imagePreview = (imgUrl: string) => {
- createImageViewer({
- urlList: [imgUrl]
- })
-}
-
// TODO puhui999: 轮训相关,功能完善后移除
onBeforeUnmount(() => {
if (!poller.value) {
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..7b890cf1
--- /dev/null
+++ b/src/views/mall/promotion/kefu/components/message/ImageMessageItem.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
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 @@
+
+
+
+
+
+
+
+
From b6ff9ede11107e22c27daf8f95f5939b30f8f2f3 Mon Sep 17 00:00:00 2001
From: cherishsince
Date: Thu, 4 Jul 2024 16:01:08 +0800
Subject: [PATCH 67/86] =?UTF-8?q?=E3=80=90=E8=A7=A3=E5=86=B3todo=E3=80=91h?=
=?UTF-8?q?andle=E5=91=BD=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/ai/image/ImageDetailDrawer.vue | 10 +++----
src/views/ai/image/ImageTask.vue | 20 +++++++-------
src/views/ai/image/ImageTaskCard.vue | 20 +++++++-------
src/views/ai/image/dall3/index.vue | 27 +++++++++----------
src/views/ai/image/index.vue | 14 +++++-----
src/views/ai/image/midjourney/index.vue | 25 +++++++++--------
src/views/ai/image/stable-diffusion/index.vue | 2 +-
7 files changed, 57 insertions(+), 61 deletions(-)
diff --git a/src/views/ai/image/ImageDetailDrawer.vue b/src/views/ai/image/ImageDetailDrawer.vue
index fca087da..95ec146c 100644
--- a/src/views/ai/image/ImageDetailDrawer.vue
+++ b/src/views/ai/image/ImageDetailDrawer.vue
@@ -2,7 +2,7 @@
@@ -79,8 +79,8 @@ const props = defineProps({
})
/** 抽屉 - close */
-const handlerDrawerClose = async () => {
- emits('handlerDrawerClose')
+const handleDrawerClose = async () => {
+ emits('handleDrawerClose')
}
/** 获取 - 图片 detail */
@@ -90,7 +90,7 @@ const getImageDetail = async (id) => {
}
/** 任务 - detail */
-const handlerTaskDetail = async () => {
+const handleTaskDetail = async () => {
showDrawer.value = true
}
@@ -107,7 +107,7 @@ watch(id, async (newVal, oldVal) => {
}
})
//
-const emits = defineEmits(['handlerDrawerClose'])
+const emits = defineEmits(['handleDrawerClose'])
//
onMounted(async () => {})
diff --git a/src/views/ai/image/ImageTask.vue b/src/views/ai/image/ImageTask.vue
index 9ddd7461..b4cbd253 100644
--- a/src/views/ai/image/ImageTask.vue
+++ b/src/views/ai/image/ImageTask.vue
@@ -6,8 +6,8 @@
v-for="image in imageList"
:key="image"
:image-detail="image"
- @on-btn-click="handlerImageBtnClick"
- @on-mj-btn-click="handlerImageMjBtnClick"
+ @on-btn-click="handleImageBtnClick"
+ @on-mj-btn-click="handleImageMjBtnClick"
/>
diff --git a/src/views/ai/image/dall3/index.vue b/src/views/ai/image/dall3/index.vue
index 69e767a3..1751eace 100644
--- a/src/views/ai/image/dall3/index.vue
+++ b/src/views/ai/image/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 }}
@@ -45,7 +45,7 @@