cnhis-design-vue 3.3.3-beta.26 → 3.3.3-beta.29
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/button-print/src/components/OldPrintComponent.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-render/src/hooks/useLowCodeReactions.js +2 -1
- package/es/components/iho-chat/index.d.ts +4 -4
- package/es/components/iho-chat/src/Index.vue.d.ts +4 -4
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +2 -2
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +5 -15
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +2 -2
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +3 -3
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +7 -15
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +2 -2
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +3 -3
- package/es/components/iho-chat/src/components/ContextMenu.js +3 -11
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +2 -2
- package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +3 -3
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useData.js +2 -7
- package/es/components/iho-chat/src/utils/index.d.ts +2 -3
- package/es/components/iho-chat/src/utils/index.js +20 -39
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +8 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- 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
|
+
```
|
@@ -438,7 +438,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
438
438
|
params,
|
439
439
|
signature: props.signature
|
440
440
|
};
|
441
|
-
printInstance.downloadPDF(queryParams, (res) => callLocalServicesSuccessCb(res, "
|
441
|
+
printInstance.downloadPDF(queryParams, (res) => callLocalServicesSuccessCb(res, "download"), callLocalServicesErrorCb);
|
442
442
|
}).catch(() => {
|
443
443
|
prevFnError("download");
|
444
444
|
state.spinning = false;
|
@@ -536,9 +536,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
536
536
|
}>;
|
537
537
|
developMode: boolean;
|
538
538
|
draggable: boolean;
|
539
|
-
isHighlightRow: boolean;
|
540
539
|
idx: number;
|
541
540
|
isHighlight: boolean;
|
541
|
+
isHighlightRow: boolean;
|
542
542
|
isFieldSet: boolean;
|
543
543
|
fieldDescribeMode: "column" | "tooltip";
|
544
544
|
hideExpressionOption: AnyObject[];
|
@@ -565,9 +565,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
565
565
|
}>;
|
566
566
|
developMode: boolean;
|
567
567
|
draggable: boolean;
|
568
|
-
isHighlightRow: boolean;
|
569
568
|
idx: number;
|
570
569
|
isHighlight: boolean;
|
570
|
+
isHighlightRow: boolean;
|
571
571
|
isFieldSet: boolean;
|
572
572
|
fieldDescribeMode: "column" | "tooltip";
|
573
573
|
hideExpressionOption: AnyObject[];
|
@@ -756,9 +756,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
756
756
|
}>;
|
757
757
|
developMode: boolean;
|
758
758
|
draggable: boolean;
|
759
|
-
isHighlightRow: boolean;
|
760
759
|
idx: number;
|
761
760
|
isHighlight: boolean;
|
761
|
+
isHighlightRow: boolean;
|
762
762
|
isFieldSet: boolean;
|
763
763
|
fieldDescribeMode: "column" | "tooltip";
|
764
764
|
hideExpressionOption: AnyObject[];
|
@@ -383,9 +383,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
383
383
|
}>;
|
384
384
|
developMode: boolean;
|
385
385
|
draggable: boolean;
|
386
|
-
isHighlightRow: boolean;
|
387
386
|
idx: number;
|
388
387
|
isHighlight: boolean;
|
388
|
+
isHighlightRow: boolean;
|
389
389
|
isFieldSet: boolean;
|
390
390
|
fieldDescribeMode: "column" | "tooltip";
|
391
391
|
hideExpressionOption: AnyObject[];
|
@@ -254,7 +254,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
254
254
|
});
|
255
255
|
return res;
|
256
256
|
});
|
257
|
-
const setValueTypes = ["INPUT", "SELECT", "SEARCH", "REMOTE_SEARCH"];
|
257
|
+
const setValueTypes = ["INPUT", "SELECT", "SEARCH", "REMOTE_SEARCH", "DIGITAL"];
|
258
258
|
const setValueFieldOptions = computed(() => {
|
259
259
|
return fieldOptions.value.filter((item) => {
|
260
260
|
var _a;
|
@@ -29,7 +29,8 @@ function useLowCodeReactions(configListRef, formModel) {
|
|
29
29
|
const targetConfig = (_a = config.setValueField) == null ? void 0 : _a.find((item) => item.field === field.path.toString());
|
30
30
|
if (!targetConfig)
|
31
31
|
return;
|
32
|
-
|
32
|
+
const value = targetConfig.value === "null" ? null : targetConfig.value === "undefined" ? void 0 : targetConfig.value;
|
33
|
+
field.value = value;
|
33
34
|
})
|
34
35
|
};
|
35
36
|
function createFieldHandler(cb) {
|
@@ -933,7 +933,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
933
933
|
OpenOutline: 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<{}>>, {}>;
|
934
934
|
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<{}>>, {}>;
|
935
935
|
downloadFile: typeof import("./src/utils").downloadFile;
|
936
|
-
|
936
|
+
formatJsonstr: typeof import("./src/utils").formatJsonstr;
|
937
937
|
getFileType: typeof import("./src/utils").getFileType;
|
938
938
|
getDetail: typeof import("./src/utils").getDetail;
|
939
939
|
ChatAdd: import("vue").DefineComponent<{
|
@@ -1353,7 +1353,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1353
1353
|
formatTime: typeof import("./src/utils").formatTime;
|
1354
1354
|
isDoctorRole: typeof import("./src/utils").isDoctorRole;
|
1355
1355
|
getRoleName: typeof import("./src/utils").getRoleName;
|
1356
|
-
|
1356
|
+
formatJsonstr: typeof import("./src/utils").formatJsonstr;
|
1357
1357
|
getFileType: typeof import("./src/utils").getFileType;
|
1358
1358
|
getDetail: typeof import("./src/utils").getDetail;
|
1359
1359
|
showAudioAndVideoRecord: typeof import("./src/utils").showAudioAndVideoRecord;
|
@@ -1690,7 +1690,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1690
1690
|
renderToolbar: ({ nodes }: import("naive-ui").ImageRenderToolbarProps) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
1691
1691
|
[key: string]: any;
|
1692
1692
|
}>[];
|
1693
|
-
formatImage: (obj: string | import("../../shared/types").AnyObject, type: string) => any;
|
1694
1693
|
getHistoryRecord: () => Promise<void>;
|
1695
1694
|
handleSelectLabel: (event: MouseEvent, msgId: string) => void;
|
1696
1695
|
handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
|
@@ -1909,7 +1908,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1909
1908
|
getForwardTitle: typeof import("./src/utils").getForwardTitle;
|
1910
1909
|
isDoctorRole: typeof import("./src/utils").isDoctorRole;
|
1911
1910
|
getRoleName: typeof import("./src/utils").getRoleName;
|
1912
|
-
|
1911
|
+
formatJsonstr: typeof import("./src/utils").formatJsonstr;
|
1913
1912
|
getFileType: typeof import("./src/utils").getFileType;
|
1914
1913
|
getDetail: typeof import("./src/utils").getDetail;
|
1915
1914
|
showAudioAndVideoRecord: typeof import("./src/utils").showAudioAndVideoRecord;
|
@@ -2272,6 +2271,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
2272
2271
|
isAudioOrVideoMessage: typeof import("./src/utils").isAudioOrVideoMessage;
|
2273
2272
|
getAVTime: typeof import("./src/utils").getAVTime;
|
2274
2273
|
getForwardTitle: typeof import("./src/utils").getForwardTitle;
|
2274
|
+
formatJsonstr: typeof import("./src/utils").formatJsonstr;
|
2275
2275
|
MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
|
2276
2276
|
ChatbubbleEllipsesOutline: 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<{}>>, {}>;
|
2277
2277
|
EllipsisHorizontal: 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<{}>>, {}>;
|
@@ -934,7 +934,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
934
934
|
OpenOutline: 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<{}>>, {}>;
|
935
935
|
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<{}>>, {}>;
|
936
936
|
downloadFile: typeof import("./utils").downloadFile;
|
937
|
-
|
937
|
+
formatJsonstr: typeof import("./utils").formatJsonstr;
|
938
938
|
getFileType: typeof import("./utils").getFileType;
|
939
939
|
getDetail: typeof import("./utils").getDetail;
|
940
940
|
ChatAdd: import("vue").DefineComponent<{
|
@@ -1354,7 +1354,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1354
1354
|
formatTime: typeof import("./utils").formatTime;
|
1355
1355
|
isDoctorRole: typeof import("./utils").isDoctorRole;
|
1356
1356
|
getRoleName: typeof import("./utils").getRoleName;
|
1357
|
-
|
1357
|
+
formatJsonstr: typeof import("./utils").formatJsonstr;
|
1358
1358
|
getFileType: typeof import("./utils").getFileType;
|
1359
1359
|
getDetail: typeof import("./utils").getDetail;
|
1360
1360
|
showAudioAndVideoRecord: typeof import("./utils").showAudioAndVideoRecord;
|
@@ -1691,7 +1691,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
1691
1691
|
renderToolbar: ({ nodes }: import("naive-ui").ImageRenderToolbarProps) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
1692
1692
|
[key: string]: any;
|
1693
1693
|
}>[];
|
1694
|
-
formatImage: (obj: string | AnyObject, type: string) => any;
|
1695
1694
|
getHistoryRecord: () => Promise<void>;
|
1696
1695
|
handleSelectLabel: (event: MouseEvent, msgId: string) => void;
|
1697
1696
|
handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
|
@@ -1910,7 +1909,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1910
1909
|
getForwardTitle: typeof import("./utils").getForwardTitle;
|
1911
1910
|
isDoctorRole: typeof import("./utils").isDoctorRole;
|
1912
1911
|
getRoleName: typeof import("./utils").getRoleName;
|
1913
|
-
|
1912
|
+
formatJsonstr: typeof import("./utils").formatJsonstr;
|
1914
1913
|
getFileType: typeof import("./utils").getFileType;
|
1915
1914
|
getDetail: typeof import("./utils").getDetail;
|
1916
1915
|
showAudioAndVideoRecord: typeof import("./utils").showAudioAndVideoRecord;
|
@@ -2273,6 +2272,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2273
2272
|
isAudioOrVideoMessage: typeof import("./utils").isAudioOrVideoMessage;
|
2274
2273
|
getAVTime: typeof import("./utils").getAVTime;
|
2275
2274
|
getForwardTitle: typeof import("./utils").getForwardTitle;
|
2275
|
+
formatJsonstr: typeof import("./utils").formatJsonstr;
|
2276
2276
|
MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
|
2277
2277
|
ChatbubbleEllipsesOutline: 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<{}>>, {}>;
|
2278
2278
|
EllipsisHorizontal: 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<{}>>, {}>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { PropType } from 'vue';
|
2
2
|
import { AnyObject } from '../../../../shared/types';
|
3
|
-
import { downloadFile,
|
3
|
+
import { downloadFile, formatJsonstr, getFileType, getDetail } from '../utils';
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
5
5
|
type: {
|
6
6
|
type: StringConstructor;
|
@@ -82,7 +82,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
82
82
|
OpenOutline: 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<{}>>, {}>;
|
83
83
|
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<{}>>, {}>;
|
84
84
|
downloadFile: typeof downloadFile;
|
85
|
-
|
85
|
+
formatJsonstr: typeof formatJsonstr;
|
86
86
|
getFileType: typeof getFileType;
|
87
87
|
getDetail: typeof getDetail;
|
88
88
|
ChatAdd: import("vue").DefineComponent<{
|
@@ -13,7 +13,7 @@ import { useScrollLoading } from '../../../../shared/hooks/useScrollLoading.js';
|
|
13
13
|
import { useData } from '../hooks/useData.js';
|
14
14
|
import 'stompjs';
|
15
15
|
import 'sockjs-client/dist/sockjs.min.js';
|
16
|
-
import {
|
16
|
+
import { formatJsonstr, getFileType, getDetail, downloadFile } from '../utils/index.js';
|
17
17
|
import 'trtc-sdk-v5';
|
18
18
|
import ChatAdd from './ChatAdd.vue.js';
|
19
19
|
|
@@ -103,17 +103,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
103
103
|
const newList = formatImageList(_list);
|
104
104
|
imageList.value = pageInfo.page > 1 ? imageList.value.concat(newList) : newList;
|
105
105
|
} else {
|
106
|
-
|
107
|
-
return new Promise(async (resolve) => {
|
108
|
-
const size = await getFileSize(item.content.fileUrl);
|
109
|
-
resolve({
|
110
|
-
...item,
|
111
|
-
size
|
112
|
-
});
|
113
|
-
});
|
114
|
-
});
|
115
|
-
const newList = await Promise.all(promiseList);
|
116
|
-
fileList.value = pageInfo.page > 1 ? fileList.value.concat(newList) : newList;
|
106
|
+
fileList.value = pageInfo.page > 1 ? fileList.value.concat(_list) : _list;
|
117
107
|
}
|
118
108
|
} catch (error) {
|
119
109
|
} finally {
|
@@ -209,7 +199,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
209
199
|
key: image,
|
210
200
|
width: "80",
|
211
201
|
height: "80",
|
212
|
-
src: unref(
|
202
|
+
src: unref(formatJsonstr)(image, "fileUrl")
|
213
203
|
}, null, 8, ["src"]);
|
214
204
|
}), 128))])]);
|
215
205
|
}), 128))]),
|
@@ -246,7 +236,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
246
236
|
return openBlock(), createElementBlock("div", {
|
247
237
|
class: "file-item",
|
248
238
|
key: i
|
249
|
-
}, [createElementVNode("span", _hoisted_3, toDisplayString(unref(getFileType)(item.content.msg)), 1), createElementVNode("div", _hoisted_4, [createElementVNode("span", _hoisted_5, toDisplayString(unref(
|
239
|
+
}, [createElementVNode("span", _hoisted_3, toDisplayString(unref(getFileType)(item.content.msg)), 1), createElementVNode("div", _hoisted_4, [createElementVNode("span", _hoisted_5, toDisplayString(unref(formatJsonstr)(item.content.msg, "fileName")), 1), createElementVNode("span", _hoisted_6, toDisplayString(unref(getDetail)(item, true)), 1)]), createElementVNode("div", _hoisted_7, [createVNode(ChatAdd, {
|
250
240
|
title: function() {
|
251
241
|
var _a, _b, _c;
|
252
242
|
try {
|
@@ -286,7 +276,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
286
276
|
trigger: withCtx(() => [createVNode(unref(NIcon), {
|
287
277
|
size: 16,
|
288
278
|
component: unref(DownloadOutline),
|
289
|
-
onClick: () => unref(downloadFile)(item.content.
|
279
|
+
onClick: () => unref(downloadFile)(item.content.msg)
|
290
280
|
}, null, 8, ["component", "onClick"])]),
|
291
281
|
default: withCtx(() => [createTextVNode(function() {
|
292
282
|
var _a, _b, _c;
|
@@ -292,7 +292,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
292
292
|
msg,
|
293
293
|
chatMessageType
|
294
294
|
};
|
295
|
-
if (
|
295
|
+
if ([MESSAGE_TYPE.FILE, MESSAGE_TYPE.IMAGE].includes(chatMessageType)) {
|
296
296
|
_content.fileUrl = url;
|
297
297
|
}
|
298
298
|
if (origin === "btn") {
|
@@ -401,7 +401,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
401
401
|
OpenOutline: 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<{}>>, {}>;
|
402
402
|
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<{}>>, {}>;
|
403
403
|
downloadFile: typeof import("../utils").downloadFile;
|
404
|
-
|
404
|
+
formatJsonstr: typeof import("../utils").formatJsonstr;
|
405
405
|
getFileType: typeof import("../utils").getFileType;
|
406
406
|
getDetail: typeof import("../utils").getDetail;
|
407
407
|
ChatAdd: import("vue").DefineComponent<{
|
@@ -821,7 +821,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
821
821
|
formatTime: typeof import("../utils").formatTime;
|
822
822
|
isDoctorRole: typeof import("../utils").isDoctorRole;
|
823
823
|
getRoleName: typeof import("../utils").getRoleName;
|
824
|
-
|
824
|
+
formatJsonstr: typeof import("../utils").formatJsonstr;
|
825
825
|
getFileType: typeof import("../utils").getFileType;
|
826
826
|
getDetail: typeof import("../utils").getDetail;
|
827
827
|
showAudioAndVideoRecord: typeof import("../utils").showAudioAndVideoRecord;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { CSSProperties } from 'vue';
|
2
2
|
import { ImageRenderToolbarProps } from 'naive-ui';
|
3
3
|
import { AnyObject } from '../../../../shared/types';
|
4
|
-
import { simplifyMessage, isAudioOrVideoMessage, getAVTime, getForwardTitle } from '../utils';
|
4
|
+
import { simplifyMessage, isAudioOrVideoMessage, getAVTime, getForwardTitle, formatJsonstr } from '../utils';
|
5
5
|
import { MESSAGE_TYPE } from '../constants';
|
6
6
|
declare const _default: import("vue").DefineComponent<{}, {
|
7
7
|
chatMainRef: import("vue").Ref<HTMLElement | undefined>;
|
@@ -71,7 +71,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
71
71
|
renderToolbar: ({ nodes }: ImageRenderToolbarProps) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
72
72
|
[key: string]: any;
|
73
73
|
}>[];
|
74
|
-
formatImage: (obj: AnyObject | string, type: string) => any;
|
75
74
|
getHistoryRecord: () => Promise<void>;
|
76
75
|
handleSelectLabel: (event: MouseEvent, msgId: string) => void;
|
77
76
|
handleContextmenu: (event: MouseEvent, msgId: string) => Promise<void>;
|
@@ -290,7 +289,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
290
289
|
getForwardTitle: typeof getForwardTitle;
|
291
290
|
isDoctorRole: typeof import("../utils").isDoctorRole;
|
292
291
|
getRoleName: typeof import("../utils").getRoleName;
|
293
|
-
|
292
|
+
formatJsonstr: typeof formatJsonstr;
|
294
293
|
getFileType: typeof import("../utils").getFileType;
|
295
294
|
getDetail: typeof import("../utils").getDetail;
|
296
295
|
showAudioAndVideoRecord: typeof import("../utils").showAudioAndVideoRecord;
|
@@ -653,6 +652,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
653
652
|
isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
|
654
653
|
getAVTime: typeof getAVTime;
|
655
654
|
getForwardTitle: typeof getForwardTitle;
|
655
|
+
formatJsonstr: typeof formatJsonstr;
|
656
656
|
MESSAGE_TYPE: typeof MESSAGE_TYPE;
|
657
657
|
ChatbubbleEllipsesOutline: 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<{}>>, {}>;
|
658
658
|
EllipsisHorizontal: 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<{}>>, {}>;
|
@@ -6,7 +6,7 @@ import { useData } from '../hooks/useData.js';
|
|
6
6
|
import 'stompjs';
|
7
7
|
import 'sockjs-client/dist/sockjs.min.js';
|
8
8
|
import { MESSAGE_TYPE } from '../constants/index.js';
|
9
|
-
import { isAudioOrVideoMessage, simplifyMessage, getForwardTitle, getAVTime, downloadFile } from '../utils/index.js';
|
9
|
+
import { isAudioOrVideoMessage, simplifyMessage, getForwardTitle, formatJsonstr, getAVTime, downloadFile } from '../utils/index.js';
|
10
10
|
import { first, last, isArray, toString } from 'lodash-es';
|
11
11
|
import 'trtc-sdk-v5';
|
12
12
|
import MessageTemplate from './MessageTemplate.vue.js';
|
@@ -130,7 +130,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
130
130
|
"color": "rgba(255, 255, 255, 0.75",
|
131
131
|
"size": 24,
|
132
132
|
"component": ArrowDownSharp,
|
133
|
-
"onClick": () => src && downloadFile(
|
133
|
+
"onClick": () => src && downloadFile(JSON.stringify({
|
134
|
+
fileUrl: src,
|
135
|
+
fileName: "image"
|
136
|
+
}))
|
134
137
|
}, null),
|
135
138
|
default: () => function() {
|
136
139
|
var _a2, _b2, _c;
|
@@ -142,17 +145,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
142
145
|
}()
|
143
146
|
}), nodes.close];
|
144
147
|
}
|
145
|
-
function formatImage(obj, type) {
|
146
|
-
try {
|
147
|
-
if (typeof obj === "string") {
|
148
|
-
const objParse = JSON.parse(obj);
|
149
|
-
return objParse[type];
|
150
|
-
}
|
151
|
-
return obj[type];
|
152
|
-
} catch (error) {
|
153
|
-
return obj;
|
154
|
-
}
|
155
|
-
}
|
156
148
|
async function getHistoryRecord() {
|
157
149
|
try {
|
158
150
|
if (!pageInfo.hasMore)
|
@@ -490,7 +482,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
490
482
|
}), 128))])], 8, _hoisted_14)) : createCommentVNode("v-if", true), item.content.chatMessageType === unref(MESSAGE_TYPE).IMAGE ? (openBlock(), createBlock(unref(NImage), {
|
491
483
|
key: 4,
|
492
484
|
width: "240",
|
493
|
-
src:
|
485
|
+
src: unref(formatJsonstr)(item.__content, "fileUrl"),
|
494
486
|
onClick: _cache[0] || (_cache[0] = (event) => event.stopPropagation())
|
495
487
|
}, null, 8, ["src"])) : createCommentVNode("v-if", true), unref(isAudioOrVideoMessage)(item.content) ? (openBlock(), createElementBlock(Fragment, {
|
496
488
|
key: 5
|
@@ -515,7 +507,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
515
507
|
"row-gap": "0"
|
516
508
|
}
|
517
509
|
}, {
|
518
|
-
default: withCtx(() => [createElementVNode("span", null, toDisplayString(
|
510
|
+
default: withCtx(() => [createElementVNode("span", null, toDisplayString(unref(formatJsonstr)(item.__content, "fileName")), 1), createElementVNode("span", _hoisted_19, toDisplayString(unref(formatJsonstr)(item.__content, "fileSize")), 1)]),
|
519
511
|
_: 2
|
520
512
|
}, 1024)]),
|
521
513
|
_: 2
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { PropType } from 'vue';
|
2
2
|
import { AnyObject } from '../../../../shared/types';
|
3
|
-
import { formatTime, isDoctorRole, getRoleName,
|
3
|
+
import { formatTime, isDoctorRole, getRoleName, formatJsonstr, getFileType, getDetail, showAudioAndVideoRecord, getForwardTitle, simplifyMessage } from '../utils';
|
4
4
|
import { MESSAGE_TYPE } from '../constants';
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
6
6
|
visible: {
|
@@ -213,7 +213,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
213
213
|
formatTime: typeof formatTime;
|
214
214
|
isDoctorRole: typeof isDoctorRole;
|
215
215
|
getRoleName: typeof getRoleName;
|
216
|
-
|
216
|
+
formatJsonstr: typeof formatJsonstr;
|
217
217
|
getFileType: typeof getFileType;
|
218
218
|
getDetail: typeof getDetail;
|
219
219
|
showAudioAndVideoRecord: typeof showAudioAndVideoRecord;
|
@@ -6,7 +6,7 @@ import 'stompjs';
|
|
6
6
|
import 'sockjs-client/dist/sockjs.min.js';
|
7
7
|
import { MESSAGE_TYPE } from '../constants/index.js';
|
8
8
|
import { searchChatRecordApi } from '../api/index.js';
|
9
|
-
import { transformMessage, isDoctorRole, getRoleName, formatTime,
|
9
|
+
import { transformMessage, isDoctorRole, getRoleName, formatTime, formatJsonstr, getFileType, getDetail, showAudioAndVideoRecord, getForwardTitle, simplifyMessage } from '../utils/index.js';
|
10
10
|
import { last, isArray } from 'lodash-es';
|
11
11
|
import 'trtc-sdk-v5';
|
12
12
|
import DatePicker from '../../../date-picker/index.js';
|
@@ -369,10 +369,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
369
369
|
class: normalizeClass(["iho-chatRole", unref(isDoctorRole)(item.roleInfo) ? "isDoctor" : ""])
|
370
370
|
}, toDisplayString(unref(getRoleName)(item.roleInfo)), 3), [[vShow, unref(getRoleName)(item.roleInfo)]])]), createElementVNode("span", _hoisted_9, toDisplayString(unref(formatTime)(item.sendTime).recordTime), 1)]), createElementVNode("div", _hoisted_10, [item.content.chatMessageType === unref(MESSAGE_TYPE).IMAGE ? (openBlock(), createElementBlock("img", {
|
371
371
|
key: 0,
|
372
|
-
src: unref(
|
372
|
+
src: unref(formatJsonstr)(item.__content, "fileUrl")
|
373
373
|
}, null, 8, _hoisted_11)) : item.content.chatMessageType === unref(MESSAGE_TYPE).FILE ? (openBlock(), createElementBlock(Fragment, {
|
374
374
|
key: 1
|
375
|
-
}, [createElementVNode("span", _hoisted_12, toDisplayString(unref(getFileType)(item.__content)), 1), createElementVNode("div", _hoisted_13, [createElementVNode("span", _hoisted_14, toDisplayString(unref(
|
375
|
+
}, [createElementVNode("span", _hoisted_12, toDisplayString(unref(getFileType)(item.__content)), 1), createElementVNode("div", _hoisted_13, [createElementVNode("span", _hoisted_14, toDisplayString(unref(formatJsonstr)(item.__content, "fileName")), 1), createElementVNode("span", _hoisted_15, toDisplayString(unref(getDetail)(item)), 1)])], 64)) : item.content.chatMessageType === unref(MESSAGE_TYPE).EMOJI ? (openBlock(), createElementBlock("img", {
|
376
376
|
key: 2,
|
377
377
|
class: "emoji",
|
378
378
|
src: unref(emojis).findEmoji(item.__content)
|
@@ -7,7 +7,7 @@ import 'stompjs';
|
|
7
7
|
import 'sockjs-client/dist/sockjs.min.js';
|
8
8
|
import { STATUS, MESSAGE_TYPE } from '../constants/index.js';
|
9
9
|
import { recallMessageApi } from '../api/index.js';
|
10
|
-
import { isAudioOrVideoMessage, $message, downloadFile,
|
10
|
+
import { isAudioOrVideoMessage, $message, downloadFile, formatJsonstr } from '../utils/index.js';
|
11
11
|
import 'lodash-es';
|
12
12
|
import 'trtc-sdk-v5';
|
13
13
|
import { emojis } from '../utils/emoji.js';
|
@@ -192,7 +192,7 @@ var ContextMenu = /* @__PURE__ */ defineComponent({
|
|
192
192
|
} else {
|
193
193
|
let data;
|
194
194
|
if ([MESSAGE_TYPE.EMOJI, MESSAGE_TYPE.IMAGE].includes(chatMessageType)) {
|
195
|
-
const url = chatMessageType === MESSAGE_TYPE.EMOJI ? emojis.findEmoji(content.msg) :
|
195
|
+
const url = chatMessageType === MESSAGE_TYPE.EMOJI ? emojis.findEmoji(content.msg) : formatJsonstr(content.msg, "fileUrl");
|
196
196
|
data = `<img data-msg=${chatMessageType === MESSAGE_TYPE.EMOJI ? content.msg : ""} data-type=${chatMessageType} class=${chatMessageType === MESSAGE_TYPE.EMOJI ? "emoji--min" : "chat-image-copy"} src=${url} />`;
|
197
197
|
} else if (chatMessageType === MESSAGE_TYPE.BLEND) {
|
198
198
|
data = __content;
|
@@ -211,15 +211,7 @@ var ContextMenu = /* @__PURE__ */ defineComponent({
|
|
211
211
|
}
|
212
212
|
return;
|
213
213
|
case "download": {
|
214
|
-
|
215
|
-
fileUrl: url,
|
216
|
-
msg: fileName
|
217
|
-
} = content;
|
218
|
-
if (chatMessageType === MESSAGE_TYPE.IMAGE) {
|
219
|
-
url = fileName;
|
220
|
-
fileName = fileName.match(/\/([^\/?#]+)$/)[1];
|
221
|
-
}
|
222
|
-
downloadFile(url, fileName);
|
214
|
+
downloadFile(__content);
|
223
215
|
return;
|
224
216
|
}
|
225
217
|
case "withdraw": {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
|
-
import { formatTime, getForwardTitle, isDoctorRole, getRoleName,
|
2
|
+
import { formatTime, getForwardTitle, isDoctorRole, getRoleName, formatJsonstr, getFileType, getDetail, showAudioAndVideoRecord, simplifyMessage } from '../utils';
|
3
3
|
import { MESSAGE_TYPE } from '../constants';
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
5
5
|
id: {
|
@@ -54,7 +54,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
54
54
|
getForwardTitle: typeof getForwardTitle;
|
55
55
|
isDoctorRole: typeof isDoctorRole;
|
56
56
|
getRoleName: typeof getRoleName;
|
57
|
-
|
57
|
+
formatJsonstr: typeof formatJsonstr;
|
58
58
|
getFileType: typeof getFileType;
|
59
59
|
getDetail: typeof getDetail;
|
60
60
|
showAudioAndVideoRecord: typeof showAudioAndVideoRecord;
|
@@ -5,7 +5,7 @@ import 'stompjs';
|
|
5
5
|
import 'sockjs-client/dist/sockjs.min.js';
|
6
6
|
import { MESSAGE_TYPE } from '../constants/index.js';
|
7
7
|
import '../api/index.js';
|
8
|
-
import { transformMessage, getForwardTitle, isDoctorRole, getRoleName, formatTime,
|
8
|
+
import { transformMessage, getForwardTitle, isDoctorRole, getRoleName, formatTime, formatJsonstr, getFileType, getDetail, showAudioAndVideoRecord, simplifyMessage } from '../utils/index.js';
|
9
9
|
import { isArray } from 'lodash-es';
|
10
10
|
import 'trtc-sdk-v5';
|
11
11
|
import { emojis } from '../utils/emoji.js';
|
@@ -116,10 +116,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
116
116
|
}
|
117
117
|
}, toDisplayString(unref(getRoleName)(item.roleInfo)), 3), [[vShow, unref(getRoleName)(item.roleInfo)]])]), createElementVNode("span", null, toDisplayString(unref(formatTime)(item.sendTime).recordTime), 1)]), createElementVNode("div", _hoisted_5, [item.content.chatMessageType === unref(MESSAGE_TYPE).IMAGE ? (openBlock(), createElementBlock("img", {
|
118
118
|
key: 0,
|
119
|
-
src: unref(
|
119
|
+
src: unref(formatJsonstr)(item.__content, "fileUrl")
|
120
120
|
}, null, 8, _hoisted_6)) : item.content.chatMessageType === unref(MESSAGE_TYPE).FILE ? (openBlock(), createElementBlock(Fragment, {
|
121
121
|
key: 1
|
122
|
-
}, [createElementVNode("span", _hoisted_7, toDisplayString(unref(getFileType)(item.__content)), 1), createElementVNode("div", _hoisted_8, [createElementVNode("span", _hoisted_9, toDisplayString(unref(
|
122
|
+
}, [createElementVNode("span", _hoisted_7, toDisplayString(unref(getFileType)(item.__content)), 1), createElementVNode("div", _hoisted_8, [createElementVNode("span", _hoisted_9, toDisplayString(unref(formatJsonstr)(item.__content, "fileName")), 1), createElementVNode("span", _hoisted_10, toDisplayString(unref(getDetail)(item)), 1)])], 64)) : item.content.chatMessageType === unref(MESSAGE_TYPE).EMOJI ? (openBlock(), createElementBlock("img", {
|
123
123
|
key: 2,
|
124
124
|
class: "emoji",
|
125
125
|
src: unref(emojis).findEmoji(item.__content)
|
@@ -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">\
|
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", {
|
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: "",
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { ref, reactive, computed, watch, toRef, inject, toRaw } from 'vue';
|
2
2
|
import { openSessionApi, updateStatusApi, groupUserApi } from '../api/index.js';
|
3
3
|
import { promiseTimeout, useIntervalFn } from '@vueuse/core';
|
4
|
-
import { isGroup, listSort, formatTime, transformMessage,
|
4
|
+
import { isGroup, listSort, formatTime, transformMessage, $message, simplifyMessage } from '../utils/index.js';
|
5
5
|
import { cloneDeep, remove, isArray, uniqBy } from 'lodash-es';
|
6
|
-
import { STATUS,
|
6
|
+
import { STATUS, CHAT_TYPE, MESSAGE_TYPE } from '../constants/index.js';
|
7
7
|
import { useTheme } from '../../../../shared/hooks/useTheme.js';
|
8
8
|
import 'date-fns';
|
9
9
|
import '@vue/shared';
|
@@ -139,11 +139,6 @@ function initData(props, emit) {
|
|
139
139
|
__content: transformMessage(item.content),
|
140
140
|
__sendTime: formatTime(item.sendTime).recordTime
|
141
141
|
});
|
142
|
-
if (item.content.chatMessageType === MESSAGE_TYPE.FILE && !item.__size) {
|
143
|
-
getFileSize(item.content.fileUrl).then((size) => {
|
144
|
-
item.__size = size;
|
145
|
-
});
|
146
|
-
}
|
147
142
|
});
|
148
143
|
if (needUpdateTime()) {
|
149
144
|
resume();
|
@@ -9,8 +9,7 @@ export declare function listSort(list: AnyObject[]): AnyObject[];
|
|
9
9
|
export declare function transformMessage(content: AnyObject): any;
|
10
10
|
export declare function getAVTime(msg: string): string;
|
11
11
|
export declare function simplifyMessage(lastMessage: AnyObject): any;
|
12
|
-
export declare function downloadFile(
|
13
|
-
export declare function getFileSize(url: string): Promise<unknown>;
|
12
|
+
export declare function downloadFile(msg: string): void;
|
14
13
|
export declare function base64ToFile(base64: string): Promise<File | undefined>;
|
15
14
|
export declare function isAudioOrVideoMessage(message: AnyObject): boolean;
|
16
15
|
export declare function formatSeconds(seconds: number): string;
|
@@ -18,7 +17,7 @@ export declare function isGroup(session: AnyObject): boolean;
|
|
18
17
|
export declare function getForwardTitle(content: AnyObject): string | undefined;
|
19
18
|
export declare function isDoctorRole(type: string): boolean;
|
20
19
|
export declare function getRoleName(type: string): string;
|
21
|
-
export declare function getFileDetails(msg: string, type: string): any;
|
22
20
|
export declare function getFileType(msg: string): string;
|
23
21
|
export declare function getDetail(item: AnyObject, isShowSize?: boolean): string;
|
24
22
|
export declare function showAudioAndVideoRecord(chatMessageType: string): "语音通话" | "视频通话";
|
23
|
+
export declare function formatJsonstr(obj: AnyObject | string, type: string): any;
|
@@ -177,44 +177,24 @@ function simplifyMessage(lastMessage) {
|
|
177
177
|
return "[\u6D88\u606F]";
|
178
178
|
}
|
179
179
|
}
|
180
|
-
function downloadFile(
|
180
|
+
function downloadFile(msg) {
|
181
|
+
const fileName = formatJsonstr(msg, "fileName");
|
182
|
+
const fileUrl = formatJsonstr(msg, "fileUrl");
|
181
183
|
const x = new XMLHttpRequest();
|
182
|
-
x.open("GET",
|
184
|
+
x.open("GET", fileUrl, true);
|
183
185
|
x.responseType = "blob";
|
184
186
|
x.onload = function(e) {
|
185
187
|
if (x.status === 200) {
|
186
188
|
const _url = window.URL.createObjectURL(x.response);
|
187
189
|
const a = document.createElement("a");
|
188
190
|
a.href = _url;
|
189
|
-
a.download =
|
191
|
+
a.download = fileName;
|
190
192
|
a.dispatchEvent(new MouseEvent("click"));
|
191
193
|
window.URL.revokeObjectURL(_url);
|
192
194
|
}
|
193
195
|
};
|
194
196
|
x.send();
|
195
197
|
}
|
196
|
-
function getFileSize(url) {
|
197
|
-
return new Promise((resolve, reject) => {
|
198
|
-
const x = new XMLHttpRequest();
|
199
|
-
x.open("HEAD", url, true);
|
200
|
-
x.onreadystatechange = () => {
|
201
|
-
var _a;
|
202
|
-
if (x.readyState === 4 && x.status === 200) {
|
203
|
-
let size = (_a = x.getResponseHeader("Content-Length")) != null ? _a : 0;
|
204
|
-
const _size = +size;
|
205
|
-
if (_size > 1024 * 1024) {
|
206
|
-
size = (_size / (1024 * 1024)).toFixed(2) + "M";
|
207
|
-
} else if (_size > 1024) {
|
208
|
-
size = (_size / 1024).toFixed(2) + "K";
|
209
|
-
} else {
|
210
|
-
size = size + "B";
|
211
|
-
}
|
212
|
-
resolve(size);
|
213
|
-
}
|
214
|
-
};
|
215
|
-
x.send();
|
216
|
-
});
|
217
|
-
}
|
218
198
|
async function base64ToFile(base64) {
|
219
199
|
try {
|
220
200
|
const res = await fetch(base64);
|
@@ -272,17 +252,6 @@ function getRoleName(type) {
|
|
272
252
|
}
|
273
253
|
return roleName;
|
274
254
|
}
|
275
|
-
function getFileDetails(msg, type) {
|
276
|
-
try {
|
277
|
-
const parseMsg = JSON.parse(msg);
|
278
|
-
if (parseMsg) {
|
279
|
-
return parseMsg[type];
|
280
|
-
}
|
281
|
-
return "";
|
282
|
-
} catch (error) {
|
283
|
-
return msg || "";
|
284
|
-
}
|
285
|
-
}
|
286
255
|
function getFileType(msg) {
|
287
256
|
const dotIndex = msg.lastIndexOf(".");
|
288
257
|
if (dotIndex !== -1) {
|
@@ -293,13 +262,14 @@ function getFileType(msg) {
|
|
293
262
|
}
|
294
263
|
function getDetail(item, isShowSize) {
|
295
264
|
const {
|
296
|
-
|
265
|
+
content = {},
|
297
266
|
sendTime,
|
298
267
|
senderName
|
299
268
|
} = item;
|
300
269
|
const details = `${format(new Date(sendTime), "yyyy/MM/dd HH:mm")} ${senderName}`;
|
301
270
|
if (isShowSize) {
|
302
|
-
|
271
|
+
const fileSize = formatJsonstr(content.msg, "fileSize");
|
272
|
+
return `${fileSize} \xB7 ${details}`;
|
303
273
|
}
|
304
274
|
return details;
|
305
275
|
}
|
@@ -320,5 +290,16 @@ function showAudioAndVideoRecord(chatMessageType) {
|
|
320
290
|
}
|
321
291
|
}();
|
322
292
|
}
|
293
|
+
function formatJsonstr(obj, type) {
|
294
|
+
try {
|
295
|
+
if (typeof obj === "string") {
|
296
|
+
const objParse = JSON.parse(obj);
|
297
|
+
return objParse[type];
|
298
|
+
}
|
299
|
+
return obj[type];
|
300
|
+
} catch (error) {
|
301
|
+
return obj;
|
302
|
+
}
|
303
|
+
}
|
323
304
|
|
324
|
-
export { $message, base64ToFile, downloadFile, formatSeconds, formatTime, getAVTime, getDetail,
|
305
|
+
export { $message, base64ToFile, downloadFile, formatJsonstr, formatSeconds, formatTime, getAVTime, getDetail, getFileType, getForwardTitle, getRoleName, isAudioOrVideoMessage, isDoctorRole, isGroup, listSort, showAudioAndVideoRecord, simplifyMessage, transformMessage };
|
@@ -188,7 +188,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
188
188
|
"onUpdate:checked": _cache[1] || (_cache[1] = ($event) => isRef(partCheckAll) ? partCheckAll.value = $event : null),
|
189
189
|
indeterminate: unref(partIndeterminate)
|
190
190
|
}, {
|
191
|
-
default: withCtx(() => [createTextVNode(
|
191
|
+
default: withCtx(() => [createTextVNode(function() {
|
192
|
+
var _a, _b, _c;
|
193
|
+
try {
|
194
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.661")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.661")) || "\u5168\u9009\u5F53\u524D";
|
195
|
+
} catch (e) {
|
196
|
+
return "\u5168\u9009\u5F53\u524D";
|
197
|
+
}
|
198
|
+
}())]),
|
192
199
|
_: 1
|
193
200
|
}, 8, ["checked", "indeterminate"])])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_4, [createVNode(unref(NCheckbox), {
|
194
201
|
checked: unref(checkAll),
|
@@ -372,7 +372,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
372
372
|
stack.push(...node.children);
|
373
373
|
}
|
374
374
|
}
|
375
|
-
return result;
|
375
|
+
return result == null ? void 0 : result.reverse();
|
376
376
|
}
|
377
377
|
if (!isRemote.value) {
|
378
378
|
if (isSearch.value && !isShowGroupList.value) {
|
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.29",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"vxe-table": "^4.2.5"
|
26
26
|
},
|
27
27
|
"dependencies": {
|
28
|
-
"@cnhis-frontend/audio-sdk": "1.0.0-beta.
|
28
|
+
"@cnhis-frontend/audio-sdk": "1.0.0-beta.8",
|
29
29
|
"@formily/core": "2.1.9",
|
30
30
|
"@formily/path": "2.1.9",
|
31
31
|
"@formily/reactive": "2.1.9",
|
@@ -73,5 +73,5 @@
|
|
73
73
|
"iOS 7",
|
74
74
|
"last 3 iOS versions"
|
75
75
|
],
|
76
|
-
"gitHead": "
|
76
|
+
"gitHead": "011f18a245fdf3430d8b463d4965821e0f580cc9"
|
77
77
|
}
|