cnhis-design-vue 3.2.9-beta.9 → 3.2.9-release.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/base-search/index.d.ts +2 -0
- package/es/components/base-search/src/index.vue.d.ts +2 -0
- package/es/components/button-print/index.d.ts +30 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +6 -5
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/classification/index.d.ts +87 -0
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +87 -0
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +87 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/classification/src/index.vue.d.ts +87 -0
- package/es/components/date-picker/index.d.ts +29 -0
- package/es/components/date-picker/src/DatePicker.vue.d.ts +30 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/field-set/index.d.ts +8 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +90 -7
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +32 -7
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +74 -31
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue.d.ts +8 -1
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue.d.ts +29 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +58 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +29 -0
- package/es/components/field-set/src/components/table-row.vue.d.ts +29 -2
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +4 -3
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +2 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/iho-chat/index.d.ts +316 -6
- package/es/components/iho-chat/src/Index.vue.d.ts +316 -6
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/api/index.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +5 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +121 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +160 -2
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +122 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +29 -0
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +6 -1
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +5 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +1 -3
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +2 -1
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
- package/es/components/iho-chat/src/hooks/useSession.js +1 -1
- package/es/components/iho-chat/src/hooks/useState.d.ts +6 -0
- package/es/components/iho-chat/src/hooks/useState.js +1 -1
- package/es/components/iho-chat/src/types/index.d.ts +3 -1
- package/es/components/iho-chat/src/types/index.js +1 -1
- package/es/components/iho-chat/src/utils/chatSock.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +29 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +29 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowHeight.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowHeight.js +1 -0
- package/es/components/iho-table/src/types/index.d.ts +3 -0
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/quick-search/index.d.ts +3 -0
- package/es/components/quick-search/src/index.vue.d.ts +3 -0
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +29 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +58 -0
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +58 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +58 -0
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +29 -0
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +116 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +116 -0
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +2 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/index.d.ts +1 -0
- package/es/shared/utils/index.js +1 -1
- package/package.json +76 -76
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as n,computed as s,watch as i,openBlock as o,createBlock as a,unref as r,withCtx as l,createVNode as c,createTextVNode as u,createElementBlock as m,Fragment as p,renderList as d,createElementVNode as v,toDisplayString as f,createCommentVNode as g,withKeys as _,nextTick as y}from"vue";import{NDrawer as k,NDrawerContent as h,NButton as b,NIcon as I,NAvatar as S,NUpload as w,NUploadTrigger as x,NInput as C,NSpace as U,NSwitch as z,NPopconfirm as j}from"naive-ui";import{ChevronBackOutline as G,ChevronForwardOutline as P,AddOutline as A,RemoveOutline as K,Pencil as R}from"@vicons/ionicons5";import{useState as D}from"../hooks/useState.js";import{useSession as F}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import{trim as L,isFunction as B}from"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import N from"./PersonProfile.vue.js";import O from"./ChatAdd.vue.js";import{toppingSessionApi as q,groupLeaveApi as E,groupUpdateApi as H}from"../api/index.js";const J={key:0,class:"chat-set-wrapper"},M={class:"item"},Q={class:"name"},T={key:0,class:"item__right",style:{color:"var(--c-primary-color)"}},V={class:"item user-info"},W={class:"name"},X={class:"item item-column"},Y=v("span",{class:"label"},"群成员",-1),Z={class:"group-box"},$={class:"group-box__item"},ee={class:"name"},te={class:"group-box__item"},ne=v("span",{class:"name"},"添加",-1),se={class:"group-box__item"},ie=v("span",{class:"name"},"移除",-1),oe=["onClick"],ae=v("span",{class:"label"},"群头像",-1),re={class:"item"},le=v("span",{class:"label"},"群名称",-1),ce={class:"item__right"},ue={class:"txt"},me={class:"item"},pe=v("span",{class:"label"},"置顶聊天",-1),de={class:"item item--red"},ve=v("span",{class:"label"},"退出群聊",-1),fe=v("p",{style:{width:"230px"}},"是否确认退出群聊?",-1),ge={class:"item item--red"},_e=v("span",{class:"label"},"解散该群",-1),ye=v("p",{style:{width:"230px"}},"是否确认解散群聊?",-1);var ke=e({__name:"ChatSet",setup(e){const ke=t(),{state:he}=D(),{setCurrentSessionItem:be,isGroupChat:Ie}=F(he),Se=n(),we=n(!1),xe=n(""),Ce=n(!1),Ue=s((()=>{var e,t;return he.userInfo.id===(null==(t=null==(e=he.currentGroupUser)?void 0:e[0])?void 0:t.id)})),ze=s((()=>he.currentGroupUser.map((e=>e.id)))),je=s((()=>he.currentGroupUser?Ue.value?he.currentGroupUser.slice(0,6):he.currentGroupUser.slice(0,7):[]));async function Ge(e){try{await q({sessionKey:he.currentSessionItem.sessionKey,id:he.currentSessionItem.id,topping:e}),be({topping:e})}catch(e){
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as n,computed as s,watch as i,openBlock as o,createBlock as a,unref as r,withCtx as l,createVNode as c,createTextVNode as u,createElementBlock as m,Fragment as p,renderList as d,createElementVNode as v,toDisplayString as f,createCommentVNode as g,withKeys as _,nextTick as y}from"vue";import{NDrawer as k,NDrawerContent as h,NButton as b,NIcon as I,NAvatar as S,NUpload as w,NUploadTrigger as x,NInput as C,NSpace as U,NSwitch as z,NPopconfirm as j}from"naive-ui";import{ChevronBackOutline as G,ChevronForwardOutline as P,AddOutline as A,RemoveOutline as K,Pencil as R}from"@vicons/ionicons5";import{useState as D}from"../hooks/useState.js";import{useSession as F}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import{trim as L,isFunction as B}from"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import N from"./PersonProfile.vue.js";import O from"./ChatAdd.vue.js";import{toppingSessionApi as q,groupLeaveApi as E,groupUpdateApi as H}from"../api/index.js";const J={key:0,class:"chat-set-wrapper"},M={class:"item"},Q={class:"name"},T={key:0,class:"item__right",style:{color:"var(--c-primary-color)"}},V={class:"item user-info"},W={class:"name"},X={class:"item item-column"},Y=v("span",{class:"label"},"群成员",-1),Z={class:"group-box"},$={class:"group-box__item"},ee={class:"name"},te={class:"group-box__item"},ne=v("span",{class:"name"},"添加",-1),se={class:"group-box__item"},ie=v("span",{class:"name"},"移除",-1),oe=["onClick"],ae=v("span",{class:"label"},"群头像",-1),re={class:"item"},le=v("span",{class:"label"},"群名称",-1),ce={class:"item__right"},ue={class:"txt"},me={class:"item"},pe=v("span",{class:"label"},"置顶聊天",-1),de={class:"item item--red"},ve=v("span",{class:"label"},"退出群聊",-1),fe=v("p",{style:{width:"230px"}},"是否确认退出群聊?",-1),ge={class:"item item--red"},_e=v("span",{class:"label"},"解散该群",-1),ye=v("p",{style:{width:"230px"}},"是否确认解散群聊?",-1);var ke=e({__name:"ChatSet",setup(e){const ke=t(),{state:he}=D(),{setCurrentSessionItem:be,isGroupChat:Ie}=F(he),Se=n(),we=n(!1),xe=n(""),Ce=n(!1),Ue=s((()=>{var e,t;return he.userInfo.id===(null==(t=null==(e=he.currentGroupUser)?void 0:e[0])?void 0:t.id)})),ze=s((()=>he.currentGroupUser.map((e=>e.id)))),je=s((()=>he.currentGroupUser?Ue.value?he.currentGroupUser.slice(0,6):he.currentGroupUser.slice(0,7):[]));async function Ge(e){try{await q({sessionKey:he.currentSessionItem.sessionKey,id:he.currentSessionItem.id,topping:e}),be({topping:e})}catch(e){}}async function Pe(e){await E({dissolution:!!e,groupId:he.currentSessionItem.receiver,operator:he.userInfo.id,memberIdSet:e?ze.value:[he.userInfo.id]})}async function Ae(){var e;xe.value=he.currentSessionItem.name,we.value=!0,await y(),null==(e=Se.value)||e.select()}async function Ke(e){const t=new FormData,n=Object.assign({id:he.currentSessionItem.receiver},e);for(const e in n)t.append(e,n[e]);await H(t)}async function Re(){we.value=!1;const e=L(xe.value);e&&e!==he.currentSessionItem.name&&(await Ke({name:e}),be({name:e,defaultName:e}))}async function De(e){const{file:t}=e.file,n=new FileReader;n.onload=function(e){var t;(null==(t=e.target)?void 0:t.result)&&be({avatar:e.target.result})},n.readAsDataURL(e.file.file),await Ke({file:t})}function Fe(){B(ke["onUpdate:show"])&&ke["onUpdate:show"](!1)}return i((()=>he.id),(e=>{Fe()})),(e,t)=>(o(),a(r(k),{width:320,"trap-focus":!1,"block-scroll":!1,to:".iho-chat",onAfterLeave:t[7]||(t[7]=e=>Ce.value=!1)},{default:l((()=>[c(r(h),null,{header:l((()=>[r(Ie)&&Ce.value?(o(),a(r(b),{key:0,text:"",color:"#666",onClick:t[0]||(t[0]=e=>Ce.value=!1),style:{"font-size":"var(--n-title-font-size)"}},{icon:l((()=>[c(r(I),{size:20,component:r(G)},null,8,["component"])])),default:l((()=>[u(" 返回 ")])),_:1})):r(Ie)?(o(),m(p,{key:1},[u("群设置")],64)):(o(),m(p,{key:2},[u("聊天设置")],64))])),default:l((()=>[r(he).id?(o(),m("div",J,[r(Ie)&&Ce.value?(o(!0),m(p,{key:0},d(r(he).currentGroupUser,((e,t)=>(o(),a(N,{key:e.id,"user-id":e.id,placement:"left"},{trigger:l((()=>[v("div",M,[c(r(S),{round:"",size:40,src:e.avatar},null,8,["src"]),v("span",Q,f(e.name),1),0===t?(o(),m("span",T,"群主")):g("v-if",!0)])])),_:2},1032,["user-id"])))),128)):(o(),m(p,{key:1},[c(N,{"user-id":r(he).currentSessionItem.receiver,onClose:Fe,disabled:!!r(Ie),placement:"bottom-end"},{trigger:l((()=>[v("div",V,[c(r(S),{round:"",size:40,src:r(he).currentSessionItem.avatar},null,8,["src"]),v("span",W,f(r(he).currentSessionItem.name),1),r(Ie)?g("v-if",!0):(o(),a(r(I),{key:0,size:24,component:r(P),class:"item__right"},null,8,["component"]))])])),_:1},8,["user-id","disabled"]),r(Ie)?(o(),m(p,{key:0},[v("div",X,[Y,v("div",Z,[(o(!0),m(p,null,d(r(je),(e=>(o(),a(N,{key:e.id,"user-id":e.id,placement:"left-start"},{trigger:l((()=>[v("div",$,[c(r(S),{round:"",size:40,src:e.avatar},null,8,["src"]),v("span",ee,f(e.name),1)])])),_:2},1032,["user-id"])))),128)),c(O,{mode:"join",disabledIds:r(ze)},{trigger:l((()=>[v("div",te,[c(r(b),{strong:"",secondary:"",circle:""},{icon:l((()=>[c(r(I),{component:r(A)},null,8,["component"])])),_:1}),ne])])),_:1},8,["disabledIds"]),r(Ue)?(o(),a(O,{key:0,title:"移除成员",mode:"remove",options:r(he).currentGroupUser},{trigger:l((()=>[v("div",se,[c(r(b),{strong:"",secondary:"",circle:""},{icon:l((()=>[c(r(I),{component:r(K)},null,8,["component"])])),_:1}),ie])])),_:1},8,["options"])):g("v-if",!0)]),c(r(b),{text:"","icon-placement":"right",color:"#999",onClick:t[1]||(t[1]=e=>Ce.value=!0)},{icon:l((()=>[c(r(I),{component:r(P)},null,8,["component"])])),default:l((()=>[u(" 查看全部群成员 ")])),_:1})]),c(r(w),{abstract:"",multiple:"",accept:"image/*",onChange:De},{default:l((()=>[c(r(x),{abstract:""},{default:l((({handleClick:e})=>[v("div",{class:"item",onClick:e},[ae,c(r(I),{size:20,component:r(P),class:"item__right"},null,8,["component"])],8,oe)])),_:1})])),_:1}),v("div",re,[le,v("div",ce,[we.value?(o(),a(r(C),{key:0,ref_key:"inputRef",ref:Se,value:xe.value,"onUpdate:value":t[2]||(t[2]=e=>xe.value=e),onBlur:Re,onKeydown:t[3]||(t[3]=_((e=>e.target.blur()),["enter"]))},null,8,["value"])):(o(),a(r(U),{key:1,"wrap-item":!1,onClick:Ae,align:"center"},{default:l((()=>[v("span",ue,f(r(he).currentSessionItem.name),1),c(r(b),{text:"",style:{"font-size":"14px","--n-text-color":"#999"}},{default:l((()=>[c(r(I),{component:r(R)},null,8,["component"])])),_:1})])),_:1}))])])],64)):g("v-if",!0),v("div",me,[pe,c(r(z),{value:r(he).currentSessionItem.topping,"onUpdate:value":[t[4]||(t[4]=e=>r(he).currentSessionItem.topping=e),Ge],class:"item__right"},null,8,["value"])]),r(Ie)?(o(),m(p,{key:1},[c(r(j),{onPositiveClick:t[5]||(t[5]=()=>Pe(!1))},{trigger:l((()=>[v("div",de,[ve,c(r(I),{size:20,component:r(P),class:"item__right"},null,8,["component"])])])),default:l((()=>[fe])),_:1}),r(Ue)?(o(),a(r(j),{key:0,onPositiveClick:t[6]||(t[6]=()=>Pe(!0))},{trigger:l((()=>[v("div",ge,[_e,c(r(I),{size:20,component:r(P),class:"item__right"},null,8,["component"])])])),default:l((()=>[ye])),_:1})):g("v-if",!0)],64)):g("v-if",!0)],64))])):g("v-if",!0)])),_:1})])),_:1}))}});export{ke as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as
|
1
|
+
import{defineComponent as e,ref as t,computed as s,withDirectives as o,createVNode as i,vShow as n,isVNode as r}from"vue";import{NButtonGroup as a,NButton as l,NIcon as c}from"naive-ui";import{CopyOutline as m,OpenOutline as d,ChatbubbleEllipsesOutline as u,ReturnDownBack as p,DownloadOutline as g}from"@vicons/ionicons5";import{onClickOutside as f}from"@vueuse/core";import{useState as y}from"../hooks/useState.js";import{useSession as w}from"../hooks/useSession.js";import{MESSAGE_TYPE as h}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as v,downloadFile as I}from"../utils/index.js";import{emojis as T}from"../utils/emoji.js";import{recallMessageApi as M}from"../api/index.js";import{format as b}from"date-fns";var E=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},position:{type:Object},msgId:{type:String}},emits:["update:show","select"],setup(e,{attrs:E,slots:j,emit:k}){const{state:S,setMsgList:x}=y(),{setCurrentSessionItem:L}=w(S),O=[{icon:m,label:"复制",key:"copy"},{icon:d,label:"转发",key:"relay"},{icon:u,label:"回复",key:"reply"},{icon:p,label:"撤回",key:"withdraw"},{icon:g,label:"下载",key:"download"}],A=t(null),D=s((()=>S.msgList.find((({id:t})=>t===e.msgId)))),W=s((()=>{if(!e.msgId)return[];if(!(null==D?void 0:D.value))return[];const{content:t={},sendTime:s,sender:o}=D.value,{chatMessageType:i}=t,n=[];return(o!==S.userInfo.id||i===h.TEMPLATE||o===S.userInfo.id&&Date.now()-new Date(s).getTime()>2592e5)&&n.push("withdraw"),[h.TEXT,h.EMOJI,h.BLEND].includes(i)?n.push("download"):v(t)?n.push("copy","relay","reply","download"):i===h.FILE?n.push("copy"):[h.FORWARD,h.TEMPLATE].includes(i)&&n.push("copy","download"),n.length?O.filter((e=>!n.includes(e.key))):O}));return f(A,(e=>{k("update:show",!1)})),()=>{let t;return e.msgId&&W.value?o(i("div",{class:"contextmenu-wrapper",ref:A,style:e.position},[i(a,{vertical:!0},(s=t=W.value.map((t=>i(l,{onClick:()=>async function(t){k("update:show",!1);const{content:s={},sendTime:o,sender:i}=D.value||{},{chatMessageType:n}=s;switch(t){case"copy":if(!s.msg)return console.log("复制内容为空!");if(!navigator||!("clipboard"in navigator))return console.log("当前浏览器版本不支持复制!");try{if(n===h.TEXT)await navigator.clipboard.writeText(s.msg);else{let e;if([h.EMOJI,h.IMAGE].includes(n)){const t=n===h.EMOJI?T.findEmoji(s.msg):s.msg;e=`<img data-msg=${s.msg} data-type=${n} class=${n===h.EMOJI?"emoji--min":""} src=${t} />`}else e=s.msg;await navigator.clipboard.write([new window.ClipboardItem({"text/html":new Blob([e],{type:"text/html"})})])}}catch(e){console.log("复制失败!")}return;case"download":return void I(s.fileUrl,s.msg);case"withdraw":{const t=S.msgList.findIndex((({id:t})=>t===e.msgId)),s=0===t;if(await M({chatType:S.currentSessionItem.chatType,messageIdSet:[e.msgId],receiver:S.currentSessionItem.receiver,sender:S.userInfo.id,isLastMessage:s}),S.msgList[t].status="WITHDRAWN",s){const e=b(new Date,"yyyy-MM-dd HH:mm:ss");L({lastMessageStatus:"WITHDRAWN",lastMessageSendTime:e,sortTime:e,updatedTime:e})}return}}k("select",t,D.value)}(t.key),quaternary:!0},{default:()=>t.label,icon:()=>i(c,{component:t.icon},null)}))),"function"==typeof s||"[object Object]"===Object.prototype.toString.call(s)&&!r(s)?t:{default:()=>[t]}))]),[[n,e.show]]):null;var s}}});export{E as default};
|
@@ -70,6 +70,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
70
70
|
};
|
71
71
|
defaultValue: {
|
72
72
|
type: import("vue").PropType<AnyObject[]>;
|
73
|
+
default: () => never[];
|
73
74
|
};
|
74
75
|
}, {
|
75
76
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -90,6 +91,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
90
91
|
};
|
91
92
|
defaultValue: {
|
92
93
|
type: import("vue").PropType<AnyObject[]>;
|
94
|
+
default: () => never[];
|
93
95
|
};
|
94
96
|
}>> & {
|
95
97
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
@@ -104,6 +106,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
104
106
|
options: import("vue").Ref<AnyObject[]>;
|
105
107
|
groupName: import("vue").Ref<string>;
|
106
108
|
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
109
|
+
remark: import("vue").Ref<string>;
|
107
110
|
userList: import("vue").Ref<AnyObject[]>;
|
108
111
|
handleInput: () => void;
|
109
112
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -152,10 +155,12 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
152
155
|
};
|
153
156
|
defaultValue: {
|
154
157
|
type: import("vue").PropType<AnyObject[]>;
|
158
|
+
default: () => never[];
|
155
159
|
};
|
156
160
|
}>> & {
|
157
161
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
158
162
|
}, {
|
163
|
+
defaultValue: AnyObject[];
|
159
164
|
mode: string;
|
160
165
|
title: string;
|
161
166
|
disabledIds: string[];
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,ref as e,reactive as a,computed as
|
1
|
+
import{defineComponent as t,ref as e,reactive as a,computed as o,openBlock as l,createBlock as r,unref as n,withCtx as s,renderSlot as i,createElementBlock as c,Fragment as u,withDirectives as d,createElementVNode as p,createVNode as m,createCommentVNode as v,toDisplayString as f,createTextVNode as g,renderList as y,vShow as k}from"vue";import{NPopover as h,NAvatar as b,NButton as w,NIcon as j}from"naive-ui";import{ChatbubbleEllipses as C,EyeOffOutline as I,EyeOutline as _,Close as x}from"@vicons/ionicons5";import{useState as z}from"../hooks/useState.js";import{useSession as N}from"../hooks/useSession.js";import{CHAT_TYPE as S}from"../constants/index.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import{openSessionApi as $,getUserDetailApi as D}from"../api/index.js";const E={class:"person-profile-main"},L={class:"left"},P={class:"profile"},q={class:"profile__text"},B={class:"right"},G={class:"right__content"},O={class:"label"},T={class:"content"};var U=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:U}){const A=t,{state:F}=z(),{openSession:H}=N(F),J=e(!1),K=e(!1),M=e(!1),Q=a({}),R=[{label:"机构",value:"",key:"orgName"},{label:"姓名",value:"",key:"name"},{label:"归属科室",value:"",key:"deptName"},{label:"业务科室",value:"",key:"businessDeptNames"},{label:"手机号",value:"",key:"phone"},{label:"岗位",value:"",key:"post"},{label:"工号",value:"",key:"jobId"},{label:"性别",value:"",key:"orgName"}],V=o((()=>(Q.id&&R.forEach((t=>{const{key:e}=t;t.value=Q[e]})),R)));async function W(){J.value=!1;let t=F.sessionList.find((t=>t.receiver===A.userId));if(!t)try{t=await $({chatType:S.SINGLE,receiver:A.userId,sender:F.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&H(t),U("close")}async function X(t){if(!t)return;const e=await D({userId:A.userId});(null==e?void 0:e.id)?Object.assign(Q,e):Q.id=""}function Y(t){const{key:e,value:a}=t;return"phone"!==e||M.value?a:(a||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,a)=>(l(),r(n(h),{raw:"",class:"person-profile-wrapper",show:J.value,"onUpdate:show":[a[3]||(a[3]=t=>J.value=t),X],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:s((()=>[i(e.$slots,"trigger")])),default:s((()=>[Q.id?(l(),c(u,{key:0},[d(p("div",E,[p("div",L,[p("div",P,[m(n(b),{src:Q.avatar,bordered:"",round:"",size:100,onClickCapture:a[0]||(a[0]=t=>K.value=!0)},null,8,["src"]),v(' <n-upload abstract accept="image/*" @change="onChange">\r\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\r\n\t\t\t\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t\t\t\tcircle\r\n\t\t\t\t\t\t\t\t\tsecondary\r\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\r\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\r\n\t\t\t\t\t\t\t\t\t@click="handleClick"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\r\n\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t</n-button>\r\n\t\t\t\t\t\t\t</n-upload-trigger>\r\n\t\t\t\t\t\t</n-upload> '),p("div",q,[p("h4",null,f(Q.name),1),p("p",null,f(Q.orgName),1)]),m(n(w),{strong:"",secondary:"",onClick:W},{default:s((()=>[m(n(j),{size:"13",color:"#666666",component:n(C),style:{"margin-right":"6px"}},null,8,["component"]),g(" 发消息 ")])),_:1})])]),p("div",B,[p("div",G,[(l(!0),c(u,null,y(n(V),((t,e)=>(l(),c("div",{class:"info-item",key:e},[p("span",O,f(t.label),1),p("div",T,[p("span",null,f(Y(t)),1),"phone"===t.key&&Y(t)?(l(),r(n(j),{key:0,size:"16",color:"#666666",component:M.value?n(I):n(_),style:{"margin-left":"10px"},onClick:a[1]||(a[1]=t=>M.value=!M.value)},null,8,["component"])):v("v-if",!0)])])))),128))])])],512),[[k,!K.value]]),d(p("div",{class:"large-avatar",onClick:a[2]||(a[2]=t=>K.value=!1)},[m(n(w),{circle:"",size:"small",secondary:""},{icon:s((()=>[m(n(j),{size:24,component:n(x),color:"#fff"},null,8,["component"])])),_:1}),m(n(b),{size:310,round:"",src:Q.avatar},null,8,["src"])],512),[[k,K.value]])],64)):v("v-if",!0)])),_:3},8,["show","trigger"]))}});export{U as default};
|
@@ -15,12 +15,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
15
15
|
}[]>;
|
16
16
|
currentFilterKey: import("vue").Ref<string>;
|
17
17
|
state: import("../types").IState;
|
18
|
-
|
18
|
+
unreadTotal: import("vue").ComputedRef<number>;
|
19
19
|
openSession: (item: AnyObject) => Promise<void>;
|
20
|
-
updateSessionList: (sessionItem: AnyObject) => void;
|
21
20
|
currentWidth: import("vue").ComputedRef<number>;
|
22
21
|
sessionList: import("vue").ComputedRef<AnyObject[]>;
|
23
|
-
unreadTotal: import("vue").ComputedRef<number>;
|
24
22
|
changeWidth: ({ distance }: AnyObject) => void;
|
25
23
|
handleFilter: (key: string) => void;
|
26
24
|
showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as s,computed as
|
1
|
+
import{defineComponent as e,ref as s,computed as l,withDirectives as i,openBlock as a,createElementBlock as t,normalizeStyle as n,unref as r,createBlock as o,createCommentVNode as u,createElementVNode as d,Fragment as v,renderList as m,withCtx as c,createTextVNode as p,toDisplayString as k,normalizeClass as f,createVNode as y,vShow as _}from"vue";import{NSpin as h,NTag as g,NAvatar as x,NBadge as M}from"naive-ui";import{useState as b}from"../hooks/useState.js";import{useSession as S}from"../hooks/useSession.js";import"trtc-sdk-v5";import{listSort as T,formatTime as C}from"../utils/index.js";import{vFlexibleResize as N}from"../../../../shared/directive/flexibleResize.js";const j={class:"sider-list__filter box-shadow"},L=["onClick"],R={class:"avatar-right"},w={class:"name"},H={class:"msg-tip"},z={class:"msg-tip__content"},K={key:0},W=["innerHTML"];var A=e({__name:"SiderList",setup(e){const A="all",B="unread";let D=[];const I=s(300),V=s(),q=s(!1),E=s([{label:"全部",key:A},{label:"未读",key:B}]),F=s("all"),{state:G,unreadTotal:J}=b(),{openSession:O}=S(G),P=l((()=>Math.min(Math.max(I.value,240),360))),Q=l((()=>T(G.sessionList)));function U({distance:e}){I.value=I.value+e}function X(e,s=r(F)){var l;return s===A||(s===B?D.includes(e.sessionKey)||(null!=(l=e.unreadNum)?l:0)>0:void 0)}return(e,s)=>i((a(),t("section",{class:"sider-list",style:n({width:r(P)+"px"})},[q.value?(a(),o(r(h),{key:0,stroke:"#5585f5"})):u("v-if",!0),u(' <n-input v-else placeholder="输入用户名模糊搜索" v-model:value="keyword" @keyup.enter="handleSearch"></n-input> '),d("div",j,[(a(!0),t(v,null,m(E.value,(e=>(a(),o(r(g),{type:F.value===e.key?"info":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return s=e.key,F.value=s,void(s===B&&(D=(Q.value.filter((e=>{var s;return(null!=(s=e.unreadNum)?s:0)>0}))||[]).map((e=>e.sessionKey))));var s}},{default:c((()=>[p(k(e.label)+"("+k(r(J))+") ",1)])),_:2},1032,["type","onClick"])))),128))]),d("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:V},[(a(!0),t(v,null,m(r(Q),(e=>i((a(),t("div",{key:e.id,onClick:()=>r(O)(e),class:f(["sider-list__box__item",{active:e.id===r(G).id},e.topping?"sider-list__box__item--top":""])},[y(r(x),{round:"",size:"large",src:e.avatar},null,8,["src"]),d("div",R,[d("div",w,[d("h4",null,k(e.name),1),d("span",null,k(e.lastMessage?r(C)(e.lastMessageSendTime).siderMsgTime:""),1)]),d("div",H,[d("div",z,["WITHDRAWN"===e.lastMessageStatus?(a(),t("div",K,"撤回了一条消息")):(a(),t("div",{key:1,innerHTML:e.lastMessageContent},null,8,W))]),y(r(M),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],10,L)),[[_,X(e)]]))),128))],512)],4)),[[r(N),{mode:"VR",onMove:U}]])}});export{A as default};
|
@@ -1 +1 @@
|
|
1
|
-
var E=(E=>(E.SINGLE="SINGLE",E.GROUP="GROUP",E))(E||{}),
|
1
|
+
var E=(E=>(E.SINGLE="SINGLE",E.GROUP="GROUP",E))(E||{}),S=(E=>(E.TEXT="TEXT",E.FILE="FILE",E.EMOJI="EMOJI",E.IMAGE="IMAGE",E.TEMPLATE="TEMPLATE",E.BLEND="BLEND",E.FORWARD="FORWARD",E.QUICK_REPLY="QUICK_REPLY",E.AUDIO="AUDIO",E.VIDEO="VIDEO",E))(S||{}),A=(E=>(E.JOIN="JOIN",E.LEAVE="LEAVE",E.NEW_SESSION="NEW_SESSION",E.MESSAGE="MESSAGE",E.AV_STATUS="AV_STATUS",E.RECALL_MESSAGE="RECALL_MESSAGE",E))(A||{}),L=(E=>(E.IN_CALL="IN_CALL",E.CALL_BUSY="CALL_BUSY",E.NO_RESPONSE="NO_RESPONSE",E.FINISHED="FINISHED",E.REJECTED="REJECTED",E.CANCELED="CANCELED",E))(L||{});export{L as AV_STATUS,E as CHAT_TYPE,S as MESSAGE_TYPE,A as SUBSCRIBE_MESSAGE_TYPE};
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e}from"vue";import{isArray as o}from"lodash-es";import{listUserApi as r}from"../api/index.js";import{useDebounceFn as t}from"@vueuse/core";import"../../../../shared/utils/index.js";import"naive-ui";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as s}from"../../../../shared/hooks/useScrollLoading.js";import{useState as a}from"./useState.js";import"../utils/emoji.js";import"trtc-sdk-v5";function i({wrapperRef:i,keywordRef:n,before:p,after:u}){const
|
1
|
+
import{ref as e}from"vue";import{isArray as o}from"lodash-es";import{listUserApi as r}from"../api/index.js";import{useDebounceFn as t}from"@vueuse/core";import"../../../../shared/utils/index.js";import"naive-ui";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as s}from"../../../../shared/hooks/useScrollLoading.js";import{useState as a}from"./useState.js";import"../utils/emoji.js";import"trtc-sdk-v5";function i({wrapperRef:i,keywordRef:n,before:p,after:u}){const m={page:0,hasMore:!0},{state:c}=a(),l=e([]),d=t((function(){Object.assign(m,{page:0,hasMore:!0}),f()}),300);async function f(){const e=(n.value||"").replace(/^\s+|\s+$/g,"");if(!e)return void(p?p():l.value=[]);if(!m.hasMore)return;m.page++,1==m.page&&(l.value=[]);const t=await r({orgId:c.orgId,keyword:e,page:m.page,pageSize:10});o(t.records)&&l.value.length<=+t.total&&(l.value=m.page>1?l.value.concat(t.records):t.records,null==u||u(),l.value.length>=+t.total&&(m.hasMore=!1))}return s(i,(()=>{f()})),{userList:l,handleInput:d}}export{i as useSearchUserList};
|
@@ -1 +1 @@
|
|
1
|
-
import{computed as e}from"vue";import{simplifyMessage as s}from"../utils/index.js";import{cloneDeep as
|
1
|
+
import{computed as e}from"vue";import{simplifyMessage as s}from"../utils/index.js";import{cloneDeep as n,isArray as t,uniqBy as i}from"lodash-es";import{CHAT_TYPE as o}from"../constants/index.js";import{groupUserApi as r}from"../api/index.js";function a(e){return e.chatType===o.GROUP}function u(e){const{lastMessage:n,lastSenderName:t=""}=e,i=s(n)||"";return a(e)&&t?t+": "+i:i}function c(s){const c=e((()=>a(s.currentSessionItem)));function m(e){Object.assign(s.currentSessionItem,e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:Reflect.has(e,"lastMessage")?u({...e,chatType:e.chatType||s.currentSessionItem.chatType}):s.currentSessionItem.lastMessageContent}),s.isChangeSession=!0,s.id!==s.currentSessionItem.id&&(s.msgList=[],s.id=s.currentSessionItem.id)}function d(e){s.sessionList=n(i(e,"id")),s.sessionList.forEach((e=>{Object.assign(e,{defaultName:Reflect.has(e,"defaultName")?e.defaultName:e.name||"",lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:u(e)}),e.receiver===s.userInfo.id&&(e.unreadNum=0),e.chatType!==o.GROUP||e.name||r({id:e.receiver}).then((s=>{t(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))}return{openSession:async function(e){const o=s.currentSessionItem.sessionKey;if(m(e),o!==s.currentSessionItem.sessionKey)if(c.value){const n=await r({id:e.receiver});s.currentGroupUser=t(n)?n:[]}else s.currentGroupUser=i([s.userInfo,{...n(e),id:e.receiver}],"id")},closeSession:function(){if(!s.id)return null;const{currentSessionItem:e}=s;return s.currentSessionItem={},s.msgList=[],s.id="",s.currentGroupUser=[],e},getCurrentSession:function(){return s.id?s.currentSessionItem:null},setCurrentSessionItem:m,setUpdateSessionItem:function(e){const t=s.sessionList.find((s=>s.sessionKey===e.sessionKey)),i={...e,lastMessageContent:u({...e,chatType:e.chatType||(null==t?void 0:t.chatType)})};s.updateSessionItem=t?{...n(t),...i}:i,s.isUpdateSession=!0},setSessionList:d,isGroupChat:c,updateSessionList:function(e){!e.id||s.sessionList.map((e=>e.id)).includes(e.id)?s.sessionList.some((n=>{if(n.sessionKey===e.sessionKey){let{unreadNum:t=0}=n;return Object.assign(n,e),e.sessionKey!==s.currentSessionItem.sessionKey&&n.sender&&n.sender!==s.userInfo.id&&(n.unreadNum=++t),!0}})):d([...s.sessionList,e])}}}export{c as useSession};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
2
|
export declare function useState(): {
|
3
3
|
state: import("../types").IState;
|
4
|
+
unreadTotal: import("vue").ComputedRef<number>;
|
4
5
|
setMsgList: (list?: AnyObject[]) => void;
|
5
6
|
stompClient: import("vue").Ref<import("../utils/chatSock").ChatSock>;
|
6
7
|
emit: (event: string, ...args: any[]) => void;
|
@@ -9,4 +10,9 @@ export declare function useState(): {
|
|
9
10
|
content: AnyObject;
|
10
11
|
receiver?: string;
|
11
12
|
}) => Promise<void>;
|
13
|
+
relayMessage: (param: {
|
14
|
+
checkedIds: string[];
|
15
|
+
remark: string;
|
16
|
+
content: AnyObject;
|
17
|
+
}) => Promise<void>;
|
12
18
|
};
|
@@ -1 +1 @@
|
|
1
|
-
import{inject as e}from"vue";import{cloneDeep as t}from"lodash-es";import{formatTime as s,transformMessage as n,getFileSize as i}from"../utils/index.js";import{InjectionIChatState as
|
1
|
+
import{inject as e}from"vue";import{cloneDeep as t}from"lodash-es";import{formatTime as s,transformMessage as n,getFileSize as i}from"../utils/index.js";import{InjectionIChatState as r,InjectionIChatStompClient as o,InjectionIChatEmits as c,InjectionIChatUnreadTotal as m}from"../types/index.js";import{MESSAGE_TYPE as a,CHAT_TYPE as T}from"../constants/index.js";import{useIntervalFn as d,promiseTimeout as g}from"@vueuse/core";import{openSessionApi as p}from"../api/index.js";function u(){const u=e(r),f=e(o),h=e(c),l=e(m),{pause:y,resume:v,isActive:L}=d((()=>{const e=t(u.msgList);e.some((e=>{const{sendTime:t}=e;return!(Date.now()-new Date(t).getTime()>=36e5)&&(e.__sendTime=s(t).recordTime,!0)})),u.msgList=e,_()||y()}),6e4,{immediate:!1});function _(){return!!u.msgList.length&&u.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function w(e){try{f.value.send("/app/chat/send",{},JSON.stringify({chatType:u.currentSessionItem.chatType,receiver:u.currentSessionItem.receiver,...e}))}catch(e){}}return{state:u,unreadTotal:l,setMsgList:function(e=[]){y(),u.msgList=t(e).sort(((e,t)=>new Date(t.sendTime).getTime()-new Date(e.sendTime).getTime())),u.msgList.forEach((e=>{var t,r;Object.assign(e,{__time:s(e.sendTime).msgTime,__content:(r=e.content.chatMessageType,[a.TEXT,a.TEXT,a.BLEND].includes(r)?n(e.content):null==(t=e.content)?void 0:t.msg),__sendTime:s(e.sendTime).recordTime}),e.content.chatMessageType!==a.FILE||e.__size||i(e.content.fileUrl).then((t=>{e.__size=t}))})),_()&&v()},stompClient:f,emit:h,sendMessage:w,relayMessage:async function(e){const{checkedIds:t,remark:s,content:n}=e;for(let e=0;e<t.length;e++){const i=t[e],r=u.sessionList.find((e=>e.receiver===i));r||await p({chatType:T.SINGLE,receiver:i,sender:u.userInfo.id});const o=(null==r?void 0:r.chatType)||T.SINGLE;w({chatType:o,receiver:i,content:n}),await g(100),s&&w({chatType:o,receiver:i,content:{chatMessageType:a.TEXT,msg:s}}),await g(100)}}}}export{u as useState};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { InjectionKey, Ref } from 'vue';
|
1
|
+
import { InjectionKey, Ref, ComputedRef } from 'vue';
|
2
2
|
import { AnyObject } from '../../../../shared/types';
|
3
3
|
import { ChatSock } from '../utils/chatSock';
|
4
4
|
import { UploadFileInfo } from 'naive-ui';
|
@@ -15,6 +15,7 @@ export type IState = {
|
|
15
15
|
updateSessionItem: AnyObject;
|
16
16
|
isUpdateSession: boolean;
|
17
17
|
currentReferenceMsg: null | AnyObject;
|
18
|
+
currentReEditMsg: null | AnyObject;
|
18
19
|
showVideo: boolean;
|
19
20
|
currentAVMsg: AnyObject;
|
20
21
|
currentGroupUser: AnyObject[];
|
@@ -27,3 +28,4 @@ export type FileOptions = {
|
|
27
28
|
export declare const InjectionIChatState: InjectionKey<IState>;
|
28
29
|
export declare const InjectionIChatStompClient: InjectionKey<Ref<ChatSock>>;
|
29
30
|
export declare const InjectionIChatEmits: InjectionKey<(event: string, ...args: any[]) => void>;
|
31
|
+
export declare const InjectionIChatUnreadTotal: InjectionKey<ComputedRef<number>>;
|
@@ -1 +1 @@
|
|
1
|
-
const t=Symbol("InjectionIChatState"),o=Symbol("InjectionIChatStompClient"),n=Symbol("InjectionIChatEmits");export{n as InjectionIChatEmits,t as InjectionIChatState,o as InjectionIChatStompClient};
|
1
|
+
const t=Symbol("InjectionIChatState"),o=Symbol("InjectionIChatStompClient"),n=Symbol("InjectionIChatEmits"),e=Symbol("InjectionIChatUnreadTotal");export{n as InjectionIChatEmits,t as InjectionIChatState,o as InjectionIChatStompClient,e as InjectionIChatUnreadTotal};
|
@@ -1 +1 @@
|
|
1
|
-
import t from"stompjs";import i from"sockjs-client/dist/sockjs.min.js";class s{constructor(t,i){this.reconnectionCount=0,this.options={},this.url="",this.url=t,this.options=i,this.connection()}connection(){if(!this.url)return;const s=new i(this.url);this.stompClient=t.over(s),this.stompClient.connect(this.options.headers||{},(()=>{const{connectCb:t}=this.options;t&&t(this.reconnectionCount>0),this.startHeartbeat(),this.subscribe(this.options.subscribeCbs),this.reconnectionCount=0}),(t=>{const i=this.reconnectionCount,{errorCb:s,reconnectMaxCount:e=60}=this.options;s&&s(t,i),i<=e&&this.reconnect()}))}disconnect(){var t;this.heartbeatTimer&&clearTimeout(this.heartbeatTimer),this.reconnectTimer&&clearTimeout(this.reconnectTimer),null==(t=this.stompClient)||t.disconnect(),this.stompClient=void 0}reconnect(){this.reconnectionCount++,this.disconnect(),this.reconnectTimer=setTimeout((()=>{this.connection()}),1e3)}subscribe(...t){const i=this.stompClient;if(i){if(1!==t.length||!Array.isArray(t[0]))return 2===t.length?i.subscribe(...t):void 0;t[0].forEach((t=>{this.subscribe(t.action,t.cb)}))}}startHeartbeat(){const t=this.options.heartbeatFn;if(!t)return;const i=this.options.heartbeatRate||1e4;this.heartbeatTimer=setTimeout((()=>{t(),this.startHeartbeat()}),i)}send(...t){var i;return null==(i=this.stompClient)?void 0:i.send(...t)}}export{s as ChatSock};
|
1
|
+
import t from"stompjs";import i from"sockjs-client/dist/sockjs.min.js";class s{constructor(t,i){this.reconnectionCount=0,this.options={},this.url="",this.url=t,this.options=i,this.connection()}connection(){if(!this.url)return;const s=new i(this.url);this.stompClient=t.over(s),this.stompClient.debug=null,this.stompClient.connect(this.options.headers||{},(()=>{const{connectCb:t}=this.options;t&&t(this.reconnectionCount>0),this.startHeartbeat(),this.subscribe(this.options.subscribeCbs),this.reconnectionCount=0}),(t=>{const i=this.reconnectionCount,{errorCb:s,reconnectMaxCount:e=60}=this.options;s&&s(t,i),i<=e&&this.reconnect()}))}disconnect(){var t;this.heartbeatTimer&&clearTimeout(this.heartbeatTimer),this.reconnectTimer&&clearTimeout(this.reconnectTimer),null==(t=this.stompClient)||t.disconnect(),this.stompClient=void 0}reconnect(){this.reconnectionCount++,this.disconnect(),this.reconnectTimer=setTimeout((()=>{this.connection()}),1e3)}subscribe(...t){const i=this.stompClient;if(i){if(1!==t.length||!Array.isArray(t[0]))return 2===t.length?i.subscribe(...t):void 0;t[0].forEach((t=>{this.subscribe(t.action,t.cb)}))}}startHeartbeat(){const t=this.options.heartbeatFn;if(!t)return;const i=this.options.heartbeatRate||1e4;this.heartbeatTimer=setTimeout((()=>{t(),this.startHeartbeat()}),i)}send(...t){var i;return null==(i=this.stompClient)?void 0:i.send(...t)}}export{s as ChatSock};
|