cnhis-design-vue 3.3.3-beta.64 → 3.3.3-beta.65
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/field-set/src/FieldColor.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldFilter.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldSet.vue.d.ts +5 -5
- package/es/components/field-set/src/components/table-row.vue.d.ts +4 -4
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +0 -2
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.js +12 -14
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
@@ -1,87 +1,87 @@
|
|
1
|
-
# 安装
|
2
|
-
|
3
|
-
```shell
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
5
|
-
# or
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
7
|
-
```
|
8
|
-
|
9
|
-
## 1.全局引入
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
// main.ts
|
13
|
-
import { createApp } from 'vue';
|
14
|
-
import App from './App.vue';
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
16
|
-
import cui from 'cnhis-design-vue';
|
17
|
-
|
18
|
-
const app = createApp(App);
|
19
|
-
app.use(cui).mount('#app');
|
20
|
-
```
|
21
|
-
|
22
|
-
## 2. 按需引入
|
23
|
-
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
25
|
-
|
26
|
-
### 2.1 样式处理方式1 (按需引入样式)
|
27
|
-
|
28
|
-
```shell
|
29
|
-
# 安装自动导入样式的插件
|
30
|
-
npm i -d vite-plugin-style-import
|
31
|
-
```
|
32
|
-
|
33
|
-
```typescript
|
34
|
-
// vite.config.ts
|
35
|
-
import { defineConfig } from 'vite';
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
37
|
-
|
38
|
-
export default defineConfig({
|
39
|
-
plugins: [
|
40
|
-
// ...otherPlugins
|
41
|
-
createStyleImportPlugin({
|
42
|
-
libs: [
|
43
|
-
{
|
44
|
-
libraryName: 'cnhis-design-vue',
|
45
|
-
esModule: true,
|
46
|
-
ensureStyleFile: true,
|
47
|
-
resolveStyle: name => {
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
]
|
52
|
-
})
|
53
|
-
]
|
54
|
-
});
|
55
|
-
```
|
56
|
-
|
57
|
-
### 2.2 样式处理方式2 (全局引入样式)
|
58
|
-
|
59
|
-
```typescript
|
60
|
-
// main.ts
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
62
|
-
```
|
63
|
-
|
64
|
-
## 3.FAQ
|
65
|
-
|
66
|
-
### 3.1 项目打包后样式丢失
|
67
|
-
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
69
|
-
|
70
|
-
```typescript
|
71
|
-
// vite.config.ts
|
72
|
-
import { defineConfig } from 'vite';
|
73
|
-
|
74
|
-
export default defineConfig({
|
75
|
-
build: {
|
76
|
-
rollupOptions: {
|
77
|
-
// ..otherOptions
|
78
|
-
output: {
|
79
|
-
dir: './dist',
|
80
|
-
manualChunks: {
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
});
|
87
|
-
```
|
1
|
+
# 安装
|
2
|
+
|
3
|
+
```shell
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
5
|
+
# or
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
7
|
+
```
|
8
|
+
|
9
|
+
## 1.全局引入
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
// main.ts
|
13
|
+
import { createApp } from 'vue';
|
14
|
+
import App from './App.vue';
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
16
|
+
import cui from 'cnhis-design-vue';
|
17
|
+
|
18
|
+
const app = createApp(App);
|
19
|
+
app.use(cui).mount('#app');
|
20
|
+
```
|
21
|
+
|
22
|
+
## 2. 按需引入
|
23
|
+
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
25
|
+
|
26
|
+
### 2.1 样式处理方式1 (按需引入样式)
|
27
|
+
|
28
|
+
```shell
|
29
|
+
# 安装自动导入样式的插件
|
30
|
+
npm i -d vite-plugin-style-import
|
31
|
+
```
|
32
|
+
|
33
|
+
```typescript
|
34
|
+
// vite.config.ts
|
35
|
+
import { defineConfig } from 'vite';
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
37
|
+
|
38
|
+
export default defineConfig({
|
39
|
+
plugins: [
|
40
|
+
// ...otherPlugins
|
41
|
+
createStyleImportPlugin({
|
42
|
+
libs: [
|
43
|
+
{
|
44
|
+
libraryName: 'cnhis-design-vue',
|
45
|
+
esModule: true,
|
46
|
+
ensureStyleFile: true,
|
47
|
+
resolveStyle: name => {
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
]
|
52
|
+
})
|
53
|
+
]
|
54
|
+
});
|
55
|
+
```
|
56
|
+
|
57
|
+
### 2.2 样式处理方式2 (全局引入样式)
|
58
|
+
|
59
|
+
```typescript
|
60
|
+
// main.ts
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
62
|
+
```
|
63
|
+
|
64
|
+
## 3.FAQ
|
65
|
+
|
66
|
+
### 3.1 项目打包后样式丢失
|
67
|
+
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
69
|
+
|
70
|
+
```typescript
|
71
|
+
// vite.config.ts
|
72
|
+
import { defineConfig } from 'vite';
|
73
|
+
|
74
|
+
export default defineConfig({
|
75
|
+
build: {
|
76
|
+
rollupOptions: {
|
77
|
+
// ..otherOptions
|
78
|
+
output: {
|
79
|
+
dir: './dist',
|
80
|
+
manualChunks: {
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
});
|
87
|
+
```
|
@@ -539,12 +539,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
539
539
|
}>;
|
540
540
|
developMode: boolean;
|
541
541
|
draggable: boolean;
|
542
|
-
isHighlightRow: boolean;
|
543
|
-
idx: number;
|
544
|
-
isHighlight: boolean;
|
545
|
-
isFieldSet: boolean;
|
546
542
|
fieldDescribeMode: "column" | "tooltip";
|
543
|
+
isFieldSet: boolean;
|
547
544
|
hideExpressionOption: AnyObject[];
|
545
|
+
idx: number;
|
546
|
+
isHighlight: boolean;
|
547
|
+
isHighlightRow: boolean;
|
548
548
|
}>;
|
549
549
|
EditDialog: import("vue").DefineComponent<{
|
550
550
|
visible: {
|
@@ -568,12 +568,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
568
568
|
}>;
|
569
569
|
developMode: boolean;
|
570
570
|
draggable: boolean;
|
571
|
-
isHighlightRow: boolean;
|
572
|
-
idx: number;
|
573
|
-
isHighlight: boolean;
|
574
|
-
isFieldSet: boolean;
|
575
571
|
fieldDescribeMode: "column" | "tooltip";
|
572
|
+
isFieldSet: boolean;
|
576
573
|
hideExpressionOption: AnyObject[];
|
574
|
+
idx: number;
|
575
|
+
isHighlight: boolean;
|
576
|
+
isHighlightRow: boolean;
|
577
577
|
}>;
|
578
578
|
setStyle: typeof setStyle;
|
579
579
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -759,12 +759,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
759
759
|
}>;
|
760
760
|
developMode: boolean;
|
761
761
|
draggable: boolean;
|
762
|
-
isHighlightRow: boolean;
|
763
|
-
idx: number;
|
764
|
-
isHighlight: boolean;
|
765
|
-
isFieldSet: boolean;
|
766
762
|
fieldDescribeMode: "column" | "tooltip";
|
763
|
+
isFieldSet: boolean;
|
767
764
|
hideExpressionOption: AnyObject[];
|
765
|
+
idx: number;
|
766
|
+
isHighlight: boolean;
|
767
|
+
isHighlightRow: boolean;
|
768
768
|
}>;
|
769
769
|
isArray: {
|
770
770
|
(value?: any): value is any[];
|
@@ -904,9 +904,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
904
904
|
showSeq: boolean;
|
905
905
|
developMode: boolean;
|
906
906
|
footerFlag: boolean;
|
907
|
-
fieldDescribeMode: "column" | "tooltip";
|
908
907
|
customColumns: FieldSetColumnItem[];
|
909
908
|
showSortPriority: boolean;
|
910
909
|
showHeadFilter: boolean;
|
910
|
+
fieldDescribeMode: "column" | "tooltip";
|
911
911
|
}>;
|
912
912
|
export default _default;
|
@@ -384,11 +384,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
384
384
|
}>;
|
385
385
|
developMode: boolean;
|
386
386
|
draggable: boolean;
|
387
|
-
isHighlightRow: boolean;
|
388
|
-
idx: number;
|
389
|
-
isHighlight: boolean;
|
390
|
-
isFieldSet: boolean;
|
391
387
|
fieldDescribeMode: "column" | "tooltip";
|
388
|
+
isFieldSet: boolean;
|
392
389
|
hideExpressionOption: AnyObject[];
|
390
|
+
idx: number;
|
391
|
+
isHighlight: boolean;
|
392
|
+
isHighlightRow: boolean;
|
393
393
|
}>;
|
394
394
|
export default _default;
|
@@ -603,7 +603,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
603
603
|
}, {
|
604
604
|
default: withCtx(() => [!unref(isAudioOrVideoMessage)(item.content) ? (openBlock(), createElementBlock(Fragment, {
|
605
605
|
key: 0
|
606
|
-
}, [createCommentVNode(' <n-button\n quaternary\n size="tiny"\n @click="(event: MouseEvent) => handleSelectLabel(event, item.id)"\n >\n <template #icon>\n <n-icon size="17" :component="HappyOutline" />\n </template>\n </n-button> '), createVNode(unref(NButton), {
|
606
|
+
}, [createCommentVNode(' <n-button\r\n quaternary\r\n size="tiny"\r\n @click="(event: MouseEvent) => handleSelectLabel(event, item.id)"\r\n >\r\n <template #icon>\r\n <n-icon size="17" :component="HappyOutline" />\r\n </template>\r\n </n-button> '), createVNode(unref(NButton), {
|
607
607
|
quaternary: "",
|
608
608
|
size: "tiny",
|
609
609
|
onClick: () => setReferenceMsg(item)
|
@@ -299,8 +299,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
299
299
|
}, 5e3);
|
300
300
|
} catch (error) {
|
301
301
|
console.error("Error setting up multiple video call:", error);
|
302
|
-
$message.error("\u8BBE\u7F6E\u591A\u4EBA\u89C6\u9891\u901A\u8BDD\u5931\u8D25");
|
303
|
-
state.showMultipleVideo = false;
|
304
302
|
}
|
305
303
|
}
|
306
304
|
async function handleExit() {
|
@@ -225,7 +225,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
225
225
|
round: "",
|
226
226
|
size: 100,
|
227
227
|
onClickCapture: _cache[0] || (_cache[0] = ($event) => showLargeAvatar.value = true)
|
228
|
-
}, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\n <n-upload-trigger #="{ handleClick }" abstract>\n <n-button\n circle\n secondary\n class="edit-avatar"\n v-show="userDetail.id === state.userInfo.id"\n @click="handleClick"\n >\n <template #icon>\n <n-icon size="16" color="#666666" :component="Camera" />\n </template>\n </n-button>\n </n-upload-trigger>\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
|
228
|
+
}, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\r\n <n-upload-trigger #="{ handleClick }" abstract>\r\n <n-button\r\n circle\r\n secondary\r\n class="edit-avatar"\r\n v-show="userDetail.id === state.userInfo.id"\r\n @click="handleClick"\r\n >\r\n <template #icon>\r\n <n-icon size="16" color="#666666" :component="Camera" />\r\n </template>\r\n </n-button>\r\n </n-upload-trigger>\r\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
|
229
229
|
class: normalizeClass(["iho-chatRole", unref(isDoctorRole)(userDetail.roleInfo) ? "isDoctor" : ""])
|
230
230
|
}, toDisplayString(unref(getRoleName)(userDetail.roleInfo)), 3), [[vShow, unref(getRoleName)(userDetail.roleInfo)]])]), createElementVNode("p", null, toDisplayString(userDetail.orgName), 1)]), createVNode(unref(NButton), {
|
231
231
|
strong: "",
|
@@ -134,7 +134,6 @@ function useVideo(config = {}) {
|
|
134
134
|
const videoElement = videoRefs.value.get(userId);
|
135
135
|
const user = findUser(userId);
|
136
136
|
console.log("tryRenderRemoteVideo called for user:", userId);
|
137
|
-
console.log("Video element:", videoElement);
|
138
137
|
console.log("User data:", user);
|
139
138
|
console.log("Is connected:", isConnect.value);
|
140
139
|
if (!videoElement) {
|
@@ -155,7 +154,6 @@ function useVideo(config = {}) {
|
|
155
154
|
console.log("Video already playing for user:", userId);
|
156
155
|
return;
|
157
156
|
}
|
158
|
-
console.log("Starting remote video for user:", userId, "with element:", videoElement);
|
159
157
|
await trtc.startRemoteVideo({
|
160
158
|
userId,
|
161
159
|
streamType: MAIN_STREAM_TYPE,
|
@@ -237,7 +235,6 @@ function useVideo(config = {}) {
|
|
237
235
|
const videoElement = videoRefs.value.get(user.id);
|
238
236
|
if (videoElement) {
|
239
237
|
const hasExistingVideo = videoElement.querySelector("video");
|
240
|
-
console.log(`User ${user.id}: hasVideo=${user.hasVideo}, hasElement=${!!videoElement}, hasExistingVideo=${!!hasExistingVideo}`);
|
241
238
|
if (user.hasVideo && !hasExistingVideo) {
|
242
239
|
console.log(`Attempting to render video for user: ${user.id}`);
|
243
240
|
tryRenderRemoteVideo(user.id);
|
@@ -351,12 +348,9 @@ function useVideo(config = {}) {
|
|
351
348
|
console.warn("Error stopping local video:", error);
|
352
349
|
}));
|
353
350
|
}
|
354
|
-
await
|
355
|
-
|
356
|
-
|
357
|
-
console.warn("Error exiting room:", error);
|
358
|
-
});
|
359
|
-
}
|
351
|
+
await trtc.exitRoom().catch((error) => {
|
352
|
+
console.warn("Error exiting room:", error);
|
353
|
+
});
|
360
354
|
cleanupAllResources();
|
361
355
|
console.log("Successfully exited TRTC room");
|
362
356
|
} catch (error) {
|
@@ -368,15 +362,20 @@ function useVideo(config = {}) {
|
|
368
362
|
await trtc.startLocalAudio({
|
369
363
|
mute: voiceClose.value
|
370
364
|
});
|
371
|
-
|
365
|
+
} catch (error) {
|
366
|
+
console.error("Error starting local audio:", error);
|
367
|
+
voiceClose.value = true;
|
368
|
+
}
|
369
|
+
if (!isAudio.value && selfVideoRef) {
|
370
|
+
try {
|
372
371
|
await trtc.startLocalVideo({
|
373
372
|
view: selfVideoRef,
|
374
373
|
mute: videocamClose.value
|
375
374
|
});
|
375
|
+
} catch (error) {
|
376
|
+
console.error("Error starting local video:", error);
|
377
|
+
videocamClose.value = true;
|
376
378
|
}
|
377
|
-
} catch (error) {
|
378
|
-
console.error("Error starting local media:", error);
|
379
|
-
throw error;
|
380
379
|
}
|
381
380
|
}
|
382
381
|
function installEventHandlers(handlers) {
|
@@ -432,7 +431,6 @@ function useVideo(config = {}) {
|
|
432
431
|
function setVideoRef(userId, el) {
|
433
432
|
if (el) {
|
434
433
|
videoRefs.value.set(userId, el);
|
435
|
-
console.log("Video ref set for user:", userId, "Element:", el);
|
436
434
|
if (isConnect.value) {
|
437
435
|
const user = findUser(userId);
|
438
436
|
console.log("User found:", user);
|
package/es/env.d.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
/// <reference types="vite/client" />
|
2
|
-
|
3
|
-
interface ImportMetaEnv {
|
4
|
-
readonly VITE_APP_TYPE: string;
|
5
|
-
// 更多环境变量...
|
6
|
-
}
|
7
|
-
|
8
|
-
interface ImportMeta {
|
9
|
-
readonly env: ImportMetaEnv;
|
10
|
-
}
|
11
|
-
|
12
|
-
declare module '*.vue' {
|
13
|
-
// @ts-ignore
|
14
|
-
import type { App, defineComponent } from 'vue';
|
15
|
-
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
16
|
-
// // const component: DefineComponent<{}, {}, any>
|
17
|
-
const component: ReturnType<typeof defineComponent> & {
|
18
|
-
install(app: App): void;
|
19
|
-
};
|
20
|
-
// @ts-ignore
|
21
|
-
export default component;
|
22
|
-
}
|
23
|
-
|
24
|
-
declare module '*.js';
|
25
|
-
|
1
|
+
/// <reference types="vite/client" />
|
2
|
+
|
3
|
+
interface ImportMetaEnv {
|
4
|
+
readonly VITE_APP_TYPE: string;
|
5
|
+
// 更多环境变量...
|
6
|
+
}
|
7
|
+
|
8
|
+
interface ImportMeta {
|
9
|
+
readonly env: ImportMetaEnv;
|
10
|
+
}
|
11
|
+
|
12
|
+
declare module '*.vue' {
|
13
|
+
// @ts-ignore
|
14
|
+
import type { App, defineComponent } from 'vue';
|
15
|
+
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
16
|
+
// // const component: DefineComponent<{}, {}, any>
|
17
|
+
const component: ReturnType<typeof defineComponent> & {
|
18
|
+
install(app: App): void;
|
19
|
+
};
|
20
|
+
// @ts-ignore
|
21
|
+
export default component;
|
22
|
+
}
|
23
|
+
|
24
|
+
declare module '*.js';
|
25
|
+
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cnhis-design-vue",
|
3
|
-
"version": "3.3.3-beta.
|
3
|
+
"version": "3.3.3-beta.65",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"spark-md5": "^3.0.2",
|
58
58
|
"stompjs": "^2.3.3",
|
59
59
|
"tiny-svg": "^2.2.4",
|
60
|
-
"trtc-sdk-v5": "
|
60
|
+
"trtc-sdk-v5": "5.12.0",
|
61
61
|
"v-viewer": "^3.0.10",
|
62
62
|
"video.js": "^7.19.2",
|
63
63
|
"videojs-contrib-hls": "^5.15.0",
|
@@ -74,5 +74,5 @@
|
|
74
74
|
"iOS 7",
|
75
75
|
"last 3 iOS versions"
|
76
76
|
],
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "621790975365a9ad89a3dccfe078451070dcc76c"
|
78
78
|
}
|