cnhis-design-vue 3.3.1-beta.14 → 3.3.1-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ai-chat/index.d.ts +17 -17
- package/es/components/ai-chat/src/Index.vue.d.ts +17 -17
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/api/index.d.ts +1 -2
- package/es/components/ai-chat/src/api/index.js +1 -1
- package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +0 -1
- package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +9 -11
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatMainDefault.js +1 -0
- package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +0 -2
- package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
- package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
- package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/audio-sdk/index.d.ts +304 -2
- package/es/components/audio-sdk/index.js +1 -1
- package/es/components/audio-sdk/src/Index.vue.d.ts +304 -0
- package/es/components/audio-sdk/src/Index.vue.js +1 -0
- package/es/components/audio-sdk/src/Index.vue2.js +1 -0
- package/es/components/audio-sdk/src/audioSDK.d.ts +5 -7
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/form.vue.d.ts +51 -0
- package/es/components/audio-sdk/src/components/form.vue.js +1 -0
- package/es/components/audio-sdk/src/components/form.vue2.js +1 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +91 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.js +1 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue2.js +1 -0
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +43 -4
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/audio-sdk/src/utils/index.d.ts +4 -0
- package/es/components/audio-sdk/src/utils/index.js +1 -0
- package/es/components/audio-sdk/src/utils/recordingModal.d.ts +7 -4
- package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
- package/es/components/audio-sdk/style/index.css +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +7 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/field-editor/index.d.ts +7 -1
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +7 -1
- package/es/components/form-config/index.d.ts +38 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +38 -3
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +7 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +17 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +8 -1
- package/es/components/form-render/index.d.ts +7 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +7 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -1
- package/es/components/form-render/src/components/renderer/date.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/input.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/input.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +14 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +14 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +12 -1
- package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/src/types/index.d.ts +2 -0
- package/es/components/form-render/src/utils/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-chat/index.d.ts +56 -0
- package/es/components/iho-chat/src/Index.vue.d.ts +56 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +7 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +7 -0
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +27 -0
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +7 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +7 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +3 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +7 -0
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +2 -0
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +3 -0
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -3
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
- package/es/components/iho-table/src/hooks/useTablePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.d.ts +79 -3
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +7 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/types/pluginType.d.ts +2 -2
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +24 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +24 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +7 -1
- package/es/components/scale-view/index.d.ts +3 -2
- package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -2
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.d.ts +3 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -2189
- package/es/components/shortcut-setter/index.d.ts +8 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +8 -1
- package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +1 -0
- package/es/shared/components/ArrowIcon/index.d.ts +2 -0
- package/es/shared/components/ArrowIcon/index.js +1 -0
- package/es/shared/components/DateIcon/DateIcon.vue.js +1 -0
- package/es/shared/components/DateIcon/index.d.ts +2 -0
- package/es/shared/components/DateIcon/index.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
- package/es/components/ai-chat/src/hooks/useProgram.d.ts +0 -6
- package/es/components/ai-chat/src/hooks/useProgram.js +0 -1
- /package/es/components/ai-chat/src/components/{ChatMainInner.d.ts → ChatMainDefault.d.ts} +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as n,ref as t,computed as o,watch as i,withDirectives as a,openBlock as r,createElementBlock as s,normalizeStyle as l,unref as c,createVNode as u,withCtx as d,Fragment as g,toDisplayString as m,createCommentVNode as f,renderList as w,createBlock as p,createTextVNode as h,mergeProps as y,renderSlot as v,vShow as k}from"vue";import{NButton as C,NIcon as M,NTooltip as _,NPopover as E,NUpload as L,NUploadTrigger as I}from"naive-ui";import b from"./ChatAdd.vue.js";import{useData as T}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as x,AV_STATUS as j}from"../constants/index.js";import{uploadFileApi as z}from"../api/index.js";import{simplifyMessage as B,base64ToFile as R}from"../utils/index.js";import{xor as q,uniq as O,trim as D,cloneDeep as F}from"lodash-es";import"trtc-sdk-v5";import{emojis as A}from"../utils/emoji.js";import{CloseOutline as $,CloseCircleOutline as H,CallOutline as J,VideocamOutline as V}from"@vicons/ionicons5";import{uuidGenerator as K}from"../../../../shared/utils/index.js";import{useStorage as U}from"@vueuse/core";var G,N;const X={key:0,class:"multi-select-box"},S={class:"select-item"},W=e("i",{class:"chat--iconfont chat--icon-forward"},null,-1),P=e("span",null,"逐条转发",-1),Q={class:"select-item"},Y=e("i",{class:"chat--iconfont chat--icon-forward-more"},null,-1),Z=e("span",null,"合并转发",-1),ee={key:0,class:"reference-content-box"},ne={class:"reference-content"},te=["innerHTML"],oe={class:"tool-box"},ie=e("i",{class:"chat--iconfont chat--icon-face"},null,-1),ae=e("span",null,(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.51"))||"最近使用",-1),re={class:"list-box",style:{"margin-bottom":"8px"}},se=["src"],le=e("span",null,(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.52"))||"默认表情",-1),ce={class:"list-box"},ue=["src"],de=e("i",{class:"chat--iconfont chat--icon-good"},null,-1),ge=e("i",{class:"chat--iconfont chat--icon-image"},null,-1),me=e("i",{class:"chat--iconfont chat--icon-folder"},null,-1),fe=["contenteditable"],we={class:"btn-box"},pe=e("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var he=n({__name:"ChatFooter",setup(n){const G=t(),{state:N,sendMessage:he,isGroupChat:ye,isEnded:ve,relayMessage:ke}=T(),Ce=t(!1),Me=t(""),_e=U("commonEmoticons",[]),Ee=o((()=>({options:N.currentGroupUser,defaultValue:[N.userInfo]}))),Le=o((()=>!Me.value.replace(/( |\s|<br>)+/g,""))),Ie=o((()=>!N.msgList.some((e=>e.checked))));function be(e,n=[]){const t=K(),o=[],i=n.length>0;N.showVideo||N.showMultipleVideo||(i?(o.push(...q(n,[N.userInfo.id])),Object.assign(N.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),N.showMultipleVideo=!0):he({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function Te(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(),Re()))}function xe(){var e;Me.value=(null==(e=G.value)?void 0:e.innerHTML)||""}function je(e){var n;_e.value.unshift(e),_e.value=O(_e.value).slice(0,26),null==(n=G.value)||n.focus(),document.execCommand("insertHTML",!1,`<img data-msg=${e} data-type=${x.EMOJI} class="emoji--min" src=${A.findEmoji(e)} />`)}async function ze(e){const n=new FormData;return n.append("sender",N.userInfo.id),n.append("file",e),await z(n)}async function Be(e,n){const{file:t,name:o}=e.file,i=await ze(t);if(!i)return console.log("上传失败");qe({chatMessageType:n,msg:n===x.FILE?o:i,url:i})}async function Re(){const{innerHTML:e="",innerText:n="",outerText:t=""}=G.value||{};if(Le.value)return console.log("请输入内容");let o=x.TEXT,i="";if(e){const t=e.match(/<img[^>]*>/gi),a=(t||[]).length;if(n&&0===a)i=n;else if(n||1!==a){if(o=x.BLEND,i=e,null==t?void 0:t.length)for(let e=0;e<a;e++)if(t[e].includes(`data-type="${x.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(i=i.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=await R(n[1]);if(e){const t=await ze(e);i=i.replace(n[1],t||"")}}}}else if(e.includes(x.EMOJI)){o=x.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(i=n[1])}else{o=x.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=await R(n[1]);if(e){const n=await ze(e);n&&(i=n)}}}}else i=D(n);i&&qe({msg:i,chatMessageType:o,origin:"btn"})}async function qe(e){const{chatMessageType:n=x.TEXT,msg:t,url:o,origin:i=""}=e,a={msg:t,chatMessageType:n};n===x.FILE&&(a.fileUrl=o),"btn"===i&&Oe(),N.currentReferenceMsg&&([x.TEXT,x.EMOJI,x.BLEND].includes(n)&&(a.referenceContent=F(N.currentReferenceMsg)),N.currentReferenceMsg=null),he({content:a})}function Oe(){G.value&&(G.value.innerHTML=""),Me.value=""}function De({checkedIds:e,remark:n},t="逐条转发"){const o=[],i=[];N.msgList.forEach((e=>{e.checked&&(o.unshift(e.content),i.unshift(e))})),ke({checkedIds:e,remark:n,contents:"逐条转发"===t?o:[{forwardMessageList:i,chatMessageType:x.FORWARD}]}),N.msgList.forEach((e=>{e.checked=!1})),N.isForward=!1}function Fe(){N.msgList.forEach((e=>{e.checked=!1})),N.isForward=!1}return i((()=>[N.currentReferenceMsg,N.currentReEditMsg]),(([e,n])=>{var t;if((e||n)&&(null==(t=G.value)||t.focus()),n){const{chatMessageType:e,msg:t}=n.content||{},o=e===x.TEXT?t:`<img data-msg=${t} data-type=${x.EMOJI} class="emoji--min" src=${A.findEmoji(t)} />`;document.execCommand("insertHTML",!1,o),N.currentReEditMsg=null}})),i((()=>N.id),(e=>{e&&(N.isForward=!1,Oe())})),(n,t)=>{var o,i;return a((r(),s("section",{class:"chat-footer",style:l({cursor:c(N).id?"default":"not-allowed"})},[c(N).isForward?(r(),s("div",X,[e("div",S,[u(b,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:t[0]||(t[0]=e=>De(e))},{trigger:d((()=>[u(c(C),{quaternary:"",circle:"",size:"large",disabled:c(Ie)},{icon:d((()=>[W])),_:1},8,["disabled"])])),_:1}),P]),e("div",Q,[u(b,{title:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:t[1]||(t[1]=e=>De(e,"合并转发"))},{trigger:d((()=>[u(c(C),{quaternary:"",circle:"",size:"large",disabled:c(Ie)},{icon:d((()=>[Y])),_:1},8,["disabled"])])),_:1}),Z]),u(c(C),{quaternary:"",circle:""},{icon:d((()=>[u(c(M),{component:c($),onClick:Fe},null,8,["component"])])),_:1})])):(r(),s(g,{key:1},[c(N).currentReferenceMsg?(r(),s("div",ee,[e("div",ne,[e("span",null,m(c(N).currentReferenceMsg.senderName)+":",1),e("pre",{innerHTML:c(B)(c(N).currentReferenceMsg.content)},null,8,te)]),u(c(M),{component:c(H),onClick:t[2]||(t[2]=()=>c(N).currentReferenceMsg=null)},null,8,["component"])])):f("v-if",!0),e("div",oe,[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(E),{"content-class":"emoji-content",class:"emoji-wrapper",show:Ce.value,"onUpdate:show":t[3]||(t[3]=e=>Ce.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny"},{icon:d((()=>[ie])),_:1})])),default:d((()=>[c(_e).length>0?(r(),s(g,{key:0},[ae,e("div",re,[(r(!0),s(g,null,w(c(_e),(n=>(r(),p(c(_),{key:n,"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:()=>je(n)},{icon:d((()=>[e("img",{src:c(A).findEmoji(n)},null,8,se)])),_:2},1032,["onClick"])])),default:d((()=>[h(" "+m(n),1)])),_:2},1024)))),128))])],64)):f("v-if",!0),le,e("div",ce,[(r(!0),s(g,null,w(c(A).default,(([n,t])=>(r(),p(c(_),{key:n,"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:()=>je(n)},{icon:d((()=>[e("img",{src:t},null,8,ue)])),_:2},1032,["onClick"])])),default:d((()=>[h(" "+m(n),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.53"))||"表情")]})),_:1}),u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:t[4]||(t[4]=()=>qe({chatMessageType:c(x).EMOJI,msg:0}))},{icon:d((()=>[de])),_:1})])),default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.54"))||"点赞")]})),_:1}),u(c(L),{abstract:"",multiple:"",accept:"image/*",onChange:t[5]||(t[5]=e=>Be(e,c(x).IMAGE))},{default:d((()=>[u(c(I),{abstract:""},{default:d((({handleClick:e})=>[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:d((()=>[ge])),_:2},1032,["onClick"])])),default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.55"))||"上传图片")]})),_:2},1024)])),_:1})])),_:1}),u(c(L),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[6]||(t[6]=e=>Be(e,c(x).FILE))},{default:d((()=>[u(c(I),{abstract:""},{default:d((({handleClick:e})=>[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:d((()=>[me])),_:2},1032,["onClick"])])),default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.56"))||"上传文件")]})),_:2},1024)])),_:1})])),_:1}),c(N).userInfo.sdkAppID?(r(),s(g,{key:0},[c(ye)?(r(),s(g,{key:0},[u(b,y(c(Ee),{onComfirm:t[7]||(t[7]=e=>be(c(x).AUDIO,e.checkedIds))}),{trigger:d((()=>[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny"},{icon:d((()=>[u(c(M),{size:"18",component:c(J)},null,8,["component"])])),_:1})])),default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.57"))||"语音通话")]})),_:1})])),_:1},16),u(b,y(c(Ee),{onComfirm:t[8]||(t[8]=e=>be(c(x).VIDEO,e.checkedIds))}),{trigger:d((()=>[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny"},{icon:d((()=>[u(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.58"))||"视频会议")]})),_:1})])),_:1},16)],64)):(r(),s(g,{key:1},[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:t[9]||(t[9]=()=>be(c(x).AUDIO))},{icon:d((()=>[u(c(M),{size:"18",component:c(J)},null,8,["component"])])),_:1})])),default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.57"))||"语音通话")]})),_:1}),u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:t[10]||(t[10]=()=>be(c(x).VIDEO))},{icon:d((()=>[u(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.59"))||"视频通话")]})),_:1})],64))],64)):f("v-if",!0),v(n.$slots,"footer")]),a(e("div",{ref_key:"inputRef",ref:G,class:"input-box",contenteditable:!c(ve),onKeydown:Te,onInput:xe},null,40,fe),[[k,c(N).id]]),e("div",we,[pe,u(c(C),{type:"primary",round:"",disabled:c(Le),onClick:Re},{default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.60"))||"发送")]})),_:1},8,["disabled"])])],64))],4)),[[k,c(N).id]])}}});export{he as default};
|
1
|
+
import{createElementVNode as e,defineComponent as n,ref as t,computed as o,watch as i,withDirectives as a,openBlock as r,createElementBlock as l,normalizeStyle as s,unref as c,createVNode as u,withCtx as d,Fragment as g,toDisplayString as m,createCommentVNode as f,renderList as w,createBlock as p,createTextVNode as y,mergeProps as h,renderSlot as v,vShow as k}from"vue";import{NButton as C,NIcon as M,NTooltip as _,NPopover as E,NUpload as L,NUploadTrigger as I}from"naive-ui";import b from"./ChatAdd.vue.js";import{useData as T}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as x,AV_STATUS as j}from"../constants/index.js";import{uploadFileApi as z}from"../api/index.js";import{simplifyMessage as B,base64ToFile as O}from"../utils/index.js";import{xor as R,uniq as q,isObject as D,trim as F,cloneDeep as A}from"lodash-es";import"trtc-sdk-v5";import{emojis as $}from"../utils/emoji.js";import{CloseOutline as J,CloseCircleOutline as H,CallOutline as V,VideocamOutline as K}from"@vicons/ionicons5";import{uuidGenerator as U}from"../../../../shared/utils/index.js";import{useStorage as N}from"@vueuse/core";var G,X;const S={key:0,class:"multi-select-box"},W={class:"select-item"},P=e("i",{class:"chat--iconfont chat--icon-forward"},null,-1),Q=e("span",null,"逐条转发",-1),Y={class:"select-item"},Z=e("i",{class:"chat--iconfont chat--icon-forward-more"},null,-1),ee=e("span",null,"合并转发",-1),ne={key:0,class:"reference-content-box"},te={class:"reference-content"},oe=["innerHTML"],ie={class:"tool-box"},ae=e("i",{class:"chat--iconfont chat--icon-face"},null,-1),re=e("span",null,(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.51"))||"最近使用",-1),le={class:"list-box",style:{"margin-bottom":"8px"}},se=["src"],ce=e("span",null,(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.52"))||"默认表情",-1),ue={class:"list-box"},de=["src"],ge=e("i",{class:"chat--iconfont chat--icon-good"},null,-1),me=e("i",{class:"chat--iconfont chat--icon-image"},null,-1),fe=e("i",{class:"chat--iconfont chat--icon-folder"},null,-1),we=["contenteditable"],pe={class:"btn-box"},ye=e("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var he=n({__name:"ChatFooter",setup(n){const G=t(),{state:X,sendMessage:he,isGroupChat:ve,isEnded:ke,relayMessage:Ce}=T(),Me=t(!1),_e=t(""),Ee=N("commonEmoticons",[]),Le=o((()=>({options:X.currentGroupUser,defaultValue:[X.userInfo]}))),Ie=o((()=>!_e.value.replace(/( |\s|<br>)+/g,""))),be=o((()=>!X.msgList.some((e=>e.checked))));function Te(e,n=[]){const t=U(),o=[],i=n.length>0;X.showVideo||X.showMultipleVideo||(i?(o.push(...R(n,[X.userInfo.id])),Object.assign(X.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),X.showMultipleVideo=!0):he({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function xe(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(),Re()))}function je(){var e;_e.value=(null==(e=G.value)?void 0:e.innerHTML)||""}function ze(e){var n;Ee.value.unshift(e),Ee.value=q(Ee.value).slice(0,26),null==(n=G.value)||n.focus(),document.execCommand("insertHTML",!1,`<img data-msg=${e} data-type=${x.EMOJI} class="emoji--min" src=${$.findEmoji(e)} />`)}async function Be(e){const n=new FormData;return n.append("sender",X.userInfo.id),n.append("file",e),await z(n)}async function Oe(e,n){const{file:t,name:o}=e.file,i=await Be(t);if(!i)return console.log("上传失败");qe({chatMessageType:n,msg:D(i)?JSON.stringify(i):n===x.FILE?o:i,url:D(i)?(null==i?void 0:i.fileUrl)||"":i})}async function Re(){const{innerHTML:e="",innerText:n="",outerText:t=""}=G.value||{};if(Ie.value)return console.log("请输入内容");let o=x.TEXT,i="";if(e){const t=e.match(/<img[^>]*>/gi),a=(t||[]).length;if(n&&0===a)i=n;else if(n||1!==a){if(o=x.BLEND,i=e,null==t?void 0:t.length)for(let e=0;e<a;e++)if(t[e].includes(`data-type="${x.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(i=i.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=await O(n[1]);if(e){const t=await Be(e);i=i.replace(n[1],t||"")}}}}else if(e.includes(x.EMOJI)){o=x.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(i=n[1])}else{o=x.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=await O(n[1]);if(e){const n=await Be(e);n&&(i=n)}}}}else i=F(n);i&&qe({msg:i,chatMessageType:o,origin:"btn"})}async function qe(e){const{chatMessageType:n=x.TEXT,msg:t,url:o="",origin:i=""}=e,a={msg:t,chatMessageType:n};n===x.FILE&&(a.fileUrl=o),"btn"===i&&De(),X.currentReferenceMsg&&([x.TEXT,x.EMOJI,x.BLEND].includes(n)&&(a.referenceContent=A(X.currentReferenceMsg)),X.currentReferenceMsg=null),he({content:a})}function De(){G.value&&(G.value.innerHTML=""),_e.value=""}function Fe({checkedIds:e,remark:n},t="逐条转发"){const o=[],i=[];X.msgList.forEach((e=>{e.checked&&(o.unshift(e.content),i.unshift(e))})),Ce({checkedIds:e,remark:n,contents:"逐条转发"===t?o:[{forwardMessageList:i,chatMessageType:x.FORWARD}]}),X.msgList.forEach((e=>{e.checked=!1})),X.isForward=!1}function Ae(){X.msgList.forEach((e=>{e.checked=!1})),X.isForward=!1}return i((()=>[X.currentReferenceMsg,X.currentReEditMsg]),(([e,n])=>{var t;if((e||n)&&(null==(t=G.value)||t.focus()),n){const{chatMessageType:e,msg:t}=n.content||{},o=e===x.TEXT?t:`<img data-msg=${t} data-type=${x.EMOJI} class="emoji--min" src=${$.findEmoji(t)} />`;document.execCommand("insertHTML",!1,o),X.currentReEditMsg=null}})),i((()=>X.id),(e=>{e&&(X.isForward=!1,De())})),(n,t)=>{var o,i;return a((r(),l("section",{class:"chat-footer",style:s({cursor:c(X).id?"default":"not-allowed"})},[c(X).isForward?(r(),l("div",S,[e("div",W,[u(b,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:t[0]||(t[0]=e=>Fe(e))},{trigger:d((()=>[u(c(C),{quaternary:"",circle:"",size:"large",disabled:c(be)},{icon:d((()=>[P])),_:1},8,["disabled"])])),_:1}),Q]),e("div",Y,[u(b,{title:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:t[1]||(t[1]=e=>Fe(e,"合并转发"))},{trigger:d((()=>[u(c(C),{quaternary:"",circle:"",size:"large",disabled:c(be)},{icon:d((()=>[Z])),_:1},8,["disabled"])])),_:1}),ee]),u(c(C),{quaternary:"",circle:""},{icon:d((()=>[u(c(M),{component:c(J),onClick:Ae},null,8,["component"])])),_:1})])):(r(),l(g,{key:1},[c(X).currentReferenceMsg?(r(),l("div",ne,[e("div",te,[e("span",null,m(c(X).currentReferenceMsg.senderName)+":",1),e("pre",{innerHTML:c(B)(c(X).currentReferenceMsg.content)},null,8,oe)]),u(c(M),{component:c(H),onClick:t[2]||(t[2]=()=>c(X).currentReferenceMsg=null)},null,8,["component"])])):f("v-if",!0),e("div",ie,[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(E),{"content-class":"emoji-content",class:"emoji-wrapper",show:Me.value,"onUpdate:show":t[3]||(t[3]=e=>Me.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny"},{icon:d((()=>[ae])),_:1})])),default:d((()=>[c(Ee).length>0?(r(),l(g,{key:0},[re,e("div",le,[(r(!0),l(g,null,w(c(Ee),(n=>(r(),p(c(_),{key:n,"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:()=>ze(n)},{icon:d((()=>[e("img",{src:c($).findEmoji(n)},null,8,se)])),_:2},1032,["onClick"])])),default:d((()=>[y(" "+m(n),1)])),_:2},1024)))),128))])],64)):f("v-if",!0),ce,e("div",ue,[(r(!0),l(g,null,w(c($).default,(([n,t])=>(r(),p(c(_),{key:n,"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:()=>ze(n)},{icon:d((()=>[e("img",{src:t},null,8,de)])),_:2},1032,["onClick"])])),default:d((()=>[y(" "+m(n),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.53"))||"表情")]})),_:1}),u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:t[4]||(t[4]=()=>qe({chatMessageType:c(x).EMOJI,msg:0}))},{icon:d((()=>[ge])),_:1})])),default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.54"))||"点赞")]})),_:1}),u(c(L),{abstract:"",multiple:"",accept:"image/*",onChange:t[5]||(t[5]=e=>Oe(e,c(x).IMAGE))},{default:d((()=>[u(c(I),{abstract:""},{default:d((({handleClick:e})=>[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:d((()=>[me])),_:2},1032,["onClick"])])),default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.55"))||"上传图片")]})),_:2},1024)])),_:1})])),_:1}),u(c(L),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[6]||(t[6]=e=>Oe(e,c(x).FILE))},{default:d((()=>[u(c(I),{abstract:""},{default:d((({handleClick:e})=>[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:d((()=>[fe])),_:2},1032,["onClick"])])),default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.56"))||"上传文件")]})),_:2},1024)])),_:1})])),_:1}),c(X).userInfo.sdkAppID?(r(),l(g,{key:0},[c(ve)?(r(),l(g,{key:0},[u(b,h(c(Le),{onComfirm:t[7]||(t[7]=e=>Te(c(x).AUDIO,e.checkedIds))}),{trigger:d((()=>[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny"},{icon:d((()=>[u(c(M),{size:"18",component:c(V)},null,8,["component"])])),_:1})])),default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.57"))||"语音通话")]})),_:1})])),_:1},16),u(b,h(c(Le),{onComfirm:t[8]||(t[8]=e=>Te(c(x).VIDEO,e.checkedIds))}),{trigger:d((()=>[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny"},{icon:d((()=>[u(c(M),{size:"20",component:c(K)},null,8,["component"])])),_:1})])),default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.58"))||"视频会议")]})),_:1})])),_:1},16)],64)):(r(),l(g,{key:1},[u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:t[9]||(t[9]=()=>Te(c(x).AUDIO))},{icon:d((()=>[u(c(M),{size:"18",component:c(V)},null,8,["component"])])),_:1})])),default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.57"))||"语音通话")]})),_:1}),u(c(_),{"show-arrow":!1},{trigger:d((()=>[u(c(C),{quaternary:"",size:"tiny",onClick:t[10]||(t[10]=()=>Te(c(x).VIDEO))},{icon:d((()=>[u(c(M),{size:"20",component:c(K)},null,8,["component"])])),_:1})])),default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.59"))||"视频通话")]})),_:1})],64))],64)):f("v-if",!0),v(n.$slots,"footer")]),a(e("div",{ref_key:"inputRef",ref:G,class:"input-box",contenteditable:!c(ke),onKeydown:xe,onInput:je},null,40,we),[[k,c(X).id]]),e("div",pe,[ye,u(c(C),{type:"primary",round:"",disabled:c(Ie),onClick:Re},{default:d((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.60"))||"发送")]})),_:1},8,["disabled"])])],64))],4)),[[k,c(X).id]])}}});export{he as default};
|
@@ -220,6 +220,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
220
220
|
remark: import("vue").Ref<string>;
|
221
221
|
currentTab: import("vue").Ref<AnyObject[]>;
|
222
222
|
breadcrumbList: import("vue").Ref<AnyObject[]>;
|
223
|
+
breadcrumbRef: import("vue").Ref<any>;
|
223
224
|
userList: import("vue").Ref<AnyObject[]>;
|
224
225
|
handleInput: () => void;
|
225
226
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -228,18 +229,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
228
229
|
name: any;
|
229
230
|
avatar: any;
|
230
231
|
chatType: any;
|
232
|
+
roleInfo: any;
|
231
233
|
}[]>;
|
232
234
|
friends: import("vue").ComputedRef<{
|
233
235
|
id: any;
|
234
236
|
name: any;
|
235
237
|
avatar: any;
|
236
238
|
chatType: any;
|
239
|
+
roleInfo: any;
|
237
240
|
}[]>;
|
238
241
|
groups: import("vue").ComputedRef<{
|
239
242
|
id: any;
|
240
243
|
name: any;
|
241
244
|
avatar: any;
|
242
245
|
chatType: any;
|
246
|
+
roleInfo: any;
|
243
247
|
}[]>;
|
244
248
|
checkedIds: import("vue").ComputedRef<any[]>;
|
245
249
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -277,6 +281,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
277
281
|
ChevronBackOutline: 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<{}>>, {}>;
|
278
282
|
ChevronForwardOutline: 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<{}>>, {}>;
|
279
283
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
284
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
285
|
+
getRoleName: typeof import("../utils").getRoleName;
|
280
286
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
281
287
|
title: {
|
282
288
|
type: StringConstructor;
|
@@ -310,6 +316,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
310
316
|
mode: string;
|
311
317
|
disabledIds: string[];
|
312
318
|
}>;
|
319
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
320
|
+
getRoleName: typeof import("../utils").getRoleName;
|
313
321
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
314
322
|
ChatFile: import("vue").DefineComponent<{
|
315
323
|
type: {
|
@@ -382,6 +390,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
382
390
|
}[];
|
383
391
|
resetAndSearch: () => void;
|
384
392
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
393
|
+
getFileDetails: (msg: string, type: string) => any;
|
385
394
|
getDetail: (item: AnyObject) => string;
|
386
395
|
getFileType: (item: AnyObject) => any;
|
387
396
|
NModal: any;
|
@@ -491,6 +500,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
491
500
|
remark: import("vue").Ref<string>;
|
492
501
|
currentTab: import("vue").Ref<AnyObject[]>;
|
493
502
|
breadcrumbList: import("vue").Ref<AnyObject[]>;
|
503
|
+
breadcrumbRef: import("vue").Ref<any>;
|
494
504
|
userList: import("vue").Ref<AnyObject[]>;
|
495
505
|
handleInput: () => void;
|
496
506
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -499,18 +509,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
499
509
|
name: any;
|
500
510
|
avatar: any;
|
501
511
|
chatType: any;
|
512
|
+
roleInfo: any;
|
502
513
|
}[]>;
|
503
514
|
friends: import("vue").ComputedRef<{
|
504
515
|
id: any;
|
505
516
|
name: any;
|
506
517
|
avatar: any;
|
507
518
|
chatType: any;
|
519
|
+
roleInfo: any;
|
508
520
|
}[]>;
|
509
521
|
groups: import("vue").ComputedRef<{
|
510
522
|
id: any;
|
511
523
|
name: any;
|
512
524
|
avatar: any;
|
513
525
|
chatType: any;
|
526
|
+
roleInfo: any;
|
514
527
|
}[]>;
|
515
528
|
checkedIds: import("vue").ComputedRef<any[]>;
|
516
529
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -548,6 +561,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
548
561
|
ChevronBackOutline: 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<{}>>, {}>;
|
549
562
|
ChevronForwardOutline: 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<{}>>, {}>;
|
550
563
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
564
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
565
|
+
getRoleName: typeof import("../utils").getRoleName;
|
551
566
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
552
567
|
title: {
|
553
568
|
type: StringConstructor;
|
@@ -636,6 +651,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
636
651
|
};
|
637
652
|
isForward: boolean;
|
638
653
|
};
|
654
|
+
cssVars: import("vue").ComputedRef<AnyObject>;
|
639
655
|
recordRef: import("vue").Ref<any>;
|
640
656
|
recordList: import("vue").Ref<AnyObject[]>;
|
641
657
|
keyword: import("vue").Ref<any>;
|
@@ -648,6 +664,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
648
664
|
hasMore: boolean;
|
649
665
|
lastSendTime: string;
|
650
666
|
};
|
667
|
+
getFileDetails: (msg: string, type: string) => any;
|
668
|
+
getDetail: (item: AnyObject) => string;
|
669
|
+
getFileType: (msg: string) => string;
|
651
670
|
handleSearch: () => Promise<void>;
|
652
671
|
resetAndSearch: () => void;
|
653
672
|
startDateDisabled: (ts: number) => boolean;
|
@@ -794,6 +813,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
794
813
|
holidays: Date[];
|
795
814
|
}>>;
|
796
815
|
formatTime: typeof import("../utils").formatTime;
|
816
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
817
|
+
getRoleName: typeof import("../utils").getRoleName;
|
797
818
|
MESSAGE_TYPE: typeof import("../constants").MESSAGE_TYPE;
|
798
819
|
emojis: {
|
799
820
|
default: string[][];
|
@@ -903,6 +924,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
903
924
|
remark: import("vue").Ref<string>;
|
904
925
|
currentTab: import("vue").Ref<AnyObject[]>;
|
905
926
|
breadcrumbList: import("vue").Ref<AnyObject[]>;
|
927
|
+
breadcrumbRef: import("vue").Ref<any>;
|
906
928
|
userList: import("vue").Ref<AnyObject[]>;
|
907
929
|
handleInput: () => void;
|
908
930
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -911,18 +933,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
911
933
|
name: any;
|
912
934
|
avatar: any;
|
913
935
|
chatType: any;
|
936
|
+
roleInfo: any;
|
914
937
|
}[]>;
|
915
938
|
friends: import("vue").ComputedRef<{
|
916
939
|
id: any;
|
917
940
|
name: any;
|
918
941
|
avatar: any;
|
919
942
|
chatType: any;
|
943
|
+
roleInfo: any;
|
920
944
|
}[]>;
|
921
945
|
groups: import("vue").ComputedRef<{
|
922
946
|
id: any;
|
923
947
|
name: any;
|
924
948
|
avatar: any;
|
925
949
|
chatType: any;
|
950
|
+
roleInfo: any;
|
926
951
|
}[]>;
|
927
952
|
checkedIds: import("vue").ComputedRef<any[]>;
|
928
953
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -960,6 +985,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
960
985
|
ChevronBackOutline: 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<{}>>, {}>;
|
961
986
|
ChevronForwardOutline: 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<{}>>, {}>;
|
962
987
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
988
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
989
|
+
getRoleName: typeof import("../utils").getRoleName;
|
963
990
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
964
991
|
title: {
|
965
992
|
type: StringConstructor;
|
@@ -71,6 +71,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
71
71
|
renderToolbar: ({ nodes }: ImageRenderToolbarProps) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
72
72
|
[key: string]: any;
|
73
73
|
}>[];
|
74
|
+
formatImage: (obj: AnyObject | string, type: string) => any;
|
74
75
|
getHistoryRecord: () => Promise<void>;
|
75
76
|
handleSelectLabel: (event: MouseEvent, msgId: string) => void;
|
76
77
|
handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
|
@@ -482,6 +483,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
482
483
|
remark: import("vue").Ref<string>;
|
483
484
|
currentTab: import("vue").Ref<AnyObject[]>;
|
484
485
|
breadcrumbList: import("vue").Ref<AnyObject[]>;
|
486
|
+
breadcrumbRef: import("vue").Ref<any>;
|
485
487
|
userList: import("vue").Ref<AnyObject[]>;
|
486
488
|
handleInput: () => void;
|
487
489
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -490,18 +492,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
490
492
|
name: any;
|
491
493
|
avatar: any;
|
492
494
|
chatType: any;
|
495
|
+
roleInfo: any;
|
493
496
|
}[]>;
|
494
497
|
friends: import("vue").ComputedRef<{
|
495
498
|
id: any;
|
496
499
|
name: any;
|
497
500
|
avatar: any;
|
498
501
|
chatType: any;
|
502
|
+
roleInfo: any;
|
499
503
|
}[]>;
|
500
504
|
groups: import("vue").ComputedRef<{
|
501
505
|
id: any;
|
502
506
|
name: any;
|
503
507
|
avatar: any;
|
504
508
|
chatType: any;
|
509
|
+
roleInfo: any;
|
505
510
|
}[]>;
|
506
511
|
checkedIds: import("vue").ComputedRef<any[]>;
|
507
512
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -539,6 +544,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
539
544
|
ChevronBackOutline: 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<{}>>, {}>;
|
540
545
|
ChevronForwardOutline: 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<{}>>, {}>;
|
541
546
|
last: <T_1>(array: import("lodash").List<T_1> | null | undefined) => T_1 | undefined;
|
547
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
548
|
+
getRoleName: typeof import("../utils").getRoleName;
|
542
549
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
543
550
|
title: {
|
544
551
|
type: StringConstructor;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as n,reactive as t,computed as s,watch as o,openBlock as i,createElementBlock as a,normalizeClass as l,unref as r,normalizeStyle as c,createVNode as u,withCtx as d,Fragment as m,renderList as p,toDisplayString as g,createCommentVNode as y,createBlock as v,createElementVNode as f,createTextVNode as h,withModifiers as k,nextTick as w}from"vue";import{NImageGroup as T,NButton as M,NCheckbox as C,NAvatar as _,NImage as x,NIcon as L,NSpace as I,NButtonGroup as b,NTooltip as j}from"naive-ui";import{format as E}from"date-fns";import{getHistoryRecordApi as S,readMessageApi as z}from"../api/index.js";import{useData as A}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as D}from"../constants/index.js";import{isAudioOrVideoMessage as R,simplifyMessage as H,getForwardTitle as N,getAVTime as O,downloadFile as B}from"../utils/index.js";import{first as F,last as U,isArray as q,toString as W}from"lodash-es";import"trtc-sdk-v5";import P from"./MessageTemplate.vue.js";import J from"./MessageEvent.vue.js";import X from"./MessageMergeForward.vue.js";import G from"./SelectLabel.vue.js";import{emojis as K}from"../utils/emoji.js";import Y from"./ContextMenu.js";import V from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as $,VideocamOutline as Q,DocumentSharp as Z,HappyOutline as ee,ChatbubbleEllipsesOutline as ne,EllipsisHorizontal as te,ArrowDownSharp as se}from"@vicons/ionicons5";import{useScrollLoading as oe}from"../../../../shared/hooks/useScrollLoading.js";const ie={key:0,class:"tip-text"},ae={key:1,class:"tip-text"},le=["onClick"],re={class:"message-box"},ce={key:0,class:"content-box"},ue={class:"name-box"},de=["data-time"],me=["onContextmenu"],pe={key:0,class:"reference-content"},ge=["innerHTML"],ye=["src"],ve=["innerHTML"],fe=["innerHTML"],he=["onClick"],ke={class:"merge-msg-contents"},we={style:{"margin-left":"8px"}},Te={class:"size"},Me=["src"],Ce={key:0};var _e=e({__name:"ChatMain",setup(e){const _e=n(),{state:xe,setMsgList:Le,relayMessage:Ie,setCurrentSessionItem:be,setMessageLabel:je,setUserDetail:Ee,isGroupChat:Se}=A(),ze=n(),Ae=n(!1),De=n({left:0,top:0}),Re=n(),He=n(),Ne=n(!1),Oe=t({x:0,y:0}),Be=n(!1),Fe={page:0,hasMore:!0,lastSendTime:E(new Date,"yyyy-MM-dd HH:mm:ss")},Ue=s((()=>({"--c-tip-top":Se.value?"1px":"-20px","--c-tip-gap":Se.value?"10px":"0px"})));function qe({nodes:e}){var n,t;const{_ctx:s}=null==(n=e.download)?void 0:n.children,o=s?null==(t=null==s?void 0:s.proxy)?void 0:t.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,u(j,null,{trigger:()=>u(L,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:se,onClick:()=>o&&B(o,"img")},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载"}}),e.close]}async function We(){try{if(!Fe.hasMore)return;Fe.page++;const e=await S({sessionKey:xe.currentSessionItem.sessionKey,page:Fe.page,lastSendTime:Fe.lastSendTime});if(!Array.isArray(e)||0===e.length)return Fe.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const n=F(e).id;Fe.lastSendTime=U(e).sendTime,Le(Fe.page>1?[...xe.msgList,...e]:e),1===Fe.page&&xe.currentSessionItem.unreadNum&&(await z({chatType:xe.currentSessionItem.chatType,messageIdSet:[n],receiver:xe.userInfo.id,sender:xe.currentSessionItem.receiver}),be({unreadNum:0}))}catch(e){console.log(e)}}async function Pe(e,n){Re.value=n,async function(e){var n,t,s,o,i,a;Ae.value=!0,await w();const{clientX:l,clientY:r}=e,{width:c=0,height:u=0,left:d=0,top:m=0}=(null==(n=_e.value)?void 0:n.getBoundingClientRect())||{},p=null!=(o=null==(s=null==(t=ze.value)?void 0:t.$el)?void 0:s.getBoundingClientRect().height)?o:220,g=null!=(a=null==(i=_e.value)?void 0:i.scrollTop)?a:0,y=5,v={};l<=d+c/2?v.left=l-d+y+"px":v.right=d+c-l-y+"px";r-m<p/2?v.top=g+y+"px":m+u-r<=p/2?v.bottom=Math.abs(g)+y+"px":v.top=g+r-m-p/2+"px";De.value=v}(e)}function Je(e){const{chatMessageType:n,messageTemplate:t}=e.content;return n!==D.TEMPLATE||!!t}function Xe(e){const{chatMessageType:n}=e.content;return e.sender===xe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[D.TEXT,D.EMOJI].includes(n)}function Ge(e){const{chatMessageType:n,msg:t=""}=e.content;if(n===D.BLEND){const e=W(t).match(/<img[^>]*>/gi);return!e||!e.length}return n&&[D.TEXT,D.EMOJI].includes(n)}function Ke(e){const{chatMessageType:n,msg:t=""}=e.content,s=W(t).match(/<img[^>]*>/gi);return n===D.BLEND&&s&&s.length}function Ye(e,n){var t,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===D.TEMPLATE)return"system"===n?2==(null==(t=null==i?void 0:i.setting)?void 0:t.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function Ve(e){var n,t;const{chatMessageType:s,messageTemplate:o}=e;return s===D.TEMPLATE&&3==(null==(t=null==(n=null==o?void 0:o.setting)?void 0:n.style)?void 0:t.id)}function $e(e,n){var t;const s=new Date(e.sendTime).getTime(),o=null==(t=xe.msgList[n+1])?void 0:t.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function Qe(e){xe.currentReferenceMsg=e,xe.currentReferenceMsg.content.referenceContent=null,Object.assign(xe.currentReferenceMsg,{chatType:xe.currentSessionItem.chatType,receiver:xe.currentSessionItem.receiver,receiverAvatar:xe.currentSessionItem.avatar,receiverName:xe.currentSessionItem.name})}function Ze(e,n){var t;"reply"!==e?"relay"===e&&(null==(t=He.value)||t.click()):Qe(n)}function en({checkedIds:e,remark:n}){const t=xe.msgList.find((e=>e.id===Re.value));Ie({checkedIds:e,remark:n,contents:[t.content]})}return oe(_e,(()=>{We()}),"top",(()=>{Ne.value=Ae.value=!1})),o((()=>xe.id),(e=>{e&&(xe.currentReferenceMsg=null,Object.assign(Fe,{page:0,hasMore:!0,lastSendTime:E(new Date,"yyyy-MM-dd HH:mm:ss")}),We())}),{immediate:!0}),o((()=>xe.isAppendMsg),(e=>{e&&(Le([xe.currentMsg,...xe.msgList]),async function(){var e;null==(e=_e.value)||e.scrollTo({top:0,behavior:"auto"})}(),xe.isAppendMsg=!1)}),{immediate:!0}),(e,n)=>{var t;return i(),a("div",{class:l(["chat-main",{"home-bg":!r(xe).id,"chat-main--check":r(xe).isForward}]),ref_key:"chatMainRef",ref:_e,style:c(r(Ue))},[u(r(T),{"show-toolbar-tooltip":"","render-toolbar":qe},{default:d((()=>[(i(!0),a(m,null,p(r(xe).msgList,((e,t)=>{var s,o,c;return i(),a(m,{key:e.id},[Je(e)?(i(),a("div",{key:0,class:l(["message-item",{"message-item--mine":e.sender==r(xe).userInfo.id}])},[$e(e,t)?(i(),a("p",ie,g(e.__sendTime),1)):y("v-if",!0),Ye(e,"system")||"WITHDRAWN"===e.status||(null==(s=e.content)?void 0:s.chatMessageType)===r(D).EVENT?(i(),a(m,{key:1},[Ye(e,"system")?(i(),v(P,{key:0,data:e},null,8,["data"])):y("v-if",!0),"WITHDRAWN"===e.status?(i(),a("p",ae,[f("span",null,g(e.sender==r(xe).userInfo.id?(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.67"))||"你":e.senderName)+((null==(c=window.getLanguageByCode)?void 0:c.call(window,"10010.1.68"))||"撤回了一条消息"),1),Xe(e)?(i(),v(r(M),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){xe.currentReEditMsg=e}(e)},{default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.69"))||"重新编辑")]})),_:2},1032,["onClick"])):y("v-if",!0)])):(i(),v(J,{key:2,data:e},null,8,["data"]))],64)):(i(),a("div",{key:2,class:l(["message-wrapper",{checked:e.checked}]),onClick:()=>e.checked=!e.checked},[u(r(C),{checked:e.checked,"onUpdate:checked":n=>e.checked=n,size:"large"},null,8,["checked","onUpdate:checked"]),f("div",re,[u(r(_),{round:"",size:38,src:e.senderAvatar,onClick:k((n=>r(Ee)(n,{show:!0,userId:e.sender})),["stop"])},null,8,["src","onClick"]),e.content?(i(),a("div",ce,[f("div",ue,[f("span",{class:"name","data-time":e.__time},g(r(Se)?e.senderName:""),9,de)]),f("div",{class:l(["content",{emoji:e.content.chatMessageType===r(D).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===r(D).TEMPLATE,"template--3":Ve(e.content),"audio-video":r(R)(e.content),file:e.content.chatMessageType===r(D).FILE,"merge-msg":e.content.chatMessageType===r(D).FORWARD&&r(q)(e.content.forwardMessageList)}]),onContextmenu:k((n=>!r(xe).isForward&&Pe(n,e.id)),["prevent"])},[Ge(e)?(i(),a(m,{key:0},[e.content.referenceContent?(i(),a("div",pe,[f("span",null,g(e.content.referenceContent.senderName)+":",1),f("pre",{innerHTML:r(H)(e.content.referenceContent.content)},null,8,ge)])):y("v-if",!0),e.content.chatMessageType===r(D).EMOJI?(i(),a("img",{key:1,class:l([e.content.referenceContent?"emoji--min":"emoji--big"]),src:r(K).findEmoji(e.__content)},null,10,ye)):(i(),a("pre",{key:2,innerHTML:e.__content},null,8,ve))],64)):y("v-if",!0),Ke(e)?(i(),a("pre",{key:1,innerHTML:e.__content},null,8,fe)):y("v-if",!0),Ye(e,"template")?(i(),v(P,{key:2,data:e},null,8,["data"])):y("v-if",!0),e.content.chatMessageType===r(D).FORWARD&&r(q)(e.content.forwardMessageList)?(i(),a("div",{key:3,class:"merge-msg-box",onClick:()=>function(e){xe.isForward||(Re.value=e.id,Be.value=!0)}(e)},[f("h4",null,g(r(N)(e.content)),1),f("div",ke,[(i(!0),a(m,null,p(e.content.forwardMessageList,(e=>(i(),a("div",{key:e.id},g(e.senderName)+":"+g(r(H)(e.content)),1)))),128))])],8,he)):y("v-if",!0),e.content.chatMessageType===r(D).IMAGE?(i(),v(r(x),{key:4,width:"240",src:e.__content,onClick:n[0]||(n[0]=e=>e.stopPropagation())},null,8,["src"])):y("v-if",!0),r(R)(e.content)?(i(),a(m,{key:5},[u(r(L),{class:l({"is-audio":e.content.chatMessageType===r(D).AUDIO}),component:e.content.chatMessageType===r(D).AUDIO?r($):r(Q)},null,8,["class","component"]),f("span",we,g(r(O)(e.__content)),1)],64)):y("v-if",!0),e.content.chatMessageType===r(D).FILE?(i(),v(r(I),{key:6,"wrap-item":!1},{default:d((()=>[u(r(L),{class:"icon-file",size:"40",component:r(Z)},null,8,["component"]),u(r(I),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:d((()=>[f("span",null,g(e.__content),1),f("span",Te,g(e.__size),1)])),_:2},1024)])),_:2},1024)):y("v-if",!0),!r(R)(e.content)&&e.content.labelList?(i(),v(r(I),{key:7,"wrap-item":!1},{default:d((()=>[(i(!0),a(m,null,p(e.content.labelList,((n,t)=>(i(),a("div",{key:t,class:"label-item"},["text"===n.type?(i(),v(r(M),{key:0,type:n.label.type,secondary:"",size:"tiny",onClick:()=>r(je)({type:n.type,labelItem:n.label,msgId:e.id})},{default:d((()=>[h(g(n.label.label),1)])),_:2},1032,["type","onClick"])):(i(),v(r(M),{key:1,quaternary:"",size:"tiny",onClick:()=>r(je)({type:n.type,labelItem:n.label,msgId:e.id})},{icon:d((()=>[f("img",{class:"emoji--min",src:r(K).findEmoji(n.label)},null,8,Me)])),_:2},1032,["onClick"])),(i(!0),a(m,null,p(n.userList,((e,t)=>(i(),a(m,{key:e.id},[u(r(M),{quaternary:"",type:"tertiary",size:"tiny",onClick:n=>r(Ee)(n,{show:!0,info:e})},{default:d((()=>[h(g(e.name),1)])),_:2},1032,["onClick"]),t<n.userList.length-1?(i(),a("span",Ce,",")):y("v-if",!0)],64)))),128))])))),128))])),_:2},1024)):y("v-if",!0),u(r(b),{class:"quick-menu"},{default:d((()=>[r(R)(e.content)?y("v-if",!0):(i(),a(m,{key:0},[u(r(M),{quaternary:"",size:"tiny",onClick:n=>function(e,n){Ne.value=!0,Oe.x=e.clientX,Oe.y=e.clientY,Re.value=n}(n,e.id)},{icon:d((()=>[u(r(L),{size:"17",component:r(ee)},null,8,["component"])])),_:2},1032,["onClick"]),u(r(M),{quaternary:"",size:"tiny",onClick:()=>Qe(e)},{icon:d((()=>[u(r(L),{size:"17",component:r(ne)},null,8,["component"])])),_:2},1032,["onClick"])],64)),u(r(M),{quaternary:"",size:"tiny",onClick:n=>Pe(n,e.id)},{icon:d((()=>[u(r(L),{size:"14",component:r(te)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,me)])):y("v-if",!0)])],10,le))],2)):y("v-if",!0)],64)})),128))])),_:1}),u(r(Y),{ref_key:"contextmenuRef",ref:ze,show:Ae.value,"onUpdate:show":n[1]||(n[1]=e=>Ae.value=e),position:De.value,id:Re.value,onSelect:Ze},null,8,["show","position","id"]),u(V,{title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:en},{trigger:d((()=>{var e;return[f("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:He},(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发",512)]})),_:1}),Re.value?(i(),v(G,{key:0,show:Ne.value,"onUpdate:show":n[2]||(n[2]=e=>Ne.value=e),x:Oe.x,y:Oe.y,id:Re.value},null,8,["show","x","y","id"])):y("v-if",!0),u(X,{show:Be.value,"onUpdate:show":n[3]||(n[3]=e=>Be.value=e),id:Re.value},null,8,["show","id"])],6)}}});export{_e as default};
|
1
|
+
import{defineComponent as e,ref as n,reactive as t,computed as s,watch as o,openBlock as i,createElementBlock as a,normalizeClass as l,unref as r,normalizeStyle as c,createVNode as u,withCtx as d,Fragment as m,renderList as p,toDisplayString as g,createCommentVNode as y,createBlock as v,createElementVNode as f,createTextVNode as h,withModifiers as k,nextTick as w}from"vue";import{NImageGroup as T,NButton as M,NCheckbox as C,NAvatar as _,NImage as x,NIcon as L,NSpace as I,NButtonGroup as b,NTooltip as j}from"naive-ui";import{format as E}from"date-fns";import{getHistoryRecordApi as S,readMessageApi as z}from"../api/index.js";import{useData as A}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as D}from"../constants/index.js";import{isAudioOrVideoMessage as R,simplifyMessage as N,getForwardTitle as H,getAVTime as O,downloadFile as B}from"../utils/index.js";import{first as U,last as F,isArray as q,toString as W}from"lodash-es";import"trtc-sdk-v5";import J from"./MessageTemplate.vue.js";import P from"./MessageEvent.vue.js";import X from"./MessageMergeForward.vue.js";import G from"./SelectLabel.vue.js";import{emojis as K}from"../utils/emoji.js";import Y from"./ContextMenu.js";import V from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as $,VideocamOutline as Q,DocumentSharp as Z,HappyOutline as ee,ChatbubbleEllipsesOutline as ne,EllipsisHorizontal as te,ArrowDownSharp as se}from"@vicons/ionicons5";import{useScrollLoading as oe}from"../../../../shared/hooks/useScrollLoading.js";const ie={key:0,class:"tip-text"},ae={key:1,class:"tip-text"},le=["onClick"],re={class:"message-box"},ce={key:0,class:"content-box"},ue={class:"name-box"},de=["data-time"],me=["onContextmenu"],pe={key:0,class:"reference-content"},ge=["innerHTML"],ye=["src"],ve=["innerHTML"],fe=["innerHTML"],he=["onClick"],ke={class:"merge-msg-contents"},we={style:{"margin-left":"8px"}},Te={class:"size"},Me=["src"],Ce={key:0};var _e=e({__name:"ChatMain",setup(e){const _e=n(),{state:xe,setMsgList:Le,relayMessage:Ie,setCurrentSessionItem:be,setMessageLabel:je,setUserDetail:Ee,isGroupChat:Se}=A(),ze=n(),Ae=n(!1),De=n({left:0,top:0}),Re=n(),Ne=n(),He=n(!1),Oe=t({x:0,y:0}),Be=n(!1),Ue={page:0,hasMore:!0,lastSendTime:E(new Date,"yyyy-MM-dd HH:mm:ss")},Fe=s((()=>({"--c-tip-top":Se.value?"1px":"-20px","--c-tip-gap":Se.value?"10px":"0px"})));function qe({nodes:e}){var n,t;const{_ctx:s}=null==(n=e.download)?void 0:n.children,o=s?null==(t=null==s?void 0:s.proxy)?void 0:t.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,u(j,null,{trigger:()=>u(L,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:se,onClick:()=>o&&B(o,"img")},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载"}}),e.close]}function We(e,n){try{if("string"==typeof e){return JSON.parse(e)[n]}return e[n]}catch(n){return e}}async function Je(){try{if(!Ue.hasMore)return;Ue.page++;const e=await S({sessionKey:xe.currentSessionItem.sessionKey,page:Ue.page,lastSendTime:Ue.lastSendTime});if(!Array.isArray(e)||0===e.length)return Ue.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const n=U(e).id;Ue.lastSendTime=F(e).sendTime,Le(Ue.page>1?[...xe.msgList,...e]:e),1===Ue.page&&xe.currentSessionItem.unreadNum&&(await z({chatType:xe.currentSessionItem.chatType,messageIdSet:[n],receiver:xe.userInfo.id,sender:xe.currentSessionItem.receiver}),be({unreadNum:0}))}catch(e){console.log(e)}}async function Pe(e,n){Re.value=n,async function(e){var n,t,s,o,i,a;Ae.value=!0,await w();const{clientX:l,clientY:r}=e,{width:c=0,height:u=0,left:d=0,top:m=0}=(null==(n=_e.value)?void 0:n.getBoundingClientRect())||{},p=null!=(o=null==(s=null==(t=ze.value)?void 0:t.$el)?void 0:s.getBoundingClientRect().height)?o:220,g=null!=(a=null==(i=_e.value)?void 0:i.scrollTop)?a:0,y=5,v={};l<=d+c/2?v.left=l-d+y+"px":v.right=d+c-l-y+"px";r-m<p/2?v.top=g+y+"px":m+u-r<=p/2?v.bottom=Math.abs(g)+y+"px":v.top=g+r-m-p/2+"px";De.value=v}(e)}function Xe(e){const{chatMessageType:n,messageTemplate:t}=e.content;return n!==D.TEMPLATE||!!t}function Ge(e){const{chatMessageType:n}=e.content;return e.sender===xe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[D.TEXT,D.EMOJI].includes(n)}function Ke(e){const{chatMessageType:n,msg:t=""}=e.content;if(n===D.BLEND){const e=W(t).match(/<img[^>]*>/gi);return!e||!e.length}return n&&[D.TEXT,D.EMOJI].includes(n)}function Ye(e){const{chatMessageType:n,msg:t=""}=e.content,s=W(t).match(/<img[^>]*>/gi);return n===D.BLEND&&s&&s.length}function Ve(e,n){var t,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===D.TEMPLATE)return"system"===n?2==(null==(t=null==i?void 0:i.setting)?void 0:t.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function $e(e){var n,t;const{chatMessageType:s,messageTemplate:o}=e;return s===D.TEMPLATE&&3==(null==(t=null==(n=null==o?void 0:o.setting)?void 0:n.style)?void 0:t.id)}function Qe(e,n){var t;const s=new Date(e.sendTime).getTime(),o=null==(t=xe.msgList[n+1])?void 0:t.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function Ze(e){xe.currentReferenceMsg=e,xe.currentReferenceMsg.content.referenceContent=null,Object.assign(xe.currentReferenceMsg,{chatType:xe.currentSessionItem.chatType,receiver:xe.currentSessionItem.receiver,receiverAvatar:xe.currentSessionItem.avatar,receiverName:xe.currentSessionItem.name})}function en(e,n){var t;"reply"!==e?"relay"===e&&(null==(t=Ne.value)||t.click()):Ze(n)}function nn({checkedIds:e,remark:n}){const t=xe.msgList.find((e=>e.id===Re.value));Ie({checkedIds:e,remark:n,contents:[t.content]})}return oe(_e,(()=>{Je()}),"top",(()=>{He.value=Ae.value=!1})),o((()=>xe.id),(e=>{e&&(xe.currentReferenceMsg=null,Object.assign(Ue,{page:0,hasMore:!0,lastSendTime:E(new Date,"yyyy-MM-dd HH:mm:ss")}),Je())}),{immediate:!0}),o((()=>xe.isAppendMsg),(e=>{e&&(Le([xe.currentMsg,...xe.msgList]),async function(){var e;null==(e=_e.value)||e.scrollTo({top:0,behavior:"auto"})}(),xe.isAppendMsg=!1)}),{immediate:!0}),(e,n)=>{var t;return i(),a("div",{class:l(["chat-main",{"home-bg":!r(xe).id,"chat-main--check":r(xe).isForward}]),ref_key:"chatMainRef",ref:_e,style:c(r(Fe))},[u(r(T),{"show-toolbar-tooltip":"","render-toolbar":qe},{default:d((()=>[(i(!0),a(m,null,p(r(xe).msgList,((e,t)=>{var s,o,c;return i(),a(m,{key:e.id},[Xe(e)?(i(),a("div",{key:0,class:l(["message-item",{"message-item--mine":e.sender==r(xe).userInfo.id}])},[Qe(e,t)?(i(),a("p",ie,g(e.__sendTime),1)):y("v-if",!0),Ve(e,"system")||"WITHDRAWN"===e.status||(null==(s=e.content)?void 0:s.chatMessageType)===r(D).EVENT?(i(),a(m,{key:1},[Ve(e,"system")?(i(),v(J,{key:0,data:e},null,8,["data"])):y("v-if",!0),"WITHDRAWN"===e.status?(i(),a("p",ae,[f("span",null,g(e.sender==r(xe).userInfo.id?(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.67"))||"你":e.senderName)+((null==(c=window.getLanguageByCode)?void 0:c.call(window,"10010.1.68"))||"撤回了一条消息"),1),Ge(e)?(i(),v(r(M),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){xe.currentReEditMsg=e}(e)},{default:d((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.69"))||"重新编辑")]})),_:2},1032,["onClick"])):y("v-if",!0)])):(i(),v(P,{key:2,data:e},null,8,["data"]))],64)):(i(),a("div",{key:2,class:l(["message-wrapper",{checked:e.checked}]),onClick:()=>e.checked=!e.checked},[u(r(C),{checked:e.checked,"onUpdate:checked":n=>e.checked=n,size:"large"},null,8,["checked","onUpdate:checked"]),f("div",re,[u(r(_),{round:"",size:38,src:e.senderAvatar,onClick:k((n=>r(Ee)(n,{show:!0,userId:e.sender})),["stop"])},null,8,["src","onClick"]),e.content?(i(),a("div",ce,[f("div",ue,[f("span",{class:"name","data-time":e.__time},g(r(Se)?e.senderName:""),9,de)]),f("div",{class:l(["content",{emoji:e.content.chatMessageType===r(D).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===r(D).TEMPLATE,"template--3":$e(e.content),"audio-video":r(R)(e.content),file:e.content.chatMessageType===r(D).FILE,"merge-msg":e.content.chatMessageType===r(D).FORWARD&&r(q)(e.content.forwardMessageList)}]),onContextmenu:k((n=>!r(xe).isForward&&Pe(n,e.id)),["prevent"])},[Ke(e)?(i(),a(m,{key:0},[e.content.referenceContent?(i(),a("div",pe,[f("span",null,g(e.content.referenceContent.senderName)+":",1),f("pre",{innerHTML:r(N)(e.content.referenceContent.content)},null,8,ge)])):y("v-if",!0),e.content.chatMessageType===r(D).EMOJI?(i(),a("img",{key:1,class:l([e.content.referenceContent?"emoji--min":"emoji--big"]),src:r(K).findEmoji(e.__content)},null,10,ye)):(i(),a("pre",{key:2,innerHTML:e.__content},null,8,ve))],64)):y("v-if",!0),Ye(e)?(i(),a("pre",{key:1,innerHTML:e.__content},null,8,fe)):y("v-if",!0),Ve(e,"template")?(i(),v(J,{key:2,data:e},null,8,["data"])):y("v-if",!0),e.content.chatMessageType===r(D).FORWARD&&r(q)(e.content.forwardMessageList)?(i(),a("div",{key:3,class:"merge-msg-box",onClick:()=>function(e){xe.isForward||(Re.value=e.id,Be.value=!0)}(e)},[f("h4",null,g(r(H)(e.content)),1),f("div",ke,[(i(!0),a(m,null,p(e.content.forwardMessageList,(e=>(i(),a("div",{key:e.id},g(e.senderName)+":"+g(r(N)(e.content)),1)))),128))])],8,he)):y("v-if",!0),e.content.chatMessageType===r(D).IMAGE?(i(),v(r(x),{key:4,width:"240",src:We(e.__content,"fileUrl"),onClick:n[0]||(n[0]=e=>e.stopPropagation())},null,8,["src"])):y("v-if",!0),r(R)(e.content)?(i(),a(m,{key:5},[u(r(L),{class:l({"is-audio":e.content.chatMessageType===r(D).AUDIO}),component:e.content.chatMessageType===r(D).AUDIO?r($):r(Q)},null,8,["class","component"]),f("span",we,g(r(O)(e.__content)),1)],64)):y("v-if",!0),e.content.chatMessageType===r(D).FILE?(i(),v(r(I),{key:6,"wrap-item":!1},{default:d((()=>[u(r(L),{class:"icon-file",size:"40",component:r(Z)},null,8,["component"]),u(r(I),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:d((()=>[f("span",null,g(We(e.__content,"fileName")),1),f("span",Te,g(e.__size),1)])),_:2},1024)])),_:2},1024)):y("v-if",!0),!r(R)(e.content)&&e.content.labelList?(i(),v(r(I),{key:7,"wrap-item":!1},{default:d((()=>[(i(!0),a(m,null,p(e.content.labelList,((n,t)=>(i(),a("div",{key:t,class:"label-item"},["text"===n.type?(i(),v(r(M),{key:0,type:n.label.type,secondary:"",size:"tiny",onClick:()=>r(je)({type:n.type,labelItem:n.label,msgId:e.id})},{default:d((()=>[h(g(n.label.label),1)])),_:2},1032,["type","onClick"])):(i(),v(r(M),{key:1,quaternary:"",size:"tiny",onClick:()=>r(je)({type:n.type,labelItem:n.label,msgId:e.id})},{icon:d((()=>[f("img",{class:"emoji--min",src:r(K).findEmoji(n.label)},null,8,Me)])),_:2},1032,["onClick"])),(i(!0),a(m,null,p(n.userList,((e,t)=>(i(),a(m,{key:e.id},[u(r(M),{quaternary:"",type:"tertiary",size:"tiny",onClick:n=>r(Ee)(n,{show:!0,info:e})},{default:d((()=>[h(g(e.name),1)])),_:2},1032,["onClick"]),t<n.userList.length-1?(i(),a("span",Ce,",")):y("v-if",!0)],64)))),128))])))),128))])),_:2},1024)):y("v-if",!0),u(r(b),{class:"quick-menu"},{default:d((()=>[r(R)(e.content)?y("v-if",!0):(i(),a(m,{key:0},[u(r(M),{quaternary:"",size:"tiny",onClick:n=>function(e,n){He.value=!0,Oe.x=e.clientX,Oe.y=e.clientY,Re.value=n}(n,e.id)},{icon:d((()=>[u(r(L),{size:"17",component:r(ee)},null,8,["component"])])),_:2},1032,["onClick"]),u(r(M),{quaternary:"",size:"tiny",onClick:()=>Ze(e)},{icon:d((()=>[u(r(L),{size:"17",component:r(ne)},null,8,["component"])])),_:2},1032,["onClick"])],64)),u(r(M),{quaternary:"",size:"tiny",onClick:n=>Pe(n,e.id)},{icon:d((()=>[u(r(L),{size:"14",component:r(te)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,me)])):y("v-if",!0)])],10,le))],2)):y("v-if",!0)],64)})),128))])),_:1}),u(r(Y),{ref_key:"contextmenuRef",ref:ze,show:Ae.value,"onUpdate:show":n[1]||(n[1]=e=>Ae.value=e),position:De.value,id:Re.value,onSelect:en},null,8,["show","position","id"]),u(V,{title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:nn},{trigger:d((()=>{var e;return[f("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:Ne},(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发",512)]})),_:1}),Re.value?(i(),v(G,{key:0,show:He.value,"onUpdate:show":n[2]||(n[2]=e=>He.value=e),x:Oe.x,y:Oe.y,id:Re.value},null,8,["show","x","y","id"])):y("v-if",!0),u(X,{show:Be.value,"onUpdate:show":n[3]||(n[3]=e=>Be.value=e),id:Re.value},null,8,["show","id"])],6)}}});export{_e as default};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { PropType } from 'vue';
|
2
2
|
import { AnyObject } from '../../../../shared/types';
|
3
|
-
import { formatTime } from '../utils';
|
3
|
+
import { formatTime, isDoctorRole, getRoleName } from '../utils';
|
4
4
|
import { MESSAGE_TYPE } from '../constants';
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
6
6
|
visible: {
|
@@ -45,6 +45,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
45
45
|
};
|
46
46
|
isForward: boolean;
|
47
47
|
};
|
48
|
+
cssVars: import("vue").ComputedRef<AnyObject>;
|
48
49
|
recordRef: import("vue").Ref<any>;
|
49
50
|
recordList: import("vue").Ref<AnyObject[]>;
|
50
51
|
keyword: import("vue").Ref<any>;
|
@@ -57,6 +58,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
57
58
|
hasMore: boolean;
|
58
59
|
lastSendTime: string;
|
59
60
|
};
|
61
|
+
getFileDetails: (msg: string, type: string) => any;
|
62
|
+
getDetail: (item: AnyObject) => string;
|
63
|
+
getFileType: (msg: string) => string;
|
60
64
|
handleSearch: () => Promise<void>;
|
61
65
|
resetAndSearch: () => void;
|
62
66
|
startDateDisabled: (ts: number) => boolean;
|
@@ -203,6 +207,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
203
207
|
holidays: Date[];
|
204
208
|
}>>;
|
205
209
|
formatTime: typeof formatTime;
|
210
|
+
isDoctorRole: typeof isDoctorRole;
|
211
|
+
getRoleName: typeof getRoleName;
|
206
212
|
MESSAGE_TYPE: typeof MESSAGE_TYPE;
|
207
213
|
emojis: {
|
208
214
|
default: string[][];
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as a,ref as l,watch as t,openBlock as
|
1
|
+
import{createElementVNode as e,defineComponent as a,ref as l,watch as t,openBlock as s,createBlock as n,unref as r,withCtx as o,createVNode as i,toDisplayString as u,normalizeStyle as d,resolveDynamicComponent as c,createElementBlock as v,Fragment as m,renderList as p,createCommentVNode as f,withDirectives as g,normalizeClass as h,vShow as y,createTextVNode as w}from"vue";import{NModal as _,NAvatar as b,NInputGroup as T,NInput as k,NSelect as M,NPopover as I,NTag as x,NIcon as j}from"naive-ui";import{SearchOutline as C}from"@vicons/ionicons5";import{useData as L}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as A}from"../constants/index.js";import{searchChatRecordApi as S}from"../api/index.js";import{transformMessage as H,isDoctorRole as D,getRoleName as U,formatTime as B}from"../utils/index.js";import{last as E}from"lodash-es";import"trtc-sdk-v5";import N from"../../../date-picker/index.js";import{useDebounceFn as z}from"@vueuse/core";import{format as O}from"date-fns";import"../../../../shared/utils/index.js";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as R}from"../../../../shared/hooks/useScrollLoading.js";import{emojis as G}from"../utils/emoji.js";var $,J;const W={class:"iho-chat-dialog__header"},F=e("span",{class:"left"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.65"))||"聊天记录",-1),P={class:"center"},V={class:"chat-record-box"},q={class:"msg-box"},K={class:"name-and-time"},Q={class:"seach-box"},X={class:"ellipsis"},Y={style:{"white-space":"nowrap"}},Z={class:"content"},ee=["src"],ae={class:"file-type"},le={class:"text"},te={class:"name"},se={class:"detail"},ne=["src"],re=["innerHTML"],oe={key:1,class:"no-data"},ie={class:"chat-record-box__filter"},ue=e("span",{class:"filter-title"},(null==(J=window.getLanguageByCode)?void 0:J.call(window,"10010.1.72"))||"添加筛选条件",-1),de={class:"filter-item"},ce=e("span",{class:"label"},"成员:",-1),ve={class:"filter-item"},me=e("span",{class:"label"},"日期:",-1),pe={class:"time-target"},fe={class:"time-target__item"},ge=e("span",null,"开始:",-1),he={class:"tip"},ye={class:"time-target__item"},we=e("span",null,"结束:",-1),_e={class:"tip"};var be=a({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(a){const $=a,J={color:"#fff",textColor:"#666"},{state:be,cssVars:Te}=L(),ke=l(),Me=l([]),Ie=l(),xe=l([]),je=l(),Ce=l(),Le=z(Be,500),Ae={page:0,hasMore:!0,lastSendTime:O(new Date,"yyyy-MM-dd HH:mm:ss")};function Se(e,a){try{const l=JSON.parse(e);return l?l[a]:""}catch(a){return e||""}}function He(e){const{size:a,sendTime:l,senderName:t}=e;return`${O(new Date(l),"yyyy/MM/dd HH:mm")} ${t}`}function De(e){const a=e.lastIndexOf(".");if(console.log("dotIndex",a),-1!==a){return e.charAt(a+1).toUpperCase()}return"?"}async function Ue(){var e;try{if(!Ae.hasMore)return;Ae.page++;const a=await S({orgId:be.orgId,keyword:Ie.value,endTime:ze(),startTime:je.value?je.value+" 00:00:00":"",lastSendTime:Ae.lastSendTime,memberIdSet:xe.value,page:Ae.page,recordType:"ALL",receiver:be.currentSessionItem.receiver,userId:be.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(Ae.hasMore=!1);let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList.filter((e=>"WITHDRAWN"!==e.status))),Ae.lastSendTime=null==(e=E(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t;let s="";if(e.content.chatMessageType===A.TEMPLATE)s=null==(t=null==(l=null==(a=e.content)?void 0:a.messageTemplate)?void 0:l.setting)?void 0:t.title;else s=H(e.content);e.__content=s})),Me.value=Ae.page>1?Me.value.concat(l):l}catch(e){}}function Be(){Object.assign(Ae,{page:0,hasMore:!0,lastSendTime:ze()||O(new Date,"yyyy-MM-dd HH:mm:ss")}),Ue()}function Ee(e){return!!Ce.value&&e>Date.parse(`${Ce.value} 23:59:59`)}function Ne(e){return!!je.value&&e<Date.parse(je.value)}function ze(){return Ce.value?Ce.value+" 23:59:59":""}function Oe(e){switch(e){case"member":xe.value=[];break;case"start":je.value=null;break;case"end":Ce.value=null}}function Re(e){return i(m,null,[i("div",{style:"display: flex;align-items: center"},[i(b,{src:e.avatar,round:!0,size:"small"},null),i("span",{style:"margin-left: 10px"},[e.name])])])}return R(ke,(()=>{Ue()})),t([()=>xe.value,()=>je.value,()=>Ce.value],(()=>{$.visible&&Be()}),{deep:!0}),t((()=>$.visible),(e=>{e?Be():(Ie.value="",Ce.value=null,je.value=null,xe.value=[],Me.value=[])})),(a,l)=>(s(),n(r(_),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{header:o((()=>[e("div",W,[F,e("div",P,[i(r(b),{round:"",size:30,src:r(be).currentSessionItem.avatar},null,8,["src"]),e("span",null,u(r(be).currentSessionItem.name),1)])])])),default:o((()=>[e("div",{class:"iho-chat-dialog__content iho-chat-record-wrapper",style:d(r(Te))},[i(r(T),null,{default:o((()=>{var e;return[(s(),n(c((()=>[i(j,{component:C,size:18,color:"#6666"},null),xe.value.length>0?i(x,{closable:!0,bordered:!1,color:J,onClose:()=>Oe("member")},{default:()=>{var e,a;return[w("成员:")," ",xe.value.length>1?xe.value.length+((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.40"))||"人"):null==(a=be.currentGroupUser.find((e=>e.id===xe.value[0])))?void 0:a.name]}}):null,je.value?i(x,{closable:!0,bordered:!1,color:J,onClose:()=>Oe("start")},{default:()=>[w("起始时间: "),je.value]}):null,Ce.value?i(x,{closable:!0,bordered:!1,color:J,onClose:()=>Oe("end")},{default:()=>[w("结束时间: "),Ce.value]}):null])))),i(r(k),{placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.36"))||"搜索",value:Ie.value,"onUpdate:value":l[0]||(l[0]=e=>Ie.value=e),valueModifiers:{trim:!0},onInput:r(Le)},null,8,["value","onInput"])]})),_:1}),e("div",V,[e("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:ke},[Me.value.length>0?(s(!0),v(m,{key:0},p(Me.value,(a=>(s(),v("div",{class:"content-item",key:a.id},[i(r(b),{round:"",size:38,src:a.senderAvatar},null,8,["src"]),e("div",q,[e("div",K,[f(" <span>{{ item.senderName }}</span> "),e("div",Q,[e("span",X,u(a.senderName),1),g(e("label",{class:h(["iho-chatRole",r(D)(a.roleInfo)?"isDoctor":""])},u(r(U)(a.roleInfo)),3),[[y,r(U)(a.roleInfo)]])]),e("span",Y,u(r(B)(a.sendTime).recordTime),1)]),e("div",Z,[a.content.chatMessageType===r(A).IMAGE?(s(),v("img",{key:0,src:Se(a.__content,"fileUrl")},null,8,ee)):a.content.chatMessageType===r(A).FILE?(s(),v(m,{key:1},[e("span",ae,u(De(a.__content)),1),e("div",le,[e("span",te,u(Se(a.__content,"fileName")),1),e("span",se,u(He(a)),1)])],64)):a.content.chatMessageType===r(A).EMOJI?(s(),v("img",{key:2,class:"emoji",src:r(G).findEmoji(a.__content)},null,8,ne)):(s(),v("p",{key:3,innerHTML:a.__content},null,8,re))])])])))),128)):(s(),v("div",oe,"没有找到相关记录"))],512),e("div",ie,[ue,e("div",de,[ce,i(r(M),{value:xe.value,"onUpdate:value":l[1]||(l[1]=e=>xe.value=e),multiple:"","max-tag-count":1,"render-label":Re,options:r(be).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),e("div",ve,[me,e("div",pe,[i(r(I),{trigger:"click","show-arrow":!1},{trigger:o((()=>{var a;return[e("div",fe,[ge,g(i(r(x),{bordered:!1,color:J,closable:"",onClose:l[2]||(l[2]=()=>Oe("start"))},{default:o((()=>[w(u(je.value),1)])),_:1},512),[[y,je.value]]),g(e("span",he,(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.76"))||"点击选择",512),[[y,!je.value]])])]})),default:o((()=>[i(r(N),{"formatted-value":je.value,"onUpdate:formatted-value":l[3]||(l[3]=e=>je.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Ee},null,8,["formatted-value"])])),_:1}),i(r(I),{trigger:"click","show-arrow":!1},{trigger:o((()=>{var a;return[e("div",ye,[we,g(i(r(x),{bordered:!1,color:J,closable:"",onClose:l[4]||(l[4]=()=>Oe("end"))},{default:o((()=>[w(u(Ce.value),1)])),_:1},512),[[y,Ce.value]]),g(e("span",_e,(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.76"))||"点击选择",512),[[y,!Ce.value]])])]})),default:o((()=>[i(r(N),{"formatted-value":Ce.value,"onUpdate:formatted-value":l[5]||(l[5]=e=>Ce.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Ne},null,8,["formatted-value"])])),_:1})])])])])],4)])),_:1}))}});export{be as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as l,ref as o,computed as
|
1
|
+
import{createElementVNode as e,defineComponent as l,ref as o,computed as t,watch as n,nextTick as a,openBlock as s,createBlock as u,unref as i,normalizeStyle as r,withCtx as v,createVNode as c,createTextVNode as d,withModifiers as p,createElementBlock as f,Fragment as g,renderList as m,normalizeClass as w,createCommentVNode as y,withDirectives as h,vShow as k}from"vue";import{NPopover as C,NButton as L,NIcon as _,NInput as j,NTabs as M,NTabPane as x,NDivider as B}from"naive-ui";import{SearchOutline as I}from"@vicons/ionicons5";import{useData as U}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{openSessionApi as D}from"../api/index.js";import{isGroup as b}from"../utils/index.js";import{trim as R}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as A}from"../hooks/useSearchUserList.js";import S from"../../../default-page/index.js";import z from"./userItemRender.js";var E;const K=e("div",{class:"title"},"联系人(医护)",-1),G=e("div",{class:"title"},(null==(E=window.getLanguageByCode)?void 0:E.call(window,"10010.1.575"))||"我的群组",-1),N={class:"user-list-wrapper"};var T=l({__name:"ChatSearch",setup(l){const E=o(),T=o(),V=o(!1),$=o(""),{cssVars:q,state:F,openSession:H}=U(),{userList:J,handleInput:O}=A({wrapperRef:E,keywordRef:$}),P=o("all"),Q=o(0),W=t((()=>($.value||"").replace(/^\s+|\s+$/g,"")?F.sessionList.filter((e=>b(e)&&(null==e?void 0:e.name.includes($.value)))):[])),X=t((()=>!J.value.length&&!!R($.value||""))),Y=t((()=>!J.value.length&&!W.value.length&&!!R($.value||""))),Z=t((()=>!W.value.length&&!!R($.value||""))),ee=t((()=>J.value.length>3?4:J.value.length)),le=t((()=>{switch(P.value){case"user":return J.value;case"group":return W.value;default:{const e=[],l=J.value.length,o=W.value.length;return l>0&&(l>3?e.push(...J.value.slice(0,3),{id:"user"}):e.push(...J.value)),o>0&&(o>3?e.push(...W.value.slice(0,3),{id:"group"}):e.push(...W.value)),e}}}));function oe(e){if(["ArrowUp","ArrowDown"].includes(e.key)){e.preventDefault();const l=i(Q);if("ArrowUp"===e.key){const e=l>0?l-1:le.value.length-1;Q.value=e}else if("ArrowDown"===e.key){const e=l<le.value.length-1?l+1:0;Q.value=e}}else if(["Enter"].includes(e.key)){e.preventDefault();const l=le.value.find(((e,l)=>Q.value===l)).id;["user","group"].includes(l)?P.value=l:async function(e){V.value=!1;const l=F.sessionList.find((l=>e&&[l.receiver,l.id].includes(e)));let o=l;if(!l){o=await D({chatType:"SINGLE",receiver:e,sender:F.userInfo.id})}H(o)}(l)}}function te(){T.value.focus(),Q.value=0}function ne(){V.value=!1}return n((()=>V.value),(async e=>{var l;e&&(await a(),null==(l=T.value)||l.focus())})),(l,o)=>(s(),u(i(C),{raw:"","content-class":"search-content",class:"search-wrapper",style:r(i(q)),show:V.value,"onUpdate:show":o[6]||(o[6]=e=>V.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:v((()=>[c(i(L),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:v((()=>[c(i(_),{component:i(I),color:"#ffffff80"},null,8,["component"])])),default:v((()=>{var e;return[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.80"))||"搜索联系人")]})),_:1})])),default:v((()=>[c(i(j),{ref_key:"inputRef",ref:T,size:"small",clearable:"",autofocus:"",value:$.value,"onUpdate:value":[o[0]||(o[0]=e=>$.value=e),i(O)],onKeydown:p(oe,["stop"])},{prefix:v((()=>[c(i(_),{color:"#ffffff80",component:i(I)},null,8,["component"])])),_:1},8,["value","onUpdate:value","onKeydown"]),c(i(M),{type:"line",animated:"",value:P.value,"onUpdate:value":[o[5]||(o[5]=e=>P.value=e),te]},{default:v((()=>{var l,t;return[c(i(x),{name:"all",tab:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.571"))||"综合","display-directive":"show",style:{padding:"0 10px 10px"}},{default:v((()=>{var e;return[i(J).length>0?(s(),f(g,{key:0},[K,(s(!0),f(g,null,m(i(J),((e,l)=>(s(),f(g,{key:e.id},[l<3?(s(),u(i(z),{key:0,item:e,class:w({last:i(J).length<4?l===i(J).length-1:2===l,selected:Q.value===l}),onItemClick:ne,onMouseover:p((()=>Q.value=l),["stop"])},null,8,["item","class","onMouseover"])):y("v-if",!0)],64)))),128)),i(J).length>3?(s(),f("div",{key:0,onClick:o[1]||(o[1]=()=>P.value="user"),class:w(["user-item",3===Q.value?"selected":""]),onMouseover:o[2]||(o[2]=p((()=>Q.value=3),["stop"]))},[c(i(L),{text:"",type:"primary"},{icon:v((()=>[c(i(_),{component:i(I),size:"16"},null,8,["component"])])),default:v((()=>[d(" 查看更多联系人(医护) ")])),_:1})],34)):y("v-if",!0)],64)):y("v-if",!0),i(J).length&&i(W).length?(s(),u(i(B),{key:1})):y("v-if",!0),i(W).length>0?(s(),f(g,{key:2},[G,(s(!0),f(g,null,m(i(W),((e,l)=>(s(),f(g,{key:e.id},[l<3?(s(),u(i(z),{key:0,item:e,class:w({last:i(W).length<4?l===i(W).length-1:2===l,selected:Q.value===i(ee)+l}),onItemClick:ne,onMouseover:p((()=>Q.value=i(ee)+l),["stop"])},null,8,["item","class","onMouseover"])):y("v-if",!0)],64)))),128)),i(W).length>3?(s(),f("div",{key:0,onClick:o[3]||(o[3]=()=>P.value="group"),class:w(["user-item",Q.value===i(ee)+3?"selected":""]),onMouseover:o[4]||(o[4]=p((()=>Q.value=i(ee)+3),["stop"]))},[c(i(L),{text:"",type:"primary"},{icon:v((()=>[c(i(_),{component:i(I),size:"16"},null,8,["component"])])),default:v((()=>{var e;return[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.574"))||"查看更多群组")]})),_:1})],34)):y("v-if",!0)],64)):y("v-if",!0),h(c(i(S),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[k,i(Y)]])]})),_:1}),c(i(x),{name:"user",tab:"联系人(医护)","display-directive":"show"},{default:v((()=>{var l;return[e("div",{class:"user-list-wrapper",ref_key:"listRef",ref:E},[(s(!0),f(g,null,m(i(J),((e,l)=>(s(),u(i(z),{key:e.id,item:e,onItemClick:ne,class:w({selected:Q.value===l}),onMouseover:p((()=>Q.value=l),["stop"])},null,8,["item","class","onMouseover"])))),128)),h(c(i(S),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[k,i(X)]])],512)]})),_:1}),c(i(x),{name:"group",tab:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.572"))||"群组","display-directive":"show"},{default:v((()=>{var l;return[e("div",N,[(s(!0),f(g,null,m(i(W),((e,l)=>(s(),u(i(z),{key:e.id,item:e,onItemClick:ne,class:w({selected:Q.value===l}),onMouseover:p((()=>Q.value=l),["stop"])},null,8,["item","class","onMouseover"])))),128)),h(c(i(S),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[k,i(Z)]])])]})),_:1})]})),_:1},8,["value"])])),_:1},8,["style","show"]))}});export{T as default};
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
|
+
import { isDoctorRole, getRoleName } from '../utils';
|
2
3
|
import { FileOptions } from '../types';
|
3
4
|
declare const _default: import("vue").DefineComponent<{}, {
|
4
5
|
attrs: {
|
@@ -163,6 +164,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
163
164
|
remark: import("vue").Ref<string>;
|
164
165
|
currentTab: import("vue").Ref<AnyObject[]>;
|
165
166
|
breadcrumbList: import("vue").Ref<AnyObject[]>;
|
167
|
+
breadcrumbRef: import("vue").Ref<any>;
|
166
168
|
userList: import("vue").Ref<AnyObject[]>;
|
167
169
|
handleInput: () => void;
|
168
170
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -171,18 +173,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
171
173
|
name: any;
|
172
174
|
avatar: any;
|
173
175
|
chatType: any;
|
176
|
+
roleInfo: any;
|
174
177
|
}[]>;
|
175
178
|
friends: import("vue").ComputedRef<{
|
176
179
|
id: any;
|
177
180
|
name: any;
|
178
181
|
avatar: any;
|
179
182
|
chatType: any;
|
183
|
+
roleInfo: any;
|
180
184
|
}[]>;
|
181
185
|
groups: import("vue").ComputedRef<{
|
182
186
|
id: any;
|
183
187
|
name: any;
|
184
188
|
avatar: any;
|
185
189
|
chatType: any;
|
190
|
+
roleInfo: any;
|
186
191
|
}[]>;
|
187
192
|
checkedIds: import("vue").ComputedRef<any[]>;
|
188
193
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -220,6 +225,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
220
225
|
ChevronBackOutline: 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<{}>>, {}>;
|
221
226
|
ChevronForwardOutline: 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<{}>>, {}>;
|
222
227
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
228
|
+
isDoctorRole: typeof isDoctorRole;
|
229
|
+
getRoleName: typeof getRoleName;
|
223
230
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
224
231
|
title: {
|
225
232
|
type: StringConstructor;
|
@@ -253,5 +260,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
253
260
|
mode: string;
|
254
261
|
disabledIds: string[];
|
255
262
|
}>;
|
263
|
+
isDoctorRole: typeof isDoctorRole;
|
264
|
+
getRoleName: typeof getRoleName;
|
256
265
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
257
266
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as n,useAttrs as o,ref as
|
1
|
+
import{createElementVNode as e,defineComponent as n,useAttrs as o,ref as l,computed as t,watch as a,openBlock as i,createBlock as s,unref as r,withCtx as c,createVNode as u,createTextVNode as d,createElementBlock as m,Fragment as p,renderList as v,toDisplayString as g,withDirectives as w,normalizeClass as f,vShow as y,createCommentVNode as _,withKeys as h,nextTick as k}from"vue";import{NDrawer as C,NDrawerContent as I,NButton as b,NIcon as L,NAvatar as B,NUpload as S,NUploadTrigger as x,NInput as U,NSpace as z,NSwitch as j,NPopconfirm as G}from"naive-ui";import{ChevronBackOutline as D,ChevronForwardOutline as R,AddOutline as A,RemoveOutline as F,Pencil as P}from"@vicons/ionicons5";import{useData as K}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{toppingSessionApi as N,groupLeaveApi as O,groupUpdateApi as q}from"../api/index.js";import{isDoctorRole as E,getRoleName as H}from"../utils/index.js";import{trim as J,isFunction as M}from"lodash-es";import"trtc-sdk-v5";import Q from"./ChatAdd.vue.js";var T,V,W,X,Y,Z,$,ee,ne,oe;const le={key:0,class:"chat-set-wrapper"},te=["onClick"],ae={class:"role-name"},ie={class:"name"},se={key:0,class:"item__right",style:{color:"var(--c-primary-color)"}},re={class:"name"},ce={class:"item item-column"},ue=e("span",{class:"label"},(null==(T=window.getLanguageByCode)?void 0:T.call(window,"10010.1.85"))||"群成员",-1),de={class:"group-box"},me=["onClick"],pe={class:"name"},ve={class:"group-box__item"},ge=e("span",{class:"name"},(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.86"))||"添加",-1),we={class:"group-box__item"},fe=e("span",{class:"name"},(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.88"))||"移除",-1),ye=["onClick"],_e=e("span",{class:"label"},(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.90"))||"群头像",-1),he={class:"item"},ke=e("span",{class:"label"},(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.91"))||"群名称",-1),Ce={class:"item__right"},Ie={class:"txt"},be={class:"item"},Le=e("span",{class:"label"},(null==(Z=window.getLanguageByCode)?void 0:Z.call(window,"10010.1.92"))||"置顶聊天",-1),Be={class:"item item--red"},Se=e("span",{class:"label"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.93"))||"退出群聊",-1),xe=e("p",{style:{width:"230px"}},(null==(ee=window.getLanguageByCode)?void 0:ee.call(window,"10010.1.94"))||"是否确认退出群聊?",-1),Ue={class:"item item--red"},ze=e("span",{class:"label"},(null==(ne=window.getLanguageByCode)?void 0:ne.call(window,"10010.1.95"))||"解散该群",-1),je=e("p",{style:{width:"230px"}},(null==(oe=window.getLanguageByCode)?void 0:oe.call(window,"10010.1.96"))||"是否确认解散群聊?",-1);var Ge=n({__name:"ChatSet",setup(n){const T=o(),{state:V,setCurrentSessionItem:W,setUserDetail:X,isGroupChat:Y,isGroupLeader:Z}=K(),$=l(),ee=l(!1),ne=l(""),oe=l(!1),Ge=t((()=>V.currentGroupUser.map((e=>e.id)))),De=t((()=>V.currentGroupUser?Z.value?V.currentGroupUser.slice(0,6):V.currentGroupUser.slice(0,7):[]));async function Re(e){try{await N({id:V.currentSessionItem.id,topping:e}),W({topping:e})}catch(e){}}async function Ae(e){await O({dissolution:!!e,groupId:V.currentSessionItem.receiver,operator:V.userInfo.id,memberIdSet:e?Ge.value:[V.userInfo.id]})}async function Fe(){var e;ne.value=V.currentSessionItem.name,ee.value=!0,await k(),null==(e=$.value)||e.select()}async function Pe(e){const n=new FormData,o=Object.assign({id:V.currentSessionItem.receiver},e);for(const e in o)n.append(e,o[e]);await q(n)}async function Ke(){ee.value=!1;const e=J(ne.value);e&&e!==V.currentSessionItem.name&&(await Pe({name:e}),W({name:e,defaultName:e}))}async function Ne(e){const{file:n}=e.file,o=new FileReader;o.onload=function(e){var n;(null==(n=e.target)?void 0:n.result)&&W({avatar:e.target.result})},o.readAsDataURL(e.file.file),await Pe({file:n})}return a((()=>V.id),(e=>{M(T["onUpdate:show"])&&T["onUpdate:show"](!1)})),(n,o)=>(i(),s(r(C),{width:320,"trap-focus":!1,"block-scroll":!1,to:".iho-chat",onAfterLeave:o[8]||(o[8]=e=>oe.value=!1)},{default:c((()=>[u(r(I),null,{header:c((()=>{var e,n;return[r(Y)&&oe.value?(i(),s(r(b),{key:0,text:"",color:"#666",onClick:o[0]||(o[0]=e=>oe.value=!1),style:{"font-size":"var(--n-title-font-size)"}},{icon:c((()=>[u(r(L),{size:20,component:r(D)},null,8,["component"])])),default:c((()=>{var e;return[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.82"))||"返回")]})),_:1})):r(Y)?(i(),m(p,{key:1},[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.83"))||"群设置")],64)):(i(),m(p,{key:2},[d((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.66"))||"聊天设置")],64))]})),default:c((()=>{var n;return[r(V).id?(i(),m("div",le,[r(Y)&&oe.value?(i(!0),m(p,{key:0},v(r(V).currentGroupUser,((n,o)=>{var l;return i(),m("div",{key:n.id,class:"item",onClick:e=>r(X)(e,{show:!0,userId:n.id})},[u(r(B),{round:"",size:40,src:n.avatar},null,8,["src"]),e("div",ae,[e("span",ie,g(n.name),1),w(e("label",{class:f(["iho-chatRole",r(E)(n.roleInfo)?"isDoctor":""]),style:{"margin-right":"6px"}},g(r(H)(n.roleInfo)),3),[[y,r(H)(n.roleInfo)]])]),0===o?(i(),m("span",se,(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.84"))||"群主")):_("v-if",!0)],8,te)})),128)):(i(),m(p,{key:1},[e("div",{class:"item user-info",onClick:o[1]||(o[1]=e=>!r(Y)&&r(X)(e,{show:!0,userId:r(V).currentSessionItem.receiver}))},[u(r(B),{round:"",size:40,src:r(V).currentSessionItem.avatar},null,8,["src"]),e("span",re,g(r(V).currentSessionItem.name),1),w(e("label",{class:f(["iho-chatRole",r(E)(r(V).currentSessionItem.roleInfo)?"isDoctor":""])},g(r(H)(r(V).currentSessionItem.roleInfo)),3),[[y,r(H)(r(V).currentSessionItem.roleInfo)]]),r(Y)?_("v-if",!0):(i(),s(r(L),{key:0,size:24,component:r(R),class:"item__right"},null,8,["component"]))]),r(Y)?(i(),m(p,{key:0},[e("div",ce,[ue,e("div",de,[(i(!0),m(p,null,v(r(De),(n=>(i(),m("div",{key:n.id,class:"group-box__item",onClick:e=>r(X)(e,{show:!0,userId:n.id})},[u(r(B),{round:"",size:40,src:n.avatar},null,8,["src"]),e("span",pe,g(n.name),1),w(e("label",{class:f(["iho-chatRole",r(E)(n.roleInfo)?"isDoctor":""]),style:{"margin-left":"0"}},g(r(H)(n.roleInfo)),3),[[y,r(H)(n.roleInfo)]])],8,me)))),128)),u(Q,{mode:"join",disabledIds:r(Ge)},{trigger:c((()=>[e("div",ve,[u(r(b),{strong:"",secondary:"",circle:""},{icon:c((()=>[u(r(L),{component:r(A)},null,8,["component"])])),_:1}),ge])])),_:1},8,["disabledIds"]),r(Z)?(i(),s(Q,{key:0,title:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.87"))||"移除成员",mode:"remove",options:r(V).currentGroupUser},{trigger:c((()=>[e("div",we,[u(r(b),{strong:"",secondary:"",circle:""},{icon:c((()=>[u(r(L),{component:r(F)},null,8,["component"])])),_:1}),fe])])),_:1},8,["options"])):_("v-if",!0)]),u(r(b),{text:"","icon-placement":"right",color:"#999",onClick:o[2]||(o[2]=e=>oe.value=!0)},{icon:c((()=>[u(r(L),{component:r(R)},null,8,["component"])])),default:c((()=>{var e;return[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.89"))||"查看全部群成员")]})),_:1})]),u(r(S),{abstract:"",multiple:"",accept:"image/*",onChange:Ne},{default:c((()=>[u(r(x),{abstract:""},{default:c((({handleClick:n})=>[e("div",{class:"item",onClick:n},[_e,u(r(L),{size:20,component:r(R),class:"item__right"},null,8,["component"])],8,ye)])),_:1})])),_:1}),e("div",he,[ke,e("div",Ce,[ee.value?(i(),s(r(U),{key:0,ref_key:"inputRef",ref:$,value:ne.value,"onUpdate:value":o[3]||(o[3]=e=>ne.value=e),onBlur:Ke,onKeydown:o[4]||(o[4]=h((e=>e.target.blur()),["enter"]))},null,8,["value"])):(i(),s(r(z),{key:1,"wrap-item":!1,onClick:Fe,align:"center"},{default:c((()=>[e("span",Ie,g(r(V).currentSessionItem.name),1),u(r(b),{text:"",style:{"font-size":"14px","--n-text-color":"#999"}},{default:c((()=>[u(r(L),{component:r(P)},null,8,["component"])])),_:1})])),_:1}))])])],64)):_("v-if",!0),e("div",be,[Le,u(r(j),{value:r(V).currentSessionItem.topping,"onUpdate:value":[o[5]||(o[5]=e=>r(V).currentSessionItem.topping=e),Re],class:"item__right"},null,8,["value"])]),r(Y)?(i(),m(p,{key:1},[u(r(G),{onPositiveClick:o[6]||(o[6]=()=>Ae(!1))},{trigger:c((()=>[e("div",Be,[Se,u(r(L),{size:20,component:r(R),class:"item__right"},null,8,["component"])])])),default:c((()=>[xe])),_:1}),r(Z)?(i(),s(r(G),{key:0,onPositiveClick:o[7]||(o[7]=()=>Ae(!0))},{trigger:c((()=>[e("div",Ue,[ze,u(r(L),{size:20,component:r(R),class:"item__right"},null,8,["component"])])])),default:c((()=>[je])),_:1})):_("v-if",!0)],64)):_("v-if",!0)],64))])):_("v-if",!0)]})),_:1})])),_:1}))}});export{Ge as default};
|