cnhis-design-vue 3.2.8-release.0 → 3.2.8-release.2
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/README.md +87 -87
- package/es/components/ai-chat/index.d.ts +75 -0
- package/es/components/ai-chat/index.js +1 -0
- package/es/components/ai-chat/src/Index.vue.d.ts +77 -0
- package/es/components/ai-chat/src/Index.vue.js +1 -0
- package/es/components/ai-chat/src/Index.vue2.js +1 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +14 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -0
- package/es/components/ai-chat/src/components/ChatMain.d.ts +8 -0
- package/es/components/ai-chat/src/components/ChatMain.js +1 -0
- package/es/components/ai-chat/src/types/index.d.ts +20 -0
- package/es/components/ai-chat/src/types/index.js +1 -0
- package/es/components/ai-chat/style/index.css +1 -0
- package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/button-print/index.d.ts +38 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +38 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +17 -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/src/utils/print.js +1 -1
- package/es/components/button-print/style/index.css +1 -1
- package/es/components/calendar/src/Calendar.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +3 -2
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +10 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +10 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +21 -2
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +10 -1
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/utils/index.d.ts +1 -1
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/form-config/index.d.ts +6 -4
- package/es/components/form-config/src/FormConfig.vue.d.ts +6 -4
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +3 -2
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -2
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-render/index.d.ts +3 -2
- package/es/components/form-render/src/FormRender.vue.d.ts +2 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +3 -2
- package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/guide/src/renderer.js +1 -1
- package/es/components/iho-chat/index.d.ts +3 -0
- package/es/components/iho-chat/src/Index.vue.d.ts +3 -0
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +4 -0
- 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.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +6 -4
- package/es/components/info-header/src/InfoHeader.vue.d.ts +6 -4
- package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +3 -2
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +3 -2
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +3 -2
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +3 -2
- package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
- package/es/components/step-notice/src/StepNotice.vue2.js +1 -1
- package/es/components/step-notice/src/hooks/useTheme.js +1 -1
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
- package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
- package/es/shared/assets/img/ai__avatar.png.js +1 -0
- 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/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/hooks/index.d.ts +1 -0
- package/es/shared/hooks/index.js +1 -1
- package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
- package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
- package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -1
- package/es/shared/hooks/useFormRequest/index.js +1 -1
- package/es/shared/hooks/useLevelSearchCascader.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
- /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.d.ts +0 -0
- /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.js +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as s,watch as o,openBlock as a,createBlock as i,unref as n,withCtx as r,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as p,Fragment as d,renderList as u,toDisplayString as y,vShow as f,normalizeStyle as h}from"vue";import{NModal as v,NImageGroup as g,NImage as w,NInput as b,NIcon as k}from"naive-ui";import{SearchOutline as M,OpenOutline as T,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as S}from"../api/index.js";import{
|
1
|
+
import{defineComponent as e,ref as t,computed as s,watch as o,openBlock as a,createBlock as i,unref as n,withCtx as r,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as p,Fragment as d,renderList as u,toDisplayString as y,vShow as f,normalizeStyle as h}from"vue";import{NModal as v,NImageGroup as g,NImage as w,NInput as b,NIcon as k}from"naive-ui";import{SearchOutline as M,OpenOutline as T,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as S}from"../api/index.js";import{useTheme as _}from"../../../../shared/hooks/useTheme.js";import{useDebounceFn as x}from"@vueuse/core";import{format as j,isSameWeek as A,isSameMonth as H}from"date-fns";import{last as D}from"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";import{useState as z}from"../hooks/useState.js";import{getFileSize as L,downloadFile as U}from"../utils/index.js";import"trtc-sdk-v5";const E={class:"label"},O={class:"image-box"},$={class:"file-type"},F={class:"text"},K={class:"name"},P={class:"detail"},R={class:"opt-box"};var B=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const B=e,G=_(),{state:N}=z(),q=t([]),J=t([]),Q=t(),V=t(),W=t(),X=x(ee,500),Y={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")};async function Z(){var e;try{if(!Y.hasMore)return;Y.page++;const t=await S({orgId:N.orgId,keyword:W.value,endTime:"",startTime:"",lastSendTime:Y.lastSendTime,memberIdSet:[],page:Y.page,recordType:"image"===B.type?"IMAGE":"FILE",sessionKey:N.currentSessionItem.sessionKey,userId:N.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(Y.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let s=t||[];if(Array.isArray(t)&&t.length>0&&(s=t[0].recordList),Y.lastSendTime=null==(e=D(s))?void 0:e.sendTime,"image"===B.type){const e=function(e){const t={};e.forEach((e=>{const s=new Date(e.sendTime);let o=j(s,"yyyy年MM月");A(s,new Date)?o="本周":H(s,new Date)&&(o="本月"),t[o]||(t[o]=[]),t[o].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(s);q.value=Y.page>1?q.value.concat(e):e}else{const e=s.map((e=>new Promise((async t=>{const s=await L(e.content.fileUrl);t({...e,size:s})})))),t=await Promise.all(e);J.value=Y.page>1?J.value.concat(t):t}}catch(e){console.log(e)}}function ee(){Object.assign(Y,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),Z()}C(Q,(()=>{Z()})),C(V,(()=>{Z()}));const te=s((()=>"image"===B.type?"聊天图片":"聊天文件"));function se(e){const{size:t,sendTime:s,senderName:o}=e;return`${t} · ${j(new Date(s),"yyyy/MM/dd HH:mm")} ${o}`}function oe(e){var t;const s=(null==(t=e.content)?void 0:t.msg)||"",o=s.lastIndexOf(".");if(-1!==o){return s.charAt(o+1).toUpperCase()}return"?"}return o((()=>B.visible),(e=>{e?ee():W.value=""})),(t,s)=>(a(),i(n(v),{preset:"dialog",title:n(te),"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{default:r((()=>[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:Q},[m(n(g),{"show-toolbar-tooltip":""},{default:r((()=>[(a(!0),p(d,null,u(q.value,(e=>(a(),p("div",{class:"image-item",key:e.label},[c("span",E,y(e.label),1),c("div",O,[(a(!0),p(d,null,u(e.list,(e=>(a(),i(n(w),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[f,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:h(n(G))},[m(n(b),{clearable:"",placeholder:"搜索文件",value:W.value,"onUpdate:value":s[0]||(s[0]=e=>W.value=e),valueModifiers:{trim:!0},onInput:n(X)},{prefix:r((()=>[m(n(k),{component:n(M)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:V},[(a(!0),p(d,null,u(J.value,((e,t)=>(a(),p("div",{class:"file-item",key:t},[c("span",$,y(oe(e)),1),c("div",F,[c("span",K,y(e.content.msg),1),c("span",P,y(se(e)),1)]),c("div",R,[m(n(k),{size:16,component:n(T)},null,8,["component"]),m(n(k),{size:16,component:n(I),onClick:()=>n(U)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])])))),128))],512)],4),[[f,"image"!==e.type]])])),_:1},8,["title"]))}});export{B as default};
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { CSSProperties } from 'vue';
|
2
|
+
import { ImageRenderToolbarProps } from 'naive-ui';
|
2
3
|
import { AnyObject } from '../../../../shared/types';
|
3
4
|
import { simplifyMessage, isAudioOrVideoMessage, getAVTime } from '../utils';
|
4
5
|
import { MESSAGE_TYPE } from '../constants';
|
@@ -21,6 +22,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
21
22
|
'--c-tip-top': string;
|
22
23
|
'--c-tip-gap': string;
|
23
24
|
}>;
|
25
|
+
renderToolbar: ({ nodes }: ImageRenderToolbarProps) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
26
|
+
[key: string]: any;
|
27
|
+
}>[];
|
24
28
|
getHistoryRecord: () => Promise<void>;
|
25
29
|
handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
|
26
30
|
setMenuPosition: (event: MouseEvent) => Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as n,watch as s,openBlock 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 l,createVNode as c,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as v,createBlock as f,createElementVNode as g,withModifiers as y,nextTick as h}from"vue";import{NImageGroup as T,NAvatar as M,NImage as k,NIcon as _,NSpace as x,NButtonGroup as S,NButton as w,NTooltip as I}from"naive-ui";import{format as C}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 b}from"../hooks/useSession.js";import{MESSAGE_TYPE as z}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as A,simplifyMessage as H,getAVTime as O,downloadFile as D}from"../utils/index.js";import{first as R,last as N}from"lodash-es";import P from"./PersonProfile.vue.js";import q from"./MessageTemplate.vue.js";import{emojis as B}from"../utils/emoji.js";import U from"./ContextMenu.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as F,VideocamOutline as G,DocumentSharp as J,ChatbubbleEllipsesOutline as K,EllipsisHorizontal as X,ArrowDownSharp as Y}from"@vicons/ionicons5";import{useScrollLoading as $}from"../../../../shared/hooks/useScrollLoading.js";const Q={key:0,class:"time"},V={key:2,class:"message-box"},W={key:0,class:"content-box"},Z={class:"name-box"},ee=["data-time"],te=["onContextmenu"],ne={key:0,class:"reference-content"},se=["innerHTML"],oe=["innerHTML"],ie=["innerHTML"],ae=["src"],re={style:{"margin-left":"8px"}},le={class:"size"};var ce=e({__name:"ChatMain",setup(e){const ce=t(),{state:ue,setMsgList:me}=E(),{setCurrentSessionItem:pe,isGroupChat:de}=b(ue),ve=t(),fe=t(!1),ge=t({left:0,top:0}),ye=t(),he={page:0,hasMore:!0,lastSendTime:C(new Date,"yyyy-MM-dd HH:mm:ss")},Te=n((()=>({"--c-tip-top":de.value?"1px":"-20px","--c-tip-gap":de.value?"10px":"0px"})));function Me({nodes:e}){var t,n;const{_ctx:s}=null==(t=e.download)?void 0:t.children,o=s?null==(n=null==s?void 0:s.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,c(I,null,{trigger:()=>c(_,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:Y,onClick:()=>o&&D(o,"img")},null),default:()=>"下载"}),e.close]}async function ke(){try{if(!he.hasMore)return;he.page++;const e=await L({sessionKey:ue.currentSessionItem.sessionKey,page:he.page,lastSendTime:he.lastSendTime});if(!Array.isArray(e)||0===e.length)return he.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=R(e).id;he.lastSendTime=N(e).sendTime,me(he.page>1?[...e,...ue.msgList]:e),1===he.page&&ue.currentSessionItem.unreadNum&&(await j({chatType:ue.currentSessionItem.chatType,messageIdSet:[t],receiver:ue.userInfo.id,sender:ue.currentSessionItem.receiver}),pe({unreadNum:0}))}catch(e){console.log(e)}}async function _e(e,t){ye.value=t,async function(e){var t,n,s,o,i,a;fe.value=!0,await h();const{clientX:r,clientY:l}=e,{width:c=0,height:u=0,left:m=0,top:p=0}=(null==(t=ce.value)?void 0:t.getBoundingClientRect())||{},d=null!=(o=null==(s=null==(n=ve.value)?void 0:n.$el)?void 0:s.getBoundingClientRect().height)?o:220,v=null!=(a=null==(i=ce.value)?void 0:i.scrollTop)?a:0,f=5,g={};r<=m+c/2?g.left=r-m+f+"px":g.right=m+c-r-f+"px";l-p<d/2?g.top=v+f+"px":p+u-l<=d/2?g.bottom=Math.abs(v)+f+"px":g.top=v+l-p-d/2+"px";ge.value=g}(e)}function xe(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==z.TEMPLATE||!!n}function Se(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===z.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 we(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===z.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function Ie(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=ue.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function Ce(e){ue.currentReferenceMsg=e,Object.assign(ue.currentReferenceMsg,{chatType:ue.currentSessionItem.chatType,receiver:ue.currentSessionItem.receiver,receiverAvatar:ue.currentSessionItem.avatar,receiverName:ue.currentSessionItem.name})}function Le(e,t){"reply"===e&&Ce(t)}return $(ce,(()=>{ke()}),"top",(()=>{fe.value=!1})),s((()=>ue.id),(e=>{e&&(ue.currentReferenceMsg=null,Object.assign(he,{page:0,hasMore:!0,lastSendTime:C(new Date,"yyyy-MM-dd HH:mm:ss")}),ke())}),{immediate:!0}),s((()=>ue.isAppendMsg),(e=>{e&&(me([...ue.msgList,ue.currentMsg]),ue.isAppendMsg=!1,async function(){var e,t,n;const s=null!=(t=null==(e=ce.value)?void 0:e.scrollHeight)?t:0;null==(n=ce.value)||n.scrollTo({top:s,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(o(),i("div",{class:a(["chat-main",{"home-bg":!r(ue).id}]),ref_key:"chatMainRef",ref:ce,style:l(r(Te))},[c(r(T),{"show-toolbar-tooltip":"","render-toolbar":Me},{default:u((()=>[(o(!0),i(m,null,p(r(ue).msgList,((e,t)=>(o(),i(m,{key:e.id},[xe(e)?(o(),i("div",{key:0,class:a(["message-item",{"message-item--mine":e.sender==r(ue).userInfo.id}])},[Ie(e,t)?(o(),i("p",Q,d(e.__sendTime),1)):v("v-if",!0),Se(e,"system")?(o(),f(q,{key:1,data:e},null,8,["data"])):(o(),i("div",V,[c(P,{"user-id":e.sender,placement:e.sender==r(ue).userInfo.id?"left":"right"},{trigger:u((()=>[c(r(M),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(o(),i("div",W,[g("div",Z,[g("span",{class:"name","data-time":e.__time},d(r(de)?e.senderName:""),9,ee)]),g("div",{class:a(["content",{emoji:e.content.chatMessageType===r(z).EMOJI,template:e.content.chatMessageType===r(z).TEMPLATE,"template--3":we(e.content),"audio-video":r(A)(e.content),file:e.content.chatMessageType===r(z).FILE}]),onContextmenu:y((t=>_e(t,e.id)),["prevent"])},[e.content.chatMessageType===r(z).TEXT?(o(),i(m,{key:0},[e.content.referenceContent?(o(),i("div",ne,[g("span",null,d(e.content.referenceContent.senderName)+":",1),g("pre",{innerHTML:r(H)(e.content.referenceContent.content)},null,8,se)])):v("v-if",!0),g("pre",{innerHTML:e.__content},null,8,oe)],64)):v("v-if",!0),e.content.chatMessageType===r(z).BLEND?(o(),i("pre",{key:1,innerHTML:e.__content},null,8,ie)):v("v-if",!0),e.content.chatMessageType===r(z).EMOJI?(o(),i("img",{key:2,src:r(B).findEmoji(e.__content)},null,8,ae)):v("v-if",!0),Se(e,"template")?(o(),f(q,{key:3,data:e},null,8,["data"])):v("v-if",!0),e.content.chatMessageType===r(z).IMAGE?(o(),f(r(k),{key:4,width:"240",src:e.__content},null,8,["src"])):v("v-if",!0),r(A)(e.content)?(o(),i(m,{key:5},[c(r(_),{class:a({"is-audio":e.content.chatMessageType===r(z).AUDIO}),component:e.content.chatMessageType===r(z).AUDIO?r(F):r(G)},null,8,["class","component"]),g("span",re,d(r(O)(e.__content)),1)],64)):v("v-if",!0),e.content.chatMessageType===r(z).FILE?(o(),f(r(x),{key:6,"wrap-item":!1},{default:u((()=>[c(r(_),{class:"icon-file",size:"40",component:r(J)},null,8,["component"]),c(r(x),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[g("span",null,d(e.__content),1),g("span",le,d(e.__size),1)])),_:2},1024)])),_:2},1024)):v("v-if",!0),c(r(S),{class:"quick-menu"},{default:u((()=>[r(A)(e.content)?v("v-if",!0):(o(),i(m,{key:0},[v(' <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> '),c(r(w),{quaternary:"",size:"tiny",onClick:()=>Ce(e)},{icon:u((()=>[c(r(_),{size:"17",component:r(K)},null,8,["component"])])),_:2},1032,["onClick"])],64)),c(r(w),{quaternary:"",size:"tiny",onClick:t=>_e(t,e.id)},{icon:u((()=>[c(r(_),{size:"14",component:r(X)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,te)])):v("v-if",!0)]))],2)):v("v-if",!0)],64)))),128))])),_:1}),c(r(U),{ref_key:"contextmenuRef",ref:ve,show:fe.value,"onUpdate:show":t[0]||(t[0]=e=>fe.value=e),position:ge.value,"msg-id":ye.value,onSelect:Le},null,8,["show","position","msg-id"])],6))}});export{ce 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
|
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 j}from"@vicons/ionicons5";import{useState as w}from"../hooks/useState.js";import{transformMessage as I,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"../../../../shared/utils/index.js";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as D}from"../../../../shared/hooks/useScrollLoading.js";import{emojis as z}from"../utils/emoji.js";const G={class:"iho-chat-dialog__header"},B=n("span",{class:"left"},"聊天记录",-1),K={class:"center"},N={class:"iho-chat-dialog__content iho-chat-record-wrapper"},O={class:"chat-record-box"},R={class:"msg-box"},J={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}=w(),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;let r="";switch(e.content.chatMessageType){case L.TEXT:case L.BLEND:r=I(e.content);break;case L.TEMPLATE:r=null==(t=null==(l=null==(a=e.content)?void 0:a.messageTemplate)?void 0:l.setting)?void 0:t.title;break;default:r=null==(s=e.content)?void 0:s.msg}e.__content=r})),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 D(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,[B,n("div",K,[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",N,[i(r(b),null,{default:o((()=>[(t(),s(c((()=>[i(x,{component:j,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",O,[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",R,[n("div",J,[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(z).findEmoji(e.__content)},null,8,$)):(t(),d("p",{key:2,innerHTML:e.__content},null,8,q))])])])))),128)):(t(),d("div",F,"没有找到相关记录"))],512),n("div",Q,[V,n("div",W,[Y,i(r(T),{value:pe.value,"onUpdate:value":a[1]||(a[1]=e=>pe.value=e),multiple:"","max-tag-count":1,"render-label":xe,options:r(ce).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),n("div",Z,[ee,n("div",ae,[i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",le,[te,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[2]||(a[2]=()=>Me("start"))},{default:o((()=>[f(u(fe.value),1)])),_:1},512),[[g,fe.value]]),p(n("span",se,"点击选择",512),[[g,!fe.value]])])])),default:o((()=>[i(r(E),{"formatted-value":fe.value,"onUpdate:formatted-value":a[3]||(a[3]=e=>fe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Te},null,8,["formatted-value"])])),_:1}),i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",re,[oe,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[4]||(a[4]=()=>Me("end"))},{default:o((()=>[f(u(ge.value),1)])),_:1},512),[[g,ge.value]]),p(n("span",ne,"点击选择",512),[[g,!ge.value]])])])),default:o((()=>[i(r(E),{"formatted-value":ge.value,"onUpdate:formatted-value":a[5]||(a[5]=e=>ge.value=e),type:"date",panel:"",clearable:"","is-date-disabled":ke},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{ie as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as
|
1
|
+
import{defineComponent as e,ref as o,computed as s,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 h,toDisplayString as v,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 L}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import{openSessionApi as R}from"../api/index.js";import{useTheme as U}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import{useSearchUserList as I}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=U(),D=o(),E=o(),G=o(!1),H=o(""),{state:$}=C(),{openSession:q}=L($),{userList:A,handleInput:B}=I({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(),l(n(y),{raw:"","content-class":"search-content",class:"search-wrapper",style:i(n(T)),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: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":[o[0]||(o[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,h(n(A),(e=>(a(),m("div",{class:"user-item",key:e.id,onClick:()=>async function(e){G.value=!1;const o=await R({chatType:"SINGLE",receiver:e,sender:$.userInfo.id});q(o)}(e.id)},[p(n(_),{round:"",size:32,src:e.avatar},null,8,["src"]),f("div",N,[f("span",null,v(e.name),1),f("span",null,v(e.deptName),1),f("span",null,v(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
|
1
|
+
import{defineComponent as t,useAttrs as e,ref as n,computed as s,watch as i,openBlock as a,createBlock as o,unref as r,withCtx as l,createVNode as c,createElementBlock as m,createElementVNode as u,toDisplayString as p,createCommentVNode as d,Fragment as v,withKeys as f,nextTick as _}from"vue";import{NDrawer as g,NDrawerContent as h,NAvatar as y,NIcon as b,NButton as w,NUpload as S,NUploadTrigger as k,NInput as I,NSpace as C,NSwitch as j}from"naive-ui";import{ChevronForwardOutline as x,AddOutline as U,RemoveOutline as z,Pencil as F}from"@vicons/ionicons5";import{useState as G}from"../hooks/useState.js";import{useSession as K}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import{trim as O,isFunction as R}from"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import A from"./PersonProfile.vue.js";import D from"./ChatAdd.vue.js";import{toppingSessionApi as P,groupUpdateApi as B}from"../api/index.js";const L={key:0,class:"chat-set-wrapper"},N={class:"item user-info"},q={class:"name"},E={class:"item"},H=u("span",{class:"label"},"群成员",-1),J={class:"item__right"},M=["onClick"],Q=u("span",{class:"label"},"群头像",-1),T={class:"item"},V=u("span",{class:"label"},"群名称",-1),W={class:"item__right"},X={class:"txt"},Y={class:"item"},Z=u("span",{class:"label"},"置顶聊天",-1);var $=t({__name:"ChatSet",setup(t){const $=e(),{state:tt}=G(),{setCurrentSessionItem:et,isGroupChat:nt}=K(tt),st=n(),it=n(!1),at=n(""),ot=s((()=>tt.currentGroupUser.map((t=>t.id))));async function rt(t){try{await P({sessionKey:tt.currentSessionItem.sessionKey,id:tt.currentSessionItem.id,topping:t}),et({topping:t})}catch(t){console.log(t)}}async function lt(){var t;at.value=tt.currentSessionItem.name,it.value=!0,await _(),null==(t=st.value)||t.select()}async function ct(t){const e=new FormData,n=Object.assign({id:tt.currentSessionItem.receiver},t);for(const t in n)e.append(t,n[t]);await B(e)}async function mt(){it.value=!1;const t=O(at.value);t&&t!==tt.currentSessionItem.name&&(await ct({name:t}),et({name:t,defaultName:t}))}async function ut(t){const{file:e}=t.file,n=new FileReader;n.onload=function(t){var e;(null==(e=t.target)?void 0:e.result)&&et({avatar:t.target.result})},n.readAsDataURL(t.file.file),await ct({file:e})}function pt(){R($["onUpdate:show"])&&$["onUpdate:show"](!1)}return i((()=>tt.id),(t=>{t||pt()})),(t,e)=>(a(),o(r(g),{width:320,"trap-focus":!1,"block-scroll":!1,to:".iho-chat"},{default:l((()=>[c(r(h),{title:r(nt)?"群设置":"聊天设置"},{default:l((()=>[r(tt).id?(a(),m("div",L,[c(A,{"user-id":r(tt).currentSessionItem.receiver,onClose:pt,disabled:!!r(nt),placement:"bottom-end"},{trigger:l((()=>[u("div",N,[c(r(y),{round:"",size:40,src:r(tt).currentSessionItem.avatar},null,8,["src"]),u("span",q,p(r(tt).currentSessionItem.name),1),r(nt)?d("v-if",!0):(a(),o(r(b),{key:0,size:24,component:r(x),class:"item__right"},null,8,["component"]))])])),_:1},8,["user-id","disabled"]),r(nt)?(a(),m(v,{key:0},[u("div",E,[H,u("div",J,[c(D,{mode:"join",disabledIds:r(ot)},{trigger:l((()=>[c(r(w),{strong:"",secondary:"",circle:""},{icon:l((()=>[c(r(b),{component:r(U)},null,8,["component"])])),_:1})])),_:1},8,["disabledIds"]),c(D,{title:"移除成员",mode:"remove",options:r(tt).currentGroupUser},{trigger:l((()=>[c(r(w),{strong:"",secondary:"",circle:""},{icon:l((()=>[c(r(b),{component:r(z)},null,8,["component"])])),_:1})])),_:1},8,["options"])])]),c(r(S),{abstract:"",multiple:"",accept:"image/*",onChange:ut},{default:l((()=>[c(r(k),{abstract:""},{default:l((({handleClick:t})=>[u("div",{class:"item",onClick:t},[Q,c(r(b),{size:20,component:r(x),class:"item__right"},null,8,["component"])],8,M)])),_:1})])),_:1}),u("div",T,[V,u("div",W,[it.value?(a(),o(r(I),{key:0,ref_key:"inputRef",ref:st,value:at.value,"onUpdate:value":e[0]||(e[0]=t=>at.value=t),onBlur:mt,onKeydown:e[1]||(e[1]=f((t=>t.target.blur()),["enter"]))},null,8,["value"])):(a(),o(r(C),{key:1,"wrap-item":!1,onClick:lt,align:"center"},{default:l((()=>[u("span",X,p(r(tt).currentSessionItem.name),1),c(r(w),{text:"",style:{"font-size":"14px","--n-text-color":"#999"}},{default:l((()=>[c(r(b),{component:r(F)},null,8,["component"])])),_:1})])),_:1}))])])],64)):d("v-if",!0),u("div",Y,[Z,c(r(j),{value:r(tt).currentSessionItem.topping,"onUpdate:value":[e[2]||(e[2]=t=>r(tt).currentSessionItem.topping=t),rt],class:"item__right"},null,8,["value"])]),d(' <template v-if="!!isGroupChat">\n\t\t\t\t\t<div class="item item--red">\n\t\t\t\t\t\t<span class="label">退出群聊</span>\n\t\t\t\t\t\t<n-icon :size="20" :component="ChevronForwardOutline" class="item__right" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="item item--red">\n\t\t\t\t\t\t<span class="label">解散该群</span>\n\t\t\t\t\t\t<n-icon :size="20" :component="ChevronForwardOutline" class="item__right" />\n\t\t\t\t\t</div>\n\t\t\t\t</template> ')])):d("v-if",!0)])),_:1},8,["title"])])),_:1}))}});export{$ as default};
|
@@ -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
|
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"../../../../shared/utils/index.js";import"naive-ui";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as s}from"../../../../shared/hooks/useScrollLoading.js";import{useState as a}from"./useState.js";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}=a(),m=e([]),d=t((function(){Object.assign(l,{page:0,hasMore:!0}),f()}),300);async function f(){const e=(n.value||"").replace(/^\s+|\s+$/g,"");if(!e)return void(p?p():m.value=[]);if(!l.hasMore)return;l.page++,1==l.page&&(m.value=[]);const t=await r({orgId:c.orgId,keyword:e,page:l.page,pageSize:10});o(t.records)&&m.value.length<=+t.total&&(m.value=l.page>1?m.value.concat(t.records):t.records,null==u||u(),m.value.length>=+t.total&&(l.hasMore=!1,console.log("没有更多消息了")))}return s(i,(()=>{f()})),{userList:m,handleInput:d}}export{i as useSearchUserList};
|