cnhis-design-vue 3.2.7-beta.2 → 3.2.7-beta.21

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.
Files changed (121) hide show
  1. package/es/components/button-print/index.d.ts +1 -0
  2. package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -0
  3. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -0
  4. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  5. package/es/components/button-print/style/index.css +1 -1
  6. package/es/components/classification/index.d.ts +60 -5
  7. package/es/components/classification/src/components/search-filter/index.vue.d.ts +60 -5
  8. package/es/components/classification/src/components/set-classification/index.vue.d.ts +60 -5
  9. package/es/components/classification/src/index.vue.d.ts +60 -5
  10. package/es/components/date-picker/index.d.ts +13 -0
  11. package/es/components/date-picker/src/DatePicker.vue.d.ts +13 -0
  12. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  13. package/es/components/fabric-chart/src/constants/index.d.ts +3 -1
  14. package/es/components/fabric-chart/src/constants/index.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +8 -3
  17. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
  19. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
  23. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
  25. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  26. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  27. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  28. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +8 -3
  29. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
  31. package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
  32. package/es/components/fabric-chart/src/interface.d.ts +11 -1
  33. package/es/components/field-set/src/FieldColor.vue.d.ts +26 -0
  34. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  35. package/es/components/field-set/src/components/condition.vue.d.ts +13 -0
  36. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +26 -0
  37. package/es/components/field-set/src/components/edit-filter.vue.d.ts +13 -0
  38. package/es/components/form-config/index.d.ts +6 -3
  39. package/es/components/form-config/src/FormConfig.vue.d.ts +6 -3
  40. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -3
  41. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  42. package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
  43. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  44. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
  45. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  46. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  47. package/es/components/form-render/src/types/fieldItem.d.ts +3 -1
  48. package/es/components/form-render/src/types/index.d.ts +1 -1
  49. package/es/components/form-render/src/utils/business.js +1 -1
  50. package/es/components/form-render/src/utils/schema.d.ts +1 -1
  51. package/es/components/form-render/src/utils/schema.js +1 -1
  52. package/es/components/iho-chat/index.d.ts +236 -74
  53. package/es/components/iho-chat/src/Index.vue.d.ts +236 -74
  54. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  55. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +34 -13
  56. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  57. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +39 -14
  58. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  59. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +48 -14
  60. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  61. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +24 -4
  62. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  63. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +13 -0
  64. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  65. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +3 -10
  66. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  67. package/es/components/iho-chat/src/components/ContextMenu.d.ts +15 -2
  68. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  69. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +61 -24
  70. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  71. package/es/components/iho-chat/src/components/Video.vue.d.ts +14 -2
  72. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  73. package/es/components/iho-chat/src/hooks/useScrollLoading.d.ts +1 -1
  74. package/es/components/iho-chat/src/hooks/useScrollLoading.js +1 -1
  75. package/es/components/iho-chat/src/hooks/useSearchUserList.d.ts +11 -0
  76. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -0
  77. package/es/components/iho-chat/src/hooks/useState.js +1 -1
  78. package/es/components/iho-chat/src/hooks/useVideo.d.ts +11 -0
  79. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  80. package/es/components/iho-chat/src/types/index.d.ts +0 -1
  81. package/es/components/iho-chat/src/utils/index.js +1 -1
  82. package/es/components/iho-chat/style/index.css +1 -1
  83. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +13 -0
  84. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +13 -0
  85. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +20 -2
  86. package/es/components/index.css +1 -1
  87. package/es/components/shortcut-setter/index.d.ts +2 -1
  88. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -1
  89. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +13 -0
  90. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +13 -0
  91. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +13 -0
  92. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +13 -0
  93. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +47 -5
  94. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +13 -0
  95. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +13 -0
  96. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +37 -19
  97. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
  98. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +47 -5
  99. package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
  100. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +47 -5
  101. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +13 -0
  102. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +13 -0
  103. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +13 -0
  104. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +13 -0
  105. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +33 -18
  106. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  107. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +13 -0
  108. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  109. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +69 -4
  110. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +69 -4
  111. package/es/components/table-filter/src/tool/transformData.js +1 -1
  112. package/es/components/table-filter/src/types/index.d.ts +1 -0
  113. package/es/components/time-line/index.d.ts +4 -4
  114. package/es/components/time-line/src/TimeLine.vue.d.ts +1 -1
  115. package/es/components/time-line/src/TimeLine.vue2.js +1 -1
  116. package/es/components/time-picker/index.d.ts +20 -2
  117. package/es/components/time-picker/src/TimePicker.vue.d.ts +21 -2
  118. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  119. package/es/shared/package.json.js +1 -1
  120. package/es/shared/utils/business.js +1 -1
  121. package/package.json +2 -2
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as r,openBlock as n,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as l,Fragment as p,createElementVNode as m,renderSlot as h,createCommentVNode as f}from"vue";import{NConfigProvider as g,NSpin as v,NLayout as S,NLayoutContent as y}from"naive-ui";import b from"./components/SiderList.vue.js";import I from"./components/ChatHeader.vue.js";import M from"./components/ChatMain.vue.js";import T from"./components/ChatFooter.vue.js";import k from"./components/ChatSearch.vue.js";import V from"./components/ChatAdd.vue.js";import j from"./components/Video.vue.js";import w from"./components/MultipleVideo.vue.js";import{ChatSock as N}from"./utils/chatSock.js";import{instanceAxios as L,listUserApi as U,readMessageApi as _}from"./api/index.js";import{useTheme as A}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as C,isNumber as O}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{CHAT_TYPE as R,SUBSCRIBE_MESSAGE_TYPE as x,AV_STATUS as G}from"./constants/index.js";import{InjectionIChatState as E,InjectionIChatStompClient as J,InjectionIChatEmits as K}from"./types/index.js";import{isAudioOrVideoMessage as P}from"./utils/index.js";import{useSession as $}from"./hooks/useSession.js";import"trtc-sdk-v5";const q={class:"iho-chat__header"},z={class:"toolbar"};var F=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"}},emits:["template-click","unread-message-update"],setup(e,{expose:F,emit:H}){const B=e;L.defaults.baseURL=B.baseURL,L.defaults.headers.Authorization="bearer "+B.token;const D=A(),W=s(!1),Y=s(),Q=o({orgId:B.orgId,currentSessionItem:{},id:"",userInfo:{id:B.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,showVideo:!1,currentAVMsg:{},userList:[],currentGroupUser:[],showMultipleVideo:!1});t(E,Q),t(J,Y),t(K,H);const{openSession:X,closeSession:Z,getCurrentSession:ee,setSessionList:se,setUpdateSessionItem:oe,setCurrentSessionItem:te}=$(Q),re=[];function ne(){const e={headers:{AccessToken:B.token,UserId:B.userId},heartbeatFn(){try{Y.value.send("test")}catch(e){Y.value.disconnect(),ne()}},connectCb(){console.log("连接成功"),Y.value.subscribe("/user/topic/single",(({body:e})=>ae({body:e,chatType:R.SINGLE}))),Y.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:o,currentUser:t,sessionVos:r}=s;if(console.log("body",s),Object.assign(Q.userInfo,t,o),!(null==r?void 0:r.length))return;se(r),re.splice(0,re.length),re.push(...r.filter((e=>e.chatType===R.GROUP))),re.forEach((e=>{Y.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>ae({body:e,chatType:R.GROUP})))}))}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};Y.value=new N("/fdp-chat/websocket",e)}async function ie(e,s){if(Q.currentMsg=e,e.sessionKey===Q.currentSessionItem.sessionKey)return Q.isAppendMsg=!0,e.sender!==Q.userInfo.id&&await _({chatType:s,messageIdSet:[e.id],receiver:Q.userInfo.id,sender:e.sender}),void te({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const o={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName};oe(o)}async function ae({body:e,chatType:s}){try{console.log(JSON.parse(e),"订阅新增消息");const o=JSON.parse(e),{messageVo:t,sessionVo:r,chatAvStatusVo:n}=o;switch(o.event){case x.MESSAGE:P(t.content)?!Q.showVideo&&!Q.showMultipleVideo||t.content.avStatus!==G.IN_CALL?(Q.currentMsg=t,Object.assign(Q.currentAVMsg,{strRoomId:t.sessionKey,chatMessageType:t.content.chatMessageType,callMode:t.sender===Q.userInfo.id?"call":"invite",currentMsg:t}),Q.showVideo||Q.showMultipleVideo?ie(t,s):Q.showVideo=!0):(Y.value.send("/app/chat/send",{},JSON.stringify({chatType:R.SINGLE,receiver:t.sender,content:{chatMessageType:t.content.chatMessageType,avStatus:G.CALL_BUSY}})),console.log("用户忙!")):ie(t,s);break;case x.AV_STATUS:Object.assign(Q.currentAVMsg,n,{callMode:n.sender===Q.userInfo.id?"call":"invite",checkedIds:[]}),Q.showVideo||Q.showMultipleVideo?console.log("用户忙!"):Q.showMultipleVideo=!0;break;case x.NEW_SESSION:if(s===R.GROUP)return;oe(r);break;case x.JOIN:if(s===R.GROUP)return;oe(r),Y.value.subscribe(`/topic/group/${r.receiver}`,(({body:e})=>ae({body:e,chatType:R.GROUP})))}}catch(e){console.log(e)}}return async function(){ne(),async function(){const e=await U({orgId:Q.orgId,keyword:"",page:1,pageSize:1e4});if(!C(e.records))return;Q.userList=e.records}()}(),r((()=>{var e;null==(e=Y.value)||e.disconnect()})),F({getUnreadData:function(){return Q.sessionList.filter((e=>O(e.unreadNum)&&e.unreadNum>0))},openSession:X,closeSession:Z,getCurrentSession:ee}),(e,s)=>(n(),i("div",{class:"iho-chat",style:a(c(D))},[d(c(g),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[W.value?(n(),l(c(v),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[m("div",q,[d(k),d(V,{title:"发起群聊",mode:"create","default-value":[Q.userInfo.id]},null,8,["default-value"]),m("div",z,[h(e.$slots,"toolbar")])]),d(c(S),{class:"iho-chat__body","has-sider":""},{default:u((()=>[d(b),d(c(y),{class:"chat-content"},{default:u((()=>[d(I),d(M),d(T)])),_:1}),h(e.$slots,"external")])),_:3}),Q.showVideo?(n(),l(j,{key:0})):f("v-if",!0),Q.showMultipleVideo?(n(),l(w,{key:1})):f("v-if",!0)],64))])),_:3})],4))}});export{F as default};
1
+ import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as n,openBlock as r,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as l,Fragment as p,createElementVNode as m,renderSlot as h,createCommentVNode as f}from"vue";import{NConfigProvider as g,NSpin as y,NLayout as v,NLayoutContent as S}from"naive-ui";import b from"./components/SiderList.vue.js";import M from"./components/ChatHeader.vue.js";import I from"./components/ChatMain.vue.js";import k from"./components/ChatFooter.vue.js";import T from"./components/ChatSearch.vue.js";import V from"./components/ChatAdd.vue.js";import j from"./components/Video.vue.js";import N from"./components/MultipleVideo.vue.js";import{ChatSock as w}from"./utils/chatSock.js";import{instanceAxios as L,readMessageApi as U}from"./api/index.js";import{useTheme as _}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as A}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{CHAT_TYPE as C,SUBSCRIBE_MESSAGE_TYPE as O,AV_STATUS as x}from"./constants/index.js";import{InjectionIChatState as R,InjectionIChatStompClient as G,InjectionIChatEmits as K}from"./types/index.js";import{isAudioOrVideoMessage as E}from"./utils/index.js";import{useSession as B}from"./hooks/useSession.js";import"trtc-sdk-v5";const J={key:0,class:"iho-chat__header"},P={class:"toolbar"};var $=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},chatBox:{type:Boolean,default:!1},defaultSessionKey:{type:String}},emits:["template-click","unread-message-update"],setup(e,{expose:$,emit:q}){const F=e;L.defaults.baseURL=F.baseURL,L.defaults.headers.Authorization="bearer "+F.token;const H=_(),z=s(!1),D=s(),W=o({orgId:F.orgId,currentSessionItem:{},id:"",userInfo:{id:F.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1});t(R,W),t(G,D),t(K,q);const{openSession:Y,closeSession:Q,getCurrentSession:X,setSessionList:Z,setUpdateSessionItem:ee,setCurrentSessionItem:se}=B(W),oe=[];function te(){const e={headers:{AccessToken:F.token,UserId:F.userId},heartbeatFn(){try{D.value.send("test")}catch(e){D.value.disconnect(),te()}},connectCb(){console.log("连接成功"),D.value.subscribe("/user/topic/single",(({body:e})=>re({body:e,chatType:C.SINGLE}))),D.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:o,currentUser:t,sessionVos:n}=s;if(console.log("body",s),Object.assign(W.userInfo,t,o),!(null==n?void 0:n.length))return;Z(n),oe.splice(0,oe.length),oe.push(...n.filter((e=>e.chatType===C.GROUP))),oe.forEach((e=>{D.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>re({body:e,chatType:C.GROUP})))})),function(){const e=W.sessionList.find((e=>e.sessionKey===F.defaultSessionKey));e&&Y(e)}()}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};D.value=new w("/fdp-chat/websocket",e)}async function ne(e,s){if(W.currentMsg=e,e.sessionKey===W.currentSessionItem.sessionKey)return W.isAppendMsg=!0,e.sender!==W.userInfo.id&&await U({chatType:s,messageIdSet:[e.id],receiver:W.userInfo.id,sender:e.sender}),void se({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const o={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName};ee(o)}async function re({body:e,chatType:s}){try{console.log(JSON.parse(e),"订阅新增消息");const o=JSON.parse(e),{messageVo:t,sessionVo:n,chatAvStatusVo:r}=o;switch(o.event){case O.MESSAGE:E(t.content)?!W.showVideo&&!W.showMultipleVideo||t.content.avStatus!==x.IN_CALL?(W.currentMsg=t,Object.assign(W.currentAVMsg,{strRoomId:t.sessionKey,chatMessageType:t.content.chatMessageType,callMode:t.sender===W.userInfo.id?"call":"invite",currentMsg:t}),W.showVideo||W.showMultipleVideo?ne(t,s):W.showVideo=!0):(D.value.send("/app/chat/send",{},JSON.stringify({chatType:C.SINGLE,receiver:t.sender,content:{chatMessageType:t.content.chatMessageType,avStatus:x.CALL_BUSY}})),console.log("用户忙!")):ne(t,s);break;case O.AV_STATUS:Object.assign(W.currentAVMsg,r,{callMode:r.sender===W.userInfo.id?"call":"invite",checkedIds:[]}),W.showVideo||W.showMultipleVideo?console.log("用户忙!"):W.showMultipleVideo=!0;break;case O.NEW_SESSION:if(s===C.GROUP)return;ee(n);break;case O.JOIN:if(s===C.GROUP)return;ee(n),D.value.subscribe(`/topic/group/${n.receiver}`,(({body:e})=>re({body:e,chatType:C.GROUP})))}}catch(e){console.log(e)}}return async function(){te()}(),n((()=>{var e;null==(e=D.value)||e.disconnect()})),$({getUnreadData:function(){return W.sessionList.filter((e=>A(e.unreadNum)&&e.unreadNum>0))},openSession:Y,closeSession:Q,getCurrentSession:X}),(s,o)=>(r(),i("div",{class:"iho-chat",style:a(c(H))},[d(c(g),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[z.value?(r(),l(c(y),{key:0,stroke:"#5585f5"})):(r(),i(p,{key:1},[e.chatBox?f("v-if",!0):(r(),i("div",J,[d(T),d(V,{title:"发起群聊",mode:"create","default-value":[W.userInfo]},null,8,["default-value"]),m("div",P,[h(s.$slots,"toolbar")])])),d(c(v),{class:"iho-chat__body","has-sider":""},{default:u((()=>[e.chatBox?f("v-if",!0):(r(),l(b,{key:0})),d(c(S),{class:"chat-content"},{default:u((()=>[d(M),d(I),d(k)])),_:1}),h(s.$slots,"external")])),_:3}),W.showVideo?(r(),l(j,{key:1})):f("v-if",!0),W.showMultipleVideo?(r(),l(N,{key:2})):f("v-if",!0)],64))])),_:3})],4))}});export{$ as default};
@@ -14,9 +14,10 @@ declare const _default: import("vue").DefineComponent<{
14
14
  };
