cnhis-design-vue 3.2.2-beta.24 → 3.2.2-beta.29
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/biunique-chat/index.d.ts +15 -23
- package/es/components/biunique-chat/src/Index.vue.d.ts +15 -23
- package/es/components/biunique-chat/src/Index.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatFooter.vue.d.ts +1 -1
- package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +1 -1
- package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/SiderList.vue.d.ts +8 -3
- package/es/components/biunique-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/biunique-chat/src/hooks/useSession.d.ts +1 -0
- package/es/components/biunique-chat/src/hooks/useSession.js +1 -1
- package/es/components/biunique-chat/src/hooks/useState.js +1 -1
- package/es/components/biunique-chat/src/types/index.d.ts +1 -1
- package/es/components/biunique-chat/src/utils/emoji.d.ts +1 -1
- package/es/components/biunique-chat/src/utils/emoji.js +1 -1
- package/es/components/biunique-chat/src/utils/index.js +1 -1
- package/es/components/biunique-chat/style/index.css +1 -1
- package/es/components/card-reader-sdk/src/insuranceSDK.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
- package/es/components/form-config/src/constants/index.d.ts +1 -0
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/step-notice/index.d.ts +1538 -1
- package/es/components/step-notice/src/StepNotice.vue.d.ts +1538 -1
- package/es/components/step-notice/src/StepNotice.vue2.js +1 -1
- package/es/components/step-notice/style/index.css +1 -1
- package/es/shared/assets/img/emoji/666.gif.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { SFCWithInstall } from '../../shared/types';
|
|
2
2
|
declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
3
|
-
token: {
|
|
4
|
-
type: StringConstructor;
|
|
5
|
-
required: true;
|
|
6
|
-
};
|
|
7
3
|
userId: {
|
|
8
4
|
type: StringConstructor;
|
|
9
5
|
required: true;
|
|
@@ -14,10 +10,6 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
14
10
|
};
|
|
15
11
|
}, {
|
|
16
12
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
-
token: {
|
|
18
|
-
type: StringConstructor;
|
|
19
|
-
required: true;
|
|
20
|
-
};
|
|
21
13
|
userId: {
|
|
22
14
|
type: StringConstructor;
|
|
23
15
|
required: true;
|
|
@@ -28,15 +20,15 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
28
20
|
};
|
|
29
21
|
}>> & {
|
|
30
22
|
"onTemplate-click"?: ((...args: any[]) => any) | undefined;
|
|
31
|
-
"
|
|
23
|
+
"onUnread-message-update"?: ((...args: any[]) => any) | undefined;
|
|
32
24
|
}>>;
|
|
33
|
-
emit: (event: "template-click" | "message-
|
|
25
|
+
emit: (event: "template-click" | "unread-message-update", ...args: any[]) => void;
|
|
34
26
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
35
27
|
loading: import("vue").Ref<boolean>;
|
|
36
28
|
stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock | undefined>;
|
|
37
29
|
state: {
|
|
38
30
|
currentSessionItem: import("../../shared/types").AnyObject;
|
|
39
|
-
|
|
31
|
+
id: string;
|
|
40
32
|
userInfo: import("../../shared/types").AnyObject;
|
|
41
33
|
msgList: import("../../shared/types").AnyObject[];
|
|
42
34
|
currentMsg: import("../../shared/types").AnyObject;
|
|
@@ -50,7 +42,6 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
50
42
|
init: () => Promise<void>;
|
|
51
43
|
initWebSocket: () => void;
|
|
52
44
|
subscribeSessionList: () => void;
|
|
53
|
-
subscribeSession: () => void;
|
|
54
45
|
subscribeMessage: () => void;
|
|
55
46
|
getUnreadData: () => import("../../shared/types").AnyObject[];
|
|
56
47
|
NLayout: any;
|
|
@@ -457,24 +448,29 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
457
448
|
NSpin: any;
|
|
458
449
|
NConfigProvider: any;
|
|
459
450
|
SiderList: import("vue").DefineComponent<{}, {
|
|
451
|
+
filterKey: {
|
|
452
|
+
all: string;
|
|
453
|
+
unread: string;
|
|
454
|
+
};
|
|
460
455
|
flexWidth: import("vue").Ref<number>;
|
|
461
456
|
listBoxRef: import("vue").Ref<HTMLElement | undefined>;
|
|
462
457
|
keyword: import("vue").Ref<string>;
|
|
463
|
-
sessionList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
|
464
458
|
loading: import("vue").Ref<boolean>;
|
|
465
459
|
filterList: import("vue").Ref<{
|
|
466
460
|
label: string;
|
|
467
461
|
key: string;
|
|
468
|
-
number: number;
|
|
469
462
|
}[]>;
|
|
470
463
|
currentFilterKey: import("vue").Ref<string>;
|
|
471
464
|
state: import("./src/types").IState;
|
|
465
|
+
emit: (event: string, ...args: any[]) => void;
|
|
472
466
|
entrySession: (item: import("../../shared/types").AnyObject) => void;
|
|
467
|
+
unreadTotal: import("vue").ComputedRef<number>;
|
|
473
468
|
currentWidth: import("vue").ComputedRef<number>;
|
|
474
|
-
|
|
469
|
+
sessionList: import("vue").ComputedRef<import("../../shared/types").AnyObject[]>;
|
|
475
470
|
sessionChange: (sessionItem: import("../../shared/types").AnyObject) => void;
|
|
476
471
|
changeWidth: ({ distance }: import("../../shared/types").AnyObject) => void;
|
|
477
472
|
handleFilter: (key: string) => void;
|
|
473
|
+
showSession: (item: import("../../shared/types").AnyObject, currentKey?: string) => boolean | undefined;
|
|
478
474
|
NSpin: any;
|
|
479
475
|
NBadge: any;
|
|
480
476
|
NAvatar: any;
|
|
@@ -1270,7 +1266,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1270
1266
|
required: true;
|
|
1271
1267
|
};
|
|
1272
1268
|
}>>, {}>;
|
|
1273
|
-
images: any[]
|
|
1269
|
+
images: import("vue").Ref<any[]>;
|
|
1274
1270
|
MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
|
|
1275
1271
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1276
1272
|
ChatFooter: import("vue").DefineComponent<{}, {
|
|
@@ -1287,15 +1283,11 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1287
1283
|
NButton: any;
|
|
1288
1284
|
NPopover: any;
|
|
1289
1285
|
NTooltip: any;
|
|
1290
|
-
images: any[]
|
|
1286
|
+
images: import("vue").Ref<any[]>;
|
|
1291
1287
|
alt: string[];
|
|
1292
1288
|
MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
|
|
1293
1289
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1294
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "message-
|
|
1295
|
-
token: {
|
|
1296
|
-
type: StringConstructor;
|
|
1297
|
-
required: true;
|
|
1298
|
-
};
|
|
1290
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update")[], "template-click" | "unread-message-update", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1299
1291
|
userId: {
|
|
1300
1292
|
type: StringConstructor;
|
|
1301
1293
|
required: true;
|
|
@@ -1306,7 +1298,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1306
1298
|
};
|
|
1307
1299
|
}>> & {
|
|
1308
1300
|
"onTemplate-click"?: ((...args: any[]) => any) | undefined;
|
|
1309
|
-
"
|
|
1301
|
+
"onUnread-message-update"?: ((...args: any[]) => any) | undefined;
|
|
1310
1302
|
}, {
|
|
1311
1303
|
baseURL: string;
|
|
1312
1304
|
}>>;
|
|
@@ -3,10 +3,6 @@ import { ChatSock } from './utils/chatSock';
|
|
|
3
3
|
import { AnyObject } from '../../../shared/types';
|
|
4
4
|
import { IState } from './types';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
|
-
token: {
|
|
7
|
-
type: StringConstructor;
|
|
8
|
-
required: true;
|
|
9
|
-
};
|
|
10
6
|
userId: {
|
|
11
7
|
type: StringConstructor;
|
|
12
8
|
required: true;
|
|
@@ -17,10 +13,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
13
|
};
|
|
18
14
|
}, {
|
|
19
15
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
-
token: {
|
|
21
|
-
type: StringConstructor;
|
|
22
|
-
required: true;
|
|
23
|
-
};
|
|
24
16
|
userId: {
|
|
25
17
|
type: StringConstructor;
|
|
26
18
|
required: true;
|
|
@@ -31,15 +23,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
23
|
};
|
|
32
24
|
}>> & {
|
|
33
25
|
"onTemplate-click"?: ((...args: any[]) => any) | undefined;
|
|
34
|
-
"
|
|
26
|
+
"onUnread-message-update"?: ((...args: any[]) => any) | undefined;
|
|
35
27
|
}>>;
|
|
36
|
-
emit: (event: "template-click" | "message-
|
|
28
|
+
emit: (event: "template-click" | "unread-message-update", ...args: any[]) => void;
|
|
37
29
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
38
30
|
loading: import("vue").Ref<boolean>;
|
|
39
31
|
stompClient: import("vue").Ref<ChatSock | undefined>;
|
|
40
32
|
state: {
|
|
41
33
|
currentSessionItem: AnyObject;
|
|
42
|
-
|
|
34
|
+
id: string;
|
|
43
35
|
userInfo: AnyObject;
|
|
44
36
|
msgList: AnyObject[];
|
|
45
37
|
currentMsg: AnyObject;
|
|
@@ -53,7 +45,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
45
|
init: () => Promise<void>;
|
|
54
46
|
initWebSocket: () => void;
|
|
55
47
|
subscribeSessionList: () => void;
|
|
56
|
-
subscribeSession: () => void;
|
|
57
48
|
subscribeMessage: () => void;
|
|
58
49
|
getUnreadData: () => AnyObject[];
|
|
59
50
|
NLayout: any;
|
|
@@ -460,24 +451,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
460
451
|
NSpin: any;
|
|
461
452
|
NConfigProvider: any;
|
|
462
453
|
SiderList: import("vue").DefineComponent<{}, {
|
|
454
|
+
filterKey: {
|
|
455
|
+
all: string;
|
|
456
|
+
unread: string;
|
|
457
|
+
};
|
|
463
458
|
flexWidth: import("vue").Ref<number>;
|
|
464
459
|
listBoxRef: import("vue").Ref<HTMLElement | undefined>;
|
|
465
460
|
keyword: import("vue").Ref<string>;
|
|
466
|
-
sessionList: import("vue").Ref<AnyObject[]>;
|
|
467
461
|
loading: import("vue").Ref<boolean>;
|
|
468
462
|
filterList: import("vue").Ref<{
|
|
469
463
|
label: string;
|
|
470
464
|
key: string;
|
|
471
|
-
number: number;
|
|
472
465
|
}[]>;
|
|
473
466
|
currentFilterKey: import("vue").Ref<string>;
|
|
474
467
|
state: IState;
|
|
468
|
+
emit: (event: string, ...args: any[]) => void;
|
|
475
469
|
entrySession: (item: AnyObject) => void;
|
|
470
|
+
unreadTotal: import("vue").ComputedRef<number>;
|
|
476
471
|
currentWidth: import("vue").ComputedRef<number>;
|
|
477
|
-
|
|
472
|
+
sessionList: import("vue").ComputedRef<AnyObject[]>;
|
|
478
473
|
sessionChange: (sessionItem: AnyObject) => void;
|
|
479
474
|
changeWidth: ({ distance }: AnyObject) => void;
|
|
480
475
|
handleFilter: (key: string) => void;
|
|
476
|
+
showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
|
|
481
477
|
NSpin: any;
|
|
482
478
|
NBadge: any;
|
|
483
479
|
NAvatar: any;
|
|
@@ -1273,7 +1269,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1273
1269
|
required: true;
|
|
1274
1270
|
};
|
|
1275
1271
|
}>>, {}>;
|
|
1276
|
-
images: any[]
|
|
1272
|
+
images: import("vue").Ref<any[]>;
|
|
1277
1273
|
MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
|
|
1278
1274
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1279
1275
|
ChatFooter: import("vue").DefineComponent<{}, {
|
|
@@ -1290,15 +1286,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1290
1286
|
NButton: any;
|
|
1291
1287
|
NPopover: any;
|
|
1292
1288
|
NTooltip: any;
|
|
1293
|
-
images: any[]
|
|
1289
|
+
images: import("vue").Ref<any[]>;
|
|
1294
1290
|
alt: string[];
|
|
1295
1291
|
MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
|
|
1296
1292
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1297
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "message-
|
|
1298
|
-
token: {
|
|
1299
|
-
type: StringConstructor;
|
|
1300
|
-
required: true;
|
|
1301
|
-
};
|
|
1293
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update")[], "template-click" | "unread-message-update", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1302
1294
|
userId: {
|
|
1303
1295
|
type: StringConstructor;
|
|
1304
1296
|
required: true;
|
|
@@ -1309,7 +1301,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1309
1301
|
};
|
|
1310
1302
|
}>> & {
|
|
1311
1303
|
"onTemplate-click"?: ((...args: any[]) => any) | undefined;
|
|
1312
|
-
"
|
|
1304
|
+
"onUnread-message-update"?: ((...args: any[]) => any) | undefined;
|
|
1313
1305
|
}, {
|
|
1314
1306
|
baseURL: string;
|
|
1315
1307
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as s,reactive as t,provide as o,onBeforeUnmount 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 u,withCtx as d,createBlock as m,Fragment as p,createElementVNode as l,renderSlot as h}from"vue";import{NConfigProvider as f,NSpin as v,NLayout as S,NLayoutContent as g}from"naive-ui";import b from"./components/SiderList.vue.js";import y from"./components/ChatHeader.vue.js";import j from"./components/ChatMain.vue.js";import I from"./components/ChatFooter.vue.js";import{ChatSock as _}from"./utils/chatSock.js";import{instanceAxios as k}from"./api/index.js";import{useTheme as M}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as L}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{SUBSCRIBE_MESSAGE_TYPE as U}from"./constants/index.js";import{InjectionIChatState as x,InjectionIChatStompClient as C,InjectionIChatEmits as N}from"./types/index.js";import"./utils/emoji.js";import{useSession as T}from"./hooks/useSession.js";const q={class:"c-biunique-chat__header"},E={class:"toolbar"};var O=e({__name:"Index",props:{userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"}},emits:["template-click","unread-message-update"],setup(e,{expose:O,emit:V}){const w=e;k.defaults.baseURL=w.baseURL+"/chat";const A=M(),J=s(!1),R=s(),F=t({currentSessionItem:{},id:"",userInfo:{},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1});function H(){const e={headers:{UserId:w.userId},heartbeatFn:()=>{try{R.value.send("test")}catch(e){R.value.disconnect(),H()}},connectCb:()=>{console.log("连接成功"),R.value.subscribe("/user/topic/single",(({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:t,sessionVo:o}=s;switch(s.event){case U.MESSAGE:if(s.messageVo.sender===F.userInfo.id)return;t.sender===F.currentSessionItem.receiver&&(F.currentMsg=t,F.isAppendMsg=!0),F.updateSessionItem={receiver:t.sender,lastMessageSendTime:t.sendTime,sortTime:t.sendTime,lastMessage:t.content.msg,chatMessageType:t.content.chatMessageType},F.isUpdateSession=!0;break;case U.NEW_SESSION:F.updateSessionItem=o,F.isUpdateSession=!0}}catch(e){console.log(e)}})),R.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{currentUser:t,sessionVos:o}=s;if(console.log("body",s),F.userInfo=t,!(null==o?void 0:o.length))return;F.sessionList=o}catch(e){console.log(e)}}))},errorCb:(e,s)=>{console.log("断线了,正在重连...")}};R.value=new _("/fdp-chat/websocket",e)}return o(x,F),o(C,R),o(N,V),async function(){H()}(),n((()=>{var e;null==(e=R.value)||e.disconnect()})),O({getUnreadData:function(){return F.sessionList.filter((e=>L(e.unreadNum)&&e.unreadNum>0))},entrySession:T(F).entrySession}),(e,s)=>(r(),i("div",{class:"c-biunique-chat",style:a(c(A))},[u(c(f),{abstract:"",namespace:"c-biunique-chat__popover"},{default:d((()=>[J.value?(r(),m(c(v),{key:0,stroke:"#5585f5"})):(r(),i(p,{key:1},[l("div",q,[l("div",E,[h(e.$slots,"toolbar")])]),u(c(S),{class:"c-biunique-chat__body","has-sider":""},{default:d((()=>[u(b),u(c(g),{class:"chat-content"},{default:d((()=>[u(y),u(j),u(I)])),_:1}),h(e.$slots,"external")])),_:3})],64))])),_:3})],4))}});export{O as default};
|
|
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
14
14
|
NButton: any;
|
|
15
15
|
NPopover: any;
|
|
16
16
|
NTooltip: any;
|
|
17
|
-
images: any[]
|
|
17
|
+
images: import("vue").Ref<any[]>;
|
|
18
18
|
alt: string[];
|
|
19
19
|
MESSAGE_TYPE: typeof MESSAGE_TYPE;
|
|
20
20
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as t,ref as e,
|
|
1
|
+
import{defineComponent as t,ref as e,withDirectives as s,openBlock as n,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as r,createVNode as c,withCtx as l,createCommentVNode as u,Fragment as d,renderList as g,createBlock as m,createTextVNode as p,toDisplayString as f,vShow as h}from"vue";import{NPopover as y,NTooltip as v,NButton as M}from"naive-ui";import{format as T}from"date-fns";import{useState as k}from"../hooks/useState.js";import{useSession as x}from"../hooks/useSession.js";import{images as b,alt as E}from"../utils/emoji.js";import{MESSAGE_TYPE as S}from"../constants/index.js";const w={class:"tool-box"},C=r("span",null,[r("i",{class:"chat--iconfont chat--icon-face"})],-1),I={class:"emoji-box"},j=r("span",null,"默认表情",-1),_={class:"list-box"},K=["onClick"],D=["src"],H=[r("i",{class:"chat--iconfont chat--icon-good"},null,-1)],J=r("span",null,[r("i",{class:"chat--iconfont chat--icon-image"})],-1),L=r("span",null,[r("i",{class:"chat--iconfont chat--icon-folder"})],-1),N={class:"btn-box"},O=r("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var X=t({__name:"ChatFooter",setup(t){const X=e(),A=e(""),{state:B,stompClient:F}=k(),{setCurrentSessionItem:G}=x(B);function R(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),z()))}function q(){var t,e;A.value=(null==(e=null==(t=X.value)?void 0:t.innerText)?void 0:e.trim())||""}function z(){if(!(A.value.length>2e3))return A.value?void P({msg:A.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function P(t){const{chatMessageType:e=S.TEXT,msg:s}=t,n={msg:s,chatMessageType:e};[S.TEXT,S.BLEND].includes(e)&&(X.value.innerHTML="",A.value="");const i=T(new Date,"yyyy-MM-dd HH:mm:ss");B.currentMsg={content:n,sender:B.userInfo.id,id:"",sendTime:i,sending:!0,fail:!1},B.isAppendMsg=!0,G({lastMessageSendTime:i,lastMessage:n.msg,sortTime:i,chatMessageType:n.chatMessageType}),B.isChangeSession=!0;try{F.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:{chatMessageType:n.chatMessageType,msg:n.msg},receiver:B.currentSessionItem.receiver})),B.currentMsg={...B.currentMsg,fail:!1}}catch(t){B.currentMsg={...B.currentMsg,fail:!0}}finally{B.currentMsg={...B.currentMsg,sending:!1}}}return(t,e)=>s((n(),i("section",{class:"chat-footer",style:a({cursor:o(B).id?"default":"not-allowed"})},[r("div",w,[c(o(y),{placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:l((()=>[C])),default:l((()=>[r("div",I,[u(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),j,r("div",_,[(n(!0),i(d,null,g(o(b),((t,e)=>(n(),i(d,{key:e},[e>0?(n(),m(o(v),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:l((()=>[r("i",{onClick:()=>P({chatMessageType:o(S).EMOJI,msg:e})},[r("img",{src:t},null,8,D)],8,K)])),default:l((()=>[p(" "+f(o(E)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1}),r("span",{onClick:e[0]||(e[0]=()=>P({chatMessageType:o(S).EMOJI,msg:0}))},H),J,L]),s(r("div",{ref_key:"inputRef",ref:X,class:"input-box",contenteditable:"",onKeydown:R,onInput:q},null,544),[[h,o(B).id]]),r("div",N,[O,c(o(M),{type:"primary",round:"",disabled:!A.value,onClick:z},{default:l((()=>[p("发送")])),_:1},8,["disabled"])])],4)),[[h,o(B).id]])}});export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as a,openBlock as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as a,openBlock as t,createElementBlock as s,Fragment as i,unref as n,createElementVNode as c,createVNode as r,withCtx as l,toDisplayString as u,createCommentVNode as h}from"vue";import{NAvatar as m}from"naive-ui";import{useState as v}from"../hooks/useState.js";import f from"./PersonProfile.vue.js";import d from"./ChatSet.vue.js";import p from"./ChatFile.vue.js";import w from"./ChatRecord.vue.js";const C={key:0,class:"chat-header box-shadow"},_={class:"chat-header__left"},g={class:"name"},k={class:"chat-header__right"};var j=e({__name:"ChatHeader",setup(e){const{state:j}=v(),S=o(!1),y=o(!1),I=o("image"),U=o(!1),x=a((()=>j.currentSessionItem.name||""));function P(e){I.value=e,y.value=!0}return(e,o)=>(t(),s(i,null,[n(j).id?(t(),s("section",C,[c("div",_,[r(f,{"user-info":n(j).currentSessionItem},{trigger:l((()=>[r(n(m),{round:"",size:30,src:n(j).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-info"]),c("span",g,u(n(x)),1)]),c("div",k,[c("i",{class:"chat--iconfont chat--icon-image",onClick:o[0]||(o[0]=()=>P("image"))}),c("i",{class:"chat--iconfont chat--icon-folder",onClick:o[1]||(o[1]=()=>P("file"))}),c("i",{class:"chat--iconfont chat--icon-list-search",onClick:o[2]||(o[2]=e=>U.value=!0)}),c("i",{class:"chat--iconfont chat--icon-set",onClick:o[3]||(o[3]=e=>S.value=!0)})])])):h("v-if",!0),r(d,{show:S.value,"onUpdate:show":o[4]||(o[4]=e=>S.value=e)},null,8,["show"]),r(p,{show:y.value,"onUpdate:show":o[5]||(o[5]=e=>y.value=e),type:I.value},null,8,["show","type"]),r(w,{show:U.value,"onUpdate:show":o[6]||(o[6]=e=>U.value=e)},null,8,["show"])],64))}});export{j as default};
|
|
@@ -141,7 +141,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
141
141
|
required: true;
|
|
142
142
|
};
|
|
143
143
|
}>>, {}>;
|
|
144
|
-
images: any[]
|
|
144
|
+
images: import("vue").Ref<any[]>;
|
|
145
145
|
MESSAGE_TYPE: typeof MESSAGE_TYPE;
|
|
146
146
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
147
147
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,
|
|
1
|
+
import{defineComponent as e,ref as t,watch as s,openBlock as n,createElementBlock as i,Fragment as r,renderList as o,unref as a,normalizeClass as m,toDisplayString as c,createCommentVNode as l,createBlock as u,createElementVNode as d,createVNode as f,withCtx as g}from"vue";import{NAvatar as p}from"naive-ui";import{useInfiniteScroll as y,promiseTimeout as v}from"@vueuse/core";import{isToday as T,format as M,isYesterday as h}from"date-fns";import{getHistoryRecordApi as H}from"../api/index.js";import{useState as L}from"../hooks/useState.js";import{isNumber as k}from"lodash-es";import E from"./PersonProfile.vue.js";import j from"./MessageTemplate.vue.js";import{images as A}from"../utils/emoji.js";import{MESSAGE_TYPE as _}from"../constants/index.js";const I={key:0,class:"time"},w={class:"message-box"},D=["data-time"],P=["innerHTML"],x=["src"];var F=e({__name:"ChatMain",setup(e){const F=t(),{state:J,setMsgList:K}=L();let O=1;async function R(){try{const e=await H({sessionKey:J.currentSessionItem.sessionKey,page:O});if(console.log("getHistoryRecord",e,O),!Array.isArray(e))return;if(0===e.length)return console.log("没有更多消息了");K(O>1?[...e,...J.msgList]:e),1===O&&b()}catch(e){console.log(e)}}function S(e){var t;const{chatMessageType:s,msgTemplate:n}=e.content;return s===_.TEMPLATE&&2==(null==(t=null==n?void 0:n.setting)?void 0:t.style.id)}function Y(e,t){var s;const n=k(e.sendTime)?e.sendTime:Date.parse(e.sendTime),i=null==(s=J.msgList[t-1])?void 0:s.sendTime;return n-(0===t?0:k(i)?i:Date.parse(i))>3e5}async function b(){var e,t,s;await v(50);const n=null!=(t=null==(e=F.value)?void 0:e.scrollHeight)?t:0;null==(s=F.value)||s.scrollTo({top:n})}function z(e){const t=new Date(e),s=Date.now()-t.getTime();if(s<6e4)return"刚刚";if(s<36e5)return Math.ceil(s/1e4/60)+"分钟前";if(T(t))return"今天 "+M(t,"HH:mm");if(h(t))return"昨天 "+M(t,"HH:mm");{const e=t.getFullYear(),s=(new Date).getFullYear();return M(t,e<s?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}return y(F,(()=>{O++,R()}),{distance:20,direction:"top"}),s((()=>J.id),(e=>{e&&(O=1,R())}),{immediate:!0}),s((()=>J.isAppendMsg),(e=>{e&&(K([...J.msgList,J.currentMsg]),J.isAppendMsg=!1,b())}),{immediate:!0}),(e,t)=>(n(),i("div",{class:"chat-main",ref_key:"chatMainRef",ref:F},[(n(!0),i(r,null,o(a(J).msgList,((e,t)=>(n(),i("div",{class:m(["message-item",{"message-item--mine":e.sender==a(J).userInfo.id}]),key:t},[Y(e,t)?(n(),i("p",I,c(z(e.sendTime)),1)):l("v-if",!0),S(e)?(n(),u(j,{key:1,data:e},null,8,["data"])):l("v-if",!0),d("div",w,[f(E,{"user-info":e.sender==a(J).userInfo.id?a(J).userInfo:e},{trigger:g((()=>[f(a(p),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-info"]),e.content?(n(),i("div",{key:0,class:m(["content",{emoji:e.content.chatMessageType===a(_).EMOJI},{template:e.content.chatMessageType===a(_).TEMPLATE}]),"data-time":e.__time},[e.content.chatMessageType===a(_).TEXT?(n(),i("pre",{key:0,innerHTML:e.__content},null,8,P)):l("v-if",!0),e.content.chatMessageType===a(_).EMOJI?(n(),i("img",{key:1,src:a(A)[e.content.msg]},null,8,x)):l("v-if",!0),e.content.chatMessageType===a(_).TEMPLATE?(n(),u(j,{key:2,data:e},null,8,["data"])):l("v-if",!0)],10,D)):l("v-if",!0)])],2)))),128))],512))}});export{F as default};
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
|
2
2
|
import { formatTime } from '../utils';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
4
|
+
filterKey: {
|
|
5
|
+
all: string;
|
|
6
|
+
unread: string;
|
|
7
|
+
};
|
|
4
8
|
flexWidth: import("vue").Ref<number>;
|
|
5
9
|
listBoxRef: import("vue").Ref<HTMLElement | undefined>;
|
|
6
10
|
keyword: import("vue").Ref<string>;
|
|
7
|
-
sessionList: import("vue").Ref<AnyObject[]>;
|
|
8
11
|
loading: import("vue").Ref<boolean>;
|
|
9
12
|
filterList: import("vue").Ref<{
|
|
10
13
|
label: string;
|
|
11
14
|
key: string;
|
|
12
|
-
number: number;
|
|
13
15
|
}[]>;
|
|
14
16
|
currentFilterKey: import("vue").Ref<string>;
|
|
15
17
|
state: import("../types").IState;
|
|
18
|
+
emit: (event: string, ...args: any[]) => void;
|
|
16
19
|
entrySession: (item: AnyObject) => void;
|
|
20
|
+
unreadTotal: import("vue").ComputedRef<number>;
|
|
17
21
|
currentWidth: import("vue").ComputedRef<number>;
|
|
18
|
-
|
|
22
|
+
sessionList: import("vue").ComputedRef<AnyObject[]>;
|
|
19
23
|
sessionChange: (sessionItem: AnyObject) => void;
|
|
20
24
|
changeWidth: ({ distance }: AnyObject) => void;
|
|
21
25
|
handleFilter: (key: string) => void;
|
|
26
|
+
showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
|
|
22
27
|
NSpin: any;
|
|
23
28
|
NBadge: any;
|
|
24
29
|
NAvatar: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as s,computed as i,watch as
|
|
1
|
+
import{defineComponent as e,ref as s,computed as i,watch as a,withDirectives as n,openBlock as t,createElementBlock as l,normalizeStyle as r,unref as o,createBlock as u,createCommentVNode as d,createElementVNode as v,Fragment as c,renderList as m,withCtx as p,createTextVNode as f,toDisplayString as k,normalizeClass as h,createVNode as y,vShow as _}from"vue";import{NSpin as S,NTag as g,NAvatar as b,NBadge as x}from"naive-ui";import{useState as M}from"../hooks/useState.js";import{useSession as L}from"../hooks/useSession.js";import{vFlexibleResize as C}from"../../../../shared/directive/flexibleResize.js";import{listSort as j,formatTime as T}from"../utils/index.js";const w={class:"sider-list__filter box-shadow"},I=["onClick"],N={class:"avatar-right"},R={class:"name"},z={class:"msg-tip"},H={class:"msg-tip__content"},U=["innerHTML"];var B=e({__name:"SiderList",setup(e){const B="all",E="unread",O=s(300),V=s();s("");const q=s(!1),A=s([{label:"全部",key:B},{label:"未读",key:E}]),D=s("all"),{state:F,emit:G}=M(),{entrySession:J,unreadTotal:K}=L(F),P=i((()=>Math.min(Math.max(O.value,240),360))),Q=i((()=>j(F.sessionList)));function W(e){!e.id||F.sessionList.map((e=>e.id)).includes(e.id)?F.sessionList.forEach((s=>{s.receiver===e.receiver&&(Object.assign(s,e),e.receiver!==F.currentSessionItem.receiver&&s.unreadNum++)})):F.sessionList.push(e)}function X({distance:e}){O.value=O.value+e}function Y(e,s=o(D)){var i;return s===B||(s===E?(null!=(i=e.unreadNum)?i:0)>0:void 0)}return a([()=>F.isChangeSession,()=>F.isUpdateSession],(([e,s])=>{e&&(W(F.currentSessionItem),F.isChangeSession=!1),s&&(W(F.updateSessionItem),F.isUpdateSession=!1)}),{immediate:!0}),a((()=>K.value),(e=>{const s=Q.value.filter((e=>Y(e,E)));G("unread-message-update",e,s)})),(e,s)=>n((t(),l("section",{class:"sider-list",style:r({width:o(P)+"px"})},[q.value?(t(),u(o(S),{key:0,stroke:"#5585f5"})):d("v-if",!0),d(' <n-input v-else placeholder="输入用户名模糊搜索" v-model:value="keyword" @keyup.enter="handleSearch"></n-input> '),v("div",w,[(t(!0),l(c,null,m(A.value,(e=>(t(),u(o(g),{type:D.value===e.key?"info":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return s=e.key,void(D.value=s);var s}},{default:p((()=>[f(k(e.label)+"("+k(o(K))+") ",1)])),_:2},1032,["type","onClick"])))),128))]),v("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:V},[(t(!0),l(c,null,m(o(Q),((e,s)=>n((t(),l("div",{key:s,onClick:()=>o(J)(e),class:h(["sider-list__box__item",{active:e.id===o(F).id}])},[y(o(b),{round:"",size:"large",src:e.avatar},null,8,["src"]),v("div",N,[v("div",R,[v("h4",null,k(e.name),1),v("span",null,k(o(T)(e.lastMessageSendTime).siderMsgTime),1)]),v("div",z,[v("div",H,[v("div",{innerHTML:e.lastMessage},null,8,U)]),y(o(x),{value:e.unreadNum},null,8,["value"])])])],10,I)),[[_,Y(e)]]))),128))],512)],4)),[[o(C),{mode:"VR",onMove:X}]])}});export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformLastMessage as s}from"../utils/index.js";function
|
|
1
|
+
import{computed as e}from"vue";import{transformLastMessage as s}from"../utils/index.js";function n(n){function t(e){Object.assign(n.currentSessionItem,e,e.lastMessage?{lastMessage:s(e)}:{}),n.id!==n.currentSessionItem.id&&(n.id=n.currentSessionItem.id)}return{entrySession:function(e){e.unreadNum=0,t(e),n.isChangeSession=!0},setCurrentSessionItem:t,unreadTotal:e((()=>n.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0)))}}export{n as useSession};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as t}from"vue";import{formatTime as
|
|
1
|
+
import{inject as t}from"vue";import{last as e}from"lodash-es";import{formatTime as n,transformMessage as s}from"../utils/index.js";import{InjectionIChatState as i,InjectionIChatStompClient as m,InjectionIChatEmits as o}from"../types/index.js";function r(){const r=t(i),g=t(m),c=t(o);return{state:r,setMsgList:function(t=[]){var i;r.msgList=t.sort(((t,e)=>{var i;return Object.assign(t,{__time:n(t.sendTime).msgTime,__content:s(null==(i=t.content)?void 0:i.msg)}),new Date(t.sendTime).getTime()-new Date(e.sendTime).getTime()}));const m=e(r.msgList);m.__time=n(m.sendTime).msgTime,m.__content=s(null==(i=m.content)?void 0:i.msg)},stompClient:g,emit:c}}export{r as useState};
|
|
@@ -3,7 +3,7 @@ import { AnyObject } from '../../../../shared/types';
|
|
|
3
3
|
import { ChatSock } from '../utils/chatSock';
|
|
4
4
|
export declare type IState = {
|
|
5
5
|
currentSessionItem: AnyObject;
|
|
6
|
-
|
|
6
|
+
id: string;
|
|
7
7
|
userInfo: AnyObject;
|
|
8
8
|
msgList: AnyObject[];
|
|
9
9
|
currentMsg: AnyObject;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const images: any[]
|
|
1
|
+
export declare const images: import("vue").Ref<any[]>;
|
|
2
2
|
export declare const alt: string[];
|