cnhis-design-vue 3.2.3-beta.15 → 3.2.3-beta.17
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 +21 -2
- package/es/components/biunique-chat/src/Index.vue.d.ts +21 -2
- package/es/components/biunique-chat/src/Index.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatHeader.vue.d.ts +2 -0
- package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +5 -2
- package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatRecord.vue.d.ts +2 -0
- package/es/components/biunique-chat/src/components/MessageTemplate.vue.d.ts +2 -1
- package/es/components/biunique-chat/src/components/MessageTemplate.vue2.js +1 -1
- 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/utils/index.d.ts +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/calendar/index.d.ts +11 -2
- package/es/components/calendar/src/Calendar.vue.d.ts +11 -1
- package/es/components/classification/index.d.ts +6 -0
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +6 -0
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +6 -0
- package/es/components/classification/src/index.vue.d.ts +6 -0
- package/es/components/date-picker/index.d.ts +2 -0
- package/es/components/date-picker/src/DatePicker.vue.d.ts +2 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +4 -0
- package/es/components/field-set/src/components/condition.vue.d.ts +2 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +4 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +2 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +2 -0
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +2 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +4 -0
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +4 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +4 -0
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +8 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +8 -0
- package/es/shared/hooks/index.js +1 -1
- package/es/shared/hooks/useDateTime.d.ts +1 -0
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/index.d.ts +3 -3
- package/package.json +2 -2
- package/es/components/node_modules/naive-ui/node_modules/date-fns/docs/logo.svg +0 -26
- package/es/components/node_modules/naive-ui/node_modules/date-fns/docs/logotype.svg +0 -1
|
@@ -1,5 +1,9 @@
|
|
|
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
|
+
};
|
|
3
7
|
userId: {
|
|
4
8
|
type: StringConstructor;
|
|
5
9
|
required: true;
|
|
@@ -10,6 +14,10 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
10
14
|
};
|
|
11
15
|
}, {
|
|
12
16
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
token: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
13
21
|
userId: {
|
|
14
22
|
type: StringConstructor;
|
|
15
23
|
required: true;
|
|
@@ -39,6 +47,8 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
39
47
|
isUpdateSession: boolean;
|
|
40
48
|
};
|
|
41
49
|
reConnention: number;
|
|
50
|
+
entrySession: (item: import("../../shared/types").AnyObject) => void;
|
|
51
|
+
setSessionList: (list: import("../../shared/types").AnyObject[]) => void;
|
|
42
52
|
init: () => Promise<void>;
|
|
43
53
|
initWebSocket: () => void;
|
|
44
54
|
subscribeSessionList: () => void;
|
|
@@ -1091,6 +1101,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1091
1101
|
datePickerRef: import("vue").Ref<import("../../shared/types").AnyObject | null>;
|
|
1092
1102
|
panelInstRef: import("vue").Ref<null>;
|
|
1093
1103
|
placeholderRef: import("vue").Ref<any>;
|
|
1104
|
+
oldValue: string;
|
|
1094
1105
|
currentFormattedValue: import("vue").WritableComputedRef<(string | [string, string]) | null | undefined>;
|
|
1095
1106
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
1096
1107
|
formatRef: import("vue").ComputedRef<string>;
|
|
@@ -1101,6 +1112,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1101
1112
|
onUpdateShow: (show: boolean) => Promise<void>;
|
|
1102
1113
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
1103
1114
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
1115
|
+
setShortcutValue: (type: "month" | "week") => Promise<void>;
|
|
1104
1116
|
NDatePicker: any;
|
|
1105
1117
|
}, 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<{
|
|
1106
1118
|
updateUnchangedValue: {
|
|
@@ -1132,7 +1144,9 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1132
1144
|
page: number;
|
|
1133
1145
|
getHistoryRecord: () => Promise<void>;
|
|
1134
1146
|
accessSession: () => Promise<void>;
|
|
1135
|
-
|
|
1147
|
+
showMessage: (item: import("../../shared/types").AnyObject) => boolean;
|
|
1148
|
+
showTemplateMsg: (item: import("../../shared/types").AnyObject, type: "template" | "system") => boolean | undefined;
|
|
1149
|
+
isTemplate3: (content: import("../../shared/types").AnyObject) => boolean;
|
|
1136
1150
|
needShowTime: (item: import("../../shared/types").AnyObject, index: number) => boolean;
|
|
1137
1151
|
setScrollToButtom: () => Promise<void>;
|
|
1138
1152
|
getIntervalMsgTime: (time: string) => string;
|
|
@@ -1411,7 +1425,8 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1411
1425
|
contentList: import("vue").ComputedRef<any>;
|
|
1412
1426
|
toolbarButton: import("vue").ComputedRef<any>;
|
|
1413
1427
|
bottomButton: import("vue").ComputedRef<any>;
|
|
1414
|
-
|
|
1428
|
+
dbParamsList: import("vue").ComputedRef<any>;
|
|
1429
|
+
messageTemplateData: import("vue").ComputedRef<any>;
|
|
1415
1430
|
getSystemMsgContent: () => any;
|
|
1416
1431
|
handleTemplateClick: (data: import("../../shared/types").AnyObject) => void;
|
|
1417
1432
|
NButton: any;
|
|
@@ -1502,6 +1517,10 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1502
1517
|
MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
|
|
1503
1518
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1504
1519
|
}, 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<{
|
|
1520
|
+
token: {
|
|
1521
|
+
type: StringConstructor;
|
|
1522
|
+
required: true;
|
|
1523
|
+
};
|
|
1505
1524
|
userId: {
|
|
1506
1525
|
type: StringConstructor;
|
|
1507
1526
|
required: true;
|
|
@@ -3,6 +3,10 @@ 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
|
+
};
|
|
6
10
|
userId: {
|
|
7
11
|
type: StringConstructor;
|
|
8
12
|
required: true;
|
|
@@ -13,6 +17,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
17
|
};
|
|
14
18
|
}, {
|
|
15
19
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
token: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
16
24
|
userId: {
|
|
17
25
|
type: StringConstructor;
|
|
18
26
|
required: true;
|
|
@@ -42,6 +50,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
42
50
|
isUpdateSession: boolean;
|
|
43
51
|
};
|
|
44
52
|
reConnention: number;
|
|
53
|
+
entrySession: (item: AnyObject) => void;
|
|
54
|
+
setSessionList: (list: AnyObject[]) => void;
|
|
45
55
|
init: () => Promise<void>;
|
|
46
56
|
initWebSocket: () => void;
|
|
47
57
|
subscribeSessionList: () => void;
|
|
@@ -1094,6 +1104,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1094
1104
|
datePickerRef: import("vue").Ref<AnyObject | null>;
|
|
1095
1105
|
panelInstRef: import("vue").Ref<null>;
|
|
1096
1106
|
placeholderRef: import("vue").Ref<any>;
|
|
1107
|
+
oldValue: string;
|
|
1097
1108
|
currentFormattedValue: import("vue").WritableComputedRef<(string | [string, string]) | null | undefined>;
|
|
1098
1109
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
1099
1110
|
formatRef: import("vue").ComputedRef<string>;
|
|
@@ -1104,6 +1115,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1104
1115
|
onUpdateShow: (show: boolean) => Promise<void>;
|
|
1105
1116
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
1106
1117
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
1118
|
+
setShortcutValue: (type: "month" | "week") => Promise<void>;
|
|
1107
1119
|
NDatePicker: any;
|
|
1108
1120
|
}, 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<{
|
|
1109
1121
|
updateUnchangedValue: {
|
|
@@ -1135,7 +1147,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1135
1147
|
page: number;
|
|
1136
1148
|
getHistoryRecord: () => Promise<void>;
|
|
1137
1149
|
accessSession: () => Promise<void>;
|
|
1138
|
-
|
|
1150
|
+
showMessage: (item: AnyObject) => boolean;
|
|
1151
|
+
showTemplateMsg: (item: AnyObject, type: "template" | "system") => boolean | undefined;
|
|
1152
|
+
isTemplate3: (content: AnyObject) => boolean;
|
|
1139
1153
|
needShowTime: (item: AnyObject, index: number) => boolean;
|
|
1140
1154
|
setScrollToButtom: () => Promise<void>;
|
|
1141
1155
|
getIntervalMsgTime: (time: string) => string;
|
|
@@ -1414,7 +1428,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1414
1428
|
contentList: import("vue").ComputedRef<any>;
|
|
1415
1429
|
toolbarButton: import("vue").ComputedRef<any>;
|
|
1416
1430
|
bottomButton: import("vue").ComputedRef<any>;
|
|
1417
|
-
|
|
1431
|
+
dbParamsList: import("vue").ComputedRef<any>;
|
|
1432
|
+
messageTemplateData: import("vue").ComputedRef<any>;
|
|
1418
1433
|
getSystemMsgContent: () => any;
|
|
1419
1434
|
handleTemplateClick: (data: AnyObject) => void;
|
|
1420
1435
|
NButton: any;
|
|
@@ -1505,6 +1520,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1505
1520
|
MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
|
|
1506
1521
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1507
1522
|
}, 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<{
|
|
1523
|
+
token: {
|
|
1524
|
+
type: StringConstructor;
|
|
1525
|
+
required: true;
|
|
1526
|
+
};
|
|
1508
1527
|
userId: {
|
|
1509
1528
|
type: StringConstructor;
|
|
1510
1529
|
required: true;
|
|
@@ -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 r,openBlock as n,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 S,NLayout as v,NLayoutContent as b}from"naive-ui";import g from"./components/SiderList.vue.js";import y from"./components/ChatHeader.vue.js";import k from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import{ChatSock as I}from"./utils/chatSock.js";import{instanceAxios as _}from"./api/index.js";import{useTheme as L}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as U}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 x}from"./constants/index.js";import{InjectionIChatState as M,InjectionIChatStompClient as C,InjectionIChatEmits as N}from"./types/index.js";import"./utils/emoji.js";import{useSession as q}from"./hooks/useSession.js";const T={class:"c-biunique-chat__header"},A={class:"toolbar"};var E=e({__name:"Index",props:{token:{type:String,required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"}},emits:["template-click","unread-message-update"],setup(e,{expose:E,emit:O}){const V=e;_.defaults.baseURL=V.baseURL+"/chat",_.defaults.headers.Authorization="bearer"+V.token;const w=L(),J=s(!1),R=s(),F=t({currentSessionItem:{},id:"",userInfo:{},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1});o(M,F),o(C,R),o(N,O);const{entrySession:H,setSessionList:$}=q(F);function z(){const e={headers:{AccessToken:V.token,UserId:V.userId},heartbeatFn:()=>{try{R.value.send("test")}catch(e){R.value.disconnect(),z()}},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 x.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},F.isUpdateSession=!0;break;case x.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(F.userInfo=t,!(null==o?void 0:o.length))return;$(o)}catch(e){console.log(e)}}))},errorCb:(e,s)=>{console.log("断线了,正在重连...")}};R.value=new I("/fdp-chat/websocket",e)}return async function(){z()}(),r((()=>{var e;null==(e=R.value)||e.disconnect()})),E({getUnreadData:function(){return F.sessionList.filter((e=>U(e.unreadNum)&&e.unreadNum>0))},entrySession:H}),(e,s)=>(n(),i("div",{class:"c-biunique-chat",style:a(c(w))},[u(c(f),{abstract:"",namespace:"c-biunique-chat__popover"},{default:d((()=>[J.value?(n(),m(c(S),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[l("div",T,[l("div",A,[h(e.$slots,"toolbar")])]),u(c(v),{class:"c-biunique-chat__body","has-sider":""},{default:d((()=>[u(g),u(c(b),{class:"chat-content"},{default:d((()=>[u(y),u(k),u(j)])),_:1}),h(e.$slots,"external")])),_:3})],64))])),_:3})],4))}});export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as r,withCtx as c,createCommentVNode as u,Fragment as d,renderList as
|
|
1
|
+
import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as r,withCtx as c,createCommentVNode as u,Fragment as d,renderList as f,createBlock as p,createTextVNode as m,toDisplayString as g,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as x}from"naive-ui";import{format as C}from"date-fns";import{useState as T}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as E,alt as I}from"../utils/emoji.js";import{MESSAGE_TYPE as w}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],X={class:"btn-box"},z=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var B=t({__name:"ChatFooter",setup(t){const B=e(),R=e(""),{state:U,stompClient:q}=T(),{setCurrentSessionItem:P}=b(U);function Q(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Y()))}function V(){var t,e;R.value=(null==(e=null==(t=B.value)?void 0:t.innerText)?void 0:e.trim())||""}async function W(t,e){console.log(W,t);const{file:n,name:s}=t.file,i=new FormData;i.append("sender",U.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");Z({chatMessageType:e,msg:e===w.FILE?s:a,url:a})}function Y(){if(!(R.value.length>2e3))return R.value?void Z({msg:R.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function Z(t){const{chatMessageType:e=w.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===w.FILE&&(i.fileUrl=s),[w.TEXT,w.BLEND].includes(e)&&(B.value.innerHTML="",R.value="");const a=C(new Date,"yyyy-MM-dd HH:mm:ss");U.currentMsg={content:i,sender:U.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},U.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i,sortTime:a}),U.isChangeSession=!0;try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:U.currentSessionItem.receiver})),U.currentMsg={...U.currentMsg,fail:!1}}catch(t){U.currentMsg={...U.currentMsg,fail:!0}}finally{U.currentMsg={...U.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(U).id?"default":"not-allowed"})},[l("div",S,[r(o(v),{placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:c((()=>[j])),default:c((()=>[l("div",L,[u(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,f(o(E),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),p(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:c((()=>[l("i",{onClick:()=>Z({chatMessageType:o(w).EMOJI,msg:e})},[l("img",{src:t},null,8,H)],8,D)])),default:c((()=>[m(" "+g(o(I)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1}),l("span",{onClick:e[0]||(e[0]=()=>Z({chatMessageType:o(w).EMOJI,msg:0}))},J),r(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[1]||(e[1]=t=>W(t,o(w).IMAGE))},{default:c((()=>[r(o(k),{abstract:""},{default:c((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),r(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[2]||(e[2]=t=>W(t,o(w).FILE))},{default:c((()=>[r(o(k),{abstract:""},{default:c((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:B,class:"input-box",contenteditable:"",onKeydown:Q,onInput:V},null,544),[[h,o(U).id]]),l("div",X,[z,r(o(x),{type:"primary",round:"",disabled:!R.value,onClick:Y},{default:c((()=>[m("发送")])),_:1},8,["disabled"])])],4)),[[h,o(U).id]])}});export{B as default};
|
|
@@ -609,6 +609,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
609
609
|
datePickerRef: import("vue").Ref<AnyObject | null>;
|
|
610
610
|
panelInstRef: import("vue").Ref<null>;
|
|
611
611
|
placeholderRef: import("vue").Ref<any>;
|
|
612
|
+
oldValue: string;
|
|
612
613
|
currentFormattedValue: import("vue").WritableComputedRef<(string | [string, string]) | null | undefined>;
|
|
613
614
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
614
615
|
formatRef: import("vue").ComputedRef<string>;
|
|
@@ -619,6 +620,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
619
620
|
onUpdateShow: (show: boolean) => Promise<void>;
|
|
620
621
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
621
622
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
623
|
+
setShortcutValue: (type: "month" | "week") => Promise<void>;
|
|
622
624
|
NDatePicker: any;
|
|
623
625
|
}, 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<{
|
|
624
626
|
updateUnchangedValue: {
|
|
@@ -7,7 +7,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
7
7
|
page: number;
|
|
8
8
|
getHistoryRecord: () => Promise<void>;
|
|
9
9
|
accessSession: () => Promise<void>;
|
|
10
|
-
|
|
10
|
+
showMessage: (item: AnyObject) => boolean;
|
|
11
|
+
showTemplateMsg: (item: AnyObject, type: 'system' | 'template') => boolean | undefined;
|
|
12
|
+
isTemplate3: (content: AnyObject) => boolean;
|
|
11
13
|
needShowTime: (item: AnyObject, index: number) => boolean;
|
|
12
14
|
setScrollToButtom: () => Promise<void>;
|
|
13
15
|
getIntervalMsgTime: (time: string) => string;
|
|
@@ -286,7 +288,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
286
288
|
contentList: import("vue").ComputedRef<any>;
|
|
287
289
|
toolbarButton: import("vue").ComputedRef<any>;
|
|
288
290
|
bottomButton: import("vue").ComputedRef<any>;
|
|
289
|
-
|
|
291
|
+
dbParamsList: import("vue").ComputedRef<any>;
|
|
292
|
+
messageTemplateData: import("vue").ComputedRef<any>;
|
|
290
293
|
getSystemMsgContent: () => any;
|
|
291
294
|
handleTemplateClick: (data: AnyObject) => void;
|
|
292
295
|
NButton: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,watch as
|
|
1
|
+
import{defineComponent as e,ref as t,watch as n,openBlock as s,createElementBlock as i,createVNode as o,unref as a,withCtx as r,Fragment as l,renderList as m,normalizeClass as c,toDisplayString as u,createCommentVNode as d,createBlock as f}from"vue";import{NImageGroup as p,NAvatar as g,NImage as y}from"naive-ui";import{useInfiniteScroll as v,promiseTimeout as T}from"@vueuse/core";import{isToday as M,format as h,isYesterday as _}from"date-fns";import{getHistoryRecordApi as k}from"../api/index.js";import{useState as E}from"../hooks/useState.js";import{isNumber as L}from"lodash-es";import H from"./PersonProfile.vue.js";import A from"./MessageTemplate.vue.js";import{images as j}from"../utils/emoji.js";import{MESSAGE_TYPE as I}from"../constants/index.js";const w={key:0,class:"time"},P={key:2,class:"message-box"},D=["data-time"],x=["innerHTML"],F=["src"],b=["href"];var J=e({__name:"ChatMain",setup(e){const J=t(),{state:K,setMsgList:O}=E();let S=1;async function Y(){try{const e=await k({sessionKey:K.currentSessionItem.sessionKey,page:S});if(!Array.isArray(e))return;if(0===e.length)return console.log("没有更多消息了");O(S>1?[...e,...K.msgList]:e),1===S&&U()}catch(e){console.log(e)}}function z(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==I.TEMPLATE||!!n}function C(e,t){var n,s;const{chatMessageType:i,messageTemplate:o}=e.content;if(i===I.TEMPLATE)return"system"===t?2==(null==(n=null==o?void 0:o.setting)?void 0:n.style.id):2!=(null==(s=null==o?void 0:o.setting)?void 0:s.style.id)}function G(e){var t,n;const{chatMessageType:s,messageTemplate:i}=e;return s===I.TEMPLATE&&3==(null==(n=null==(t=null==i?void 0:i.setting)?void 0:t.style)?void 0:n.id)}function R(e,t){var n;const s=L(e.sendTime)?e.sendTime:Date.parse(e.sendTime),i=null==(n=K.msgList[t-1])?void 0:n.sendTime;return s-(0===t?0:L(i)?i:Date.parse(i))>3e5}async function U(){var e,t,n;await T(50);const s=null!=(t=null==(e=J.value)?void 0:e.scrollHeight)?t:0;null==(n=J.value)||n.scrollTo({top:s})}function X(e){const t=new Date(e),n=Date.now()-t.getTime();if(n<6e4)return"刚刚";if(n<36e5)return Math.ceil(n/1e3/60)+"分钟前";if(M(t))return"今天 "+h(t,"HH:mm");if(_(t))return"昨天 "+h(t,"HH:mm");{const e=t.getFullYear(),n=(new Date).getFullYear();return h(t,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}return v(J,(()=>{S++,Y()}),{distance:10,direction:"top"}),n((()=>K.id),(e=>{e&&(S=1,Y())}),{immediate:!0}),n((()=>K.isAppendMsg),(e=>{e&&(O([...K.msgList,K.currentMsg]),K.isAppendMsg=!1,U())}),{immediate:!0}),(e,t)=>(s(),i("div",{class:"chat-main",ref_key:"chatMainRef",ref:J},[o(a(p),{"show-toolbar-tooltip":""},{default:r((()=>[(s(!0),i(l,null,m(a(K).msgList,((e,t)=>(s(),i(l,{key:t},[z(e)?(s(),i("div",{key:0,class:c(["message-item",{"message-item--mine":e.sender==a(K).userInfo.id}])},[R(e,t)?(s(),i("p",w,u(X(e.sendTime)),1)):d("v-if",!0),C(e,"system")?(s(),f(A,{key:1,data:e},null,8,["data"])):(s(),i("div",P,[o(H,{"user-info":e.sender==a(K).userInfo.id?a(K).userInfo:e},{trigger:r((()=>[o(a(g),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-info"]),e.content?(s(),i("div",{key:0,class:c(["content",{emoji:e.content.chatMessageType===a(I).EMOJI,template:e.content.chatMessageType===a(I).TEMPLATE,"template--3":G(e.content)}]),"data-time":e.__time},[e.content.chatMessageType===a(I).TEXT?(s(),i("pre",{key:0,innerHTML:e.__content},null,8,x)):d("v-if",!0),e.content.chatMessageType===a(I).EMOJI?(s(),i("img",{key:1,src:a(j)[e.__content]},null,8,F)):d("v-if",!0),C(e,"template")?(s(),f(A,{key:2,data:e},null,8,["data"])):d("v-if",!0),e.content.chatMessageType===a(I).IMAGE?(s(),f(a(y),{key:3,width:"240",src:e.__content},null,8,["src"])):d("v-if",!0),e.content.chatMessageType===a(I).FILE?(s(),i("a",{key:4,href:e.content.fileUrl},u(e.__content),9,b)):d("v-if",!0)],10,D)):d("v-if",!0)]))],2)):d("v-if",!0)],64)))),128))])),_:1})],512))}});export{J as default};
|
|
@@ -65,6 +65,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
65
65
|
datePickerRef: import("vue").Ref<AnyObject | null>;
|
|
66
66
|
panelInstRef: import("vue").Ref<null>;
|
|
67
67
|
placeholderRef: import("vue").Ref<any>;
|
|
68
|
+
oldValue: string;
|
|
68
69
|
currentFormattedValue: import("vue").WritableComputedRef<(string | [string, string]) | null | undefined>;
|
|
69
70
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
70
71
|
formatRef: import("vue").ComputedRef<string>;
|
|
@@ -75,6 +76,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
75
76
|
onUpdateShow: (show: boolean) => Promise<void>;
|
|
76
77
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
77
78
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
79
|
+
setShortcutValue: (type: "month" | "week") => Promise<void>;
|
|
78
80
|
NDatePicker: any;
|
|
79
81
|
}, 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<{
|
|
80
82
|
updateUnchangedValue: {
|
|
@@ -19,7 +19,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
19
19
|
contentList: import("vue").ComputedRef<any>;
|
|
20
20
|
toolbarButton: import("vue").ComputedRef<any>;
|
|
21
21
|
bottomButton: import("vue").ComputedRef<any>;
|
|
22
|
-
|
|
22
|
+
dbParamsList: import("vue").ComputedRef<any>;
|
|
23
|
+
messageTemplateData: import("vue").ComputedRef<any>;
|
|
23
24
|
getSystemMsgContent: () => any;
|
|
24
25
|
handleTemplateClick: (data: AnyObject) => void;
|
|
25
26
|
NButton: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,openBlock as
|
|
1
|
+
import{defineComponent as e,computed as t,openBlock as s,createElementBlock as l,Fragment as a,unref as o,createElementVNode as i,toDisplayString as n,withModifiers as c,createBlock as m,createCommentVNode as r,renderList as d,withCtx as p,createTextVNode as u,createVNode as v}from"vue";import{NIcon as f,NButton as y}from"naive-ui";import{ChevronForwardOutline as g,AlertCircleSharp as k}from"@vicons/ionicons5";import _ from"../../../../shared/components/SvgIcon/SvgIcon.vue.js";import{useState as b}from"../hooks/useState.js";const h={class:"default-msg-template__header"},C={class:"title"},T={class:"default-msg-template__body"},j=["src"],S={class:"template-content"},L={key:0,class:"default-msg-template__btn-group"},M=i("i",{class:"chat--iconfont chat--icon-more"},null,-1),x={key:1,class:"describe-msg-template"},B={class:"describe-msg-template__header"},H={class:"describe-msg-template__body"},I={class:"title"},q={class:"txt"},z=i("div",{class:"describe-msg-template__footer"},[u(" 展开全部 "),i("i",{class:"chat--iconfont chat--icon-more"})],-1),D={key:2,class:"system-msg-template"},O=["innerHTML"],P=["onClick"];var R=e({__name:"MessageTemplate",props:{data:{type:Object,required:!0}},setup(e){const R=e,{emit:w}=b(),A=t((()=>R.data.content.messageTemplate.setting)),E=t((()=>A.value.serverSetting)),F=t((()=>(E.value.topRightButton||[])[0])),G=t((()=>(A.value.content||"").split("##").filter((e=>e)))),J=t((()=>E.value.toolbar_button)),K=t((()=>(E.value.bottomButton||[])[0])),N=t((()=>A.value.dbParamsList)),Q=t((()=>R.data.content.messageTemplateData));function U(e){w("template-click",e,R.data)}return(e,t)=>(s(),l(a,null,[1==o(A).style.id?(s(),l("div",{key:0,class:"default-msg-template",onClick:t[2]||(t[2]=()=>U(o(E)))},[i("div",h,[i("span",C,n(o(A).title),1),o(F)?(s(),l("span",{key:0,class:"btn",onClick:t[0]||(t[0]=c((()=>U(o(F))),["stop"]))},n(o(F).title),1)):o(E).address?(s(),m(o(f),{key:1,component:o(g),color:"#969696"},null,8,["component"])):r("v-if",!0)]),i("div",T,[o(A).style.icon?(s(),m(o(_),{key:0,class:"logo","icon-class":o(A).style.icon},null,8,["icon-class"])):o(A).style.image?(s(),l("img",{key:1,class:"logo",src:o(A).style.image},null,8,j)):r("v-if",!0),i("div",S,[(s(!0),l(a,null,d(o(G),(e=>(s(),l("div",{key:e},n(e),1)))),128))])]),o(J)?(s(),l("div",L,[(s(!0),l(a,null,d(o(J),((e,t)=>(s(),m(o(y),{type:"primary",round:"",ghost:"",onClick:c((()=>U(e)),["stop"]),key:t},{default:p((()=>[u(n(e.title),1)])),_:2},1032,["onClick"])))),128))])):r("v-if",!0),o(K)?(s(),l("div",{key:1,class:"default-msg-template__footer",onClick:t[1]||(t[1]=c((()=>U(o(K))),["stop"]))},[u(n(o(K).title)+" ",1),M])):r("v-if",!0)])):r("v-if",!0),3==o(A).style.id?(s(),l("div",x,[i("div",B,n(o(A).title),1),i("div",H,[(s(!0),l(a,null,d(o(N),((e,t)=>(s(),l(a,{key:t},[i("div",I,n(e.desc),1),i("div",q,n(o(Q)[e.p_name]),1)],64)))),128))]),z])):r("v-if",!0),2==o(A).style.id?(s(),l("div",D,[v(o(f),{component:o(k),color:"#ffc200",size:18},null,8,["component"]),i("span",{innerHTML:G.value.join("<br>")},null,8,O),(s(!0),l(a,null,d(o(J),((e,t)=>(s(),l("span",{class:"btn",onClick:()=>U(e),key:t},n(e.title),9,P)))),128))])):r("v-if",!0)],64))}});export{R as default};
|
|
@@ -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 n,withDirectives as a,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 C}from"../hooks/useSession.js";import{vFlexibleResize as L}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}=C(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 n([()=>F.isChangeSession,()=>F.isUpdateSession],(([e,s])=>{e&&(W(F.currentSessionItem),F.isChangeSession=!1),s&&(W(F.updateSessionItem),F.isUpdateSession=!1)}),{immediate:!0}),n((()=>K.value),(e=>{const s=Q.value.filter((e=>Y(e,E)));G("unread-message-update",e,s)})),(e,s)=>a((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)=>a((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.lastMessageContent},null,8,U)]),y(o(x),{value:e.unreadNum},null,8,["value"])])])],10,I)),[[_,Y(e)]]))),128))],512)],4)),[[o(L),{mode:"VR",onMove:X}]])}});export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{computed as
|
|
1
|
+
import{computed as s}from"vue";import{transformLastMessage as e}from"../utils/index.js";function t(t){function n(s){Object.assign(t.currentSessionItem,s,{lastMessageContent:s.lastMessage?e(s.lastMessage):""}),t.id!==t.currentSessionItem.id&&(t.id=t.currentSessionItem.id)}return{entrySession:function(s){s.unreadNum=0,n(s),t.isChangeSession=!0},setCurrentSessionItem:n,unreadTotal:s((()=>t.sessionList.reduce(((s,e)=>s+ +e.unreadNum),0))),setSessionList:function(s){t.sessionList=s.map((s=>{const{lastMessage:t}=s;return{...s,lastMessageContent:t?e(t):""}}))}}}export{t as useSession};
|
|
@@ -5,4 +5,4 @@ export declare function formatTime(dateStr: string): {
|
|
|
5
5
|
};
|
|
6
6
|
export declare function listSort(list: AnyObject[]): AnyObject[];
|
|
7
7
|
export declare function transformMessage(content: string): string;
|
|
8
|
-
export declare function transformLastMessage(
|
|
8
|
+
export declare function transformLastMessage(lastMessage: AnyObject): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isToday as e,format as t,isYesterday as r}from"date-fns";import{cloneDeep as
|
|
1
|
+
import{isToday as e,format as t,isYesterday as r}from"date-fns";import{cloneDeep as n}from"lodash-es";import{MESSAGE_TYPE as a}from"../constants/index.js";import{images as s}from"./emoji.js";function i(n){const a=new Date(n);let s,i;if(e(a))s=i=t(a,"HH:mm");else{s=r(a)?"昨天":t(a,"MM-dd");const e=a.getFullYear(),n=(new Date).getFullYear();i=t(a,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:s,msgTime:i}}function o(e){return n(e).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function l(e){if(!e)return"";const t=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return e=e.toString().replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(t(),"<$1 $2>").replace(t("/"),"</$1>").replace(/\n/g,"<br>")}function p(e){var t;const{chatMessageType:r,msg:n,messageTemplate:i}=e;switch(r){case a.TEXT:return l(n);case a.IMAGE:return"[图片]";case a.FILE:return"[文件]";case a.EMOJI:return`<img alt=${n} src=${s.value[n]}>`;case a.TEMPLATE:return null==(t=null==i?void 0:i.setting)?void 0:t.title;default:return"其他消息"}}export{i as formatTime,o as listSort,p as transformLastMessage,l as transformMessage};
|