Files
aiot-platform-ui/apps/web-antd/dist/js/constants-Cy5rxJva.js
lzh 35c3d0e06e
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-18 16:18:59 +08:00

2 lines
1.9 KiB
JavaScript

var i=(t,e,n)=>new Promise((a,v)=>{var d=s=>{try{r(n.next(s))}catch(c){v(c)}},L=s=>{try{r(n.throw(s))}catch(c){v(c)}},r=s=>s.done?a(s.value):Promise.resolve(s.value).then(d,L);r((n=n.apply(t,e)).next())});import{aq as o,bX as f}from"./bootstrap-CW2RsBQq.js";import{cp as u}from"../jse/index-index-Cy8amzIl.js";function g(){return o.get("/promotion/kefu-conversation/list")}function p(t){return o.get(`/promotion/kefu-conversation/get?id=${t}`)}function M(t){return o.put("/promotion/kefu-conversation/update-conversation-pinned",t)}function E(t){return o.delete(`/promotion/kefu-conversation/delete?id=${t}`)}const l=f("mall-kefu",{state:()=>({conversationList:[],conversationMessageList:new Map}),getters:{getConversationList(){return this.conversationList},getConversationMessageList(){return t=>this.conversationMessageList.get(t)}},actions:{saveMessageList(t,e){this.conversationMessageList.set(t,e)},setConversationList(){return i(this,null,function*(){this.conversationList=yield g(),this.conversationSort()})},updateConversationStatus(t){return i(this,null,function*(){if(u(this.conversationList))return;const n=this.conversationList.find(a=>a.id===t);n&&(n.adminUnreadMessageCount=0)})},updateConversation(t){return i(this,null,function*(){if(u(this.conversationList))return;const e=yield p(t);if(this.deleteConversation(t),e&&this.conversationList){const n=this.conversationList;this.conversationList=[...n,e]}this.conversationSort()})},deleteConversation(t){const e=this.conversationList.findIndex(n=>n.id===t);e!==-1&&this.conversationList.splice(e,1)},conversationSort(){this.conversationList.toSorted((t,e)=>t.adminPinned!==e.adminPinned?t.adminPinned?-1:1:e.lastMessageTime-t.lastMessageTime)}}}),S={TEXT:1,IMAGE:2,VOICE:3,VIDEO:4,SYSTEM:5,PRODUCT:10,ORDER:11},_={KEFU_MESSAGE_TYPE:"kefu_message_type",KEFU_MESSAGE_ADMIN_READ:"kefu_message_read_status_change"};export{S as K,_ as W,M as a,E as d,l as u};