cnhis-design-vue 3.2.4-release.4 → 3.2.4-release.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1069,20 +1069,40 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1069
1069
  }>>, {
1070
1070
  type: string;
1071
1071
  }>;
1072
- ChatRecord: import("vue").DefineComponent<{}, {
1072
+ ChatRecord: import("vue").DefineComponent<{
1073
+ visible: {
1074
+ type: BooleanConstructor;
1075
+ };
1076
+ }, {
1073
1077
  tagColor: {
1074
1078
  color: string;
1075
1079
  textColor: string;
1076
1080
  };
1081
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1082
+ visible: {
1083
+ type: BooleanConstructor;
1084
+ };
1085
+ }>> & {}>>;
1077
1086
  state: import("./src/types").IState;
1078
- options: {
1079
- label: any;
1080
- value: any;
1081
- avatar: any;
1082
- }[];
1083
- user: import("vue").Ref<never[]>;
1087
+ recordRef: import("vue").Ref<any>;
1088
+ recordList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
1089
+ keyword: import("vue").Ref<any>;
1090
+ memberList: import("vue").Ref<never[]>;
1084
1091
  startTime: import("vue").Ref<any>;
1085
1092
  endTime: import("vue").Ref<any>;
1093
+ handleInput: () => void;
1094
+ currentInfo: {
1095
+ page: number;
1096
+ hasMore: boolean;
1097
+ lastSendTime: string;
1098
+ };
1099
+ handleSearch: () => Promise<void>;
1100
+ options: import("vue").ComputedRef<import("../../shared/types").AnyObject[]>;
1101
+ resetAndSearch: () => void;
1102
+ startDateDisabled: (ts: number) => boolean;
1103
+ endDateDisabled: (ts: number) => boolean;
1104
+ resetInfo: () => void;
1105
+ handleCloseTag: (type: "end" | "start" | "member", e: Event) => void;
1086
1106
  getPrefixCondition: () => (JSX.Element | null)[];
1087
1107
  renderLabel: (option: import("../../shared/types").AnyObject) => JSX.Element;
1088
1108
  NModal: any;
@@ -1168,7 +1188,15 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1168
1188
  }, {
1169
1189
  updateUnchangedValue: boolean;
1170
1190
  }>>;
1171
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1191
+ formatTime: typeof import("./src/utils").formatTime;
1192
+ MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
1193
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1194
+ visible: {
1195
+ type: BooleanConstructor;
1196
+ };
1197
+ }>>, {
1198
+ visible: boolean;
1199
+ }>;
1172
1200
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1173
1201
  ChatMain: import("vue").DefineComponent<{}, {
1174
1202
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
@@ -1186,7 +1214,6 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1186
1214
  isTemplate3: (content: import("../../shared/types").AnyObject) => boolean;
1187
1215
  needShowTime: (item: import("../../shared/types").AnyObject, index: number) => boolean;
1188
1216
  setScrollToButtom: () => Promise<void>;
1189
- getIntervalMsgTime: (time: string) => string;
1190
1217
  resetInfo: () => void;
1191
1218
  handleDownload: (url: string, filename: string) => void;
1192
1219
  NAvatar: any;
@@ -1533,6 +1560,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1533
1560
  };
1534
1561
  }>>, {}>;
1535
1562
  images: import("vue").Ref<any[]>;
