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