cnhis-design-vue 3.2.4-release.4 → 3.2.4-release.6
Sign up to get free protection for your applications and to get access to all the features.
- package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/biunique-chat/index.d.ts +75 -17
- package/es/components/biunique-chat/src/Index.vue.d.ts +75 -17
- package/es/components/biunique-chat/src/api/index.d.ts +1 -0
- package/es/components/biunique-chat/src/api/index.js +1 -1
- package/es/components/biunique-chat/src/components/ChatFile.vue.d.ts +26 -8
- package/es/components/biunique-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatHeader.vue.d.ts +74 -16
- package/es/components/biunique-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +2 -1
- package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatRecord.vue.d.ts +50 -8
- package/es/components/biunique-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/biunique-chat/src/hooks/useScrollLoading.d.ts +1 -1
- package/es/components/biunique-chat/src/hooks/useScrollLoading.js +1 -1
- package/es/components/biunique-chat/src/utils/index.d.ts +1 -0
- package/es/components/biunique-chat/src/utils/index.js +1 -1
- package/es/components/biunique-chat/style/index.css +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +5 -3
- package/es/components/default-page/index.d.ts +0 -1
- package/es/components/default-page/src/constants/index.d.ts +4 -0
- package/es/components/default-page/src/constants/index.js +1 -1
- package/es/components/default-page/src/index.vue.d.ts +0 -1
- package/es/components/default-page/src/index.vue2.js +1 -1
- package/es/components/default-page/style/index.css +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +10 -6
- package/es/components/form-config/src/FormConfig.vue.d.ts +10 -6
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +5 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +5 -3
- package/es/components/form-render/index.d.ts +5 -3
- package/es/components/form-render/src/FormRender.vue.d.ts +4 -2
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +5 -3
- package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useChangeContext.d.ts +3 -0
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +3 -2
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +4 -0
- package/es/components/form-render/src/utils/valueFormatter.d.ts +4 -0
- package/es/components/form-render/src/utils/valueFormatter.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +10 -6
- package/es/components/info-header/src/InfoHeader.vue.d.ts +10 -6
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +5 -3
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +5 -3
- package/es/components/shortcut-setter/index.d.ts +5 -3
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +5 -3
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -0
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -0
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -0
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as o,ref as l,onDeactivated as t,createVNode as a,unref as u,createTextVNode as n}from"vue";import{useTheme as r}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as
|
1
|
+
import{defineComponent as e,computed as o,ref as l,onDeactivated as t,createVNode as a,unref as u,createTextVNode as n}from"vue";import{useTheme as r}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as i,isObject as s,isArray as d,isFunction as m}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import{promiseTimeout as v}from"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import{FileTrayFull as c,FileTray as p}from"@vicons/ionicons5";import{NPopover as f,NDivider as h,NEllipsis as V,NIcon as g,NPopselect as y,NButton as b,NInput as w}from"naive-ui";var x=e({props:{modelValue:{type:[String,Object],default:""},shortcuts:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:x}){const k=r(),T=o({get:()=>i(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let l=o;s(e.modelValue)&&(l={...e.modelValue,content:o}),x("update:modelValue",l)}}),P=l(!1),R=o({get:()=>P.value,async set(e){P.value=e,!e&&M.value&&(await new Promise((e=>setTimeout(e,200))),M.value=!1)}}),_=o((()=>{let o=e.shortcuts||[];return s(e.modelValue)&&(d(e.modelValue.shortcuts)?o=e.modelValue.shortcuts:Reflect.has(e.modelValue,"shortcuts")&&(o=[])),o.map((e=>i(e)?{label:e,value:e}:e))})),j=l(),M=l(!1);let C,U;async function z(){var e,o;await v(50),null==(o=null==(e=j.value)?void 0:e.syncPosition)||o.call(e)}function L(e){e.stopPropagation(),clearTimeout(C),R.value&&M.value?R.value=!1:u(T)||(C=setTimeout((()=>(M.value=R.value=!0,z())),200))}function S(e){if(e.stopPropagation(),clearTimeout(C),u(T))return M.value=R.value=!0,z()}function W(e){e.stopPropagation(),clearTimeout(U),u(T)&&(R.value=!0)}function A(e){e.stopPropagation(),clearTimeout(U),u(T)&&!M.value&&(U=setTimeout((()=>{R.value=!1}),300))}return t((()=>{R.value=!1})),function(){return a("section",{class:["annotation-edit",{"is-active":!!u(T)}],style:{"--icon-right":"-5",...k.value},"annotation-hover-show":!u(T)&&!M.value},[a(f,{ref:j,to:"body",flip:!0,"keep-alive-on-hover":!0,style:{maxWidth:"360px",wordBreak:"break-all"},show:R.value,"onUpdate:show":e=>R.value=e,trigger:"manual",duration:100,onClickoutside:L},{default:function(){return a("section",{onMouseleave:A,onMouseenter:W},[a("div",null,[M.value?[_.value.length?a(y,{options:_.value,"onUpdate:value":e=>T.value+=e,scrollable:!0},{default:()=>a(b,{style:"margin-bottom: 8px;"},{default:()=>"短语"})}):null,a(w,{resizable:!1,autosize:{minRows:3,maxRows:5},"show-count":!0,class:"annotation-edit__textarea",type:"textarea",value:T.value,"onUpdate:value":e=>T.value=e},null)]:a("span",null,[u(T)])]),s(e.modelValue)&&(m(e.modelValue.footerRender)||e.modelValue.author||e.modelValue.date)?[a(h,{style:{margin:"4px 0",minWidth:"360px"}},null),a("section",{class:"annotation-edit__footer"},[m(e.modelValue.footerRender)?e.modelValue.footerRender(e.modelValue):[a(V,null,{default:()=>{var o;return[null!=(o=e.modelValue.authorLabel)?o:"质控人",n(": "),e.modelValue.author]}}),a(V,null,{default:()=>{var o;return[null!=(o=e.modelValue.dateLabel)?o:"质控时间",n(": "),e.modelValue.date]}})]])]:null])},trigger:function(){return a("div",{class:"annotation-edit__icon",onMouseleave:A,onMouseenter:W,onDblclick:S,onClick:L},[a(g,{component:u(T)?c:p},null)])}})])}}});export{x as default};
|
@@ -836,23 +836,37 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
836
836
|
type: StringConstructor;
|
837
837
|
default: string;
|
838
838
|
};
|
839
|
+
visible: {
|
840
|
+
type: BooleanConstructor;
|
841
|
+
};
|
839
842
|
}, {
|
840
843
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
841
844
|
type: {
|
842
845
|
type: StringConstructor;
|
843
846
|
default: string;
|
844
847
|
};
|
848
|
+
visible: {
|
849
|
+
type: BooleanConstructor;
|
850
|
+
};
|
845
851
|
}>> & {}>>;
|
846
|
-
|
852
|
+
state: import("./src/types").IState;
|
853
|
+
imageList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
854
|
+
fileList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
855
|
+
imageRef: import("vue").Ref<any>;
|
856
|
+
fileRef: import("vue").Ref<any>;
|
857
|
+
keyword: import("vue").Ref<any>;
|
858
|
+
handleInput: () => void;
|
859
|
+
currentInfo: {
|
860
|
+
page: number;
|
861
|
+
hasMore: boolean;
|
862
|
+
lastSendTime: string;
|
863
|
+
};
|
864
|
+
handleSearch: () => Promise<void>;
|
865
|
+
formatImageList: (data: import("../../shared/types").AnyObject[]) => {
|
847
866
|
label: string;
|
848
|
-
|
849
|
-
}[];
|
850
|
-
fileList: {
|
851
|
-
name: string;
|
852
|
-
size: string;
|
853
|
-
time: string;
|
854
|
-
sender: string;
|
867
|
+
list: unknown;
|
855
868
|
}[];
|
869
|
+
resetAndSearch: () => void;
|
856
870
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
857
871
|
getDetail: (item: import("../../shared/types").AnyObject) => string;
|
858
872
|
NModal: any;
|
@@ -1066,23 +1080,47 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1066
1080
|
type: StringConstructor;
|
1067
1081
|
default: string;
|
1068
1082
|
};
|
1083
|
+
visible: {
|
1084
|
+
type: BooleanConstructor;
|
1085
|
+
};
|
1069
1086
|
}>>, {
|
1070
1087
|
type: string;
|
1088
|
+
visible: boolean;
|
1071
1089
|
}>;
|
1072
|
-
ChatRecord: import("vue").DefineComponent<{
|
1090
|
+
ChatRecord: import("vue").DefineComponent<{
|
1091
|
+
visible: {
|
1092
|
+
type: BooleanConstructor;
|
1093
|
+
};
|
1094
|
+
}, {
|
1073
1095
|
tagColor: {
|
1074
1096
|
color: string;
|
1075
1097
|
textColor: string;
|
1076
1098
|
};
|
1099
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1100
|
+
visible: {
|
1101
|
+
type: BooleanConstructor;
|
1102
|
+
};
|
1103
|
+
}>> & {}>>;
|
1077
1104
|
state: import("./src/types").IState;
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
}[];
|
1083
|
-
user: import("vue").Ref<never[]>;
|
1105
|
+
recordRef: import("vue").Ref<any>;
|
1106
|
+
recordList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
1107
|
+
keyword: import("vue").Ref<any>;
|
1108
|
+
memberList: import("vue").Ref<never[]>;
|
1084
1109
|
startTime: import("vue").Ref<any>;
|
1085
1110
|
endTime: import("vue").Ref<any>;
|
1111
|
+
handleInput: () => void;
|
1112
|
+
currentInfo: {
|
1113
|
+
page: number;
|
1114
|
+
hasMore: boolean;
|
1115
|
+
lastSendTime: string;
|
1116
|
+
};
|
1117
|
+
handleSearch: () => Promise<void>;
|
1118
|
+
options: import("vue").ComputedRef<import("../../shared/types").AnyObject[]>;
|
1119
|
+
resetAndSearch: () => void;
|
1120
|
+
startDateDisabled: (ts: number) => boolean;
|
1121
|
+
endDateDisabled: (ts: number) => boolean;
|
1122
|
+
resetInfo: () => void;
|
1123
|
+
handleCloseTag: (type: "end" | "start" | "member") => void;
|
1086
1124
|
getPrefixCondition: () => (JSX.Element | null)[];
|
1087
1125
|
renderLabel: (option: import("../../shared/types").AnyObject) => JSX.Element;
|
1088
1126
|
NModal: any;
|
@@ -1091,6 +1129,17 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1091
1129
|
NSelect: any;
|
1092
1130
|
NAvatar: any;
|
1093
1131
|
NPopover: any;
|
1132
|
+
NInputGroup: import("vue").DefineComponent<{
|
1133
|
+
[x: string]: never;
|
1134
|
+
[x: number]: never;
|
1135
|
+
[x: symbol]: never;
|
1136
|
+
}, {
|
1137
|
+
mergedClsPrefix: import("vue").ComputedRef<string>;
|
1138
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1139
|
+
[x: string]: never;
|
1140
|
+
[x: number]: never;
|
1141
|
+
[x: symbol]: never;
|
1142
|
+
}>>, {}>;
|
1094
1143
|
DatePicker: SFCWithInstall<import("vue").DefineComponent<{
|
1095
1144
|
updateUnchangedValue: {
|
1096
1145
|
type: BooleanConstructor;
|
@@ -1168,7 +1217,16 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1168
1217
|
}, {
|
1169
1218
|
updateUnchangedValue: boolean;
|
1170
1219
|
}>>;
|
1171
|
-
|
1220
|
+
formatTime: typeof import("./src/utils").formatTime;
|
1221
|
+
MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
|
1222
|
+
images: import("vue").Ref<any[]>;
|
1223
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1224
|
+
visible: {
|
1225
|
+
type: BooleanConstructor;
|
1226
|
+
};
|
1227
|
+
}>>, {
|
1228
|
+
visible: boolean;
|
1229
|
+
}>;
|
1172
1230
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
1173
1231
|
ChatMain: import("vue").DefineComponent<{}, {
|
1174
1232
|
chatMainRef: import("vue").Ref<HTMLElement | undefined>;
|
@@ -1186,7 +1244,6 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1186
1244
|
isTemplate3: (content: import("../../shared/types").AnyObject) => boolean;
|
1187
1245
|
needShowTime: (item: import("../../shared/types").AnyObject, index: number) => boolean;
|
1188
1246
|
setScrollToButtom: () => Promise<void>;
|
1189
|
-
getIntervalMsgTime: (time: string) => string;
|
1190
1247
|
resetInfo: () => void;
|
1191
1248
|
handleDownload: (url: string, filename: string) => void;
|
1192
1249
|
NAvatar: any;
|
@@ -1533,6 +1590,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1533
1590
|
};
|
1534
1591
|
}>>, {}>;
|
1535
1592
|
images: import("vue").Ref<any[]>;
|
1593
|
+
formatTime: typeof import("./src/utils").formatTime;
|
1536
1594
|
MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
|
1537
1595
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
1538
1596
|
ChatFooter: import("vue").DefineComponent<{}, {
|
@@ -839,23 +839,37 @@ declare const _default: import("vue").DefineComponent<{
|
|
839
839
|
type: StringConstructor;
|
840
840
|
default: string;
|
841
841
|
};
|
842
|
+
visible: {
|
843
|
+
type: BooleanConstructor;
|
844
|
+
};
|
842
845
|
}, {
|
843
846
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
844
847
|
type: {
|
845
848
|
type: StringConstructor;
|
846
849
|
default: string;
|
847
850
|
};
|
851
|
+
visible: {
|
852
|
+
type: BooleanConstructor;
|
853
|
+
};
|
848
854
|
}>> & {}>>;
|
849
|
-
|
855
|
+
state: IState;
|
856
|
+
imageList: import("vue").Ref<AnyObject[]>;
|
857
|
+
fileList: import("vue").Ref<AnyObject[]>;
|
858
|
+
imageRef: import("vue").Ref<any>;
|
859
|
+
fileRef: import("vue").Ref<any>;
|
860
|
+
keyword: import("vue").Ref<any>;
|
861
|
+
handleInput: () => void;
|
862
|
+
currentInfo: {
|
863
|
+
page: number;
|
864
|
+
hasMore: boolean;
|
865
|
+
lastSendTime: string;
|
866
|
+
};
|
867
|
+
handleSearch: () => Promise<void>;
|
868
|
+
formatImageList: (data: AnyObject[]) => {
|
850
869
|
label: string;
|
851
|
-
|
852
|
-
}[];
|
853
|
-
fileList: {
|
854
|
-
name: string;
|
855
|
-
size: string;
|
856
|
-
time: string;
|
857
|
-
sender: string;
|
870
|
+
list: unknown;
|
858
871
|
}[];
|
872
|
+
resetAndSearch: () => void;
|
859
873
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
860
874
|
getDetail: (item: AnyObject) => string;
|
861
875
|
NModal: any;
|
@@ -1069,23 +1083,47 @@ declare const _default: import("vue").DefineComponent<{
|
|
1069
1083
|
type: StringConstructor;
|
1070
1084
|
default: string;
|
1071
1085
|
};
|
1086
|
+
visible: {
|
1087
|
+
type: BooleanConstructor;
|
1088
|
+
};
|
1072
1089
|
}>>, {
|
1073
1090
|
type: string;
|
1091
|
+
visible: boolean;
|
1074
1092
|
}>;
|
1075
|
-
ChatRecord: import("vue").DefineComponent<{
|
1093
|
+
ChatRecord: import("vue").DefineComponent<{
|
1094
|
+
visible: {
|
1095
|
+
type: BooleanConstructor;
|
1096
|
+
};
|
1097
|
+
}, {
|
1076
1098
|
tagColor: {
|
1077
1099
|
color: string;
|
1078
1100
|
textColor: string;
|
1079
1101
|
};
|
1102
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1103
|
+
visible: {
|
1104
|
+
type: BooleanConstructor;
|
1105
|
+
};
|
1106
|
+
}>> & {}>>;
|
1080
1107
|
state: IState;
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
}[];
|
1086
|
-
user: import("vue").Ref<never[]>;
|
1108
|
+
recordRef: import("vue").Ref<any>;
|
1109
|
+
recordList: import("vue").Ref<AnyObject[]>;
|
1110
|
+
keyword: import("vue").Ref<any>;
|
1111
|
+
memberList: import("vue").Ref<never[]>;
|
1087
1112
|
startTime: import("vue").Ref<any>;
|
1088
1113
|
endTime: import("vue").Ref<any>;
|
1114
|
+
handleInput: () => void;
|
1115
|
+
currentInfo: {
|
1116
|
+
page: number;
|
1117
|
+
hasMore: boolean;
|
1118
|
+
lastSendTime: string;
|
1119
|
+
};
|
1120
|
+
handleSearch: () => Promise<void>;
|
1121
|
+
options: import("vue").ComputedRef<AnyObject[]>;
|
1122
|
+
resetAndSearch: () => void;
|
1123
|
+
startDateDisabled: (ts: number) => boolean;
|
1124
|
+
endDateDisabled: (ts: number) => boolean;
|
1125
|
+
resetInfo: () => void;
|
1126
|
+
handleCloseTag: (type: "end" | "start" | "member") => void;
|
1089
1127
|
getPrefixCondition: () => (JSX.Element | null)[];
|
1090
1128
|
renderLabel: (option: AnyObject) => JSX.Element;
|
1091
1129
|
NModal: any;
|
@@ -1094,6 +1132,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
1094
1132
|
NSelect: any;
|
1095
1133
|
NAvatar: any;
|
1096
1134
|
NPopover: any;
|
1135
|
+
NInputGroup: import("vue").DefineComponent<{
|
1136
|
+
[x: string]: never;
|
1137
|
+
[x: number]: never;
|
1138
|
+
[x: symbol]: never;
|
1139
|
+
}, {
|
1140
|
+
mergedClsPrefix: import("vue").ComputedRef<string>;
|
1141
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1142
|
+
[x: string]: never;
|
1143
|
+
[x: number]: never;
|
1144
|
+
[x: symbol]: never;
|
1145
|
+
}>>, {}>;
|
1097
1146
|
DatePicker: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
1098
1147
|
updateUnchangedValue: {
|
1099
1148
|
type: BooleanConstructor;
|
@@ -1171,7 +1220,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
1171
1220
|
}, {
|
1172
1221
|
updateUnchangedValue: boolean;
|
1173
1222
|
}>>;
|
1174
|
-
|
1223
|
+
formatTime: typeof import("./utils").formatTime;
|
1224
|
+
MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
|
1225
|
+
images: import("vue").Ref<any[]>;
|
1226
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1227
|
+
visible: {
|
1228
|
+
type: BooleanConstructor;
|
1229
|
+
};
|
1230
|
+
}>>, {
|
1231
|
+
visible: boolean;
|
1232
|
+
}>;
|
1175
1233
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
1176
1234
|
ChatMain: import("vue").DefineComponent<{}, {
|
1177
1235
|
chatMainRef: import("vue").Ref<HTMLElement | undefined>;
|
@@ -1189,7 +1247,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
1189
1247
|
isTemplate3: (content: AnyObject) => boolean;
|
1190
1248
|
needShowTime: (item: AnyObject, index: number) => boolean;
|
1191
1249
|
setScrollToButtom: () => Promise<void>;
|
1192
|
-
getIntervalMsgTime: (time: string) => string;
|
1193
1250
|
resetInfo: () => void;
|
1194
1251
|
handleDownload: (url: string, filename: string) => void;
|
1195
1252
|
NAvatar: any;
|
@@ -1536,6 +1593,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1536
1593
|
};
|
1537
1594
|
}>>, {}>;
|
1538
1595
|
images: import("vue").Ref<any[]>;
|
1596
|
+
formatTime: typeof import("./utils").formatTime;
|
1539
1597
|
MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
|
1540
1598
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
1541
1599
|
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
|
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};
|
@@ -5,23 +5,37 @@ declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
type: StringConstructor;
|
6
6
|
default: string;
|
7
7
|
};
|
8
|
+
visible: {
|
9
|
+
type: BooleanConstructor;
|
10
|
+
};
|
8
11
|
}, {
|
9
12
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
10
13
|
type: {
|
11
14
|
type: StringConstructor;
|
12
15
|
default: string;
|
13
16
|
};
|
17
|
+
visible: {
|
18
|
+
type: BooleanConstructor;
|
19
|
+
};
|
14
20
|
}>> & {}>>;
|
15
|
-
|
21
|
+
state: import("../types").IState;
|
22
|
+
imageList: import("vue").Ref<AnyObject[]>;
|
23
|
+
fileList: import("vue").Ref<AnyObject[]>;
|
24
|
+
imageRef: import("vue").Ref<any>;
|
25
|
+
fileRef: import("vue").Ref<any>;
|
26
|
+
keyword: import("vue").Ref<any>;
|
27
|
+
handleInput: () => void;
|
28
|
+
currentInfo: {
|
29
|
+
page: number;
|
30
|
+
hasMore: boolean;
|
31
|
+
lastSendTime: string;
|
32
|
+
};
|
33
|
+
handleSearch: () => Promise<void>;
|
34
|
+
formatImageList: (data: AnyObject[]) => {
|
16
35
|
label: string;
|
17
|
-
|
18
|
-
}[];
|
19
|
-
fileList: {
|
20
|
-
name: string;
|
21
|
-
size: string;
|
22
|
-
time: string;
|
23
|
-
sender: string;
|
36
|
+
list: unknown;
|
24
37
|
}[];
|
38
|
+
resetAndSearch: () => void;
|
25
39
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
26
40
|
getDetail: (item: AnyObject) => string;
|
27
41
|
NModal: any;
|
@@ -235,7 +249,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
235
249
|
type: StringConstructor;
|
236
250
|
default: string;
|
237
251
|
};
|
252
|
+
visible: {
|
253
|
+
type: BooleanConstructor;
|
254
|
+
};
|
238
255
|
}>>, {
|
239
256
|
type: string;
|
257
|
+
visible: boolean;
|
240
258
|
}>;
|
241
259
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,computed as
|
1
|
+
import{defineComponent as e,ref as t,computed as a,watch as o,openBlock as s,createBlock as i,unref as n,withCtx as l,withDirectives as r,createElementVNode as c,createVNode as m,createElementBlock as p,Fragment as d,renderList as u,toDisplayString as y,vShow as f}from"vue";import{NModal as g,NImageGroup as v,NImage as h,NInput as b,NIcon as w}from"naive-ui";import{SearchOutline as M,OpenOutline as _,DownloadOutline as k}from"@vicons/ionicons5";import{searchChatRecordApi as I}from"../api/index.js";import{useScrollLoading as S}from"../hooks/useScrollLoading.js";import{format as T,isSameWeek as x,isSameMonth as j}from"date-fns";import{useState as A}from"../hooks/useState.js";import{last as z}from"lodash-es";import"../utils/emoji.js";import{useDebounceFn as D}from"@vueuse/core";const H={class:"label"},L={class:"image-box"},E={class:"c-chat-dialog__content c-chat-file-wrapper"},$={class:"text"},F={class:"name"},K={class:"detail"},O={class:"opt-box"};var R=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const R=e,{state:B}=A(),C=t([]),G=t([{name:"问的那个1.docx",size:"8kb",time:"2024/01/01 10:30",sender:"大傻子(质控部)"},{name:"问的那个21.docx",size:"8kb",time:"2024/01/01 10:30",sender:"大傻子(质控2部)"}]),U=t(),q=t(),J=t(),N=D(V,500),P={page:0,hasMore:!0,lastSendTime:T(new Date,"yyyy-MM-dd HH:mm:ss")};async function Q(){var e;try{if(!P.hasMore)return;P.page++;const t=await I({orgId:B.orgId,keyword:J.value,endTime:"",startTime:"",lastSendTime:P.lastSendTime,memberIdSet:[],page:P.page,recordType:"image"===R.type?"IMAGE":"FILE",sessionKey:B.currentSessionItem.sessionKey,userId:B.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(P.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let a=t||[];if(Array.isArray(t)&&t.length>0&&(a=t[0].recordList),P.lastSendTime=null==(e=z(a))?void 0:e.sendTime,"image"===R.type){const e=function(e){const t={};e.forEach((e=>{const a=new Date(e.sendTime);let o=T(a,"yyyy年MM月");x(a,new Date)?o="本周":j(a,new Date)&&(o="本月"),t[o]||(t[o]=[]),t[o].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(a);C.value=P.page>1?C.value.concat(e):e}}catch(e){console.log(e)}}function V(){Object.assign(P,{page:0,hasMore:!0,lastSendTime:T(new Date,"yyyy-MM-dd HH:mm:ss")}),Q()}S(U,(()=>{Q()})),S(q,(()=>{Q()}));const W=a((()=>"image"===R.type?"聊天图片":"聊天文件"));function X(e){const{size:t,time:a,sender:o}=e;return`${t}.${a}.${o}`}return o((()=>R.visible),(e=>{e?V():J.value=""})),(t,a)=>(s(),i(n(g),{preset:"dialog",title:n(W),"show-icon":!1,"auto-focus":!1,class:"c-chat-dialog"},{default:l((()=>[r(c("div",{class:"c-chat-dialog__content c-chat-image-wrapper",ref_key:"imageRef",ref:U},[m(n(v),{"show-toolbar-tooltip":""},{default:l((()=>[(s(!0),p(d,null,u(C.value,(e=>(s(),p("div",{class:"image-item",key:e.label},[c("span",H,y(e.label),1),c("div",L,[(s(!0),p(d,null,u(e.list,(e=>(s(),i(n(h),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[f,"image"===e.type]]),r(c("div",E,[m(n(b),{placeholder:"搜索文件",value:J.value,"onUpdate:value":a[0]||(a[0]=e=>J.value=e),valueModifiers:{trim:!0},onInput:n(N)},{prefix:l((()=>[m(n(w),{component:n(M)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:q},[(s(!0),p(d,null,u(G.value,((e,t)=>(s(),p("div",{class:"file-item",key:t},[m(n(w),{component:n(M)},null,8,["component"]),c("div",$,[c("span",F,y(e.name),1),c("span",K,y(X(e)),1)]),c("div",O,[m(n(w),{size:16,component:n(_)},null,8,["component"]),m(n(w),{size:16,component:n(k)},null,8,["component"])])])))),128))],512)],512),[[f,"image"!==e.type]])])),_:1},8,["title"]))}});export{R as default};
|
@@ -332,23 +332,37 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
332
332
|
type: StringConstructor;
|
333
333
|
default: string;
|
334
334
|
};
|
335
|
+
visible: {
|
336
|
+
type: BooleanConstructor;
|
337
|
+
};
|
335
338
|
}, {
|
336
339
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
337
340
|
type: {
|
338
341
|
type: StringConstructor;
|
339
342
|
default: string;
|
340
343
|
};
|
344
|
+
visible: {
|
345
|
+
type: BooleanConstructor;
|
346
|
+
};
|
341
347
|
}>> & {}>>;
|
342
|
-
|
348
|
+
state: import("../types").IState;
|
349
|
+
imageList: import("vue").Ref<AnyObject[]>;
|
350
|
+
fileList: import("vue").Ref<AnyObject[]>;
|
351
|
+
imageRef: import("vue").Ref<any>;
|
352
|
+
fileRef: import("vue").Ref<any>;
|
353
|
+
keyword: import("vue").Ref<any>;
|
354
|
+
handleInput: () => void;
|
355
|
+
currentInfo: {
|
356
|
+
page: number;
|
357
|
+
hasMore: boolean;
|
358
|
+
lastSendTime: string;
|
359
|
+
};
|
360
|
+
handleSearch: () => Promise<void>;
|
361
|
+
formatImageList: (data: AnyObject[]) => {
|
343
362
|
label: string;
|
344
|
-
|
345
|
-
}[];
|
346
|
-
fileList: {
|
347
|
-
name: string;
|
348
|
-
size: string;
|
349
|
-
time: string;
|
350
|
-
sender: string;
|
363
|
+
list: unknown;
|
351
364
|
}[];
|
365
|
+
resetAndSearch: () => void;
|
352
366
|
title: import("vue").ComputedRef<"聊天图片" | "聊天文件">;
|
353
367
|
getDetail: (item: AnyObject) => string;
|
354
368
|
NModal: any;
|
@@ -562,23 +576,47 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
562
576
|
type: StringConstructor;
|
563
577
|
default: string;
|
564
578
|
};
|
579
|
+
visible: {
|
580
|
+
type: BooleanConstructor;
|
581
|
+
};
|
565
582
|
}>>, {
|
566
583
|
type: string;
|
584
|
+
visible: boolean;
|
567
585
|
}>;
|
568
|
-
ChatRecord: import("vue").DefineComponent<{
|
586
|
+
ChatRecord: import("vue").DefineComponent<{
|
587
|
+
visible: {
|
588
|
+
type: BooleanConstructor;
|
589
|
+
};
|
590
|
+
}, {
|
569
591
|
tagColor: {
|
570
592
|
color: string;
|
571
593
|
textColor: string;
|
572
594
|
};
|
595
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
596
|
+
visible: {
|
597
|
+
type: BooleanConstructor;
|
598
|
+
};
|
599
|
+
}>> & {}>>;
|
573
600
|
state: import("../types").IState;
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
}[];
|
579
|
-
user: import("vue").Ref<never[]>;
|
601
|
+
recordRef: import("vue").Ref<any>;
|
602
|
+
recordList: import("vue").Ref<AnyObject[]>;
|
603
|
+
keyword: import("vue").Ref<any>;
|
604
|
+
memberList: import("vue").Ref<never[]>;
|
580
605
|
startTime: import("vue").Ref<any>;
|
581
606
|
endTime: import("vue").Ref<any>;
|
607
|
+
handleInput: () => void;
|
608
|
+
currentInfo: {
|
609
|
+
page: number;
|
610
|
+
hasMore: boolean;
|
611
|
+
lastSendTime: string;
|
612
|
+
};
|
613
|
+
handleSearch: () => Promise<void>;
|
614
|
+
options: import("vue").ComputedRef<AnyObject[]>;
|
615
|
+
resetAndSearch: () => void;
|
616
|
+
startDateDisabled: (ts: number) => boolean;
|
617
|
+
endDateDisabled: (ts: number) => boolean;
|
618
|
+
resetInfo: () => void;
|
619
|
+
handleCloseTag: (type: "end" | "start" | "member") => void;
|
582
620
|
getPrefixCondition: () => (JSX.Element | null)[];
|
583
621
|
renderLabel: (option: AnyObject) => JSX.Element;
|
584
622
|
NModal: any;
|
@@ -587,6 +625,17 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
587
625
|
NSelect: any;
|
588
626
|
NAvatar: any;
|
589
627
|
NPopover: any;
|
628
|
+
NInputGroup: import("vue").DefineComponent<{
|
629
|
+
[x: string]: never;
|
630
|
+
[x: number]: never;
|
631
|
+
[x: symbol]: never;
|
632
|
+
}, {
|
633
|
+
mergedClsPrefix: import("vue").ComputedRef<string>;
|
634
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
635
|
+
[x: string]: never;
|
636
|
+
[x: number]: never;
|
637
|
+
[x: symbol]: never;
|
638
|
+
}>>, {}>;
|
590
639
|
DatePicker: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
591
640
|
updateUnchangedValue: {
|
592
641
|
type: BooleanConstructor;
|
@@ -664,6 +713,15 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
664
713
|
}, {
|
665
714
|
updateUnchangedValue: boolean;
|
666
715
|
}>>;
|
667
|
-
|
716
|
+
formatTime: typeof import("../utils").formatTime;
|
717
|
+
MESSAGE_TYPE: typeof import("../constants").MESSAGE_TYPE;
|
718
|
+
images: import("vue").Ref<any[]>;
|
719
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
720
|
+
visible: {
|
721
|
+
type: BooleanConstructor;
|
722
|
+
};
|
723
|
+
}>>, {
|
724
|
+
visible: boolean;
|
725
|
+
}>;
|
668
726
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
669
727
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as a,openBlock as o,createElementBlock as
|
1
|
+
import{defineComponent as e,ref as a,openBlock as o,createElementBlock as s,Fragment as t,unref as i,createElementVNode as l,createVNode as r,withCtx as c,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(),b=a(!1),j=a(!1),S=a("image"),y=a(!1);function I(e){S.value=e,j.value=!0}return(e,a)=>(o(),s(t,null,[i(k).id?(o(),s("section",w,[l("div",C,[r(m,{"user-id":i(k).currentSessionItem.receiver},{trigger:c((()=>[r(i(h),{round:"",size:30,src:i(k).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id"]),l("span",_,n(i(k).currentSessionItem.name),1)]),l("div",g,[l("i",{class:"chat--iconfont chat--icon-image",onClick:a[0]||(a[0]=()=>I("image"))}),l("i",{class:"chat--iconfont chat--icon-folder",onClick:a[1]||(a[1]=()=>I("file"))}),l("i",{class:"chat--iconfont chat--icon-list-search",onClick:a[2]||(a[2]=e=>y.value=!0)}),l("i",{class:"chat--iconfont chat--icon-set",onClick:a[3]||(a[3]=e=>b.value=!0)})])])):u("v-if",!0),r(f,{show:b.value,"onUpdate:show":a[4]||(a[4]=e=>b.value=e)},null,8,["show"]),r(d,{show:j.value,"onUpdate:show":a[5]||(a[5]=e=>j.value=e),type:S.value,visible:j.value},null,8,["show","type","visible"]),r(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
|
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};
|