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
@@ -1,4 +1,4 @@
|
|
1
|
-
import { createElementVNode, defineComponent, ref, computed, onMounted, watch, withDirectives, openBlock, createElementBlock, normalizeStyle, unref, createVNode, withCtx, Fragment, toDisplayString, createCommentVNode, renderList, createBlock, createTextVNode, mergeProps, renderSlot, vShow } from 'vue';
|
1
|
+
import { createElementVNode, defineComponent, ref, computed, onMounted, onBeforeUnmount, watch, withDirectives, openBlock, createElementBlock, normalizeStyle, unref, createVNode, withCtx, Fragment, toDisplayString, createCommentVNode, renderList, createBlock, createTextVNode, mergeProps, renderSlot, vShow } from 'vue';
|
2
2
|
import { NButton, NIcon, NTooltip, NPopover, NUpload, NUploadTrigger } from 'naive-ui';
|
3
3
|
import ChatAdd from './ChatAdd.vue.js';
|
4
4
|
import { useData } from '../hooks/useData.js';
|
@@ -6,11 +6,12 @@ import 'stompjs';
|
|
6
6
|
import 'sockjs-client/dist/sockjs.min.js';
|
7
7
|
import { MESSAGE_TYPE, AV_STATUS } from '../constants/index.js';
|
8
8
|
import { uploadFileApi } from '../api/index.js';
|
9
|
-
import { simplifyMessage, base64ToFile } from '../utils/index.js';
|
9
|
+
import { simplifyMessage, base64ToFile, removeImgBySrc } from '../utils/index.js';
|
10
10
|
import { xor, uniq, isObject, trim, cloneDeep } from 'lodash-es';
|
11
11
|
import 'trtc-sdk-v5';
|
12
12
|
import { emojis } from '../utils/emoji.js';
|
13
|
-
import { CloseOutline, CloseCircleOutline, CallOutline, VideocamOutline } from '@vicons/ionicons5';
|
13
|
+
import { CloseOutline, CloseCircleOutline, HappyOutline, ImageOutline, FolderOutline, CallOutline, VideocamOutline } from '@vicons/ionicons5';
|
14
|
+
import { ThumbsUp } from '@vicons/carbon';
|
14
15
|
import { uuidGenerator } from '../../../../shared/utils/index.js';
|
15
16
|
import { useStorage } from '@vueuse/core';
|
16
17
|
|
@@ -43,10 +44,7 @@ const _hoisted_10 = ["innerHTML"];
|
|
43
44
|
const _hoisted_11 = {
|
44
45
|
class: "tool-box"
|
45
46
|
};
|
46
|
-
const _hoisted_12 = /* @__PURE__ */ createElementVNode("
|
47
|
-
class: "chat--iconfont chat--icon-face"
|
48
|
-
}, null, -1);
|
49
|
-
const _hoisted_13 = /* @__PURE__ */ createElementVNode("span", null, function() {
|
47
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("span", null, function() {
|
50
48
|
var _a, _b, _c;
|
51
49
|
try {
|
52
50
|
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.51")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.51")) || "\u6700\u8FD1\u4F7F\u7528";
|
@@ -54,14 +52,14 @@ const _hoisted_13 = /* @__PURE__ */ createElementVNode("span", null, function()
|
|
54
52
|
return "\u6700\u8FD1\u4F7F\u7528";
|
55
53
|
}
|
56
54
|
}(), -1);
|
57
|
-
const
|
55
|
+
const _hoisted_13 = {
|
58
56
|
class: "list-box",
|
59
57
|
style: {
|
60
58
|
"margin-bottom": "8px"
|
61
59
|
}
|
62
60
|
};
|
63
|
-
const
|
64
|
-
const
|
61
|
+
const _hoisted_14 = ["src"];
|
62
|
+
const _hoisted_15 = /* @__PURE__ */ createElementVNode("span", null, function() {
|
65
63
|
var _a, _b, _c;
|
66
64
|
try {
|
67
65
|
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.52")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.52")) || "\u9ED8\u8BA4\u8868\u60C5";
|
@@ -69,24 +67,15 @@ const _hoisted_16 = /* @__PURE__ */ createElementVNode("span", null, function()
|
|
69
67
|
return "\u9ED8\u8BA4\u8868\u60C5";
|
70
68
|
}
|
71
69
|
}(), -1);
|
72
|
-
const
|
70
|
+
const _hoisted_16 = {
|
73
71
|
class: "list-box"
|
74
72
|
};
|
75
|
-
const
|
76
|
-
const
|
77
|
-
|
78
|
-
}, null, -1);
|
79
|
-
const _hoisted_20 = /* @__PURE__ */ createElementVNode("i", {
|
80
|
-
class: "chat--iconfont chat--icon-image"
|
81
|
-
}, null, -1);
|
82
|
-
const _hoisted_21 = /* @__PURE__ */ createElementVNode("i", {
|
83
|
-
class: "chat--iconfont chat--icon-folder"
|
84
|
-
}, null, -1);
|
85
|
-
const _hoisted_22 = ["contenteditable"];
|
86
|
-
const _hoisted_23 = {
|
73
|
+
const _hoisted_17 = ["src"];
|
74
|
+
const _hoisted_18 = ["contenteditable"];
|
75
|
+
const _hoisted_19 = {
|
87
76
|
class: "btn-box"
|
88
77
|
};
|
89
|
-
const
|
78
|
+
const _hoisted_20 = /* @__PURE__ */ createElementVNode("span", {
|
90
79
|
class: "tip"
|
91
80
|
}, "Enter \u53D1\u9001, Ctrl + Enter \u6362\u884C", -1);
|
92
81
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -179,10 +168,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
179
168
|
}
|
180
169
|
}
|
181
170
|
async function doUpdateFile(file) {
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
171
|
+
try {
|
172
|
+
const formData = new FormData();
|
173
|
+
formData.append("sender", state.userInfo.id);
|
174
|
+
formData.append("file", file);
|
175
|
+
return await uploadFileApi(formData);
|
176
|
+
} catch (error) {
|
177
|
+
return "";
|
178
|
+
}
|
186
179
|
}
|
187
180
|
async function fileChange(options, chatMessageType) {
|
188
181
|
const {
|
@@ -257,7 +250,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
257
250
|
const file = await base64ToFile(srcMatch[1]);
|
258
251
|
if (file) {
|
259
252
|
const data = await doUpdateFile(file);
|
260
|
-
|
253
|
+
if (!(data == null ? void 0 : data.fileUrl)) {
|
254
|
+
console.log("\u4E0A\u4F20\u56FE\u7247\u5931\u8D25 ==>");
|
255
|
+
msg = removeImgBySrc(msg, srcMatch[1]);
|
256
|
+
continue;
|
257
|
+
}
|
258
|
+
const newImgTag = msgList[i].replace(srcMatch[1], data.fileUrl).replace(/<img/, `<img data-clicked='1' data-msg='${JSON.stringify(data)}'`);
|
259
|
+
msg = msg.replace(msgList[i], newImgTag);
|
261
260
|
}
|
262
261
|
}
|
263
262
|
}
|
@@ -345,9 +344,43 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
345
344
|
});
|
346
345
|
state.isForward = false;
|
347
346
|
}
|
347
|
+
function handleFilePaste(event) {
|
348
|
+
var _a;
|
349
|
+
const files = ((_a = event.clipboardData) == null ? void 0 : _a.files) ? Array.from(event.clipboardData.files) : [];
|
350
|
+
if (files.length === 1 && files[0].type.startsWith("image/")) {
|
351
|
+
const file = files[0];
|
352
|
+
if (file.type.startsWith("image/")) {
|
353
|
+
const reader = new FileReader();
|
354
|
+
reader.onload = function(e) {
|
355
|
+
var _a2;
|
356
|
+
if (!((_a2 = e.target) == null ? void 0 : _a2.result))
|
357
|
+
return;
|
358
|
+
document.execCommand("insertHTML", false, `<img src=${e.target.result} />`);
|
359
|
+
};
|
360
|
+
reader.readAsDataURL(file);
|
361
|
+
}
|
362
|
+
} else {
|
363
|
+
for (let i = 0, len = files.length; i < len; i++) {
|
364
|
+
const file = files[i];
|
365
|
+
const type = file.type.startsWith("image/") ? MESSAGE_TYPE.IMAGE : MESSAGE_TYPE.FILE;
|
366
|
+
fileChange({
|
367
|
+
file: {
|
368
|
+
file,
|
369
|
+
name: file.name
|
370
|
+
}
|
371
|
+
}, type);
|
372
|
+
}
|
373
|
+
}
|
374
|
+
}
|
348
375
|
onMounted(() => {
|
349
376
|
if (inputRef.value) {
|
350
377
|
inputRef.value.innerHTML = SPACE_PLACEHOLDER;
|
378
|
+
document.addEventListener("paste", handleFilePaste);
|
379
|
+
}
|
380
|
+
});
|
381
|
+
onBeforeUnmount(() => {
|
382
|
+
if (inputRef.value) {
|
383
|
+
document.removeEventListener("paste", handleFilePaste);
|
351
384
|
}
|
352
385
|
});
|
353
386
|
watch(() => [state.currentReferenceMsg, state.currentReEditMsg], ([currentReferenceMsg, currentReEditMsg]) => {
|
@@ -455,12 +488,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
455
488
|
quaternary: "",
|
456
489
|
size: "tiny"
|
457
490
|
}, {
|
458
|
-
icon: withCtx(() => [
|
491
|
+
icon: withCtx(() => [createVNode(unref(NIcon), {
|
492
|
+
size: "18",
|
493
|
+
component: unref(HappyOutline)
|
494
|
+
}, null, 8, ["component"])]),
|
459
495
|
_: 1
|
460
496
|
})]),
|
461
497
|
default: withCtx(() => [unref(commonEmoticons).length > 0 ? (openBlock(), createElementBlock(Fragment, {
|
462
498
|
key: 0
|
463
|
-
}, [
|
499
|
+
}, [_hoisted_12, createElementVNode("div", _hoisted_13, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(commonEmoticons), (name) => {
|
464
500
|
return openBlock(), createBlock(unref(NTooltip), {
|
465
501
|
key: name,
|
466
502
|
"show-arrow": false
|
@@ -472,13 +508,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
472
508
|
}, {
|
473
509
|
icon: withCtx(() => [createElementVNode("img", {
|
474
510
|
src: unref(emojis).findEmoji(name)
|
475
|
-
}, null, 8,
|
511
|
+
}, null, 8, _hoisted_14)]),
|
476
512
|
_: 2
|
477
513
|
}, 1032, ["onClick"])]),
|
478
514
|
default: withCtx(() => [createTextVNode(" " + toDisplayString(name), 1)]),
|
479
515
|
_: 2
|
480
516
|
}, 1024);
|
481
|
-
}), 128))])], 64)) : createCommentVNode("v-if", true),
|
517
|
+
}), 128))])], 64)) : createCommentVNode("v-if", true), _hoisted_15, createElementVNode("div", _hoisted_16, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(emojis).default, ([name, emoji]) => {
|
482
518
|
return openBlock(), createBlock(unref(NTooltip), {
|
483
519
|
key: name,
|
484
520
|
"show-arrow": false
|
@@ -490,7 +526,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
490
526
|
}, {
|
491
527
|
icon: withCtx(() => [createElementVNode("img", {
|
492
528
|
src: emoji
|
493
|
-
}, null, 8,
|
529
|
+
}, null, 8, _hoisted_17)]),
|
494
530
|
_: 2
|
495
531
|
}, 1032, ["onClick"])]),
|
496
532
|
default: withCtx(() => [createTextVNode(" " + toDisplayString(name), 1)]),
|
@@ -519,7 +555,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
519
555
|
msg: 0
|
520
556
|
}))
|
521
557
|
}, {
|
522
|
-
icon: withCtx(() => [
|
558
|
+
icon: withCtx(() => [createVNode(unref(NIcon), {
|
559
|
+
size: "18",
|
560
|
+
component: unref(ThumbsUp)
|
561
|
+
}, null, 8, ["component"])]),
|
523
562
|
_: 1
|
524
563
|
})]),
|
525
564
|
default: withCtx(() => [createTextVNode(function() {
|
@@ -550,7 +589,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
550
589
|
size: "tiny",
|
551
590
|
onClick: handleClick
|
552
591
|
}, {
|
553
|
-
icon: withCtx(() => [
|
592
|
+
icon: withCtx(() => [createVNode(unref(NIcon), {
|
593
|
+
size: "18",
|
594
|
+
component: unref(ImageOutline)
|
595
|
+
}, null, 8, ["component"])]),
|
554
596
|
_: 2
|
555
597
|
}, 1032, ["onClick"])]),
|
556
598
|
default: withCtx(() => [createTextVNode(function() {
|
@@ -585,7 +627,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
585
627
|
size: "tiny",
|
586
628
|
onClick: handleClick
|
587
629
|
}, {
|
588
|
-
icon: withCtx(() => [
|
630
|
+
icon: withCtx(() => [createVNode(unref(NIcon), {
|
631
|
+
size: "18",
|
632
|
+
component: unref(FolderOutline)
|
633
|
+
}, null, 8, ["component"])]),
|
589
634
|
_: 2
|
590
635
|
}, 1032, ["onClick"])]),
|
591
636
|
default: withCtx(() => [createTextVNode(function() {
|
@@ -718,7 +763,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
718
763
|
contenteditable: !unref(isEnded),
|
719
764
|
onKeydown: handleKeyDown,
|
720
765
|
onInput: handleInput
|
721
|
-
}, null, 40,
|
766
|
+
}, null, 40, _hoisted_18), [[vShow, unref(state).id]]), createElementVNode("div", _hoisted_19, [_hoisted_20, createVNode(unref(NButton), {
|
722
767
|
type: "primary",
|
723
768
|
round: "",
|
724
769
|
disabled: unref(sendBtnDisabled),
|