cnhis-design-vue 3.2.9-beta.19 → 3.2.9-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/base-search/index.d.ts +2 -0
- package/es/components/base-search/src/index.vue.d.ts +2 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/iho-chat/index.d.ts +245 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +245 -1
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +121 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +122 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +120 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +1 -0
- package/es/components/iho-chat/src/hooks/useSession.js +1 -1
- package/es/components/iho-chat/src/hooks/useState.d.ts +5 -0
- package/es/components/iho-chat/src/hooks/useState.js +1 -1
- package/es/components/iho-chat/src/utils/chatSock.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/quick-search/index.d.ts +3 -0
- package/es/components/quick-search/src/index.vue.d.ts +3 -0
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +2 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/index.js +1 -1
- package/package.json +2 -2
@@ -384,6 +384,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
384
384
|
options: import("vue").Ref<AnyObject[]>;
|
385
385
|
groupName: import("vue").Ref<string>;
|
386
386
|
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
387
|
+
remark: import("vue").Ref<string>;
|
387
388
|
userList: import("vue").Ref<AnyObject[]>;
|
388
389
|
handleInput: () => void;
|
389
390
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -463,6 +464,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
463
464
|
};
|
464
465
|
}>> & {}>>;
|
465
466
|
state: IState;
|
467
|
+
relayMessage: (param: {
|
468
|
+
checkedIds: string[];
|
469
|
+
remark: string;
|
470
|
+
content: AnyObject;
|
471
|
+
}) => Promise<void>;
|
466
472
|
imageList: import("vue").Ref<AnyObject[]>;
|
467
473
|
fileList: import("vue").Ref<AnyObject[]>;
|
468
474
|
imageRef: import("vue").Ref<any>;
|
@@ -477,7 +483,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
477
483
|
handleSearch: () => Promise<void>;
|
478
484
|
formatImageList: (data: AnyObject[]) => {
|
479
485
|
label: string;
|
480
|
-
list:
|
486
|
+
list: any;
|
481
487
|
}[];
|
482
488
|
resetAndSearch: () => void;
|
483
489
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
@@ -490,8 +496,122 @@ declare const _default: import("vue").DefineComponent<{
|
|
490
496
|
NIcon: any;
|
491
497
|
NTooltip: any;
|
492
498
|
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<{}>>, {}>;
|
499
|
+
OpenOutline: 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<{}>>, {}>;
|
493
500
|
DownloadOutline: 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<{}>>, {}>;
|
494
501
|
downloadFile: typeof import("./utils").downloadFile;
|
502
|
+
ChatAdd: import("vue").DefineComponent<{
|
503
|
+
title: {
|
504
|
+
type: StringConstructor;
|
505
|
+
default: string;
|
506
|
+
};
|
507
|
+
mode: {
|
508
|
+
type: StringConstructor;
|
509
|
+
default: string;
|
510
|
+
};
|
511
|
+
options: {
|
512
|
+
type: PropType<AnyObject[]>;
|
513
|
+
};
|
514
|
+
disabledIds: {
|
515
|
+
type: PropType<string[]>;
|
516
|
+
default: () => never[];
|
517
|
+
};
|
518
|
+
defaultValue: {
|
519
|
+
type: PropType<AnyObject[]>;
|
520
|
+
default: () => never[];
|
521
|
+
};
|
522
|
+
}, {
|
523
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
524
|
+
title: {
|
525
|
+
type: StringConstructor;
|
526
|
+
default: string;
|
527
|
+
};
|
528
|
+
mode: {
|
529
|
+
type: StringConstructor;
|
530
|
+
default: string;
|
531
|
+
};
|
532
|
+
options: {
|
533
|
+
type: PropType<AnyObject[]>;
|
534
|
+
};
|
535
|
+
disabledIds: {
|
536
|
+
type: PropType<string[]>;
|
537
|
+
default: () => never[];
|
538
|
+
};
|
539
|
+
defaultValue: {
|
540
|
+
type: PropType<AnyObject[]>;
|
541
|
+
default: () => never[];
|
542
|
+
};
|
543
|
+
}>> & {
|
544
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
545
|
+
}>>;
|
546
|
+
emit: (event: "comfirm", ...args: any[]) => void;
|
547
|
+
state: IState;
|
548
|
+
setCurrentSessionItem: (item: AnyObject) => void;
|
549
|
+
listRef: import("vue").Ref<any>;
|
550
|
+
keyword: import("vue").Ref<string>;
|
551
|
+
showModal: import("vue").Ref<boolean>;
|
552
|
+
checkedOptions: import("vue").Ref<AnyObject[]>;
|
553
|
+
options: import("vue").Ref<AnyObject[]>;
|
554
|
+
groupName: import("vue").Ref<string>;
|
555
|
+
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
556
|
+
remark: import("vue").Ref<string>;
|
557
|
+
userList: import("vue").Ref<AnyObject[]>;
|
558
|
+
handleInput: () => void;
|
559
|
+
_disabledIds: import("vue").ComputedRef<any[]>;
|
560
|
+
defaultOptions: import("vue").ComputedRef<{
|
561
|
+
id: any;
|
562
|
+
name: any;
|
563
|
+
avatar: any;
|
564
|
+
}[]>;
|
565
|
+
checkedIds: import("vue").ComputedRef<any[]>;
|
566
|
+
btnDisabled: import("vue").ComputedRef<boolean>;
|
567
|
+
allChecked: import("vue").WritableComputedRef<boolean>;
|
568
|
+
handlePositiveClick: () => Promise<void>;
|
569
|
+
updateCheckedSourceIds: () => void;
|
570
|
+
handleSourceIdsUpdate: (value: (string | number)[], meta: {
|
571
|
+
actionType: "check" | "uncheck";
|
572
|
+
value: string | number;
|
573
|
+
}) => void;
|
574
|
+
closeTag: (id: string) => void;
|
575
|
+
NModal: any;
|
576
|
+
NButton: any;
|
577
|
+
NSpace: any;
|
578
|
+
NAvatar: any;
|
579
|
+
NIcon: any;
|
580
|
+
NTag: any;
|
581
|
+
NInput: any;
|
582
|
+
NCheckbox: any;
|
583
|
+
NCheckboxGroup: any;
|
584
|
+
NTooltip: any;
|
585
|
+
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<{}>>, {}>;
|
586
|
+
AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
587
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
588
|
+
title: {
|
589
|
+
type: StringConstructor;
|
590
|
+
default: string;
|
591
|
+
};
|
592
|
+
mode: {
|
593
|
+
type: StringConstructor;
|
594
|
+
default: string;
|
595
|
+
};
|
596
|
+
options: {
|
597
|
+
type: PropType<AnyObject[]>;
|
598
|
+
};
|
599
|
+
disabledIds: {
|
600
|
+
type: PropType<string[]>;
|
601
|
+
default: () => never[];
|
602
|
+
};
|
603
|
+
defaultValue: {
|
604
|
+
type: PropType<AnyObject[]>;
|
605
|
+
default: () => never[];
|
606
|
+
};
|
607
|
+
}>> & {
|
608
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
609
|
+
}, {
|
610
|
+
defaultValue: AnyObject[];
|
611
|
+
mode: string;
|
612
|
+
title: string;
|
613
|
+
disabledIds: string[];
|
614
|
+
}>;
|
495
615
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
496
616
|
type: {
|
497
617
|
type: StringConstructor;
|
@@ -704,6 +824,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
704
824
|
options: import("vue").Ref<AnyObject[]>;
|
705
825
|
groupName: import("vue").Ref<string>;
|
706
826
|
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
827
|
+
remark: import("vue").Ref<string>;
|
707
828
|
userList: import("vue").Ref<AnyObject[]>;
|
708
829
|
handleInput: () => void;
|
709
830
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -768,12 +889,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
768
889
|
chatMainRef: import("vue").Ref<HTMLElement | undefined>;
|
769
890
|
state: IState;
|
770
891
|
setMsgList: (list?: AnyObject[]) => void;
|
892
|
+
relayMessage: (param: {
|
893
|
+
checkedIds: string[];
|
894
|
+
remark: string;
|
895
|
+
content: AnyObject;
|
896
|
+
}) => Promise<void>;
|
771
897
|
setCurrentSessionItem: (item: AnyObject) => void;
|
772
898
|
isGroupChat: import("vue").ComputedRef<boolean>;
|
773
899
|
contextmenuRef: import("vue").Ref<any>;
|
774
900
|
showMenu: import("vue").Ref<boolean>;
|
775
901
|
menuPosition: any;
|
776
902
|
menuMsgId: import("vue").Ref<any>;
|
903
|
+
relayTriggerRef: import("vue").Ref<any>;
|
777
904
|
pageInfo: {
|
778
905
|
page: number;
|
779
906
|
hasMore: boolean;
|
@@ -800,6 +927,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
800
927
|
resetInfo: () => void;
|
801
928
|
setReferenceMsg: (msgItem: AnyObject) => void;
|
802
929
|
handleSelect: (key: string, msgItem: AnyObject) => void;
|
930
|
+
handleRelay: (checkedIds: string[], remark: string) => void;
|
803
931
|
reEdit: (item: AnyObject) => void;
|
804
932
|
NAvatar: any;
|
805
933
|
NImageGroup: any;
|
@@ -985,6 +1113,119 @@ declare const _default: import("vue").DefineComponent<{
|
|
985
1113
|
}, {
|
986
1114
|
show: boolean;
|
987
1115
|
}>;
|
1116
|
+
ChatAdd: import("vue").DefineComponent<{
|
1117
|
+
title: {
|
1118
|
+
type: StringConstructor;
|
1119
|
+
default: string;
|
1120
|
+
};
|
1121
|
+
mode: {
|
1122
|
+
type: StringConstructor;
|
1123
|
+
default: string;
|
1124
|
+
};
|
1125
|
+
options: {
|
1126
|
+
type: PropType<AnyObject[]>;
|
1127
|
+
};
|
1128
|
+
disabledIds: {
|
1129
|
+
type: PropType<string[]>;
|
1130
|
+
default: () => never[];
|
1131
|
+
};
|
1132
|
+
defaultValue: {
|
1133
|
+
type: PropType<AnyObject[]>;
|
1134
|
+
default: () => never[];
|
1135
|
+
};
|
1136
|
+
}, {
|
1137
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1138
|
+
title: {
|
1139
|
+
type: StringConstructor;
|
1140
|
+
default: string;
|
1141
|
+
};
|
1142
|
+
mode: {
|
1143
|
+
type: StringConstructor;
|
1144
|
+
default: string;
|
1145
|
+
};
|
1146
|
+
options: {
|
1147
|
+
type: PropType<AnyObject[]>;
|
1148
|
+
};
|
1149
|
+
disabledIds: {
|
1150
|
+
type: PropType<string[]>;
|
1151
|
+
default: () => never[];
|
1152
|
+
};
|
1153
|
+
defaultValue: {
|
1154
|
+
type: PropType<AnyObject[]>;
|
1155
|
+
default: () => never[];
|
1156
|
+
};
|
1157
|
+
}>> & {
|
1158
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
1159
|
+
}>>;
|
1160
|
+
emit: (event: "comfirm", ...args: any[]) => void;
|
1161
|
+
state: IState;
|
1162
|
+
setCurrentSessionItem: (item: AnyObject) => void;
|
1163
|
+
listRef: import("vue").Ref<any>;
|
1164
|
+
keyword: import("vue").Ref<string>;
|
1165
|
+
showModal: import("vue").Ref<boolean>;
|
1166
|
+
checkedOptions: import("vue").Ref<AnyObject[]>;
|
1167
|
+
options: import("vue").Ref<AnyObject[]>;
|
1168
|
+
groupName: import("vue").Ref<string>;
|
1169
|
+
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
1170
|
+
remark: import("vue").Ref<string>;
|
1171
|
+
userList: import("vue").Ref<AnyObject[]>;
|
1172
|
+
handleInput: () => void;
|
1173
|
+
_disabledIds: import("vue").ComputedRef<any[]>;
|
1174
|
+
defaultOptions: import("vue").ComputedRef<{
|
1175
|
+
id: any;
|
1176
|
+
name: any;
|
1177
|
+
avatar: any;
|
1178
|
+
}[]>;
|
1179
|
+
checkedIds: import("vue").ComputedRef<any[]>;
|
1180
|
+
btnDisabled: import("vue").ComputedRef<boolean>;
|
1181
|
+
allChecked: import("vue").WritableComputedRef<boolean>;
|
1182
|
+
handlePositiveClick: () => Promise<void>;
|
1183
|
+
updateCheckedSourceIds: () => void;
|
1184
|
+
handleSourceIdsUpdate: (value: (string | number)[], meta: {
|
1185
|
+
actionType: "check" | "uncheck";
|
1186
|
+
value: string | number;
|
1187
|
+
}) => void;
|
1188
|
+
closeTag: (id: string) => void;
|
1189
|
+
NModal: any;
|
1190
|
+
NButton: any;
|
1191
|
+
NSpace: any;
|
1192
|
+
NAvatar: any;
|
1193
|
+
NIcon: any;
|
1194
|
+
NTag: any;
|
1195
|
+
NInput: any;
|
1196
|
+
NCheckbox: any;
|
1197
|
+
NCheckboxGroup: any;
|
1198
|
+
NTooltip: any;
|
1199
|
+
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<{}>>, {}>;
|
1200
|
+
AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
1201
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1202
|
+
title: {
|
1203
|
+
type: StringConstructor;
|
1204
|
+
default: string;
|
1205
|
+
};
|
1206
|
+
mode: {
|
1207
|
+
type: StringConstructor;
|
1208
|
+
default: string;
|
1209
|
+
};
|
1210
|
+
options: {
|
1211
|
+
type: PropType<AnyObject[]>;
|
1212
|
+
};
|
1213
|
+
disabledIds: {
|
1214
|
+
type: PropType<string[]>;
|
1215
|
+
default: () => never[];
|
1216
|
+
};
|
1217
|
+
defaultValue: {
|
1218
|
+
type: PropType<AnyObject[]>;
|
1219
|
+
default: () => never[];
|
1220
|
+
};
|
1221
|
+
}>> & {
|
1222
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
1223
|
+
}, {
|
1224
|
+
defaultValue: AnyObject[];
|
1225
|
+
mode: string;
|
1226
|
+
title: string;
|
1227
|
+
disabledIds: string[];
|
1228
|
+
}>;
|
988
1229
|
simplifyMessage: typeof import("./utils").simplifyMessage;
|
989
1230
|
isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
|
990
1231
|
getAVTime: typeof import("./utils").getAVTime;
|
@@ -1082,6 +1323,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1082
1323
|
options: import("vue").Ref<AnyObject[]>;
|
1083
1324
|
groupName: import("vue").Ref<string>;
|
1084
1325
|
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
1326
|
+
remark: import("vue").Ref<string>;
|
1085
1327
|
userList: import("vue").Ref<AnyObject[]>;
|
1086
1328
|
handleInput: () => void;
|
1087
1329
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -1278,6 +1520,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1278
1520
|
options: import("vue").Ref<AnyObject[]>;
|
1279
1521
|
groupName: import("vue").Ref<string>;
|
1280
1522
|
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
1523
|
+
remark: import("vue").Ref<string>;
|
1281
1524
|
userList: import("vue").Ref<AnyObject[]>;
|
1282
1525
|
handleInput: () => void;
|
1283
1526
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -1505,6 +1748,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1505
1748
|
options: import("vue").Ref<AnyObject[]>;
|
1506
1749
|
groupName: import("vue").Ref<string>;
|
1507
1750
|
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
1751
|
+
remark: import("vue").Ref<string>;
|
1508
1752
|
userList: import("vue").Ref<AnyObject[]>;
|
1509
1753
|
handleInput: () => void;
|
1510
1754
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as s,reactive as
|
1
|
+
import{defineComponent as e,ref as s,reactive as t,provide as o,onBeforeUnmount as n,openBlock as r,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as l,Fragment as p,createElementVNode as m,renderSlot as h,createCommentVNode as f}from"vue";import{NConfigProvider as y,NSpin as g,NLayout as S,NLayoutContent as v}from"naive-ui";import b from"./components/SiderList.vue.js";import M from"./components/ChatHeader.vue.js";import I from"./components/ChatMain.vue.js";import k from"./components/ChatFooter.vue.js";import T from"./components/ChatSearch.vue.js";import V from"./components/ChatAdd.vue.js";import j from"./components/Video.vue.js";import L from"./components/MultipleVideo.vue.js";import{ChatSock as A}from"./utils/chatSock.js";import{instanceAxios as N,readMessageApi as w}from"./api/index.js";import{useTheme as U}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{remove as _,isNumber as C}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{CHAT_TYPE as E,SUBSCRIBE_MESSAGE_TYPE as O,AV_STATUS as x}from"./constants/index.js";import{InjectionIChatState as R,InjectionIChatStompClient as G,InjectionIChatEmits as K}from"./types/index.js";import{isAudioOrVideoMessage as B}from"./utils/index.js";import{useSession as P}from"./hooks/useSession.js";import"trtc-sdk-v5";const J={key:0,class:"iho-chat__header"},$={class:"toolbar"};var q=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},chatBox:{type:Boolean,default:!1},defaultSessionKey:{type:String}},emits:["template-click","unread-message-update"],setup(e,{expose:q,emit:F}){const H=e;N.defaults.baseURL=H.baseURL,N.defaults.headers.Authorization="bearer "+H.token;const z=U(),D=s(!1),W=s(),Y=t({orgId:H.orgId,currentSessionItem:{},id:"",userInfo:{id:H.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,currentReEditMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1});o(R,Y),o(G,W),o(K,F);const{openSession:Q,closeSession:X,getCurrentSession:Z,setSessionList:ee,setUpdateSessionItem:se,setCurrentSessionItem:te}=P(Y),oe=[];function ne(){const e={headers:{AccessToken:H.token,UserId:H.userId},heartbeatFn(){try{W.value.send("test")}catch(e){W.value.disconnect(),ne()}},connectCb(){console.log("连接成功"),W.value.subscribe("/user/topic/single",(({body:e})=>ie({body:e,chatType:E.SINGLE}))),W.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:t,currentUser:o,sessionVos:n}=s;if(Object.assign(Y.userInfo,o,t),!(null==n?void 0:n.length))return;ee(n),oe.splice(0,oe.length),oe.push(...n.filter((e=>e.chatType===E.GROUP))),oe.forEach((e=>{W.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>ie({body:e,chatType:E.GROUP})))})),function(){const e=Y.sessionList.find((e=>e.sessionKey===H.defaultSessionKey));e&&Q(e)}()}catch(e){console.log(e)}}))},errorCb(e,s){}};W.value=new A("/fdp-chat/websocket",e)}async function re(e,s){if(Y.currentMsg=e,e.sessionKey===Y.currentSessionItem.sessionKey)return Y.isAppendMsg=!0,e.sender!==Y.userInfo.id&&await w({chatType:s,messageIdSet:[e.id],receiver:Y.userInfo.id,sender:e.sender}),void te({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const t={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName,sender:e.sender};se(t)}async function ie({body:e,chatType:s}){try{const t=JSON.parse(e),{messageVo:o,sessionVo:n,chatAvStatusVo:r}=t;switch(t.event){case O.MESSAGE:B(o.content)?!Y.showVideo&&!Y.showMultipleVideo||o.content.avStatus!==x.IN_CALL?(Y.currentMsg=o,Object.assign(Y.currentAVMsg,{strRoomId:o.sessionKey,chatMessageType:o.content.chatMessageType,callMode:o.sender===Y.userInfo.id?"call":"invite",currentMsg:o}),Y.showVideo||Y.showMultipleVideo?re(o,s):Y.showVideo=!0):(W.value.send("/app/chat/send",{},JSON.stringify({chatType:E.SINGLE,receiver:o.sender,content:{chatMessageType:o.content.chatMessageType,avStatus:x.CALL_BUSY}})),console.log("用户忙!")):re(o,s);break;case O.RECALL_MESSAGE:break;case O.AV_STATUS:Object.assign(Y.currentAVMsg,r,{callMode:r.sender===Y.userInfo.id?"call":"invite",checkedIds:[]}),Y.showVideo||Y.showMultipleVideo?console.log("用户忙!"):Y.showMultipleVideo=!0;break;case O.NEW_SESSION:if(s===E.GROUP)return;se(n);break;case O.JOIN:if(s===E.GROUP)return;se(n),W.value.subscribe(`/topic/group/${n.receiver}`,(({body:e})=>ie({body:e,chatType:E.GROUP})));break;case O.LEAVE:X(),_(Y.sessionList,(e=>e.sessionKey===n.sessionKey))}}catch(e){console.log(e)}}return async function(){ne()}(),n((()=>{var e;null==(e=W.value)||e.disconnect()})),q({getUnreadData:function(){return Y.sessionList.filter((e=>C(e.unreadNum)&&e.unreadNum>0))},openSession:Q,closeSession:X,getCurrentSession:Z}),(s,t)=>(r(),i("div",{class:"iho-chat",style:a(c(z))},[d(c(y),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[D.value?(r(),l(c(g),{key:0,stroke:"#5585f5"})):(r(),i(p,{key:1},[e.chatBox?f("v-if",!0):(r(),i("div",J,[d(T),d(V,{title:"发起群聊",mode:"create","default-value":[Y.userInfo]},null,8,["default-value"]),m("div",$,[h(s.$slots,"toolbar")])])),d(c(S),{class:"iho-chat__body","has-sider":""},{default:u((()=>[e.chatBox?f("v-if",!0):(r(),l(b,{key:0})),d(c(v),{class:"chat-content"},{default:u((()=>[d(M),d(I),d(k)])),_:1}),h(s.$slots,"external")])),_:3}),Y.showVideo?(r(),l(j,{key:1})):f("v-if",!0),Y.showMultipleVideo?(r(),l(L,{key:2})):f("v-if",!0)],64))])),_:3})],4))}});export{q as default};
|
@@ -54,6 +54,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
54
54
|
options: import("vue").Ref<AnyObject[]>;
|
55
55
|
groupName: import("vue").Ref<string>;
|
56
56
|
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
57
|
+
remark: import("vue").Ref<string>;
|
57
58
|
userList: import("vue").Ref<AnyObject[]>;
|
58
59
|
handleInput: () => void;
|
59
60
|
_disabledIds: import("vue").ComputedRef<any[]>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as u,Fragment as o,createVNode as r,unref as s,withCtx as n,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as h,renderSlot as b}from"vue";import{NModal as g,NInput as
|
1
|
+
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as u,Fragment as o,createVNode as r,unref as s,withCtx as n,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as h,renderSlot as b}from"vue";import{NModal as g,NInput as y,NIcon as I,NCheckbox as k,NCheckboxGroup as w,NSpace as _,NAvatar as x,NTag as S,NTooltip as U,NButton as j}from"naive-ui";import{SearchOutline as C,AddOutline as R}from"@vicons/ionicons5";import{useState as L}from"../hooks/useState.js";import{useSession as V}from"../hooks/useSession.js";import{CHAT_TYPE as A}from"../constants/index.js";import"trtc-sdk-v5";import{listSort as E}from"../utils/index.js";import{groupLeaveApi as G,groupJoinApi as N,groupCreateApi as $}from"../api/index.js";import{cloneDeep as z,union as M,intersection as T,unionBy as D,remove as P,isArray as q,uniqBy as B,trim as F}from"lodash-es";import{useSearchUserList as H}from"../hooks/useSearchUserList.js";const J={class:"iho-chat-dialog__content iho-chat-add-wrapper"},K={key:0,class:"input-box"},O=d("span",null,"群名称:",-1),Q={class:"transfer-box"},W={class:"transfer-box__left"},X={class:"user-list-box"},Y={key:1,class:"no-data"},Z={class:"transfer-box__right"},ee={class:"checked-tag-box"},ae={key:0,class:"input-wrapper"};var le=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array,default:()=>[]}},emits:["comfirm"],setup(e,{emit:le}){const te=e,{state:ie}=L(),{setCurrentSessionItem:ue}=V(ie),oe=a(),re=a(""),se=a(!1),ne=a([]),de=a([]),ve=a(""),ce=a([]),pe=a(""),{userList:me,handleInput:fe}=H({wrapperRef:oe,keywordRef:re,before:()=>{me.value=z(de.value),we()},after:()=>{he.value.length&&me.value.forEach((e=>{var a;e.disabled=null==(a=he.value)?void 0:a.includes(e.id)})),we()}}),he=l((()=>"relay"===te.mode?[]:M(te.disabledIds,[ie.userInfo.id]))),be=l((()=>{var e,a;if(!(null==(e=ie.sessionList)?void 0:e.length))return[];const l=E(ie.sessionList);return null==(a="relay"===te.mode?l:l.filter((e=>e.chatType===A.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar})))})),ge=l((()=>ne.value.length?ne.value.map((e=>e.id)):[])),ye=l((()=>"create"===te.mode?ge.value.length<3:ge.value.length<1)),Ie=l({get:()=>ce.value.filter((e=>!he.value.includes(e))).length===me.value.filter((e=>!e.disabled)).length,set(e){const a=te.defaultValue.map((e=>e.id)),l=T(a,he.value,me.value.map((e=>e.id))),t=me.value.filter((e=>!e.disabled));ce.value=l.concat(e?t.map((e=>e.id)):[]),e?ne.value=D(ne.value,t,"id"):P(ne.value,(e=>t.map((e=>e.id)).includes(e.id)))}});async function ke(){switch(te.mode){case"create":await $({creator:ie.userInfo.id,memberIdSet:ge.value,name:F(ve.value),orgId:ie.orgId});break;case"join":if(await N({groupId:ie.currentSessionItem.receiver,operator:ie.userInfo.id,memberIdSet:ge.value}),!ie.currentSessionItem.defaultName){const e=ne.value.map((e=>e.name)).join(",");ue({name:`${ie.currentSessionItem.name},${e}`})}ie.currentGroupUser.push(...me.value.filter((e=>ge.value.includes(e.id))));break;case"remove":if(await G({dissolution:!1,groupId:ie.currentSessionItem.receiver,operator:ie.userInfo.id,memberIdSet:ge.value}),!ie.currentSessionItem.defaultName){const e=ne.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");ue({name:ie.currentSessionItem.name.replace(a,"")})}P(ie.currentGroupUser,(e=>ge.value.includes(e.id)));break;default:le("comfirm",ge.value,pe.value)}se.value=!1}function we(){var e,a;ce.value=null!=(a=null==(e=me.value.filter((e=>ge.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function _e(e,a){if("check"===a.actionType){const e=me.value.find((e=>e.id===a.value));ne.value.push(e)}else P(ne.value,(e=>e.id===a.value))}return t((()=>se.value),(e=>{if(!e)return;re.value="",ve.value="";const a=q(te.options)&&te.options.length?te.options:be.value;de.value=B(a,"id").map((e=>{var a;return{...e,disabled:null==(a=he.value)?void 0:a.includes(e.id)}})),me.value=z(de.value),q(te.defaultValue)&&te.defaultValue.length?(ne.value=z(te.defaultValue),we()):(ne.value=[],ce.value=[])})),(a,l)=>(i(),u(o,null,[r(s(g),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:se.value,"onUpdate:show":l[5]||(l[5]=e=>se.value=e),"negative-text":"取消","positive-text":"确定","display-directive":"show","positive-button-props":{disabled:s(ye)},onPositiveClick:ke},{default:n((()=>[d("div",J,["create"===e.mode?(i(),u("div",K,[O,r(s(y),{clearable:"",placeholder:"取个群名称方便后续搜索",value:ve.value,"onUpdate:value":l[0]||(l[0]=e=>ve.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),d("div",Q,[d("div",W,[r(s(y),{placeholder:"搜索",clearable:"",value:re.value,"onUpdate:value":[l[1]||(l[1]=e=>re.value=e),s(fe)],valueModifiers:{trim:!0}},{prefix:n((()=>[r(s(I),{component:s(C)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),d("div",X,[s(me).length>0?(i(),u(o,{key:0},[r(s(k),{label:"全选",checked:s(Ie),"onUpdate:checked":l[2]||(l[2]=e=>c(Ie)?Ie.value=e:null)},null,8,["checked"]),r(s(w),{ref_key:"listRef",ref:oe,value:ce.value,"onUpdate:value":[l[3]||(l[3]=e=>ce.value=e),_e]},{default:n((()=>[(i(!0),u(o,null,p(s(me),(e=>(i(),m(s(k),{key:e.id,value:e.id,disabled:e.disabled},{default:n((()=>[r(s(_),{align:"center","wrap-item":!1},{default:n((()=>[r(s(x),{src:e.avatar,round:"",size:32},null,8,["src"]),d("span",null,f(e.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),u("div",Y,"找不到相关结果"))])]),d("div",Z,[d("span",null,"已选择 "+f(s(ge).length)+" 人",1),d("div",ee,[(i(!0),u(o,null,p(ne.value,(a=>(i(),m(s(S),{key:a.id,bordered:!1,closable:"relay"===e.mode||a.id!==s(ie).userInfo.id,disabled:s(he).includes(a.id),onClose:()=>{return e=a.id,P(ne.value,(a=>a.id===e)),void P(ce.value,(a=>a===e));var e}},{avatar:n((()=>[r(s(x),{round:"",src:a.avatar},null,8,["src"])])),default:n((()=>[h(" "+f(a.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))]),"relay"===e.mode?(i(),u("div",ae,[r(s(y),{clearable:"",value:pe.value,"onUpdate:value":l[4]||(l[4]=e=>pe.value=e),type:"textarea",placeholder:"留言",autosize:{minRows:2,maxRows:2}},null,8,["value"])])):v("v-if",!0)])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:l[6]||(l[6]=e=>se.value=!0)},[b(a.$slots,"trigger",{},(()=>[r(s(U),{"show-arrow":!1,placement:"bottom"},{trigger:n((()=>[r(s(j),{color:"#ffffff4D",class:"add-btn"},{icon:n((()=>[r(s(I),{component:s(R),color:"#fff"},null,8,["component"])])),_:1})])),default:n((()=>[h(" "+f(e.title),1)])),_:1})]))])],64))}});export{le as default};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { PropType } from 'vue';
|
1
2
|
import { AnyObject } from '../../../../shared/types';
|
2
3
|
import { downloadFile } from '../utils';
|
3
4
|
declare const _default: import("vue").DefineComponent<{
|
@@ -20,6 +21,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
20
21
|
};
|
21
22
|
}>> & {}>>;
|
22
23
|
state: import("../types").IState;
|
24
|
+
relayMessage: (param: {
|
25
|
+
checkedIds: string[];
|
26
|
+
remark: string;
|
27
|
+
content: AnyObject;
|
28
|
+
}) => Promise<void>;
|
23
29
|
imageList: import("vue").Ref<AnyObject[]>;
|
24
30
|
fileList: import("vue").Ref<AnyObject[]>;
|
25
31
|
imageRef: import("vue").Ref<any>;
|
@@ -34,7 +40,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
34
40
|
handleSearch: () => Promise<void>;
|
35
41
|
formatImageList: (data: AnyObject[]) => {
|
36
42
|
label: string;
|
37
|
-
list:
|
43
|
+
list: any;
|
38
44
|
}[];
|
39
45
|
resetAndSearch: () => void;
|
40
46
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
@@ -47,8 +53,122 @@ declare const _default: import("vue").DefineComponent<{
|
|
47
53
|
NIcon: any;
|
48
54
|
NTooltip: any;
|
49
55
|
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<{}>>, {}>;
|
56
|
+
OpenOutline: 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<{}>>, {}>;
|
50
57
|
DownloadOutline: 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<{}>>, {}>;
|
51
58
|
downloadFile: typeof downloadFile;
|
59
|
+
ChatAdd: import("vue").DefineComponent<{
|
60
|
+
title: {
|
61
|
+
type: StringConstructor;
|
62
|
+
default: string;
|
63
|
+
};
|
64
|
+
mode: {
|
65
|
+
type: StringConstructor;
|
66
|
+
default: string;
|
67
|
+
};
|
68
|
+
options: {
|
69
|
+
type: PropType<AnyObject[]>;
|
70
|
+
};
|
71
|
+
disabledIds: {
|
72
|
+
type: PropType<string[]>;
|
73
|
+
default: () => never[];
|
74
|
+
};
|
75
|
+
defaultValue: {
|
76
|
+
type: PropType<AnyObject[]>;
|
77
|
+
default: () => never[];
|
78
|
+
};
|
79
|
+
}, {
|
80
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
81
|
+
title: {
|
82
|
+
type: StringConstructor;
|
83
|
+
default: string;
|
84
|
+
};
|
85
|
+
mode: {
|
86
|
+
type: StringConstructor;
|
87
|
+
default: string;
|
88
|
+
};
|
89
|
+
options: {
|
90
|
+
type: PropType<AnyObject[]>;
|
91
|
+
};
|
92
|
+
disabledIds: {
|
93
|
+
type: PropType<string[]>;
|
94
|
+
default: () => never[];
|
95
|
+
};
|
96
|
+
defaultValue: {
|
97
|
+
type: PropType<AnyObject[]>;
|
98
|
+
default: () => never[];
|
99
|
+
};
|
100
|
+
}>> & {
|
101
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
102
|
+
}>>;
|
103
|
+
emit: (event: "comfirm", ...args: any[]) => void;
|
104
|
+
state: import("../types").IState;
|
105
|
+
setCurrentSessionItem: (item: AnyObject) => void;
|
106
|
+
listRef: import("vue").Ref<any>;
|
107
|
+
keyword: import("vue").Ref<string>;
|
108
|
+
showModal: import("vue").Ref<boolean>;
|
109
|
+
checkedOptions: import("vue").Ref<AnyObject[]>;
|
110
|
+
options: import("vue").Ref<AnyObject[]>;
|
111
|
+
groupName: import("vue").Ref<string>;
|
112
|
+
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
113
|
+
remark: import("vue").Ref<string>;
|
114
|
+
userList: import("vue").Ref<AnyObject[]>;
|
115
|
+
handleInput: () => void;
|
116
|
+
_disabledIds: import("vue").ComputedRef<any[]>;
|
117
|
+
defaultOptions: import("vue").ComputedRef<{
|
118
|
+
id: any;
|
119
|
+
name: any;
|
120
|
+
avatar: any;
|
121
|
+
}[]>;
|
122
|
+
checkedIds: import("vue").ComputedRef<any[]>;
|
123
|
+
btnDisabled: import("vue").ComputedRef<boolean>;
|
124
|
+
allChecked: import("vue").WritableComputedRef<boolean>;
|
125
|
+
handlePositiveClick: () => Promise<void>;
|
126
|
+
updateCheckedSourceIds: () => void;
|
127
|
+
handleSourceIdsUpdate: (value: (string | number)[], meta: {
|
128
|
+
actionType: "check" | "uncheck";
|
129
|
+
value: string | number;
|
130
|
+
}) => void;
|
131
|
+
closeTag: (id: string) => void;
|
132
|
+
NModal: any;
|
133
|
+
NButton: any;
|
134
|
+
NSpace: any;
|
135
|
+
NAvatar: any;
|
136
|
+
NIcon: any;
|
137
|
+
NTag: any;
|
138
|
+
NInput: any;
|
139
|
+
NCheckbox: any;
|
140
|
+
NCheckboxGroup: any;
|
141
|
+
NTooltip: any;
|
142
|
+
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<{}>>, {}>;
|
143
|
+
AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
144
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
145
|
+
title: {
|
146
|
+
type: StringConstructor;
|
147
|
+
default: string;
|
148
|
+
};
|
149
|
+
mode: {
|
150
|
+
type: StringConstructor;
|
151
|
+
default: string;
|
152
|
+
};
|
153
|
+
options: {
|
154
|
+
type: PropType<AnyObject[]>;
|
155
|
+
};
|
156
|
+
disabledIds: {
|
157
|
+
type: PropType<string[]>;
|
158
|
+
default: () => never[];
|
159
|
+
};
|
160
|
+
defaultValue: {
|
161
|
+
type: PropType<AnyObject[]>;
|
162
|
+
default: () => never[];
|
163
|
+
};
|
164
|
+
}>> & {
|
165
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
166
|
+
}, {
|
167
|
+
defaultValue: AnyObject[];
|
168
|
+
mode: string;
|
169
|
+
title: string;
|
170
|
+
disabledIds: string[];
|
171
|
+
}>;
|
52
172
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
53
173
|
type: {
|
54
174
|
type: StringConstructor;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,watch as o,openBlock as s,createBlock as
|
1
|
+
import{defineComponent as e,ref as t,computed as a,watch as o,openBlock as s,createBlock as r,unref as i,withCtx as n,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as d,Fragment as p,renderList as u,toDisplayString as f,vShow as h,normalizeStyle as y,createTextVNode as g}from"vue";import{NModal as v,NImageGroup as w,NImage as k,NInput as M,NIcon as b,NTooltip as _}from"naive-ui";import{SearchOutline as I,OpenOutline as T,DownloadOutline as S}from"@vicons/ionicons5";import{searchChatRecordApi as j}from"../api/index.js";import{useTheme as x}from"../../../../shared/hooks/useTheme.js";import{useDebounceFn as A}from"@vueuse/core";import{format as C,isSameWeek as H,isSameMonth as D}from"date-fns";import{last as z}from"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as L}from"../../../../shared/hooks/useScrollLoading.js";import{useState as U}from"../hooks/useState.js";import{getFileSize as E,downloadFile as O}from"../utils/index.js";import"trtc-sdk-v5";import $ from"./ChatAdd.vue.js";const F={class:"label"},P={class:"image-box"},R={class:"file-type"},B={class:"text"},G={class:"name"},N={class:"detail"},q={class:"opt-box"};var J=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const J=e,K=x(),{state:Q,relayMessage:V}=U(),W=t([]),X=t([]),Y=t(),Z=t(),ee=t(),te=A(se,500),ae={page:0,hasMore:!0,lastSendTime:C(new Date,"yyyy-MM-dd HH:mm:ss")};async function oe(){var e;try{if(!ae.hasMore)return;ae.page++;const t=await j({orgId:Q.orgId,keyword:ee.value,endTime:"",startTime:"",lastSendTime:ae.lastSendTime,memberIdSet:[],page:ae.page,recordType:"image"===J.type?"IMAGE":"FILE",receiver:Q.currentSessionItem.receiver,userId:Q.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(ae.hasMore=!1);let a=t||[];if(Array.isArray(t)&&t.length>0&&(a=t[0].recordList),ae.lastSendTime=null==(e=z(a))?void 0:e.sendTime,"image"===J.type){const e=function(e){const t={};e.forEach((e=>{const a=new Date(e.sendTime);let o=C(a,"yyyy年MM月");H(a,new Date)?o="本周":D(a,new Date)&&(o="本月"),t[o]||(t[o]=[]),t[o].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(a);W.value=ae.page>1?W.value.concat(e):e}else{const e=a.map((e=>new Promise((async t=>{const a=await E(e.content.fileUrl);t({...e,size:a})})))),t=await Promise.all(e);X.value=ae.page>1?X.value.concat(t):t}}catch(e){}}function se(){Object.assign(ae,{page:0,hasMore:!0,lastSendTime:C(new Date,"yyyy-MM-dd HH:mm:ss")}),oe()}L(Y,(()=>{oe()})),L(Z,(()=>{oe()}));const re=a((()=>"image"===J.type?"聊天图片":"聊天文件"));function ie(e){const{size:t,sendTime:a,senderName:o}=e;return`${t} · ${C(new Date(a),"yyyy/MM/dd HH:mm")} ${o}`}function ne(e){var t;const a=(null==(t=e.content)?void 0:t.msg)||"",o=a.lastIndexOf(".");if(-1!==o){return a.charAt(o+1).toUpperCase()}return"?"}return o((()=>J.visible),(e=>{e?se():ee.value=""})),(t,a)=>(s(),r(i(v),{preset:"dialog",title:i(re),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:n((()=>[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:Y},[m(i(w),{"show-toolbar-tooltip":""},{default:n((()=>[(s(!0),d(p,null,u(W.value,(e=>(s(),d("div",{class:"image-item",key:e.label},[c("span",F,f(e.label),1),c("div",P,[(s(!0),d(p,null,u(e.list,(e=>(s(),r(i(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[h,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:y(i(K))},[m(i(M),{clearable:"",placeholder:"搜索文件",value:ee.value,"onUpdate:value":a[0]||(a[0]=e=>ee.value=e),valueModifiers:{trim:!0},onInput:i(te)},{prefix:n((()=>[m(i(b),{component:i(I)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:Z},[(s(!0),d(p,null,u(X.value,((e,t)=>(s(),d("div",{class:"file-item",key:t},[c("span",R,f(ne(e)),1),c("div",B,[c("span",G,f(e.content.msg),1),c("span",N,f(ie(e)),1)]),c("div",q,[m($,{title:"转发消息",mode:"relay",onComfirm:(t,a)=>i(V)({content:e.content,checkedIds:t,remark:a})},{trigger:n((()=>[m(i(_),{"show-arrow":!1},{trigger:n((()=>[m(i(b),{size:16,component:i(T)},null,8,["component"])])),default:n((()=>[g(" 转发 ")])),_:1})])),_:2},1032,["onComfirm"]),m(i(_),{"show-arrow":!1},{trigger:n((()=>[m(i(b),{size:16,component:i(S),onClick:()=>i(O)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:n((()=>[g(" 下载 ")])),_:2},1024)])])))),128))],512)],4),[[h,"image"!==e.type]])])),_:1},8,["title"]))}});export{J as default};
|
@@ -90,6 +90,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
90
90
|
options: Ref<AnyObject[]>;
|
91
91
|
groupName: Ref<string>;
|
92
92
|
checkedSourceIds: Ref<(string | number)[]>;
|
93
|
+
remark: Ref<string>;
|
93
94
|
userList: Ref<AnyObject[]>;
|
94
95
|
handleInput: () => void;
|
95
96
|
_disabledIds: import("vue").ComputedRef<any[]>;
|