cnhis-design-vue 3.3.3-beta.33 → 3.3.3-beta.41
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/README.md +87 -87
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/form-config/index.d.ts +10 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +10 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +10 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +2 -2
- package/es/components/form-config/src/constants/index.d.ts +3 -1
- package/es/components/form-config/src/constants/index.js +2 -0
- package/es/components/form-config/src/hooks/useConfigurationField.js +24 -4
- package/es/components/form-config/src/hooks/useLocale.d.ts +2 -0
- package/es/components/form-config/src/hooks/useLocale.js +2 -0
- package/es/components/form-config/src/types/index.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +9 -2
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +4 -2
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +5 -2
- package/es/components/iho-chat/index.d.ts +836 -44
- package/es/components/iho-chat/src/Index.vue.d.ts +836 -44
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +179 -6
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +48 -28
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +61 -5
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +83 -38
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +327 -13
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +18 -17
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +232 -17
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +299 -272
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +49 -3
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +48 -2
- package/es/components/iho-chat/src/components/ImageLightbox.vue.d.ts +104 -0
- package/es/components/iho-chat/src/components/ImageLightbox.vue.js +6 -0
- package/es/components/iho-chat/src/components/ImageLightbox.vue2.js +307 -0
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +51 -4
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +48 -2
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SelectLabel.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +24 -1
- package/es/components/iho-chat/src/hooks/useData.d.ts +51 -4
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +24 -1
- package/es/components/iho-chat/src/types/index.d.ts +37 -1
- package/es/components/iho-chat/src/utils/emoji.d.ts +1 -1
- package/es/components/iho-chat/src/utils/emoji.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +1 -0
- package/es/components/iho-chat/src/utils/index.js +8 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +20 -15
- package/es/env.d.ts +25 -25
- package/es/shared/hooks/useLevelSearchCascader.js +3 -3
- package/es/shared/package.json.js +1 -1
- package/package.json +3 -2
@@ -21,7 +21,30 @@ declare const _default: import("vue").DefineComponent<{
|
|
21
21
|
currentSessionItem: AnyObject;
|
22
22
|
id: string;
|
23
23
|
userInfo: AnyObject;
|
24
|
-
msgList:
|
24
|
+
msgList: {
|
25
|
+
[x: string]: any;
|
26
|
+
id: string;
|
27
|
+
sessionKey: string;
|
28
|
+
content: {
|
29
|
+
[x: string]: any;
|
30
|
+
chatMessageType: string;
|
31
|
+
msg: string;
|
32
|
+
referenceContent?: any;
|
33
|
+
forwardMessageList?: AnyObject[] | undefined;
|
34
|
+
messageTemplate?: any;
|
35
|
+
messageTemplateData?: any;
|
36
|
+
fileUrl?: string | undefined;
|
37
|
+
avStatus?: string | undefined;
|
38
|
+
};
|
39
|
+
senderName: string;
|
40
|
+
sendTime: string;
|
41
|
+
sender: string;
|
42
|
+
status: string;
|
43
|
+
senderAvatar: string;
|
44
|
+
__content: string;
|
45
|
+
__time?: string | undefined;
|
46
|
+
__sendTime?: string | undefined;
|
47
|
+
}[];
|
25
48
|
currentMsg: AnyObject;
|
26
49
|
isAppendMsg: boolean;
|
27
50
|
sessionList: AnyObject[];
|
@@ -222,7 +245,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
222
245
|
MESSAGE_TYPE: typeof MESSAGE_TYPE;
|
223
246
|
emojis: {
|
224
247
|
default: string[][];
|
225
|
-
findEmoji(name: string):
|
248
|
+
findEmoji(name: string): string | undefined;
|
226
249
|
};
|
227
250
|
MessageEvent: import("vue").DefineComponent<{
|
228
251
|
data: {
|
@@ -241,7 +264,30 @@ declare const _default: import("vue").DefineComponent<{
|
|
241
264
|
currentSessionItem: AnyObject;
|
242
265
|
id: string;
|
243
266
|
userInfo: AnyObject;
|
244
|
-
msgList:
|
267
|
+
msgList: {
|
268
|
+
[x: string]: any;
|
269
|
+
id: string;
|
270
|
+
sessionKey: string;
|
271
|
+
content: {
|
272
|
+
[x: string]: any;
|
273
|
+
chatMessageType: string;
|
274
|
+
msg: string;
|
275
|
+
referenceContent?: any;
|
276
|
+
forwardMessageList?: AnyObject[] | undefined;
|
277
|
+
messageTemplate?: any;
|
278
|
+
messageTemplateData?: any;
|
279
|
+
fileUrl?: string | undefined;
|
280
|
+
avStatus?: string | undefined;
|
281
|
+
};
|
282
|
+
senderName: string;
|
283
|
+
sendTime: string;
|
284
|
+
sender: string;
|
285
|
+
status: string;
|
286
|
+
senderAvatar: string;
|
287
|
+
__content: string;
|
288
|
+
__time?: string | undefined;
|
289
|
+
__sendTime?: string | undefined;
|
290
|
+
}[];
|
245
291
|
currentMsg: AnyObject;
|
246
292
|
isAppendMsg: boolean;
|
247
293
|
sessionList: AnyObject[];
|
@@ -11,7 +11,30 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
11
11
|
currentSessionItem: AnyObject;
|
12
12
|
id: string;
|
13
13
|
userInfo: AnyObject;
|
14
|
-
msgList:
|
14
|
+
msgList: {
|
15
|
+
[x: string]: any;
|
16
|
+
id: string;
|
17
|
+
sessionKey: string;
|
18
|
+
content: {
|
19
|
+
[x: string]: any;
|
20
|
+
chatMessageType: string;
|
21
|
+
msg: string;
|
22
|
+
referenceContent?: any;
|
23
|
+
forwardMessageList?: AnyObject[] | undefined;
|
24
|
+
messageTemplate?: any;
|
25
|
+
messageTemplateData?: any;
|
26
|
+
fileUrl?: string | undefined;
|
27
|
+
avStatus?: string | undefined;
|
28
|
+
};
|
29
|
+
senderName: string;
|
30
|
+
sendTime: string;
|
31
|
+
sender: string;
|
32
|
+
status: string;
|
33
|
+
senderAvatar: string;
|
34
|
+
__content: string;
|
35
|
+
__time?: string | undefined;
|
36
|
+
__sendTime?: string | undefined;
|
37
|
+
}[];
|
15
38
|
currentMsg: AnyObject;
|
16
39
|
isAppendMsg: boolean;
|
17
40
|
sessionList: AnyObject[];
|
@@ -10,7 +10,30 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
10
10
|
currentSessionItem: AnyObject;
|
11
11
|
id: string;
|
12
12
|
userInfo: AnyObject;
|
13
|
-
msgList:
|
13
|
+
msgList: {
|
14
|
+
[x: string]: any;
|
15
|
+
id: string;
|
16
|
+
sessionKey: string;
|
17
|
+
content: {
|
18
|
+
[x: string]: any;
|
19
|
+
chatMessageType: string;
|
20
|
+
msg: string;
|
21
|
+
referenceContent?: any;
|
22
|
+
forwardMessageList?: AnyObject[] | undefined;
|
23
|
+
messageTemplate?: any;
|
24
|
+
messageTemplateData?: any;
|
25
|
+
fileUrl?: string | undefined;
|
26
|
+
avStatus?: string | undefined;
|
27
|
+
};
|
28
|
+
senderName: string;
|
29
|
+
sendTime: string;
|
30
|
+
sender: string;
|
31
|
+
status: string;
|
32
|
+
senderAvatar: string;
|
33
|
+
__content: string;
|
34
|
+
__time?: string | undefined;
|
35
|
+
__sendTime?: string | undefined;
|
36
|
+
}[];
|
14
37
|
currentMsg: AnyObject;
|
15
38
|
isAppendMsg: boolean;
|
16
39
|
sessionList: AnyObject[];
|
@@ -131,7 +154,30 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
131
154
|
currentSessionItem: AnyObject;
|
132
155
|
id: string;
|
133
156
|
userInfo: AnyObject;
|
134
|
-
msgList:
|
157
|
+
msgList: {
|
158
|
+
[x: string]: any;
|
159
|
+
id: string;
|
160
|
+
sessionKey: string;
|
161
|
+
content: {
|
162
|
+
[x: string]: any;
|
163
|
+
chatMessageType: string;
|
164
|
+
msg: string;
|
165
|
+
referenceContent?: any;
|
166
|
+
forwardMessageList?: AnyObject[] | undefined;
|
167
|
+
messageTemplate?: any;
|
168
|
+
messageTemplateData?: any;
|
169
|
+
fileUrl?: string | undefined;
|
170
|
+
avStatus?: string | undefined;
|
171
|
+
};
|
172
|
+
senderName: string;
|
173
|
+
sendTime: string;
|
174
|
+
sender: string;
|
175
|
+
status: string;
|
176
|
+
senderAvatar: string;
|
177
|
+
__content: string;
|
178
|
+
__time?: string | undefined;
|
179
|
+
__sendTime?: string | undefined;
|
180
|
+
}[];
|
135
181
|
currentMsg: AnyObject;
|
136
182
|
isAppendMsg: boolean;
|
137
183
|
sessionList: AnyObject[];
|
@@ -0,0 +1,104 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import type { ImageItem } from '../types';
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
4
|
+
images: {
|
5
|
+
type: PropType<ImageItem[]>;
|
6
|
+
default: () => never[];
|
7
|
+
};
|
8
|
+
visible: {
|
9
|
+
type: BooleanConstructor;
|
10
|
+
};
|
11
|
+
currentId: {
|
12
|
+
type: StringConstructor;
|
13
|
+
default: string;
|
14
|
+
};
|
15
|
+
}, {
|
16
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
17
|
+
images: {
|
18
|
+
type: PropType<ImageItem[]>;
|
19
|
+
default: () => never[];
|
20
|
+
};
|
21
|
+
visible: {
|
22
|
+
type: BooleanConstructor;
|
23
|
+
};
|
24
|
+
currentId: {
|
25
|
+
type: StringConstructor;
|
26
|
+
default: string;
|
27
|
+
};
|
28
|
+
}>> & {
|
29
|
+
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
30
|
+
"onUpdate:currentId"?: ((...args: any[]) => any) | undefined;
|
31
|
+
}>>;
|
32
|
+
emit: (event: "update:visible" | "update:currentId", ...args: any[]) => void;
|
33
|
+
imageEl: import("vue").Ref<HTMLImageElement | null>;
|
34
|
+
naturalSize: import("vue").Ref<{
|
35
|
+
width: number;
|
36
|
+
height: number;
|
37
|
+
}>;
|
38
|
+
scale: import("vue").Ref<number>;
|
39
|
+
rotation: import("vue").Ref<number>;
|
40
|
+
isDragging: import("vue").Ref<boolean>;
|
41
|
+
offset: import("vue").Ref<{
|
42
|
+
x: number;
|
43
|
+
y: number;
|
44
|
+
}>;
|
45
|
+
lastMouse: import("vue").Ref<{
|
46
|
+
x: number;
|
47
|
+
y: number;
|
48
|
+
}>;
|
49
|
+
idToIndexMap: import("vue").ComputedRef<Map<string, number>>;
|
50
|
+
currentIndex: import("vue").ComputedRef<number>;
|
51
|
+
currentImageData: import("vue").ComputedRef<ImageItem>;
|
52
|
+
hasNext: import("vue").ComputedRef<boolean>;
|
53
|
+
hasPrev: import("vue").ComputedRef<boolean>;
|
54
|
+
imageStyle: import("vue").ComputedRef<{
|
55
|
+
left: string;
|
56
|
+
top: string;
|
57
|
+
transform: string;
|
58
|
+
cursor: string;
|
59
|
+
transition: string;
|
60
|
+
}>;
|
61
|
+
resetImageState: () => void;
|
62
|
+
close: () => void;
|
63
|
+
nextImage: () => void;
|
64
|
+
prevImage: () => void;
|
65
|
+
rotate: (degrees: number) => void;
|
66
|
+
zoomIn: () => void;
|
67
|
+
zoomOut: () => void;
|
68
|
+
resetZoom: () => void;
|
69
|
+
startDrag: (e: MouseEvent) => void;
|
70
|
+
onDragMove: (e: MouseEvent) => void;
|
71
|
+
endDrag: () => void;
|
72
|
+
handleWheel: (e: WheelEvent) => void;
|
73
|
+
handleImageLoad: () => void;
|
74
|
+
download: () => void;
|
75
|
+
Close: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
76
|
+
PlaySkipBackOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
77
|
+
PlaySkipForwardOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
78
|
+
DownloadOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
79
|
+
RefreshOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
80
|
+
AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
81
|
+
RemoveSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
82
|
+
NButton: any;
|
83
|
+
NIcon: any;
|
84
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "update:currentId")[], "update:visible" | "update:currentId", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
85
|
+
images: {
|
86
|
+
type: PropType<ImageItem[]>;
|
87
|
+
default: () => never[];
|
88
|
+
};
|
89
|
+
visible: {
|
90
|
+
type: BooleanConstructor;
|
91
|
+
};
|
92
|
+
currentId: {
|
93
|
+
type: StringConstructor;
|
94
|
+
default: string;
|
95
|
+
};
|
96
|
+
}>> & {
|
97
|
+
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
98
|
+
"onUpdate:currentId"?: ((...args: any[]) => any) | undefined;
|
99
|
+
}, {
|
100
|
+
visible: boolean;
|
101
|
+
images: ImageItem[];
|
102
|
+
currentId: string;
|
103
|
+
}>;
|
104
|
+
export default _default;
|
@@ -0,0 +1,307 @@
|
|
1
|
+
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, withModifiers, createElementVNode, createVNode, unref, withCtx, createCommentVNode, normalizeStyle, renderSlot, toDisplayString, createTextVNode } from 'vue';
|
2
|
+
import { downloadFile } from '../utils/index.js';
|
3
|
+
import { Close, PlaySkipBackOutline, PlaySkipForwardOutline, RefreshOutline, AddOutline, RemoveSharp, DownloadOutline } from '@vicons/ionicons5';
|
4
|
+
import { NButton, NIcon } from 'naive-ui';
|
5
|
+
|
6
|
+
const _hoisted_1 = ["onClick"];
|
7
|
+
const _hoisted_2 = {
|
8
|
+
class: "lightbox-container"
|
9
|
+
};
|
10
|
+
const _hoisted_3 = ["onMousedown", "onWheel"];
|
11
|
+
const _hoisted_4 = ["src", "alt"];
|
12
|
+
const _hoisted_5 = {
|
13
|
+
class: "title"
|
14
|
+
};
|
15
|
+
const _hoisted_6 = {
|
16
|
+
class: "toolbar-container"
|
17
|
+
};
|
18
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
19
|
+
__name: "ImageLightbox",
|
20
|
+
props: {
|
21
|
+
images: {
|
22
|
+
type: Array,
|
23
|
+
default: () => []
|
24
|
+
},
|
25
|
+
visible: {
|
26
|
+
type: Boolean
|
27
|
+
},
|
28
|
+
currentId: {
|
29
|
+
type: String,
|
30
|
+
default: ""
|
31
|
+
}
|
32
|
+
},
|
33
|
+
emits: ["update:visible", "update:currentId"],
|
34
|
+
setup(__props, {
|
35
|
+
expose,
|
36
|
+
emit
|
37
|
+
}) {
|
38
|
+
const props = __props;
|
39
|
+
const imageEl = ref(null);
|
40
|
+
const naturalSize = ref({
|
41
|
+
width: 0,
|
42
|
+
height: 0
|
43
|
+
});
|
44
|
+
const scale = ref(1);
|
45
|
+
const rotation = ref(0);
|
46
|
+
const isDragging = ref(false);
|
47
|
+
const offset = ref({
|
48
|
+
x: 0,
|
49
|
+
y: 0
|
50
|
+
});
|
51
|
+
const lastMouse = ref({
|
52
|
+
x: 0,
|
53
|
+
y: 0
|
54
|
+
});
|
55
|
+
const idToIndexMap = computed(() => {
|
56
|
+
const map = /* @__PURE__ */ new Map();
|
57
|
+
props.images.forEach((img, index) => map.set(img.id, index));
|
58
|
+
return map;
|
59
|
+
});
|
60
|
+
const currentIndex = computed(() => {
|
61
|
+
var _a;
|
62
|
+
return (_a = idToIndexMap.value.get(props.currentId)) != null ? _a : 0;
|
63
|
+
});
|
64
|
+
const currentImageData = computed(() => props.images.find((img) => img.id === props.currentId) || props.images[0]);
|
65
|
+
const hasNext = computed(() => currentIndex.value < props.images.length - 1);
|
66
|
+
const hasPrev = computed(() => currentIndex.value > 0);
|
67
|
+
const imageStyle = computed(() => ({
|
68
|
+
left: `calc(50% + ${offset.value.x}px)`,
|
69
|
+
top: `calc(50% + ${offset.value.y}px)`,
|
70
|
+
transform: `translate(-50%, -50%) scale(${scale.value}) rotate(${rotation.value}deg)`,
|
71
|
+
cursor: isDragging.value ? "grabbing" : "grab",
|
72
|
+
transition: isDragging.value ? "none" : "transform 0.3s ease"
|
73
|
+
}));
|
74
|
+
const resetImageState = () => {
|
75
|
+
scale.value = 1;
|
76
|
+
rotation.value = 0;
|
77
|
+
offset.value = {
|
78
|
+
x: 0,
|
79
|
+
y: 0
|
80
|
+
};
|
81
|
+
};
|
82
|
+
const close = () => {
|
83
|
+
emit("update:visible", false);
|
84
|
+
};
|
85
|
+
const nextImage = () => {
|
86
|
+
if (hasNext.value) {
|
87
|
+
emit("update:currentId", props.images[currentIndex.value + 1].id);
|
88
|
+
resetImageState();
|
89
|
+
}
|
90
|
+
};
|
91
|
+
const prevImage = () => {
|
92
|
+
if (hasPrev.value) {
|
93
|
+
emit("update:currentId", props.images[currentIndex.value - 1].id);
|
94
|
+
resetImageState();
|
95
|
+
}
|
96
|
+
};
|
97
|
+
const rotate = (degrees) => {
|
98
|
+
rotation.value = (rotation.value + degrees) % 360;
|
99
|
+
};
|
100
|
+
const zoomIn = () => {
|
101
|
+
scale.value = Math.min(scale.value + 0.2, 5);
|
102
|
+
};
|
103
|
+
const zoomOut = () => {
|
104
|
+
scale.value = Math.max(scale.value - 0.2, 0.5);
|
105
|
+
};
|
106
|
+
const resetZoom = () => {
|
107
|
+
if (!imageEl.value)
|
108
|
+
return;
|
109
|
+
const container = imageEl.value.parentElement;
|
110
|
+
if (!container)
|
111
|
+
return;
|
112
|
+
const containerWidth = container.clientWidth;
|
113
|
+
const containerHeight = container.clientHeight;
|
114
|
+
const widthRatio = containerWidth / naturalSize.value.width;
|
115
|
+
const heightRatio = containerHeight / naturalSize.value.height;
|
116
|
+
scale.value = Math.min(widthRatio, heightRatio, 1);
|
117
|
+
offset.value = {
|
118
|
+
x: 0,
|
119
|
+
y: 0
|
120
|
+
};
|
121
|
+
};
|
122
|
+
function startDrag(e) {
|
123
|
+
if (scale.value <= 1)
|
124
|
+
return;
|
125
|
+
isDragging.value = true;
|
126
|
+
lastMouse.value = {
|
127
|
+
x: e.clientX,
|
128
|
+
y: e.clientY
|
129
|
+
};
|
130
|
+
document.body.style.cursor = "grabbing";
|
131
|
+
window.addEventListener("mousemove", onDragMove);
|
132
|
+
window.addEventListener("mouseup", endDrag);
|
133
|
+
}
|
134
|
+
function onDragMove(e) {
|
135
|
+
if (!isDragging.value)
|
136
|
+
return;
|
137
|
+
const dx = e.clientX - lastMouse.value.x;
|
138
|
+
const dy = e.clientY - lastMouse.value.y;
|
139
|
+
offset.value = {
|
140
|
+
x: offset.value.x + dx,
|
141
|
+
y: offset.value.y + dy
|
142
|
+
};
|
143
|
+
lastMouse.value = {
|
144
|
+
x: e.clientX,
|
145
|
+
y: e.clientY
|
146
|
+
};
|
147
|
+
}
|
148
|
+
function endDrag() {
|
149
|
+
if (!isDragging.value)
|
150
|
+
return;
|
151
|
+
isDragging.value = false;
|
152
|
+
document.body.style.cursor = "";
|
153
|
+
window.removeEventListener("mousemove", onDragMove);
|
154
|
+
window.removeEventListener("mouseup", endDrag);
|
155
|
+
}
|
156
|
+
const handleWheel = (e) => {
|
157
|
+
var _a;
|
158
|
+
e.preventDefault();
|
159
|
+
const rect = (_a = imageEl.value) == null ? void 0 : _a.getBoundingClientRect();
|
160
|
+
if (!rect)
|
161
|
+
return;
|
162
|
+
const delta = -e.deltaY;
|
163
|
+
const zoomFactor = delta > 0 ? 1.1 : 0.9;
|
164
|
+
const newScale = Math.min(Math.max(scale.value * zoomFactor, 0.5), 5);
|
165
|
+
scale.value = newScale;
|
166
|
+
};
|
167
|
+
const handleImageLoad = () => {
|
168
|
+
if (imageEl.value) {
|
169
|
+
naturalSize.value = {
|
170
|
+
width: imageEl.value.naturalWidth,
|
171
|
+
height: imageEl.value.naturalHeight
|
172
|
+
};
|
173
|
+
resetImageState();
|
174
|
+
}
|
175
|
+
};
|
176
|
+
const download = () => {
|
177
|
+
downloadFile(JSON.stringify({
|
178
|
+
fileUrl: currentImageData.value.src,
|
179
|
+
fileName: currentImageData.value.fileName
|
180
|
+
}));
|
181
|
+
};
|
182
|
+
watch(() => props.visible, (newVal) => {
|
183
|
+
document.body.style.overflow = newVal ? "hidden" : "";
|
184
|
+
});
|
185
|
+
expose({
|
186
|
+
open,
|
187
|
+
nextImage,
|
188
|
+
prevImage
|
189
|
+
});
|
190
|
+
return (_ctx, _cache) => {
|
191
|
+
return __props.visible ? (openBlock(), createElementBlock("div", {
|
192
|
+
key: 0,
|
193
|
+
class: "c-lightbox-overlay",
|
194
|
+
onClick: withModifiers(close, ["stop"])
|
195
|
+
}, [createElementVNode("div", _hoisted_2, [createVNode(unref(NButton), {
|
196
|
+
text: "",
|
197
|
+
class: "close-btn",
|
198
|
+
onClick: close
|
199
|
+
}, {
|
200
|
+
default: withCtx(() => [createVNode(unref(NIcon), {
|
201
|
+
size: "22",
|
202
|
+
component: unref(Close)
|
203
|
+
}, null, 8, ["component"])]),
|
204
|
+
_: 1
|
205
|
+
}), createCommentVNode(" \u56FE\u7247\u5BB9\u5668 "), createElementVNode("div", {
|
206
|
+
class: "image-container",
|
207
|
+
onMousedown: withModifiers(startDrag, ["prevent"]),
|
208
|
+
onWheel: withModifiers(handleWheel, ["prevent"])
|
209
|
+
}, [createElementVNode("img", {
|
210
|
+
ref_key: "imageEl",
|
211
|
+
ref: imageEl,
|
212
|
+
src: unref(currentImageData).fileUrl,
|
213
|
+
style: normalizeStyle(unref(imageStyle)),
|
214
|
+
alt: unref(currentImageData).fileName,
|
215
|
+
onLoad: handleImageLoad,
|
216
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
217
|
+
}, ["stop"]))
|
218
|
+
}, null, 44, _hoisted_4)], 40, _hoisted_3), createCommentVNode(function() {
|
219
|
+
var _a, _b, _c;
|
220
|
+
try {
|
221
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.254")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.254")) || "\u81EA\u5B9A\u4E49\u6807\u9898";
|
222
|
+
} catch (e) {
|
223
|
+
return "\u81EA\u5B9A\u4E49\u6807\u9898";
|
224
|
+
}
|
225
|
+
}()), createElementVNode("div", _hoisted_5, [renderSlot(_ctx.$slots, "title", {
|
226
|
+
currentImageData: unref(currentImageData)
|
227
|
+
}, () => [createElementVNode("p", null, toDisplayString(unref(currentImageData).senderName) + "\u5206\u4EAB\u7684\u56FE\u7247", 1), createElementVNode("p", null, toDisplayString(unref(currentImageData).sendTime) + " \xB7 " + toDisplayString(unref(currentImageData).fileSize), 1)])]), createCommentVNode(" \u5DE5\u5177\u680F "), createElementVNode("div", _hoisted_6, [createElementVNode("div", {
|
228
|
+
class: "toolbar",
|
229
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(() => {
|
230
|
+
}, ["stop"]))
|
231
|
+
}, [createVNode(unref(NButton), {
|
232
|
+
text: "",
|
233
|
+
disabled: !unref(hasPrev),
|
234
|
+
onClick: prevImage
|
235
|
+
}, {
|
236
|
+
default: withCtx(() => [createVNode(unref(NIcon), {
|
237
|
+
size: "22",
|
238
|
+
component: unref(PlaySkipBackOutline)
|
239
|
+
}, null, 8, ["component"])]),
|
240
|
+
_: 1
|
241
|
+
}, 8, ["disabled"]), createVNode(unref(NButton), {
|
242
|
+
text: "",
|
243
|
+
disabled: !unref(hasNext),
|
244
|
+
onClick: nextImage
|
245
|
+
}, {
|
246
|
+
default: withCtx(() => [createVNode(unref(NIcon), {
|
247
|
+
size: "22",
|
248
|
+
component: unref(PlaySkipForwardOutline)
|
249
|
+
}, null, 8, ["component"])]),
|
250
|
+
_: 1
|
251
|
+
}, 8, ["disabled"]), createVNode(unref(NButton), {
|
252
|
+
text: "",
|
253
|
+
onClick: _cache[1] || (_cache[1] = () => rotate(-90))
|
254
|
+
}, {
|
255
|
+
default: withCtx(() => [createVNode(unref(NIcon), {
|
256
|
+
size: "22",
|
257
|
+
component: unref(RefreshOutline)
|
258
|
+
}, null, 8, ["component"])]),
|
259
|
+
_: 1
|
260
|
+
}), createVNode(unref(NButton), {
|
261
|
+
text: "",
|
262
|
+
onClick: _cache[2] || (_cache[2] = () => rotate(90))
|
263
|
+
}, {
|
264
|
+
default: withCtx(() => [createVNode(unref(NIcon), {
|
265
|
+
size: "22",
|
266
|
+
component: unref(RefreshOutline)
|
267
|
+
}, null, 8, ["component"])]),
|
268
|
+
_: 1
|
269
|
+
}), createVNode(unref(NButton), {
|
270
|
+
text: "",
|
271
|
+
onClick: zoomIn
|
272
|
+
}, {
|
273
|
+
default: withCtx(() => [createVNode(unref(NIcon), {
|
274
|
+
size: "22",
|
275
|
+
component: unref(AddOutline)
|
276
|
+
}, null, 8, ["component"])]),
|
277
|
+
_: 1
|
278
|
+
}), createVNode(unref(NButton), {
|
279
|
+
text: "",
|
280
|
+
onClick: zoomOut
|
281
|
+
}, {
|
282
|
+
default: withCtx(() => [createVNode(unref(NIcon), {
|
283
|
+
size: "22",
|
284
|
+
component: unref(RemoveSharp)
|
285
|
+
}, null, 8, ["component"])]),
|
286
|
+
_: 1
|
287
|
+
}), createVNode(unref(NButton), {
|
288
|
+
text: "",
|
289
|
+
onClick: resetZoom
|
290
|
+
}, {
|
291
|
+
default: withCtx(() => [createTextVNode("1:1")]),
|
292
|
+
_: 1
|
293
|
+
}), createVNode(unref(NButton), {
|
294
|
+
text: "",
|
295
|
+
onClick: download
|
296
|
+
}, {
|
297
|
+
default: withCtx(() => [createVNode(unref(NIcon), {
|
298
|
+
size: "22",
|
299
|
+
component: unref(DownloadOutline)
|
300
|
+
}, null, 8, ["component"])]),
|
301
|
+
_: 1
|
302
|
+
})])])])], 8, _hoisted_1)) : createCommentVNode("v-if", true);
|
303
|
+
};
|
304
|
+
}
|
305
|
+
});
|
306
|
+
|
307
|
+
export { _sfc_main as default };
|
@@ -17,7 +17,30 @@ declare const _default: import("vue").DefineComponent<{
|
|
17
17
|
currentSessionItem: AnyObject;
|
18
18
|
id: string;
|
19
19
|
userInfo: AnyObject;
|
20
|
-
msgList:
|
20
|
+
msgList: {
|
21
|
+
[x: string]: any;
|
22
|
+
id: string;
|
23
|
+
sessionKey: string;
|
24
|
+
content: {
|
25
|
+
[x: string]: any;
|
26
|
+
chatMessageType: string;
|
27
|
+
msg: string;
|
28
|
+
referenceContent?: any;
|
29
|
+
forwardMessageList?: AnyObject[] | undefined;
|
30
|
+
messageTemplate?: any;
|
31
|
+
messageTemplateData?: any;
|
32
|
+
fileUrl?: string | undefined;
|
33
|
+
avStatus?: string | undefined;
|
34
|
+
};
|
35
|
+
senderName: string;
|
36
|
+
sendTime: string;
|
37
|
+
sender: string;
|
38
|
+
status: string;
|
39
|
+
senderAvatar: string;
|
40
|
+
__content: string;
|
41
|
+
__time?: string | undefined;
|
42
|
+
__sendTime?: string | undefined;
|
43
|
+
}[];
|
21
44
|
currentMsg: AnyObject;
|
22
45
|
isAppendMsg: boolean;
|
23
46
|
sessionList: AnyObject[];
|