cnhis-design-vue 3.2.7-release.2 → 3.2.7-release.3

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 (108) hide show
  1. package/es/components/base-search/index.d.ts +2 -0
  2. package/es/components/base-search/src/index.vue.d.ts +2 -0
  3. package/es/components/button-print/index.d.ts +27 -0
  4. package/es/components/button-print/src/ButtonPrint.vue.d.ts +27 -0
  5. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  6. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -0
  7. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  8. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  9. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  10. package/es/components/button-print/style/index.css +1 -1
  11. package/es/components/callback/src/components/render/popupMaps.d.ts +27 -0
  12. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  16. package/es/components/form-config/index.d.ts +37 -0
  17. package/es/components/form-config/src/FormConfig.vue.d.ts +37 -0
  18. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +14 -0
  19. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +20 -0
  20. package/es/components/form-render/index.d.ts +14 -0
  21. package/es/components/form-render/src/FormRender.vue.d.ts +14 -0
  22. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  23. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +14 -0
  24. package/es/components/form-render/src/components/renderer/formItem.d.ts +9 -0
  25. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  26. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -0
  27. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -0
  28. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
  29. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  30. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -0
  31. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  32. package/es/components/form-render/src/types/index.d.ts +1 -0
  33. package/es/components/iho-chat/index.d.ts +99 -10
  34. package/es/components/iho-chat/src/Index.vue.d.ts +99 -10
  35. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -0
  36. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  37. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +3 -1
  38. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  39. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +2 -0
  40. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  41. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +5 -2
  42. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  43. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  44. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +57 -1
  45. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  46. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  47. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  48. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +15 -2
  49. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  50. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  51. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -3
  52. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  53. package/es/components/iho-chat/src/components/Video.vue.d.ts +14 -2
  54. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  55. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  56. package/es/components/iho-chat/src/hooks/useSession.d.ts +1 -1
  57. package/es/components/iho-chat/src/hooks/useSession.js +1 -1
  58. package/es/components/iho-chat/src/hooks/useState.js +1 -1
  59. package/es/components/iho-chat/src/hooks/useVideo.d.ts +11 -0
  60. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  61. package/es/components/iho-chat/src/utils/index.js +1 -1
  62. package/es/components/iho-chat/style/index.css +1 -1
  63. package/es/components/iho-table/index.d.ts +13 -0
  64. package/es/components/iho-table/src/IhoTable.vue.d.ts +13 -0
  65. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  66. package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -0
  67. package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -0
  68. package/es/components/iho-table/src/plugins/headerPlugin/tooltipMessage.vue.d.ts +13 -0
  69. package/es/components/iho-table/src/plugins/headerPlugin/tooltipMessage.vue.js +1 -0
  70. package/es/components/iho-table/src/plugins/headerPlugin/tooltipMessage.vue2.js +1 -0
  71. package/es/components/iho-table/src/plugins/index.js +1 -1
  72. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  73. package/es/components/iho-table/src/types/index.d.ts +3 -0
  74. package/es/components/iho-table/src/utils/index.d.ts +0 -1
  75. package/es/components/iho-table/src/utils/index.js +1 -1
  76. package/es/components/index.css +1 -1
  77. package/es/components/info-header/index.d.ts +34 -0
  78. package/es/components/info-header/src/InfoHeader.vue.d.ts +34 -0
  79. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
  80. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +1 -1
  81. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
  82. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +16 -0
  83. package/es/components/info-header/src/components/infoDescription/index.vue2.js +1 -1
  84. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +14 -0
  85. package/es/components/quick-search/src/index.vue2.js +1 -1
  86. package/es/components/scale-view/index.d.ts +23 -1
  87. package/es/components/scale-view/src/ScaleView.vue.d.ts +23 -1
  88. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  89. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +21 -1
  90. package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +1 -1
  91. package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
  92. package/es/components/scale-view/src/directive/drag-move.d.ts +3 -0
  93. package/es/components/scale-view/src/directive/drag-move.js +1 -0
  94. package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +1 -0
  95. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  96. package/es/components/scale-view/style/index.css +1 -1
  97. package/es/components/shortcut-setter/index.d.ts +15 -0
  98. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +15 -0
  99. package/es/components/steps-wheel/index.d.ts +1 -1
  100. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
  101. package/es/components/table-filter/src/types/index.d.ts +2 -0
  102. package/es/components/time-line/index.d.ts +4 -4
  103. package/es/components/time-line/src/TimeLine.vue.d.ts +1 -1
  104. package/es/components/time-line/src/TimeLine.vue2.js +1 -1
  105. package/es/shared/package.json.js +1 -1
  106. package/package.json +2 -2
  107. package/es/components/iho-table/src/plugins/headerPlugin.d.ts +0 -1
  108. package/es/components/iho-table/src/plugins/headerPlugin.js +0 -1
@@ -1 +1 @@
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 a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as d,createCommentVNode as f,withCtx as m,Fragment as p,renderList as g,createBlock as y,createTextVNode as h,mergeProps as v,vShow as M}from"vue";import{NIcon as k,NPopover as C,NButton as _,NTooltip as x,NUpload as I,NUploadTrigger as b}from"naive-ui";import w from"./ChatAdd.vue.js";import{useState as T}from"../hooks/useState.js";import{useSession as z}from"../hooks/useSession.js";import{MESSAGE_TYPE as E,AV_STATUS as j}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as R}from"../utils/index.js";import{emojis as q}from"../utils/emoji.js";import{uploadFileApi as L}from"../api/index.js";import{CloseCircleOutline as D,CallOutline as O,VideocamOutline as V}from"@vicons/ionicons5";import{xor as A,cloneDeep as F}from"lodash-es";import{uuidGenerator as K}from"../../../../shared/utils/index.js";const U={key:0,class:"reference-content-box"},S={class:"reference-content"},G=["innerHTML"],H={class:"tool-box"},N=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),J={class:"emoji-box"},X=l("span",null,"默认表情",-1),B={class:"list-box"},P=["src"],Q=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),W=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),Y=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),Z={class:"btn-box"},$=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var ee=e({__name:"ChatFooter",setup(e){const ee=t(),te=t(""),{state:ne,sendMessage:oe}=T(),{isGroupChat:ie}=z(ne),se=t(!1),re=n((()=>({options:ne.currentGroupUser,defaultValue:[ne.userInfo]})));function ae(e,t=[]){const n=K(),o=[],i=t.length>0;ne.showVideo||ne.showMultipleVideo||(i?(o.push(...A(t,[ne.userInfo.id])),Object.assign(ne.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),ne.showMultipleVideo=!0):oe({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function ce(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),de()))}function le(){var e,t;te.value=(null==(t=null==(e=ee.value)?void 0:e.innerText)?void 0:t.trim())||""}async function ue(e,t){const{file:n,name:o}=e.file,i=new FormData;i.append("sender",ne.userInfo.id),i.append("file",n);const s=await L(i);if(!s)return console.log("上传失败");fe({chatMessageType:t,msg:t===E.FILE?o:s,url:s})}function de(){if(!(te.value.length>2e3))return te.value?void fe({msg:te.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function fe(e){const{chatMessageType:t=E.TEXT,msg:n,url:o}=e,i={msg:n,chatMessageType:t};t===E.FILE&&(i.fileUrl=o),[E.TEXT,E.BLEND].includes(t)&&(ee.value.innerHTML="",te.value=""),ne.currentReferenceMsg&&(i.referenceContent=F(ne.currentReferenceMsg),ne.currentReferenceMsg=null),oe({content:i})}return o((()=>ne.currentReferenceMsg),(e=>{var t;e&&(null==(t=ee.value)||t.focus())})),(e,t)=>i((s(),r("section",{class:"chat-footer",style:a({cursor:c(ne).id?"default":"not-allowed"})},[c(ne).currentReferenceMsg?(s(),r("div",U,[l("div",S,[l("span",null,u(c(ne).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(R)(c(ne).currentReferenceMsg.content)},null,8,G)]),d(c(k),{component:c(D),onClick:t[0]||(t[0]=()=>c(ne).currentReferenceMsg=null)},null,8,["component"])])):f("v-if",!0),l("div",H,[d(c(C),{show:se.value,"onUpdate:show":t[1]||(t[1]=e=>se.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[N])),_:1})])),default:m((()=>[l("div",J,[f(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),X,l("div",B,[(s(!0),r(p,null,g(c(q).default,(([e,t])=>(s(),y(c(x),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny",onClick:()=>function(e){se.value=!1,fe({chatMessageType:E.EMOJI,msg:e})}(e)},{icon:m((()=>[l("img",{src:t},null,8,P)])),_:2},1032,["onClick"])])),default:m((()=>[h(" "+u(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),d(c(_),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>fe({chatMessageType:c(E).EMOJI,msg:0}))},{icon:m((()=>[Q])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ue(e,c(E).IMAGE))},{default:m((()=>[d(c(b),{abstract:""},{default:m((({handleClick:e})=>[d(c(_),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[W])),_:2},1032,["onClick"])])),_:1})])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ue(e,c(E).FILE))},{default:m((()=>[d(c(b),{abstract:""},{default:m((({handleClick:e})=>[d(c(_),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[Y])),_:2},1032,["onClick"])])),_:1})])),_:1}),c(ie)?(s(),r(p,{key:0},[d(w,v(c(re),{onComfirm:t[5]||(t[5]=e=>ae(c(E).AUDIO,e))}),{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[d(c(k),{size:"18",component:c(O)},null,8,["component"])])),_:1})])),_:1},16),d(w,v(c(re),{onComfirm:t[6]||(t[6]=e=>ae(c(E).VIDEO,e))}),{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[d(c(k),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),_:1},16)],64)):(s(),r(p,{key:1},[d(c(_),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ae(c(E).AUDIO))},{icon:m((()=>[d(c(k),{size:"18",component:c(O)},null,8,["component"])])),_:1}),d(c(_),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ae(c(E).VIDEO))},{icon:m((()=>[d(c(k),{size:"20",component:c(V)},null,8,["component"])])),_:1})],64))]),i(l("div",{ref_key:"inputRef",ref:ee,class:"input-box",contenteditable:"",onKeydown:ce,onInput:le},null,544),[[M,c(ne).id]]),l("div",Z,[$,d(c(_),{type:"primary",round:"",disabled:!te.value,onClick:de},{default:m((()=>[h("发送")])),_:1},8,["disabled"])])],4)),[[M,c(ne).id]])}});export{ee as default};
1
+ import{defineComponent as e,ref as t,computed as n,watch as r,withDirectives as o,openBlock as i,createElementBlock as s,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as p,createCommentVNode as g,withCtx as f,Fragment as m,renderList as d,createBlock as h,createTextVNode as y,mergeProps as v,vShow as w}from"vue";import{NIcon as M,NTooltip as _,NPopover as k,NButton as C,NUpload as I,NUploadTrigger as T}from"naive-ui";import b from"./ChatAdd.vue.js";import{useState as E}from"../hooks/useState.js";import{useSession as x}from"../hooks/useSession.js";import{MESSAGE_TYPE as z,AV_STATUS as j}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as L}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=l("span",null,"默认表情",-1),X={class:"list-box"},B=["src"],$=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 发送, Ctrl + Enter 换行",-1);var Z=e({__name:"ChatFooter",setup(e){const Z=t(),{state:ee,sendMessage:te}=E(),{isGroupChat:ne}=x(ee),re=t(!1),oe=t(""),ie=n((()=>({options:ee.currentGroupUser,defaultValue:[ee.userInfo]}))),se=n((()=>!oe.value.replace(/(&nbsp;|\s|<br>)+/g,"")));function ae(e,t=[]){const n=F(),r=[],o=t.length>0;ee.showVideo||ee.showMultipleVideo||(o?(r.push(...V(t,[ee.userInfo.id])),Object.assign(ee.currentAVMsg,{callMode:"call",checkedIds:r,strRoomId:n,chatMessageType:e}),ee.showMultipleVideo=!0):te({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function ce(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(),pe()))}function le(){var e;oe.value=(null==(e=Z.value)?void 0:e.innerHTML)||""}async function ue(e,t){const{file:n,name:r}=e.file,o=new FormData;o.append("sender",ee.userInfo.id),o.append("file",n);const i=await q(o);if(!i)return console.log("上传失败");ge({chatMessageType:t,msg:t===z.FILE?r:i,url:i})}function pe(){const{innerHTML:e="",innerText:t=""}=Z.value||{};if(se.value)return console.log("请输入内容");const n=e.split(t).find((e=>!!e));let r=z.TEXT,o="";if(n){if(t.replace(/\n$/,"")||(e.match(/<img[^>]*>/gi)||[]).length>1)r=z.BLEND,o=e;else if(e.includes(z.EMOJI)){r=z.EMOJI;const t=e.match(/data-msg\s*=\s*"([^"]*)"/);t&&(o=t[1])}else{r=z.IMAGE;const t=e.match(/src\s*=\s*"([^"]*)"/);t&&(o=t[1])}}else o=t.trim();o&&ge({msg:o,chatMessageType:r,origin:"btn"})}async function ge(e){const{chatMessageType:t=z.TEXT,msg:n,url:r,origin:o=""}=e,i={msg:n,chatMessageType:t};t===z.FILE&&(i.fileUrl=r),"btn"===o&&(Z.value.innerHTML="",oe.value=""),ee.currentReferenceMsg&&(t===z.TEXT&&(i.referenceContent=K(ee.currentReferenceMsg)),ee.currentReferenceMsg=null),te({content:i})}return r((()=>ee.currentReferenceMsg),(e=>{var t;e&&(null==(t=Z.value)||t.focus())})),(e,t)=>o((i(),s("section",{class:"chat-footer",style:a({cursor:c(ee).id?"default":"not-allowed"})},[c(ee).currentReferenceMsg?(i(),s("div",H,[l("div",U,[l("span",null,u(c(ee).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(L)(c(ee).currentReferenceMsg.content)},null,8,G)]),p(c(M),{component:c(O),onClick:t[0]||(t[0]=()=>c(ee).currentReferenceMsg=null)},null,8,["component"])])):g("v-if",!0),l("div",J,[p(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[p(c(k),{"content-class":"emoji-content",class:"emoji-wrapper",show:re.value,"onUpdate:show":t[1]||(t[1]=e=>re.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny"},{icon:f((()=>[N])),_:1})])),default:f((()=>[S,l("div",X,[(i(!0),s(m,null,d(c(R).default,(([e,t])=>(i(),h(c(_),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny",onClick:()=>function(e){re.value=!1,ge({chatMessageType:z.EMOJI,msg:e})}(e)},{icon:f((()=>[l("img",{src:t},null,8,B)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:f((()=>[y(" 表情 ")])),_:1}),p(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>ge({chatMessageType:c(z).EMOJI,msg:0}))},{icon:f((()=>[$])),_:1})])),default:f((()=>[y(" 点赞 ")])),_:1}),p(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ue(e,c(z).IMAGE))},{default:f((()=>[p(c(T),{abstract:""},{default:f((({handleClick:e})=>[p(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[P])),_:2},1032,["onClick"])])),default:f((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),p(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ue(e,c(z).FILE))},{default:f((()=>[p(c(T),{abstract:""},{default:f((({handleClick:e})=>[p(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[Q])),_:2},1032,["onClick"])])),default:f((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(ne)?(i(),s(m,{key:0},[p(b,v(c(ie),{onComfirm:t[5]||(t[5]=e=>ae(c(z).AUDIO,e))}),{trigger:f((()=>[p(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny"},{icon:f((()=>[p(c(M),{size:"18",component:c(D)},null,8,["component"])])),_:1})])),default:f((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),p(b,v(c(ie),{onComfirm:t[6]||(t[6]=e=>ae(c(z).VIDEO,e))}),{trigger:f((()=>[p(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny"},{icon:f((()=>[p(c(M),{size:"20",component:c(A)},null,8,["component"])])),_:1})])),default:f((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(i(),s(m,{key:1},[p(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ae(c(z).AUDIO))},{icon:f((()=>[p(c(M),{size:"18",component:c(D)},null,8,["component"])])),_:1})])),default:f((()=>[y(" 语音通话 ")])),_:1}),p(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[p(c(C),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ae(c(z).VIDEO))},{icon:f((()=>[p(c(M),{size:"20",component:c(A)},null,8,["component"])])),_:1})])),default:f((()=>[y(" 视频通话 ")])),_:1})],64))]),o(l("div",{ref_key:"inputRef",ref:Z,class:"input-box",contenteditable:"",onKeydown:ce,onInput:le},null,544),[[w,c(ee).id]]),l("div",W,[Y,p(c(C),{type:"primary",round:"",disabled:c(se),onClick:pe},{default:f((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[w,c(ee).id]])}});export{Z as default};
@@ -19,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{}, {
19
19
  NAvatar: any;
20
20
  NIcon: any;
21
21
  NButton: any;
22
+ NTooltip: any;
22
23
  PersonProfile: import("vue").DefineComponent<{
23
24
  userId: {
24
25
  type: StringConstructor;
@@ -460,6 +461,7 @@ declare const _default: import("vue").DefineComponent<{}, {
460
461
  NInput: any;
461
462
  NCheckbox: any;
462
463
  NCheckboxGroup: any;
464
+ NTooltip: any;
463
465
  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<{}>>, {}>;
464
466
  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<{}>>, {}>;
465
467
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", 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 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
+ import{defineComponent as e,ref as t,computed as o,openBlock as r,createElementBlock as i,Fragment as a,unref as s,createElementVNode as n,createVNode as l,withCtx as c,toDisplayString as u,createTextVNode as m,normalizeProps as h,guardReactiveProps as d,createCommentVNode as v}from"vue";import{NAvatar as p,NTooltip as f,NButton as g,NIcon as w}from"naive-ui";import{useState as _}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import y from"./PersonProfile.vue.js";import j from"./ChatSet.vue.js";import C from"./ChatFile.vue.js";import k from"./ChatRecord.vue.js";import z from"./ChatAdd.vue.js";import{PersonAddOutline as S}from"@vicons/ionicons5";const q={key:0,class:"chat-header box-shadow"},U={class:"chat-header__left"},I={class:"name"},G={class:"chat-header__right"},x=n("i",{class:"chat--iconfont chat--icon-image"},null,-1),P=n("i",{class:"chat--iconfont chat--icon-folder"},null,-1),A=n("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),F=n("i",{class:"chat--iconfont chat--icon-set"},null,-1);var H=e({__name:"ChatHeader",setup(e){const{state:H}=_(),{isGroupChat:R}=b(H),V=t(!1),B=t(!1),D=t("image"),E=t(!1),J=o((()=>{const e=H.currentGroupUser.map((e=>e.id));return R.value?{mode:"join",disabledIds:e}:{mode:"create",defaultValue:H.currentGroupUser}}));function K(e){D.value=e,B.value=!0}return(e,t)=>(r(),i(a,null,[s(H).id?(r(),i("section",q,[n("div",U,[l(y,{"user-id":s(H).currentSessionItem.receiver,disabled:s(R),placement:"bottom"},{trigger:c((()=>[l(s(p),{round:"",size:30,src:s(H).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),n("span",I,u(s(H).currentSessionItem.name),1)]),n("div",G,[l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny",onClick:t[0]||(t[0]=()=>K("image"))},{icon:c((()=>[x])),_:1})])),default:c((()=>[m(" 图片 ")])),_:1}),l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny",onClick:t[1]||(t[1]=()=>K("file"))},{icon:c((()=>[P])),_:1})])),default:c((()=>[m(" 文件 ")])),_:1}),l(z,h(d(s(J))),{trigger:c((()=>[l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny"},{icon:c((()=>[l(s(w),{size:"18",component:s(S)},null,8,["component"])])),_:1})])),default:c((()=>[m(" 添加成员 ")])),_:1})])),_:1},16),l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>E.value=!0)},{icon:c((()=>[A])),_:1})])),default:c((()=>[m(" 聊天记录 ")])),_:1}),l(s(f),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:c((()=>[l(s(g),{quaternary:"",size:"tiny",onClick:t[3]||(t[3]=()=>V.value=!0)},{icon:c((()=>[F])),_:1})])),default:c((()=>[m(" 聊天设置 ")])),_:1})])])):v("v-if",!0),l(j,{show:V.value,"onUpdate:show":t[4]||(t[4]=e=>V.value=e)},null,8,["show"]),l(C,{show:B.value,"onUpdate:show":t[5]||(t[5]=e=>B.value=e),type:D.value,visible:B.value},null,8,["show","type","visible"]),l(k,{show:E.value,"onUpdate:show":t[6]||(t[6]=e=>E.value=e),visible:E.value},null,8,["show","visible"])],64))}});export{H as default};
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'vue';
2
2
  import { AnyObject } from '../../../../shared/types';
