cnhis-design-vue 3.2.15-beta.5 → 3.2.15-beta.9

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.
Files changed (31) hide show
  1. package/es/components/classification/src/index.vue2.js +1 -1
  2. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  3. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  4. package/es/components/iho-chat/index.d.ts +256 -18
  5. package/es/components/iho-chat/src/Index.vue.d.ts +256 -18
  6. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  7. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -0
  8. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +2 -0
  9. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +2 -0
  10. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +9 -0
  11. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +3 -0
  12. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -0
  13. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +34 -34
  14. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  15. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +3 -0
  16. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +2 -0
  17. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +1 -0
  18. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +206 -3
  19. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  20. package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -0
  21. package/es/components/iho-chat/src/components/userItemRender.d.ts +18 -0
  22. package/es/components/iho-chat/src/components/userItemRender.js +1 -0
  23. package/es/components/iho-chat/src/hooks/useData.d.ts +2 -0
  24. package/es/components/iho-chat/src/hooks/useData.js +1 -1
  25. package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -0
  26. package/es/components/iho-chat/src/types/index.d.ts +2 -0
  27. package/es/components/iho-chat/style/index.css +1 -1
  28. package/es/components/index.css +1 -1
  29. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  30. package/es/shared/package.json.js +1 -1
  31. package/package.json +2 -2
@@ -1,52 +1,37 @@
1
- import { PropType } from 'vue';
2
- import { AnyObject } from '../../../../shared/types';
3
1
  declare const _default: import("vue").DefineComponent<{}, {
4
2
  listRef: import("vue").Ref<any>;
5
3
  inputRef: import("vue").Ref<any>;
6
4
  showSearch: import("vue").Ref<boolean>;
7
5
  keyword: import("vue").Ref<string>;
8
- cssVars: import("vue").ComputedRef<AnyObject>;
6
+ cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
9
7
  state: {
8
+ filterable: boolean;
10
9
  orgId: string | number;
11
- currentSessionItem: AnyObject;
10
+ currentSessionItem: import("../../../../shared/types").AnyObject;
12
11
  id: string;
13
- userInfo: AnyObject;
14
- msgList: AnyObject[];
15
- currentMsg: AnyObject;
12
+ userInfo: import("../../../../shared/types").AnyObject;
13
+ msgList: import("../../../../shared/types").AnyObject[];
14
+ currentMsg: import("../../../../shared/types").AnyObject;
16
15
  isAppendMsg: boolean;
17
- sessionList: AnyObject[];
16
+ sessionList: import("../../../../shared/types").AnyObject[];
18
17
  isChangeSession: boolean;
19
- updateSessionItem: AnyObject;
18
+ updateSessionItem: import("../../../../shared/types").AnyObject;
20
19
  isUpdateSession: boolean;
21
- currentReferenceMsg: AnyObject | null;
22
- currentReEditMsg: AnyObject | null;
20
+ currentReferenceMsg: import("../../../../shared/types").AnyObject | null;
21
+ currentReEditMsg: import("../../../../shared/types").AnyObject | null;
23
22
  showVideo: boolean;
24
- currentAVMsg: AnyObject;
25
- currentGroupUser: AnyObject[];
23
+ currentAVMsg: import("../../../../shared/types").AnyObject;
24
+ currentGroupUser: import("../../../../shared/types").AnyObject[];
26
25
  showMultipleVideo: boolean;
27
26
  };
28
- openSession: (session: string | AnyObject) => Promise<void>;
29
- userList: import("vue").Ref<AnyObject[]>;
27
+ userList: import("vue").Ref<import("../../../../shared/types").AnyObject[]>;
30
28
  handleInput: () => void;
31
29
  currentTabValue: import("vue").Ref<string>;
32
- userItemRender: import("vue").DefineComponent<{
33
- item: {
34
- type: PropType<AnyObject>;
35
- default: () => {};
36
- };
37
- }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
38
- item: {
39
- type: PropType<AnyObject>;
40
- default: () => {};
41
- };
42
- }>>, {
43
- item: AnyObject;
44
- }>;
45
- groupList: import("vue").ComputedRef<AnyObject[]>;
30
+ groupList: import("vue").ComputedRef<import("../../../../shared/types").AnyObject[]>;
46
31
  showNoData: import("vue").ComputedRef<boolean>;
47
32
  showAllNoData: import("vue").ComputedRef<boolean>;
48
33
  showGroupNoData: import("vue").ComputedRef<boolean>;
49
- addSession: (id: string) => Promise<void>;
34
+ handleClose: () => void;
50
35
  NPopover: any;
51
36
  NButton: any;
52
37
  NInput: any;
@@ -61,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{}, {
61
46
  default: string;
62
47
  };
