diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index 3f20b0f03..847d65725 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -44,7 +44,6 @@ "@vben/types": "workspace:*", "@vben/utils": "workspace:*", "@videojs-player/vue": "catalog:", - "@vueuse/components": "catalog:", "@vueuse/core": "catalog:", "@vueuse/integrations": "catalog:", "ant-design-vue": "catalog:", diff --git a/apps/web-antd/src/api/mall/promotion/kefu/conversation/index.ts b/apps/web-antd/src/api/mall/promotion/kefu/conversation/index.ts index 6510dc0ec..497bd1a50 100644 --- a/apps/web-antd/src/api/mall/promotion/kefu/conversation/index.ts +++ b/apps/web-antd/src/api/mall/promotion/kefu/conversation/index.ts @@ -1,5 +1,3 @@ -import type { PageResult } from '@vben/request'; - import { requestClient } from '#/api/request'; export namespace MallKefuConversationApi { @@ -28,7 +26,7 @@ export namespace MallKefuConversationApi { /** 获得客服会话列表 */ export function getConversationList() { - return requestClient.get>( + return requestClient.get( '/promotion/kefu-conversation/list', ); } diff --git a/apps/web-antd/src/plugins/form-create/index.ts b/apps/web-antd/src/plugins/form-create/index.ts index e13f1c1f7..db60c0f51 100644 --- a/apps/web-antd/src/plugins/form-create/index.ts +++ b/apps/web-antd/src/plugins/form-create/index.ts @@ -96,7 +96,6 @@ export function setupFormCreate(app: App) { components.forEach((component) => { app.component(component.name as string, component); }); - // TODO @xingyu:这里为啥 app.component('AMessage', message); 看官方是没有的; 需要额外引入 app.component('AMessage', message); formCreate.use(install); app.use(formCreate); diff --git a/apps/web-antd/src/store/mall/kefu.ts b/apps/web-antd/src/store/mall/kefu.ts index 85f4023e7..6fe0b6c25 100644 --- a/apps/web-antd/src/store/mall/kefu.ts +++ b/apps/web-antd/src/store/mall/kefu.ts @@ -5,7 +5,10 @@ import { isEmpty } from '@vben/utils'; import { acceptHMRUpdate, defineStore } from 'pinia'; -import * as KeFuConversationApi from '#/api/mall/promotion/kefu/conversation'; +import { + getConversation, + getConversationList, +} from '#/api/mall/promotion/kefu/conversation'; interface MallKefuInfoVO { conversationList: MallKefuConversationApi.Conversation[]; // 会话列表 @@ -41,9 +44,7 @@ export const useMallKefuStore = defineStore('mall-kefu', { // ======================= 会话相关 ======================= /** 加载会话缓存列表 */ async setConversationList() { - // TODO @jave:idea linter 告警,修复下; - // TODO @jave:不使用 KeFuConversationApi.,直接用 getConversationList - this.conversationList = await KeFuConversationApi.getConversationList(); + this.conversationList = await getConversationList(); this.conversationSort(); }, /** 更新会话缓存已读 */ @@ -51,8 +52,11 @@ export const useMallKefuStore = defineStore('mall-kefu', { if (isEmpty(this.conversationList)) { return; } - const conversation = this.conversationList.find( - (item) => item.id === conversationId, + const conversationList = this + .conversationList as MallKefuConversationApi.Conversation[]; + const conversation = conversationList.find( + (item: MallKefuConversationApi.Conversation) => + item.id === conversationId, ); conversation && (conversation.adminUnreadMessageCount = 0); }, @@ -62,10 +66,16 @@ export const useMallKefuStore = defineStore('mall-kefu', { return; } - const conversation = - await KeFuConversationApi.getConversation(conversationId); + const conversation = await getConversation(conversationId); this.deleteConversation(conversationId); - conversation && this.conversationList.push(conversation); + if (conversation && this.conversationList) { + const conversationList = this + .conversationList as MallKefuConversationApi.Conversation[]; + this.conversationList = [ + ...conversationList, + conversation as MallKefuConversationApi.Conversation, + ]; + } this.conversationSort(); }, /** 删除会话缓存 */ diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/property.vue index fc830eed8..3d0412309 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/property.vue @@ -25,7 +25,7 @@ import { Typography, } from 'ant-design-vue'; -import * as CouponTemplateApi from '#/api/mall/promotion/coupon/couponTemplate'; +import { getCouponTemplateList } from '#/api/mall/promotion/coupon/couponTemplate'; import UploadImg from '#/components/upload/image-upload.vue'; import { ColorInput } from '#/views/mall/promotion/components'; import CouponSelect from '#/views/mall/promotion/coupon/components/select.vue'; @@ -66,9 +66,7 @@ watch( () => formData.value.couponIds, async () => { if (formData.value.couponIds?.length > 0) { - couponList.value = await CouponTemplateApi.getCouponTemplateList( - formData.value.couponIds, - ); + couponList.value = await getCouponTemplateList(formData.value.couponIds); } }, { diff --git a/apps/web-antd/src/views/member/level/index.vue b/apps/web-antd/src/views/member/level/index.vue index b18b53caa..f3032f835 100644 --- a/apps/web-antd/src/views/member/level/index.vue +++ b/apps/web-antd/src/views/member/level/index.vue @@ -82,10 +82,12 @@ const [Grid, gridApi] = useVbenVxeGrid({