15
15
  disabledIds: {
16
16
  type: PropType<string[]>;
17
+ default: () => never[];
17
18
  };
18
19
  defaultValue: {
19
- type: PropType<string[]>;
20
+ type: PropType<AnyObject[]>;
20
21
  };
21
22
  }, {
22
23
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -33,34 +34,52 @@ declare const _default: import("vue").DefineComponent<{
33
34
  };
34
35
  disabledIds: {
35
36
  type: PropType<string[]>;
37
+ default: () => never[];
36
38
  };
37
39
  defaultValue: {
38
- type: PropType<string[]>;
40
+ type: PropType<AnyObject[]>;
39
41
  };
40
42
  }>> & {
41
43
  onComfirm?: ((...args: any[]) => any) | undefined;
42
44
  }>>;
43
45
  emit: (event: "comfirm", ...args: any[]) => void;
44
46
  state: import("../types").IState;
47
+ listRef: import("vue").Ref<any>;
48
+ keyword: import("vue").Ref<any>;
45
49
  showModal: import("vue").Ref<boolean>;
46
- checkedIds: import("vue").Ref<(string | number)[]>;
50
+ checkedOptions: import("vue").Ref<AnyObject[]>;
47
51
  options: import("vue").Ref<AnyObject[]>;
48
52
  groupName: import("vue").Ref<string>;