63
48
  config: {
64
- type: PropType<AnyObject>;
49
+ type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
65
50
  default: () => {
66
51
  title: string;
67
52
  content: string;
@@ -74,7 +59,7 @@ declare const _default: import("vue").DefineComponent<{}, {
74
59
  default: string;
75
60
  };
76
61
  config: {
77
- type: PropType<AnyObject>;
62
+ type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
78
63
  default: () => {
79
64
  title: string;
80
65
  content: string;
@@ -98,7 +83,7 @@ declare const _default: import("vue").DefineComponent<{}, {
98
83
  default: string;
99
84
  };
100
85
  config: {
101
- type: PropType<AnyObject>;
86
+ type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
102
87
  default: () => {
103
88
  title: string;
104
89
  content: string;
@@ -108,7 +93,22 @@ declare const _default: import("vue").DefineComponent<{}, {
108
93
  onReloadPage?: ((...args: any[]) => any) | undefined;
109
94
  }, {
110
95
  type: string;
111
- config: AnyObject;
96
+ config: import("../../../../shared/types").AnyObject;
112
97
  }>>;
98
+ userItemRender: import("vue").DefineComponent<{
99
+ item: {
100
+ type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
101
+ default: () => {};
102
+ };
103
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
104
+ item: {
105
+ type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
106
+ default: () => {};
107
+ };
108
+ }>> & {
109
+ "onItem-click"?: ((...args: any[]) => any) | undefined;
110
+ }, {
111
+ item: import("../../../../shared/types").AnyObject;
112
+ }>;
113
113
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
114
114
  export default _default;
@@ -1 +1 @@
1
- import{createElementVNode as e,defineComponent as l,ref as t,computed as n,watch as a,nextTick as i,openBlock as o,createBlock as s,unref as r,normalizeStyle as u,withCtx as d,createVNode as c,createTextVNode as v,createElementBlock as p,Fragment as f,renderList as g,resolveDynamicComponent as w,normalizeClass as m,createCommentVNode as y,withDirectives as h,vShow as k}from"vue";import{NPopover as L,NButton as C,NIcon as _,NInput as B,NTabs as j,NTabPane as x,NDivider as b,NAvatar as U}from"naive-ui";import{SearchOutline as R}from"@vicons/ionicons5";import{useData as z}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{openSessionApi as I}from"../api/index.js";import{isGroup as S}from"../utils/index.js";import{trim as D}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as N}from"../hooks/useSearchUserList.js";import E from"../../../default-page/index.js";var G,O;const T=e("div",{class:"title"},(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.510"))||"联系人",-1),V=e("div",{class:"title"},(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.575"))||"我的群组",-1),$={class:"user-list-wrapper"};var q=l({__name:"ChatSearch",setup(G){const O=t(),q=t(),A=t(!1),F=t(""),{cssVars:H,state:J,openSession:K}=z(),{userList:M,handleInput:P}=N({wrapperRef:O,keywordRef:F}),Q=t("all"),W=l({name:"UserItemRender",props:{item:{type:Object,default:()=>({})}},render(){return c("div",{class:"user-item",onClick:()=>async function(e){A.value=!1;const l=J.sessionList.find((l=>e&&[l.receiver,l.id].includes(e)));let t=l;if(!l){t=await I({chatType:"SINGLE",receiver:e,sender:J.userInfo.id})}K(t)}(this.item.id)},[c(U,{round:!0,size:32,src:this.item.avatar},null),c("div",{class:"user-info"},[c("span",null,[this.item.name]),c("span",null,[this.item.deptName]),c("span",null,[this.item.post])])])}}),X=n((()=>(F.value||"").replace(/^\s+|\s+$/g,"")?J.sessionList.filter((e=>S(e)&&(null==e?void 0:e.name.includes(F.value)))):[])),Y=n((()=>!M.value.length&&!!D(F.value||""))),Z=n((()=>!M.value.length&&!X.value.length&&!!D(F.value||""))),ee=n((()=>!X.value.length&&!!D(F.value||"")));return a((()=>A.value),(async e=>{var l;e&&(await i(),null==(l=q.value)||l.focus())})),(l,t)=>(o(),s(r(L),{raw:"","content-class":"search-content",class:"search-wrapper",style:u(r(H)),show:A.value,"onUpdate:show":t[4]||(t[4]=e=>A.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:d((()=>[c(r(C),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:d((()=>[c(r(_),{component:r(R),color:"#ffffff80"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.80"))||"搜索联系人")]})),_:1})])),default:d((()=>[c(r(B),{ref_key:"inputRef",ref:q,size:"small",clearable:"",autofocus:"",value:F.value,"onUpdate:value":[t[0]||(t[0]=e=>F.value=e),r(P)]},{prefix:d((()=>[c(r(_),{color:"#ffffff80",component:r(R)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),c(r(j),{type:"line",animated:"",value:Q.value,"onUpdate:value":t[3]||(t[3]=e=>Q.value=e)},{default:d((()=>{var l,n,a;return[c(r(x),{name:"all",tab:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.571"))||"综合","display-directive":"show",style:{padding:"0 10px 10px"}},{default:d((()=>{var e;return[r(M).length>0?(o(),p(f,{key:0},[T,(o(!0),p(f,null,g(r(M),((e,l)=>(o(),p(f,{key:e.id},[l<3?(o(),s(w(r(W)),{key:0,item:e,class:m({last:r(M).length<4?l===r(M).length-1:2===l})},null,8,["item","class"])):y("v-if",!0)],64)))),128)),r(M).length>3?(o(),s(r(C),{key:0,text:"",type:"primary",onClick:t[1]||(t[1]=()=>Q.value="user")},{icon:d((()=>[c(r(_),{component:r(R),size:"16"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.573"))||"查看更多联系人")]})),_:1})):y("v-if",!0)],64)):y("v-if",!0),r(M).length&&r(X).length?(o(),s(r(b),{key:1})):y("v-if",!0),r(X).length>0?(o(),p(f,{key:2},[V,(o(!0),p(f,null,g(r(X),((e,l)=>(o(),p(f,{key:e.id},[l<3?(o(),s(w(r(W)),{key:0,item:e,class:m({last:r(X).length<4?l===r(X).length-1:2===l})},null,8,["item","class"])):y("v-if",!0)],64)))),128)),r(X).length>3?(o(),s(r(C),{key:0,text:"",type:"primary",onClick:t[2]||(t[2]=()=>Q.value="group")},{icon:d((()=>[c(r(_),{component:r(R),size:"16"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.574"))||"查看更多群组")]})),_:1})):y("v-if",!0)],64)):y("v-if",!0),h(c(r(E),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[k,r(Z)]])]})),_:1}),c(r(x),{name:"user",tab:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.510"))||"联系人","display-directive":"show"},{default:d((()=>{var l;return[e("div",{class:"user-list-wrapper",ref_key:"listRef",ref:O},[(o(!0),p(f,null,g(r(M),(e=>(o(),s(w(r(W)),{key:e.id,item:e},null,8,["item"])))),128)),h(c(r(E),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[k,r(Y)]])],512)]})),_:1}),c(r(x),{name:"group",tab:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.572"))||"群组","display-directive":"show"},{default:d((()=>{var l;return[e("div",$,[(o(!0),p(f,null,g(r(X),(e=>(o(),s(w(r(W)),{key:e.id,item:e},null,8,["item"])))),128)),h(c(r(E),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[k,r(ee)]])])]})),_:1})]})),_:1},8,["value"])])),_:1},8,["style","show"]))}});export{q as default};
1
+ import{createElementVNode as e,defineComponent as l,ref as t,computed as n,watch as a,nextTick as o,openBlock as i,createBlock as u,unref as r,normalizeStyle as s,withCtx as d,createVNode as c,createTextVNode as v,createElementBlock as p,Fragment as g,renderList as f,normalizeClass as w,createCommentVNode as m,withDirectives as y,vShow as h}from"vue";import{NPopover as k,NButton as C,NIcon as L,NInput as _,NTabs as B,NTabPane as j,NDivider as x}from"naive-ui";import{SearchOutline as I}from"@vicons/ionicons5";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import"../api/index.js";import{isGroup as R}from"../utils/index.js";import{trim as U}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as z}from"../hooks/useSearchUserList.js";import D from"../../../default-page/index.js";import S from"./userItemRender.js";var V,$;const q=e("div",{class:"title"},(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.510"))||"联系人",-1),A=e("div",{class:"title"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.575"))||"我的群组",-1),E={class:"user-list-wrapper"};var F=l({__name:"ChatSearch",setup(l){const V=t(),$=t(),F=t(!1),G=t(""),{cssVars:H,state:J}=b(),{userList:K,handleInput:M}=z({wrapperRef:V,keywordRef:G}),N=t("all"),O=n((()=>(G.value||"").replace(/^\s+|\s+$/g,"")?J.sessionList.filter((e=>R(e)&&(null==e?void 0:e.name.includes(G.value)))):[])),P=n((()=>!K.value.length&&!!U(G.value||""))),Q=n((()=>!K.value.length&&!O.value.length&&!!U(G.value||""))),T=n((()=>!O.value.length&&!!U(G.value||"")));function W(){F.value=!1}return a((()=>F.value),(async e=>{var l;e&&(await o(),null==(l=$.value)||l.focus())})),(l,t)=>(i(),u(r(k),{raw:"","content-class":"search-content",class:"search-wrapper",style:s(r(H)),show:F.value,"onUpdate:show":t[4]||(t[4]=e=>F.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:d((()=>[c(r(C),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:d((()=>[c(r(L),{component:r(I),color:"#ffffff80"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.80"))||"搜索联系人")]})),_:1})])),default:d((()=>[c(r(_),{ref_key:"inputRef",ref:$,size:"small",clearable:"",autofocus:"",value:G.value,"onUpdate:value":[t[0]||(t[0]=e=>G.value=e),r(M)]},{prefix:d((()=>[c(r(L),{color:"#ffffff80",component:r(I)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),c(r(B),{type:"line",animated:"",value:N.value,"onUpdate:value":t[3]||(t[3]=e=>N.value=e)},{default:d((()=>{var l,n,a;return[c(r(j),{name:"all",tab:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.571"))||"综合","display-directive":"show",style:{padding:"0 10px 10px"}},{default:d((()=>{var e;return[r(K).length>0?(i(),p(g,{key:0},[q,(i(!0),p(g,null,f(r(K),((e,l)=>(i(),p(g,{key:e.id},[l<3?(i(),u(r(S),{key:0,item:e,class:w({last:r(K).length<4?l===r(K).length-1:2===l}),onItemClick:W},null,8,["item","class"])):m("v-if",!0)],64)))),128)),r(K).length>3?(i(),u(r(C),{key:0,text:"",type:"primary",onClick:t[1]||(t[1]=()=>N.value="user")},{icon:d((()=>[c(r(L),{component:r(I),size:"16"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.573"))||"查看更多联系人")]})),_:1})):m("v-if",!0)],64)):m("v-if",!0),r(K).length&&r(O).length?(i(),u(r(x),{key:1})):m("v-if",!0),r(O).length>0?(i(),p(g,{key:2},[A,(i(!0),p(g,null,f(r(O),((e,l)=>(i(),p(g,{key:e.id},[l<3?(i(),u(r(S),{key:0,item:e,class:w({last:r(O).length<4?l===r(O).length-1:2===l}),onItemClick:W},null,8,["item","class"])):m("v-if",!0)],64)))),128)),r(O).length>3?(i(),u(r(C),{key:0,text:"",type:"primary",onClick:t[2]||(t[2]=()=>N.value="group")},{icon:d((()=>[c(r(L),{component:r(I),size:"16"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.574"))||"查看更多群组")]})),_:1})):m("v-if",!0)],64)):m("v-if",!0),y(c(r(D),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(Q)]])]})),_:1}),c(r(j),{name:"user",tab:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.510"))||"联系人","display-directive":"show"},{default:d((()=>{var l;return[e("div",{class:"user-list-wrapper",ref_key:"listRef",ref:V},[(i(!0),p(g,null,f(r(K),(e=>(i(),u(r(S),{key:e.id,item:e,onItemClick:W},null,8,["item"])))),128)),y(c(r(D),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(P)]])],512)]})),_:1}),c(r(j),{name:"group",tab:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.572"))||"群组","display-directive":"show"},{default:d((()=>{var l;return[e("div",E,[(i(!0),p(g,null,f(r(O),(e=>(i(),u(r(S),{key:e.id,item:e,onItemClick:W},null,8,["item"])))),128)),y(c(r(D),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(T)]])])]})),_:1})]})),_:1},8,["value"])])),_:1},8,["style","show"]))}});export{F as default};
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<{}, {
5
5
  [x: string]: unknown;
6
6
  };
7
7
  state: {
8
+ filterable: boolean;
8
9
  orgId: string | number;
9
10
  currentSessionItem: AnyObject;
10
11
  id: string;
@@ -79,6 +80,7 @@ declare const _default: import("vue").DefineComponent<{}, {
79
80
  }>>;
80
81
  emit: (event: "close", ...args: any[]) => void;
81
82
  state: {
83
+ filterable: boolean;
82
84
  orgId: string | number;
83
85
  currentSessionItem: AnyObject;
84
86
  id: string;
@@ -194,6 +196,7 @@ declare const _default: import("vue").DefineComponent<{}, {
194
196
  }>>;
195
197
  emit: (event: "comfirm", ...args: any[]) => void;
196
198
  state: {
199
+ filterable: boolean;
197
200
  orgId: string | number;
198
201
  currentSessionItem: AnyObject;
199
202
  id: string;
@@ -7,6 +7,7 @@ declare const _default: import("vue").DefineComponent<{}, {
7
7
  name: string;
8
8
  }[]>;
9
9
  state: {
10
+ filterable: boolean;
10
11
  orgId: string | number;
11
12
  currentSessionItem: AnyObject;
12
13
  id: string;
@@ -124,6 +125,7 @@ declare const _default: import("vue").DefineComponent<{}, {
124
125
  }>>;
125
126
  emit: (event: "comfirm", ...args: any[]) => void;
126
127
  state: {
128
+ filterable: boolean;
127
129
  orgId: string | number;
128
130
  currentSessionItem: AnyObject;
129
131
  id: string;
@@ -24,6 +24,7 @@ declare const _default: import("vue").DefineComponent<{
24
24
  }>>;
25
25
  emit: (event: "close", ...args: any[]) => void;
26
26
  state: {
27
+ filterable: boolean;
27
28
  orgId: string | number;
28
29
  currentSessionItem: AnyObject;
29
30
  id: string;
@@ -11,8 +11,7 @@ declare const _default: import("vue").DefineComponent<{}, {
11
11
  unreadSessionKeys: string[];
12
12
  flexWidth: import("vue").Ref<number>;
13
13
  listBoxRef: import("vue").Ref<HTMLElement | undefined>;
14
- loading: import("vue").Ref<boolean>;
15
- filterList: import("vue").Ref<{
14
+ filterListByTag: import("vue").Ref<{
16
15
  label: string;
17
16
  key: string;
18
17
  }[]>;
@@ -21,7 +20,15 @@ declare const _default: import("vue").DefineComponent<{}, {
21
20
  menuPosition: any;
22
21
  sessionId: import("vue").Ref<any>;
23
22
  currentFilterKey: import("vue").Ref<string>;
23
+ datePickerRef: import("vue").Ref<any>;
24
+ inputRef: import("vue").Ref<any>;
25
+ dateRange: import("vue").Ref<any>;
26
+ keyword: import("vue").Ref<string>;
27
+ showSearch: import("vue").Ref<boolean>;
28
+ filterList: import("vue").Ref<AnyObject[]>;
29
+ handleInput: () => void;
24
30
  state: {
31
+ filterable: boolean;
25
32
  orgId: string | number;
26
33
  currentSessionItem: AnyObject;
27
34
  id: string;
@@ -52,10 +59,16 @@ declare const _default: import("vue").DefineComponent<{}, {
52
59
  showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
53
60
  handleContextmenu: (event: MouseEvent, id: string) => Promise<void>;
54
61
  handleSelect: (key: string, session: AnyObject) => Promise<void>;
55
- NSpin: any;
62
+ handleUpdateShow: (value: boolean) => void;
63
+ handleClickoutside: (e: Event) => void;
64
+ handleUpdateDate: (value: string[]) => void;
65
+ handleSearch: () => void;
56
66
  NBadge: any;
57
67
  NAvatar: any;
68
+ NInput: any;
58
69
  NTag: any;
70
+ NIcon: any;
71
+ NPopover: any;
59
72
  ContextMenu: import("vue").DefineComponent<{
60
73
  type: {
61
74
  type: StringConstructor;
@@ -99,5 +112,195 @@ declare const _default: import("vue").DefineComponent<{}, {
99
112
  };
100
113
  formatTime: typeof formatTime;
101
114
  STATUS: typeof STATUS;
115
+ CDatePicker: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
116
+ updateUnchangedValue: {
117
+ type: BooleanConstructor;
118
+ };
119
+ onConfirm: {
120
+ type: FunctionConstructor;
121
+ };
122
+ formattedValue: {
123
+ type: import("vue").PropType<(string | [string, string]) | null | undefined>;
124
+ };
125
+ placeholder: {
126
+ type: StringConstructor;
127
+ };
128
+ allowedInvalidValue: {
129
+ type: StringConstructor;
130
+ };
131
+ to: {
132
+ type: import("vue").PropType<string | false | HTMLElement>;
133
+ default: string;
134
+ };
135
+ holidays: {
136
+ type: import("vue").PropType<Date[]>;
137
+ default: () => never[];
138
+ };
139
+ type: {
140
+ type: StringConstructor;
141
+ default: string;
142
+ };
143
+ }, {
144
+ attrs: {
145
+ [x: string]: unknown;
146
+ };
147
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
148
+ updateUnchangedValue: {
149
+ type: BooleanConstructor;
150
+ };
151
+ onConfirm: {
152
+ type: FunctionConstructor;
153
+ };
154
+ formattedValue: {
155
+ type: import("vue").PropType<(string | [string, string]) | null | undefined>;
156
+ };
157
+ placeholder: {
158
+ type: StringConstructor;
159
+ };
160
+ allowedInvalidValue: {
161
+ type: StringConstructor;
162
+ };
163
+ to: {
164
+ type: import("vue").PropType<string | false | HTMLElement>;
165
+ default: string;
166
+ };
167
+ holidays: {
168
+ type: import("vue").PropType<Date[]>;
169
+ default: () => never[];
170
+ };
171
+ type: {
172
+ type: StringConstructor;
173
+ default: string;
174
+ };
175
+ }>> & {
176
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
177
+ }>>;
178
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
179
+ datePickerRef: import("vue").Ref<AnyObject | null>;
180
+ panelInstRef: import("vue").Ref<null>;
181
+ placeholderRef: import("vue").Ref<any>;
182
+ oldValue: string;
183
+ currentFormattedValue: import("vue").WritableComputedRef<(string | [string, string]) | null | undefined>;
184
+ isDateTime: import("vue").ComputedRef<boolean>;
185
+ formatRef: import("vue").ComputedRef<string>;
186
+ panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
187
+ focus: () => any;
188
+ blur: () => any;
189
+ handleConfirm: (target: HTMLInputElement) => void;
190
+ onUpdateShow: (show: boolean) => Promise<void>;
191
+ watchers: import("../../../../shared/types").AnyFn[];
192
+ stopWatcher: () => void;
193
+ setHoliday: (show: boolean) => Promise<void>;
194
+ onConfirm: (...args: any[]) => Promise<void>;
195
+ isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
196
+ setShortcutValue: (type: "month" | "week") => Promise<void>;
197
+ NDatePicker: any;
198
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
199
+ updateUnchangedValue: {
200
+ type: BooleanConstructor;
201
+ };
202
+ onConfirm: {
203
+ type: FunctionConstructor;
204
+ };
205
+ formattedValue: {
206
+ type: import("vue").PropType<(string | [string, string]) | null | undefined>;
207
+ };
208
+ placeholder: {
209
+ type: StringConstructor;
210
+ };
211
+ allowedInvalidValue: {
212
+ type: StringConstructor;
213
+ };
214
+ to: {
215
+ type: import("vue").PropType<string | false | HTMLElement>;
216
+ default: string;
217
+ };
218
+ holidays: {
219
+ type: import("vue").PropType<Date[]>;
220
+ default: () => never[];
221
+ };
222
+ type: {
223
+ type: StringConstructor;
224
+ default: string;
225
+ };
226
+ }>> & {
227
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
228
+ }, {
229
+ type: string;
230
+ updateUnchangedValue: boolean;
231
+ to: string | false | HTMLElement;
232
+ holidays: Date[];
233
+ }>>;
234
+ 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<{}>>, {}>;
235
+ userItemRender: import("vue").DefineComponent<{
236
+ item: {
237
+ type: import("vue").PropType<AnyObject>;
238
+ default: () => {};
239
+ };
240
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
241
+ item: {
242
+ type: import("vue").PropType<AnyObject>;
243
+ default: () => {};
244
+ };
245
+ }>> & {
246
+ "onItem-click"?: ((...args: any[]) => any) | undefined;
247
+ }, {
248
+ item: AnyObject;
249
+ }>;
250
+ DefaultPage: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
251
+ type: {
252
+ type: StringConstructor;
253
+ default: string;
254
+ };
255
+ config: {
256
+ type: import("vue").PropType<AnyObject>;
257
+ default: () => {
258
+ title: string;
259
+ content: string;
260
+ };
261
+ };
262
+ }, {
263
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
264
+ type: {
265
+ type: StringConstructor;
266
+ default: string;
267
+ };
268
+ config: {
269
+ type: import("vue").PropType<AnyObject>;
270
+ default: () => {
271
+ title: string;
272
+ content: string;
273
+ };
274
+ };
275
+ }>> & {
276
+ onReloadPage?: ((...args: any[]) => any) | undefined;
277
+ }>>;
278
+ emit: (event: "reloadPage", ...args: any[]) => void;
279
+ configResult: import("vue").ComputedRef<{
280
+ title: string;
281
+ content: string;
282
+ img: string;
283
+ }>;
284
+ reloadPage: () => void;
285
+ NIcon: any;
286
+ 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<{}>>, {}>;
287
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reloadPage"[], "reloadPage", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
288
+ type: {
289
+ type: StringConstructor;
290
+ default: string;
291
+ };
292
+ config: {
293
+ type: import("vue").PropType<AnyObject>;
294
+ default: () => {
295
+ title: string;
296
+ content: string;
297
+ };
298
+ };
299
+ }>> & {
300
+ onReloadPage?: ((...args: any[]) => any) | undefined;
301
+ }, {
302
+ type: string;
303
+ config: AnyObject;
304
+ }>>;
102
305
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
103
306
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as i,withDirectives as l,openBlock as n,createElementBlock as o,normalizeStyle as s,unref as a,createBlock as u,createCommentVNode as d,createElementVNode as r,Fragment as v,renderList as p,withCtx as c,createTextVNode as m,toDisplayString as g,withModifiers as f,normalizeClass as y,createVNode as w,vShow as k,nextTick as h}from"vue";import{NSpin as x,NTag as _,NAvatar as C,NBadge as M}from"naive-ui";import E from"./ContextMenu.js";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as R}from"../constants/index.js";import{toppingSessionApi as j,updateStatusApi as D}from"../api/index.js";import{listSort as L,formatTime as S}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{vFlexibleResize as B}from"../../../../shared/directive/flexibleResize.js";const N={class:"sider-list__filter box-shadow"},T=["onClick","onContextmenu"],V={class:"avatar-right"},O={class:"name"},H={class:"msg-tip"},I={class:"msg-tip__content"},z={key:0},K=["innerHTML"];var U=e({__name:"SiderList",setup(e){var U,W,A;const X="all",Y="unread",$="ended";let q=[];const F=t(300),G=t(),J=t(!1),P=t([{label:(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.123"))||"全部",key:X},{label:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.124"))||"未读",key:Y},{label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.77"))||"结束",key:$}]),Q=t(),Z=t(!1),ee=t({left:0,top:0}),te=t(),ie=t("all"),{state:le,unreadTotal:ne,openSession:oe,setUpdateSessionItem:se,setCurrentSessionItem:ae}=b(),ue=i((()=>Math.min(Math.max(F.value,240),360))),de=i((()=>L(le.sessionList)));function re({distance:e}){F.value=F.value+e}function ve(e,t=a(ie)){var i;return t===X||(t===Y?q.includes(e.sessionKey)||(null!=(i=e.unreadNum)?i:0)>0:t===$?e.status===R.ENDED:void 0)}async function pe(e,t){try{if("topping"===e)return await j({id:t.id,topping:!(null==t?void 0:t.topping)}),void(le.id===t.id?ae({topping:!(null==t?void 0:t.topping)}):se({...t,topping:!(null==t?void 0:t.topping)}));"remove"===e&&(await D({id:t.id,status:R.REMOVED}),le.id===t.id?ae({status:R.REMOVED}):se({...t,status:R.REMOVED}))}catch(e){}}return(e,t)=>l((n(),o("section",{class:"sider-list",style:s({width:a(ue)+"px"})},[J.value?(n(),u(a(x),{key:0,stroke:"#5585f5"})):d("v-if",!0),d(' <n-input v-else placeholder="输入用户名模糊搜索" v-model:value="keyword" @keyup.enter="handleSearch"></n-input> '),r("div",N,[(n(!0),o(v,null,p(P.value,(e=>(n(),u(a(_),{type:ie.value===e.key?"primary":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return t=e.key,ie.value=t,void(t===Y&&(q=(de.value.filter((e=>{var t;return(null!=(t=e.unreadNum)?t:0)>0}))||[]).map((e=>e.sessionKey))));var t}},{default:c((()=>{return[m(g(e.label)+"("+g((t=e,t.key===$?de.value.filter((e=>e.status===R.ENDED)).length:ne.value))+") ",1)];var t})),_:2},1032,["type","onClick"])))),128))]),r("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:G},[(n(!0),o(v,null,p(a(de),(e=>{var t;return n(),o(v,{key:e.id},[e.status!==a(R).REMOVED?l((n(),o("div",{key:0,onClick:()=>a(oe)(e),onContextmenu:f((t=>async function(e,t){var i,l,n,o,s;te.value=t,Z.value=!0,await h();const{clientX:a,clientY:u}=e,{width:d=0,height:r=0,left:v=0,top:p=0}=(null==(i=G.value)?void 0:i.getBoundingClientRect())||{},{width:c=100,height:m=80}=(null==(n=null==(l=Q.value)?void 0:l.$el)?void 0:n.getBoundingClientRect())||{},g=null!=(s=null==(o=G.value)?void 0:o.scrollTop)?s:0,f={};a<v+d-(c+2)-5?f.left=a-v+5+"px":f.right=v+d-a+5+"px",p+r-u<=m+5?f.bottom=5-g+"px":f.top=u-p+g+5+"px",ee.value=f}(t,e.id)),["prevent"]),class:y(["sider-list__box__item",{active:e.id===a(le).id},e.topping?"sider-list__box__item--top":""])},[w(a(C),{round:"",size:"large",src:e.avatar},null,8,["src"]),r("div",V,[r("div",O,[r("h4",null,g(e.name),1),r("span",null,g(e.lastMessage?a(S)(e.lastMessageSendTime).siderMsgTime:""),1)]),r("div",H,[r("div",I,["WITHDRAWN"===e.lastMessageStatus?(n(),o("div",z,(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.68"))||"撤回了一条消息")):(n(),o("div",{key:1,innerHTML:e.lastMessageContent},null,8,K))]),w(a(M),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],42,T)),[[k,ve(e)]]):d("v-if",!0)],64)})),128)),w(a(E),{ref_key:"contextmenuRef",ref:Q,show:Z.value,"onUpdate:show":t[0]||(t[0]=e=>Z.value=e),type:"session",position:ee.value,id:te.value,onSelect:pe},null,8,["show","position","id"])],512)],4)),[[a(B),{mode:"VR",onMove:re}]])}});export{U as default};
1
+ import{defineComponent as e,ref as t,computed as l,withDirectives as n,openBlock as i,createElementBlock as a,normalizeStyle as o,unref as s,createVNode as u,withCtx as r,createElementVNode as d,Fragment as v,renderList as c,createBlock as p,vShow as m,createCommentVNode as f,createTextVNode as g,toDisplayString as w,withModifiers as y,normalizeClass as k,nextTick as h}from"vue";import{NPopover as _,NInput as x,NIcon as C,NTag as M,NAvatar as R,NBadge as b}from"naive-ui";import j from"./ContextMenu.js";import{useData as D}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as E}from"../constants/index.js";import{toppingSessionApi as L,updateStatusApi as B}from"../api/index.js";import{listSort as I,formatTime as T}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{vFlexibleResize as N}from"../../../../shared/directive/flexibleResize.js";import S from"../../../date-picker/index.js";import{SearchOutline as V}from"@vicons/ionicons5";import $ from"./userItemRender.js";import O from"../../../default-page/index.js";import{useDebounceFn as U}from"@vueuse/core";import{isBefore as H,isAfter as z}from"date-fns";const K={key:0,class:"sider-list__filter"},P={class:"user-list-wrapper"},W={class:"sider-list__tags box-shadow"},A=["onClick","onContextmenu"],X={class:"avatar-right"},Y={class:"name"},q={class:"msg-tip"},F={class:"msg-tip__content"},G={key:0},J=["innerHTML"];var Q=e({__name:"SiderList",setup(e){var Q,Z,ee;const te="all",le="unread",ne="ended";let ie=[];const ae=t(300),oe=t(),se=t([{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.123"))||"全部",key:te},{label:(null==(Z=window.getLanguageByCode)?void 0:Z.call(window,"10010.1.124"))||"未读",key:le},{label:(null==(ee=window.getLanguageByCode)?void 0:ee.call(window,"10010.1.77"))||"结束",key:ne}]),ue=t(),re=t(!1),de=t({left:0,top:0}),ve=t(),ce=t("all"),pe=t(),me=t(),fe=t(),ge=t(""),we=t(!1),ye=t([]),ke=U(Te,500),{state:he,unreadTotal:_e,openSession:xe,setUpdateSessionItem:Ce,setCurrentSessionItem:Me}=D(),Re=l((()=>Math.min(Math.max(ae.value,240),360))),be=l((()=>I(he.sessionList)));function je({distance:e}){ae.value=ae.value+e}function De(e,t=s(ce)){var l;return t===te||(t===le?ie.includes(e.sessionKey)||(null!=(l=e.unreadNum)?l:0)>0:t===ne?e.status===E.ENDED:void 0)}async function Ee(e,t){try{if("topping"===e)return await L({id:t.id,topping:!(null==t?void 0:t.topping)}),void(he.id===t.id?Me({topping:!(null==t?void 0:t.topping)}):Ce({...t,topping:!(null==t?void 0:t.topping)}));"remove"===e&&(await B({id:t.id,status:E.REMOVED}),he.id===t.id?Me({status:E.REMOVED}):Ce({...t,status:E.REMOVED}))}catch(e){}}function Le(e){we.value=e,e||(ge.value="",fe.value=null,ye.value=[])}function Be(e){var t,l,n,i,a;const o=null==(n=null==(l=null==(t=pe.value)?void 0:t.$datePicker)?void 0:l.panelInstRef)?void 0:n.$el;Le(!(!e.target||!(o&&o.contains(e.target)||(null==(i=me.value)?void 0:i.$el)&&(null==(a=me.value)?void 0:a.$el.contains(e.target)))))}function Ie(e){fe.value=e,Te()}function Te(){ge.value||fe.value?ye.value=be.value.filter((e=>{const t=e.name.includes(ge.value);if(!fe.value)return t;const[l,n]=fe.value,i=new Date(e.createdTime);return t&&H(i,new Date(n+" 23:59:59"))&&z(i,new Date(l+" 00:00:00"))})):ye.value=[]}return(e,t)=>n((i(),a("section",{class:"sider-list",style:o({width:s(Re)+"px"})},[s(he).filterable?(i(),a("div",K,[u(s(_),{raw:"","content-class":"search-content__sider",class:"search-wrapper",show:we.value,placement:"bottom-start","display-directive":"show","show-arrow":!1,onClickoutside:Be},{trigger:r((()=>[u(s(x),{ref_key:"inputRef",ref:me,placeholder:"请输入名称模糊搜索",value:ge.value,"onUpdate:value":t[0]||(t[0]=e=>ge.value=e),onInput:s(ke),onClick:t[1]||(t[1]=()=>Le(!0))},{prefix:r((()=>[u(s(C),{component:s(V)},null,8,["component"])])),_:1},8,["value","onInput"])])),default:r((()=>{var e;return[u(s(S),{ref_key:"datePickerRef",ref:pe,"formatted-value":fe.value,type:"daterange",clearable:"","onUpdate:formattedValue":Ie},null,8,["formatted-value"]),d("div",P,[(i(!0),a(v,null,c(ye.value,(e=>(i(),p(s($),{key:e.id,item:e,onItemClick:t[2]||(t[2]=()=>Le(!1))},null,8,["item"])))),128)),n(u(s(O),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[m,ye.value.length<1]])])]})),_:1},8,["show"])])):f("v-if",!0),d("div",W,[(i(!0),a(v,null,c(se.value,(e=>(i(),p(s(M),{type:ce.value===e.key?"primary":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return t=e.key,ce.value=t,void(t===le&&(ie=(be.value.filter((e=>{var t;return(null!=(t=e.unreadNum)?t:0)>0}))||[]).map((e=>e.sessionKey))));var t}},{default:r((()=>{return[g(w(e.label)+"("+w((t=e,t.key===ne?be.value.filter((e=>e.status===E.ENDED)).length:_e.value))+") ",1)];var t})),_:2},1032,["type","onClick"])))),128))]),d("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:oe},[(i(!0),a(v,null,c(s(be),(e=>{var t;return i(),a(v,{key:e.id},[e.status!==s(E).REMOVED?n((i(),a("div",{key:0,onClick:()=>s(xe)(e),onContextmenu:y((t=>async function(e,t){var l,n,i,a,o;ve.value=t,re.value=!0,await h();const{clientX:s,clientY:u}=e,{width:r=0,height:d=0,left:v=0,top:c=0}=(null==(l=oe.value)?void 0:l.getBoundingClientRect())||{},{width:p=100,height:m=80}=(null==(i=null==(n=ue.value)?void 0:n.$el)?void 0:i.getBoundingClientRect())||{},f=null!=(o=null==(a=oe.value)?void 0:a.scrollTop)?o:0,g={};s<v+r-(p+2)-5?g.left=s-v+5+"px":g.right=v+r-s+5+"px",c+d-u<=m+5?g.bottom=5-f+"px":g.top=u-c+f+5+"px",de.value=g}(t,e.id)),["prevent"]),class:k(["sider-list__box__item",{active:e.id===s(he).id},e.topping?"sider-list__box__item--top":""])},[u(s(R),{round:"",size:"large",src:e.avatar},null,8,["src"]),d("div",X,[d("div",Y,[d("h4",null,w(e.name),1),d("span",null,w(e.lastMessage?s(T)(e.lastMessageSendTime).siderMsgTime:""),1)]),d("div",q,[d("div",F,["WITHDRAWN"===e.lastMessageStatus?(i(),a("div",G,(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.68"))||"撤回了一条消息")):(i(),a("div",{key:1,innerHTML:e.lastMessageContent},null,8,J))]),u(s(b),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],42,A)),[[m,De(e)]]):f("v-if",!0)],64)})),128)),u(s(j),{ref_key:"contextmenuRef",ref:ue,show:re.value,"onUpdate:show":t[3]||(t[3]=e=>re.value=e),type:"session",position:de.value,id:ve.value,onSelect:Ee},null,8,["show","position","id"])],512)],4)),[[s(N),{mode:"VR",onMove:je}]])}});export{Q as default};
@@ -7,6 +7,7 @@ declare const _default: import("vue").DefineComponent<{}, {
7
7
  receiver?: string | undefined;
8
8
  }) => Promise<void>;
9
9
  state: {
10
+ filterable: boolean;
10
11
  orgId: string | number;
11
12
  currentSessionItem: import("../../../../shared/types").AnyObject;
12
13
  id: string;
@@ -0,0 +1,18 @@
1
+ import { PropType } from 'vue';
2
+ import { AnyObject } from '../../../../shared/types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ item: {
5
+ type: PropType<AnyObject>;
6
+ default: () => {};
7
+ };
8
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
+ item: {
10
+ type: PropType<AnyObject>;
11
+ default: () => {};
12
+ };
13
+ }>> & {
14
+ "onItem-click"?: ((...args: any[]) => any) | undefined;
15
+ }, {
16
+ item: AnyObject;
17
+ }>;
18
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,createVNode as s}from"vue";import{NAvatar as t}from"naive-ui";import{useData as i}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{openSessionApi as r}from"../api/index.js";import"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";var o=e({name:"UserItemRender",props:{item:{type:Object,default:()=>({})}},emits:["item-click"],setup(e,{attrs:o,slots:m,emit:n}){const{state:a,openSession:c,cssVars:l}=i();return()=>s("div",{class:"user-item",onClick:()=>async function(e){n("item-click");const s=a.sessionList.find((s=>e&&[s.receiver,s.id].includes(e)));let t=s;s||(t=await r({chatType:"SINGLE",receiver:e,sender:a.userInfo.id}));c(t)}(e.item.id)},[s(t,{round:!0,size:32,src:e.item.avatar,color:l.value["--c-primary-color"]},null),s("div",{class:"user-info"},[s("span",null,[e.item.name]),s("span",null,[e.item.deptName]),s("span",null,[e.item.post])])])}});export{o as default};
@@ -6,6 +6,7 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
6
6
  cssVars: import("vue").ComputedRef<AnyObject>;
7
7
  stompClient: import("vue").Ref<ChatSock | undefined>;
8
8
  state: {
9
+ filterable: boolean;
9
10
  orgId: string | number;
10
11
  currentSessionItem: AnyObject;
11
12
  id: string;
@@ -51,6 +52,7 @@ export declare const useData: () => {
51
52
  cssVars: import("vue").ComputedRef<AnyObject>;
52
53
  stompClient: import("vue").Ref<ChatSock | undefined>;
53
54
  state: {
55
+ filterable: boolean;
54
56
  orgId: string | number;
55
57
  currentSessionItem: AnyObject;
56
58
  id: string;
@@ -1 +1 @@
1
- import{ref as e,reactive as s,computed as t,watch as n,inject as i,toRaw as r}from"vue";import{openSessionApi as o,updateStatusApi as a,groupUserApi as c}from"../api/index.js";import{promiseTimeout as u,useIntervalFn as m}from"@vueuse/core";import{isGroup as d,listSort as l,formatTime as p,transformMessage as g,getFileSize as f,simplifyMessage as h}from"../utils/index.js";import{cloneDeep as S,isArray as I,uniqBy as T}from"lodash-es";import{STATUS as y,MESSAGE_TYPE as v,CHAT_TYPE as L}from"../constants/index.js";import{useTheme as M}from"../../../../shared/hooks/useTheme.js";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../../shared/hooks/useScrollLoading.js";const E=Symbol("InjectionIChatData");function C(e){const{lastMessage:s,lastSenderName:t=""}=e,n=h(s)||"";return d(e)&&t?t+": "+n:n}function N(i,h){const E=e(),N=s({orgId:i.orgId,currentSessionItem:{},id:"",userInfo:{id:i.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,currentReEditMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1}),D=M(),w=t((()=>N.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),j=t((()=>d(N.currentSessionItem))),U=t((()=>{var e,s,t;return(null==(e=N.userInfo)?void 0:e.id)===(null==(t=null==(s=N.currentGroupUser)?void 0:s[0])?void 0:t.id)})),_=t((()=>{var e;return(null==(e=N.currentSessionItem)?void 0:e.status)===y.ENDED}));n((()=>w.value),(e=>{!async function s(t=0){if(t>2)return;const n=N.sessionList.filter((e=>{var s;return+(null!=(s=e.unreadNum)?s:0)>0}));n.every((e=>!!e.name))?h("unread-message-update",e,l(n)):(await u(300),s(++t))}()})),n([()=>N.isChangeSession,()=>N.isUpdateSession],(([e,s])=>{e&&(B(N.currentSessionItem),N.currentSessionItem.status===y.REMOVED&&V(),N.isChangeSession=!1),s&&(B(N.updateSessionItem),N.isUpdateSession=!1)}),{immediate:!0});const{pause:G,resume:R,isActive:K}=m((()=>{const e=S(N.msgList);e.some((e=>{const{sendTime:s}=e;return!(Date.now()-new Date(s).getTime()>=36e5)&&(e.__sendTime=p(s).recordTime,!0)})),N.msgList=e,O()||G()}),6e4,{immediate:!1});function O(){return!!N.msgList.length&&N.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function k(e){var s;try{null==(s=E.value)||s.send("/app/chat/send",{},JSON.stringify({chatType:N.currentSessionItem.chatType,receiver:N.currentSessionItem.receiver,...e}))}catch(e){}}function x(e){Object.assign(N.currentSessionItem,e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:Reflect.has(e,"lastMessage")?C({...e,chatType:e.chatType||N.currentSessionItem.chatType}):N.currentSessionItem.lastMessageContent}),N.isChangeSession=!0,N.id!==N.currentSessionItem.id&&(N.msgList=[],N.id=N.currentSessionItem.id)}function A(e){const s=N.sessionList.find((s=>s.sessionKey===e.sessionKey)),t={...e,lastMessageContent:C({...e,chatType:e.chatType||(null==s?void 0:s.chatType)})};N.updateSessionItem=s?{...S(s),...t}:t,N.isUpdateSession=!0}function V(){if(!N.id)return null;const{currentSessionItem:e}=N;return N.currentSessionItem={},N.msgList=[],N.id="",N.currentGroupUser=[],e}function b(e){N.sessionList=S(T(e,"id")),N.sessionList.forEach((e=>{Object.assign(e,{defaultName:Reflect.has(e,"defaultName")?e.defaultName:e.name||"",lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:C(e)}),e.receiver===N.userInfo.id&&(e.unreadNum=0),e.chatType!==L.GROUP||e.name||c({id:e.receiver}).then((s=>{I(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))}function B(e){!e.id||N.sessionList.map((e=>e.id)).includes(e.id)?N.sessionList.some((s=>{if(s.sessionKey===e.sessionKey){let{unreadNum:t=0}=s;return Object.assign(s,e),e.sessionKey!==N.currentSessionItem.sessionKey&&s.sender&&s.sender!==N.userInfo.id&&(s.unreadNum=++t),!0}})):b([...N.sessionList,e])}return{cssVars:D,stompClient:E,state:N,unreadTotal:w,isGroupChat:j,isGroupLeader:U,isEnded:_,setMsgList:function(e=[]){G(),N.msgList=S(e).sort(((e,s)=>new Date(s.sendTime).getTime()-new Date(e.sendTime).getTime())),N.msgList.forEach((e=>{var s,t;Object.assign(e,{__time:p(e.sendTime).msgTime,__content:(t=e.content.chatMessageType,[v.TEXT,v.TEXT,v.BLEND].includes(t)?g(e.content):null==(s=e.content)?void 0:s.msg),__sendTime:p(e.sendTime).recordTime}),e.content.chatMessageType!==v.FILE||e.__size||f(e.content.fileUrl).then((s=>{e.__size=s}))})),O()&&R()},sendMessage:k,relayMessage:async function(e){const{checkedIds:s,remark:t,content:n}=e;for(let e=0;e<s.length;e++){const i=s[e],r=N.sessionList.find((e=>e.receiver===i));r||await o({chatType:L.SINGLE,receiver:i,sender:N.userInfo.id});const a=(null==r?void 0:r.chatType)||L.SINGLE;k({chatType:a,receiver:i,content:n}),await u(100),t&&k({chatType:a,receiver:i,content:{chatMessageType:v.TEXT,msg:t}}),await u(100)}},openSession:async function(e){try{const s="string"==typeof e?N.sessionList.find((s=>s.id===e)):e;if(!s)return;s.status===y.REMOVED&&(await a({id:s.id,status:y.ENABLED}),A({...s,status:y.ENABLED}),s.status=y.ENABLED);const t=N.currentSessionItem.sessionKey;if(x(s),t===N.currentSessionItem.sessionKey)return;if(j.value){const e=await c({id:s.receiver});N.currentGroupUser=I(e)?e:[]}else N.currentGroupUser=T([N.userInfo,{...S(s),id:s.receiver}],"id");h("session-change",{...r(N.currentSessionItem),userList:N.currentGroupUser.map((e=>r(e)))})}catch(e){console.log("error---\x3e",e)}},closeSession:V,getCurrentSession:function(){return N.id?N.currentSessionItem:null},setCurrentSessionItem:x,setUpdateSessionItem:A,setSessionList:b,emit:h}}const D=()=>i(E);export{E as InjectionIChatData,N as initData,D as useData};
1
+ import{ref as e,reactive as s,toRef as t,computed as n,watch as i,inject as r,toRaw as o}from"vue";import{openSessionApi as a,updateStatusApi as c,groupUserApi as u}from"../api/index.js";import{promiseTimeout as m,useIntervalFn as d}from"@vueuse/core";import{isGroup as l,listSort as p,formatTime as g,transformMessage as f,getFileSize as h,simplifyMessage as S}from"../utils/index.js";import{cloneDeep as I,isArray as T,uniqBy as y}from"lodash-es";import{STATUS as v,MESSAGE_TYPE as L,CHAT_TYPE as M}from"../constants/index.js";import{useTheme as E}from"../../../../shared/hooks/useTheme.js";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../../shared/hooks/useScrollLoading.js";const C=Symbol("InjectionIChatData");function N(e){const{lastMessage:s,lastSenderName:t=""}=e,n=S(s)||"";return l(e)&&t?t+": "+n:n}function D(r,S){const C=e(),D=s({filterable:t(r,"filterable"),orgId:r.orgId,currentSessionItem:{},id:"",userInfo:{id:r.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,currentReEditMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1}),w=E(),j=n((()=>D.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),U=n((()=>l(D.currentSessionItem))),_=n((()=>{var e,s,t;return(null==(e=D.userInfo)?void 0:e.id)===(null==(t=null==(s=D.currentGroupUser)?void 0:s[0])?void 0:t.id)})),G=n((()=>{var e;return(null==(e=D.currentSessionItem)?void 0:e.status)===v.ENDED}));i((()=>j.value),(e=>{!async function s(t=0){if(t>2)return;const n=D.sessionList.filter((e=>{var s;return+(null!=(s=e.unreadNum)?s:0)>0}));n.every((e=>!!e.name))?S("unread-message-update",e,p(n)):(await m(300),s(++t))}()})),i([()=>D.isChangeSession,()=>D.isUpdateSession],(([e,s])=>{e&&(X(D.currentSessionItem),D.currentSessionItem.status===v.REMOVED&&V(),D.isChangeSession=!1),s&&(X(D.updateSessionItem),D.isUpdateSession=!1)}),{immediate:!0});const{pause:R,resume:K,isActive:O}=d((()=>{const e=I(D.msgList);e.some((e=>{const{sendTime:s}=e;return!(Date.now()-new Date(s).getTime()>=36e5)&&(e.__sendTime=g(s).recordTime,!0)})),D.msgList=e,b()||R()}),6e4,{immediate:!1});function b(){return!!D.msgList.length&&D.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function k(e){var s;try{null==(s=C.value)||s.send("/app/chat/send",{},JSON.stringify({chatType:D.currentSessionItem.chatType,receiver:D.currentSessionItem.receiver,...e}))}catch(e){}}function x(e){Object.assign(D.currentSessionItem,e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:Reflect.has(e,"lastMessage")?N({...e,chatType:e.chatType||D.currentSessionItem.chatType}):D.currentSessionItem.lastMessageContent}),D.isChangeSession=!0,D.id!==D.currentSessionItem.id&&(D.msgList=[],D.id=D.currentSessionItem.id)}function A(e){const s=D.sessionList.find((s=>s.sessionKey===e.sessionKey)),t={...e,lastMessageContent:N({...e,chatType:e.chatType||(null==s?void 0:s.chatType)})};D.updateSessionItem=s?{...I(s),...t}:t,D.isUpdateSession=!0}function V(){if(!D.id)return null;const{currentSessionItem:e}=D;return D.currentSessionItem={},D.msgList=[],D.id="",D.currentGroupUser=[],e}function B(e){D.sessionList=I(y(e,"id")),D.sessionList.forEach((e=>{Object.assign(e,{defaultName:Reflect.has(e,"defaultName")?e.defaultName:e.name||"",lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:N(e)}),e.receiver===D.userInfo.id&&(e.unreadNum=0),e.chatType!==M.GROUP||e.name||u({id:e.receiver}).then((s=>{T(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))}function X(e){!e.id||D.sessionList.map((e=>e.id)).includes(e.id)?D.sessionList.some((s=>{if(s.sessionKey===e.sessionKey){let{unreadNum:t=0}=s;return Object.assign(s,e),e.sessionKey!==D.currentSessionItem.sessionKey&&s.sender&&s.sender!==D.userInfo.id&&(s.unreadNum=++t),!0}})):B([...D.sessionList,e])}return{cssVars:w,stompClient:C,state:D,unreadTotal:j,isGroupChat:U,isGroupLeader:_,isEnded:G,setMsgList:function(e=[]){R(),D.msgList=I(e).sort(((e,s)=>new Date(s.sendTime).getTime()-new Date(e.sendTime).getTime())),D.msgList.forEach((e=>{var s,t;Object.assign(e,{__time:g(e.sendTime).msgTime,__content:(t=e.content.chatMessageType,[L.TEXT,L.TEXT,L.BLEND].includes(t)?f(e.content):null==(s=e.content)?void 0:s.msg),__sendTime:g(e.sendTime).recordTime}),e.content.chatMessageType!==L.FILE||e.__size||h(e.content.fileUrl).then((s=>{e.__size=s}))})),b()&&K()},sendMessage:k,relayMessage:async function(e){const{checkedIds:s,remark:t,content:n}=e;for(let e=0;e<s.length;e++){const i=s[e],r=D.sessionList.find((e=>e.receiver===i));r||await a({chatType:M.SINGLE,receiver:i,sender:D.userInfo.id});const o=(null==r?void 0:r.chatType)||M.SINGLE;k({chatType:o,receiver:i,content:n}),await m(100),t&&k({chatType:o,receiver:i,content:{chatMessageType:L.TEXT,msg:t}}),await m(100)}},openSession:async function(e){try{const s="string"==typeof e?D.sessionList.find((s=>s.id===e)):e;if(!s)return;s.status===v.REMOVED&&(await c({id:s.id,status:v.ENABLED}),A({...s,status:v.ENABLED}),s.status=v.ENABLED);const t=D.currentSessionItem.sessionKey;if(x(s),t===D.currentSessionItem.sessionKey)return;if(U.value){const e=await u({id:s.receiver});D.currentGroupUser=T(e)?e:[]}else D.currentGroupUser=y([D.userInfo,{...I(s),id:s.receiver}],"id");S("session-change",{...o(D.currentSessionItem),userList:D.currentGroupUser.map((e=>o(e)))})}catch(e){console.log("error---\x3e",e)}},closeSession:V,getCurrentSession:function(){return D.id?D.currentSessionItem:null},setCurrentSessionItem:x,setUpdateSessionItem:A,setSessionList:B,emit:S}}const w=()=>r(C);export{C as InjectionIChatData,D as initData,w as useData};
@@ -9,6 +9,7 @@ type EventHandlers = {
9
9
  };
10
10
  export declare function useVideo(): {
11
11
  state: {
12
+ filterable: boolean;
12
13
  orgId: string | number;
13
14
  currentSessionItem: import("../../../../shared/types").AnyObject;
14
15
  id: string;
@@ -1,6 +1,8 @@
1
+ import { Ref } from 'vue';
1
2
  import { AnyObject } from '../../../../shared/types';
2
3
  import { UploadFileInfo } from 'naive-ui';
3
4
  export type IState = {
5
+ filterable: Ref<boolean>;
4
6
  orgId: number | string;
5
7
  currentSessionItem: AnyObject;
6
8
  id: string;