1563
+ formatTime: typeof import("./src/utils").formatTime;
1536
1564
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
1537
1565
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1538
1566
  ChatFooter: import("vue").DefineComponent<{}, {
@@ -1072,20 +1072,40 @@ declare const _default: import("vue").DefineComponent<{
1072
1072
  }>>, {
1073
1073
  type: string;
1074
1074
  }>;
1075
- ChatRecord: import("vue").DefineComponent<{}, {
1075
+ ChatRecord: import("vue").DefineComponent<{
1076
+ visible: {
1077
+ type: BooleanConstructor;
1078
+ };
1079
+ }, {
1076
1080
  tagColor: {
1077
1081
  color: string;
1078
1082
  textColor: string;
1079
1083
  };
1084
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1085
+ visible: {
1086
+ type: BooleanConstructor;
1087
+ };
1088
+ }>> & {}>>;
1080
1089
  state: IState;
1081
- options: {
1082
- label: any;
1083
- value: any;
1084
- avatar: any;
1085
- }[];
1086
- user: import("vue").Ref<never[]>;
1090
+ recordRef: import("vue").Ref<any>;
1091
+ recordList: import("vue").Ref<AnyObject[]>;
1092
+ keyword: import("vue").Ref<any>;
1093
+ memberList: import("vue").Ref<never[]>;
1087
1094
  startTime: import("vue").Ref<any>;
1088
1095
  endTime: import("vue").Ref<any>;
1096
+ handleInput: () => void;
1097
+ currentInfo: {
1098
+ page: number;
1099
+ hasMore: boolean;
1100
+ lastSendTime: string;
1101
+ };
1102
+ handleSearch: () => Promise<void>;
1103
+ options: import("vue").ComputedRef<AnyObject[]>;
1104
+ resetAndSearch: () => void;
1105
+ startDateDisabled: (ts: number) => boolean;
1106
+ endDateDisabled: (ts: number) => boolean;
1107
+ resetInfo: () => void;
1108
+ handleCloseTag: (type: "end" | "start" | "member", e: Event) => void;
1089
1109
  getPrefixCondition: () => (JSX.Element | null)[];
1090
1110
  renderLabel: (option: AnyObject) => JSX.Element;
1091
1111
  NModal: any;
@@ -1171,7 +1191,15 @@ declare const _default: import("vue").DefineComponent<{
1171
1191
  }, {
1172
1192
  updateUnchangedValue: boolean;
1173
1193
  }>>;
1174
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1194
+ formatTime: typeof import("./utils").formatTime;
1195
+ MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
1196
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1197
+ visible: {
1198
+ type: BooleanConstructor;
1199
+ };
1200
+ }>>, {
1201
+ visible: boolean;
1202
+ }>;
1175
1203
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1176
1204
  ChatMain: import("vue").DefineComponent<{}, {
1177
1205
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
@@ -1189,7 +1217,6 @@ declare const _default: import("vue").DefineComponent<{
1189
1217
  isTemplate3: (content: AnyObject) => boolean;
1190
1218
  needShowTime: (item: AnyObject, index: number) => boolean;
1191
1219
  setScrollToButtom: () => Promise<void>;
1192
- getIntervalMsgTime: (time: string) => string;
1193
1220
  resetInfo: () => void;
1194
1221
  handleDownload: (url: string, filename: string) => void;
1195
1222
  NAvatar: any;
@@ -1536,6 +1563,7 @@ declare const _default: import("vue").DefineComponent<{
1536
1563
  };
1537
1564
  }>>, {}>;
1538
1565
  images: import("vue").Ref<any[]>;
1566
+ formatTime: typeof import("./utils").formatTime;
1539
1567
  MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
1540
1568
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1541
1569
  ChatFooter: import("vue").DefineComponent<{}, {
@@ -7,3 +7,4 @@ export declare function uploadFileApi(params: FormData): import("axios").AxiosPr
7
7
  export declare function listUserApi(params: AnyObject): import("axios").AxiosPromise<any>;
8
8
  export declare function getUserDetailApi(params: AnyObject): import("axios").AxiosPromise<any>;
9
9
  export declare function readMessageApi(params: AnyObject): import("axios").AxiosPromise<any>;
10
+ export declare function searchChatRecordApi(params: AnyObject): import("axios").AxiosPromise<any>;
@@ -1 +1 @@
1
- import t from"axios";function e(t){const e=[];for(const o in t){const n=t[o];Array.isArray(n)?n.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(n)}`)}return e.join("&")}const o=t.create({withCredentials:!0,timeout:5e3});function n(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/chat/openSession",data:e(t)})}function r(t){return o({method:"get",url:"/chat/recordList",params:t})}function a(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/chat/toppingSession",data:e(t)})}function s(t){return o({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function u(t){return o({method:"get",url:"/user/listUser",params:t})}function d(t){return o({method:"get",url:"/user/getUserDetail",params:t})}function i(t){return o({method:"post",url:"/chat/readMessage",data:t})}o.interceptors.response.use((t=>{var e,o;if(null==(e=t.data)?void 0:e.result)return null==(o=t.data)?void 0:o.data;console.log("请求错误")}));export{r as getHistoryRecordApi,d as getUserDetailApi,o as instanceAxios,u as listUserApi,n as openSessionApi,i as readMessageApi,a as toppingSessionApi,s as uploadFileApi};
1
+ import t from"axios";function e(t){const e=[];for(const o in t){const n=t[o];Array.isArray(n)?n.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(n)}`)}return e.join("&")}const o=t.create({withCredentials:!0,timeout:5e3});function n(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/chat/openSession",data:e(t)})}function r(t){return o({method:"get",url:"/chat/recordList",params:t})}function a(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/chat/toppingSession",data:e(t)})}function u(t){return o({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function s(t){return o({method:"get",url:"/user/listUser",params:t})}function d(t){return o({method:"get",url:"/user/getUserDetail",params:t})}function c(t){return o({method:"post",url:"/chat/readMessage",data:t})}function i(t){return o({method:"post",url:"/chat/searchChatRecord",data:t})}o.interceptors.response.use((t=>{var e,o;if(null==(e=t.data)?void 0:e.result)return null==(o=t.data)?void 0:o.data;console.log("请求错误")}));export{r as getHistoryRecordApi,d as getUserDetailApi,o as instanceAxios,s as listUserApi,n as openSessionApi,c as readMessageApi,i as searchChatRecordApi,a as toppingSessionApi,u as uploadFileApi};
@@ -565,20 +565,40 @@ declare const _default: import("vue").DefineComponent<{}, {
565
565
  }>>, {
566
566
  type: string;
567
567
  }>;
568
- ChatRecord: import("vue").DefineComponent<{}, {
568
+ ChatRecord: import("vue").DefineComponent<{
569
+ visible: {
570
+ type: BooleanConstructor;
571
+ };
572
+ }, {
569
573
  tagColor: {
570
574
  color: string;
571
575
  textColor: string;
572
576
  };
577
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
578
+ visible: {
579
+ type: BooleanConstructor;
580
+ };
581
+ }>> & {}>>;
573
582
  state: import("../types").IState;
574
- options: {
575
- label: any;
576
- value: any;
577
- avatar: any;
578
- }[];
579
- user: import("vue").Ref<never[]>;
583
+ recordRef: import("vue").Ref<any>;
584
+ recordList: import("vue").Ref<AnyObject[]>;
585
+ keyword: import("vue").Ref<any>;
586
+ memberList: import("vue").Ref<never[]>;
580
587
  startTime: import("vue").Ref<any>;
581
588
  endTime: import("vue").Ref<any>;
589
+ handleInput: () => void;
590
+ currentInfo: {
591
+ page: number;
592
+ hasMore: boolean;
593
+ lastSendTime: string;
594
+ };
595
+ handleSearch: () => Promise<void>;
596
+ options: import("vue").ComputedRef<AnyObject[]>;
597
+ resetAndSearch: () => void;
598
+ startDateDisabled: (ts: number) => boolean;
599
+ endDateDisabled: (ts: number) => boolean;
600
+ resetInfo: () => void;
601
+ handleCloseTag: (type: "end" | "start" | "member", e: Event) => void;
582
602
  getPrefixCondition: () => (JSX.Element | null)[];
583
603
  renderLabel: (option: AnyObject) => JSX.Element;
584
604
  NModal: any;
@@ -664,6 +684,14 @@ declare const _default: import("vue").DefineComponent<{}, {
664
684
  }, {
665
685
  updateUnchangedValue: boolean;
666
686
  }>>;
667
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
687
+ formatTime: typeof import("../utils").formatTime;
688
+ MESSAGE_TYPE: typeof import("../constants").MESSAGE_TYPE;
689
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
690
+ visible: {
691
+ type: BooleanConstructor;
692
+ };
693
+ }>>, {
694
+ visible: boolean;
695
+ }>;
668
696
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
669
697
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as a,openBlock as o,createElementBlock as t,Fragment as s,unref as i,createElementVNode as r,createVNode as c,withCtx as n,toDisplayString as l,createCommentVNode as u}from"vue";import{NAvatar as h}from"naive-ui";import{useState as m}from"../hooks/useState.js";import v from"./PersonProfile.vue.js";import f from"./ChatSet.vue.js";import d from"./ChatFile.vue.js";import p from"./ChatRecord.vue.js";const w={key:0,class:"chat-header box-shadow"},C={class:"chat-header__left"},_={class:"name"},g={class:"chat-header__right"};var k=e({__name:"ChatHeader",setup(e){const{state:k}=m(),j=a(!1),S=a(!1),y=a("image"),I=a(!1);function U(e){y.value=e,S.value=!0}return(e,a)=>(o(),t(s,null,[i(k).id?(o(),t("section",w,[r("div",C,[c(v,{"user-id":i(k).currentSessionItem.receiver},{trigger:n((()=>[c(i(h),{round:"",size:30,src:i(k).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id"]),r("span",_,l(i(k).currentSessionItem.name),1)]),r("div",g,[r("i",{class:"chat--iconfont chat--icon-image",onClick:a[0]||(a[0]=()=>U("image"))}),r("i",{class:"chat--iconfont chat--icon-folder",onClick:a[1]||(a[1]=()=>U("file"))}),r("i",{class:"chat--iconfont chat--icon-list-search",onClick:a[2]||(a[2]=e=>I.value=!0)}),r("i",{class:"chat--iconfont chat--icon-set",onClick:a[3]||(a[3]=e=>j.value=!0)})])])):u("v-if",!0),c(f,{show:j.value,"onUpdate:show":a[4]||(a[4]=e=>j.value=e)},null,8,["show"]),c(d,{show:S.value,"onUpdate:show":a[5]||(a[5]=e=>S.value=e),type:y.value},null,8,["show","type"]),c(p,{show:I.value,"onUpdate:show":a[6]||(a[6]=e=>I.value=e)},null,8,["show"])],64))}});export{k as default};
1
+ import{defineComponent as e,ref as a,openBlock as o,createElementBlock as s,Fragment as t,unref as i,createElementVNode as r,createVNode as c,withCtx as l,toDisplayString as n,createCommentVNode as u}from"vue";import{NAvatar as h}from"naive-ui";import{useState as v}from"../hooks/useState.js";import m from"./PersonProfile.vue.js";import f from"./ChatSet.vue.js";import d from"./ChatFile.vue.js";import p from"./ChatRecord.vue.js";const w={key:0,class:"chat-header box-shadow"},C={class:"chat-header__left"},_={class:"name"},g={class:"chat-header__right"};var k=e({__name:"ChatHeader",setup(e){const{state:k}=v(),j=a(!1),S=a(!1),b=a("image"),y=a(!1);function I(e){b.value=e,S.value=!0}return(e,a)=>(o(),s(t,null,[i(k).id?(o(),s("section",w,[r("div",C,[c(m,{"user-id":i(k).currentSessionItem.receiver},{trigger:l((()=>[c(i(h),{round:"",size:30,src:i(k).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id"]),r("span",_,n(i(k).currentSessionItem.name),1)]),r("div",g,[r("i",{class:"chat--iconfont chat--icon-image",onClick:a[0]||(a[0]=()=>I("image"))}),r("i",{class:"chat--iconfont chat--icon-folder",onClick:a[1]||(a[1]=()=>I("file"))}),r("i",{class:"chat--iconfont chat--icon-list-search",onClick:a[2]||(a[2]=e=>y.value=!0)}),r("i",{class:"chat--iconfont chat--icon-set",onClick:a[3]||(a[3]=e=>j.value=!0)})])])):u("v-if",!0),c(f,{show:j.value,"onUpdate:show":a[4]||(a[4]=e=>j.value=e)},null,8,["show"]),c(d,{show:S.value,"onUpdate:show":a[5]||(a[5]=e=>S.value=e),type:b.value},null,8,["show","type"]),c(p,{show:y.value,"onUpdate:show":a[6]||(a[6]=e=>y.value=e),visible:y.value},null,8,["show","visible"])],64))}});export{k as default};
@@ -1,4 +1,5 @@
1
1
  import { AnyObject } from '../../../../shared/types';
2
+ import { formatTime } from '../utils';
2
3
  import { MESSAGE_TYPE } from '../constants';
3
4
  declare const _default: import("vue").DefineComponent<{}, {
4
5
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
@@ -16,7 +17,6 @@ declare const _default: import("vue").DefineComponent<{}, {
16
17
  isTemplate3: (content: AnyObject) => boolean;
17
18
  needShowTime: (item: AnyObject, index: number) => boolean;
18
19
  setScrollToButtom: () => Promise<void>;
19
- getIntervalMsgTime: (time: string) => string;
20
20
  resetInfo: () => void;
21
21
  handleDownload: (url: string, filename: string) => void;
22
22
  NAvatar: any;
@@ -363,6 +363,7 @@ declare const _default: import("vue").DefineComponent<{}, {
363
363
  };
364
364
  }>>, {}>;
365
365
  images: import("vue").Ref<any[]>;
366
+ formatTime: typeof formatTime;
366
367
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
367
368
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
368
369
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as s,openBlock as n,createElementBlock as o,normalizeClass as i,unref as a,createVNode as r,withCtx as m,Fragment as l,renderList as c,toDisplayString as d,createCommentVNode as u,createBlock as p,withModifiers as f}from"vue";import{NImageGroup as g,NAvatar as y,NImage as T}from"naive-ui";import{format as v,isToday as M,isYesterday as h}from"date-fns";import{getHistoryRecordApi as k,readMessageApi as L}from"../api/index.js";import{useState as E}from"../hooks/useState.js";import{useSession as _}from"../hooks/useSession.js";import{first as w,last as H,isNumber as S}from"lodash-es";import j from"./PersonProfile.vue.js";import I from"./MessageTemplate.vue.js";import{images as A}from"../utils/emoji.js";import{MESSAGE_TYPE as b}from"../constants/index.js";import{useScrollLoading as D}from"../hooks/useScrollLoading.js";const P={key:0,class:"time"},R={key:2,class:"message-box"},U=["data-time"],O=["innerHTML"],x=["src"],C=["href","onClick"];var F=e({__name:"ChatMain",setup(e){const F=t(),{state:G,setMsgList:N}=E(),{setCurrentSessionItem:J}=_(G),K={page:0,hasMore:!0,lastSendTime:v(new Date,"yyyy-MM-dd HH:mm:ss")};async function X(){try{if(!K.hasMore)return;K.page++;const e=await k({sessionKey:G.currentSessionItem.sessionKey,page:K.page,lastSendTime:K.lastSendTime});if(!Array.isArray(e)||0===e.length)return K.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=w(e).id;K.lastSendTime=H(e).sendTime,N(K.page>1?[...e,...G.msgList]:e),1===K.page&&G.currentSessionItem.unreadNum&&(await L({chatType:"SINGLE",messageIdSet:t,receiver:G.userInfo.id,sender:G.currentSessionItem.receiver}),J({unreadNum:0}))}catch(e){console.log(e)}}function Y(e){const{chatMessageType:t,messageTemplate:s}=e.content;return t!==b.TEMPLATE||!!s}function q(e,t){var s,n;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===b.TEMPLATE)return"system"===t?2==(null==(s=null==i?void 0:i.setting)?void 0:s.style.id):2!=(null==(n=null==i?void 0:i.setting)?void 0:n.style.id)}function z(e){var t,s;const{chatMessageType:n,messageTemplate:o}=e;return n===b.TEMPLATE&&3==(null==(s=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:s.id)}function B(e,t){var s;const n=S(e.sendTime)?e.sendTime:Date.parse(e.sendTime),o=null==(s=G.msgList[t-1])?void 0:s.sendTime;return n-(0===t?0:S(o)?o:Date.parse(o))>3e5}function Q(e){const t=new Date(e),s=Date.now()-t.getTime();if(s<6e4)return"刚刚";if(s<36e5)return Math.ceil(s/1e3/60)+"分钟前";if(M(t))return"今天 "+v(t,"HH:mm");if(h(t))return"昨天 "+v(t,"HH:mm");{const e=t.getFullYear(),s=(new Date).getFullYear();return v(t,e<s?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}return D(F,(()=>{X()}),"top"),s((()=>G.id),(e=>{e&&(Object.assign(K,{page:0,hasMore:!0,lastSendTime:v(new Date,"yyyy-MM-dd HH:mm:ss")}),X())}),{immediate:!0}),s((()=>G.isAppendMsg),(e=>{e&&(N([...G.msgList,G.currentMsg]),G.isAppendMsg=!1,async function(){var e,t,s;const n=null!=(t=null==(e=F.value)?void 0:e.scrollHeight)?t:0;null==(s=F.value)||s.scrollTo({top:n,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(n(),o("div",{class:i(["chat-main",{"home-bg":!a(G).id}]),ref_key:"chatMainRef",ref:F},[r(a(g),{"show-toolbar-tooltip":""},{default:m((()=>[(n(!0),o(l,null,c(a(G).msgList,((e,t)=>(n(),o(l,{key:t},[Y(e)?(n(),o("div",{key:0,class:i(["message-item",{"message-item--mine":e.sender==a(G).userInfo.id}])},[B(e,t)?(n(),o("p",P,d(Q(e.sendTime)),1)):u("v-if",!0),q(e,"system")?(n(),p(I,{key:1,data:e},null,8,["data"])):(n(),o("div",R,[r(j,{"user-id":e.sender},{trigger:m((()=>[r(a(y),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(n(),o("div",{key:0,class:i(["content",{emoji:e.content.chatMessageType===a(b).EMOJI,template:e.content.chatMessageType===a(b).TEMPLATE,"template--3":z(e.content)}]),"data-time":e.__time},[e.content.chatMessageType===a(b).TEXT?(n(),o("pre",{key:0,innerHTML:e.__content},null,8,O)):u("v-if",!0),e.content.chatMessageType===a(b).EMOJI?(n(),o("img",{key:1,src:a(A)[e.__content]},null,8,x)):u("v-if",!0),q(e,"template")?(n(),p(I,{key:2,data:e},null,8,["data"])):u("v-if",!0),e.content.chatMessageType===a(b).IMAGE?(n(),p(a(T),{key:3,width:"240",src:e.__content},null,8,["src"])):u("v-if",!0),e.content.chatMessageType===a(b).FILE?(n(),o("a",{key:4,href:e.content.fileUrl,onClick:f((()=>function(e,t){const s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(n){if(200===s.status){const n=window.URL.createObjectURL(s.response),o=document.createElement("a");o.href=n,o.download=t,o.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},s.send()}(e.content.fileUrl,e.__content)),["prevent"])},d(e.__content),9,C)):u("v-if",!0)],10,U)):u("v-if",!0)]))],2)):u("v-if",!0)],64)))),128))])),_:1})],2))}});export{F as default};
1
+ import{defineComponent as e,ref as t,watch as s,openBlock as n,createElementBlock as o,normalizeClass as i,unref as a,createVNode as r,withCtx as c,Fragment as l,renderList as m,toDisplayString as d,createCommentVNode as u,createBlock as p,withModifiers as f}from"vue";import{NImageGroup as g,NAvatar as y,NImage as T}from"naive-ui";import{format as v}from"date-fns";import{getHistoryRecordApi as M,readMessageApi as h}from"../api/index.js";import{useState as k}from"../hooks/useState.js";import{useSession as L}from"../hooks/useSession.js";import{first as E,last as _,isNumber as j}from"lodash-es";import S from"./PersonProfile.vue.js";import w from"./MessageTemplate.vue.js";import{images as I}from"../utils/emoji.js";import{formatTime as A}from"../utils/index.js";import{MESSAGE_TYPE as b}from"../constants/index.js";import{useScrollLoading as H}from"../hooks/useScrollLoading.js";const P={key:0,class:"time"},R={key:2,class:"message-box"},U=["data-time"],x=["innerHTML"],O=["src"],C=["href","onClick"];var D=e({__name:"ChatMain",setup(e){const D=t(),{state:G,setMsgList:N}=k(),{setCurrentSessionItem:J}=L(G),K={page:0,hasMore:!0,lastSendTime:v(new Date,"yyyy-MM-dd HH:mm:ss")};async function X(){try{if(!K.hasMore)return;K.page++;const e=await M({sessionKey:G.currentSessionItem.sessionKey,page:K.page,lastSendTime:K.lastSendTime});if(!Array.isArray(e)||0===e.length)return K.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=E(e).id;K.lastSendTime=_(e).sendTime,N(K.page>1?[...e,...G.msgList]:e),1===K.page&&G.currentSessionItem.unreadNum&&(await h({chatType:"SINGLE",messageIdSet:[t],receiver:G.userInfo.id,sender:G.currentSessionItem.receiver}),J({unreadNum:0}))}catch(e){console.log(e)}}function q(e){const{chatMessageType:t,messageTemplate:s}=e.content;return t!==b.TEMPLATE||!!s}function z(e,t){var s,n;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===b.TEMPLATE)return"system"===t?2==(null==(s=null==i?void 0:i.setting)?void 0:s.style.id):2!=(null==(n=null==i?void 0:i.setting)?void 0:n.style.id)}function F(e){var t,s;const{chatMessageType:n,messageTemplate:o}=e;return n===b.TEMPLATE&&3==(null==(s=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:s.id)}function B(e,t){var s;const n=j(e.sendTime)?e.sendTime:Date.parse(e.sendTime),o=null==(s=G.msgList[t-1])?void 0:s.sendTime;return n-(0===t?0:j(o)?o:Date.parse(o))>3e5}return H(D,(()=>{X()}),"top"),s((()=>G.id),(e=>{e&&(Object.assign(K,{page:0,hasMore:!0,lastSendTime:v(new Date,"yyyy-MM-dd HH:mm:ss")}),X())}),{immediate:!0}),s((()=>G.isAppendMsg),(e=>{e&&(N([...G.msgList,G.currentMsg]),G.isAppendMsg=!1,async function(){var e,t,s;const n=null!=(t=null==(e=D.value)?void 0:e.scrollHeight)?t:0;null==(s=D.value)||s.scrollTo({top:n,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(n(),o("div",{class:i(["chat-main",{"home-bg":!a(G).id}]),ref_key:"chatMainRef",ref:D},[r(a(g),{"show-toolbar-tooltip":""},{default:c((()=>[(n(!0),o(l,null,m(a(G).msgList,((e,t)=>(n(),o(l,{key:t},[q(e)?(n(),o("div",{key:0,class:i(["message-item",{"message-item--mine":e.sender==a(G).userInfo.id}])},[B(e,t)?(n(),o("p",P,d(a(A)(e.sendTime).recordTime),1)):u("v-if",!0),z(e,"system")?(n(),p(w,{key:1,data:e},null,8,["data"])):(n(),o("div",R,[r(S,{"user-id":e.sender},{trigger:c((()=>[r(a(y),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(n(),o("div",{key:0,class:i(["content",{emoji:e.content.chatMessageType===a(b).EMOJI,template:e.content.chatMessageType===a(b).TEMPLATE,"template--3":F(e.content)}]),"data-time":e.__time},[e.content.chatMessageType===a(b).TEXT?(n(),o("pre",{key:0,innerHTML:e.__content},null,8,x)):u("v-if",!0),e.content.chatMessageType===a(b).EMOJI?(n(),o("img",{key:1,src:a(I)[e.__content]},null,8,O)):u("v-if",!0),z(e,"template")?(n(),p(w,{key:2,data:e},null,8,["data"])):u("v-if",!0),e.content.chatMessageType===a(b).IMAGE?(n(),p(a(T),{key:3,width:"240",src:e.__content},null,8,["src"])):u("v-if",!0),e.content.chatMessageType===a(b).FILE?(n(),o("a",{key:4,href:e.content.fileUrl,onClick:f((()=>function(e,t){const s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(n){if(200===s.status){const n=window.URL.createObjectURL(s.response),o=document.createElement("a");o.href=n,o.download=t,o.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},s.send()}(e.content.fileUrl,e.__content)),["prevent"])},d(e.__content),9,C)):u("v-if",!0)],10,U)):u("v-if",!0)]))],2)):u("v-if",!0)],64)))),128))])),_:1})],2))}});export{D as default};
@@ -1,19 +1,41 @@
1
1
  import { PropType } from 'vue';
2
2
  import { AnyObject } from '../../../../shared/types';
3
- declare const _default: import("vue").DefineComponent<{}, {
3
+ import { formatTime } from '../utils';
4
+ import { MESSAGE_TYPE } from '../constants';
5
+ declare const _default: import("vue").DefineComponent<{
6
+ visible: {
7
+ type: BooleanConstructor;
8
+ };
9
+ }, {
4
10
  tagColor: {
5
11
  color: string;
6
12
  textColor: string;
7
13
  };
14
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
15
+ visible: {
16
+ type: BooleanConstructor;
17
+ };
18
+ }>> & {}>>;
8
19
  state: import("../types").IState;
9
- options: {
10
- label: any;
11
- value: any;
12
- avatar: any;
13
- }[];
14
- user: import("vue").Ref<never[]>;
20
+ recordRef: import("vue").Ref<any>;
21
+ recordList: import("vue").Ref<AnyObject[]>;
22
+ keyword: import("vue").Ref<any>;
23
+ memberList: import("vue").Ref<never[]>;
15
24
  startTime: import("vue").Ref<any>;
16
25
  endTime: import("vue").Ref<any>;
26
+ handleInput: () => void;
27
+ currentInfo: {
28
+ page: number;
29
+ hasMore: boolean;
30
+ lastSendTime: string;
31
+ };
32
+ handleSearch: () => Promise<void>;
33
+ options: import("vue").ComputedRef<AnyObject[]>;
34
+ resetAndSearch: () => void;
35
+ startDateDisabled: (ts: number) => boolean;
36
+ endDateDisabled: (ts: number) => boolean;
37
+ resetInfo: () => void;
38
+ handleCloseTag: (type: 'member' | 'start' | 'end', e: Event) => void;
17
39
  getPrefixCondition: () => (JSX.Element | null)[];
18
40
  renderLabel: (option: AnyObject) => JSX.Element;
19
41
  NModal: any;
@@ -99,5 +121,13 @@ declare const _default: import("vue").DefineComponent<{}, {
99
121
  }, {
100
122
  updateUnchangedValue: boolean;
101
123
  }>>;
102
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
124
+ formatTime: typeof formatTime;
125
+ MESSAGE_TYPE: typeof MESSAGE_TYPE;
126
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
127
+ visible: {
128
+ type: BooleanConstructor;
129
+ };
130
+ }>>, {
131
+ visible: boolean;
132
+ }>;
103
133
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,openBlock as a,createBlock as t,unref as r,withCtx as s,createElementVNode as o,createVNode as n,resolveDynamicComponent as i,withDirectives as c,createTextVNode as u,toDisplayString as d,vShow as v,Fragment as m}from"vue";import{NModal as p,NInput as f,NAvatar as g,NSelect as b,NPopover as _,NTag as h,NIcon as x}from"naive-ui";import{SearchOutline as y}from"@vicons/ionicons5";import{useState as w}from"../hooks/useState.js";import I from"../../../date-picker/index.js";const k={class:"c-chat-dialog__content c-chat-record-wrapper"},S={class:"chat-record-box"},z={class:"chat-record-box__content"},U={class:"content-item"},j=o("div",{class:"msg-box"},[o("div",{class:"name-and-time"},[o("span",null,"大傻子(质控部)"),o("span",null,"今天14:30")]),o("div",{class:"content"},[o("p",{innerHTML:"内容内容"})])],-1),C={class:"content-item"},H=o("div",{class:"msg-box"},[o("div",{class:"name-and-time"},[o("span",null,"大傻子2号(质控部)"),o("span",null,"今天14:30")]),o("div",{class:"content"},[o("p",{innerHTML:"内容内容叭叭叭"})])],-1),L={class:"chat-record-box__filter"},M=o("span",{class:"filter-title"},"添加筛选条件",-1),T={class:"filter-item"},R=o("span",{class:"label"},"成员:",-1),q={class:"filter-item"},A=o("span",{class:"label"},"日期:",-1),B={class:"time-target"},D={class:"time-target__item"},E=o("span",null,"开始:",-1),F={class:"time-target__item"},G=o("span",null,"结束:",-1);var J=e({__name:"ChatRecord",setup(e){const J={color:"#fff",textColor:"#666"},{state:K}=w(),N=[{label:K.userInfo.name,value:K.userInfo.id,avatar:K.userInfo.avatar},{label:K.currentSessionItem.name,value:K.currentSessionItem.receiver,avatar:K.currentSessionItem.avatar}],O=l([]),P=l(),Q=l();function V(e){return n(m,null,[n("div",{style:"display: flex;align-items: center"},[n(g,{src:e.avatar,round:!0,size:"small"},null),n("span",{style:"margin-left: 10px"},[e.label])])])}return(e,l)=>(a(),t(r(p),{preset:"dialog",title:"聊天记录","show-icon":!1,class:"c-chat-dialog"},{default:s((()=>[o("div",k,[n(r(f),{placeholder:"搜索文件"},{prefix:s((()=>[(a(),t(i((()=>[n(x,{component:y,color:"#6666"},null),O.value.length>0?n(h,{closable:!0,bordered:!1,color:J,style:"margin-left: 10px"},{default:()=>[u("成员: "),O.value.length>1?O.value.length+"人":O.value[0]]}):null,P.value?n(h,{closable:!0,bordered:!1,color:J,style:"margin-left: 10px"},{default:()=>[u("起始时间: "),P.value]}):null,Q.value?n(h,{closable:!0,bordered:!1,color:J,style:"margin-left: 10px"},{default:()=>[u("结束时间: "),Q.value]}):null]))))])),_:1}),o("div",S,[o("div",z,[o("div",U,[n(r(g),{round:"",size:38}),j]),o("div",C,[n(r(g),{round:"",size:38}),H])]),o("div",L,[M,o("div",T,[R,n(r(b),{value:O.value,"onUpdate:value":l[0]||(l[0]=e=>O.value=e),multiple:"","max-tag-count":1,"render-label":V,options:N},null,8,["value"])]),o("div",q,[A,o("div",B,[n(r(_),{trigger:"click","show-arrow":!1},{trigger:s((()=>[o("div",D,[E,c(n(r(h),{bordered:!1,color:J,closable:""},{default:s((()=>[u(d(P.value),1)])),_:1},512),[[v,P.value]])])])),default:s((()=>[n(r(I),{"formatted-value":P.value,"onUpdate:formatted-value":l[1]||(l[1]=e=>P.value=e),type:"date",panel:"",clearable:""},null,8,["formatted-value"])])),_:1}),n(r(_),{trigger:"click","show-arrow":!1},{trigger:s((()=>[o("div",F,[G,c(n(r(h),{bordered:!1,color:J,closable:""},{default:s((()=>[u(d(Q.value),1)])),_:1},512),[[v,Q.value]])])])),default:s((()=>[n(r(I),{"formatted-value":Q.value,"onUpdate:formatted-value":l[2]||(l[2]=e=>Q.value=e),type:"date",panel:"",clearable:""},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{J as default};
1
+ import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as s,createBlock as r,unref as n,withCtx as o,createElementVNode as i,createVNode as u,toDisplayString as c,resolveDynamicComponent as d,createElementBlock as v,Fragment as m,renderList as p,withDirectives as f,createTextVNode as g,vShow as y}from"vue";import{NModal as b,NAvatar as h,NInput as _,NSelect as T,NPopover as k,NTag as x,NIcon as M}from"naive-ui";import{SearchOutline as I}from"@vicons/ionicons5";import{useState as w}from"../hooks/useState.js";import{transformMessage as S,formatTime as A}from"../utils/index.js";import{last as j}from"lodash-es";import L from"../../../date-picker/index.js";import{searchChatRecordApi as C}from"../api/index.js";import{useDebounceFn as E}from"@vueuse/core";import{format as H}from"date-fns";import{useScrollLoading as D}from"../hooks/useScrollLoading.js";import{MESSAGE_TYPE as U}from"../constants/index.js";import{images as z}from"../utils/emoji.js";const O={class:"c-chat-dialog__header"},J=i("span",{class:"left"},"聊天记录",-1),K={class:"center"},P={class:"c-chat-dialog__content c-chat-record-wrapper"},R={class:"chat-record-box"},B={class:"msg-box"},G={class:"name-and-time"},N={class:"content"},X=["src"],$=["innerHTML"],q={key:1,class:"no-data"},F={class:"chat-record-box__filter"},Q=i("span",{class:"filter-title"},"添加筛选条件",-1),V={class:"filter-item"},W=i("span",{class:"label"},"成员:",-1),Y={class:"filter-item"},Z=i("span",{class:"label"},"日期:",-1),ee={class:"time-target"},ae={class:"time-target__item"},le=i("span",null,"开始:",-1),te={class:"no-data"},se={class:"time-target__item"},re=i("span",null,"结束:",-1),ne={class:"no-data"};var oe=e({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(e){const oe=e,ie={color:"#fff",textColor:"#666"},{state:ue}=w(),ce=a(),de=a([]),ve=a(),me=a([]),pe=a(),fe=a(),ge=E(_e,500),ye={page:0,hasMore:!0,lastSendTime:H(new Date,"yyyy-MM-dd HH:mm:ss")};async function be(){var e;try{if(!ye.hasMore)return;ye.page++;const a=await C({orgId:ue.orgId,keyword:ve.value,endTime:fe.value?fe.value+" 23:59:59":"",startTime:pe.value?pe.value+" 00:00:00":"",lastSendTime:ye.lastSendTime,memberIdSet:me.value,page:ye.page,recordType:"ALL",sessionKey:ue.currentSessionItem.sessionKey,userId:ue.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(ye.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList),ye.lastSendTime=null==(e=j(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t,s,r,n;let o="";switch(e.content.chatMessageType){case U.TEXT:o=S(null==(a=e.content)?void 0:a.msg);break;case U.TEMPLATE:o=null==(s=null==(t=null==(l=e.content)?void 0:l.messageTemplate)?void 0:t.setting)?void 0:s.title;break;case U.EMOJI:o=z[null==(r=e.item.content)?void 0:r.msg];break;default:o=null==(n=e.content)?void 0:n.msg}e.__content=o})),de.value=ye.page>1?de.value.concat(l):l}catch(e){console.log(e)}}D(ce,(()=>{be()}));const he=l((()=>[ue.currentSessionItem]));function _e(){Object.assign(ye,{page:0,hasMore:!0,lastSendTime:H(new Date,"yyyy-MM-dd HH:mm:ss")}),be()}function Te(e){return!!fe.value&&e>Date.parse(`${fe.value} 23:59:59`)}function ke(e){return!!pe.value&&e<Date.parse(pe.value)}function xe(e,a){switch(a.stopPropagation(),e){case"member":me.value=[];break;case"start":pe.value=null;break;case"end":fe.value=null}}function Me(e){return u(m,null,[u("div",{style:"display: flex;align-items: center"},[u(h,{src:e.avatar,round:!0,size:"small"},null),u("span",{style:"margin-left: 10px"},[e.name])])])}return t([()=>me.value,()=>pe.value,()=>fe.value],(()=>{oe.visible&&_e()}),{deep:!0}),t((()=>oe.visible),(e=>{e?_e():(ve.value="",fe.value=null,pe.value=null,me.value=[],de.value=[])})),(e,a)=>(s(),r(n(b),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"c-chat-dialog"},{header:o((()=>[i("div",O,[J,i("div",K,[u(n(h),{round:"",size:30,src:n(ue).currentSessionItem.avatar},null,8,["src"]),i("span",null,c(n(ue).currentSessionItem.name),1)])])])),default:o((()=>[i("div",P,[u(n(_),{placeholder:"搜索",value:ve.value,"onUpdate:value":a[0]||(a[0]=e=>ve.value=e),valueModifiers:{trim:!0},onInput:n(ge)},{prefix:o((()=>[(s(),r(d((()=>[u(M,{component:I,color:"#6666"},null),me.value.length>0?u(x,{closable:!0,bordered:!1,color:ie,style:"margin-left: 10px",onClose:e=>xe("member",e)},{default:()=>{var e;return[g("成员:")," ",me.value.length>1?me.value.length+"人":null==(e=he.value.find((e=>e.receiver===me.value[0])))?void 0:e.name]}}):null,pe.value?u(x,{closable:!0,bordered:!1,color:ie,style:"margin-left: 10px",onClose:e=>xe("start",e)},{default:()=>[g("起始时间: "),pe.value]}):null,fe.value?u(x,{closable:!0,bordered:!1,color:ie,style:"margin-left: 10px",onClose:e=>xe("end",e)},{default:()=>[g("结束时间: "),fe.value]}):null]))))])),_:1},8,["value","onInput"]),i("div",R,[i("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:ce},[de.value.length>0?(s(!0),v(m,{key:0},p(de.value,(e=>(s(),v("div",{class:"content-item",key:e.id},[u(n(h),{round:"",size:38,src:e.senderAvatar},null,8,["src"]),i("div",B,[i("div",G,[i("span",null,c(e.senderName),1),i("span",null,c(n(A)(e.sendTime).recordTime),1)]),i("div",N,[[n(U).EMOJI,n(U).IMAGE].includes(e.content.chatMessageType)?(s(),v("img",{key:0,src:e.__content},null,8,X)):(s(),v("p",{key:1,innerHTML:e.__content},null,8,$))])])])))),128)):(s(),v("div",q,"没有找到相关记录"))],512),i("div",F,[Q,i("div",V,[W,u(n(T),{value:me.value,"onUpdate:value":a[1]||(a[1]=e=>me.value=e),multiple:"","max-tag-count":1,"render-label":Me,options:n(he),"value-field":"receiver"},null,8,["value","options"])]),i("div",Y,[Z,i("div",ee,[u(n(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[i("div",ae,[le,f(u(n(x),{bordered:!1,color:ie,closable:"",onClose:a[2]||(a[2]=e=>xe("start",e))},{default:o((()=>[g(c(pe.value),1)])),_:1},512),[[y,pe.value]]),f(i("span",te,"点击选择",512),[[y,!pe.value]])])])),default:o((()=>[u(n(L),{"formatted-value":pe.value,"onUpdate:formatted-value":a[3]||(a[3]=e=>pe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Te},null,8,["formatted-value"])])),_:1}),u(n(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[i("div",se,[re,f(u(n(x),{bordered:!1,color:ie,closable:"",onClose:a[4]||(a[4]=e=>xe("end",e))},{default:o((()=>[g(c(fe.value),1)])),_:1},512),[[y,fe.value]]),f(i("span",ne,"点击选择",512),[[y,!fe.value]])])])),default:o((()=>[u(n(L),{"formatted-value":fe.value,"onUpdate:formatted-value":a[5]||(a[5]=e=>fe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":ke},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{oe as default};
@@ -2,6 +2,7 @@ import { AnyObject } from '../../../../shared/types';
2
2
  export declare function formatTime(dateStr: string): {
3
3
  siderMsgTime: any;
4
4
  msgTime: any;
5
+ recordTime: string;
5
6
  };
6
7
  export declare function listSort(list: AnyObject[]): AnyObject[];
7
8
  export declare function transformMessage(content: string): string;
@@ -1 +1 @@
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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").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};
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 i}from"./emoji.js";function o(n){const a=new Date(n);let i,o;if(e(a))i=o=t(a,"HH:mm");else{i=r(a)?"昨天":t(a,"MM-dd");const e=a.getFullYear(),n=(new Date).getFullYear();o=t(a,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:i,msgTime:o,recordTime:function(n){const a=new Date(n),i=Date.now()-a.getTime();if(i<6e4)return"刚刚";if(i<36e5)return Math.ceil(i/1e3/60)+"分钟前";if(e(a))return"今天 "+t(a,"HH:mm");if(r(a))return"昨天 "+t(a,"HH:mm");{const e=a.getFullYear(),r=(new Date).getFullYear();return t(a,e<r?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(n)}}function l(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 m(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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(t(),"<$1 $2>").replace(t("/"),"</$1>").replace(/\n/g,"<br>")}function s(e){var t;const{chatMessageType:r,msg:n,messageTemplate:o}=e;switch(r){case a.TEXT:return m(n);case a.IMAGE:return"[图片]";case a.FILE:return"[文件]";case a.EMOJI:return`<img alt=${n} src=${i.value[n]}>`;case a.TEMPLATE:return null==(t=null==o?void 0:o.setting)?void 0:t.title;default:return"其他消息"}}export{o as formatTime,l as listSort,s as transformLastMessage,m as transformMessage};