cnhis-design-vue 3.2.11-release.2 → 3.2.12-release.0

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.
Files changed (98) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/index.d.ts +36 -1
  3. package/es/components/ai-chat/src/Index.vue.d.ts +37 -2
  4. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  5. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +28 -1
  6. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  8. package/es/components/ai-chat/src/types/index.d.ts +7 -0
  9. package/es/components/ai-chat/style/index.css +1 -1
  10. package/es/components/button-print/index.d.ts +3 -0
  11. package/es/components/button-print/src/ButtonPrint.vue.d.ts +3 -0
  12. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  13. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -0
  14. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  15. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +2 -0
  16. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  17. package/es/components/callback/src/components/render/popupMaps.d.ts +4 -0
  18. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  19. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  25. package/es/components/fabric-chart/src/utils/index.d.ts +2 -2
  26. package/es/components/fabric-chart/src/utils/index.js +1 -1
  27. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  28. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
  29. package/es/components/form-config/index.d.ts +236 -3
  30. package/es/components/form-config/src/FormConfig.vue.d.ts +236 -3
  31. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +322 -88
  32. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  33. package/es/components/form-config/src/types/index.d.ts +4 -0
  34. package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
  35. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  36. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  37. package/es/components/iho-table/index.d.ts +4 -0
  38. package/es/components/iho-table/src/IhoTable.vue.d.ts +4 -0
  39. package/es/components/iho-table/src/constants/index.d.ts +4 -0
  40. package/es/components/iho-table/src/constants/index.js +1 -1
  41. package/es/components/iho-table/src/plugins/defaultConfigPlugin.js +1 -1
  42. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  43. package/es/components/iho-table/src/types/index.d.ts +14 -0
  44. package/es/components/iho-table/src/utils/index.js +1 -1
  45. package/es/components/iho-table/style/index.css +1 -1
  46. package/es/components/index.css +1 -1
  47. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  48. package/es/components/scale-view/src/hooks/use-component.d.ts +2 -7
  49. package/es/components/select-label/index.d.ts +2 -7
  50. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  51. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue.d.ts +2 -7
  52. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue.d.ts +2 -7
  53. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  54. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue.d.ts +2 -7
  55. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
  56. package/es/components/select-label/src/index.vue.d.ts +2 -7
  57. package/es/components/select-label/src/types/index.d.ts +2 -1
  58. package/es/components/shortcut-setter/index.d.ts +1 -1
  59. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
  60. package/es/env.d.ts +25 -25
  61. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  62. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  63. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  64. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  65. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  66. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  67. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  68. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  69. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  70. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  71. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  72. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  73. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  74. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  75. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  76. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  77. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  78. package/es/shared/assets/img/failure.png.js +1 -1
  79. package/es/shared/assets/img/logo.png.js +1 -1
  80. package/es/shared/assets/img/no-permission.png.js +1 -1
  81. package/es/shared/assets/img/nodata.png.js +1 -1
  82. package/es/shared/assets/img/notfound.png.js +1 -1
  83. package/es/shared/assets/img/qr.png.js +1 -1
  84. package/es/shared/assets/img/success.png.js +1 -1
  85. package/es/shared/assets/img/table_style_2.png.js +1 -1
  86. package/es/shared/assets/img/video.png.js +1 -1
  87. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  88. package/es/shared/assets/img/xb_big.png.js +1 -1
  89. package/es/shared/assets/img/xb_small.png.js +1 -1
  90. package/es/shared/package.json.js +1 -1
  91. package/package.json +2 -2
  92. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  93. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  94. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  95. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  96. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  97. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  98. package/es/shared/utils/tapable/index.d.ts +0 -139
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
+ ```
@@ -27,6 +27,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
27
27
  type: NumberConstructor;
28
28
  default: number;
29
29
  };
30
+ commandList: {
31
+ type: import("vue").PropType<import("./src/types").CommandItem[]>;
32
+ };
30
33
  }, {
31
34
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
32
35
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -57,6 +60,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
57
60
  type: NumberConstructor;
58
61
  default: number;
59
62
  };
63
+ commandList: {
64
+ type: import("vue").PropType<import("./src/types").CommandItem[]>;
65
+ };
60
66
  }>> & {
61
67
  "onButton-click"?: ((...args: any[]) => any) | undefined;
62
68
  }>>;
@@ -70,26 +76,52 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
70
76
  readonly [x: number]: string;
71
77
  } | {}>;
72
78
  ChatFooter: import("vue").DefineComponent<{}, {
79
+ cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
73
80
  audioSdk: import("..").CAudioSDK;
74
81
  emit: (event: string, ...args: any[]) => void;
75
82
  shortcutList: any;
76
83
  state: any;
77
84
  isSmall: any;
78
85
  audioTimed: any;
86
+ commandList: any;
87
+ inputRef: import("vue").Ref<any>;
79
88
  content: import("vue").Ref<string>;
89
+ showPopover: import("vue").Ref<boolean>;
90
+ breadcrumb: import("vue").Ref<{
91
+ [x: string]: any;
92
+ shortcutTitle: string;
93
+ shortcutId: string;
94
+ shortcutDescription?: string | undefined;
95
+ children?: any[] | undefined;
96
+ }[]>;
97
+ currentCommand: import("vue").Ref<{
98
+ [x: string]: any;
99
+ shortcutTitle: string;
100
+ shortcutId: string;
101
+ shortcutDescription?: string | undefined;
102
+ children?: any[] | undefined;
103
+ }[]>;
80
104
  btnDisabled: import("vue").ComputedRef<boolean>;
81
105
  recorderStart: () => Promise<void>;
82
- recorderStop: () => Promise<void>;
83
106
  isValidJSON: (str: string) => boolean;
84
107
  getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
85
108
  handleShortcut: (item: string | import("../../shared/types").AnyObject) => void;
109
+ resetCurrentCommand: () => void;
86
110
  handleKeyDown: (event: KeyboardEvent) => void;
87
111
  isWrap: (event: KeyboardEvent) => boolean;
88
112
  handleSend: () => void;
113
+ clickMenu: (menu: import("./src/types").CommandItem) => void;
114
+ handleBack: () => void;
89
115
  NButton: any;
90
116
  NInput: any;
91
117
  NIcon: any;
118
+ NPopover: any;
119
+ NBreadcrumb: any;
120
+ NBreadcrumbItem: any;
121
+ NTag: any;
92
122
  PaperPlane: 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<{}>>, {}>;
123
+ ChevronBack: 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<{}>>, {}>;
124
+ ChevronForward: 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<{}>>, {}>;
93
125
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
94
126
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
95
127
  userAvatar: {
@@ -119,6 +151,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
119
151
  type: NumberConstructor;
120
152
  default: number;
121
153
  };
154
+ commandList: {
155
+ type: import("vue").PropType<import("./src/types").CommandItem[]>;
156
+ };
122
157
  }>> & {
123
158
  "onButton-click"?: ((...args: any[]) => any) | undefined;
124
159
  }, {
@@ -1,5 +1,5 @@
1
1
  import { type PropType } from 'vue';
2
- import { QueryData, QueryRecord } from './types';
2
+ import { QueryData, QueryRecord, CommandItem } from './types';
3
3
  import { AnyObject } from '../../../shared/types';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  userAvatar: {
@@ -29,6 +29,9 @@ declare const _default: import("vue").DefineComponent<{
29
29
  type: NumberConstructor;
30
30
  default: number;
31
31
  };
32
+ commandList: {
33
+ type: PropType<CommandItem[]>;
34
+ };
32
35
  }, {
33
36
  cssVars: import("vue").ComputedRef<AnyObject>;
34
37
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -59,6 +62,9 @@ declare const _default: import("vue").DefineComponent<{
59
62
  type: NumberConstructor;
60
63
  default: number;
61
64
  };
65
+ commandList: {
66
+ type: PropType<CommandItem[]>;
67
+ };
62
68
  }>> & {
63
69
  "onButton-click"?: ((...args: any[]) => any) | undefined;
64
70
  }>>;
@@ -72,26 +78,52 @@ declare const _default: import("vue").DefineComponent<{
72
78
  readonly [x: number]: string;
73
79
  } | {}>;
74
80
  ChatFooter: import("vue").DefineComponent<{}, {
81
+ cssVars: import("vue").ComputedRef<AnyObject>;
75
82
  audioSdk: import("../..").CAudioSDK;
76
83
  emit: (event: string, ...args: any[]) => void;
77
84
  shortcutList: any;
78
85
  state: any;
79
86
  isSmall: any;
80
87
  audioTimed: any;
88
+ commandList: any;
89
+ inputRef: import("vue").Ref<any>;
81
90
  content: import("vue").Ref<string>;
91
+ showPopover: import("vue").Ref<boolean>;
92
+ breadcrumb: import("vue").Ref<{
93
+ [x: string]: any;
94
+ shortcutTitle: string;
95
+ shortcutId: string;
96
+ shortcutDescription?: string | undefined;
97
+ children?: any[] | undefined;
98
+ }[]>;
99
+ currentCommand: import("vue").Ref<{
100
+ [x: string]: any;
101
+ shortcutTitle: string;
102
+ shortcutId: string;
103
+ shortcutDescription?: string | undefined;
104
+ children?: any[] | undefined;
105
+ }[]>;
82
106
  btnDisabled: import("vue").ComputedRef<boolean>;
83
107
  recorderStart: () => Promise<void>;
84
- recorderStop: () => Promise<void>;
85
108
  isValidJSON: (str: string) => boolean;
86
109
  getShortcutName: (item: string | AnyObject) => any;
87
110
  handleShortcut: (item: string | AnyObject) => void;
111
+ resetCurrentCommand: () => void;
88
112
  handleKeyDown: (event: KeyboardEvent) => void;
89
113
  isWrap: (event: KeyboardEvent) => boolean;
90
114
  handleSend: () => void;
115
+ clickMenu: (menu: CommandItem) => void;
116
+ handleBack: () => void;
91
117
  NButton: any;
92
118
  NInput: any;
93
119
  NIcon: any;
120
+ NPopover: any;
121
+ NBreadcrumb: any;
122
+ NBreadcrumbItem: any;
123
+ NTag: any;
94
124
  PaperPlane: 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<{}>>, {}>;
125
+ ChevronBack: 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<{}>>, {}>;
126
+ ChevronForward: 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<{}>>, {}>;
95
127
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
96
128
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
97
129
  userAvatar: {
@@ -121,6 +153,9 @@ declare const _default: import("vue").DefineComponent<{
121
153
  type: NumberConstructor;
122
154
  default: number;
123
155
  };
156
+ commandList: {
157
+ type: PropType<CommandItem[]>;
158
+ };
124
159
  }>> & {
125
160
  "onButton-click"?: ((...args: any[]) => any) | undefined;
126
161
  }, {
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as t,provide as o,toRefs as r,computed as s,openBlock as i,createElementBlock as a,normalizeClass as n,normalizeStyle as u,unref as m,createVNode as p,createBlock as d,createCommentVNode as l}from"vue";import h from"./components/ChatMain.js";import c from"./components/ChatFooter.vue.js";import{useTheme as y}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as v,InjectionAIChatEmits as f}from"./types/index.js";var S=e({__name:"Index",props:{userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function,reuired:!0},queryRecord:{type:Function,reuired:!0},hideInput:{type:Boolean},uiStyle:{type:String},audioTimed:{type:Number,default:10}},emits:["button-click"],setup(e,{emit:S}){const j=e,k=y(),g=t({beingSent:!1,sendContent:""});return o(v,{...r(j),state:g,isSmall:s((()=>"small"===j.uiStyle))}),o(f,S),(t,o)=>(i(),a("div",{class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:u(m(k))},[p(m(h)),e.hideInput?l("v-if",!0):(i(),d(c,{key:0}))],6))}});export{S as default};
1
+ import{defineComponent as e,reactive as t,provide as o,toRefs as r,computed as s,openBlock as i,createElementBlock as a,normalizeClass as n,normalizeStyle as m,unref as u,createVNode as p,createBlock as d,createCommentVNode as l}from"vue";import c from"./components/ChatMain.js";import h from"./components/ChatFooter.vue.js";import{useTheme as y}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as v,InjectionAIChatEmits as f}from"./types/index.js";var S=e({__name:"Index",props:{userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function,reuired:!0},queryRecord:{type:Function,reuired:!0},hideInput:{type:Boolean},uiStyle:{type:String},audioTimed:{type:Number,default:10},commandList:{type:Array}},emits:["button-click"],setup(e,{emit:S}){const j=e,k=y(),C=t({beingSent:!1,sendContent:"",selectedCommand:null});return o(v,{...r(j),state:C,isSmall:s((()=>"small"===j.uiStyle))}),o(f,S),(t,o)=>(i(),a("div",{class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:m(u(k))},[p(u(c)),e.hideInput?l("v-if",!0):(i(),d(h,{key:0}))],6))}});export{S as default};
@@ -1,25 +1,52 @@
1
+ import { CommandItem } from '../types';
1
2
  import { CAudioSDK } from '../../../../components/audio-sdk';
2
3
  import { AnyObject } from '../../../../shared/types';
3
4
  declare const _default: import("vue").DefineComponent<{}, {
5
+ cssVars: import("vue").ComputedRef<AnyObject>;
4
6
  audioSdk: CAudioSDK;
5
7
  emit: (event: string, ...args: any[]) => void;
6
8
  shortcutList: any;
7
9
  state: any;
8
10
  isSmall: any;
9
11
  audioTimed: any;
12
+ commandList: any;
13
+ inputRef: import("vue").Ref<any>;
10
14
  content: import("vue").Ref<string>;
15
+ showPopover: import("vue").Ref<boolean>;
16
+ breadcrumb: import("vue").Ref<{
17
+ [x: string]: any;
18
+ shortcutTitle: string;
19
+ shortcutId: string;
20
+ shortcutDescription?: string | undefined;
21
+ children?: any[] | undefined;
22
+ }[]>;
23
+ currentCommand: import("vue").Ref<{
24
+ [x: string]: any;
25
+ shortcutTitle: string;
26
+ shortcutId: string;
27
+ shortcutDescription?: string | undefined;
28
+ children?: any[] | undefined;
29
+ }[]>;
11
30
  btnDisabled: import("vue").ComputedRef<boolean>;
12
31
  recorderStart: () => Promise<void>;
13
- recorderStop: () => Promise<void>;
14
32
  isValidJSON: (str: string) => boolean;
15
33
  getShortcutName: (item: string | AnyObject) => any;
16
34
  handleShortcut: (item: string | AnyObject) => void;
35
+ resetCurrentCommand: () => void;
17
36
  handleKeyDown: (event: KeyboardEvent) => void;
18
37
  isWrap: (event: KeyboardEvent) => boolean;
19
38
  handleSend: () => void;
39
+ clickMenu: (menu: CommandItem) => void;
40
+ handleBack: () => void;
20
41
  NButton: any;
21
42
  NInput: any;
22
43
  NIcon: any;
44
+ NPopover: any;
45
+ NBreadcrumb: any;
46
+ NBreadcrumbItem: any;
47
+ NTag: any;
23
48
  PaperPlane: 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<{}>>, {}>;
49
+ ChevronBack: 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<{}>>, {}>;
50
+ ChevronForward: 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<{}>>, {}>;
24
51
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
25
52
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as n,ref as t,computed as o,watch as l,onBeforeUnmount as i,openBlock as a,createElementBlock as s,normalizeClass as r,unref as d,Fragment as c,renderList as u,createBlock as f,withCtx as p,createTextVNode as v,toDisplayString as k,createCommentVNode as m,createElementVNode as b,createVNode as h,getCurrentInstance as w}from"vue";import{NButton as y,NInput as g,NIcon as x}from"naive-ui";import{PaperPlane as S}from"@vicons/ionicons5";import{InjectionAIChatEmits as C,InjectionAIChat as K}from"../types/index.js";import _ from"../../../audio-sdk/src/audioSDK.js";import{isString as j}from"lodash-es";const z={key:0,class:"menu-box fillet-8"},M={class:"input-wrapper fillet-10"},E=b("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),b("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),b("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),N={class:"btn-box"},R=["disabled"];var D=e({__name:"ChatFooter",setup(e){const D=_.create(),F=n(C),{shortcutList:J,state:O,isSmall:T,audioTimed:U}=n(K),B=t(""),I=o((()=>!B.value.replace(/(&nbsp;|\s|<br>)+/g,"")));async function L(){await D.recorderStart(w(),{onStop:P,allowPunctuationMark:!1,timed:U.value||10,realTimeRecognition:!0})}async function P(){try{const e=await D.recorderStop();if("success"!==e.result)return;const{text:n}=e.data;B.value=n}catch(e){console.log(e)}}function V(e){var n,t;if(j(e))return e;const o=null==(t=null==(n=null==e?void 0:e.contents)?void 0:n[0])?void 0:t.content;return(function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(o)?JSON.parse(o):{}).instructionName}function q(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),A()))}function A(){I.value||(O.beingSent=!0,O.sendContent=B.value,B.value="")}return l((()=>O.sendContent),(e=>{e&&!O.beingSent&&(B.value=e)})),i((()=>{D.destroy()})),(e,n)=>(a(),s("section",{class:r(["chat-footer",d(O).beingSent?"disabled":""])},[d(J)&&d(J).length>0?(a(),s("div",z,[(a(!0),s(c,null,u(d(J),(e=>(a(),f(d(y),{secondary:"",size:"small",round:d(T),key:V(e),onClick:()=>function(e){var n;if(j(e))B.value=e;else{const t=null==(n=null==e?void 0:e.contents)?void 0:n[0];F("button-click",{msgItem:t,item:e})}}(e)},{default:p((()=>[v(k(V(e)),1)])),_:2},1032,["round","onClick"])))),128))])):m("v-if",!0),b("div",M,[d(T)?(a(),f(d(g),{key:0,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:d(O).beingSent,value:B.value,"onUpdate:value":n[0]||(n[0]=e=>B.value=e),onKeydown:q},{suffix:p((()=>[h(d(y),{text:"",disabled:d(O).beingSent,onClick:L},{icon:p((()=>[h(d(x),{size:"30"},{default:p((()=>[E])),_:1})])),_:1},8,["disabled"]),h(d(y),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:d(I),onClick:A},{icon:p((()=>[h(d(x),{color:"#fff",size:"20",component:d(S)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(a(),s(c,{key:1},[h(d(g),{type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:d(O).beingSent,autosize:{minRows:2,maxRows:7},value:B.value,"onUpdate:value":n[1]||(n[1]=e=>B.value=e),onKeydown:q},null,8,["disabled","value"]),b("div",N,[b("span",{class:r(["btn-send","gradient","fillet-8",d(I)?"disabled":""]),disabled:d(I),onClick:A},[h(d(x),{color:"#fff",size:"22",component:d(S)},null,8,["component"])],10,R)])],64))])],2))}});export{D as default};
1
+ import{defineComponent as e,inject as t,ref as l,computed as o,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as i,normalizeClass as r,unref as u,Fragment as d,renderList as c,createBlock as v,withCtx as m,createTextVNode as p,toDisplayString as h,createCommentVNode as f,createVNode as k,createElementVNode as b,getCurrentInstance as y}from"vue";import{NButton as g,NPopover as x,NInput as C,NTag as w,NIcon as _,NBreadcrumb as S,NBreadcrumbItem as j}from"naive-ui";import{PaperPlane as T,ChevronBack as z,ChevronForward as K}from"@vicons/ionicons5";import{InjectionAIChatEmits as M,InjectionAIChat as R}from"../types/index.js";import D from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as E,isString as I,last as L}from"lodash-es";import{useTheme as N}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";const B={key:0,class:"menu-box fillet-8"},F={class:"input-wrapper fillet-10"},J=b("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),b("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),b("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),O={class:"btn-box"},U=["disabled"],W={class:"command-box"},H={class:"command-box__header"},P={key:0,class:"title"},V={class:"command-box__menu"},q=["onClick"],A={class:"label"},G={class:"remark"};var Q=e({__name:"ChatFooter",setup(e){const Q=N(),X=D.create(),Y=t(M),{shortcutList:Z,state:$,isSmall:ee,audioTimed:te,commandList:le}=t(R),oe=l(),ne=l(""),ae=l(!1),se=l([]),ie=l(E(le.value||[])),re=o((()=>!ne.value.replace(/(&nbsp;|\s|<br>)+/g,"")));async function ue(){try{const e=await X.start(y(),{allowPunctuationMark:!1,timed:te.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:t}=e.data;ne.value=t}catch(e){console.log(e)}}function de(e){var t,l;if(I(e))return e;const o=null==(l=null==(t=null==e?void 0:e.contents)?void 0:t[0])?void 0:l.content;return(function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(o)?JSON.parse(o):{}).instructionName}function ce(){var e;ie.value=E(le.value||[]),se.value=[],(null==(e=le.value)?void 0:e.length)>0&&(ae.value=!0)}function ve(e){ae.value=!1,"Slash"!==e.code||$.selectedCommand||ne.value||ce(),"Backspace"===e.key&&(!ne.value.startsWith("/")&&!ne.value.startsWith("、")||2!==ne.value.length||$.selectedCommand?!ne.value&&$.selectedCommand&&(e.preventDefault(),$.selectedCommand=null,ne.value="/",ce()):ce()),["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),me()))}function me(){re.value||($.beingSent=!0,$.sendContent=ne.value,ne.value="")}function pe(){var e;se.value.pop(),ie.value=L(se.value)?null==(e=L(se.value))?void 0:e.children:E(le.value||[])}return n((()=>$.sendContent),(e=>{e&&!$.beingSent&&(ne.value=e)})),a((()=>{X.destroy()})),(e,t)=>(s(),i("section",{class:r(["chat-footer",u($).beingSent?"disabled":""])},[u(Z)&&u(Z).length>0?(s(),i("div",B,[(s(!0),i(d,null,c(u(Z),(e=>(s(),v(u(g),{secondary:"",size:"small",round:u(ee),key:de(e),onClick:()=>function(e){var t;if(I(e))ne.value=e;else{const l=null==(t=null==e?void 0:e.contents)?void 0:t[0];Y("button-click",{msgItem:l,item:e})}}(e)},{default:m((()=>[p(h(de(e)),1)])),_:2},1032,["round","onClick"])))),128))])):f("v-if",!0),k(u(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ae.value,onClickoutside:t[2]||(t[2]=e=>ae.value=!1)},{trigger:m((()=>[b("div",F,[u(ee)?(s(),v(u(C),{key:0,ref_key:"inputRef",ref:oe,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:u($).beingSent,value:ne.value,"onUpdate:value":t[0]||(t[0]=e=>ne.value=e),onKeydown:ve},{prefix:m((()=>[u($).selectedCommand&&u($).selectedCommand.shortcutTitle?(s(),v(u(w),{key:0,bordered:!1,color:{textColor:u(Q)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>[p(" /"+h(u($).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):f("v-if",!0)])),suffix:m((()=>[k(u(g),{text:"",disabled:u($).beingSent,onClick:ue},{icon:m((()=>[k(u(_),{size:"30"},{default:m((()=>[J])),_:1})])),_:1},8,["disabled"]),k(u(g),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:u(re),onClick:me},{icon:m((()=>[k(u(_),{color:"#fff",size:"20",component:u(T)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),i(d,{key:1},[k(u(C),{ref_key:"inputRef",ref:oe,type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:u($).beingSent,autosize:{minRows:2,maxRows:7},value:ne.value,"onUpdate:value":t[1]||(t[1]=e=>ne.value=e),onKeydown:ve},{prefix:m((()=>[u($).selectedCommand&&u($).selectedCommand.shortcutTitle?(s(),v(u(w),{key:0,bordered:!1,color:{textColor:u(Q)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>{var e;return[p(" /"+h(null==(e=u($).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):f("v-if",!0)])),_:1},8,["disabled","value"]),b("div",O,[b("span",{class:r(["btn-send","gradient","fillet-8",u(re)?"disabled":""]),disabled:u(re),onClick:me},[k(u(_),{color:"#fff",size:"22",component:u(T)},null,8,["component"])],10,U)])],64))])])),default:m((()=>[b("div",W,[b("div",H,[0===se.value.length?(s(),i("span",P,"推荐指令")):(s(),i(d,{key:1},[k(u(g),{text:"",onClick:pe},{default:m((()=>[k(u(_),{color:"#999",size:"20",component:u(z)},null,8,["component"])])),_:1}),k(u(S),null,{default:m((()=>[(s(!0),i(d,null,c(se.value,(e=>(s(),v(u(j),{key:e.shortcutId},{default:m((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),b("div",V,[(s(!0),i(d,null,c(ie.value,(e=>(s(),i("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable"]),key:e.shortcutId,onClick:()=>{var t,l;(null==(l=(t=e).children)?void 0:l.length)?(ie.value=t.children,se.value.push(t)):($.selectedCommand=t||{},ae.value=!1,ne.value="",oe.value.focus())}},[b("span",A,h(e.shortcutTitle),1),b("span",G,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),v(u(_),{key:0,color:"#999",size:"20",component:u(K)},null,8,["component"])):f("v-if",!0)],10,q)))),128))])])])),_:1},8,["show"])],2))}});export{Q as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as n,computed as l,watch as a,nextTick as s,createVNode as o,createTextVNode as i,mergeProps as r,isVNode as u}from"vue";import{NAvatar as c,NSpin as d,NButton as m,NSpace as p,NIcon as v}from"naive-ui";import{InjectionAIChatEmits as f,InjectionAIChat as g}from"../types/index.js";import h from"../../../../shared/assets/img/ai__avatar.png.js";import b from"../../../../shared/assets/img/logo.png.js";import{isArray as y,isFunction as x}from"lodash-es";import"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{ChevronForward as k}from"@vicons/ionicons5";import{useScrollLoading as S}from"../../../../shared/hooks/useScrollLoading.js";function j(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var C=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:u,slots:C,emit:I}){const T=t(f),{userAvatar:E,queryData:_,state:w,queryRecord:z,defaultShortcutList:M,hideInput:N=!1,isSmall:O}=t(g),A=n(null),q=n([]),H=n(!1),J=l((()=>O.value?b:h)),L={page:0,hasMore:!0};async function D(e=!1){if(!L.hasMore)return;L.page++,1==L.page&&(q.value=[]);const{records:t,rows:n}=await z.value({page:L.page});y(n)&&q.value.length<=+t&&(q.value=L.page>1?[...q.value,...n]:n,R(),q.value.length>=+t&&(e&&(H.value=!0),L.hasMore=!1,console.log("没有更多消息了")))}function R(){q.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function B(e){const{item:t,msgItem:n,fieldItem:l}=e;if(n)return T("button-click",{item:t,msgItem:n,fieldItem:l}),void q.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));q.value.forEach((e=>e.buttonType&&(e.disabled=!0))),t.link||(w.beingSent=!0,w.sendContent="确定")}function F(e,t){const{contentType:n,content:l=""}=t;if("json"!==n||!function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(l))return null;const a=JSON.parse(l),s=["journaling","dashboard"].includes(a.buttonType);return o("div",{class:"card"},[[o("p",null,[a.title]),s?a.fields.map((n=>o(m,{class:"link-btn",style:"--n-height: 36px",secondary:!0,"icon-placement":"right",onClick:()=>B({item:e,msgItem:t,fieldItem:n})},{default:()=>n.name,icon:()=>o(v,{component:k},null)}))):[o("div",{class:"card-body"},[o("p",{class:"card-body__head"},[a.instructionName]),o("div",{class:"card-body__content"},[a.fields.map((e=>o("div",null,[o("span",{class:"label"},[e.name]),i(":"),o("span",null,[e.value])])))])]),o(m,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",disabled:t.disabled,onClick:()=>B({item:e,msgItem:t})},{default:()=>[a.buttonName]})]]])}function G(e,t){const{contents:n=[],buttonType:l=""}=e,a=F(e,n[t]);if(a)return a;return[n[t].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,t,n)=>[e,t===n.length-1?null:o("br",null,null)])),l&&0===t?[o("br",null,null),o(m,r({style:"margin-top: 5px",secondary:!0,class:"gradient",disabled:e.disabled},e.link?{tag:"a",href:e.link,target:"_blank"}:{},{onClick:()=>B({item:e})}),{default:()=>[i("确定")]})]:null]}function K({role:e=""}){return"user"===e}function P(){let e;return o("div",{class:"message-item"},[o(c,{round:!0,size:O.value?64:40,src:J.value},null),o("div",{class:"content-box"},[o("div",{class:"content fillet-10 default"},[o("h2",null,[i("Hi,我是你的AI助理")]),o("p",null,[i("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),o("br",null,null),i("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),y(M.value)&&M.value.length>0?[o("p",{style:"margin: 5px 0 5px"},[i("你可以试着问我:")]),o(p,{"wrap-item":!1},j(e=M.value.map((e=>o(m,{size:"large",secondary:!0,onClick:()=>w.sendContent=e,disabled:w.beingSent},j(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return S(A,(()=>{D()}),N.value?"bottom":"top"),D(!0),a((()=>w.beingSent),(async e=>{var t,n;if(e){q.value.unshift({contents:[{role:"user",content:w.sendContent}]}),null==(t=A.value)||t.scrollTo({top:0,behavior:"auto"}),R();const e=await _.value({content:w.sendContent,contentType:"text"});y(null==e?void 0:e.contents)&&(q.value.unshift(e),await s(),null==(n=A.value)||n.scrollTo({top:0,behavior:"auto"})),w.beingSent=!1,w.sendContent=""}})),()=>o("section",{class:"chat-main",ref:A,style:{"flex-direction":N.value?"column":"column-reverse"}},[[w.beingSent?o("div",{class:"message-item"},[[O.value?null:o(c,{round:!0,size:40,src:J.value},null),o("div",{class:"content-box"},[o("div",{class:"content loading"},[o(d,{size:22,stroke:"#4170EE"},null),o("span",null,[i("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((t,n)=>o("div",{class:"message-item"},[[O.value?null:o(c,{round:!0,size:40,src:K(t)?E.value:J.value},null),o("div",{class:["content-box",K(t)?"mine":""]},[o("div",{class:"content"},[x(t.render)?t.render():G(e,n)])])]]))))),H.value?P():null]])}});export{C as default};
1
+ import{defineComponent as e,inject as t,ref as n,computed as l,watch as a,nextTick as s,createVNode as o,createTextVNode as i,mergeProps as r,isVNode as u}from"vue";import{NAvatar as c,NSpin as d,NButton as m,NSpace as p,NIcon as v}from"naive-ui";import{InjectionAIChatEmits as f,InjectionAIChat as g}from"../types/index.js";import h from"../../../../shared/assets/img/ai__avatar.png.js";import b from"../../../../shared/assets/img/logo.png.js";import{isArray as y,isFunction as x}from"lodash-es";import"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{ChevronForward as k}from"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";function S(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var j=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:u,slots:j,emit:I}){const T=t(f),{userAvatar:E,queryData:_,state:w,queryRecord:z,defaultShortcutList:M,hideInput:N=!1,isSmall:O}=t(g),A=n(null),q=n([]),H=n(!1),J=l((()=>O.value?b:h)),L={page:0,hasMore:!0};async function D(e=!1){if(!L.hasMore)return;L.page++,1==L.page&&(q.value=[]);const{records:t,rows:n}=await z.value({page:L.page});y(n)&&q.value.length<=+t&&(q.value=L.page>1?[...q.value,...n]:n,R(),q.value.length>=+t&&(e&&(H.value=!0),L.hasMore=!1,console.log("没有更多消息了")))}function R(){q.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function B(e){const{item:t,msgItem:n,fieldItem:l}=e;if(n)return T("button-click",{item:t,msgItem:n,fieldItem:l}),void q.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));q.value.forEach((e=>e.buttonType&&(e.disabled=!0))),t.link||(w.beingSent=!0,w.sendContent="确定")}function F(e,t){const{contentType:n,content:l=""}=t;if("json"!==n||!function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(l))return null;const a=JSON.parse(l),s=["journaling","dashboard"].includes(a.buttonType);return o("div",{class:"card"},[[o("p",null,[a.title]),s?a.fields.map((n=>o(m,{class:"link-btn",style:"--n-height: 36px",secondary:!0,"icon-placement":"right",onClick:()=>B({item:e,msgItem:t,fieldItem:n})},{default:()=>n.name,icon:()=>o(v,{component:k},null)}))):[o("div",{class:"card-body"},[o("p",{class:"card-body__head"},[a.instructionName]),o("div",{class:"card-body__content"},[a.fields.map((e=>o("div",null,[o("span",{class:"label"},[e.name]),i(":"),o("span",null,[e.value])])))])]),o(m,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",disabled:t.disabled,onClick:()=>B({item:e,msgItem:t})},{default:()=>[a.buttonName]})]]])}function G(e,t){const{contents:n=[],buttonType:l=""}=e,a=F(e,n[t]);if(a)return a;return[n[t].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,t,n)=>[e,t===n.length-1?null:o("br",null,null)])),l&&0===t?[o("br",null,null),o(m,r({style:"margin-top: 5px",secondary:!0,class:"gradient",disabled:e.disabled},e.link?{tag:"a",href:e.link,target:"_blank"}:{},{onClick:()=>B({item:e})}),{default:()=>[i("确定")]})]:null]}function K({role:e=""}){return"user"===e}function P(){let e;return o("div",{class:"message-item"},[o(c,{round:!0,size:O.value?64:40,src:J.value},null),o("div",{class:"content-box"},[o("div",{class:"content fillet-10 default"},[o("h2",null,[i("Hi,我是你的AI助理")]),o("p",null,[i("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),o("br",null,null),i("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),y(M.value)&&M.value.length>0?[o("p",{style:"margin: 5px 0 5px"},[i("你可以试着问我:")]),o(p,{"wrap-item":!1},S(e=M.value.map((e=>o(m,{size:"large",secondary:!0,onClick:()=>w.sendContent=e,disabled:w.beingSent},S(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return C(A,(()=>{D()}),N.value?"bottom":"top"),D(!0),a((()=>w.beingSent),(async e=>{var t,n;if(e){q.value.unshift({contents:[{role:"user",content:w.sendContent}]}),null==(t=A.value)||t.scrollTo({top:0,behavior:"auto"}),R();const e=w.selectedCommand;w.selectedCommand=null;const l=await _.value({content:w.sendContent,contentType:"text",command:e});y(null==l?void 0:l.contents)&&(q.value.unshift(l),await s(),null==(n=A.value)||n.scrollTo({top:0,behavior:"auto"})),w.beingSent=!1,w.sendContent=""}})),()=>o("section",{class:"chat-main",ref:A,style:{"flex-direction":N.value?"column":"column-reverse"}},[[w.beingSent?o("div",{class:"message-item"},[[O.value?null:o(c,{round:!0,size:40,src:J.value},null),o("div",{class:"content-box"},[o("div",{class:"content loading"},[o(d,{size:22,stroke:"#4170EE"},null),o("span",null,[i("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((t,n)=>o("div",{class:"message-item"},[[O.value?null:o(c,{round:!0,size:40,src:K(t)?E.value:J.value},null),o("div",{class:["content-box",K(t)?"mine":""]},[o("div",{class:"content"},[x(t.render)?t.render():G(e,n)])])]]))))),H.value?P():null]])}});export{j as default};
@@ -27,3 +27,10 @@ export type QueryRecord = (props: {
27
27
  records: number;
28
28
  rows: MessageList;
29
29
  }>;
30
+ export type CommandItem = {
31
+ shortcutTitle: string;
32
+ shortcutId: string;
33
+ shortcutDescription?: string;
34
+ children?: CommandItem[];
35
+ [key: string]: any;
36
+ };
@@ -1 +1 @@
1
- .c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;font-size:14px;height:100%;padding:45px 0 60px;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .gradient{background:linear-gradient(178deg,#8f66f7,#4170ee);color:#fff}.ai-chat .gradient:active,.ai-chat .gradient:focus,.ai-chat .gradient:hover{color:#fff}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:auto;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content-box .content{background:#fff;border-radius:10px;flex:unset;padding:10px 12px}.ai-chat .chat-main .message-item .content-box .content .card{width:236px}.ai-chat .chat-main .message-item .content-box .content .card>p{font-size:14px;line-height:19px}.ai-chat .chat-main .message-item .content-box .content .card .link-btn{display:flex;flex-flow:row wrap;font-size:14px;justify-content:space-between;margin-top:10px;width:100%}.ai-chat .chat-main .message-item .content-box .content .card .link-btn .n-button__content{display:unset;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-main .message-item .content-box .content .card .card-body{border:1px solid #d5d5d5;border-radius:8px;margin-top:5px;overflow:hidden}.ai-chat .chat-main .message-item .content-box .content .card .card-body__head{background:rgba(65,112,238,.14);line-height:36px;padding:0 15px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content{padding:10px 6px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div{display:flex;font-size:12px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div .label{flex:0 0 60px;text-align:right}.ai-chat .chat-main .message-item .content-box .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content-box .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-main .message-item .content-box.mine .content{background:hsla(0,0%,100%,.48);border-radius:8px}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;overflow-x:auto;padding:10px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{width:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{height:5px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed;opacity:.5}.ai-chat--small{padding:20px 0 44px}.ai-chat--small .chat-main{padding:0 20px 10px}.ai-chat--small .chat-main .message-item{display:unset}.ai-chat--small .chat-main .message-item .n-avatar{background:transparent}.ai-chat--small .chat-main .message-item .content-box{display:flex;flex-flow:row nowrap}.ai-chat--small .chat-main .message-item .content-box .content{border-radius:3px 14px 14px;max-width:calc(100% - 55px)}.ai-chat--small .chat-main .message-item .content-box .content.default{border-radius:4px 16px 16px}.ai-chat--small .chat-main .message-item .content-box.mine{flex-flow:row-reverse nowrap}.ai-chat--small .chat-main .message-item .content-box.mine .content{background:#5874dc;border-radius:14px 0 14px 14px;color:#fff}.ai-chat--small .chat-footer{padding:10px 20px 0}.ai-chat--small .chat-footer .menu-box{background:none;padding:0}.ai-chat--small .chat-footer .menu-box .n-button{background:#fff}.ai-chat--small .chat-footer .input-wrapper{border-radius:24px;box-shadow:0 0 6px 0 hsla(240,9%,85%,.74);padding:0}
1
+ .c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;font-size:14px;height:100%;padding:45px 0 60px;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .gradient{background:linear-gradient(178deg,#8f66f7,#4170ee);color:#fff}.ai-chat .gradient:active,.ai-chat .gradient:focus,.ai-chat .gradient:hover{color:#fff}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:auto;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content-box .content{background:#fff;border-radius:10px;flex:unset;padding:10px 12px}.ai-chat .chat-main .message-item .content-box .content .card{width:236px}.ai-chat .chat-main .message-item .content-box .content .card>p{font-size:14px;line-height:19px}.ai-chat .chat-main .message-item .content-box .content .card .link-btn{display:flex;flex-flow:row wrap;font-size:14px;justify-content:space-between;margin-top:10px;width:100%}.ai-chat .chat-main .message-item .content-box .content .card .link-btn .n-button__content{display:unset;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-main .message-item .content-box .content .card .card-body{border:1px solid #d5d5d5;border-radius:8px;margin-top:5px;overflow:hidden}.ai-chat .chat-main .message-item .content-box .content .card .card-body__head{background:rgba(65,112,238,.14);line-height:36px;padding:0 15px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content{padding:10px 6px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div{display:flex;font-size:12px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div .label{flex:0 0 60px;text-align:right}.ai-chat .chat-main .message-item .content-box .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content-box .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-main .message-item .content-box.mine .content{background:hsla(0,0%,100%,.48);border-radius:8px}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;overflow-x:auto;padding:10px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{width:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{height:5px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed;opacity:.5}.ai-chat .chat-footer .command-box{display:flex;flex-flow:column nowrap;height:100%}.ai-chat .chat-footer .command-box__header{display:flex}.ai-chat .chat-footer .command-box__header .title{color:#999}.ai-chat .chat-footer .command-box__menu{flex:1;overflow-y:auto}.ai-chat .chat-footer .command-box__menu .menu-item{align-items:center;display:flex;padding:8px 0 8px 5px}.ai-chat .chat-footer .command-box__menu .menu-item .remark{color:#999;flex:1;font-size:12px;margin-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-footer .command-box__menu .menu-item .n-icon{margin-left:auto}.ai-chat .chat-footer .command-box__menu .menu-item:hover{background:#e5e5e5;border-radius:5px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable{position:relative}.ai-chat .chat-footer .command-box__menu .menu-item.selectable .label{color:var(--c-primary-color);margin-left:30px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable:before{background:#d5d5d5;border-radius:5px;content:"/";height:20px;left:5px;line-height:20px;position:absolute;text-align:center;top:10px;width:20px}.ai-chat--small{padding:20px 0 44px}.ai-chat--small .chat-main{padding:0 20px 10px}.ai-chat--small .chat-main .message-item{display:unset}.ai-chat--small .chat-main .message-item .n-avatar{background:transparent}.ai-chat--small .chat-main .message-item .content-box{display:flex;flex-flow:row nowrap}.ai-chat--small .chat-main .message-item .content-box .content{border-radius:3px 14px 14px;max-width:calc(100% - 55px)}.ai-chat--small .chat-main .message-item .content-box .content.default{border-radius:4px 16px 16px}.ai-chat--small .chat-main .message-item .content-box.mine{flex-flow:row-reverse nowrap}.ai-chat--small .chat-main .message-item .content-box.mine .content{background:#5874dc;border-radius:14px 0 14px 14px;color:#fff}.ai-chat--small .chat-footer{padding:10px 20px 0}.ai-chat--small .chat-footer .menu-box{background:none;padding:0}.ai-chat--small .chat-footer .menu-box .n-button{background:#fff}.ai-chat--small .chat-footer .input-wrapper{border-radius:24px;box-shadow:0 0 6px 0 hsla(240,9%,85%,.74);padding:0}
@@ -341,6 +341,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
341
341
  type: StringConstructor;
342
342
  };
343
343
  }, {
344
+ isDomestic: boolean;
344
345
  baseDownListSetting: {
345
346
  label: string;
346
347
  key: string;
@@ -961,6 +962,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
961
962
  printInstance: import("./src/utils").Print | null;
962
963
  downloadPdfCode: string;
963
964
  formatEditTextCode: string;
965
+ isDomestic: boolean;
964
966
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
965
967
  printParams: {
966
968
  type: import("vue").PropType<import("../../shared/types").AnyObject[]>;
@@ -1086,6 +1088,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1086
1088
  iReportExecuteMode: number;
1087
1089
  };
1088
1090
  options: import("vue").Ref<import("../../shared/types").AnyObject[]>;
1091
+ tempOptions: import("vue").Ref<import("../../shared/types").AnyObject[]>;
1089
1092
  currentFormatItem: import("vue").ComputedRef<{} | undefined>;
1090
1093
  formatTitle: import("vue").ComputedRef<any>;
1091
1094
  getTemplateIdByFormatId: import("vue").ComputedRef<any>;
@@ -347,6 +347,7 @@ declare const _default: import("vue").DefineComponent<{
347
347
  type: StringConstructor;
348
348
  };
349
349
  }, {
350
+ isDomestic: boolean;
350
351
  baseDownListSetting: {
351
352
  label: string;
352
353
  key: string;
@@ -967,6 +968,7 @@ declare const _default: import("vue").DefineComponent<{
967
968
  printInstance: import("./utils").Print | null;
968
969
  downloadPdfCode: string;
969
970
  formatEditTextCode: string;
971
+ isDomestic: boolean;
970
972
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
971
973
  printParams: {
972
974
  type: PropType<AnyObject[]>;
@@ -1092,6 +1094,7 @@ declare const _default: import("vue").DefineComponent<{
1092
1094
  iReportExecuteMode: number;
1093
1095
  };
1094
1096
  options: import("vue").Ref<AnyObject[]>;
1097
+ tempOptions: import("vue").Ref<AnyObject[]>;
1095
1098
  currentFormatItem: import("vue").ComputedRef<{} | undefined>;
1096
1099
  formatTitle: import("vue").ComputedRef<any>;
1097
1100
  getTemplateIdByFormatId: import("vue").ComputedRef<any>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,reactive as a,watch as l,openBlock as o,createBlock as u,unref as r,normalizeStyle as n,withCtx as i,createElementVNode as s,mergeProps as d,createVNode as p,withKeys as c,createTextVNode as m}from"vue";import{useMessage as v,NModal as f,NForm as y,NFormItem as w,NInput as g,NButton as h}from"naive-ui";import k from"./EditFormat.vue.js";import"../utils/print.js";import{isIReport as I}from"../utils/browserPrint.js";const _={class:"content"};var V=e({__name:"IdentityVerification",props:{verifyUser:{type:Function,default:()=>Promise.resolve()},identityVerificationTitle:{default:"打印服务身份校验"},modelValue:{type:Boolean},formatId:null,templateId:null},emits:["update:modelValue","success","close"],setup(e,{emit:V}){const b=e,x=v(),C={account:"",password:""},K=t(null),U=t(!1),j=t("");let S=a({...C});const F={account:{required:!0,message:"请输入账号"},password:{required:!0,message:"请输入密码"}},P="416px",q=t(null),E=()=>{V("update:modelValue",!1),V("close")},N=t(!1),R=()=>{var e;null==(e=q.value)||e.validate((e=>{if(e)return console.log(e),!1;(async()=>{var e,t;try{N.value=!0;const{data:a={}}=await b.verifyUser(S)||{};if("SUCCESS"!==a.result)return x.error(a.resultMsg||"身份校验失败,请重试!"),!1;I(b.formatId||"")?(U.value=!0,j.value=null==(e=a.map)?void 0:e.token):V("success",null==(t=a.map)?void 0:t.token)}finally{N.value=!1}})()}))},T=async()=>{var e,t;try{N.value=!0;if(!await(null==(t=K.value)?void 0:t.submit({authorizationKey:j.value,id:null==(e=b.formatId)?void 0:e.split("_")[1],templateId:b.templateId,datasourceName:null,dataSourceId:null})))return!1;V("success",j.value)}finally{N.value=!1}};return l((()=>b.modelValue),(e=>{e||Object.assign(S,C)})),(t,a)=>(o(),u(r(f),{preset:"dialog",title:U.value?"编辑":e.identityVerificationTitle,class:"standard-modal standard-modal-white authentication-modal c-button-print-modal",show:e.modelValue,"close-on-esc":!1,"show-icon":!1,style:n({width:P,overflowY:"auto"}),"positive-text":U.value?"确认":"","negative-text":U.value?"取消":"",onClose:E,onNegativeClick:E,onPositiveClick:T},{default:i((()=>[s("div",_,[U.value?(o(),u(k,d({key:0,ref_key:"editFormRef",ref:K},t.$attrs,{formatId:e.formatId,token:j.value}),null,16,["formatId","token"])):(o(),u(r(y),{key:1,class:"login-form-button-print",ref_key:"formRef",ref:q,model:r(S),rules:F},{default:i((()=>[p(r(w),{path:"account"},{default:i((()=>[p(r(g),{value:r(S).account,"onUpdate:value":a[0]||(a[0]=e=>r(S).account=e),placeholder:"请输入账号",onKeyup:c(R,["enter"])},null,8,["value","onKeyup"])])),_:1}),p(r(w),{path:"password"},{default:i((()=>[p(r(g),{type:"password","input-props":{autocomplete:"on",name:"password"},value:r(S).password,"onUpdate:value":a[1]||(a[1]=e=>r(S).password=e),placeholder:"请输入密码",onKeyup:c(R,["enter"])},null,8,["value","onKeyup"])])),_:1}),p(r(w),null,{default:i((()=>[p(r(h),{loading:N.value,type:"primary",class:"login-form-button",onClick:R},{default:i((()=>[m("登录")])),_:1},8,["loading"])])),_:1})])),_:1},8,["model"]))])])),_:1},8,["title","show","style","positive-text","negative-text"]))}});export{V as default};
1
+ import{defineComponent as e,ref as t,reactive as a,watch as l,openBlock as o,createBlock as u,unref as n,normalizeStyle as r,withCtx as s,createElementVNode as i,mergeProps as d,createVNode as c,withKeys as p,createTextVNode as m}from"vue";import{useMessage as v,NModal as f,NForm as y,NFormItem as w,NInput as g,NButton as h}from"naive-ui";import _ from"./EditFormat.vue.js";const k={class:"content"};var I=e({__name:"IdentityVerification",props:{verifyUser:{type:Function,default:()=>Promise.resolve()},identityVerificationTitle:{default:"打印服务身份校验"},modelValue:{type:Boolean},formatId:null,templateId:null},emits:["update:modelValue","success","close"],setup(e,{emit:I}){const V=e,x=v(),C={account:"",password:""},b=t(null),K=t(!1),U=t("");let S=a({...C});const F={account:{required:!0,message:"请输入账号"},password:{required:!0,message:"请输入密码"}},j="416px",q=t(null),E=()=>{I("update:modelValue",!1),I("close")},N=t(!1),P=()=>{var e;null==(e=q.value)||e.validate((e=>{if(e)return console.log(e),!1;(async()=>{var e;try{N.value=!0;const{data:t={}}=await V.verifyUser(S)||{};if("SUCCESS"!==t.result)return x.error(t.resultMsg||"身份校验失败,请重试!"),!1;I("success",null==(e=t.map)?void 0:e.token)}finally{N.value=!1}})()}))},R=async()=>{var e,t;try{N.value=!0;if(!await(null==(t=b.value)?void 0:t.submit({authorizationKey:U.value,id:null==(e=V.formatId)?void 0:e.split("_")[1],templateId:V.templateId,datasourceName:null,dataSourceId:null})))return!1;I("success",U.value)}finally{N.value=!1}};return l((()=>V.modelValue),(e=>{e||Object.assign(S,C)})),(t,a)=>(o(),u(n(f),{preset:"dialog",title:K.value?"编辑":e.identityVerificationTitle,class:"standard-modal standard-modal-white authentication-modal c-button-print-modal",show:e.modelValue,"close-on-esc":!1,"show-icon":!1,style:r({width:j,overflowY:"auto"}),"positive-text":K.value?"确认":"","negative-text":K.value?"取消":"",onClose:E,onNegativeClick:E,onPositiveClick:R},{default:s((()=>[i("div",k,[K.value?(o(),u(_,d({key:0,ref_key:"editFormRef",ref:b},t.$attrs,{formatId:e.formatId,token:U.value}),null,16,["formatId","token"])):(o(),u(n(y),{key:1,class:"login-form-button-print",ref_key:"formRef",ref:q,model:n(S),rules:F},{default:s((()=>[c(n(w),{path:"account"},{default:s((()=>[c(n(g),{value:n(S).account,"onUpdate:value":a[0]||(a[0]=e=>n(S).account=e),placeholder:"请输入账号",onKeyup:p(P,["enter"])},null,8,["value","onKeyup"])])),_:1}),c(n(w),{path:"password"},{default:s((()=>[c(n(g),{type:"password","input-props":{autocomplete:"on",name:"password"},value:n(S).password,"onUpdate:value":a[1]||(a[1]=e=>n(S).password=e),placeholder:"请输入密码",onKeyup:p(P,["enter"])},null,8,["value","onKeyup"])])),_:1}),c(n(w),null,{default:s((()=>[c(n(h),{loading:N.value,type:"primary",class:"login-form-button",onClick:P},{default:s((()=>[m("登录")])),_:1},8,["loading"])])),_:1})])),_:1},8,["model"]))])])),_:1},8,["title","show","style","positive-text","negative-text"]))}});export{I as default};
@@ -112,6 +112,7 @@ declare const _default: import("vue").DefineComponent<{
112
112
  type: StringConstructor;
113
113
  };
114
114
  }, {
115
+ isDomestic: boolean;
115
116
  baseDownListSetting: {
116
117
  label: string;
117
118
  key: string;