3
- import { downloadFile, simplifyMessage, isAudioOrVideoMessage, getAVTime } from '../utils';
3
+ import { simplifyMessage, isAudioOrVideoMessage, getAVTime } from '../utils';
4
4
  import { MESSAGE_TYPE } from '../constants';
5
5
  declare const _default: import("vue").DefineComponent<{}, {
6
6
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
@@ -31,12 +31,14 @@ declare const _default: import("vue").DefineComponent<{}, {
31
31
  setScrollToButtom: () => Promise<void>;
32
32
  resetInfo: () => void;
33
33
  setReferenceMsg: (msgItem: AnyObject) => void;
34
+ handleSelect: (key: string, msgItem: AnyObject) => void;
34
35
  NAvatar: any;
35
36
  NImageGroup: any;
36
37
  NImage: any;
37
38
  NIcon: any;
38
39
  NButtonGroup: any;
39
40
  NButton: any;
41
+ NSpace: any;
40
42
  PersonProfile: import("vue").DefineComponent<{
41
43
  userId: {
42
44
  type: StringConstructor;
@@ -217,13 +219,14 @@ declare const _default: import("vue").DefineComponent<{}, {
217
219
  }, {
218
220
  show: boolean;
219
221
  }>;
220
- downloadFile: typeof downloadFile;
221
222
  simplifyMessage: typeof simplifyMessage;
222
223
  isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
223
224
  getAVTime: typeof getAVTime;
224
225
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
225
226
  ChatbubbleEllipsesOutline: 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<{}>>, {}>;
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<{}>>, {}>;
226
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<{}>>, {}>;
227
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<{}>>, {}>;
228
231
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
229
232
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as a,unref as r,normalizeStyle as c,createVNode as l,withCtx as m,Fragment as u,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as v,createElementVNode as y,withModifiers as g}from"vue";import{NImageGroup as T,NAvatar as h,NImage as M,NIcon as k,NButtonGroup as _,NButton as I}from"naive-ui";import{format as S}from"date-fns";import{getHistoryRecordApi as x,readMessageApi as j}from"../api/index.js";import{useState as E}from"../hooks/useState.js";import{useSession as L}from"../hooks/useSession.js";import{MESSAGE_TYPE as A}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as C,simplifyMessage as b,getAVTime as w,downloadFile as H}from"../utils/index.js";import{first as z,last as D}from"lodash-es";import O from"./PersonProfile.vue.js";import P from"./MessageTemplate.vue.js";import{emojis as N}from"../utils/emoji.js";import U from"./ContextMenu.js";import{useScrollLoading as q}from"../hooks/useScrollLoading.js";import{CallOutline as R,VideocamOutline as G,ChatbubbleEllipsesOutline as J}from"@vicons/ionicons5";const K={key:0,class:"time"},F={key:2,class:"message-box"},X={key:0,class:"content-box"},B={class:"name-box"},Q=["data-time"],V=["onContextmenu"],W={key:0,class:"reference-content"},Y=["innerHTML"],Z=["innerHTML"],$=["src"],ee={style:{"margin-left":"8px"}},te=["href","onClick"];var ne=e({__name:"ChatMain",setup(e){const ne=t(),{state:se,setMsgList:oe}=E(),{setCurrentSessionItem:ie,isGroupChat:ae}=L(se),re=t(),ce=t(!1),le=t({left:0,top:0}),me=t(),ue={page:0,hasMore:!0,lastSendTime:S(new Date,"yyyy-MM-dd HH:mm:ss")},pe=n((()=>({"--c-tip-top":ae.value?"1px":"-20px","--c-tip-gap":ae.value?"10px":"0px"})));async function de(){try{if(!ue.hasMore)return;ue.page++;const e=await x({sessionKey:se.currentSessionItem.sessionKey,page:ue.page,lastSendTime:ue.lastSendTime});if(!Array.isArray(e)||0===e.length)return ue.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=z(e).id;ue.lastSendTime=D(e).sendTime,oe(ue.page>1?[...e,...se.msgList]:e),1===ue.page&&se.currentSessionItem.unreadNum&&(await j({chatType:se.currentSessionItem.chatType,messageIdSet:[t],receiver:se.userInfo.id,sender:se.currentSessionItem.receiver}),ie({unreadNum:0}))}catch(e){console.log(e)}}function fe(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==A.TEMPLATE||!!n}function ve(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===A.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function ye(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===A.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function ge(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=se.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}return q(ne,(()=>{de()}),"top",(()=>{ce.value=!1})),s((()=>se.id),(e=>{e&&(Object.assign(ue,{page:0,hasMore:!0,lastSendTime:S(new Date,"yyyy-MM-dd HH:mm:ss")}),de())}),{immediate:!0}),s((()=>se.isAppendMsg),(e=>{e&&(oe([...se.msgList,se.currentMsg]),se.isAppendMsg=!1,async function(){var e,t,n;const s=null!=(t=null==(e=ne.value)?void 0:e.scrollHeight)?t:0;null==(n=ne.value)||n.scrollTo({top:s,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(o(),i("div",{class:a(["chat-main",{"home-bg":!r(se).id}]),ref_key:"chatMainRef",ref:ne,style:c(r(pe))},[l(r(T),{"show-toolbar-tooltip":""},{default:m((()=>[(o(!0),i(u,null,p(r(se).msgList,((e,t)=>(o(),i(u,{key:e.id},[fe(e)?(o(),i("div",{key:0,class:a(["message-item",{"message-item--mine":e.sender==r(se).userInfo.id}])},[ge(e,t)?(o(),i("p",K,d(e.__sendTime),1)):f("v-if",!0),ve(e,"system")?(o(),v(P,{key:1,data:e},null,8,["data"])):(o(),i("div",F,[l(O,{"user-id":e.sender},{trigger:m((()=>[l(r(h),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(o(),i("div",X,[y("div",B,[y("span",{class:"name","data-time":e.__time},d(r(ae)?e.senderName:""),9,Q)]),y("div",{class:a(["content",{emoji:e.content.chatMessageType===r(A).EMOJI,template:e.content.chatMessageType===r(A).TEMPLATE,"template--3":ye(e.content),"audio-video":r(C)(e.content)}]),onContextmenu:g((t=>async function(e,t){}(0,e.id)),["prevent"])},[e.content.chatMessageType===r(A).TEXT?(o(),i(u,{key:0},[e.content.referenceContent?(o(),i("div",W,[y("span",null,d(e.content.referenceContent.senderName)+":",1),y("pre",{innerHTML:r(b)(e.content.referenceContent.content)},null,8,Y)])):f("v-if",!0),y("pre",{innerHTML:e.__content},null,8,Z)],64)):f("v-if",!0),e.content.chatMessageType===r(A).EMOJI?(o(),i("img",{key:1,src:r(N).findEmoji(e.__content)},null,8,$)):f("v-if",!0),ve(e,"template")?(o(),v(P,{key:2,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===r(A).IMAGE?(o(),v(r(M),{key:3,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),r(C)(e.content)?(o(),i(u,{key:4},[l(r(k),{class:a({"is-audio":e.content.chatMessageType===r(A).AUDIO}),component:e.content.chatMessageType===r(A).AUDIO?r(R):r(G)},null,8,["class","component"]),y("span",ee,d(r(w)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===r(A).FILE?(o(),i("a",{key:5,href:e.content.fileUrl,onClick:g((()=>r(H)(e.content.fileUrl,e.__content)),["prevent"])},d(e.__content),9,te)):f("v-if",!0),l(r(_),{class:"quick-menu"},{default:m((()=>[f(' <n-button quaternary size="tiny">\n\t\t\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\n\t\t\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t\t</n-button> '),l(r(I),{quaternary:"",size:"tiny",onClick:()=>{return t=e,se.currentReferenceMsg=t,void Object.assign(se.currentReferenceMsg,{chatType:se.currentSessionItem.chatType,receiver:se.currentSessionItem.receiver,receiverAvatar:se.currentSessionItem.avatar,receiverName:se.currentSessionItem.name});var t}},{icon:m((()=>[l(r(k),{size:"17",component:r(J)},null,8,["component"])])),_:2},1032,["onClick"]),f(' <n-button quaternary size="tiny">\n\t\t\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t\t\t<n-icon :component="EllipsisHorizontal" />\n\t\t\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t\t</n-button> ')])),_:2},1024)],42,V)])):f("v-if",!0)]))],2)):f("v-if",!0)],64)))),128))])),_:1}),l(r(U),{ref_key:"contextmenuRef",ref:re,show:ce.value,"onUpdate:show":t[0]||(t[0]=e=>ce.value=e),position:le.value,"msg-id":me.value},null,8,["show","position","msg-id"])],6))}});export{ne as default};
1
+ import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as a,unref as r,normalizeStyle as c,createVNode as l,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as v,createElementVNode as g,withModifiers as y,nextTick as h}from"vue";import{NImageGroup as T,NAvatar as M,NImage as _,NIcon as k,NSpace as x,NButtonGroup as I,NButton as S}from"naive-ui";import{format as w}from"date-fns";import{getHistoryRecordApi as L,readMessageApi as j}from"../api/index.js";import{useState as E}from"../hooks/useState.js";import{useSession as C}from"../hooks/useSession.js";import{MESSAGE_TYPE as b}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as A,simplifyMessage as z,getAVTime as H}from"../utils/index.js";import{first as D,last as R}from"lodash-es";import N from"./PersonProfile.vue.js";import O from"./MessageTemplate.vue.js";import{emojis as P}from"../utils/emoji.js";import q from"./ContextMenu.js";import{useScrollLoading as B}from"../hooks/useScrollLoading.js";import{CallOutline as U,VideocamOutline as F,DocumentSharp as G,ChatbubbleEllipsesOutline as J,EllipsisHorizontal as K}from"@vicons/ionicons5";const X={key:0,class:"time"},Y={key:2,class:"message-box"},$={key:0,class:"content-box"},Q={class:"name-box"},V=["data-time"],W=["onContextmenu"],Z={key:0,class:"reference-content"},ee=["innerHTML"],te=["innerHTML"],ne=["src"],se={style:{"margin-left":"8px"}},oe={class:"size"};var ie=e({__name:"ChatMain",setup(e){const ie=t(),{state:ae,setMsgList:re}=E(),{setCurrentSessionItem:ce,isGroupChat:le}=C(ae),ue=t(),me=t(!1),pe=t({left:0,top:0}),de=t(),fe={page:0,hasMore:!0,lastSendTime:w(new Date,"yyyy-MM-dd HH:mm:ss")},ve=n((()=>({"--c-tip-top":le.value?"1px":"-20px","--c-tip-gap":le.value?"10px":"0px"})));async function ge(){try{if(!fe.hasMore)return;fe.page++;const e=await L({sessionKey:ae.currentSessionItem.sessionKey,page:fe.page,lastSendTime:fe.lastSendTime});if(!Array.isArray(e)||0===e.length)return fe.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=D(e).id;fe.lastSendTime=R(e).sendTime,re(fe.page>1?[...e,...ae.msgList]:e),1===fe.page&&ae.currentSessionItem.unreadNum&&(await j({chatType:ae.currentSessionItem.chatType,messageIdSet:[t],receiver:ae.userInfo.id,sender:ae.currentSessionItem.receiver}),ce({unreadNum:0}))}catch(e){console.log(e)}}async function ye(e,t){de.value=t,async function(e){var t,n,s,o,i,a;me.value=!0,await h();const{clientX:r,clientY:c}=e,{width:l=0,height:u=0,left:m=0,top:p=0}=(null==(t=ie.value)?void 0:t.getBoundingClientRect())||{},d=null!=(o=null==(s=null==(n=ue.value)?void 0:n.$el)?void 0:s.getBoundingClientRect().height)?o:220,f=null!=(a=null==(i=ie.value)?void 0:i.scrollTop)?a:0,v=5,g={};r<=m+l/2?g.left=r-m+v+"px":g.right=m+l-r-v+"px";c-p<d/2?g.top=f+v+"px":p+u-c<=d/2?g.bottom=Math.abs(f)+v+"px":g.top=f+c-p-d/2+"px";pe.value=g}(e)}function he(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==b.TEMPLATE||!!n}function Te(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===b.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function Me(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===b.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function _e(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=ae.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function ke(e){ae.currentReferenceMsg=e,Object.assign(ae.currentReferenceMsg,{chatType:ae.currentSessionItem.chatType,receiver:ae.currentSessionItem.receiver,receiverAvatar:ae.currentSessionItem.avatar,receiverName:ae.currentSessionItem.name})}function xe(e,t){"reply"===e&&ke(t)}return B(ie,(()=>{ge()}),"top",(()=>{me.value=!1})),s((()=>ae.id),(e=>{e&&(ae.currentReferenceMsg=null,Object.assign(fe,{page:0,hasMore:!0,lastSendTime:w(new Date,"yyyy-MM-dd HH:mm:ss")}),ge())}),{immediate:!0}),s((()=>ae.isAppendMsg),(e=>{e&&(re([...ae.msgList,ae.currentMsg]),ae.isAppendMsg=!1,async function(){var e,t,n;const s=null!=(t=null==(e=ie.value)?void 0:e.scrollHeight)?t:0;null==(n=ie.value)||n.scrollTo({top:s,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(o(),i("div",{class:a(["chat-main",{"home-bg":!r(ae).id}]),ref_key:"chatMainRef",ref:ie,style:c(r(ve))},[l(r(T),{"show-toolbar-tooltip":""},{default:u((()=>[(o(!0),i(m,null,p(r(ae).msgList,((e,t)=>(o(),i(m,{key:e.id},[he(e)?(o(),i("div",{key:0,class:a(["message-item",{"message-item--mine":e.sender==r(ae).userInfo.id}])},[_e(e,t)?(o(),i("p",X,d(e.__sendTime),1)):f("v-if",!0),Te(e,"system")?(o(),v(O,{key:1,data:e},null,8,["data"])):(o(),i("div",Y,[l(N,{"user-id":e.sender},{trigger:u((()=>[l(r(M),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(o(),i("div",$,[g("div",Q,[g("span",{class:"name","data-time":e.__time},d(r(le)?e.senderName:""),9,V)]),g("div",{class:a(["content",{emoji:e.content.chatMessageType===r(b).EMOJI,template:e.content.chatMessageType===r(b).TEMPLATE,"template--3":Me(e.content),"audio-video":r(A)(e.content),file:e.content.chatMessageType===r(b).FILE}]),onContextmenu:y((t=>ye(t,e.id)),["prevent"])},[e.content.chatMessageType===r(b).TEXT?(o(),i(m,{key:0},[e.content.referenceContent?(o(),i("div",Z,[g("span",null,d(e.content.referenceContent.senderName)+":",1),g("pre",{innerHTML:r(z)(e.content.referenceContent.content)},null,8,ee)])):f("v-if",!0),g("pre",null,d(e.__content),1)],64)):f("v-if",!0),e.content.chatMessageType===r(b).BLEND?(o(),i("pre",{key:1,innerHTML:e.__content},null,8,te)):f("v-if",!0),e.content.chatMessageType===r(b).EMOJI?(o(),i("img",{key:2,src:r(P).findEmoji(e.__content)},null,8,ne)):f("v-if",!0),Te(e,"template")?(o(),v(O,{key:3,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===r(b).IMAGE?(o(),v(r(_),{key:4,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),r(A)(e.content)?(o(),i(m,{key:5},[l(r(k),{class:a({"is-audio":e.content.chatMessageType===r(b).AUDIO}),component:e.content.chatMessageType===r(b).AUDIO?r(U):r(F)},null,8,["class","component"]),g("span",se,d(r(H)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===r(b).FILE?(o(),v(r(x),{key:6,"wrap-item":!1},{default:u((()=>[l(r(k),{class:"icon-file",size:"40",component:r(G)},null,8,["component"]),l(r(x),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[g("span",null,d(e.__content),1),g("span",oe,d(e.__size),1)])),_:2},1024)])),_:2},1024)):f("v-if",!0),l(r(I),{class:"quick-menu"},{default:u((()=>[r(A)(e.content)?f("v-if",!0):(o(),i(m,{key:0},[f(' <n-button quaternary size="tiny">\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),l(r(S),{quaternary:"",size:"tiny",onClick:()=>ke(e)},{icon:u((()=>[l(r(k),{size:"17",component:r(J)},null,8,["component"])])),_:2},1032,["onClick"])],64)),l(r(S),{quaternary:"",size:"tiny",onClick:t=>ye(t,e.id)},{icon:u((()=>[l(r(k),{size:"14",component:r(K)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,W)])):f("v-if",!0)]))],2)):f("v-if",!0)],64)))),128))])),_:1}),l(r(q),{ref_key:"contextmenuRef",ref:ue,show:me.value,"onUpdate:show":t[0]||(t[0]=e=>me.value=e),position:pe.value,"msg-id":de.value,onSelect:xe},null,8,["show","position","msg-id"])],6))}});export{ie as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as a,watch as l,openBlock as t,createBlock as s,unref as r,withCtx as o,createElementVNode as n,createVNode as i,toDisplayString as u,resolveDynamicComponent as c,createElementBlock as d,Fragment as v,renderList as m,withDirectives as p,createTextVNode as f,vShow as g}from"vue";import{NModal as h,NAvatar as y,NInputGroup as b,NInput as _,NSelect as T,NPopover as k,NTag as M,NIcon as x}from"naive-ui";import{SearchOutline as w}from"@vicons/ionicons5";import{useState as I}from"../hooks/useState.js";import{transformMessage as j,formatTime as S}from"../utils/index.js";import{last as A}from"lodash-es";import{MESSAGE_TYPE as L}from"../constants/index.js";import{searchChatRecordApi as C}from"../api/index.js";import"trtc-sdk-v5";import E from"../../../date-picker/index.js";import{useDebounceFn as H}from"@vueuse/core";import{format as U}from"date-fns";import{useScrollLoading as z}from"../hooks/useScrollLoading.js";import{emojis as D}from"../utils/emoji.js";const G={class:"iho-chat-dialog__header"},K=n("span",{class:"left"},"聊天记录",-1),O={class:"center"},R={class:"iho-chat-dialog__content iho-chat-record-wrapper"},B={class:"chat-record-box"},J={class:"msg-box"},N={class:"name-and-time"},P={class:"content"},X=["src"],$=["src"],q=["innerHTML"],F={key:1,class:"no-data"},Q={class:"chat-record-box__filter"},V=n("span",{class:"filter-title"},"添加筛选条件",-1),W={class:"filter-item"},Y=n("span",{class:"label"},"成员:",-1),Z={class:"filter-item"},ee=n("span",{class:"label"},"日期:",-1),ae={class:"time-target"},le={class:"time-target__item"},te=n("span",null,"开始:",-1),se={class:"no-data"},re={class:"time-target__item"},oe=n("span",null,"结束:",-1),ne={class:"no-data"};var ie=e({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(e){const ie=e,ue={color:"#fff",textColor:"#666"},{state:ce}=I(),de=a(),ve=a([]),me=a(),pe=a([]),fe=a(),ge=a(),he=H(_e,500),ye={page:0,hasMore:!0,lastSendTime:U(new Date,"yyyy-MM-dd HH:mm:ss")};async function be(){var e;try{if(!ye.hasMore)return;ye.page++;const a=await C({orgId:ce.orgId,keyword:me.value,endTime:ge.value?ge.value+" 23:59:59":"",startTime:fe.value?fe.value+" 00:00:00":"",lastSendTime:ye.lastSendTime,memberIdSet:pe.value,page:ye.page,recordType:"ALL",sessionKey:ce.currentSessionItem.sessionKey,userId:ce.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(ye.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList),ye.lastSendTime=null==(e=A(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t,s,r;let o="";switch(e.content.chatMessageType){case L.TEXT:o=j(null==(a=e.content)?void 0:a.msg);break;case L.TEMPLATE:o=null==(s=null==(t=null==(l=e.content)?void 0:l.messageTemplate)?void 0:t.setting)?void 0:s.title;break;default:o=null==(r=e.content)?void 0:r.msg}e.__content=o})),ve.value=ye.page>1?ve.value.concat(l):l}catch(e){console.log(e)}}function _e(){Object.assign(ye,{page:0,hasMore:!0,lastSendTime:ge.value||U(new Date,"yyyy-MM-dd HH:mm:ss")}),be()}function Te(e){return!!ge.value&&e>Date.parse(`${ge.value} 23:59:59`)}function ke(e){return!!fe.value&&e<Date.parse(fe.value)}function Me(e){switch(e){case"member":pe.value=[];break;case"start":fe.value=null;break;case"end":ge.value=null}}function xe(e){return i(v,null,[i("div",{style:"display: flex;align-items: center"},[i(y,{src:e.avatar,round:!0,size:"small"},null),i("span",{style:"margin-left: 10px"},[e.name])])])}return z(de,(()=>{be()})),l([()=>pe.value,()=>fe.value,()=>ge.value],(()=>{ie.visible&&_e()}),{deep:!0}),l((()=>ie.visible),(e=>{e?_e():(me.value="",ge.value=null,fe.value=null,pe.value=[],ve.value=[])})),(e,a)=>(t(),s(r(h),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{header:o((()=>[n("div",G,[K,n("div",O,[i(r(y),{round:"",size:30,src:r(ce).currentSessionItem.avatar},null,8,["src"]),n("span",null,u(r(ce).currentSessionItem.name),1)])])])),default:o((()=>[n("div",R,[i(r(b),null,{default:o((()=>[(t(),s(c((()=>[i(x,{component:w,size:18,color:"#6666"},null),pe.value.length>0?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("member")},{default:()=>{var e;return[f("成员:")," ",pe.value.length>1?pe.value.length+"人":null==(e=ce.currentGroupUser.find((e=>e.id===pe.value[0])))?void 0:e.name]}}):null,fe.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("start")},{default:()=>[f("起始时间: "),fe.value]}):null,ge.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("end")},{default:()=>[f("结束时间: "),ge.value]}):null])))),i(r(_),{placeholder:"搜索",value:me.value,"onUpdate:value":a[0]||(a[0]=e=>me.value=e),valueModifiers:{trim:!0},onInput:r(he)},null,8,["value","onInput"])])),_:1}),n("div",B,[n("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:de},[ve.value.length>0?(t(!0),d(v,{key:0},m(ve.value,(e=>(t(),d("div",{class:"content-item",key:e.id},[i(r(y),{round:"",size:38,src:e.senderAvatar},null,8,["src"]),n("div",J,[n("div",N,[n("span",null,u(e.senderName),1),n("span",null,u(r(S)(e.sendTime).recordTime),1)]),n("div",P,[e.content.chatMessageType===r(L).IMAGE?(t(),d("img",{key:0,class:"img",src:e.__content},null,8,X)):e.content.chatMessageType===r(L).EMOJI?(t(),d("img",{key:1,class:"emoji",src:r(D).findEmoji(e.__content)},null,8,$)):(t(),d("p",{key:2,innerHTML:e.__content},null,8,q))])])])))),128)):(t(),d("div",F,"没有找到相关记录"))],512),n("div",Q,[V,n("div",W,[Y,i(r(T),{value:pe.value,"onUpdate:value":a[1]||(a[1]=e=>pe.value=e),multiple:"","max-tag-count":1,"render-label":xe,options:r(ce).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),n("div",Z,[ee,n("div",ae,[i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",le,[te,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[2]||(a[2]=()=>Me("start"))},{default:o((()=>[f(u(fe.value),1)])),_:1},512),[[g,fe.value]]),p(n("span",se,"点击选择",512),[[g,!fe.value]])])])),default:o((()=>[i(r(E),{"formatted-value":fe.value,"onUpdate:formatted-value":a[3]||(a[3]=e=>fe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Te},null,8,["formatted-value"])])),_:1}),i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",re,[oe,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[4]||(a[4]=()=>Me("end"))},{default:o((()=>[f(u(ge.value),1)])),_:1},512),[[g,ge.value]]),p(n("span",ne,"点击选择",512),[[g,!ge.value]])])])),default:o((()=>[i(r(E),{"formatted-value":ge.value,"onUpdate:formatted-value":a[5]||(a[5]=e=>ge.value=e),type:"date",panel:"",clearable:"","is-date-disabled":ke},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{ie as default};
1
+ import{defineComponent as e,ref as a,watch as l,openBlock as t,createBlock as s,unref as r,withCtx as o,createElementVNode as n,createVNode as i,toDisplayString as u,resolveDynamicComponent as c,createElementBlock as d,Fragment as v,renderList as m,withDirectives as p,createTextVNode as f,vShow as g}from"vue";import{NModal as h,NAvatar as y,NInputGroup as b,NInput as _,NSelect as T,NPopover as k,NTag as M,NIcon as x}from"naive-ui";import{SearchOutline as w}from"@vicons/ionicons5";import{useState as I}from"../hooks/useState.js";import{transformMessage as j,formatTime as S}from"../utils/index.js";import{last as A}from"lodash-es";import{MESSAGE_TYPE as L}from"../constants/index.js";import{searchChatRecordApi as C}from"../api/index.js";import"trtc-sdk-v5";import E from"../../../date-picker/index.js";import{useDebounceFn as H}from"@vueuse/core";import{format as U}from"date-fns";import{useScrollLoading as z}from"../hooks/useScrollLoading.js";import{emojis as D}from"../utils/emoji.js";const G={class:"iho-chat-dialog__header"},K=n("span",{class:"left"},"聊天记录",-1),O={class:"center"},R={class:"iho-chat-dialog__content iho-chat-record-wrapper"},B={class:"chat-record-box"},J={class:"msg-box"},N={class:"name-and-time"},P={class:"content"},X=["src"],$=["src"],q=["innerHTML"],F={key:1,class:"no-data"},Q={class:"chat-record-box__filter"},V=n("span",{class:"filter-title"},"添加筛选条件",-1),W={class:"filter-item"},Y=n("span",{class:"label"},"成员:",-1),Z={class:"filter-item"},ee=n("span",{class:"label"},"日期:",-1),ae={class:"time-target"},le={class:"time-target__item"},te=n("span",null,"开始:",-1),se={class:"tip"},re={class:"time-target__item"},oe=n("span",null,"结束:",-1),ne={class:"tip"};var ie=e({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(e){const ie=e,ue={color:"#fff",textColor:"#666"},{state:ce}=I(),de=a(),ve=a([]),me=a(),pe=a([]),fe=a(),ge=a(),he=H(_e,500),ye={page:0,hasMore:!0,lastSendTime:U(new Date,"yyyy-MM-dd HH:mm:ss")};async function be(){var e;try{if(!ye.hasMore)return;ye.page++;const a=await C({orgId:ce.orgId,keyword:me.value,endTime:ge.value?ge.value+" 23:59:59":"",startTime:fe.value?fe.value+" 00:00:00":"",lastSendTime:ye.lastSendTime,memberIdSet:pe.value,page:ye.page,recordType:"ALL",sessionKey:ce.currentSessionItem.sessionKey,userId:ce.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(ye.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList),ye.lastSendTime=null==(e=A(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t,s,r;let o="";switch(e.content.chatMessageType){case L.TEXT:o=j(null==(a=e.content)?void 0:a.msg);break;case L.TEMPLATE:o=null==(s=null==(t=null==(l=e.content)?void 0:l.messageTemplate)?void 0:t.setting)?void 0:s.title;break;default:o=null==(r=e.content)?void 0:r.msg}e.__content=o})),ve.value=ye.page>1?ve.value.concat(l):l}catch(e){console.log(e)}}function _e(){Object.assign(ye,{page:0,hasMore:!0,lastSendTime:ge.value||U(new Date,"yyyy-MM-dd HH:mm:ss")}),be()}function Te(e){return!!ge.value&&e>Date.parse(`${ge.value} 23:59:59`)}function ke(e){return!!fe.value&&e<Date.parse(fe.value)}function Me(e){switch(e){case"member":pe.value=[];break;case"start":fe.value=null;break;case"end":ge.value=null}}function xe(e){return i(v,null,[i("div",{style:"display: flex;align-items: center"},[i(y,{src:e.avatar,round:!0,size:"small"},null),i("span",{style:"margin-left: 10px"},[e.name])])])}return z(de,(()=>{be()})),l([()=>pe.value,()=>fe.value,()=>ge.value],(()=>{ie.visible&&_e()}),{deep:!0}),l((()=>ie.visible),(e=>{e?_e():(me.value="",ge.value=null,fe.value=null,pe.value=[],ve.value=[])})),(e,a)=>(t(),s(r(h),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{header:o((()=>[n("div",G,[K,n("div",O,[i(r(y),{round:"",size:30,src:r(ce).currentSessionItem.avatar},null,8,["src"]),n("span",null,u(r(ce).currentSessionItem.name),1)])])])),default:o((()=>[n("div",R,[i(r(b),null,{default:o((()=>[(t(),s(c((()=>[i(x,{component:w,size:18,color:"#6666"},null),pe.value.length>0?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("member")},{default:()=>{var e;return[f("成员:")," ",pe.value.length>1?pe.value.length+"人":null==(e=ce.currentGroupUser.find((e=>e.id===pe.value[0])))?void 0:e.name]}}):null,fe.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("start")},{default:()=>[f("起始时间: "),fe.value]}):null,ge.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("end")},{default:()=>[f("结束时间: "),ge.value]}):null])))),i(r(_),{placeholder:"搜索",value:me.value,"onUpdate:value":a[0]||(a[0]=e=>me.value=e),valueModifiers:{trim:!0},onInput:r(he)},null,8,["value","onInput"])])),_:1}),n("div",B,[n("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:de},[ve.value.length>0?(t(!0),d(v,{key:0},m(ve.value,(e=>(t(),d("div",{class:"content-item",key:e.id},[i(r(y),{round:"",size:38,src:e.senderAvatar},null,8,["src"]),n("div",J,[n("div",N,[n("span",null,u(e.senderName),1),n("span",null,u(r(S)(e.sendTime).recordTime),1)]),n("div",P,[e.content.chatMessageType===r(L).IMAGE?(t(),d("img",{key:0,class:"img",src:e.__content},null,8,X)):e.content.chatMessageType===r(L).EMOJI?(t(),d("img",{key:1,class:"emoji",src:r(D).findEmoji(e.__content)},null,8,$)):(t(),d("p",{key:2,innerHTML:e.__content},null,8,q))])])])))),128)):(t(),d("div",F,"没有找到相关记录"))],512),n("div",Q,[V,n("div",W,[Y,i(r(T),{value:pe.value,"onUpdate:value":a[1]||(a[1]=e=>pe.value=e),multiple:"","max-tag-count":1,"render-label":xe,options:r(ce).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),n("div",Z,[ee,n("div",ae,[i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",le,[te,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[2]||(a[2]=()=>Me("start"))},{default:o((()=>[f(u(fe.value),1)])),_:1},512),[[g,fe.value]]),p(n("span",se,"点击选择",512),[[g,!fe.value]])])])),default:o((()=>[i(r(E),{"formatted-value":fe.value,"onUpdate:formatted-value":a[3]||(a[3]=e=>fe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Te},null,8,["formatted-value"])])),_:1}),i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",re,[oe,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[4]||(a[4]=()=>Me("end"))},{default:o((()=>[f(u(ge.value),1)])),_:1},512),[[g,ge.value]]),p(n("span",ne,"点击选择",512),[[g,!ge.value]])])])),default:o((()=>[i(r(E),{"formatted-value":ge.value,"onUpdate:formatted-value":a[5]||(a[5]=e=>ge.value=e),type:"date",panel:"",clearable:"","is-date-disabled":ke},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{ie as default};
@@ -3,11 +3,12 @@ declare const _default: import("vue").DefineComponent<{}, {
3
3
  listRef: import("vue").Ref<any>;
4
4
  inputRef: import("vue").Ref<any>;
5
5
  showSearch: import("vue").Ref<boolean>;
6
- keyword: import("vue").Ref<any>;
6
+ keyword: import("vue").Ref<string>;
7
7
  state: import("../types").IState;
8
8
  openSession: (item: import("../../../../shared/types").AnyObject) => Promise<void>;
9
9
  userList: import("vue").Ref<import("../../../../shared/types").AnyObject[]>;
10
10
  handleInput: () => void;
11
+ showNoData: import("vue").ComputedRef<boolean>;
11
12
  addSession: (userId: string) => Promise<void>;
12
13
  NPopover: any;
13
14
  NButton: any;
@@ -15,5 +16,60 @@ declare const _default: import("vue").DefineComponent<{}, {
15
16
  NInput: any;
16
17
  NIcon: any;
17
18
  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<{}>>, {}>;
19
+ DefaultPage: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
20
+ type: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ config: {
25
+ type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
26
+ default: () => {
27
+ title: string;
28
+ content: string;
29
+ };
30
+ };
31
+ }, {
32
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
33
+ type: {
34
+ type: StringConstructor;
35
+ default: string;
36
+ };
37
+ config: {
38
+ type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
39
+ default: () => {
40
+ title: string;
41
+ content: string;
42
+ };
43
+ };
44
+ }>> & {
45
+ onReloadPage?: ((...args: any[]) => any) | undefined;
46
+ }>>;
47
+ emit: (event: "reloadPage", ...args: any[]) => void;
48
+ configResult: import("vue").ComputedRef<{
49
+ title: string;
50
+ content: string;
51
+ img: string;
52
+ }>;
53
+ reloadPage: () => void;
54
+ NIcon: any;
55
+ Refresh: 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<{}>>, {}>;
56
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reloadPage"[], "reloadPage", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
57
+ type: {
58
+ type: StringConstructor;
59
+ default: string;
60
+ };
61
+ config: {
62
+ type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
63
+ default: () => {
64
+ title: string;
65
+ content: string;
66
+ };
67
+ };
68
+ }>> & {
69
+ onReloadPage?: ((...args: any[]) => any) | undefined;
70
+ }, {
71
+ type: string;
72
+ config: import("../../../../shared/types").AnyObject;
73
+ }>>;
18
74
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
19
75
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,watch as s,nextTick as r,openBlock as a,createBlock as t,unref as i,withCtx as l,createVNode as n,createTextVNode as u,createElementVNode as p,normalizeStyle as f,createElementBlock as c,Fragment as m,renderList as d,toDisplayString as v}from"vue";import{NPopover as h,NButton as k,NIcon as w,NInput as y,NAvatar as j}from"naive-ui";import{SearchOutline as S}from"@vicons/ionicons5";import{useState as _}from"../hooks/useState.js";import{useSession as g}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import{openSessionApi as x}from"../api/index.js";import{useTheme as C}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSearchUserList as R}from"../hooks/useSearchUserList.js";const U=["onClick"],I={class:"user-info"};var L=e({__name:"ChatSearch",setup(e){const L=C(),b=o(),z=o(),N=o(!1),T=o(),{state:D}=_(),{openSession:E}=g(D),{userList:G,handleInput:H}=R({wrapperRef:b,keywordRef:T});return s((()=>N.value),(async e=>{var o;e&&(await r(),null==(o=z.value)||o.focus())})),(e,o)=>(a(),t(i(h),{show:N.value,"onUpdate:show":o[1]||(o[1]=e=>N.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:l((()=>[n(i(k),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:l((()=>[n(i(w),{component:i(S),color:"#ffffff80"},null,8,["component"])])),default:l((()=>[u(" 搜索联系人 ")])),_:1})])),default:l((()=>[p("div",{class:"popover-search",style:f(i(L))},[n(i(y),{ref_key:"inputRef",ref:z,size:"small",clearable:"",autofocus:"",value:T.value,"onUpdate:value":[o[0]||(o[0]=e=>T.value=e),i(H)],valueModifiers:{trim:!0}},{prefix:l((()=>[n(i(w),{color:"#ffffff80",component:i(S)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),p("div",{class:"user-list-wrapper",ref_key:"listRef",ref:b},[(a(!0),c(m,null,d(i(G),(e=>(a(),c("div",{class:"user-item",key:e.id,onClick:()=>async function(e){N.value=!1;const o=await x({chatType:"SINGLE",receiver:e,sender:D.userInfo.id});E(o)}(e.id)},[n(i(j),{round:"",size:32,src:e.avatar},null,8,["src"]),p("div",I,[p("span",null,v(e.name),1),p("span",null,v(e.deptName),1),p("span",null,v(e.post),1)])],8,U)))),128))],512)],4)])),_:1},8,["show"]))}});export{L as default};
1
+ import{defineComponent as e,ref as s,computed as o,watch as r,nextTick as t,openBlock as a,createBlock as l,unref as n,normalizeStyle as i,withCtx as u,createVNode as p,createTextVNode as c,createElementVNode as f,createElementBlock as m,Fragment as d,renderList as v,toDisplayString as h,withDirectives as k,vShow as w}from"vue";import{NPopover as y,NButton as g,NIcon as j,NInput as S,NAvatar as _}from"naive-ui";import{SearchOutline as x}from"@vicons/ionicons5";import{useState as C}from"../hooks/useState.js";import{useSession as R}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import{openSessionApi as U}from"../api/index.js";import{useTheme as I}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSearchUserList as L}from"../hooks/useSearchUserList.js";import b from"../../../default-page/index.js";const z=["onClick"],N={class:"user-info"};var T=e({__name:"ChatSearch",setup(e){const T=I(),D=s(),E=s(),G=s(!1),H=s(""),{state:$}=C(),{openSession:q}=R($),{userList:A,handleInput:B}=L({wrapperRef:D,keywordRef:H}),F=o((()=>!A.value.length&&!!(H.value||"").replace(/^\s+|\s+$/g,"")));return r((()=>G.value),(async e=>{var s;e&&(await t(),null==(s=E.value)||s.focus())})),(e,s)=>(a(),l(n(y),{raw:"","content-class":"search-content",class:"search-wrapper",style:i(n(T)),show:G.value,"onUpdate:show":s[1]||(s[1]=e=>G.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:u((()=>[p(n(g),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:u((()=>[p(n(j),{component:n(x),color:"#ffffff80"},null,8,["component"])])),default:u((()=>[c(" 搜索联系人 ")])),_:1})])),default:u((()=>[p(n(S),{ref_key:"inputRef",ref:E,size:"small",clearable:"",autofocus:"",value:H.value,"onUpdate:value":[s[0]||(s[0]=e=>H.value=e),n(B)]},{prefix:u((()=>[p(n(j),{color:"#ffffff80",component:n(x)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),f("div",{class:"user-list-wrapper",ref_key:"listRef",ref:D},[(a(!0),m(d,null,v(n(A),(e=>(a(),m("div",{class:"user-item",key:e.id,onClick:()=>async function(e){G.value=!1;const s=await U({chatType:"SINGLE",receiver:e,sender:$.userInfo.id});q(s)}(e.id)},[p(n(_),{round:"",size:32,src:e.avatar},null,8,["src"]),f("div",N,[f("span",null,h(e.name),1),f("span",null,h(e.deptName),1),f("span",null,h(e.post),1)])],8,z)))),128)),k(p(n(b),{config:{title:" ",content:"找不到相关的结果"},type:"5"},null,512),[[w,n(F)]])],512)])),_:1},8,["style","show"]))}});export{T as default};
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as s,openBlock as t,createBlock as o,unref as i,withCtx as r,createVNode as n,createElementVNode as a,toDisplayString as m}from"vue";import{NDrawer as c,NDrawerContent as l,NAvatar as u,NIcon as p,NSwitch as d}from"naive-ui";import{ChevronForwardOutline as f}from"@vicons/ionicons5";import{useState as h}from"../hooks/useState.js";import{useSession as v}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import{isFunction as S}from"lodash-es";import"../utils/emoji.js";import g from"./PersonProfile.vue.js";import{toppingSessionApi as _}from"../api/index.js";const I={class:"chat-set-wrapper"},j={class:"item user-info"},w={class:"item"},b=a("span",{class:"label"},"置顶聊天",-1);var k=e({__name:"ChatSet",setup(e){const k=s(),{state:y}=h(),{setCurrentSessionItem:C,isGroupChat:U}=v(y);async function x(e){try{await _({sessionKey:y.currentSessionItem.sessionKey,id:y.currentSessionItem.id,topping:e}),C({topping:e})}catch(e){console.log(e)}}function z(){S(k["onUpdate:show"])&&k["onUpdate:show"](!1)}return(e,s)=>(t(),o(i(c),{width:320,"trap-focus":!1,"block-scroll":!1,to:".iho-chat"},{default:r((()=>[n(i(l),{title:"聊天设置"},{default:r((()=>[a("div",I,[n(g,{"user-id":i(y).currentSessionItem.receiver,onClose:z,disabled:!!i(U)},{trigger:r((()=>[a("div",j,[n(i(u),{round:"",size:40,src:i(y).currentSessionItem.avatar},null,8,["src"]),a("span",null,m(i(y).currentSessionItem.name),1),n(i(p),{size:24,component:i(f),class:"item__right"},null,8,["component"])])])),_:1},8,["user-id","disabled"]),a("div",w,[b,n(i(d),{value:i(y).currentSessionItem.topping,"onUpdate:value":[s[0]||(s[0]=e=>i(y).currentSessionItem.topping=e),x],class:"item__right"},null,8,["value"])])])])),_:1})])),_:1}))}});export{k as default};
1
+ import{defineComponent as e,useAttrs as s,openBlock as t,createBlock as o,unref as i,withCtx as r,createVNode as n,createElementVNode as a,toDisplayString as m}from"vue";import{NDrawer as c,NDrawerContent as l,NAvatar as p,NIcon as u,NSwitch as d}from"naive-ui";import{ChevronForwardOutline as f}from"@vicons/ionicons5";import{useState as h}from"../hooks/useState.js";import{useSession as v}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import{isFunction as S}from"lodash-es";import"../utils/emoji.js";import g from"./PersonProfile.vue.js";import{toppingSessionApi as _}from"../api/index.js";const I={class:"chat-set-wrapper"},j={class:"item user-info"},b={class:"name"},w={class:"item"},k=a("span",{class:"label"},"置顶聊天",-1);var y=e({__name:"ChatSet",setup(e){const y=s(),{state:C}=h(),{setCurrentSessionItem:U,isGroupChat:x}=v(C);async function z(e){try{await _({sessionKey:C.currentSessionItem.sessionKey,id:C.currentSessionItem.id,topping:e}),U({topping:e})}catch(e){console.log(e)}}function K(){S(y["onUpdate:show"])&&y["onUpdate:show"](!1)}return(e,s)=>(t(),o(i(c),{width:320,"trap-focus":!1,"block-scroll":!1,to:".iho-chat"},{default:r((()=>[n(i(l),{title:"聊天设置"},{default:r((()=>[a("div",I,[n(g,{"user-id":i(C).currentSessionItem.receiver,onClose:K,disabled:!!i(x),placement:"bottom-end"},{trigger:r((()=>[a("div",j,[n(i(p),{round:"",size:40,src:i(C).currentSessionItem.avatar},null,8,["src"]),a("span",b,m(i(C).currentSessionItem.name),1),n(i(u),{size:24,component:i(f),class:"item__right"},null,8,["component"])])])),_:1},8,["user-id","disabled"]),a("div",w,[k,n(i(d),{value:i(C).currentSessionItem.topping,"onUpdate:value":[s[0]||(s[0]=e=>i(C).currentSessionItem.topping=e),z],class:"item__right"},null,8,["value"])])])])),_:1})])),_:1}))}});export{y as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as o,withDirectives as n,createVNode as s,vShow as i,isVNode as l}from"vue";import{NButtonGroup as r,NButton as a,NIcon as p}from"naive-ui";import{CopyOutline as u,OpenOutline as c,ChatbubbleEllipsesOutline as d,ReorderFourOutline as m,ReturnDownBack as y,DownloadOutline as f}from"@vicons/ionicons5";import{onClickOutside as h}from"@vueuse/core";import{useState as v}from"../hooks/useState.js";import{isAudioOrVideoMessage as w}from"../utils/index.js";import"lodash-es";import{MESSAGE_TYPE as b}from"../constants/index.js";import"../api/index.js";import"trtc-sdk-v5";import{isSameMonth as k}from"date-fns";var g=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},position:{type:Object},msgId:{type:String}},emits:["update:show","select"],setup(e,{attrs:g,slots:j,emit:E}){const{state:T,setMsgList:I}=v(),L=[{icon:u,label:"复制",key:"copy"},{icon:c,label:"转发",key:"relay"},{icon:d,label:"回复",key:"reply"},{icon:m,label:"多选",key:"multiSelect"},{icon:y,label:"撤回",key:"withdraw"},{icon:f,label:"下载",key:"download"}],M=t(null),x=o((()=>T.msgList.find((({id:t})=>t===e.msgId)))),O=o((()=>{if(!e.msgId)return[];if(!(null==x?void 0:x.value))return[];const{content:t={},sendTime:o,sender:n}=x.value,{chatMessageType:s}=t,i=[];return(n!==T.userInfo.id&&k(new Date(o),new Date)||s===b.TEMPLATE)&&i.push("withdraw"),[b.TEXT,b.EMOJI,b.BLEND].includes(s)?i.push("download"):w(t)?i.push("copy","relay","download"):s===b.FILE?i.push("copy"):[b.FORWARD,b.TEMPLATE].includes(s)&&i.push("copy","download"),i.length?L.filter((e=>!i.includes(e.key))):L}));return h(M,(e=>{E("update:show",!1)})),()=>{let t;return e.msgId&&O.value?n(s("div",{class:"contextmenu-wrapper",ref:M,style:e.position},[s(r,{vertical:!0},(o=t=O.value.map((e=>s(a,{onClick:()=>{return t=e.key,E("update:show",!1),x.value,void E("select",t);var t},quaternary:!0},{default:()=>e.label,icon:()=>s(p,{component:e.icon},null)}))),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!l(o)?t:{default:()=>[t]}))]),[[i,e.show]]):null;var o}}});export{g as default};
1
+ import{defineComponent as e,ref as t,computed as o,withDirectives as s,createVNode as i,vShow as n,isVNode as r}from"vue";import{NButtonGroup as a,NButton as l,NIcon as p}from"naive-ui";import{CopyOutline as c,ChatbubbleEllipsesOutline as d,DownloadOutline as u}from"@vicons/ionicons5";import{onClickOutside as m}from"@vueuse/core";import{useState as f}from"../hooks/useState.js";import{isAudioOrVideoMessage as g,downloadFile as y}from"../utils/index.js";import"lodash-es";import{MESSAGE_TYPE as w}from"../constants/index.js";import"../api/index.js";import"trtc-sdk-v5";import{isSameMonth as h}from"date-fns";import{emojis as v}from"../utils/emoji.js";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:b,emit:T}){const{state:I,setMsgList:j}=f(),M=[{icon:c,label:"复制",key:"copy"},{icon:d,label:"回复",key:"reply"},{icon:u,label:"下载",key:"download"}],x=t(null),k=o((()=>I.msgList.find((({id:t})=>t===e.msgId)))),O=o((()=>{if(!e.msgId)return[];if(!(null==k?void 0:k.value))return[];const{content:t={},sendTime:o,sender:s}=k.value,{chatMessageType:i}=t,n=[];return(s!==I.userInfo.id&&h(new Date(o),new Date)||i===w.TEMPLATE)&&n.push("withdraw"),[w.TEXT,w.EMOJI,w.BLEND].includes(i)?n.push("download"):g(t)?n.push("copy","relay","reply","download"):i===w.FILE?n.push("copy"):[w.FORWARD,w.TEMPLATE].includes(i)&&n.push("copy","download"),n.length?M.filter((e=>!n.includes(e.key))):M}));return m(x,(e=>{T("update:show",!1)})),()=>{let t;return e.msgId&&O.value?s(i("div",{class:"contextmenu-wrapper",ref:x,style:e.position},[i(a,{vertical:!0},(o=t=O.value.map((e=>i(l,{onClick:()=>async function(e){T("update:show",!1);const{content:t={},sendTime:o,sender:s}=k.value||{},{chatMessageType:i}=t;switch(e){case"copy":if(!t.msg)return console.log("复制内容为空!");if(!navigator||!("clipboard"in navigator))return console.log("当前浏览器版本不支持复制!");try{if(i===w.TEXT)await navigator.clipboard.writeText(t.msg);else{let e;if([w.EMOJI,w.IMAGE].includes(i)){const o=i===w.EMOJI?v.findEmoji(t.msg):t.msg;e=`<img data-msg=${t.msg} data-type=${i} ${i===w.EMOJI?'style="width: 24px;"':""} src=${o} />`}else e=t.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 y(t.fileUrl,t.msg)}T("select",e,k.value)}(e.key),quaternary:!0},{default:()=>e.label,icon:()=>i(p,{component:e.icon},null)}))),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!r(o)?t:{default:()=>[t]}))]),[[n,e.show]]):null;var o}}});export{E as default};
@@ -23,6 +23,20 @@ declare const _default: import("vue").DefineComponent<{}, {
23
23
  timing: import("vue").Ref<string>;
24
24
  toggleVideo: () => Promise<void>;
25
25
  videocamOpen: import("vue").Ref<boolean>;
26
+ installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
27
+ handleError: import("../../../../shared/types").AnyFn;
28
+ handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
29
+ handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
30
+ handleRemoteUserExit: import("../../../../shared/types").AnyFn;
31
+ handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
32
+ }) => void;
33
+ uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
34
+ handleError: import("../../../../shared/types").AnyFn;
35
+ handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
36
+ handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
37
+ handleRemoteUserExit: import("../../../../shared/types").AnyFn;
38
+ handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
39
+ }) => void;
26
40
  isConnect: import("vue").Ref<boolean>;
27
41
  callUser: import("vue").ComputedRef<any>;
28
42
  title: import("vue").ComputedRef<string>;
@@ -30,8 +44,6 @@ declare const _default: import("vue").DefineComponent<{}, {
30
44
  handleCall: () => void;
31
45
  handleEnter: () => Promise<void>;
32
46
  handleExit: () => Promise<void>;
33
- installEventHandlers: () => void;
34
- uninstallEventHandlers: () => void;
35
47
  handleRemoteVideoAvailable: (event: any) => Promise<void>;
36
48
  handleRemoteAudioAvailable: (event: any) => Promise<void>;
37
49
  handleRemoteUserEnter: (event: any) => Promise<void>;
@@ -119,6 +131,7 @@ declare const _default: import("vue").DefineComponent<{}, {
119
131
  NInput: any;
120
132
  NCheckbox: any;
121
133
  NCheckboxGroup: any;
134
+ NTooltip: any;
122
135
  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<{}>>, {}>;
123
136
  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<{}>>, {}>;
124
137
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", 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 n,openBlock as t,createElementBlock as s,createElementVNode as i,withDirectives as c,toDisplayString as l,unref as a,vShow as r,createVNode as u,withCtx as d,Fragment as p,renderList as m,createCommentVNode as f,createTextVNode as v,nextTick as E}from"vue";import{NButton as g,NIcon as _}from"naive-ui";import V from"./ChatAdd.vue.js";import{Close as I,Mic as T,MicOff as A,Videocam as h,VideocamOff as R,Call as M,PersonAdd as k}from"@vicons/ionicons5";import{xorBy as y}from"lodash-es";import"date-fns";import{CHAT_TYPE as w,SUBSCRIBE_MESSAGE_TYPE as b}from"../constants/index.js";import"../utils/emoji.js";import"@vueuse/core";import{getUserDetailApi as O}from"../api/index.js";import{useVideo as N}from"../hooks/useVideo.js";import x from"trtc-sdk-v5";const C={class:"video-wrapper video-wrapper--multiple"},L={class:"video-header"},S={key:0,class:"video-main"},U={class:"video-main__left"},j=["data-name"],D={class:"video-bottom"},$={class:"btn-group"},z={class:"btn"},B=i("span",{class:"text"},"静音",-1),H={class:"btn"},P=i("span",{class:"text"},"摄像头",-1),X=i("span",{class:"text"},"结束会诊",-1),Y={class:"btn"},q=i("span",{class:"text"},"添加参会人",-1),G={class:"video-main__right"},F=["id","data-name"],J={class:"user"},K={class:"name"},Q={key:0,class:"tip"},W={key:0,class:"calling-box"},Z={class:"btn-box"},ee={key:1,class:"opt-btn"},oe={class:"btn"},ne=i("span",null,"拒接",-1),te={class:"btn"},se=i("span",null,"接听",-1);var ie=e({__name:"MultipleVideo",setup(e){const ie=o(),ce=o([]),{state:le,sendMessage:ae,trtc:re,voiceOpen:ue,isAudio:de,isCall:pe,startTimer:me,resetTimer:fe,toggleAudio:ve,messageTypeText:Ee,timing:ge,toggleVideo:_e,videocamOpen:Ve}=N(),Ie=o(!1),Te=n((()=>pe.value?le.userInfo.name:le.currentAVMsg.sendName)),Ae=n((()=>{if(!Ie.value)return"";const e=pe.value?`(${ce.value.length+1}/${le.currentAVMsg.checkedIds.length+1})`:"";return`${Te.value}发起的${Ee.value}会诊${e} ${ge.value}`}));function he(e){console.log("checkedIds :>> ",e),le.currentAVMsg.checkedIds.push(...e),Re()}function Re(){var e;(null==(e=le.currentAVMsg.checkedIds)?void 0:e.length)&&le.currentAVMsg.checkedIds.forEach((e=>{ae({chatType:w.SINGLE,content:{msg:le.currentAVMsg.chatMessageType+","+le.currentAVMsg.strRoomId,chatMessageType:b.AV_STATUS},receiver:e})})),Ie.value||Me()}async function Me(){const e=await x.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(le.showMultipleVideo=!1);try{if(await re.enterRoom({strRoomId:le.currentAVMsg.strRoomId,sdkAppId:parseInt(le.userInfo.sdkAppID),userId:le.userInfo.id,userSig:le.userInfo.userSig}),Ie.value=!0,me(),function(){if(re.on(x.EVENT.ERROR,xe),re.on(x.EVENT.REMOTE_USER_ENTER,be),re.on(x.EVENT.REMOTE_AUDIO_AVAILABLE,we),re.on(x.EVENT.REMOTE_USER_EXIT,Ne),de.value)return;re.on(x.EVENT.REMOTE_VIDEO_AVAILABLE,ye)}(),await re.startLocalAudio(),de.value)return;await re.startLocalVideo({view:ie.value})}catch(e){console.log("error :>> ",e),le.showMultipleVideo=!1}}async function ke(){try{if(le.showMultipleVideo=!1,function(){if(re.off(x.EVENT.ERROR,xe),re.off(x.EVENT.REMOTE_USER_ENTER,be),re.off(x.EVENT.REMOTE_AUDIO_AVAILABLE,we),re.off(x.EVENT.REMOTE_USER_EXIT,Ne),de.value)return;re.off(x.EVENT.REMOTE_VIDEO_AVAILABLE,ye)}(),await re.exitRoom(),await re.stopLocalAudio(),de.value)return;await re.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function ye(e){const{userId:o,streamType:n}=e;try{n===x.TYPE.STREAM_TYPE_MAIN&&(await E(),await re.startRemoteVideo({userId:o,streamType:n,view:o}))}catch(e){console.log("error :>> ",e)}}async function we(e){var o;const{userId:n}=e;if(n&&!(null==(o=ce.value.map((e=>e.id)))?void 0:o.includes(n))){const e=await Oe(n);ce.value.push({id:n,name:e})}}async function be(e){const{userId:o}=e,n=await Oe(o);ce.value.push({id:o,name:n}),me()}async function Oe(e){const o=await O({userId:e});return(null==o?void 0:o.name)||""}function Ne(e){console.log("event :>> 退房",e);const{userId:o}=e;ce.value=y(ce.value,[{id:o,name:""}],"id")}function xe(e){console.log("error :>> ",e),le.showMultipleVideo=!1}return(e,o)=>(t(),s("div",C,[i("div",L,[c(i("span",{class:"title"},l(a(Ae)),513),[[r,Ie.value]]),u(a(g),{quaternary:"",circle:"",color:"#ffffffcc",onClick:ke},{icon:d((()=>[u(a(_),{component:a(I)},null,8,["component"])])),_:1})]),Ie.value?(t(),s("div",S,[i("div",U,[i("div",{ref_key:"selfVideoRef",ref:ie,class:"video-view","data-name":a(le).userInfo.name},null,8,j),i("div",D,[i("div",$,[i("div",z,[u(a(g),{text:"",color:a(ue)?"#fff":"#000",onClick:a(ve)},{icon:d((()=>[u(a(_),{component:a(ue)?a(T):a(A)},null,8,["component"])])),_:1},8,["color","onClick"]),B]),i("div",H,[u(a(g),{text:"",color:a(Ve)?"#fff":"#000",disabled:a(de),onClick:a(_e)},{icon:d((()=>[u(a(_),{component:a(Ve)?a(h):a(R)},null,8,["component"])])),_:1},8,["color","disabled","onClick"]),P]),i("div",{class:"btn",onClick:ke},[u(a(g),{circle:"",color:"#f17568",class:"btn--rotate"},{icon:d((()=>[u(a(_),{component:a(M)},null,8,["component"])])),_:1}),X]),u(V,{onComfirm:he},{trigger:d((()=>[i("div",Y,[u(a(g),{text:"",color:"#fff"},{icon:d((()=>[u(a(_),{component:a(k)},null,8,["component"])])),_:1}),q])])),_:1})])])]),i("div",G,[(t(!0),s(p,null,m(ce.value,(e=>(t(),s("div",{key:e.id,id:e.id,class:"video-view","data-name":e.name},null,8,F)))),128))])])):(t(),s(p,{key:1},[i("div",J,[i("span",K,l(a(Te))+"发起的"+l(a(Ee))+"会议",1),a(pe)?f("v-if",!0):(t(),s("span",Q,"邀请你加入"+l(a(Ee))+"会议",1))]),a(pe)?(t(),s("div",W,[u(V,{onComfirm:he},{trigger:d((()=>[u(a(g),{size:"large",circle:"",color:"#000"},{icon:d((()=>[u(a(_),{component:a(k)},null,8,["component"])])),_:1})])),_:1}),i("p",null,"已邀请共"+l(a(le).currentAVMsg.checkedIds.length)+"人",1),u(a(g),{size:"large",strong:"",round:"",type:"primary",onClick:Re},{default:d((()=>[v("开始会诊")])),_:1}),i("div",Z,[u(a(g),{color:"#000",round:""},{icon:d((()=>[u(a(_),{component:a(T)},null,8,["component"])])),_:1}),u(a(g),{color:"#000",round:""},{icon:d((()=>[u(a(_),{component:a(h)},null,8,["component"])])),_:1})])])):(t(),s("div",ee,[i("div",oe,[u(a(g),{circle:"",color:"#f17568",class:"btn--rotate",onClick:o[0]||(o[0]=()=>a(le).showMultipleVideo=!1)},{icon:d((()=>[u(a(_),{size:"30",component:a(M)},null,8,["component"])])),_:1}),ne]),i("div",te,[u(a(g),{circle:"",color:"#2ac98b",onClick:Me},{icon:d((()=>[u(a(_),{size:"30",component:a(M)},null,8,["component"])])),_:1}),se])]))],64))]))}});export{ie as default};
1
+ import{defineComponent as e,ref as o,computed as n,onBeforeUnmount as t,openBlock as s,createElementBlock as l,createElementVNode as i,withDirectives as a,toDisplayString as c,unref as r,vShow as d,createVNode as u,withCtx as m,Fragment as p,renderList as v,createCommentVNode as f,createTextVNode as g,nextTick as h}from"vue";import{NButton as k,NIcon as A}from"naive-ui";import I from"./ChatAdd.vue.js";import{Close as y,Mic as V,MicOff as w,Videocam as _,VideocamOff as b,Call as M,PersonAdd as R}from"@vicons/ionicons5";import{xorBy as x}from"lodash-es";import"date-fns";import{CHAT_TYPE as E,SUBSCRIBE_MESSAGE_TYPE as T}from"../constants/index.js";import"../utils/emoji.js";import"@vueuse/core";import{getUserDetailApi as C}from"../api/index.js";import{useVideo as S}from"../hooks/useVideo.js";import j from"trtc-sdk-v5";const $={class:"video-wrapper video-wrapper--multiple"},L={class:"video-header"},U={key:0,class:"video-main"},z={class:"video-main__left"},H=["data-name"],N={class:"video-bottom"},D={class:"btn-group"},O={class:"btn"},P=i("span",{class:"text"},"静音",-1),Y={class:"btn"},q=i("span",{class:"text"},"摄像头",-1),G=i("span",{class:"text"},"结束会诊",-1),B={class:"btn"},F=i("span",{class:"text"},"添加参会人",-1),J={class:"video-main__right"},K=["id","data-name"],Q={class:"user"},W={class:"name"},X={key:0,class:"tip"},Z={key:0,class:"calling-box"},ee={class:"btn-box"},oe={key:1,class:"opt-btn"},ne={class:"btn"},te=i("span",null,"拒接",-1),se={class:"btn"},le=i("span",null,"接听",-1);var ie=e({__name:"MultipleVideo",setup(e){const ie=o(),ae=o([]),{state:ce,sendMessage:re,trtc:de,voiceOpen:ue,isAudio:me,isCall:pe,startTimer:ve,resetTimer:fe,toggleAudio:ge,messageTypeText:he,timing:ke,toggleVideo:Ae,videocamOpen:Ie,installEventHandlers:ye,uninstallEventHandlers:Ve}=S(),we=o(!1),_e=n((()=>pe.value?ce.userInfo.name:ce.currentAVMsg.sendName)),be=n((()=>{if(!we.value)return"";const e=pe.value?`(${ae.value.length+1}/${ce.currentAVMsg.checkedIds.length+1})`:"";return`${_e.value}发起的${he.value}会诊${e} ${ke.value}`}));function Me(e){console.log("checkedIds :>> ",e),ce.currentAVMsg.checkedIds.push(...e),Re()}function Re(){var e;(null==(e=ce.currentAVMsg.checkedIds)?void 0:e.length)&&ce.currentAVMsg.checkedIds.forEach((e=>{re({chatType:E.SINGLE,content:{msg:ce.currentAVMsg.chatMessageType+","+ce.currentAVMsg.strRoomId,chatMessageType:T.AV_STATUS},receiver:e})})),we.value||xe()}async function xe(){const e=await j.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(ce.showMultipleVideo=!1);try{if(await de.enterRoom({strRoomId:ce.currentAVMsg.strRoomId,sdkAppId:parseInt(ce.userInfo.sdkAppID),userId:ce.userInfo.id,userSig:ce.userInfo.userSig}),we.value=!0,ve(),ye({handleError:Le,handleRemoteUserEnter:Se,handleRemoteAudioAvailable:Ce,handleRemoteUserExit:$e,handleRemoteVideoAvailable:Te}),await de.startLocalAudio(),me.value)return;await de.startLocalVideo({view:ie.value})}catch(e){console.log("error :>> ",e),ce.showMultipleVideo=!1}}async function Ee(){try{if(ce.showMultipleVideo=!1,Ve({handleError:Le,handleRemoteUserEnter:Se,handleRemoteAudioAvailable:Ce,handleRemoteUserExit:$e,handleRemoteVideoAvailable:Te}),await de.exitRoom(),await de.stopLocalAudio(),me.value)return;await de.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function Te(e){const{userId:o,streamType:n}=e;try{n===j.TYPE.STREAM_TYPE_MAIN&&(await h(),await de.startRemoteVideo({userId:o,streamType:n,view:o}))}catch(e){console.log("error :>> ",e)}}async function Ce(e){var o;const{userId:n}=e;if(n&&!(null==(o=ae.value.map((e=>e.id)))?void 0:o.includes(n))){const e=await je(n);ae.value.push({id:n,name:e})}}async function Se(e){const{userId:o}=e,n=await je(o);ae.value.push({id:o,name:n}),ve()}async function je(e){const o=await C({userId:e});return(null==o?void 0:o.name)||""}function $e(e){console.log("event :>> 退房",e);const{userId:o}=e;ae.value=x(ae.value,[{id:o,name:""}],"id")}function Le(e){console.log("error :>> ",e),ce.showMultipleVideo=!1}return t((()=>{Ee()})),(e,o)=>(s(),l("div",$,[i("div",L,[a(i("span",{class:"title"},c(r(be)),513),[[d,we.value]]),u(r(k),{quaternary:"",circle:"",color:"#ffffffcc",onClick:Ee},{icon:m((()=>[u(r(A),{component:r(y)},null,8,["component"])])),_:1})]),we.value?(s(),l("div",U,[i("div",z,[i("div",{ref_key:"selfVideoRef",ref:ie,class:"video-view","data-name":r(ce).userInfo.name},null,8,H),i("div",N,[i("div",D,[i("div",O,[u(r(k),{text:"",color:r(ue)?"#fff":"#000",onClick:r(ge)},{icon:m((()=>[u(r(A),{component:r(ue)?r(V):r(w)},null,8,["component"])])),_:1},8,["color","onClick"]),P]),i("div",Y,[u(r(k),{text:"",color:r(Ie)?"#fff":"#000",disabled:r(me),onClick:r(Ae)},{icon:m((()=>[u(r(A),{component:r(Ie)?r(_):r(b)},null,8,["component"])])),_:1},8,["color","disabled","onClick"]),q]),i("div",{class:"btn",onClick:Ee},[u(r(k),{circle:"",color:"#f17568",class:"btn--rotate"},{icon:m((()=>[u(r(A),{component:r(M)},null,8,["component"])])),_:1}),G]),u(I,{onComfirm:Me},{trigger:m((()=>[i("div",B,[u(r(k),{text:"",color:"#fff"},{icon:m((()=>[u(r(A),{component:r(R)},null,8,["component"])])),_:1}),F])])),_:1})])])]),i("div",J,[(s(!0),l(p,null,v(ae.value,(e=>(s(),l("div",{key:e.id,id:e.id,class:"video-view","data-name":e.name},null,8,K)))),128))])])):(s(),l(p,{key:1},[i("div",Q,[i("span",W,c(r(_e))+"发起的"+c(r(he))+"会议",1),r(pe)?f("v-if",!0):(s(),l("span",X,"邀请你加入"+c(r(he))+"会议",1))]),r(pe)?(s(),l("div",Z,[u(I,{onComfirm:Me},{trigger:m((()=>[u(r(k),{size:"large",circle:"",color:"#000"},{icon:m((()=>[u(r(A),{component:r(R)},null,8,["component"])])),_:1})])),_:1}),i("p",null,"已邀请共"+c(r(ce).currentAVMsg.checkedIds.length)+"人",1),u(r(k),{size:"large",strong:"",round:"",type:"primary",onClick:Re},{default:m((()=>[g("开始会诊")])),_:1}),i("div",ee,[u(r(k),{color:"#000",round:""},{icon:m((()=>[u(r(A),{component:r(V)},null,8,["component"])])),_:1}),u(r(k),{color:"#000",round:""},{icon:m((()=>[u(r(A),{component:r(_)},null,8,["component"])])),_:1})])])):(s(),l("div",oe,[i("div",ne,[u(r(k),{circle:"",color:"#f17568",class:"btn--rotate",onClick:o[0]||(o[0]=()=>r(ce).showMultipleVideo=!1)},{icon:m((()=>[u(r(A),{size:"30",component:r(M)},null,8,["component"])])),_:1}),te]),i("div",se,[u(r(k),{circle:"",color:"#2ac98b",onClick:xe},{icon:m((()=>[u(r(A),{size:"30",component:r(M)},null,8,["component"])])),_:1}),le])]))],64))]))}});export{ie as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,reactive as a,computed as l,openBlock as n,createBlock as s,unref as r,createSlots as t,withCtx as i,createElementBlock as c,Fragment as u,withDirectives as p,createElementVNode as d,createVNode as v,vShow as m,toDisplayString as f,createTextVNode as y,renderList as k,createCommentVNode as b,renderSlot as g}from"vue";import{NPopover as h,NAvatar as _,NUpload as w,NUploadTrigger as C,NButton as I,NIcon as j}from"naive-ui";import{Camera as z,ChatbubbleEllipses as x,EyeOffOutline as N,EyeOutline as S,Close as $}from"@vicons/ionicons5";import{useState as D}from"../hooks/useState.js";import{useSession as P}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import{openSessionApi as T,getUserDetailApi as q,uploadFileApi as B}from"../api/index.js";const E={class:"popover-person"},F={class:"popover-person__left"},O={class:"profile"},U={class:"profile__text"},A={class:"popover-person__right"},G={class:"label"},H={class:"content"};var J=e({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:J}){const K=e,{state:L}=D(),{openSession:M}=P(L),Q=o(!1),R=o(!1),V=o(!1),W=a({}),X=[{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"}],Y=l((()=>(W.id&&X.forEach((e=>{const{key:o}=e;e.value=W[o]})),X)));async function Z(){Q.value=!1;const e=await T({chatType:L.currentSessionItem.chatType,receiver:K.userId,sender:L.userInfo.id});M(e),J("close")}async function ee(e){if(!e)return;const o=await q({userId:K.userId});(null==o?void 0:o.id)?Object.assign(W,o):W.id=""}function oe(e){const{key:o,value:a}=e;return"phone"!==o||V.value?a:(a||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}async function ae(e){const{file:o,name:a}=e.file,l=new FormData;l.append("sender",L.userInfo.id),l.append("file",o);const n=await B(l);if(W.avatar=n,!n)return console.log("上传失败")}return(o,a)=>(n(),s(r(h),{show:Q.value,"onUpdate:show":[a[3]||(a[3]=e=>Q.value=e),ee],trigger:e.disabled?"manual":"click","show-arrow":!1,scrollable:"",delay:0},t({default:i((()=>[W.id?(n(),c(u,{key:0},[p(d("div",E,[d("div",F,[d("div",O,[v(r(_),{src:W.avatar,bordered:"",round:"",size:100,onClickCapture:a[0]||(a[0]=e=>R.value=!0)},null,8,["src"]),v(r(w),{abstract:"",accept:"image/*",onChange:ae},{default:i((()=>[v(r(C),{abstract:""},{default:i((({handleClick:e})=>[p(v(r(I),{circle:"",secondary:"",class:"edit-avatar",onClick:e},{icon:i((()=>[v(r(j),{size:"16",color:"#666666",component:r(z)},null,8,["component"])])),_:2},1032,["onClick"]),[[m,W.id===r(L).userInfo.id]])])),_:1})])),_:1}),d("div",U,[d("h4",null,f(W.name),1),d("p",null,f(W.orgName),1)]),v(r(I),{strong:"",secondary:"",onClick:Z},{default:i((()=>[v(r(j),{size:"13",color:"#666666",component:r(x),style:{"margin-right":"6px"}},null,8,["component"]),y(" 发消息 ")])),_:1})])]),d("div",A,[(n(!0),c(u,null,k(r(Y),((e,o)=>(n(),c("div",{class:"info-item",key:o},[d("span",G,f(e.label),1),d("div",H,[d("span",null,f(oe(e)),1),"phone"===e.key&&oe(e)?(n(),s(r(j),{key:0,size:"16",color:"#666666",component:V.value?r(N):r(S),style:{"margin-left":"10px"},onClick:a[1]||(a[1]=e=>V.value=!V.value)},null,8,["component"])):b("v-if",!0)])])))),128))])],512),[[m,!R.value]]),p(d("div",{class:"large-avatar",onClick:a[2]||(a[2]=e=>R.value=!1)},[v(r(I),{circle:"",size:"small",secondary:""},{icon:i((()=>[v(r(j),{size:24,component:r($),color:"#fff"},null,8,["component"])])),_:1}),v(r(_),{size:310,round:"",src:W.avatar},null,8,["src"])],512),[[m,R.value]])],64)):b("v-if",!0)])),_:2},[k(o.$slots,((e,a)=>({name:a,fn:i((()=>[g(o.$slots,a)]))})))]),1032,["show","trigger"]))}});export{J as default};
1
+ import{defineComponent as e,ref as a,reactive as l,computed as o,openBlock as s,createBlock as n,unref as i,createSlots as t,withCtx as r,createElementBlock as c,Fragment as u,withDirectives as d,createElementVNode as p,createVNode as m,vShow as v,toDisplayString as f,createTextVNode as y,renderList as k,createCommentVNode as h,renderSlot as g}from"vue";import{NPopover as b,NAvatar as _,NUpload as w,NUploadTrigger as C,NButton as I,NIcon as j}from"naive-ui";import{Camera as z,ChatbubbleEllipses as x,EyeOffOutline as N,EyeOutline as S,Close as $}from"@vicons/ionicons5";import{useState as D}from"../hooks/useState.js";import{useSession as P}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import{openSessionApi as T,getUserDetailApi as q,uploadFileApi as B}from"../api/index.js";const E={class:"person-profile-main"},F={class:"left"},O={class:"profile"},U={class:"profile__text"},A={class:"right"},G={class:"right__content"},H={class:"label"},J={class:"content"};var K=e({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:K}){const L=e,{state:M}=D(),{openSession:Q}=P(M),R=a(!1),V=a(!1),W=a(!1),X=l({}),Y=[{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"}],Z=o((()=>(X.id&&Y.forEach((e=>{const{key:a}=e;e.value=X[a]})),Y)));async function ee(){R.value=!1;const e=await T({chatType:M.currentSessionItem.chatType,receiver:L.userId,sender:M.userInfo.id});Q(e),K("close")}async function ae(e){if(!e)return;const a=await q({userId:L.userId});(null==a?void 0:a.id)?Object.assign(X,a):X.id=""}function le(e){const{key:a,value:l}=e;return"phone"!==a||W.value?l:(l||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}async function oe(e){const{file:a,name:l}=e.file,o=new FormData;o.append("sender",M.userInfo.id),o.append("file",a);const s=await B(o);if(X.avatar=s,!s)return console.log("上传失败")}return(a,l)=>(s(),n(i(b),{raw:"",class:"person-profile-wrapper",show:R.value,"onUpdate:show":[l[3]||(l[3]=e=>R.value=e),ae],trigger:e.disabled?"manual":"click","show-arrow":!1,shift:""},t({default:r((()=>[X.id?(s(),c(u,{key:0},[d(p("div",E,[p("div",F,[p("div",O,[m(i(_),{src:X.avatar,bordered:"",round:"",size:100,onClickCapture:l[0]||(l[0]=e=>V.value=!0)},null,8,["src"]),m(i(w),{abstract:"",accept:"image/*",onChange:oe},{default:r((()=>[m(i(C),{abstract:""},{default:r((({handleClick:e})=>[d(m(i(I),{circle:"",secondary:"",class:"edit-avatar",onClick:e},{icon:r((()=>[m(i(j),{size:"16",color:"#666666",component:i(z)},null,8,["component"])])),_:2},1032,["onClick"]),[[v,X.id===i(M).userInfo.id]])])),_:1})])),_:1}),p("div",U,[p("h4",null,f(X.name),1),p("p",null,f(X.orgName),1)]),m(i(I),{strong:"",secondary:"",onClick:ee},{default:r((()=>[m(i(j),{size:"13",color:"#666666",component:i(x),style:{"margin-right":"6px"}},null,8,["component"]),y(" 发消息 ")])),_:1})])]),p("div",A,[p("div",G,[(s(!0),c(u,null,k(i(Z),((e,a)=>(s(),c("div",{class:"info-item",key:a},[p("span",H,f(e.label),1),p("div",J,[p("span",null,f(le(e)),1),"phone"===e.key&&le(e)?(s(),n(i(j),{key:0,size:"16",color:"#666666",component:W.value?i(N):i(S),style:{"margin-left":"10px"},onClick:l[1]||(l[1]=e=>W.value=!W.value)},null,8,["component"])):h("v-if",!0)])])))),128))])])],512),[[v,!V.value]]),d(p("div",{class:"large-avatar",onClick:l[2]||(l[2]=e=>V.value=!1)},[m(i(I),{circle:"",size:"small",secondary:""},{icon:r((()=>[m(i(j),{size:24,component:i($),color:"#fff"},null,8,["component"])])),_:1}),m(i(_),{size:310,round:"",src:X.avatar},null,8,["src"])],512),[[v,V.value]])],64)):h("v-if",!0)])),_:2},[k(a.$slots,((e,l)=>({name:l,fn:r((()=>[g(a.$slots,l)]))})))]),1032,["show","trigger"]))}});export{K as default};
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<{}, {
5
5
  all: string;
6
6
  unread: string;
7
7
  };
8
+ unreadSessionKeys: string[];
8
9
  flexWidth: import("vue").Ref<number>;
9
10
  listBoxRef: import("vue").Ref<HTMLElement | undefined>;
10
11
  loading: import("vue").Ref<boolean>;
@@ -16,11 +17,10 @@ declare const _default: import("vue").DefineComponent<{}, {
16
17
  state: import("../types").IState;
17
18
  emit: (event: string, ...args: any[]) => void;
18
19
  openSession: (item: AnyObject) => Promise<void>;
19
- unreadTotal: import("vue").ComputedRef<number>;
20
- setSessionList: (list: AnyObject[]) => void;
20
+ updateSessionList: (sessionItem: AnyObject) => void;
21
21
  currentWidth: import("vue").ComputedRef<number>;
22
22
  sessionList: import("vue").ComputedRef<AnyObject[]>;
23
- sessionChange: (sessionItem: AnyObject) => void;
23
+ unreadTotal: import("vue").ComputedRef<number>;
24
24
  changeWidth: ({ distance }: AnyObject) => void;
25
25
  handleFilter: (key: string) => void;
26
26
  showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,computed as i,watch as t,withDirectives as n,openBlock as a,createElementBlock as l,normalizeStyle as o,unref as r,createBlock as u,createCommentVNode as d,createElementVNode as m,Fragment as v,renderList as c,withCtx as p,createTextVNode as f,toDisplayString as k,normalizeClass as y,createVNode as _,vShow as h}from"vue";import{NSpin as S,NTag as g,NAvatar as b,NBadge as x}from"naive-ui";import{useState as M}from"../hooks/useState.js";import{useSession as L}from"../hooks/useSession.js";import"trtc-sdk-v5";import{listSort as C,formatTime as j}from"../utils/index.js";import{vFlexibleResize as N}from"../../../../shared/directive/flexibleResize.js";const T={class:"sider-list__filter box-shadow"},K=["onClick"],w={class:"avatar-right"},I={class:"name"},R={class:"msg-tip"},z={class:"msg-tip__content"},H=["innerHTML"];var U=e({__name:"SiderList",setup(e){const U="all",B="unread",E=s(300),O=s(),V=s(!1),q=s([{label:"全部",key:U},{label:"未读",key:B}]),A=s("all"),{state:D,emit:F}=M(),{openSession:G,unreadTotal:J,setSessionList:P}=L(D),Q=i((()=>Math.min(Math.max(E.value,240),360))),W=i((()=>C(D.sessionList)));function X(e){!e.id||D.sessionList.map((e=>e.id)).includes(e.id)?D.sessionList.forEach((s=>{if(s.sessionKey===e.sessionKey){let{unreadNum:i=0}=s;Object.assign(s,e),e.sessionKey!==D.currentSessionItem.sessionKey&&(s.unreadNum=++i)}})):P([...D.sessionList,e])}function Y({distance:e}){E.value=E.value+e}function Z(e,s=r(A)){var i;return s===U||(s===B?(null!=(i=e.unreadNum)?i:0)>0:void 0)}return t([()=>D.isChangeSession,()=>D.isUpdateSession],(([e,s])=>{e&&(X(D.currentSessionItem),D.isChangeSession=!1),s&&(X(D.updateSessionItem),D.isUpdateSession=!1)}),{immediate:!0}),t((()=>J.value),(e=>{const s=W.value.filter((e=>Z(e,B)));F("unread-message-update",e,s)})),(e,s)=>n((a(),l("section",{class:"sider-list",style:o({width:r(Q)+"px"})},[V.value?(a(),u(r(S),{key:0,stroke:"#5585f5"})):d("v-if",!0),d(' <n-input v-else placeholder="输入用户名模糊搜索" v-model:value="keyword" @keyup.enter="handleSearch"></n-input> '),m("div",T,[(a(!0),l(v,null,c(q.value,(e=>(a(),u(r(g),{type:A.value===e.key?"info":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return s=e.key,void(A.value=s);var s}},{default:p((()=>[f(k(e.label)+"("+k(r(J))+") ",1)])),_:2},1032,["type","onClick"])))),128))]),m("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:O},[(a(!0),l(v,null,c(r(W),(e=>n((a(),l("div",{key:e.id,onClick:()=>r(G)(e),class:y(["sider-list__box__item",{active:e.id===r(D).id},e.topping?"sider-list__box__item--top":""])},[_(r(b),{round:"",size:"large",src:e.avatar},null,8,["src"]),m("div",w,[m("div",I,[m("h4",null,k(e.name),1),m("span",null,k(e.lastMessage?r(j)(e.lastMessageSendTime).siderMsgTime:""),1)]),m("div",R,[m("div",z,[m("div",{innerHTML:e.lastMessageContent},null,8,H)]),_(r(x),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],10,K)),[[h,Z(e)]]))),128))],512)],4)),[[r(N),{mode:"VR",onMove:Y}]])}});export{U as default};
1
+ import{defineComponent as e,ref as s,computed as i,watch as t,withDirectives as a,openBlock as l,createElementBlock as n,normalizeStyle as r,unref as o,createBlock as u,createCommentVNode as d,createElementVNode as m,Fragment as v,renderList as c,withCtx as p,createTextVNode as f,toDisplayString as k,normalizeClass as _,createVNode as y,vShow as h}from"vue";import{NSpin as S,NTag as g,NAvatar as x,NBadge as b}from"naive-ui";import{useState as M}from"../hooks/useState.js";import{useSession as C}from"../hooks/useSession.js";import"trtc-sdk-v5";import{listSort as L,formatTime as N}from"../utils/index.js";import{vFlexibleResize as j}from"../../../../shared/directive/flexibleResize.js";const T={class:"sider-list__filter box-shadow"},w=["onClick"],R={class:"avatar-right"},z={class:"name"},H={class:"msg-tip"},I={class:"msg-tip__content"},K=["innerHTML"];var U=e({__name:"SiderList",setup(e){const U="all",B="unread";let V=[];const q=s(300),A=s(),D=s(!1),E=s([{label:"全部",key:U},{label:"未读",key:B}]),F=s("all"),{state:G,emit:J}=M(),{openSession:O,updateSessionList:P}=C(G),Q=i((()=>Math.min(Math.max(q.value,240),360))),W=i((()=>L(G.sessionList))),X=i((()=>G.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0)));function Y({distance:e}){q.value=q.value+e}function Z(e,s=o(F)){var i;return s===U||(s===B?V.includes(e.sessionKey)||(null!=(i=e.unreadNum)?i:0)>0:void 0)}return t([()=>G.isChangeSession,()=>G.isUpdateSession],(([e,s])=>{e&&(P(G.currentSessionItem),G.isChangeSession=!1),s&&(P(G.updateSessionItem),G.isUpdateSession=!1)}),{immediate:!0}),t((()=>X.value),(e=>{const s=W.value.filter((e=>{var s;return+(null!=(s=e.unreadNum)?s:0)>0}));J("unread-message-update",e,s)})),(e,s)=>a((l(),n("section",{class:"sider-list",style:r({width:o(Q)+"px"})},[D.value?(l(),u(o(S),{key:0,stroke:"#5585f5"})):d("v-if",!0),d(' <n-input v-else placeholder="输入用户名模糊搜索" v-model:value="keyword" @keyup.enter="handleSearch"></n-input> '),m("div",T,[(l(!0),n(v,null,c(E.value,(e=>(l(),u(o(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&&(V=(W.value.filter((e=>{var s;return(null!=(s=e.unreadNum)?s:0)>0}))||[]).map((e=>e.sessionKey))));var s}},{default:p((()=>[f(k(e.label)+"("+k(o(X))+") ",1)])),_:2},1032,["type","onClick"])))),128))]),m("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:A},[(l(!0),n(v,null,c(o(W),(e=>a((l(),n("div",{key:e.id,onClick:()=>o(O)(e),class:_(["sider-list__box__item",{active:e.id===o(G).id},e.topping?"sider-list__box__item--top":""])},[y(o(x),{round:"",size:"large",src:e.avatar},null,8,["src"]),m("div",R,[m("div",z,[m("h4",null,k(e.name),1),m("span",null,k(e.lastMessage?o(N)(e.lastMessageSendTime).siderMsgTime:""),1)]),m("div",H,[m("div",I,[m("div",{innerHTML:e.lastMessageContent},null,8,K)]),y(o(b),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],10,w)),[[h,Z(e)]]))),128))],512)],4)),[[o(j),{mode:"VR",onMove:Y}]])}});export{U as default};
@@ -20,6 +20,20 @@ declare const _default: import("vue").DefineComponent<{}, {
20
20
  timer: any;
21
21
  seconds: number;
22
22
  };
23
+ installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
24
+ handleError: import("../../../../shared/types").AnyFn;
25
+ handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
26
+ handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
27
+ handleRemoteUserExit: import("../../../../shared/types").AnyFn;
28
+ handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
29
+ }) => void;
30
+ uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
31
+ handleError: import("../../../../shared/types").AnyFn;
32
+ handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
33
+ handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
34
+ handleRemoteUserExit: import("../../../../shared/types").AnyFn;
35
+ handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
36
+ }) => void;
23
37
  videoRef: import("vue").Ref<any>;
24
38
  selfVideoRef: import("vue").Ref<any>;
25
39
  isConnect: import("vue").Ref<boolean>;
@@ -36,8 +50,6 @@ declare const _default: import("vue").DefineComponent<{}, {
36
50
  handleEnter: () => Promise<void>;
37
51
  handleFinish: () => void;
38
52
  handleExit: () => Promise<void>;
39
- installEventHandlers: () => void;
40
- uninstallEventHandlers: () => void;
41
53
  handleRemoteVideoAvailable: (event: any) => Promise<void>;
42
54
  handleRemoteAudioAvailable: (event: any) => void;
43
55
  handleRemoteUserEnter: () => void;