cnhis-design-vue 3.2.14-beta.2 → 3.2.14-beta.21
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/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-date.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
- package/es/components/big-table/src/components/input-button.vue2.js +1 -1
- package/es/components/big-table/src/hooks/useTableParse.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/utils/constant.js +1 -1
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +3 -2
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/constants/filter.d.ts +21 -12
- package/es/components/field-set/src/constants/filter.js +1 -1
- package/es/components/field-set/src/constants/index.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/components/form-config/index.d.ts +7 -5
- package/es/components/form-config/index.js +1 -1
- package/es/components/form-config/src/FormConfig.vue.d.ts +7 -5
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +2 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +2 -2
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
- package/es/components/form-config/src/constants/index.d.ts +1 -11
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/form-config/src/hooks/useLocale.d.ts +52 -0
- package/es/components/form-config/src/hooks/useLocale.js +1 -0
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/utils/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-chat/index.d.ts +596 -52
- package/es/components/iho-chat/src/Index.vue.d.ts +599 -59
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/api/index.d.ts +1 -0
- package/es/components/iho-chat/src/api/index.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +32 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +52 -3
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +52 -2
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +220 -11
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +82 -6
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +20 -2
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +71 -4
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.d.ts +11 -2
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +51 -2
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +66 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +11 -2
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/index.d.ts +2 -2
- package/es/components/iho-chat/src/hooks/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useData.d.ts +94 -0
- package/es/components/iho-chat/src/hooks/useData.js +1 -0
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +19 -1
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/hooks/useWebSocket.d.ts +3 -0
- package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -0
- package/es/components/iho-chat/src/types/index.d.ts +0 -6
- package/es/components/iho-chat/src/types/index.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +1 -0
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
- package/es/components/map/src/Map.vue2.js +1 -1
- package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +4 -7
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +4 -7
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -7
- package/es/components/table-filter/src/tool/baseOptions.js +1 -1
- package/es/components/template-render/src/components/index.d.ts +23 -23
- package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/logo.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/index.d.ts +3 -0
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/index.d.ts +1 -0
- package/es/shared/utils/index.js +1 -1
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
- package/es/components/iho-chat/src/hooks/useSession.d.ts +0 -12
- package/es/components/iho-chat/src/hooks/useSession.js +0 -1
- package/es/components/iho-chat/src/hooks/useState.d.ts +0 -18
- package/es/components/iho-chat/src/hooks/useState.js +0 -1
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
|
+
```
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as a,reactive as l,computed as n,watch as o,createVNode as i}from"vue";import{NForm as s,NFormItem as r,NInput as u,NIcon as d,NButton as c}from"naive-ui";import{InjectionAIChat as v}from"../types/index.js";import"../../../index.js";import{cloneDeep as
|
1
|
+
import{defineComponent as e,inject as t,ref as a,reactive as l,computed as n,watch as o,createVNode as i}from"vue";import{NForm as s,NFormItem as r,NInput as u,NIcon as d,NButton as c}from"naive-ui";import{InjectionAIChat as v}from"../types/index.js";import"../../../index.js";import{cloneDeep as m,isArray as p}from"lodash-es";import{isValidJSON as f}from"../utils/index.js";import{ChevronDown as g,ChevronForward as b}from"@vicons/ionicons5";import{useTheme as h}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";import y from"../../../form-render/index.js";import E from"../../../template-render/index.js";var I=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object},configs:{type:Object},msgId:{type:String}},emits:["button-click"],setup(e,{attrs:I,slots:k,emit:x}){const T={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATETIME-INPUT",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},_=h(),{patientInfo:C,state:P,axiosInstance:w,isSmall:O}=t(v),S=a([]),j=a(),R=a(),M=l({vaa05:""}),L=a(),N=n((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),q=e.msgItem.content,A={},U=l(m(q.data||{})),B={beforeRequest(e,t,a){(null==t?void 0:t.params)&&(t.params.vaa05=R.value.selectedPatient.vaa01),t&&Reflect.has(t,"configs")&&(t.configs=R.value.selectedPatient)}};function F(e){const{eventName:t,data:a}=e;t&&x("button-click",{buttonInfo:a,isBI:!0})}function K(e){U[e.button.id+"Disabled"]="1",x("button-click",{buttonInfo:e.button})}function H(){var t;if(!R.value)return null;function a(){e.msgItem.disabled||(P.showPatient=!0)}return i(s,{class:"form-render",ref:L,"require-mark-placement":"left",disabled:e.msgItem.disabled,model:M,rules:{vaa05:{required:R.value.required,message:R.value.name+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.146"))||"为必填"),trigger:["input"]}}},{default:()=>[i(r,{label:R.value.name,path:"vaa05",class:"form-render__formItem",style:"--n-feedback-height: 16px; --n-feedback-padding: 0px; --n-feedback-font-size: 12px"},{default:()=>{var e;return[i(u,{style:"--n-text-color-disabled: #000; --n-placeholder-color-disabled: #000;--n-padding-left: 8px; --n-padding-right: 8px",readonly:!0,value:M.vaa05,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择",onClick:a},{suffix:()=>i(d,{color:"#c2c2c2",component:g},null)})]}})]})}async function J(t,a){var l;try{const n=a||j.value.getFormValues();await(null==(l=j.value)?void 0:l.validate()),q.body.items.forEach((e=>{var t;"vaa05"===e.code?(e._value=P.selectedPatientLabel,e.value=R.value.selectedPatient.vaa01||e.value):n[e.code]&&(e.value=n[e.code]),(null==(t=A[e.code])?void 0:t[0])&&(e.options=A[e.code])})),P.loading=!0,x("button-click",{values:n,buttonInfo:t,patient:R.value.selectedPatient||e.configs,isForm:!0})}catch(e){P.loading=!1}}function z(e){const{fieldInstance:t,context:a,value:l,fieldKey:n}=e;"REMOTE_SEARCH"===t.componentType&&(null==l?void 0:l.length)&&(A[n]=[null==a?void 0:a.currentOption])}function D(){x("button-click",{showMore:!0})}function V(){var e;if("1834043761964638208"!==(null==(e=q.settings)?void 0:e.id)||!q.data)return null;const t=JSON.parse(q.settings.setting),a=e=>{var t;let l="";for(let n=0;n<e.length;n++){const o=e[n];if(o.setting.scopeKey){l=o.setting.scopeKey;break}if((null==(t=o.childrens)?void 0:t.length)&&(l=a(o.childrens),l))break}return l},l=a(t.templates);return!l||!f(q.data[l])||JSON.parse(q.data[l]).length<=5?null:(f(U[l])&&(U[l]=JSON.parse(U[l]).slice(0,5)),i(c,{block:!0,text:!0,"icon-placement":"right",color:_.value["--c-primary-color"],style:"margin-top: 10px",onClick:D},{icon:()=>i(d,{component:b},null),default:()=>"查看更多"}))}return N.value&&(S.value=(q.body.items||[]).map((t=>{var a,l,n;if("vaa05"===t.code&&!O.value)return R.value={...t},t._value?M.vaa05=t._value:(null==(a=t.options)?void 0:a.length)&&t.value&&(M.vaa05=null==(l=t.options.find((e=>e.value===t.value)))?void 0:l.label,R.value.selectedPatient=e.configs),null;const o={html_type:T[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=t.labelField)?n:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("REMOTE_SEARCH"===o.html_type){if(o.componentProps={fallbackOption:!1},o.option=t.options||[],o.default_val=null,t.value&&p(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(o.default_val=t.value)}if(Object.assign(o.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:O.value?"inner":"global",configs:C.value.info||P.selectedPatient},dependKey:[]}),t.dependencies){const e=t.dependencies.split(",");o.urlConfig.dependKey=e,e.includes("vaa05")&&(o.urlConfig.params.params={vaa05:""})}}return o})).filter((e=>!!e))),o((()=>P.showPatient),(t=>{!e.msgItem.disabled&&N.value&&!t&&P.selectedPatientLabel&&R.value&&(M.vaa05=P.selectedPatientLabel,R.value.selectedPatient={...P.selectedPatientForm})})),()=>{var t;return i("div",{class:"card"},[N.value?[i("p",null,[q.title||q.header.title]),i("div",{class:"form-box"},[[H(),i(y,{"request-instance":{get:w.get,post:w.post},"life-cycle":B,column:12,ref:j,"field-list":S.value,onFormChange:z},null)]]),q.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=N.value?{...a,marginTop:"0"}:a;return i(c,{id:e.msgId,style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){var e;if(N.value){if(!j.value)return;try{R.value?null==(e=L.value)||e.validate((async e=>{var a,l;if(!e){const e=null==(l=(a=j.value).getFormValues)?void 0:l.call(a);Object.assign(e,{vaa05:R.value.selectedPatient.vaa01}),await J(t,e)}})):await J(t)}catch(e){}}else x("button-click")}},{default:()=>[N.value?null==t?void 0:t.text:q.buttonName]})}(t)))]:[i(E,{config:f(null==(t=q.settings)?void 0:t.setting)?JSON.parse(q.settings.setting):null,data:U,"onModule-click":F,"onButton-click":K},null),V()]])}}});export{I as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as o,computed as n,onBeforeUnmount as l,watch as
|
1
|
+
import{defineComponent as e,inject as t,ref as o,computed as n,onBeforeUnmount as l,watch as a,openBlock as s,createElementBlock as i,normalizeClass as r,unref as d,createElementVNode as u,createBlock as c,withCtx as v,createVNode as m,createTextVNode as h,toDisplayString as p,createCommentVNode as f,Fragment as k,renderList as w,withModifiers as C,getCurrentInstance as g}from"vue";import{NButton as y,NIcon as b,NPopover as x,NInput as _,NTag as I,NBreadcrumb as j,NBreadcrumbItem as z}from"naive-ui";import{PeopleOutline as P,SparklesSharp as T,PaperPlane as D,ChevronBack as K,ChevronForward as M}from"@vicons/ionicons5";import{InjectionAIChatEmits as L,InjectionAIChat as S}from"../types/index.js";import U from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as B,isString as R,last as A}from"lodash-es";import{useTheme as E}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";import W from"./ChatPrompt.vue.js";import F from"./ChatPatient.vue.js";const N={class:"menu-box fillet-8"},q={class:"input-wrapper fillet-10"},H=u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),u("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"}),u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),u("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),V={class:"btn-box"},G=["disabled"],J={class:"command-box"},O={class:"command-box__header"},Q={key:0,class:"title"},X={class:"command-box__menu"},Y=["onMouseover","onClick"],Z={class:"label"},$={class:"remark"};var ee=e({__name:"ChatFooter",setup(e){const ee=E(),te=U.create(),oe=t(L),{shortcutList:ne,state:le,isSmall:ae,audioTimed:se,commandList:ie}=t(S),re=o(),de=o(!1),ue=o([]),ce=o(B(ie.value||[])),ve=o(!1),me=o(""),he=o(!1),pe=n((()=>le.loading||!le.sendContent.replace(/( |\s|<br>)+/g,""))),fe=n((()=>{var e;return!le.sendContent&&!(null==(e=re.value)?void 0:e.activated.value)})),ke=n((()=>{var e,t;if(!le.selectedPatient)return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.190"))||"选择患者";const{bcq04b:o,vaa05:n}=le.selectedPatient;let l="";o&&(l+=o+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.191"))||"床"));return n&&(l+=(!l||l.endsWith("/")?"":"/")+n),l}));async function we(){try{const e=await te.start(g(),{allowPunctuationMark:!1,timed:se.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:t}=e.data;le.sendContent=t}catch(e){console.log(e)}}function Ce(e){var t;if(R(e))return e;const{content:o}=(null==(t=null==e?void 0:e.contents)?void 0:t[0])||{};return o.instructionName}function ge(){var e;de.value=!1,ce.value=B(ie.value||[]),ue.value=[],(null==(e=ie.value)?void 0:e.length)&&(de.value=!0,me.value=ce.value[0].shortcutId)}function ye(e){if(!["Slash","NumpadDivide"].includes(e.code)||le.selectedCommand||le.sendContent)if("Backspace"===e.key)de.value=!1,!le.sendContent.startsWith("/")&&!le.sendContent.startsWith("、")||2!==le.sendContent.length||le.selectedCommand?!le.sendContent&&le.selectedCommand&&(e.preventDefault(),le.selectedCommand=null,le.sendContent="/",ge()):ge();else if(de.value&&["ArrowUp","ArrowDown"].includes(e.key)){const t=ce.value.findIndex((e=>e.shortcutId===me.value));if("ArrowUp"===e.key){const e=t>0?t-1:ce.value.length-1;me.value=ce.value[e].shortcutId}else if("ArrowDown"===e.key){const e=t<ce.value.length-1?t+1:0;me.value=ce.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e))if(e.preventDefault(),de.value){_e(ce.value.find((e=>e.shortcutId===me.value)))}else xe()}else de.value=!1;else ge()}function be(e){!e&&le.selectedPrompt&&(le.selectedPrompt=null)}function xe(){pe.value||(le.sending=!0,le.loading=!0)}function _e(e){var t;me.value=e.shortcutId,re.value.focus(),(null==(t=e.children)?void 0:t.length)?(ce.value=e.children,me.value=ce.value[0].shortcutId,ue.value.push(e)):(le.selectedCommand=e||{},de.value=!1,le.sendContent="")}function Ie(){var e;ue.value.pop(),ce.value=A(ue.value)?null==(e=A(ue.value))?void 0:e.children:B(ie.value||[]),me.value=ce.value[0].shortcutId,re.value.focus()}function je(e){e||(le.showPatient=!1)}return l((()=>{te.destroy()})),a((()=>le.showPatient),(e=>{e&&(he.value=e)})),(e,t)=>(s(),i("section",{class:r(["chat-footer",d(le).loading?"disabled":""])},[u("div",N,[d(ae)?f("v-if",!0):(s(),c(d(y),{key:0,secondary:"",size:"small",onClick:t[0]||(t[0]=()=>he.value=!0)},{icon:v((()=>[m(d(b),{color:d(ee)["--c-primary-color"],size:"20",component:d(P)},null,8,["color","component"])])),default:v((()=>[h(" "+p(d(ke)),1)])),_:1})),d(ne)&&d(ne).length>0?(s(!0),i(k,{key:1},w(d(ne),(e=>(s(),c(d(y),{secondary:"",size:"small",round:d(ae),key:Ce(e),onClick:()=>function(e){var t;if(R(e))le.sendContent=e;else{const o=null==(t=null==e?void 0:e.contents)?void 0:t[0];oe("button-click",{msgItem:o,item:e})}}(e)},{default:v((()=>[h(p(Ce(e)),1)])),_:2},1032,["round","onClick"])))),128)):f("v-if",!0)]),m(d(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:de.value,onClickoutside:t[5]||(t[5]=e=>de.value=!1)},{trigger:v((()=>[u("div",q,[d(ae)?(s(),c(d(_),{key:0,ref_key:"inputRef",ref:re,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:d(le).loading,value:d(le).sendContent,"onUpdate:value":t[2]||(t[2]=e=>d(le).sendContent=e),onKeydownCapture:ye,onInput:be},{prefix:v((()=>[d(le).selectedCommand&&d(le).selectedCommand.shortcutTitle?(s(),c(d(I),{key:0,bordered:!1,color:{textColor:d(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[h(" /"+p(d(le).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):d(fe)?(s(),c(d(y),{key:1,text:"",onClick:t[1]||(t[1]=()=>ve.value=!0)},{default:v((()=>[m(d(b),{color:"#8f66f7",size:"18",component:d(T)},null,8,["component"])])),_:1})):f("v-if",!0)])),suffix:v((()=>[m(d(y),{text:"",disabled:d(le).loading,onClick:we},{icon:v((()=>[m(d(b),{size:"30"},{default:v((()=>[H])),_:1})])),_:1},8,["disabled"]),m(d(y),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:d(pe),onClick:xe},{icon:v((()=>[m(d(b),{color:"#fff",size:"20",component:d(D)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),i(k,{key:1},[m(d(_),{ref_key:"inputRef",ref:re,type:"textarea",placeholder:'请向我提问或输入"/"查看指令,Shift+Enter换行',disabled:d(le).loading,autosize:{minRows:2,maxRows:7},value:d(le).sendContent,"onUpdate:value":t[4]||(t[4]=e=>d(le).sendContent=e),onKeydownCapture:ye,onInput:be},{prefix:v((()=>[d(le).selectedCommand&&d(le).selectedCommand.shortcutTitle?(s(),c(d(I),{key:0,bordered:!1,color:{textColor:d(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>{var e;return[h(" /"+p(null==(e=d(le).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):d(fe)?(s(),c(d(y),{key:1,text:"",onClick:t[3]||(t[3]=()=>ve.value=!0)},{default:v((()=>[m(d(b),{color:"#8f66f7",size:"18",component:d(T)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:1},8,["disabled","value"]),u("div",V,[u("span",{class:r(["btn-send","gradient","fillet-8",d(pe)?"disabled":""]),disabled:d(pe),onClick:xe},[m(d(b),{color:"#fff",size:"22",component:d(D)},null,8,["component"])],10,G)])],64))])])),default:v((()=>{var e;return[u("div",J,[u("div",O,[0===ue.value.length?(s(),i("span",Q,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.189"))||"推荐指令")):(s(),i(k,{key:1},[m(d(y),{text:"",onClick:Ie},{default:v((()=>[m(d(b),{color:"#999",size:"20",component:d(K)},null,8,["component"])])),_:1}),m(d(j),null,{default:v((()=>[(s(!0),i(k,null,w(ue.value,(e=>(s(),c(d(z),{key:e.shortcutId},{default:v((()=>[h(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),u("div",X,[(s(!0),i(k,null,w(ce.value,(e=>(s(),i("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",me.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>me.value=e.shortcutId),["stop"]),onClick:()=>_e(e)},[u("span",Z,p(e.shortcutTitle),1),u("span",$,p(e.shortcutDescription),1),e.children&&e.children.length?(s(),c(d(b),{key:0,color:"#999",size:"20",component:d(M)},null,8,["component"])):f("v-if",!0)],42,Y)))),128))])])]})),_:1},8,["show"]),m(W,{show:ve.value,"onUpdate:show":t[6]||(t[6]=e=>ve.value=e)},null,8,["show"]),m(F,{show:he.value,"onUpdate:show":[t[7]||(t[7]=e=>he.value=e),je]},null,8,["show"])],2))}});export{ee as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as
|
1
|
+
import{defineComponent as e,inject as n,ref as t,computed as l,watch as o,createVNode as s,createTextVNode as a,nextTick as i,isVNode as u}from"vue";import{NAvatar as r,NSpin as d,NSpace as c,NButton as v}from"naive-ui";import{InjectionAIChatEmits as m,InjectionAIChat as g}from"../types/index.js";import p from"../../../../shared/assets/img/ai__avatar.png.js";import f from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as b}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"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";import y from"./ChatCard.js";import{isValidJSON as w}from"../utils/index.js";import I from"./ChatBI.vue.js";function j(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var x=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:u,slots:x,emit:k}){const T=n(m),{userAvatar:E,queryData:L,state:B,queryRecord:P,defaultShortcutList:S,hideInput:z=!1,isSmall:M}=n(g),D=t(null),O=t([]),A=t(!1),q=t(!1),H=t(),N=l((()=>M.value?f:p)),R={page:0,hasMore:!0};async function U(e=!1){if(!R.hasMore)return;R.page++,1==R.page&&(O.value=[]);const{records:n,rows:t}=await P.value({page:R.page});h(t)&&O.value.length<=+n&&(O.value=R.page>1?[...O.value,...t]:t,J(),O.value.length>=+n&&(e&&(A.value=!0),R.hasMore=!1,console.log("没有更多消息了")))}async function _(){var e,n;O.value.unshift({contents:[{role:"user",content:B.sendContent}]}),null==(e=D.value)||e.scrollTo({top:0,behavior:"auto"}),J();const t=B.selectedCommand,l=B.selectedPrompt;B.selectedCommand=null,B.selectedPrompt=null;const o=await L.value({content:B.sendContent,contentType:"text",command:t,prompt:l,patient:B.selectedPatient});h(null==o?void 0:o.contents)&&(O.value.unshift(o),await i(),null==(n=D.value)||n.scrollTo({top:0,behavior:"auto"})),B.selectedPatientLabel="",B.selectedPatientForm=null,B.sending=!1,B.loading=!1,B.sendContent=""}function F(e,n,t){if(e.type!==n){if(e.childrens&&e.childrens.length)for(let l=0;l<e.childrens.length;l++)F(e.childrens[l],n,t)}else t.push(e)}function J(){O.value.forEach((e=>{e.contents.forEach((e=>{var n;if(Reflect.has(e,"disabled")||(e.disabled=!0),"json"===e.contentType&&"string"!=typeof e.content){const{settings:t,data:l,needConfirms:o}=e.content;if(o||!(null==t?void 0:t.setting)||!w(null==t?void 0:t.setting)||!(null==(n=null==l?void 0:l.buttonList)?void 0:n.length))return;const{templates:s=[]}=JSON.parse(t.setting),a=[];s.forEach((e=>{F(e,"BUTTON",a)})),a.forEach((e=>{const{buttonList:n}=e.setting;n.forEach((e=>{var n;const{conditions:t=[]}=(null==(n=null==e?void 0:e.advancedConfig)?void 0:n.disabled)||{};t.length&&(l[e.id+"Disabled"]="1")}))}))}}))}))}function G(e,n,t,l){const{contentType:o,content:a}=n;return"json"===o&&a?s(y,{selectParams:{taskId:e.taskId,instructionId:e.instructionId},msgItem:n,configs:t,msgId:l,"onButton-click":(t={})=>function(e){var n;const{item:t,msgItem:l,showMore:o}=e;return o?(H.value={item:t,msgItem:l},void(q.value=!0)):l?(T("button-click",e),void(l.disabled=!0)):void(t.link||(B.sendContent=(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.27"))||"确定",B.sending=!0,B.loading=!0))}({item:e,msgItem:n,...t})},null):null}function K(e,n){const{contents:t=[],buttonType:l="",configs:o={},msgId:a=""}=e,i=G(e,t[n],o,a);if(i)return i;return[t[n].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:s("br",null,null)]))]}function Q({role:e=""}){return"user"===e}function V(){var e;let n;return s("div",{class:"message-item"},[s(r,{round:!0,size:M.value?64:40,src:N.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[a((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.192"))||"Hi,我是你的AI助理")]),s("p",null,[a("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),a("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),h(S.value)&&S.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[a("你可以试着问我:")]),s(c,{"wrap-item":!1},j(n=S.value.map((e=>s(v,{size:"large",secondary:!0,onClick:()=>B.sendContent=e,disabled:B.loading},j(e)?e:{default:()=>[e]}))))?n:{default:()=>[n]})]:null])])])}return C(D,(()=>{U()}),z.value?"bottom":"top"),U(!0),o((()=>B.externalData),(e=>{var n,t;e&&(n=e,O.value.unshift(n),null==(t=D.value)||t.scrollTo({top:0,behavior:"auto"}),B.loading=!1,B.externalData=null)})),o((()=>B.sending),(e=>{var n,t,l,o,s,a;if(e){if(O.value.length>0&&["确认",(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.27"))||"确定"].includes(B.sendContent)){const e=null==(o=null==(t=O.value[0])?void 0:t.contents)?void 0:o[(null==(l=O.value[0].contents)?void 0:l.length)-1];return(null==(s=e.content)?void 0:s.body)&&!e.disabled?(null==(a=document.getElementById(O.value[0].msgId))||a.click(),void setTimeout((()=>{O.value.unshift({contents:[{role:"user",content:B.sendContent}]}),B.selectedCommand=null,B.selectedPrompt=null,B.sending=!1,B.sendContent=""}))):void _()}_()}})),()=>[s("section",{class:"chat-main",ref:D,style:{"flex-direction":z.value?"column":"column-reverse"}},[[B.loading?s("div",{class:"message-item"},[[M.value?null:s(r,{round:!0,size:40,src:N.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(d,{size:22,stroke:"#4170EE"},null),s("span",null,[a("正在加载中,请稍等...")])])])]]):null,O.value.map((e=>e.contents.map(((n,t)=>s("div",{class:"message-item"},[[M.value?null:s(r,{round:!0,size:40,src:Q(n)?E.value:N.value},null),s("div",{class:["content-box",Q(n)?"mine":""]},[s("div",{class:"content"},[b(n.render)?n.render():K(e,t)])])]]))))),A.value?V():null]]),s(I,{show:q.value,"onUpdate:show":e=>q.value=e,data:H.value},null)]}});export{x as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as a,reactive as
|
1
|
+
import{defineComponent as e,inject as a,reactive as l,ref as n,openBlock as t,createBlock as o,unref as u,withCtx as i,createVNode as d,createTextVNode as r,toDisplayString as w}from"vue";import{NDrawer as s,NDrawerContent as v,NForm as g,NFormItem as c,NRadioGroup as f,NRadio as p,NSelect as y,NButton as b}from"naive-ui";import{isFunction as m,isArray as h}from"lodash-es";import{InjectionAIChat as C}from"../types/index.js";var L=e({__name:"ChatPatient",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:L}){var B;const{patientInfo:_,state:k}=a(C),I=l({businessType:"CLINICIAN",vaa01:null,bck03a:""}),P={businessType:{required:!0,trigger:"change",message:"请选择类型"},vaa01:{required:!0,trigger:["blur","change"],message:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.201"))||"请选择患者"}},T=n([]),q=n();function N(e){var a,l,n,t;const{bcq04b:o,vae96:u}=e,i="1"==u?(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.203"))||"男":"2"==u?(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.204"))||"女":(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.205"))||"未知";let d="";o&&(d+=o+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.191"))||"床"));const r=a=>{e[a]&&(d+=(!d||d.endsWith("/")?"":"/")+e[a])};return r("vaa05"),d+="/"+i,r("vae87"),r("bck02a"),d.startsWith("/")&&(d=d.slice(1)),d}function A(e,a){I.bck03a=a.bck03a}async function x(e){var a;if(m(null==(a=_.value)?void 0:a.queryPatient))try{const a=await _.value.queryPatient({keyword:e,businessType:I.businessType});if(h(a))return void(T.value=a);T.value=[]}catch(e){T.value=[]}}function S(){I.vaa01=null,I.bck03a="",x("")}function U(e){var a;e.preventDefault(),null==(a=q.value)||a.validate((e=>{if(!e){const e={...I,...T.value.find((e=>e.vaa01===I.vaa01))};k.showPatient?(k.selectedPatientLabel=N(e),k.selectedPatientForm=e):k.selectedPatient=e,L("update:show",!1)}}))}return x(""),(a,l)=>(t(),o(u(s),{placement:"bottom",height:"300","trap-focus":!1,to:"#"+u(k).id,show:e.show,onMaskClick:l[2]||(l[2]=()=>L("update:show",!1))},{default:i((()=>[d(u(v),null,{default:i((()=>[d(u(g),{ref_key:"formRef",ref:q,"label-placement":"left","label-width":"auto",size:"large",model:I,"require-mark-placement":"right-hanging",rules:P},{default:i((()=>{var e,a,n;return[d(u(c),{label:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.197"))||"业务",path:"businessType"},{default:i((()=>{var e;return[d(u(f),{value:I.businessType,"onUpdate:value":[l[0]||(l[0]=e=>I.businessType=e),S],name:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.197"))||"业务"},{default:i((()=>[d(u(p),{value:"CLINICIAN"},{default:i((()=>{var e;return[r((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.198"))||"门诊")]})),_:1}),d(u(p),{value:"HOSPITAL"},{default:i((()=>{var e;return[r((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.199"))||"住院")]})),_:1})])),_:1},8,["value"])]})),_:1}),d(u(c),{label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.200"))||"患者",path:"vaa01"},{default:i((()=>{var e;return[d(u(y),{to:"body",remote:"",value:I.vaa01,"onUpdate:value":[l[1]||(l[1]=e=>I.vaa01=e),A],placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.201"))||"请选择患者",filterable:"",options:T.value,"render-label":N,"value-field":"vaa01",onSearch:x},null,8,["value","options"])]})),_:1}),d(u(c),{label:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.202"))||"科室"},{default:i((()=>[r(w(I.bck03a),1)])),_:1}),d(u(c),null,{default:i((()=>[d(u(b),{block:"",type:"primary",onClick:U},{default:i((()=>{var e;return[r((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})]})),_:1},8,["model"])])),_:1})])),_:1},8,["to","show"]))}});export{L as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{createElementVNode as e,defineComponent as o,inject as t,ref as a,computed as l,watch as n,openBlock as r,createBlock as s,unref as p,withCtx as u,createVNode as i,createElementBlock as c,Fragment as d,renderList as m,toDisplayString as v,withDirectives as h,vShow as f}from"vue";import{NDrawer as w,NDrawerContent as g,NButton as k,NIcon as C,NInput as y}from"naive-ui";import{CloseOutline as _,SearchOutline as j}from"@vicons/ionicons5";import{isFunction as x}from"lodash-es";import"../../../../shared/utils/index.js";import{useDebounceFn as M}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as b}from"../../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as B}from"../types/index.js";var L;const P={class:"title"},R=e("span",null,(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.206"))||"发现提示词",-1),S=["onClick"];var U=o({__name:"ChatPrompt",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:L}){const U=o,q={page:0,hasMore:!0},{queryPrompt:z,state:H}=t(B),I=a(),O=a(""),T=a([]),$=l((()=>!T.value.length&&!!(O.value||"").replace(/^\s+|\s+$/g,""))),A=M(E,500);async function D(){try{if(!q.hasMore||!x(z.value))return;q.page++,1==q.page&&(T.value=[]);const e=await z.value({keyword:O.value,page:q.page});T.value.length<=+e.records&&(T.value=q.page>1?T.value.concat(e.rows):e.rows,T.value.length>=+e.records&&(q.hasMore=!1))}catch(e){}}function E(){Object.assign(q,{page:0,hasMore:!0}),D()}return b(I,(()=>{D()})),n((()=>U.show),(e=>{e&&(O.value="",E())})),(t,a)=>(r(),s(p(w),{placement:"bottom",height:"70%","trap-focus":!1,to:"#"+p(H).id,show:o.show,"content-class":"prompt-wrapper",onMaskClick:a[2]||(a[2]=()=>L("update:show",!1))},{default:u((()=>[i(p(g),null,{header:u((()=>[e("div",P,[R,i(p(k),{text:"",onClick:a[0]||(a[0]=()=>L("update:show",!1))},{default:u((()=>[i(p(C),{size:"20",component:p(_)},null,8,["component"])])),_:1})]),i(p(y),{ref:"inputRef",clearable:"",autofocus:"",value:O.value,"onUpdate:value":[a[1]||(a[1]=e=>O.value=e),p(A)]},{prefix:u((()=>[i(p(C),{component:p(j)},null,8,["component"])])),_:1},8,["value","onUpdate:value"])])),default:u((()=>{var o;return[e("div",{class:"list-wrapper",ref_key:"listRef",ref:I},[(r(!0),c(d,null,m(T.value,(o=>(r(),c("div",{class:"item",key:o.promptId,onClick:()=>function(e){L("update:show",!1),H.selectedPrompt=e,H.sendContent=e.promptContent}(o)},[e("p",null,v(o.promptTitle),1),e("p",null,v(o.promptContent),1)],8,S)))),128)),h(e("div",null,(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.81"))||"找不到相关的结果",512),[[f,p($)]])],512)]})),_:1})])),_:1},8,["to","show"]))}});export{U as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{createElementVNode as o,defineComponent as e,openBlock as s,createBlock as t,unref as r,normalizeStyle as i,withCtx as n,toDisplayString as a,createVNode as c}from"vue";import{NModal as l,NIcon as p}from"naive-ui";import{Mic as m}from"@vicons/ionicons5";import{useTheme as d}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"../../../../shared/hooks/useScrollLoading.js";var u;const f={class:"c-recording-wrapper"},h={class:"content"},v=o("div",{class:"animation"},null,-1),g=o("p",{class:"tip"},(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.141"))||"按下空格键停止录音",-1);var k=e({__name:"recording",props:{content:{type:String,default:""}},emits:["close"],setup(e,{emit:u}){const k=d();function w(){u("close")}return(d,u)=>(s(),t(r(l),{style:i(r(k))},{default:n((()=>[o("div",f,[o("p",h,a(e.content||"正在聆听..."),1),v,o("div",{class:"icon-box",onClick:w},[c(r(p),{size:"60",color:"#fff",component:r(m)},null,8,["component"])]),g])])),_:1},8,["style"]))}});export{k as default};
|