53
+ checkedSourceIds: import("vue").Ref<(string | number)[]>;
54
+ userList: import("vue").Ref<AnyObject[]>;
55
+ handleInput: () => void;
56
+ _disabledIds: import("vue").ComputedRef<any[]>;
57
+ defaultOptions: import("vue").ComputedRef<{
58
+ id: any;
59
+ name: any;
60
+ avatar: any;
61
+ }[]>;
62
+ checkedIds: import("vue").ComputedRef<any[]>;
49
63
  btnDisabled: import("vue").ComputedRef<boolean>;
64
+ allChecked: import("vue").WritableComputedRef<boolean>;
50
65
  handlePositiveClick: () => Promise<void>;
51
- renderSourceLabel: ({ option }: {
52
- option: AnyObject;
53
- }) => JSX.Element;
54
- renderTargetList: (props: {
55
- onCheck: (checkedValueList: Array<string | number>) => void;
56
- checkedOptions: AnyObject[];
57
- pattern: string;
58
- }) => JSX.Element | null;
66
+ updateCheckedSourceIds: () => void;
67
+ handleSourceIdsUpdate: (value: (string | number)[], meta: {
68
+ actionType: 'check' | 'uncheck';
69
+ value: string | number;
70
+ }) => void;
71
+ closeTag: (id: string) => void;
72
+ renderTargetList: () => JSX.Element[] | null;
59
73
  NModal: any;
60
74
  NButton: any;
61
- NTransfer: any;
75
+ NSpace: any;
76
+ NAvatar: any;
62
77
  NIcon: any;
78
+ NTag: any;
63
79
  NInput: any;
80
+ NCheckbox: any;
81
+ NCheckboxGroup: any;
82
+ SearchOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
64
83
  AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
65
84
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
66
85
  title: {
@@ -76,14 +95,16 @@ declare const _default: import("vue").DefineComponent<{
76
95
  };
77
96
  disabledIds: {
78
97
  type: PropType<string[]>;
98
+ default: () => never[];
79
99
  };
80
100
  defaultValue: {
81
- type: PropType<string[]>;
101
+ type: PropType<AnyObject[]>;
82
102
  };
83
103
  }>> & {
84
104
  onComfirm?: ((...args: any[]) => any) | undefined;
85
105
  }, {
86
106
  mode: string;
87
107
  title: string;
108
+ disabledIds: string[];
88
109
  }>;
