cnhis-design-vue 3.3.1-beta.14 → 3.3.1-beta.15
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 +12 -17
- package/es/components/ai-chat/src/Index.vue.d.ts +12 -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 +3 -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 +47 -0
- package/es/components/iho-chat/src/Index.vue.d.ts +47 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +5 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +22 -0
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +4 -0
- 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 +8 -0
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +5 -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 +26 -23
- 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 +78 -0
- 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/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/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 l,ref as a,computed as n,watch as t,openBlock as o,createElementBlock as i,Fragment as u,createVNode as r,unref as d,withCtx as s,createCommentVNode as c,createBlock as v,renderList as p,toDisplayString as g,createTextVNode as f,withDirectives as m,isRef as h,vShow as y,withModifiers as w,normalizeClass as k,renderSlot as b}from"vue";import{NModal as I,NInput as C,NIcon as _,NSpace as x,NButton as L,NBreadcrumb as j,NBreadcrumbItem as S,NCheckbox as B,NCheckboxGroup as U,NAvatar as E,NTag as R,NTooltip as N}from"naive-ui";import{SearchOutline as z,PersonOutline as A,PeopleOutline as G,ChevronBackOutline as T,ChevronForwardOutline as V,AddOutline as $}from"@vicons/ionicons5";import{useData as D}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as M}from"../constants/index.js";import{getOrgUserTreeApi as O,groupUserApi as P,groupLeaveApi as q,groupJoinApi as F,groupCreateApi as H}from"../api/index.js";import{listSort as J}from"../utils/index.js";import{union as K,unionBy as Q,remove as W,intersection as X,last as Y,isArray as Z,uniqBy as ee,cloneDeep as le,trim as ae}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as ne}from"../hooks/useSearchUserList.js";var te,oe;const ie={class:"iho-chat-dialog__content iho-chat-add-wrapper"},ue={key:0,class:"input-box"},re=e("span",null,(null==(te=window.getLanguageByCode)?void 0:te.call(window,"10010.1.34"))||"群名称:",-1),de={class:"transfer-box"},se={class:"transfer-box__left"},ce={key:0,class:"nav-wrapper"},ve={key:0,class:"chat--iconfont chat--icon-map-site"},pe={style:{"font-size":"12px"}},ge={key:1,class:"header"},fe={class:"user-list-box"},me={key:0,class:"org-list"},he={class:"ellipsis"},ye={key:0,style:{"font-size":"12px",color:"#666","margin-right":"10px"}},we={key:1,class:"no-data"},ke={class:"transfer-box__right"},be={class:"checked-tag-box"},Ie={key:0,class:"input-wrapper"};var Ce=l({__name:"ChatAdd",props:{title:{type:String,default:(null==(oe=window.getLanguageByCode)?void 0:oe.call(window,"10010.1.42"))||"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["comfirm"],setup(l,{emit:te}){const oe=l;let Ce=[];const _e=[{key:"single",label:"按好友选"},{key:"group",label:"按群聊选"},{key:"org",label:"按架构选"}];let xe=[];const{state:Le,setCurrentSessionItem:je}=D(),Se=a(),Be=a(""),Ue=a(!1),Ee=a([]),Re=a(""),Ne=a(""),ze=a([]),Ae=a([]),{userList:Ge,handleInput:Te}=ne({wrapperRef:Se,keywordRef:Be,before:()=>{ze.value.length>0||(Ge.value=Ce)}}),Ve=n((()=>"relay"===oe.mode?[]:K(oe.disabledIds,[Le.userInfo.id]))),$e=n((()=>{var e;return(null==(e=Le.sessionList)?void 0:e.length)?J(Le.sessionList).map((e=>({id:e.receiver,name:e.name,avatar:e.avatar,chatType:e.chatType}))):[]})),De=n((()=>$e.value.filter((e=>e.chatType===M.SINGLE)))),Me=n((()=>$e.value.filter((e=>e.chatType===M.GROUP)))),Oe=n((()=>Ee.value.length?Ee.value.map((e=>e.id)):[])),Pe=n((()=>"create"===oe.mode?Oe.value.length<3:Oe.value.length<1)),qe=n({get:()=>Fe.value.filter((e=>!Qe(e))).length===Ge.value.filter((e=>!Qe(e.id))).length,set(e){const l=[];if(Ge.value.forEach((e=>{var a;if(1==e.type&&(null==(a=e.children)?void 0:a.length)){const a=Ze(e.children||[]).filter((e=>!Qe(e.id)));l.push(...a)}else Qe(e.id)||l.push(e)})),e)Ee.value=Q(Ee.value,l,"id");else{const e=l.map((e=>e.id));W(Ee.value,(l=>e.includes(l.id)))}}}),Fe=n({get(){var e,l,a;return null!=(a=null==(l=null==(e=Ge.value)?void 0:e.filter((e=>{var l;if(1==e.type&&(null==(l=e.children)?void 0:l.length)){const l=Ze(e.children||[]).map((e=>e.id)).filter((e=>!Qe(e)));return X(l,Oe.value).length===l.length}return Oe.value.includes(e.id)})))?void 0:l.map((e=>e.id)))?a:[]},set(e){Ge.value.forEach((l=>{var a;const n=[];1==l.type&&(null==(a=l.children)?void 0:a.length)?n.push(...Ze(l.children||[]).filter((e=>!Qe(e.id)))):n.push(l),e.includes(l.id)?Ee.value=Q(Ee.value,n,"id"):W(Ee.value,(e=>n.some((l=>l.id===e.id))))}))}}),He=n((()=>{var e;return ze.value.length>0?null==(e=Y(ze.value))?void 0:e.key:""})),Je=n((()=>!("relay"!==oe.mode&&["group","org"].includes(He.value)&&1===ze.value.length)));function Ke(e){e.forEach((e=>{var l;1==e.type&&(null==(l=e.children)?void 0:l.length)?(e.total=Ze(e.children).length,Ke(e.children)):2==e.type&&(e.total=0)}))}function Qe(e){var l,a;return"group"===He.value?"relay"!==oe.mode&&(1===ze.value.length||(null==(l=Ve.value)?void 0:l.includes(e))):null==(a=Ve.value)?void 0:a.includes(e)}function We(){ze.value.length>1?"group"===He.value?Ge.value=Me.value:"org"===He.value&&(Ge.value=xe.map((e=>({id:e.orgId,name:e.orgName}))),Ae.value=[]):Ge.value=Ce,ze.value.pop()}function Xe(e,l){const{id:a,children:n=[],type:t}=e;if("breadcrumb"!==l||Y(Ae.value).id!==a)if(t){const l=Ae.value.findIndex((e=>e.id===a));l>-1?Ae.value=Ae.value.slice(0,l+1):Ae.value.push(e),Ge.value=n}else{const n=xe.find((e=>e.orgId===a));Ae.value=[e],Ge.value=n.userList||[],l||ze.value.push({key:He.value,label:n.orgName})}}function Ye(e){const{children:l=[]}=e;if(!l.length)return!0;const a=Ze(l).map((e=>e.id)).filter((e=>!Ve.value.includes(e)));return X(a,Oe.value).length===a.length}function Ze(e){const l=[];return e.forEach((e=>{var a;1==e.type&&(null==(a=e.children)?void 0:a.length)?l.push(...Ze(e.children)):2==e.type&&l.push(e)})),l}async function el(){const e=d(Oe);switch(oe.mode){case"create":await H({creator:Le.userInfo.id,memberIdSet:e,name:ae(Re.value),orgId:Le.orgId});break;case"join":if(await F({groupId:Le.currentSessionItem.receiver,operator:Le.userInfo.id,memberIdSet:e}),!Le.currentSessionItem.defaultName){const e=Ee.value.map((e=>e.name)).join(",");je({name:`${Le.currentSessionItem.name},${e}`})}Le.currentGroupUser.push(...Ge.value.filter((l=>e.includes(l.id))));break;case"remove":if(await q({dissolution:!1,groupId:Le.currentSessionItem.receiver,operator:Le.userInfo.id,memberIdSet:e}),!Le.currentSessionItem.defaultName){const e=Ee.value.map((e=>e.name)).join(","),l=new RegExp(e,"g");je({name:Le.currentSessionItem.name.replace(l,"")})}W(Le.currentGroupUser,(l=>e.includes(l.id)));break;default:te("comfirm",{checkedIds:e,checkedOptions:Ee.value,remark:Ne.value})}Ue.value=!1}return async function(){try{const e=await O();xe=Z(e)?e:[],xe.forEach((e=>Ke(e.userList||[])))}catch(e){console.log("error ==>",e)}}(),t((()=>Ue.value),(e=>{if(!e)return;Be.value="",Re.value="",ze.value=[],Ae.value=[];const l="relay"===oe.mode?$e.value:De.value,a=Z(oe.options)&&oe.options.length?oe.options:l;Ce=ee(a,"id"),Ge.value=Ce,Ee.value=Z(oe.defaultValue)&&oe.defaultValue.length?le(oe.defaultValue):[]})),(a,n)=>{var t,D;return o(),i(u,null,[r(d(I),{preset:"dialog",title:l.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:Ue.value,"onUpdate:show":n[5]||(n[5]=e=>Ue.value=e),"negative-text":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.28"))||"取消","positive-text":(null==(D=window.getLanguageByCode)?void 0:D.call(window,"10010.1.27"))||"确定","display-directive":"show","positive-button-props":{disabled:d(Pe)},onPositiveClick:el},{default:s((()=>{var a,t,k,b,I,N,$,D,M;return[e("div",ie,["create"===l.mode?(o(),i("div",ue,[re,r(d(C),{clearable:"",placeholder:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.35"))||"取个群名称方便后续搜索",value:Re.value,"onUpdate:value":n[0]||(n[0]=e=>Re.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):c("v-if",!0),e("div",de,[e("div",se,[r(d(C),{placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.36"))||"搜索",clearable:"",value:Be.value,"onUpdate:value":[n[1]||(n[1]=e=>Be.value=e),d(Te)],valueModifiers:{trim:!0}},{prefix:s((()=>[r(d(_),{component:d(z)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),Be.value||"remove"===l.mode?c("v-if",!0):(o(),i("div",ce,[0===ze.value.length?(o(),v(d(x),{key:0,justify:"space-around","wrap-item":!1},{default:s((()=>[(o(),i(u,null,p(_e,(l=>r(d(x),{vertical:"",align:"center","wrap-item":!1,key:l.key,onClick:()=>function(e){switch(Be.value="",ze.value=[e],e.key){case"single":Ge.value=De.value;break;case"group":Ge.value=Me.value;break;case"org":Ge.value=xe.map((e=>({id:e.orgId,name:e.orgName})))}}(l)},{default:s((()=>[r(d(L),{tertiary:""},{icon:s((()=>["org"===l.key?(o(),i("i",ve)):(o(),v(d(_),{key:1,component:"single"===l.key?d(A):d(G)},null,8,["component"]))])),_:2},1024),e("span",pe,g(l.label),1)])),_:2},1032,["onClick"]))),64))])),_:1})):c("v-if",!0),ze.value.length>0?(o(),i("div",ge,[r(d(L),{text:"",onClick:We},{icon:s((()=>[r(d(_),{component:d(T)},null,8,["component"])])),_:1}),e("h4",null,g(null==(k=d(Y)(ze.value))?void 0:k.label),1)])):c("v-if",!0),ze.value.length>0&&"org"===(null==(b=d(Y)(ze.value))?void 0:b.key)&&Ae.value.length>0?(o(),v(d(j),{key:2,separator:">"},{default:s((()=>[(o(!0),i(u,null,p(Ae.value,(e=>(o(),v(d(S),{key:e.id,onClick:l=>Xe(e,"breadcrumb")},{default:s((()=>[f(g(e.name),1)])),_:2},1032,["onClick"])))),128))])),_:1})):c("v-if",!0)])),e("div",fe,[d(Ge).length>0?(o(),i(u,{key:0},[m(r(d(B),{label:(null==(I=window.getLanguageByCode)?void 0:I.call(window,"10010.1.37"))||"全选",checked:d(qe),"onUpdate:checked":n[2]||(n[2]=e=>h(qe)?qe.value=e:null)},null,8,["checked"]),[[y,d(Je)]]),"org"===d(He)&&1===ze.value.length?(o(),i("div",me,[(o(!0),i(u,null,p(d(Ge),(l=>(o(),v(d(x),{"wrap-item":!1,align:"center",justify:"space-between",key:l.Id,onClick:e=>Xe(l)},{default:s((()=>[e("span",null,g(l.name),1),r(d(_),{size:"16",component:d(V)},null,8,["component"])])),_:2},1032,["onClick"])))),128))])):(o(),v(d(U),{key:1,ref_key:"listRef",ref:Se,value:d(Fe),"onUpdate:value":n[3]||(n[3]=e=>h(Fe)?Fe.value=e:null)},{default:s((()=>[(o(!0),i(u,null,p(d(Ge),(l=>(o(),v(d(B),{key:l.id,value:l.id,disabled:Qe(l.id),onClick:()=>async function(e){const l=d(He);if(l&&"relay"!==oe.mode&&"group"===l&&1===ze.value.length)try{ze.value.push({key:l,label:e.name});const a=await P({id:e.id});Ge.value=Z(a)?a:[]}catch(e){console.log("error ==>",e)}}(l)},{default:s((()=>[r(d(x),{align:"center","wrap-item":!1,wrap:!1},{default:s((()=>[r(d(E),{src:l.avatar,round:"",size:32},null,8,["src"]),e("span",he,g(l.name),1),l.total?(o(),i("span",ye," ("+g(l.total)+"人) ",1)):c("v-if",!0),1==l.type&&l.children.length>0?(o(),v(d(L),{key:1,type:"primary",text:"",disabled:Ye(l),style:{"margin-left":"auto"},onClick:w((e=>Xe(l)),["stop"])},{default:s((()=>[f(" 下级 ")])),_:2},1032,["disabled","onClick"])):c("v-if",!0)])),_:2},1024)])),_:2},1032,["value","disabled","onClick"])))),128))])),_:1},8,["value"]))],64)):(o(),i("div",we,(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.38"))||"找不到相关结果"))])]),e("div",ke,[e("span",null,((null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.39"))||"已选择")+g(d(Oe).length)+((null==(D=window.getLanguageByCode)?void 0:D.call(window,"10010.1.40"))||"人"),1),e("div",be,[(o(!0),i(u,null,p(Ee.value,(e=>(o(),v(d(R),{key:e.id,bordered:!1,closable:"relay"===l.mode||e.id!==d(Le).userInfo.id,disabled:d(Ve).includes(e.id),onClose:()=>{return l=e.id,void W(Ee.value,(e=>e.id===l));var l}},{avatar:s((()=>[r(d(E),{round:"",src:e.avatar},null,8,["src"])])),default:s((()=>[f(" "+g(e.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))]),"relay"===l.mode?(o(),i("div",Ie,[r(d(C),{clearable:"",value:Ne.value,"onUpdate:value":n[4]||(n[4]=e=>Ne.value=e),type:"textarea",placeholder:(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.41"))||"留言",autosize:{minRows:2,maxRows:2}},null,8,["value"])])):c("v-if",!0)])])])]})),_:1},8,["title","show","positive-button-props"]),e("span",{class:k(["btn-wrapper",{disabled:l.disabled}]),onClick:n[6]||(n[6]=e=>Ue.value=!0)},[b(a.$slots,"trigger",{},(()=>[r(d(N),{"show-arrow":!1,placement:"bottom"},{trigger:s((()=>[r(d(L),{color:"#ffffff4D",class:"add-btn"},{icon:s((()=>[r(d(_),{component:d($),color:"#fff"},null,8,["component"])])),_:1})])),default:s((()=>[f(" "+g(l.title),1)])),_:1})]))],2)],64)}}});export{Ce as default};
|
1
|
+
import{createElementVNode as e,defineComponent as l,ref as a,computed as n,watch as o,openBlock as t,createElementBlock as i,Fragment as r,createVNode as u,unref as s,withCtx as d,createCommentVNode as c,createBlock as v,renderList as p,toDisplayString as f,createTextVNode as g,withDirectives as m,isRef as h,vShow as y,normalizeClass as w,withModifiers as k,renderSlot as b}from"vue";import{NModal as I,NInput as C,NIcon as _,NSpace as x,NButton as L,NBreadcrumb as j,NBreadcrumbItem as S,NCheckbox as B,NCheckboxGroup as U,NAvatar as R,NTag as E,NTooltip as N}from"naive-ui";import{SearchOutline as z,PersonOutline as A,PeopleOutline as D,ChevronBackOutline as G,ChevronForwardOutline as T,AddOutline as V}from"@vicons/ionicons5";import{useData as $}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as M}from"../constants/index.js";import{getOrgUserTreeApi as O,groupUserApi as P,groupLeaveApi as q,groupJoinApi as F,groupCreateApi as H}from"../api/index.js";import{listSort as J,isDoctorRole as K,getRoleName as Q}from"../utils/index.js";import{union as W,unionBy as X,remove as Y,intersection as Z,last as ee,isArray as le,uniqBy as ae,cloneDeep as ne,trim as oe}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as te}from"../hooks/useSearchUserList.js";var ie,re;const ue={class:"iho-chat-dialog__content iho-chat-add-wrapper"},se={key:0,class:"input-box"},de=e("span",null,(null==(ie=window.getLanguageByCode)?void 0:ie.call(window,"10010.1.34"))||"群名称:",-1),ce={class:"transfer-box"},ve={class:"transfer-box__left"},pe={key:0,class:"nav-wrapper"},fe={key:0,class:"chat--iconfont chat--icon-map-site"},ge={style:{"font-size":"12px"}},me={key:1,class:"header"},he={class:"user-list-box"},ye={key:0,class:"org-list"},we={class:"seach-box"},ke={class:"ellipsis"},be={key:0,style:{"font-size":"12px",color:"#666","margin-right":"10px"}},Ie={key:1,class:"no-data"},Ce={class:"transfer-box__right"},_e={class:"checked-tag-box"},xe={class:"seach-box"},Le={class:"ellipsis"},je={key:0,class:"input-wrapper"};var Se=l({__name:"ChatAdd",props:{title:{type:String,default:(null==(re=window.getLanguageByCode)?void 0:re.call(window,"10010.1.42"))||"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["comfirm"],setup(l,{emit:ie}){const re=l;let Se=[];const Be=[{key:"single",label:"按好友选"},{key:"group",label:"按群聊选"},{key:"org",label:"按架构选"}];let Ue=[];const{state:Re,setCurrentSessionItem:Ee}=$(),Ne=a(),ze=a(""),Ae=a(!1),De=a([]),Ge=a(""),Te=a(""),Ve=a([]),$e=a([]),{userList:Me,handleInput:Oe}=te({wrapperRef:Ne,keywordRef:ze,before:()=>{Ve.value.length>0||(Me.value=Se)}}),Pe=n((()=>"relay"===re.mode?[]:W(re.disabledIds,[Re.userInfo.id]))),qe=n((()=>{var e;return(null==(e=Re.sessionList)?void 0:e.length)?J(Re.sessionList).map((e=>({id:e.receiver,name:e.name,avatar:e.avatar,chatType:e.chatType,roleInfo:e.roleInfo||""}))):[]})),Fe=n((()=>qe.value.filter((e=>e.chatType===M.SINGLE)))),He=n((()=>qe.value.filter((e=>e.chatType===M.GROUP)))),Je=n((()=>De.value.length?De.value.map((e=>e.id)):[])),Ke=n((()=>"create"===re.mode?Je.value.length<3:Je.value.length<1)),Qe=n({get:()=>We.value.filter((e=>!el(e))).length===Me.value.filter((e=>!el(e.id))).length,set(e){const l=[];if(Me.value.forEach((e=>{var a;if(1==e.type&&(null==(a=e.children)?void 0:a.length)){const a=ol(e.children||[]).filter((e=>!el(e.id)));l.push(...a)}else el(e.id)||l.push(e)})),e)De.value=X(De.value,l,"id");else{const e=l.map((e=>e.id));Y(De.value,(l=>e.includes(l.id)))}}}),We=n({get(){var e,l,a;return null!=(a=null==(l=null==(e=Me.value)?void 0:e.filter((e=>{var l;if(1==e.type&&(null==(l=e.children)?void 0:l.length)){const l=ol(e.children||[]).map((e=>e.id)).filter((e=>!el(e)));return Z(l,Je.value).length===l.length}return Je.value.includes(e.id)})))?void 0:l.map((e=>e.id)))?a:[]},set(e){Me.value.forEach((l=>{var a;const n=[];1==l.type&&(null==(a=l.children)?void 0:a.length)?n.push(...ol(l.children||[]).filter((e=>!el(e.id)))):n.push(l),e.includes(l.id)?De.value=X(De.value,n,"id"):Y(De.value,(e=>n.some((l=>l.id===e.id))))}))}}),Xe=n((()=>{var e;return Ve.value.length>0?null==(e=ee(Ve.value))?void 0:e.key:""})),Ye=n((()=>!("relay"!==re.mode&&["group","org"].includes(Xe.value)&&1===Ve.value.length)));function Ze(e){e.forEach((e=>{var l;1==e.type&&(null==(l=e.children)?void 0:l.length)?(e.total=ol(e.children).length,Ze(e.children)):2==e.type&&(e.total=0)}))}function el(e){var l,a;return"group"===Xe.value?"relay"!==re.mode&&(1===Ve.value.length||(null==(l=Pe.value)?void 0:l.includes(e))):null==(a=Pe.value)?void 0:a.includes(e)}function ll(){Ve.value.length>1?"group"===Xe.value?Me.value=He.value:"org"===Xe.value&&(Me.value=Ue.map((e=>({id:e.orgId,name:e.orgName}))),$e.value=[]):Me.value=Se,Ve.value.pop()}function al(e,l){const{id:a,children:n=[],type:o}=e;if("breadcrumb"!==l||ee($e.value).id!==a)if(o){const l=$e.value.findIndex((e=>e.id===a));l>-1?$e.value=$e.value.slice(0,l+1):$e.value.push(e),Me.value=n}else{const n=Ue.find((e=>e.orgId===a));$e.value=[e],Me.value=n.userList||[],l||Ve.value.push({key:Xe.value,label:n.orgName})}}function nl(e){const{children:l=[]}=e;if(!l.length)return!0;const a=ol(l).map((e=>e.id)).filter((e=>!Pe.value.includes(e)));return Z(a,Je.value).length===a.length}function ol(e){const l=[];return e.forEach((e=>{var a;1==e.type&&(null==(a=e.children)?void 0:a.length)?l.push(...ol(e.children)):2==e.type&&l.push(e)})),l}async function tl(){const e=s(Je);switch(re.mode){case"create":await H({creator:Re.userInfo.id,memberIdSet:e,name:oe(Ge.value),orgId:Re.orgId});break;case"join":if(await F({groupId:Re.currentSessionItem.receiver,operator:Re.userInfo.id,memberIdSet:e}),!Re.currentSessionItem.defaultName){const e=De.value.map((e=>e.name)).join(",");Ee({name:`${Re.currentSessionItem.name},${e}`})}Re.currentGroupUser.push(...Me.value.filter((l=>e.includes(l.id))));break;case"remove":if(await q({dissolution:!1,groupId:Re.currentSessionItem.receiver,operator:Re.userInfo.id,memberIdSet:e}),!Re.currentSessionItem.defaultName){const e=De.value.map((e=>e.name)).join(","),l=new RegExp(e,"g");Ee({name:Re.currentSessionItem.name.replace(l,"")})}Y(Re.currentGroupUser,(l=>e.includes(l.id)));break;default:ie("comfirm",{checkedIds:e,checkedOptions:De.value,remark:Te.value})}Ae.value=!1}return async function(){try{const e=await O();Ue=le(e)?e:[],Ue.forEach((e=>Ze(e.userList||[])))}catch(e){console.log("error ==>",e)}}(),o((()=>Ae.value),(e=>{if(!e)return;ze.value="",Ge.value="",Ve.value=[],$e.value=[];const l="relay"===re.mode?qe.value:Fe.value,a=le(re.options)&&re.options.length?re.options:l;Se=ae(a,"id"),Me.value=Se,De.value=le(re.defaultValue)&&re.defaultValue.length?ne(re.defaultValue):[]})),(a,n)=>{var o,$;return t(),i(r,null,[u(s(I),{preset:"dialog",title:l.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:Ae.value,"onUpdate:show":n[5]||(n[5]=e=>Ae.value=e),"negative-text":(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.28"))||"取消","positive-text":(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.27"))||"确定","display-directive":"show","positive-button-props":{disabled:s(Ke)},onPositiveClick:tl},{default:d((()=>{var a,o,b,I,N,V,$,M,O;return[e("div",ue,["create"===l.mode?(t(),i("div",se,[de,u(s(C),{clearable:"",placeholder:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.35"))||"取个群名称方便后续搜索",value:Ge.value,"onUpdate:value":n[0]||(n[0]=e=>Ge.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):c("v-if",!0),e("div",ce,[e("div",ve,[u(s(C),{placeholder:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.36"))||"搜索",clearable:"",value:ze.value,"onUpdate:value":[n[1]||(n[1]=e=>ze.value=e),s(Oe)],valueModifiers:{trim:!0}},{prefix:d((()=>[u(s(_),{component:s(z)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),ze.value||"remove"===l.mode?c("v-if",!0):(t(),i("div",pe,[0===Ve.value.length?(t(),v(s(x),{key:0,justify:"space-around","wrap-item":!1},{default:d((()=>[(t(),i(r,null,p(Be,(l=>u(s(x),{vertical:"",align:"center","wrap-item":!1,key:l.key,onClick:()=>function(e){switch(ze.value="",Ve.value=[e],e.key){case"single":Me.value=Fe.value;break;case"group":Me.value=He.value;break;case"org":Me.value=Ue.map((e=>({id:e.orgId,name:e.orgName})))}}(l)},{default:d((()=>[u(s(L),{tertiary:""},{icon:d((()=>["org"===l.key?(t(),i("i",fe)):(t(),v(s(_),{key:1,component:"single"===l.key?s(A):s(D)},null,8,["component"]))])),_:2},1024),e("span",ge,f(l.label),1)])),_:2},1032,["onClick"]))),64))])),_:1})):c("v-if",!0),Ve.value.length>0?(t(),i("div",me,[u(s(L),{text:"",onClick:ll},{icon:d((()=>[u(s(_),{component:s(G)},null,8,["component"])])),_:1}),e("h4",null,f(null==(b=s(ee)(Ve.value))?void 0:b.label),1)])):c("v-if",!0),Ve.value.length>0&&"org"===(null==(I=s(ee)(Ve.value))?void 0:I.key)&&$e.value.length>0?(t(),v(s(j),{key:2,separator:">"},{default:d((()=>[(t(!0),i(r,null,p($e.value,(e=>(t(),v(s(S),{key:e.id,onClick:l=>al(e,"breadcrumb")},{default:d((()=>[g(f(e.name),1)])),_:2},1032,["onClick"])))),128))])),_:1})):c("v-if",!0)])),e("div",he,[s(Me).length>0?(t(),i(r,{key:0},[m(u(s(B),{label:(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.37"))||"全选",checked:s(Qe),"onUpdate:checked":n[2]||(n[2]=e=>h(Qe)?Qe.value=e:null)},null,8,["checked"]),[[y,s(Ye)]]),"org"===s(Xe)&&1===Ve.value.length?(t(),i("div",ye,[(t(!0),i(r,null,p(s(Me),(l=>(t(),v(s(x),{"wrap-item":!1,align:"center",justify:"space-between",key:l.Id,onClick:e=>al(l)},{default:d((()=>[e("span",null,f(l.name),1),u(s(_),{size:"16",component:s(T)},null,8,["component"])])),_:2},1032,["onClick"])))),128))])):(t(),v(s(U),{key:1,ref_key:"listRef",ref:Ne,value:s(We),"onUpdate:value":n[3]||(n[3]=e=>h(We)?We.value=e:null)},{default:d((()=>[(t(!0),i(r,null,p(s(Me),(l=>(t(),v(s(B),{key:l.id,value:l.id,disabled:el(l.id),onClick:()=>async function(e){const l=s(Xe);if(l&&"relay"!==re.mode&&"group"===l&&1===Ve.value.length)try{Ve.value.push({key:l,label:e.name});const a=await P({id:e.id});Me.value=le(a)?a:[]}catch(e){console.log("error ==>",e)}}(l)},{default:d((()=>[u(s(x),{align:"center","wrap-item":!1,wrap:!1},{default:d((()=>[u(s(R),{src:l.avatar,round:"",size:32},null,8,["src"]),e("div",we,[e("span",ke,f(l.name),1),m(e("label",{class:w(["iho-chatRole",s(K)(l.roleInfo)?"isDoctor":""])},f(s(Q)(l.roleInfo)),3),[[y,s(Q)(l.roleInfo)]])]),l.total?(t(),i("span",be," ("+f(l.total)+"人) ",1)):c("v-if",!0),1==l.type&&l.children.length>0?(t(),v(s(L),{key:1,type:"primary",text:"",disabled:nl(l),style:{"margin-left":"auto"},onClick:k((e=>al(l)),["stop"])},{default:d((()=>[g(" 下级 ")])),_:2},1032,["disabled","onClick"])):c("v-if",!0)])),_:2},1024)])),_:2},1032,["value","disabled","onClick"])))),128))])),_:1},8,["value"]))],64)):(t(),i("div",Ie,(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.38"))||"找不到相关结果"))])]),e("div",Ce,[e("span",null,((null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.39"))||"已选择")+f(s(Je).length)+((null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.40"))||"人"),1),e("div",_e,[(t(!0),i(r,null,p(De.value,(a=>(t(),v(s(E),{key:a.id,bordered:!1,closable:"relay"===l.mode||a.id!==s(Re).userInfo.id,disabled:s(Pe).includes(a.id),onClose:()=>{return e=a.id,void Y(De.value,(l=>l.id===e));var e}},{avatar:d((()=>[u(s(R),{round:"",src:a.avatar},null,8,["src"])])),default:d((()=>[e("div",xe,[e("span",Le,f(a.name),1),m(e("label",{class:w(["iho-chatRole",s(K)(a.roleInfo)?"isDoctor":""])},f(s(Q)(a.roleInfo)),3),[[y,s(Q)(a.roleInfo)]])])])),_:2},1032,["closable","disabled","onClose"])))),128))]),"relay"===l.mode?(t(),i("div",je,[u(s(C),{clearable:"",value:Te.value,"onUpdate:value":n[4]||(n[4]=e=>Te.value=e),type:"textarea",placeholder:(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.41"))||"留言",autosize:{minRows:2,maxRows:2}},null,8,["value"])])):c("v-if",!0)])])])]})),_:1},8,["title","show","positive-button-props"]),e("span",{class:w(["btn-wrapper",{disabled:l.disabled}]),onClick:n[6]||(n[6]=e=>Ae.value=!0)},[b(a.$slots,"trigger",{},(()=>[u(s(N),{"show-arrow":!1,placement:"bottom"},{trigger:d((()=>[u(s(L),{color:"#ffffff4D",class:"add-btn"},{icon:d((()=>[u(s(_),{component:s(V),color:"#fff"},null,8,["component"])])),_:1})])),default:d((()=>[g(" "+f(l.title),1)])),_:1})]))],2)],64)}}});export{Se as default};
|
@@ -72,6 +72,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
72
72
|
}[];
|
73
73
|
resetAndSearch: () => void;
|
74
74
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
75
|
+
getFileDetails: (msg: string, type: string) => any;
|
75
76
|
getDetail: (item: AnyObject) => string;
|
76
77
|
getFileType: (item: AnyObject) => any;
|
77
78
|
NModal: any;
|
@@ -189,18 +190,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
189
190
|
name: any;
|
190
191
|
avatar: any;
|
191
192
|
chatType: any;
|
193
|
+
roleInfo: any;
|
192
194
|
}[]>;
|
193
195
|
friends: import("vue").ComputedRef<{
|
194
196
|
id: any;
|
195
197
|
name: any;
|
196
198
|
avatar: any;
|
197
199
|
chatType: any;
|
200
|
+
roleInfo: any;
|
198
201
|
}[]>;
|
199
202
|
groups: import("vue").ComputedRef<{
|
200
203
|
id: any;
|
201
204
|
name: any;
|
202
205
|
avatar: any;
|
203
206
|
chatType: any;
|
207
|
+
roleInfo: any;
|
204
208
|
}[]>;
|
205
209
|
checkedIds: import("vue").ComputedRef<any[]>;
|
206
210
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -238,6 +242,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
238
242
|
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<{}>>, {}>;
|
239
243
|
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<{}>>, {}>;
|
240
244
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
245
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
246
|
+
getRoleName: typeof import("../utils").getRoleName;
|
241
247
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
242
248
|
title: {
|
243
249
|
type: StringConstructor;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as
|
1
|
+
import{defineComponent as e,ref as t,computed as a,watch as o,openBlock as n,createBlock as i,unref as r,withCtx as s,withDirectives as l,createElementVNode as c,createVNode as d,createElementBlock as m,Fragment as u,renderList as p,toDisplayString as g,vShow as v,normalizeStyle as y,createTextVNode as w}from"vue";import{NModal as f,NImageGroup as h,NImage as k,NInput as C,NIcon as M,NTooltip as b}from"naive-ui";import{SearchOutline as _,OpenOutline as j,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as L}from"../api/index.js";import"../../../../shared/utils/index.js";import{useDebounceFn as S}from"@vueuse/core";import{format as T,isSameWeek as x,isSameMonth as A}from"date-fns";import{last as B}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as D}from"../../../../shared/hooks/useScrollLoading.js";import{useData as H}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{getFileSize as U,downloadFile as z}from"../utils/index.js";import"trtc-sdk-v5";import O from"./ChatAdd.vue.js";const E={class:"label"},N={class:"image-box"},$={class:"file-type"},F={class:"text"},P={class:"name"},R={class:"detail"},G={class:"opt-box"};var J=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const J=e,{cssVars:V,state:q,relayMessage:K}=H(),Q=t([]),W=t([]),X=t(),Y=t(),Z=t(),ee=S(oe,500),te={page:0,hasMore:!0,lastSendTime:T(new Date,"yyyy-MM-dd HH:mm:ss")};async function ae(){var e;try{if(!te.hasMore)return;te.page++;const t=await L({orgId:q.orgId,keyword:Z.value,endTime:"",startTime:"",lastSendTime:te.lastSendTime,memberIdSet:[],page:te.page,recordType:"image"===J.type?"IMAGE":"FILE",receiver:q.currentSessionItem.receiver,userId:q.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(te.hasMore=!1);let a=t||[];if(Array.isArray(t)&&t.length>0&&(a=t[0].recordList),te.lastSendTime=null==(e=B(a))?void 0:e.sendTime,"image"===J.type){const e=function(e){const t={};e.forEach((e=>{var a,o;const n=new Date(e.sendTime);let i=T(n,"yyyy年MM月");x(n,new Date)?i=(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.47"))||"本周":A(n,new Date)&&(i=(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.404"))||"本月"),t[i]||(t[i]=[]),t[i].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(a);Q.value=te.page>1?Q.value.concat(e):e}else{const e=a.map((e=>new Promise((async t=>{const a=await U(e.content.fileUrl);t({...e,size:a})})))),t=await Promise.all(e);W.value=te.page>1?W.value.concat(t):t}}catch(e){}}function oe(){Object.assign(te,{page:0,hasMore:!0,lastSendTime:T(new Date,"yyyy-MM-dd HH:mm:ss")}),ae()}D(X,(()=>{ae()})),D(Y,(()=>{ae()}));const ne=a((()=>{var e,t;return"image"===J.type?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.49"))||"聊天图片":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.50"))||"聊天文件"}));function ie(e,t){try{const a=JSON.parse(e);return a?a[t]:""}catch(t){return e||""}}function re(e){const{size:t,sendTime:a,senderName:o}=e;return`${t} · ${T(new Date(a),"yyyy/MM/dd HH:mm")} ${o}`}function se(e){var t;const a=(null==(t=e.content)?void 0:t.msg)||"",o=a.lastIndexOf(".");if(-1!==o){return a.charAt(o+1).toUpperCase()}return"?"}return o((()=>J.visible),(e=>{e?oe():Z.value=""})),(t,a)=>(n(),i(r(f),{preset:"dialog",title:r(ne),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:s((()=>{var t;return[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:X},[d(r(h),{"show-toolbar-tooltip":""},{default:s((()=>[(n(!0),m(u,null,p(Q.value,(e=>(n(),m("div",{class:"image-item",key:e.label},[c("span",E,g(e.label),1),c("div",N,[(n(!0),m(u,null,p(e.list,(e=>(n(),i(r(k),{key:e,width:"80",height:"80",src:ie(e,"fileUrl")},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[v,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:y(r(V))},[d(r(C),{clearable:"",placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.43"))||"搜索文件",value:Z.value,"onUpdate:value":a[0]||(a[0]=e=>Z.value=e),valueModifiers:{trim:!0},onInput:r(ee)},{prefix:s((()=>[d(r(M),{component:r(_)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:Y},[(n(!0),m(u,null,p(W.value,((e,t)=>{var a;return n(),m("div",{class:"file-item",key:t},[c("span",$,g(se(e)),1),c("div",F,[c("span",P,g(ie(e.content.msg,"fileName")),1),c("span",R,g(re(e)),1)]),c("div",G,[d(O,{title:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:t=>r(K)({contents:[e.content],checkedIds:t.checkedIds,remark:t.remark})},{trigger:s((()=>[d(r(b),{"show-arrow":!1},{trigger:s((()=>[d(r(M),{size:16,component:r(j)},null,8,["component"])])),default:s((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发")]})),_:1})])),_:2},1032,["onComfirm"]),d(r(b),{"show-arrow":!1},{trigger:s((()=>[d(r(M),{size:16,component:r(I),onClick:()=>r(z)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:s((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载")]})),_:2},1024)])])})),128))],512)],4),[[v,"image"!==e.type]])]})),_:1},8,["title"]))}});export{J as default};
|
@@ -181,18 +181,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
181
181
|
name: any;
|
182
182
|
avatar: any;
|
183
183
|
chatType: any;
|
184
|
+
roleInfo: any;
|
184
185
|
}[]>;
|
185
186
|
friends: import("vue").ComputedRef<{
|
186
187
|
id: any;
|
187
188
|
name: any;
|
188
189
|
avatar: any;
|
189
190
|
chatType: any;
|
191
|
+
roleInfo: any;
|
190
192
|
}[]>;
|
191
193
|
groups: import("vue").ComputedRef<{
|
192
194
|
id: any;
|
193
195
|
name: any;
|
194
196
|
avatar: any;
|
195
197
|
chatType: any;
|
198
|
+
roleInfo: any;
|
196
199
|
}[]>;
|
197
200
|
checkedIds: import("vue").ComputedRef<any[]>;
|
198
201
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -230,6 +233,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
230
233
|
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<{}>>, {}>;
|
231
234
|
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<{}>>, {}>;
|
232
235
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
236
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
237
|
+
getRoleName: typeof import("../utils").getRoleName;
|
233
238
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
234
239
|
title: {
|
235
240
|
type: StringConstructor;
|
@@ -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};
|
@@ -228,18 +228,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
228
228
|
name: any;
|
229
229
|
avatar: any;
|
230
230
|
chatType: any;
|
231
|
+
roleInfo: any;
|
231
232
|
}[]>;
|
232
233
|
friends: import("vue").ComputedRef<{
|
233
234
|
id: any;
|
234
235
|
name: any;
|
235
236
|
avatar: any;
|
236
237
|
chatType: any;
|
238
|
+
roleInfo: any;
|
237
239
|
}[]>;
|
238
240
|
groups: import("vue").ComputedRef<{
|
239
241
|
id: any;
|
240
242
|
name: any;
|
241
243
|
avatar: any;
|
242
244
|
chatType: any;
|
245
|
+
roleInfo: any;
|
243
246
|
}[]>;
|
244
247
|
checkedIds: import("vue").ComputedRef<any[]>;
|
245
248
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -277,6 +280,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
277
280
|
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
281
|
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
282
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
283
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
284
|
+
getRoleName: typeof import("../utils").getRoleName;
|
280
285
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
281
286
|
title: {
|
282
287
|
type: StringConstructor;
|
@@ -310,6 +315,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
310
315
|
mode: string;
|
311
316
|
disabledIds: string[];
|
312
317
|
}>;
|
318
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
319
|
+
getRoleName: typeof import("../utils").getRoleName;
|
313
320
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
314
321
|
ChatFile: import("vue").DefineComponent<{
|
315
322
|
type: {
|
@@ -382,6 +389,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
382
389
|
}[];
|
383
390
|
resetAndSearch: () => void;
|
384
391
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
392
|
+
getFileDetails: (msg: string, type: string) => any;
|
385
393
|
getDetail: (item: AnyObject) => string;
|
386
394
|
getFileType: (item: AnyObject) => any;
|
387
395
|
NModal: any;
|
@@ -499,18 +507,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
499
507
|
name: any;
|
500
508
|
avatar: any;
|
501
509
|
chatType: any;
|
510
|
+
roleInfo: any;
|
502
511
|
}[]>;
|
503
512
|
friends: import("vue").ComputedRef<{
|
504
513
|
id: any;
|
505
514
|
name: any;
|
506
515
|
avatar: any;
|
507
516
|
chatType: any;
|
517
|
+
roleInfo: any;
|
508
518
|
}[]>;
|
509
519
|
groups: import("vue").ComputedRef<{
|
510
520
|
id: any;
|
511
521
|
name: any;
|
512
522
|
avatar: any;
|
513
523
|
chatType: any;
|
524
|
+
roleInfo: any;
|
514
525
|
}[]>;
|
515
526
|
checkedIds: import("vue").ComputedRef<any[]>;
|
516
527
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -548,6 +559,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
548
559
|
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
560
|
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
561
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
562
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
563
|
+
getRoleName: typeof import("../utils").getRoleName;
|
551
564
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
552
565
|
title: {
|
553
566
|
type: StringConstructor;
|
@@ -636,6 +649,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
636
649
|
};
|
637
650
|
isForward: boolean;
|
638
651
|
};
|
652
|
+
cssVars: import("vue").ComputedRef<AnyObject>;
|
639
653
|
recordRef: import("vue").Ref<any>;
|
640
654
|
recordList: import("vue").Ref<AnyObject[]>;
|
641
655
|
keyword: import("vue").Ref<any>;
|
@@ -648,6 +662,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
648
662
|
hasMore: boolean;
|
649
663
|
lastSendTime: string;
|
650
664
|
};
|
665
|
+
getFileDetails: (msg: string, type: string) => any;
|
666
|
+
getDetail: (item: AnyObject) => string;
|
667
|
+
getFileType: (msg: string) => string;
|
651
668
|
handleSearch: () => Promise<void>;
|
652
669
|
resetAndSearch: () => void;
|
653
670
|
startDateDisabled: (ts: number) => boolean;
|
@@ -911,18 +928,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
911
928
|
name: any;
|
912
929
|
avatar: any;
|
913
930
|
chatType: any;
|
931
|
+
roleInfo: any;
|
914
932
|
}[]>;
|
915
933
|
friends: import("vue").ComputedRef<{
|
916
934
|
id: any;
|
917
935
|
name: any;
|
918
936
|
avatar: any;
|
919
937
|
chatType: any;
|
938
|
+
roleInfo: any;
|
920
939
|
}[]>;
|
921
940
|
groups: import("vue").ComputedRef<{
|
922
941
|
id: any;
|
923
942
|
name: any;
|
924
943
|
avatar: any;
|
925
944
|
chatType: any;
|
945
|
+
roleInfo: any;
|
926
946
|
}[]>;
|
927
947
|
checkedIds: import("vue").ComputedRef<any[]>;
|
928
948
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -960,6 +980,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
960
980
|
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
981
|
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
982
|
last: <T>(array: import("lodash").List<T> | null | undefined) => T | undefined;
|
983
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
984
|
+
getRoleName: typeof import("../utils").getRoleName;
|
963
985
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
964
986
|
title: {
|
965
987
|
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>;
|
@@ -490,18 +491,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
490
491
|
name: any;
|
491
492
|
avatar: any;
|
492
493
|
chatType: any;
|
494
|
+
roleInfo: any;
|
493
495
|
}[]>;
|
494
496
|
friends: import("vue").ComputedRef<{
|
495
497
|
id: any;
|
496
498
|
name: any;
|
497
499
|
avatar: any;
|
498
500
|
chatType: any;
|
501
|
+
roleInfo: any;
|
499
502
|
}[]>;
|
500
503
|
groups: import("vue").ComputedRef<{
|
501
504
|
id: any;
|
502
505
|
name: any;
|
503
506
|
avatar: any;
|
504
507
|
chatType: any;
|
508
|
+
roleInfo: any;
|
505
509
|
}[]>;
|
506
510
|
checkedIds: import("vue").ComputedRef<any[]>;
|
507
511
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
@@ -539,6 +543,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
539
543
|
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
544
|
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
545
|
last: <T_1>(array: import("lodash").List<T_1> | null | undefined) => T_1 | undefined;
|
546
|
+
isDoctorRole: typeof import("../utils").isDoctorRole;
|
547
|
+
getRoleName: typeof import("../utils").getRoleName;
|
542
548
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
543
549
|
title: {
|
544
550
|
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};
|
@@ -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;
|
@@ -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 n,createBlock as r,unref as s,withCtx as o,createVNode as i,toDisplayString as u,normalizeStyle as d,resolveDynamicComponent as c,createElementBlock as v,Fragment as m,renderList as p,withDirectives as f,createTextVNode as g,vShow as y}from"vue";import{NModal as h,NAvatar as w,NInputGroup as _,NInput as b,NSelect as T,NPopover as k,NTag as M,NIcon as j}from"naive-ui";import{SearchOutline as x}from"@vicons/ionicons5";import{useData as I}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as C}from"../constants/index.js";import{searchChatRecordApi as L}from"../api/index.js";import{transformMessage as A,formatTime as S}from"../utils/index.js";import{last as H}from"lodash-es";import"trtc-sdk-v5";import U from"../../../date-picker/index.js";import{useDebounceFn as B}from"@vueuse/core";import{format as D}from"date-fns";import"../../../../shared/utils/index.js";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as E}from"../../../../shared/hooks/useScrollLoading.js";import{emojis as z}from"../utils/emoji.js";var N,O;const G={class:"iho-chat-dialog__header"},R=e("span",{class:"left"},(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.65"))||"聊天记录",-1),$={class:"center"},J={class:"chat-record-box"},W={class:"msg-box"},F={class:"name-and-time"},P={class:"content"},V=["src"],q={class:"file-type"},K={class:"text"},Q={class:"name"},X={class:"detail"},Y=["src"],Z=["innerHTML"],ee={key:1,class:"no-data"},ae={class:"chat-record-box__filter"},le=e("span",{class:"filter-title"},(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.72"))||"添加筛选条件",-1),te={class:"filter-item"},ne=e("span",{class:"label"},"成员:",-1),re={class:"filter-item"},se=e("span",{class:"label"},"日期:",-1),oe={class:"time-target"},ie={class:"time-target__item"},ue=e("span",null,"开始:",-1),de={class:"tip"},ce={class:"time-target__item"},ve=e("span",null,"结束:",-1),me={class:"tip"};var pe=a({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(a){const N=a,O={color:"#fff",textColor:"#666"},{state:pe,cssVars:fe}=I(),ge=l(),ye=l([]),he=l(),we=l([]),_e=l(),be=l(),Te=B(Ce,500),ke={page:0,hasMore:!0,lastSendTime:D(new Date,"yyyy-MM-dd HH:mm:ss")};function Me(e,a){try{const l=JSON.parse(e);return l?l[a]:""}catch(a){return e||""}}function je(e){const{size:a,sendTime:l,senderName:t}=e;return`${D(new Date(l),"yyyy/MM/dd HH:mm")} ${t}`}function xe(e){const a=e.lastIndexOf(".");if(console.log("dotIndex",a),-1!==a){return e.charAt(a+1).toUpperCase()}return"?"}async function Ie(){var e;try{if(!ke.hasMore)return;ke.page++;const a=await L({orgId:pe.orgId,keyword:he.value,endTime:Se(),startTime:_e.value?_e.value+" 00:00:00":"",lastSendTime:ke.lastSendTime,memberIdSet:we.value,page:ke.page,recordType:"ALL",receiver:pe.currentSessionItem.receiver,userId:pe.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(ke.hasMore=!1);let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList.filter((e=>"WITHDRAWN"!==e.status))),ke.lastSendTime=null==(e=H(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t;let n="";if(e.content.chatMessageType===C.TEMPLATE)n=null==(t=null==(l=null==(a=e.content)?void 0:a.messageTemplate)?void 0:l.setting)?void 0:t.title;else n=A(e.content);e.__content=n})),ye.value=ke.page>1?ye.value.concat(l):l}catch(e){}}function Ce(){Object.assign(ke,{page:0,hasMore:!0,lastSendTime:Se()||D(new Date,"yyyy-MM-dd HH:mm:ss")}),Ie()}function Le(e){return!!be.value&&e>Date.parse(`${be.value} 23:59:59`)}function Ae(e){return!!_e.value&&e<Date.parse(_e.value)}function Se(){return be.value?be.value+" 23:59:59":""}function He(e){switch(e){case"member":we.value=[];break;case"start":_e.value=null;break;case"end":be.value=null}}function Ue(e){return i(m,null,[i("div",{style:"display: flex;align-items: center"},[i(w,{src:e.avatar,round:!0,size:"small"},null),i("span",{style:"margin-left: 10px"},[e.name])])])}return E(ge,(()=>{Ie()})),t([()=>we.value,()=>_e.value,()=>be.value],(()=>{N.visible&&Ce()}),{deep:!0}),t((()=>N.visible),(e=>{e?Ce():(he.value="",be.value=null,_e.value=null,we.value=[],ye.value=[])})),(a,l)=>(n(),r(s(h),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{header:o((()=>[e("div",G,[R,e("div",$,[i(s(w),{round:"",size:30,src:s(pe).currentSessionItem.avatar},null,8,["src"]),e("span",null,u(s(pe).currentSessionItem.name),1)])])])),default:o((()=>[e("div",{class:"iho-chat-dialog__content iho-chat-record-wrapper",style:d(s(fe))},[i(s(_),null,{default:o((()=>{var e;return[(n(),r(c((()=>[i(j,{component:x,size:18,color:"#6666"},null),we.value.length>0?i(M,{closable:!0,bordered:!1,color:O,onClose:()=>He("member")},{default:()=>{var e,a;return[g("成员:")," ",we.value.length>1?we.value.length+((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.40"))||"人"):null==(a=pe.currentGroupUser.find((e=>e.id===we.value[0])))?void 0:a.name]}}):null,_e.value?i(M,{closable:!0,bordered:!1,color:O,onClose:()=>He("start")},{default:()=>[g("起始时间: "),_e.value]}):null,be.value?i(M,{closable:!0,bordered:!1,color:O,onClose:()=>He("end")},{default:()=>[g("结束时间: "),be.value]}):null])))),i(s(b),{placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.36"))||"搜索",value:he.value,"onUpdate:value":l[0]||(l[0]=e=>he.value=e),valueModifiers:{trim:!0},onInput:s(Te)},null,8,["value","onInput"])]})),_:1}),e("div",J,[e("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:ge},[ye.value.length>0?(n(!0),v(m,{key:0},p(ye.value,(a=>(n(),v("div",{class:"content-item",key:a.id},[i(s(w),{round:"",size:38,src:a.senderAvatar},null,8,["src"]),e("div",W,[e("div",F,[e("span",null,u(a.senderName),1),e("span",null,u(s(S)(a.sendTime).recordTime),1)]),e("div",P,[a.content.chatMessageType===s(C).IMAGE?(n(),v("img",{key:0,src:Me(a.__content,"fileUrl")},null,8,V)):a.content.chatMessageType===s(C).FILE?(n(),v(m,{key:1},[e("span",q,u(xe(a.__content)),1),e("div",K,[e("span",Q,u(Me(a.__content,"fileName")),1),e("span",X,u(je(a)),1)])],64)):a.content.chatMessageType===s(C).EMOJI?(n(),v("img",{key:2,class:"emoji",src:s(z).findEmoji(a.__content)},null,8,Y)):(n(),v("p",{key:3,innerHTML:a.__content},null,8,Z))])])])))),128)):(n(),v("div",ee,"没有找到相关记录"))],512),e("div",ae,[le,e("div",te,[ne,i(s(T),{value:we.value,"onUpdate:value":l[1]||(l[1]=e=>we.value=e),multiple:"","max-tag-count":1,"render-label":Ue,options:s(pe).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),e("div",re,[se,e("div",oe,[i(s(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>{var a;return[e("div",ie,[ue,f(i(s(M),{bordered:!1,color:O,closable:"",onClose:l[2]||(l[2]=()=>He("start"))},{default:o((()=>[g(u(_e.value),1)])),_:1},512),[[y,_e.value]]),f(e("span",de,(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.76"))||"点击选择",512),[[y,!_e.value]])])]})),default:o((()=>[i(s(U),{"formatted-value":_e.value,"onUpdate:formatted-value":l[3]||(l[3]=e=>_e.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Le},null,8,["formatted-value"])])),_:1}),i(s(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>{var a;return[e("div",ce,[ve,f(i(s(M),{bordered:!1,color:O,closable:"",onClose:l[4]||(l[4]=()=>He("end"))},{default:o((()=>[g(u(be.value),1)])),_:1},512),[[y,be.value]]),f(e("span",me,(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.76"))||"点击选择",512),[[y,!be.value]])])]})),default:o((()=>[i(s(U),{"formatted-value":be.value,"onUpdate:formatted-value":l[5]||(l[5]=e=>be.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Ae},null,8,["formatted-value"])])),_:1})])])])])],4)])),_:1}))}});export{pe as default};
|