cnhis-design-vue 3.2.7-beta.24 → 3.2.7-beta.25
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +87 -87
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/iho-chat/index.d.ts +62 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +62 -1
- 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 +1 -0
- 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.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/MultipleVideo.vue.d.ts +1 -0
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
- package/es/components/iho-chat/src/hooks/useSession.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -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 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
|
+
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">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\r\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,
|
1
|
+
import{defineComponent as e,ref as o,computed as s,watch as r,nextTick as t,openBlock as a,createBlock as i,unref as l,withCtx as n,createVNode as u,createTextVNode as p,createElementVNode as f,normalizeStyle as c,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=o(),E=o(),G=o(!1),H=o(""),{state:$}=C(),{openSession:q}=R($),{userList:A,handleInput:B}=L({wrapperRef:D,keywordRef:H}),F=s((()=>!A.value.length&&!!(H.value||"").replace(/^\s+|\s+$/g,"")));return r((()=>G.value),(async e=>{var o;e&&(await t(),null==(o=E.value)||o.focus())})),(e,o)=>(a(),i(l(y),{show:G.value,"onUpdate:show":o[1]||(o[1]=e=>G.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:n((()=>[u(l(g),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:n((()=>[u(l(j),{component:l(x),color:"#ffffff80"},null,8,["component"])])),default:n((()=>[p(" 搜索联系人 ")])),_:1})])),default:n((()=>[f("div",{class:"popover-search",style:c(l(T))},[u(l(S),{ref_key:"inputRef",ref:E,size:"small",clearable:"",autofocus:"",value:H.value,"onUpdate:value":[o[0]||(o[0]=e=>H.value=e),l(B)]},{prefix:n((()=>[u(l(j),{color:"#ffffff80",component:l(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(l(A),(e=>(a(),m("div",{class:"user-item",key:e.id,onClick:()=>async function(e){G.value=!1;const o=await U({chatType:"SINGLE",receiver:e,sender:$.userInfo.id});q(o)}(e.id)},[u(l(_),{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(u(l(b),{config:{title:" ",content:"找不到相关的结果"},type:"5"},null,512),[[w,l(F)]])],512)],4)])),_:1},8,["show"]))}});export{T as default};
|
@@ -131,6 +131,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
131
131
|
NInput: any;
|
132
132
|
NCheckbox: any;
|
133
133
|
NCheckboxGroup: any;
|
134
|
+
NTooltip: any;
|
134
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<{}>>, {}>;
|
135
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<{}>>, {}>;
|
136
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{ref as e}from"vue";import{isArray as o}from"lodash-es";import{listUserApi as r}from"../api/index.js";import{useDebounceFn as t}from"@vueuse/core";import{useScrollLoading as a}from"./useScrollLoading.js";import{useState as s}from"./useState.js";import"date-fns";import"../utils/emoji.js";import"trtc-sdk-v5";function i({wrapperRef:i,keywordRef:n,before:
|
1
|
+
import{ref as e}from"vue";import{isArray as o}from"lodash-es";import{listUserApi as r}from"../api/index.js";import{useDebounceFn as t}from"@vueuse/core";import{useScrollLoading as a}from"./useScrollLoading.js";import{useState as s}from"./useState.js";import"date-fns";import"../utils/emoji.js";import"trtc-sdk-v5";function i({wrapperRef:i,keywordRef:n,before:p,after:u}){const l={page:0,hasMore:!0},{state:c}=s(),f=e([]),g=t((function(){Object.assign(l,{page:0,hasMore:!0}),m()}),300);async function m(){const e=(n.value||"").replace(/^\s+|\s+$/g,"");if(!e)return void(p?p():f.value=[]);if(!l.hasMore)return;l.page++,1==l.page&&(f.value=[]);const t=await r({orgId:c.orgId,keyword:e,page:l.page,pageSize:10});o(t.records)&&f.value.length<=+t.total&&(f.value=l.page>1?f.value.concat(t.records):t.records,null==u||u(),f.value.length>=+t.total&&(l.hasMore=!1,console.log("没有更多消息了")))}return a(i,(()=>{m()})),{userList:f,handleInput:g}}export{i as useSearchUserList};
|
@@ -1 +1 @@
|
|
1
|
-
import{computed as e}from"vue";import{simplifyMessage as s}from"../utils/index.js";import{cloneDeep as t,isArray as n,uniqBy as i}from"lodash-es";import{CHAT_TYPE as o}from"../constants/index.js";import{groupUserApi as r}from"../api/index.js";function
|
1
|
+
import{computed as e}from"vue";import{simplifyMessage as s}from"../utils/index.js";import{cloneDeep as t,isArray as n,uniqBy as i}from"lodash-es";import{CHAT_TYPE as o}from"../constants/index.js";import{groupUserApi as r}from"../api/index.js";function a(e){return e.chatType===o.GROUP}function c(e){const{lastMessage:t,lastSenderName:n=""}=e,i=s(t)||"";return a(e)&&n?n+": "+i:i}function u(s){const u=e((()=>s.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),m=e((()=>a(s.currentSessionItem)));function l(e){Object.assign(s.currentSessionItem,e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:Reflect.has(e,"lastMessage")?c({...e,chatType:e.chatType||s.currentSessionItem.chatType}):s.currentSessionItem.lastMessageContent}),s.isChangeSession=!0,s.id!==s.currentSessionItem.id&&(s.msgList=[],s.id=s.currentSessionItem.id)}return{openSession:async function(e){const i=s.currentSessionItem.sessionKey;if(l(e),i!==s.currentSessionItem.sessionKey)if(m.value){const t=await r({id:e.receiver});s.currentGroupUser=n(t)?t:[]}else s.currentGroupUser=[s.userInfo,{...t(e),id:e.receiver}]},closeSession:function(){if(!s.id)return null;const{currentSessionItem:e}=s;return s.currentSessionItem={},s.msgList=[],s.id="",e},getCurrentSession:function(){return s.id?s.currentSessionItem:null},setCurrentSessionItem:l,setUpdateSessionItem:function(e){const n=s.sessionList.find((s=>s.sessionKey===e.sessionKey)),i={...e,lastMessageContent:c({...e,chatType:e.chatType||(null==n?void 0:n.chatType)})};s.updateSessionItem=n?{...t(n),...i}:i,s.isUpdateSession=!0},unreadTotal:u,setSessionList:function(e){s.sessionList=t(i(e,"id")),s.sessionList.forEach((e=>{Object.assign(e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:c(e)}),e.chatType!==o.GROUP||e.name||r({id:e.receiver}).then((s=>{n(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))},isGroupChat:m}}export{u as useSession};
|