89
110
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,watch as l,openBlock as o,createElementBlock as r,Fragment as i,createVNode as s,unref as n,withCtx as u,createElementVNode as d,createCommentVNode as c,renderSlot as p}from"vue";import{NModal as v,NInput as f,NTransfer as m,NButton as h,NIcon as b,NAvatar as g,NTag as y}from"naive-ui";import{AddOutline as I}from"@vicons/ionicons5";import{useState as k}from"../hooks/useState.js";import"date-fns";import{isArray as w,uniqBy as x,xorBy as S}from"lodash-es";import"../utils/emoji.js";import{groupJoinApi as _,groupCreateApi as j}from"../api/index.js";import"trtc-sdk-v5";const C={class:"iho-chat-dialog__content iho-chat-add-wrapper"},A={key:0,class:"input-box"},U=d("span",null,"群名称:",-1),V={class:"transfer-box"};var z=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array},defaultValue:{type:Array}},emits:["comfirm"],setup(e,{emit:z}){const D=e,{state:G}=k(),L=t(!1),M=t([]),O=t([]),P=t(""),$=a((()=>"create"===D.mode?M.value.length<3:M.value.length<1));async function q(){switch(D.mode){case"create":await j({creator:G.userInfo.id,memberIdSet:M.value,name:P.value,orgId:G.orgId});break;case"join":await _({groupId:G.currentSessionItem.receiver,operator:G.userInfo.id,memberIdSet:M.value}),G.currentGroupUser.push(O.value.filter((e=>M.value.includes(e.value))));break;default:z("comfirm",M.value)}L.value=!1}function B({option:e}){return s("div",{style:"display: flex;align-items: center"},[s(g,{src:e.avatar,round:!0,size:32},null),s("span",{style:"margin-left: 10px"},[e.name])])}function E(e){const{onCheck:t,checkedOptions:a,pattern:l}=e;return a.length>0?s("div",{class:"checked-tag-box"},[a.map((e=>s(y,{bordered:!1,closable:e.id!==G.userInfo.id,onClose:()=>t(S(a,[e],"id").map((e=>e.id)))},{avatar:()=>s(g,{round:!0,src:e.avatar},null),default:()=>e.name})))]):null}return l((()=>L.value),(e=>{if(!e)return;const t=w(D.options)&&D.options.length?D.options:G.userList;O.value=x(t,"id").map((e=>{var t;return{...e,label:e.name,value:e.id,disabled:e.id===G.userInfo.id||(null==(t=D.disabledIds)?void 0:t.includes(e.id))}})),w(D.defaultValue)&&D.defaultValue.length?M.value=D.defaultValue:M.value=[]})),(t,a)=>(o(),r(i,null,[s(n(v),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog",show:L.value,"onUpdate:show":a[2]||(a[2]=e=>L.value=e),"negative-text":"取消","positive-text":"确定","positive-button-props":{disabled:n($)},onPositiveClick:q},{default:u((()=>[d("div",C,["create"===e.mode?(o(),r("div",A,[U,s(n(f),{clearable:"",placeholder:"取个群名称方便后续搜索",value:P.value,"onUpdate:value":a[0]||(a[0]=e=>P.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):c("v-if",!0),d("div",V,[s(n(m),{size:"large",value:M.value,"onUpdate:value":a[1]||(a[1]=e=>M.value=e),"virtual-scroll":"",options:O.value,"render-source-label":B,"render-target-list":E,"source-filterable":""},null,8,["value","options"])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:a[3]||(a[3]=e=>L.value=!0)},[p(t.$slots,"trigger",{},(()=>[s(n(h),{color:"#ffffff4D",class:"add-btn"},{icon:u((()=>[s(n(b),{component:n(I),color:"#fff"},null,8,["component"])])),_:1})]))])],64))}});export{z as default};
1
+ import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as u,Fragment as o,createVNode as s,unref as r,withCtx as d,createElementVNode as n,createCommentVNode as v,isRef as c,renderList as p,createBlock as f,toDisplayString as m,createTextVNode as h,renderSlot as b}from"vue";import{NModal as g,NInput as k,NIcon as y,NCheckbox as _,NCheckboxGroup as I,NSpace as x,NAvatar as w,NTag as S,NButton as U}from"naive-ui";import{SearchOutline as j,AddOutline as C}from"@vicons/ionicons5";import{useState as L}from"../hooks/useState.js";import{listSort as A}from"../utils/index.js";import{cloneDeep as V,union as R,unionBy as E,remove as G,isArray as M,uniqBy as T}from"lodash-es";import{CHAT_TYPE as z}from"../constants/index.js";import{groupJoinApi as D,groupCreateApi as N}from"../api/index.js";import"trtc-sdk-v5";import{useSearchUserList as P}from"../hooks/useSearchUserList.js";const $={class:"iho-chat-dialog__content iho-chat-add-wrapper"},q={key:0,class:"input-box"},B=n("span",null,"群名称:",-1),F={class:"transfer-box"},H={class:"transfer-box__left"},J={class:"user-list-box"},K={key:1,class:"no-data"},O={class:"transfer-box__right"},Q={class:"checked-tag-box"};var W=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array}},emits:["comfirm"],setup(e,{emit:W}){const X=e,{state:Y}=L(),Z=a(),ee=a(),ae=a(!1),le=a([]),te=a([]),ie=a(""),ue=a([]),{userList:oe,handleInput:se}=P({wrapperRef:Z,keywordRef:ee,before:()=>{oe.value=V(te.value),fe()},after:()=>{oe.value.forEach((e=>{var a;e.disabled=null==(a=re.value)?void 0:a.includes(e.id)})),fe()}}),re=l((()=>R(X.disabledIds,[Y.userInfo.id]))),de=l((()=>{var e,a;return(null==(e=Y.sessionList)?void 0:e.length)?null==(a=A(Y.sessionList).filter((e=>e.chatType===z.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar}))):[]})),ne=l((()=>le.value.length?le.value.map((e=>e.id)):[])),ve=l((()=>"create"===X.mode?ne.value.length<3:ne.value.length<1)),ce=l({get:()=>ue.value.length===oe.value.filter((e=>!e.disabled)).length,set(e){const a=oe.value.filter((e=>!e.disabled));ue.value=e?a.map((e=>e.id)):[],e?le.value=E(le.value,a,"id"):G(le.value,(e=>a.map((e=>e.id)).includes(e.id)))}});async function pe(){switch(X.mode){case"create":await N({creator:Y.userInfo.id,memberIdSet:ne.value,name:ie.value,orgId:Y.orgId});break;case"join":await D({groupId:Y.currentSessionItem.receiver,operator:Y.userInfo.id,memberIdSet:ne.value}),Y.currentGroupUser.push(oe.value.filter((e=>ne.value.includes(e.value))));break;default:W("comfirm",ne.value)}ae.value=!1}function fe(){var e,a;ue.value=null!=(a=null==(e=oe.value.filter((e=>ne.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function me(e,a){if("check"===a.actionType){const e=oe.value.find((e=>e.id===a.value));le.value.push(e)}else G(le.value,(e=>e.id===a.value))}return t((()=>ae.value),(e=>{if(!e)return;const a=M(X.options)&&X.options.length?X.options:de.value;te.value=T(a,"id").map((e=>{var a;return{...e,disabled:null==(a=re.value)?void 0:a.includes(e.id)}})),oe.value=V(te.value),M(X.defaultValue)&&X.defaultValue.length?(le.value=V(X.defaultValue),fe()):(le.value=[],ue.value=[])})),(a,l)=>(i(),u(o,null,[s(r(g),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:ae.value,"onUpdate:show":l[4]||(l[4]=e=>ae.value=e),"negative-text":"取消","positive-text":"确定","positive-button-props":{disabled:r(ve)},onPositiveClick:pe},{default:d((()=>[n("div",$,["create"===e.mode?(i(),u("div",q,[B,s(r(k),{clearable:"",placeholder:"取个群名称方便后续搜索",value:ie.value,"onUpdate:value":l[0]||(l[0]=e=>ie.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),n("div",F,[n("div",H,[s(r(k),{placeholder:"搜索",clearable:"",value:ee.value,"onUpdate:value":[l[1]||(l[1]=e=>ee.value=e),r(se)],valueModifiers:{trim:!0}},{prefix:d((()=>[s(r(y),{component:r(j)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),n("div",J,[r(oe).length>0?(i(),u(o,{key:0},[s(r(_),{label:"全选",checked:r(ce),"onUpdate:checked":l[2]||(l[2]=e=>c(ce)?ce.value=e:null)},null,8,["checked"]),s(r(I),{ref_key:"listRef",ref:Z,value:ue.value,"onUpdate:value":[l[3]||(l[3]=e=>ue.value=e),me]},{default:d((()=>[(i(!0),u(o,null,p(r(oe),(e=>(i(),f(r(_),{key:e.id,value:e.id,disabled:e.disabled},{default:d((()=>[s(r(x),{align:"center","wrap-item":!1},{default:d((()=>[s(r(w),{src:e.avatar,round:"",size:32},null,8,["src"]),n("span",null,m(e.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),u("div",K,"找不到相关结果"))])]),n("div",O,[n("span",null,"已选择 "+m(r(ne).length)+" 人",1),n("div",Q,[(i(!0),u(o,null,p(le.value,(e=>(i(),f(r(S),{key:e.id,bordered:!1,closable:e.id!==r(Y).userInfo.id,disabled:r(re).includes(e.id),onClose:()=>{return a=e.id,G(le.value,(e=>e.id===a)),void G(ue.value,(e=>e===a));var a}},{avatar:d((()=>[s(r(w),{round:"",src:e.avatar},null,8,["src"])])),default:d((()=>[h(" "+m(e.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))])])])])])),_:1},8,["title","show","positive-button-props"]),n("span",{class:"btn-wrapper",onClick:l[5]||(l[5]=e=>ae.value=!0)},[b(a.$slots,"trigger",{},(()=>[s(r(U),{color:"#ffffff4D",class:"add-btn"},{icon:d((()=>[s(r(y),{component:r(C),color:"#fff"},null,8,["component"])])),_:1})]))])],64))}});export{W as default};
@@ -8,7 +8,6 @@ type FileOptions = {
8
8
  };
9
9
  declare const _default: import("vue").DefineComponent<{}, {
10
10
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
11
- content: import("vue").Ref<string>;
12
11
  state: import("../types").IState;
13
12
  sendMessage: (message: {
14
13
  chatType?: string | undefined;
@@ -17,6 +16,11 @@ declare const _default: import("vue").DefineComponent<{}, {
17
16
  }) => Promise<void>;
18
17
  isGroupChat: import("vue").ComputedRef<boolean>;
19
18
  showEmoji: import("vue").Ref<boolean>;
19
+ content: import("vue").Ref<string>;
20
+ chatAddProps: import("vue").ComputedRef<{
21
+ options: AnyObject[];
22
+ defaultValue: AnyObject[];
23
+ }>;
20
24
  handleCall: (chatMessageType: string, checkedIds?: never[]) => void;
21
25
  handleKeyDown: (event: KeyboardEvent) => void;
22
26
  isWrap: (event: KeyboardEvent) => boolean;
@@ -45,9 +49,10 @@ declare const _default: import("vue").DefineComponent<{}, {
45
49
  };
46
50
  disabledIds: {
47
51
  type: import("vue").PropType<string[]>;
52
+ default: () => never[];
48
53
  };
49
54
  defaultValue: {
50
- type: import("vue").PropType<string[]>;
55
+ type: import("vue").PropType<AnyObject[]>;
51
56
  };
52
57
  }, {
53
58
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -64,34 +69,52 @@ declare const _default: import("vue").DefineComponent<{}, {
64
69
  };
65
70
  disabledIds: {
66
71
  type: import("vue").PropType<string[]>;
72
+ default: () => never[];
67
73
  };
68
74
  defaultValue: {
69
- type: import("vue").PropType<string[]>;
75
+ type: import("vue").PropType<AnyObject[]>;
70
76
  };
71
77
  }>> & {
72
78
  onComfirm?: ((...args: any[]) => any) | undefined;
73
79
  }>>;
74
80
  emit: (event: "comfirm", ...args: any[]) => void;
75
81
  state: import("../types").IState;
82
+ listRef: import("vue").Ref<any>;
83
+ keyword: import("vue").Ref<any>;
76
84
  showModal: import("vue").Ref<boolean>;
77
- checkedIds: import("vue").Ref<(string | number)[]>;
85
+ checkedOptions: import("vue").Ref<AnyObject[]>;
78
86
  options: import("vue").Ref<AnyObject[]>;
79
87
  groupName: import("vue").Ref<string>;
88
+ checkedSourceIds: import("vue").Ref<(string | number)[]>;
89
+ userList: import("vue").Ref<AnyObject[]>;
90
+ handleInput: () => void;
91
+ _disabledIds: import("vue").ComputedRef<any[]>;
92
+ defaultOptions: import("vue").ComputedRef<{
93
+ id: any;
94
+ name: any;
95
+ avatar: any;
96
+ }[]>;
97
+ checkedIds: import("vue").ComputedRef<any[]>;
80
98
  btnDisabled: import("vue").ComputedRef<boolean>;
99
+ allChecked: import("vue").WritableComputedRef<boolean>;
81
100
  handlePositiveClick: () => Promise<void>;
82
- renderSourceLabel: ({ option }: {
83
- option: AnyObject;
84
- }) => JSX.Element;
85
- renderTargetList: (props: {
86
- onCheck: (checkedValueList: (string | number)[]) => void;
87
- checkedOptions: AnyObject[];
88
- pattern: string;
89
- }) => JSX.Element | null;
101
+ updateCheckedSourceIds: () => void;
102
+ handleSourceIdsUpdate: (value: (string | number)[], meta: {
103
+ actionType: "check" | "uncheck";
104
+ value: string | number;
105
+ }) => void;
106
+ closeTag: (id: string) => void;
107
+ renderTargetList: () => JSX.Element[] | null;
90
108
  NModal: any;
91
109
  NButton: any;
92
- NTransfer: any;
110
+ NSpace: any;
111
+ NAvatar: any;
93
112
  NIcon: any;
113
+ NTag: any;
94
114
  NInput: any;
115
+ NCheckbox: any;
116
+ NCheckboxGroup: any;
117
+ SearchOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
95
118
  AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
96
119
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
97
120
  title: {
@@ -107,15 +130,17 @@ declare const _default: import("vue").DefineComponent<{}, {
107
130
  };
108
131
  disabledIds: {
109
132
  type: import("vue").PropType<string[]>;
133
+ default: () => never[];
110
134
  };
111
135
  defaultValue: {
112
- type: import("vue").PropType<string[]>;
136
+ type: import("vue").PropType<AnyObject[]>;
113
137
  };
114
138
  }>> & {
115
139
  onComfirm?: ((...args: any[]) => any) | undefined;
116
140
  }, {
117
141
  mode: string;
118
142
  title: string;
143
+ disabledIds: string[];
119
144
  }>;
120
145
  emojis: {
121
146
  default: string[][];
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as n,withDirectives as o,openBlock as i,createElementBlock as s,normalizeStyle as r,unref as a,createElementVNode as l,toDisplayString as c,createVNode as u,createCommentVNode as d,withCtx as f,Fragment as p,renderList as m,createBlock as g,createTextVNode as y,vShow as h}from"vue";import{NIcon as v,NPopover as M,NButton as k,NTooltip as C,NUpload as _,NUploadTrigger as x}from"naive-ui";import I from"./ChatAdd.vue.js";import{useState as b}from"../hooks/useState.js";import{useSession as w}from"../hooks/useSession.js";import{MESSAGE_TYPE as T,AV_STATUS as z}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as E}from"../utils/index.js";import{emojis as j}from"../utils/emoji.js";import{uploadFileApi as R}from"../api/index.js";import{CloseCircleOutline as q,CallOutline as L,VideocamOutline as D}from"@vicons/ionicons5";import{xor as O,cloneDeep as A}from"lodash-es";import{uuidGenerator as U}from"../../../../shared/utils/index.js";const V={key:0,class:"reference-content-box"},F={class:"reference-content"},K=["innerHTML"],G={class:"tool-box"},S=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),H={class:"emoji-box"},N=l("span",null,"默认表情",-1),J={class:"list-box"},X=["src"],B=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),P=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),Q=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),W={class:"btn-box"},Y=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var Z=e({__name:"ChatFooter",setup(e){const Z=t(),$=t(""),{state:ee,sendMessage:te}=b(),{isGroupChat:ne}=w(ee),oe=t(!1);function ie(e,t=[]){const n=U(),o=[],i=t.length>0;ee.showVideo||ee.showMultipleVideo||(i?(o.push(...O(t,[ee.userInfo.id])),Object.assign(ee.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),ee.showMultipleVideo=!0):te({content:{chatMessageType:e,msg:"",avStatus:z.IN_CALL}}))}function se(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),le()))}function re(){var e,t;$.value=(null==(t=null==(e=Z.value)?void 0:e.innerText)?void 0:t.trim())||""}async function ae(e,t){const{file:n,name:o}=e.file,i=new FormData;i.append("sender",ee.userInfo.id),i.append("file",n);const s=await R(i);if(!s)return console.log("上传失败");ce({chatMessageType:t,msg:t===T.FILE?o:s,url:s})}function le(){if(!($.value.length>2e3))return $.value?void ce({msg:$.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function ce(e){const{chatMessageType:t=T.TEXT,msg:n,url:o}=e,i={msg:n,chatMessageType:t};t===T.FILE&&(i.fileUrl=o),[T.TEXT,T.BLEND].includes(t)&&(Z.value.innerHTML="",$.value=""),ee.currentReferenceMsg&&(i.referenceContent=A(ee.currentReferenceMsg),ee.currentReferenceMsg=null),te({content:i})}return n((()=>ee.currentReferenceMsg),(e=>{var t;e&&(null==(t=Z.value)||t.focus())})),(e,t)=>o((i(),s("section",{class:"chat-footer",style:r({cursor:a(ee).id?"default":"not-allowed"})},[a(ee).currentReferenceMsg?(i(),s("div",V,[l("div",F,[l("span",null,c(a(ee).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:a(E)(a(ee).currentReferenceMsg.content)},null,8,K)]),u(a(v),{component:a(q),onClick:t[0]||(t[0]=()=>a(ee).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",G,[u(a(M),{show:oe.value,"onUpdate:show":t[1]||(t[1]=e=>oe.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[S])),_:1})])),default:f((()=>[l("div",H,[d(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),N,l("div",J,[(i(!0),s(p,null,m(a(j).default,(([e,t])=>(i(),g(a(C),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny",onClick:()=>function(e){oe.value=!1,ce({chatMessageType:T.EMOJI,msg:e})}(e)},{icon:f((()=>[l("img",{src:t},null,8,X)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+c(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),u(a(k),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>ce({chatMessageType:a(T).EMOJI,msg:0}))},{icon:f((()=>[B])),_:1}),u(a(_),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ae(e,a(T).IMAGE))},{default:f((()=>[u(a(x),{abstract:""},{default:f((({handleClick:e})=>[u(a(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[P])),_:2},1032,["onClick"])])),_:1})])),_:1}),u(a(_),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ae(e,a(T).FILE))},{default:f((()=>[u(a(x),{abstract:""},{default:f((({handleClick:e})=>[u(a(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[Q])),_:2},1032,["onClick"])])),_:1})])),_:1}),a(ne)?(i(),s(p,{key:0},[u(I,{options:a(ee).currentGroupUser,"default-value":[a(ee).userInfo.id],onComfirm:t[5]||(t[5]=e=>ie(a(T).AUDIO,e))},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[u(a(v),{size:"18",component:a(L)},null,8,["component"])])),_:1})])),_:1},8,["options","default-value"]),u(I,{options:a(ee).currentGroupUser,"default-value":[a(ee).userInfo.id],onComfirm:t[6]||(t[6]=e=>ie(a(T).VIDEO,e))},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[u(a(v),{size:"20",component:a(D)},null,8,["component"])])),_:1})])),_:1},8,["options","default-value"])],64)):(i(),s(p,{key:1},[u(a(k),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ie(a(T).AUDIO))},{icon:f((()=>[u(a(v),{size:"18",component:a(L)},null,8,["component"])])),_:1}),u(a(k),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ie(a(T).VIDEO))},{icon:f((()=>[u(a(v),{size:"20",component:a(D)},null,8,["component"])])),_:1})],64))]),o(l("div",{ref_key:"inputRef",ref:Z,class:"input-box",contenteditable:"",onKeydown:se,onInput:re},null,544),[[h,a(ee).id]]),l("div",W,[Y,u(a(k),{type:"primary",round:"",disabled:!$.value,onClick:le},{default:f((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[h,a(ee).id]])}});export{Z as default};
1
+ import{defineComponent as e,ref as t,computed as n,watch as o,withDirectives as i,openBlock as s,createElementBlock as r,normalizeStyle as c,unref as a,createElementVNode as l,toDisplayString as u,createVNode as m,createCommentVNode as d,withCtx as f,Fragment as p,renderList as g,createBlock as h,createTextVNode as y,mergeProps as v,vShow as M}from"vue";import{NIcon as k,NPopover as C,NButton as _,NTooltip as I,NUpload as x,NUploadTrigger as T}from"naive-ui";import b from"./ChatAdd.vue.js";import{useState as E}from"../hooks/useState.js";import{useSession as w}from"../hooks/useSession.js";import{MESSAGE_TYPE as z,AV_STATUS as L}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as j}from"../utils/index.js";import{emojis as R}from"../utils/emoji.js";import{uploadFileApi as q}from"../api/index.js";import{CloseCircleOutline as O,CallOutline as D,VideocamOutline as A}from"@vicons/ionicons5";import{xor as V,cloneDeep as K}from"lodash-es";import{uuidGenerator as F}from"../../../../shared/utils/index.js";const H={key:0,class:"reference-content-box"},U={class:"reference-content"},G=["innerHTML"],J={class:"tool-box"},N=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),S={class:"emoji-box"},X=l("span",null,"默认表情",-1),B={class:"list-box"},$=["src"],P=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),Q=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),W=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),Y={class:"btn-box"},Z=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var ee=e({__name:"ChatFooter",setup(e){const ee=t(),{state:te,sendMessage:ne}=E(),{isGroupChat:oe}=w(te),ie=t(!1),se=t(""),re=n((()=>({options:te.currentGroupUser,defaultValue:[te.userInfo]})));function ce(e,t=[]){const n=F(),o=[],i=t.length>0;te.showVideo||te.showMultipleVideo||(i?(o.push(...V(t,[te.userInfo.id])),Object.assign(te.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),te.showMultipleVideo=!0):ne({content:{chatMessageType:e,msg:"",avStatus:L.IN_CALL}}))}function ae(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),me()))}function le(){var e;se.value=(null==(e=ee.value)?void 0:e.innerHTML)||""}async function ue(e,t){const{file:n,name:o}=e.file,i=new FormData;i.append("sender",te.userInfo.id),i.append("file",n);const s=await q(i);if(!s)return console.log("上传失败");de({chatMessageType:t,msg:t===z.FILE?o:s,url:s})}function me(){const{innerHTML:e="",innerText:t=""}=ee.value||{};if(se.value.trim().length>2e3)return void console.log("请控制在2000字以内");if(!se.value)return console.log("请输入内容");const n=e.split(t).find((e=>!!e));let o=z.TEXT,i="";if(n){if(t.replace(/\n$/,"")||(e.match(/<img[^>]*>/gi)||[]).length>1)o=z.BLEND,i=e;else if(e.includes(z.EMOJI)){o=z.EMOJI;const t=e.match(/data-msg\s*=\s*"([^"]*)"/);t&&(i=t[1])}else{o=z.IMAGE;const t=e.match(/src\s*=\s*"([^"]*)"/);t&&(i=t[1])}}else i=t.trim();i&&de({msg:i,chatMessageType:o,origin:"btn"})}async function de(e){const{chatMessageType:t=z.TEXT,msg:n,url:o,origin:i=""}=e,s={msg:n,chatMessageType:t};t===z.FILE&&(s.fileUrl=o),"btn"===i&&(ee.value.innerHTML="",se.value=""),te.currentReferenceMsg&&(t===z.TEXT&&(s.referenceContent=K(te.currentReferenceMsg)),te.currentReferenceMsg=null),ne({content:s})}return o((()=>te.currentReferenceMsg),(e=>{var t;e&&(null==(t=ee.value)||t.focus())})),(e,t)=>i((s(),r("section",{class:"chat-footer",style:c({cursor:a(te).id?"default":"not-allowed"})},[a(te).currentReferenceMsg?(s(),r("div",H,[l("div",U,[l("span",null,u(a(te).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:a(j)(a(te).currentReferenceMsg.content)},null,8,G)]),m(a(k),{component:a(O),onClick:t[0]||(t[0]=()=>a(te).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",J,[m(a(C),{show:ie.value,"onUpdate:show":t[1]||(t[1]=e=>ie.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[m(a(_),{quaternary:"",size:"tiny"},{icon:f((()=>[N])),_:1})])),default:f((()=>[l("div",S,[d(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),X,l("div",B,[(s(!0),r(p,null,g(a(R).default,(([e,t])=>(s(),h(a(I),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[m(a(_),{quaternary:"",size:"tiny",onClick:()=>function(e){ie.value=!1,de({chatMessageType:z.EMOJI,msg:e})}(e)},{icon:f((()=>[l("img",{src:t},null,8,$)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),m(a(_),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>de({chatMessageType:a(z).EMOJI,msg:0}))},{icon:f((()=>[P])),_:1}),m(a(x),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ue(e,a(z).IMAGE))},{default:f((()=>[m(a(T),{abstract:""},{default:f((({handleClick:e})=>[m(a(_),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[Q])),_:2},1032,["onClick"])])),_:1})])),_:1}),m(a(x),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ue(e,a(z).FILE))},{default:f((()=>[m(a(T),{abstract:""},{default:f((({handleClick:e})=>[m(a(_),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[W])),_:2},1032,["onClick"])])),_:1})])),_:1}),a(oe)?(s(),r(p,{key:0},[m(b,v(a(re),{onComfirm:t[5]||(t[5]=e=>ce(a(z).AUDIO,e))}),{trigger:f((()=>[m(a(_),{quaternary:"",size:"tiny"},{icon:f((()=>[m(a(k),{size:"18",component:a(D)},null,8,["component"])])),_:1})])),_:1},16),m(b,v(a(re),{onComfirm:t[6]||(t[6]=e=>ce(a(z).VIDEO,e))}),{trigger:f((()=>[m(a(_),{quaternary:"",size:"tiny"},{icon:f((()=>[m(a(k),{size:"20",component:a(A)},null,8,["component"])])),_:1})])),_:1},16)],64)):(s(),r(p,{key:1},[m(a(_),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ce(a(z).AUDIO))},{icon:f((()=>[m(a(k),{size:"18",component:a(D)},null,8,["component"])])),_:1}),m(a(_),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ce(a(z).VIDEO))},{icon:f((()=>[m(a(k),{size:"20",component:a(A)},null,8,["component"])])),_:1})],64))]),i(l("div",{ref_key:"inputRef",ref:ee,class:"input-box",contenteditable:"",onKeydown:ae,onInput:le},null,544),[[M,a(te).id]]),l("div",Y,[Z,m(a(_),{type:"primary",round:"",disabled:!se.value,onClick:me},{default:f((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[M,a(te).id]])}});export{ee as default};
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{}, {
12
12
  defaultValue?: undefined;
13
13
  } | {
14
14
  mode: string;
15
- defaultValue: any[];
15
+ defaultValue: AnyObject[];
16
16
  disabledIds?: undefined;
17
17
  }>;
18
18
  handleOpenChatFile: (type: string) => void;
@@ -294,6 +294,10 @@ declare const _default: import("vue").DefineComponent<{}, {
294
294
  allowedInvalidValue: {
295
295
  type: StringConstructor;
296
296
  };
297
+ to: {
298
+ type: import("vue").PropType<string | false | HTMLElement>;
299
+ default: string;
300
+ };
297
301
  }, {
298
302
  attrs: {
299
303
  [x: string]: unknown;
@@ -314,6 +318,10 @@ declare const _default: import("vue").DefineComponent<{}, {
314
318
  allowedInvalidValue: {
315
319
  type: StringConstructor;
316
320
  };
321
+ to: {
322
+ type: import("vue").PropType<string | false | HTMLElement>;
323
+ default: string;
324
+ };
317
325
  }>> & {
318
326
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
319
327
  }>>;
@@ -350,10 +358,15 @@ declare const _default: import("vue").DefineComponent<{}, {
350
358
  allowedInvalidValue: {
351
359
  type: StringConstructor;
352
360
  };
361
+ to: {
362
+ type: import("vue").PropType<string | false | HTMLElement>;
363
+ default: string;
364
+ };
353
365
  }>> & {
354
366
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
355
367
  }, {
356
368
  updateUnchangedValue: boolean;
369
+ to: string | false | HTMLElement;
357
370
  }>>;
358
371
  formatTime: typeof import("../utils").formatTime;
359
372
  MESSAGE_TYPE: typeof import("../constants").MESSAGE_TYPE;
@@ -382,9 +395,10 @@ declare const _default: import("vue").DefineComponent<{}, {
382
395
  };
383
396
  disabledIds: {
384
397
  type: import("vue").PropType<string[]>;
398
+ default: () => never[];
385
399
  };
386
400
  defaultValue: {
387
- type: import("vue").PropType<string[]>;
401
+ type: import("vue").PropType<AnyObject[]>;
388
402
  };
389
403
  }, {
390
404
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -401,34 +415,52 @@ declare const _default: import("vue").DefineComponent<{}, {
401
415
  };
402
416
  disabledIds: {
403
417
  type: import("vue").PropType<string[]>;
418
+ default: () => never[];
404
419
  };
405
420
  defaultValue: {
406
- type: import("vue").PropType<string[]>;
421
+ type: import("vue").PropType<AnyObject[]>;
407
422
  };
408
423
  }>> & {
409
424
  onComfirm?: ((...args: any[]) => any) | undefined;
410
425
  }>>;
411
426
  emit: (event: "comfirm", ...args: any[]) => void;
412
427
  state: import("../types").IState;
428
+ listRef: import("vue").Ref<any>;
429
+ keyword: import("vue").Ref<any>;
413
430
  showModal: import("vue").Ref<boolean>;
414
- checkedIds: import("vue").Ref<(string | number)[]>;
431
+ checkedOptions: import("vue").Ref<AnyObject[]>;
415
432
  options: import("vue").Ref<AnyObject[]>;
416
433
  groupName: import("vue").Ref<string>;
434
+ checkedSourceIds: import("vue").Ref<(string | number)[]>;
435
+ userList: import("vue").Ref<AnyObject[]>;
436
+ handleInput: () => void;
437
+ _disabledIds: import("vue").ComputedRef<any[]>;
438
+ defaultOptions: import("vue").ComputedRef<{
439
+ id: any;
440
+ name: any;
441
+ avatar: any;
442
+ }[]>;
443
+ checkedIds: import("vue").ComputedRef<any[]>;
417
444
  btnDisabled: import("vue").ComputedRef<boolean>;
445
+ allChecked: import("vue").WritableComputedRef<boolean>;
418
446
  handlePositiveClick: () => Promise<void>;
419
- renderSourceLabel: ({ option }: {
420
- option: AnyObject;
421
- }) => JSX.Element;
422
- renderTargetList: (props: {
423
- onCheck: (checkedValueList: (string | number)[]) => void;
424
- checkedOptions: AnyObject[];
425
- pattern: string;
426
- }) => JSX.Element | null;
447
+ updateCheckedSourceIds: () => void;
448
+ handleSourceIdsUpdate: (value: (string | number)[], meta: {
449
+ actionType: "check" | "uncheck";
450
+ value: string | number;
451
+ }) => void;
452
+ closeTag: (id: string) => void;
453
+ renderTargetList: () => JSX.Element[] | null;
427
454
  NModal: any;
428
455
  NButton: any;
429
- NTransfer: any;
456
+ NSpace: any;
457
+ NAvatar: any;
430
458
  NIcon: any;
459
+ NTag: any;
431
460
  NInput: any;
461
+ NCheckbox: any;
462
+ NCheckboxGroup: any;
463
+ SearchOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
432
464
  AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
433
465
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
434
466
  title: {
@@ -444,15 +476,17 @@ declare const _default: import("vue").DefineComponent<{}, {
444
476
  };
445
477
  disabledIds: {
446
478
  type: import("vue").PropType<string[]>;
479
+ default: () => never[];
447
480
  };
448
481
  defaultValue: {
449
- type: import("vue").PropType<string[]>;
482
+ type: import("vue").PropType<AnyObject[]>;
450
483
  };
451
484
  }>> & {
452
485
  onComfirm?: ((...args: any[]) => any) | undefined;
453
486
  }, {
454
487
  mode: string;
455
488
  title: string;
489
+ disabledIds: string[];
456
490
  }>;
457
491
  PersonAddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
458
492
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as i,openBlock as t,createElementBlock as s,Fragment as a,unref as n,createElementVNode as r,createVNode as l,withCtx as c,toDisplayString as u,normalizeProps as m,guardReactiveProps as h,createCommentVNode as d}from"vue";import{NAvatar as v,NButton as p,NIcon as f}from"naive-ui";import{useState as y}from"../hooks/useState.js";import{useSession as _}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import j from"./PersonProfile.vue.js";import w from"./ChatSet.vue.js";import C from"./ChatFile.vue.js";import b from"./ChatRecord.vue.js";import g from"./ChatAdd.vue.js";import{PersonAddOutline as k}from"@vicons/ionicons5";const z={key:0,class:"chat-header box-shadow"},S={class:"chat-header__left"},q={class:"name"},I={class:"chat-header__right"},U=r("i",{class:"chat--iconfont chat--icon-image"},null,-1),x=r("i",{class:"chat--iconfont chat--icon-folder"},null,-1),G=r("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),P=r("i",{class:"chat--iconfont chat--icon-set"},null,-1);var A=e({__name:"ChatHeader",setup(e){const{state:A}=y(),{isGroupChat:F}=_(A),H=o(!1),R=o(!1),V=o("image"),B=o(!1),D=i((()=>{const e=A.currentGroupUser.map((e=>e.id));return F.value?{mode:"join",disabledIds:e}:{mode:"create",defaultValue:e}}));function E(e){V.value=e,R.value=!0}return(e,o)=>(t(),s(a,null,[n(A).id?(t(),s("section",z,[r("div",S,[l(j,{"user-id":n(A).currentSessionItem.receiver,disabled:n(F)},{trigger:c((()=>[l(n(v),{round:"",size:30,src:n(A).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),r("span",q,u(n(A).currentSessionItem.name),1)]),r("div",I,[l(n(p),{quaternary:"",size:"tiny",onClick:o[0]||(o[0]=()=>E("image"))},{icon:c((()=>[U])),_:1}),l(n(p),{quaternary:"",size:"tiny",onClick:o[1]||(o[1]=()=>E("file"))},{icon:c((()=>[x])),_:1}),l(g,m(h(n(D))),{trigger:c((()=>[l(n(p),{quaternary:"",size:"tiny"},{icon:c((()=>[l(n(f),{size:"18",component:n(k)},null,8,["component"])])),_:1})])),_:1},16),l(n(p),{quaternary:"",size:"tiny",onClick:o[2]||(o[2]=()=>B.value=!0)},{icon:c((()=>[G])),_:1}),l(n(p),{quaternary:"",size:"tiny",onClick:o[3]||(o[3]=()=>H.value=!0)},{icon:c((()=>[P])),_:1})])])):d("v-if",!0),l(w,{show:H.value,"onUpdate:show":o[4]||(o[4]=e=>H.value=e)},null,8,["show"]),l(C,{show:R.value,"onUpdate:show":o[5]||(o[5]=e=>R.value=e),type:V.value,visible:R.value},null,8,["show","type","visible"]),l(b,{show:B.value,"onUpdate:show":o[6]||(o[6]=e=>B.value=e),visible:B.value},null,8,["show","visible"])],64))}});export{A as default};
1
+ import{defineComponent as e,ref as o,computed as i,openBlock as t,createElementBlock as s,Fragment as a,unref as r,createElementVNode as n,createVNode as l,withCtx as c,toDisplayString as u,normalizeProps as m,guardReactiveProps as h,createCommentVNode as d}from"vue";import{NAvatar as v,NButton as p,NIcon as f}from"naive-ui";import{useState as y}from"../hooks/useState.js";import{useSession as _}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import j from"./PersonProfile.vue.js";import w from"./ChatSet.vue.js";import C from"./ChatFile.vue.js";import b from"./ChatRecord.vue.js";import g from"./ChatAdd.vue.js";import{PersonAddOutline as k}from"@vicons/ionicons5";const z={key:0,class:"chat-header box-shadow"},S={class:"chat-header__left"},q={class:"name"},U={class:"chat-header__right"},I=n("i",{class:"chat--iconfont chat--icon-image"},null,-1),G=n("i",{class:"chat--iconfont chat--icon-folder"},null,-1),x=n("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),P=n("i",{class:"chat--iconfont chat--icon-set"},null,-1);var A=e({__name:"ChatHeader",setup(e){const{state:A}=y(),{isGroupChat:F}=_(A),H=o(!1),R=o(!1),V=o("image"),B=o(!1),D=i((()=>{const e=A.currentGroupUser.map((e=>e.id));return F.value?{mode:"join",disabledIds:e}:{mode:"create",defaultValue:A.currentGroupUser}}));function E(e){V.value=e,R.value=!0}return(e,o)=>(t(),s(a,null,[r(A).id?(t(),s("section",z,[n("div",S,[l(j,{"user-id":r(A).currentSessionItem.receiver,disabled:r(F)},{trigger:c((()=>[l(r(v),{round:"",size:30,src:r(A).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),n("span",q,u(r(A).currentSessionItem.name),1)]),n("div",U,[l(r(p),{quaternary:"",size:"tiny",onClick:o[0]||(o[0]=()=>E("image"))},{icon:c((()=>[I])),_:1}),l(r(p),{quaternary:"",size:"tiny",onClick:o[1]||(o[1]=()=>E("file"))},{icon:c((()=>[G])),_:1}),l(g,m(h(r(D))),{trigger:c((()=>[l(r(p),{quaternary:"",size:"tiny"},{icon:c((()=>[l(r(f),{size:"18",component:r(k)},null,8,["component"])])),_:1})])),_:1},16),l(r(p),{quaternary:"",size:"tiny",onClick:o[2]||(o[2]=()=>B.value=!0)},{icon:c((()=>[x])),_:1}),l(r(p),{quaternary:"",size:"tiny",onClick:o[3]||(o[3]=()=>H.value=!0)},{icon:c((()=>[P])),_:1})])])):d("v-if",!0),l(w,{show:H.value,"onUpdate:show":o[4]||(o[4]=e=>H.value=e)},null,8,["show"]),l(C,{show:R.value,"onUpdate:show":o[5]||(o[5]=e=>R.value=e),type:V.value,visible:R.value},null,8,["show","type","visible"]),l(b,{show:B.value,"onUpdate:show":o[6]||(o[6]=e=>B.value=e),visible:B.value},null,8,["show","visible"])],64))}});export{A as default};
@@ -1,5 +1,6 @@
1
+ import { CSSProperties } from 'vue';
1
2
  import { AnyObject } from '../../../../shared/types';
2
- import { downloadFile, simplifyMessage, isAudioOrVideoMessage, getAVTime } from '../utils';
3
+ import { simplifyMessage, isAudioOrVideoMessage, getAVTime } from '../utils';
3
4
  import { MESSAGE_TYPE } from '../constants';
4
5
  declare const _default: import("vue").DefineComponent<{}, {
5
6
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
@@ -7,7 +8,10 @@ declare const _default: import("vue").DefineComponent<{}, {
7
8
  setMsgList: (list?: AnyObject[]) => void;
8
9
  setCurrentSessionItem: (item: AnyObject) => void;
9
10
  isGroupChat: import("vue").ComputedRef<boolean>;
11
+ contextmenuRef: import("vue").Ref<any>;
10
12
  showMenu: import("vue").Ref<boolean>;
13
+ menuPosition: any;
14
+ menuMsgId: import("vue").Ref<any>;
11
15
  pageInfo: {
12
16
  page: number;
13
17
  hasMore: boolean;
@@ -18,6 +22,8 @@ declare const _default: import("vue").DefineComponent<{}, {
18
22
  '--c-tip-gap': string;
19
23
  }>;
20
24
  getHistoryRecord: () => Promise<void>;
25
+ handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
26
+ setMenuPosition: (event: MouseEvent) => Promise<void>;
21
27
  showMessage: (item: AnyObject) => boolean;
22
28
  showTemplateMsg: (item: AnyObject, type: 'system' | 'template') => boolean | undefined;
23
29
  isTemplate3: (content: AnyObject) => boolean;
@@ -25,12 +31,14 @@ declare const _default: import("vue").DefineComponent<{}, {
25
31
  setScrollToButtom: () => Promise<void>;
26
32
  resetInfo: () => void;
27
33
  setReferenceMsg: (msgItem: AnyObject) => void;
34
+ handleSelect: (key: string, msgItem: AnyObject) => void;
28
35
  NAvatar: any;
29
36
  NImageGroup: any;
30
37
  NImage: any;
31
38
  NIcon: any;
32
39
  NButtonGroup: any;
33
40
  NButton: any;
41
+ NFlex: any;
34
42
  PersonProfile: import("vue").DefineComponent<{
35
43
  userId: {
36
44
  type: StringConstructor;
@@ -188,18 +196,29 @@ declare const _default: import("vue").DefineComponent<{}, {
188
196
  type: BooleanConstructor;
189
197
  default: boolean;
190
198
  };
191
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickMenu" | "update:show")[], "clickMenu" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
199
+ position: {
200
+ type: import("vue").PropType<CSSProperties>;
201
+ };
202
+ msgId: {
203
+ type: StringConstructor;
204
+ };
205
+ }, () => JSX.Element | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show")[], "select" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
192
206
  show: {
193
207
  type: BooleanConstructor;
194
208
  default: boolean;
195
209
  };
210
+ position: {
211
+ type: import("vue").PropType<CSSProperties>;
212
+ };
213
+ msgId: {
214
+ type: StringConstructor;
215
+ };
196
216
  }>> & {
197
- onClickMenu?: ((...args: any[]) => any) | undefined;
217
+ onSelect?: ((...args: any[]) => any) | undefined;
198
218
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
199
219
  }, {
200
220
  show: boolean;
201
221
  }>;
202
- downloadFile: typeof downloadFile;
203
222
  simplifyMessage: typeof simplifyMessage;
204
223
  isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
205
224
  getAVTime: typeof getAVTime;
@@ -208,5 +227,6 @@ declare const _default: import("vue").DefineComponent<{}, {
208
227
  EllipsisHorizontal: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
209
228
  CallOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
210
229
  VideocamOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
230
+ DocumentSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
211
231
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
212
232
  export default _default;