cnhis-design-vue 3.3.1-beta.3 → 3.3.1-beta.44
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/es/components/ai-chat/index.d.ts +289 -68
- package/es/components/ai-chat/src/Index.vue.d.ts +289 -68
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/api/index.d.ts +5 -3
- package/es/components/ai-chat/src/api/index.js +1 -1
- package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +9 -15
- package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +46 -55
- 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/ChatMainDefault.js +1 -0
- package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +6 -5
- package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
- package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
- package/es/components/ai-chat/src/components/{card/SelectIcon.d.ts → message-render/CardRender.d.ts} +9 -7
- package/es/components/ai-chat/src/components/message-render/CardRender.js +1 -0
- package/es/components/ai-chat/src/components/message-render/FormRender.d.ts +16 -0
- package/es/components/ai-chat/src/components/message-render/FormRender.js +1 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.d.ts +36 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.js +1 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue2.js +1 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.d.ts +105 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.js +1 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue2.js +1 -0
- package/es/components/ai-chat/src/components/svgs/AddIcon.vue.js +1 -0
- package/es/components/ai-chat/src/components/svgs/AudioIcon.vue.js +1 -0
- package/es/components/ai-chat/src/components/svgs/KeyboardIcon.vue.js +1 -0
- package/es/components/ai-chat/src/components/svgs/MicroPhone.vue.js +1 -0
- package/es/components/ai-chat/src/hooks/index.d.ts +2 -0
- package/es/components/ai-chat/src/hooks/index.js +1 -0
- package/es/components/ai-chat/src/hooks/useChartAudioContext.d.ts +18 -0
- package/es/components/ai-chat/src/hooks/useChartAudioContext.js +1 -0
- package/es/components/ai-chat/src/hooks/useData.d.ts +77 -0
- package/es/components/ai-chat/src/hooks/useData.js +1 -0
- package/es/components/ai-chat/src/hooks/useFooterContext.d.ts +38 -0
- package/es/components/ai-chat/src/hooks/useFooterContext.js +1 -0
- package/es/components/ai-chat/src/hooks/useProgram.d.ts +12 -4
- package/es/components/ai-chat/src/hooks/useProgram.js +1 -1
- package/es/components/ai-chat/src/hooks/useSSE.d.ts +9 -0
- package/es/components/ai-chat/src/hooks/useSSE.js +1 -0
- package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +3 -1
- package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -1
- package/es/components/ai-chat/src/types/index.d.ts +1 -3
- package/es/components/ai-chat/src/types/index.js +1 -1
- package/es/components/ai-chat/src/utils/index.d.ts +6 -1
- package/es/components/ai-chat/src/utils/index.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/audio-sdk/index.d.ts +274 -2
- package/es/components/audio-sdk/index.js +1 -1
- package/es/components/audio-sdk/src/Index.vue.d.ts +274 -0
- package/es/components/audio-sdk/src/Index.vue.js +1 -0
- package/es/components/audio-sdk/src/Index.vue2.js +1 -0
- package/es/components/audio-sdk/src/audioSDK.d.ts +59 -26
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/form.vue.d.ts +51 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +100 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.js +1 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue2.js +1 -0
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +53 -4
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/audio-sdk/src/utils/index.d.ts +7 -0
- package/es/components/audio-sdk/src/utils/index.js +1 -0
- package/es/components/audio-sdk/src/utils/recordingModal.d.ts +7 -4
- package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
- package/es/components/audio-sdk/style/index.css +1 -1
- package/es/components/button-print/index.d.ts +30 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +2 -2
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/calendar/index.d.ts +126 -3
- package/es/components/calendar/src/Calendar.vue.d.ts +126 -2
- package/es/components/callback/src/components/render/popupMaps.d.ts +7 -1
- package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +4 -8
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/card-render/src/components/Button.vue.d.ts +3 -0
- package/es/components/card-render/src/components/Button.vue2.js +1 -1
- package/es/components/card-render/src/components/ScaleView.vue.d.ts +39 -0
- package/es/components/card-render/src/components/ScaleView.vue.js +1 -0
- package/es/components/card-render/src/components/ScaleView.vue2.js +1 -0
- package/es/components/card-render/src/components/Table.vue.d.ts +104 -0
- package/es/components/card-render/src/components/Table.vue.js +1 -0
- package/es/components/card-render/src/components/Table.vue2.js +1 -0
- package/es/components/card-render/src/components/Text.vue.d.ts +1 -0
- package/es/components/card-render/src/components/Text.vue2.js +1 -1
- package/es/components/card-render/src/components/index.d.ts +139 -0
- package/es/components/card-render/src/components/index.js +1 -1
- package/es/components/card-render/src/constants/index.d.ts +4 -1
- package/es/components/card-render/src/constants/index.js +1 -1
- package/es/components/card-render/style/index.css +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/index.d.ts +6 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +6 -2
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/field-editor/index.d.ts +7 -1
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +7 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +73 -13
- package/es/components/form-config/src/FormConfig.vue.d.ts +73 -13
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +7 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +45 -9
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +15 -3
- package/es/components/form-render/index.d.ts +7 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +7 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -1
- package/es/components/form-render/src/components/renderer/date.d.ts +4 -2
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/input.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/input.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.d.ts +9 -0
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +14 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +14 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +12 -1
- package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
- package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +9 -3
- package/es/components/form-render/src/types/index.d.ts +2 -0
- 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/form-render/style/index.css +1 -1
- package/es/components/guide/src/renderer.d.ts +2 -2
- package/es/components/iho-chat/index.d.ts +206 -4
- package/es/components/iho-chat/src/Index.vue.d.ts +206 -4
- 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 +8 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +11 -3
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +7 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +96 -2
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +77 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +71 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +8 -2
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +10 -0
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +70 -1
- package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +7 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +3 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +9 -2
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useSearchPatientList.d.ts +11 -0
- package/es/components/iho-chat/src/hooks/useSearchPatientList.js +1 -0
- package/es/components/iho-chat/src/utils/chatSock.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +6 -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/index.d.ts +3 -0
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -3
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
- package/es/components/iho-table/src/hooks/useTablePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.d.ts +79 -3
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +7 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/types/pluginType.d.ts +2 -2
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +24 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +24 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +7 -1
- package/es/components/scale-view/index.d.ts +17 -3
- package/es/components/scale-view/src/ScaleView.vue.d.ts +17 -3
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.d.ts +3 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -2189
- package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +15 -3
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +15 -3
- package/es/components/steps-wheel/index.d.ts +18 -0
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +18 -0
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/shared/assets/img/use.png.js +1 -1
- package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +1 -0
- package/es/shared/components/ArrowIcon/index.d.ts +2 -0
- package/es/shared/components/ArrowIcon/index.js +1 -0
- package/es/shared/components/DateIcon/DateIcon.vue.js +1 -0
- package/es/shared/components/DateIcon/index.d.ts +2 -0
- package/es/shared/components/DateIcon/index.js +1 -0
- package/es/shared/hooks/useLevelSearchCascader.d.ts +1 -0
- package/es/shared/hooks/useLevelSearchCascader.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +5 -3
- package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
- package/es/components/ai-chat/src/components/card/SelectIcon.js +0 -1
- /package/es/components/ai-chat/src/components/{ChatMainInner.d.ts → ChatMainDefault.d.ts} +0 -0
@@ -0,0 +1,104 @@
|
|
1
|
+
import { AnyObject } from '../../../../shared/types';
|
2
|
+
import { PropType } from 'vue';
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
4
|
+
config: {
|
5
|
+
type: PropType<AnyObject>;
|
6
|
+
default: () => {};
|
7
|
+
};
|
8
|
+
data: {
|
9
|
+
type: PropType<AnyObject>;
|
10
|
+
};
|
11
|
+
}, {
|
12
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
13
|
+
config: {
|
14
|
+
type: PropType<AnyObject>;
|
15
|
+
default: () => {};
|
16
|
+
};
|
17
|
+
data: {
|
18
|
+
type: PropType<AnyObject>;
|
19
|
+
};
|
20
|
+
}>> & {}>>;
|
21
|
+
dataList: import("vue").ComputedRef<AnyObject[]>;
|
22
|
+
columns: import("vue").ComputedRef<AnyObject[]>;
|
23
|
+
createLinkProps: (linkConfig: AnyObject, row: AnyObject, col: AnyObject) => {
|
24
|
+
setting: {
|
25
|
+
buttonList: {
|
26
|
+
customTitle: any;
|
27
|
+
props: {
|
28
|
+
text: boolean;
|
29
|
+
color: string;
|
30
|
+
type: string;
|
31
|
+
style: {
|
32
|
+
padding: number;
|
33
|
+
};
|
34
|
+
};
|
35
|
+
advancedConfig: {
|
36
|
+
eventConfig: AnyObject;
|
37
|
+
};
|
38
|
+
}[];
|
39
|
+
};
|
40
|
+
};
|
41
|
+
parseTemplateString: (str: string) => string;
|
42
|
+
NCheckbox: any;
|
43
|
+
RenderButton: import("vue").DefineComponent<{
|
44
|
+
config: {
|
45
|
+
default: () => {};
|
46
|
+
type: PropType<AnyObject>;
|
47
|
+
};
|
48
|
+
data: {
|
49
|
+
default: () => {};
|
50
|
+
type: PropType<AnyObject>;
|
51
|
+
};
|
52
|
+
}, {
|
53
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
54
|
+
config: {
|
55
|
+
default: () => {};
|
56
|
+
type: PropType<AnyObject>;
|
57
|
+
};
|
58
|
+
data: {
|
59
|
+
default: () => {};
|
60
|
+
type: PropType<AnyObject>;
|
61
|
+
};
|
62
|
+
}>> & {}>>;
|
63
|
+
emit: (event: string, ...args: any[]) => void;
|
64
|
+
attrs: {
|
65
|
+
[x: string]: unknown;
|
66
|
+
};
|
67
|
+
setting: import("vue").ComputedRef<any>;
|
68
|
+
showButtonList: import("vue").ComputedRef<any>;
|
69
|
+
containerFlexStyle: import("vue").ComputedRef<any>;
|
70
|
+
noMargin: (buttonItem: AnyObject, index: number) => any;
|
71
|
+
getButtonDisabledStatus: (button: AnyObject) => false | {
|
72
|
+
disabled: boolean;
|
73
|
+
title: any;
|
74
|
+
};
|
75
|
+
getDisabledText: (button: AnyObject) => any;
|
76
|
+
getButtonStyle: (button: AnyObject) => AnyObject;
|
77
|
+
getButtonProps: (button: AnyObject) => any;
|
78
|
+
handleButtonClick: (button: AnyObject) => void;
|
79
|
+
NButton: any;
|
80
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
81
|
+
config: {
|
82
|
+
default: () => {};
|
83
|
+
type: PropType<AnyObject>;
|
84
|
+
};
|
85
|
+
data: {
|
86
|
+
default: () => {};
|
87
|
+
type: PropType<AnyObject>;
|
88
|
+
};
|
89
|
+
}>>, {
|
90
|
+
data: AnyObject;
|
91
|
+
config: AnyObject;
|
92
|
+
}>;
|
93
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
94
|
+
config: {
|
95
|
+
type: PropType<AnyObject>;
|
96
|
+
default: () => {};
|
97
|
+
};
|
98
|
+
data: {
|
99
|
+
type: PropType<AnyObject>;
|
100
|
+
};
|
101
|
+
}>>, {
|
102
|
+
config: AnyObject;
|
103
|
+
}>;
|
104
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import e from"./Table.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var l=r(e,[["__file","Table.vue"]]);export{l as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,computed as t,openBlock as n,createElementBlock as l,createElementVNode as a,Fragment as r,renderList as i,unref as d,normalizeStyle as o,toDisplayString as c,createCommentVNode as u,createVNode as f,withDirectives as s,createBlock as g,vShow as y}from"vue";import{isString as p,isArray as v,property as _}from"lodash-es";import{NCheckbox as k}from"naive-ui";import b from"./Button.vue.js";const h={class:"c-card-render__table"},m={key:0,class:"c-card-render__table__cell__content__text"},C={key:0,style:{"text-align":"center"}},x={key:1,style:{"text-align":"center"}},L={key:4};var D=e({__name:"Table",props:{config:{type:Object,default:()=>({})},data:{type:Object}},setup(e){const D=e,j=t((()=>{var e,t;const n=null==(e=D.config.setting)?void 0:e.dataKey;if(!j)return[];try{let e=null==(t=D.data)?void 0:t[n];return p(e)?(D.data[n]=JSON.parse(e),D.data[n]):v(e)?e:[]}catch(e){return[]}})),O=t((()=>{var e,t;return null!=(t=null==(e=D.config.setting)?void 0:e.columns)?t:[]}));function T(e,t,n){return{setting:{buttonList:[{customTitle:t[n.field],props:{text:!0,color:"#5585f5",type:"default",style:{padding:0}},advancedConfig:{eventConfig:e}}]}}}function U(e){return p(e)?e.replace(/\$\{(.*?)}/g,((e,t)=>{if(!p(t))return t;const n=_(t.trim())(D.data);return null==n?"":p(n)?n:n+""})):""}return(t,p)=>(n(),l("section",h,[a("table",null,[a("thead",null,[a("tr",null,[(n(!0),l(r,null,i(d(O),(e=>(n(),l("th",{key:e.field},[a("div",{class:"c-card-render__table__cell",style:o(e.style)},[e.field?(n(),l("div",m,c(U(e.title)),1)):u("v-if",!0)],4)])))),128))])]),a("tbody",null,[(n(!0),l(r,null,i(d(j),((t,a)=>(n(),l("tr",{key:a},[(n(!0),l(r,null,i(d(O),(r=>{var i,o,u,p;return n(),l("td",{key:r.field},["seq"===r.type?(n(),l("div",C,c(a+1),1)):"checkbox"===r.type?(n(),l("div",x,[f(d(k),{checked:t.__checked,"onUpdate:checked":e=>t.__checked=e},null,8,["checked","onUpdate:checked"])])):(null==(i=r.renderConfig)?void 0:i.isLink)?s((n(),g(b,{key:2,config:T(r.renderConfig.linkConfig,t,r),data:t,fullData:e.data},null,8,["config","data","fullData"])),[[y,null!=t[r.field]]]):(null==(u=null==(o=r.renderConfig)?void 0:o.buttonList)?void 0:u.length)?(n(),g(b,{key:3,config:{setting:{buttonList:null==(p=r.renderConfig)?void 0:p.buttonList}},data:t,fullData:e.data},null,8,["config","data","fullData"])):(n(),l("span",L,c(U(t[r.field])),1))])})),128))])))),128))])])]))}});export{D as default};
|
@@ -24,6 +24,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
24
24
|
handleModuleClick: (data: AnyObject) => void;
|
25
25
|
containerTextStyle: import("vue").ComputedRef<any>;
|
26
26
|
showClass: import("vue").ComputedRef<any>;
|
27
|
+
displayText: import("vue").ComputedRef<any>;
|
27
28
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
28
29
|
config: {
|
29
30
|
default: () => {};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as t,openBlock as
|
1
|
+
import{defineComponent as e,computed as t,openBlock as r,createElementBlock as o,normalizeClass as a,unref as n,normalizeStyle as l,withModifiers as s,toDisplayString as i}from"vue";import{isString as u,property as d}from"lodash-es";import{getRealWidth as c,transNumberToPx as p}from"../utils/index.js";import{useCommon as f}from"../hooks/useCommon.js";var m=e({__name:"Text",props:{config:{default:()=>({}),type:Object},data:{default:()=>({}),type:Object}},setup(e){const m=e,{setting:x,handleModuleClick:v}=f(m),b=t((()=>{const{containerStyle:e={},style:t={},unitConfig:r={}}=x.value||{},o=c(e,r);return{"font-size":"14px",...p(e),...p(t),width:o,"box-sizing":"border-box"}})),g=t((()=>{let e=x.value.containerClass||"";return x.value.prefixBar&&(e=`c-card-render__bar ${e}`),e})),y=t((()=>{let e=x.value.text;return u(e)?(e=e.replace(/\$\{(.*?)}/g,((e,t)=>{if(!u(t))return t;const r=d(t.trim())(m.data);return null==r?"":u(r)?r:r+""})),e):e}));return(t,u)=>(r(),o("div",{class:a(n(g)),style:l(n(b)),onClick:u[0]||(u[0]=s((()=>n(v)(e.data)),["stop"]))},i(n(y)),7))}});export{m as default};
|
@@ -333,6 +333,9 @@ declare function getComponent(type: COMPONENT_TYPE): import("vue").DefineCompone
|
|
333
333
|
};
|
334
334
|
}>> & {}>>;
|
335
335
|
emit: (event: string, ...args: any[]) => void;
|
336
|
+
attrs: {
|
337
|
+
[x: string]: unknown;
|
338
|
+
};
|
336
339
|
setting: import("vue").ComputedRef<any>;
|
337
340
|
showButtonList: import("vue").ComputedRef<any>;
|
338
341
|
containerFlexStyle: import("vue").ComputedRef<any>;
|
@@ -382,6 +385,7 @@ declare function getComponent(type: COMPONENT_TYPE): import("vue").DefineCompone
|
|
382
385
|
handleModuleClick: (data: import("../../../../shared/types").AnyObject) => void;
|
383
386
|
containerTextStyle: import("vue").ComputedRef<any>;
|
384
387
|
showClass: import("vue").ComputedRef<any>;
|
388
|
+
displayText: import("vue").ComputedRef<any>;
|
385
389
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
386
390
|
config: {
|
387
391
|
default: () => {};
|
@@ -526,5 +530,140 @@ declare function getComponent(type: COMPONENT_TYPE): import("vue").DefineCompone
|
|
526
530
|
}>>, {
|
527
531
|
data: import("../../../../shared/types").AnyObject;
|
528
532
|
config: import("../../../../shared/types").AnyObject;
|
533
|
+
}> | import("vue").DefineComponent<{
|
534
|
+
config: {
|
535
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
536
|
+
default: () => {};
|
537
|
+
};
|
538
|
+
data: {
|
539
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
540
|
+
};
|
541
|
+
}, {
|
542
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
543
|
+
config: {
|
544
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
545
|
+
default: () => {};
|
546
|
+
};
|
547
|
+
data: {
|
548
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
549
|
+
};
|
550
|
+
}>> & {}>>;
|
551
|
+
dataList: import("vue").ComputedRef<import("../../../../shared/types").AnyObject[]>;
|
552
|
+
columns: import("vue").ComputedRef<import("../../../../shared/types").AnyObject[]>;
|
553
|
+
createLinkProps: (linkConfig: import("../../../../shared/types").AnyObject, row: import("../../../../shared/types").AnyObject, col: import("../../../../shared/types").AnyObject) => {
|
554
|
+
setting: {
|
555
|
+
buttonList: {
|
556
|
+
customTitle: any;
|
557
|
+
props: {
|
558
|
+
text: boolean;
|
559
|
+
color: string;
|
560
|
+
type: string;
|
561
|
+
style: {
|
562
|
+
padding: number;
|
563
|
+
};
|
564
|
+
};
|
565
|
+
advancedConfig: {
|
566
|
+
eventConfig: import("../../../../shared/types").AnyObject;
|
567
|
+
};
|
568
|
+
}[];
|
569
|
+
};
|
570
|
+
};
|
571
|
+
parseTemplateString: (str: string) => string;
|
572
|
+
NCheckbox: any;
|
573
|
+
RenderButton: import("vue").DefineComponent<{
|
574
|
+
config: {
|
575
|
+
default: () => {};
|
576
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
577
|
+
};
|
578
|
+
data: {
|
579
|
+
default: () => {};
|
580
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
581
|
+
};
|
582
|
+
}, {
|
583
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
584
|
+
config: {
|
585
|
+
default: () => {};
|
586
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
587
|
+
};
|
588
|
+
data: {
|
589
|
+
default: () => {};
|
590
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
591
|
+
};
|
592
|
+
}>> & {}>>;
|
593
|
+
emit: (event: string, ...args: any[]) => void;
|
594
|
+
attrs: {
|
595
|
+
[x: string]: unknown;
|
596
|
+
};
|
597
|
+
setting: import("vue").ComputedRef<any>;
|
598
|
+
showButtonList: import("vue").ComputedRef<any>;
|
599
|
+
containerFlexStyle: import("vue").ComputedRef<any>;
|
600
|
+
noMargin: (buttonItem: import("../../../../shared/types").AnyObject, index: number) => any;
|
601
|
+
getButtonDisabledStatus: (button: import("../../../../shared/types").AnyObject) => false | {
|
602
|
+
disabled: boolean;
|
603
|
+
title: any;
|
604
|
+
};
|
605
|
+
getDisabledText: (button: import("../../../../shared/types").AnyObject) => any;
|
606
|
+
getButtonStyle: (button: import("../../../../shared/types").AnyObject) => import("../../../../shared/types").AnyObject;
|
607
|
+
getButtonProps: (button: import("../../../../shared/types").AnyObject) => any;
|
608
|
+
handleButtonClick: (button: import("../../../../shared/types").AnyObject) => void;
|
609
|
+
NButton: any;
|
610
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
611
|
+
config: {
|
612
|
+
default: () => {};
|
613
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
614
|
+
};
|
615
|
+
data: {
|
616
|
+
default: () => {};
|
617
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
618
|
+
};
|
619
|
+
}>>, {
|
620
|
+
data: import("../../../../shared/types").AnyObject;
|
621
|
+
config: import("../../../../shared/types").AnyObject;
|
622
|
+
}>;
|
623
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
624
|
+
config: {
|
625
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
626
|
+
default: () => {};
|
627
|
+
};
|
628
|
+
data: {
|
629
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
630
|
+
};
|
631
|
+
}>>, {
|
632
|
+
config: import("../../../../shared/types").AnyObject;
|
633
|
+
}> | import("vue").DefineComponent<{
|
634
|
+
config: {
|
635
|
+
default: () => {};
|
636
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
637
|
+
};
|
638
|
+
data: {
|
639
|
+
default: () => {};
|
640
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
641
|
+
};
|
642
|
+
}, {
|
643
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
644
|
+
config: {
|
645
|
+
default: () => {};
|
646
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
647
|
+
};
|
648
|
+
data: {
|
649
|
+
default: () => {};
|
650
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
651
|
+
};
|
652
|
+
}>> & {}>>;
|
653
|
+
formItems: import("vue").ComputedRef<any[]>;
|
654
|
+
getItemTitle: (formItem: import("../../../../shared/types").AnyObject, formItemIndex: number) => string;
|
655
|
+
NSelect: any;
|
656
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
657
|
+
config: {
|
658
|
+
default: () => {};
|
659
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
660
|
+
};
|
661
|
+
data: {
|
662
|
+
default: () => {};
|
663
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
664
|
+
};
|
665
|
+
}>>, {
|
666
|
+
data: import("../../../../shared/types").AnyObject;
|
667
|
+
config: import("../../../../shared/types").AnyObject;
|
529
668
|
}>;
|
530
669
|
export { Field, Row, Label, getComponent };
|
@@ -1 +1 @@
|
|
1
|
-
import{defineAsyncComponent as o}from"vue";import{COMPONENT_TYPE as
|
1
|
+
import{defineAsyncComponent as o}from"vue";import{COMPONENT_TYPE as e}from"../constants/index.js";const t=o((()=>import("./Field.vue.js"))),i=o((()=>import("./FieldGroup.vue.js"))),r=o((()=>import("./Row.vue.js"))),m=o((()=>import("./Label.vue.js"))),p=o((()=>import("./Button.vue.js"))),s=o((()=>import("./Text.vue.js"))),u=o((()=>import("./Divider.vue.js"))),j=o((()=>import("./Box.vue.js"))),v=o((()=>import("./Slot.js"))),E=o((()=>import("./Image.vue.js"))),I=o((()=>import("./Table.vue.js"))),T=o((()=>import("./ScaleView.vue.js"))),n={[e.FIELD]:t,[e.FIELD_COMBINATION]:i,[e.ROW]:r,[e.LABEL]:m,[e.BUTTON]:p,[e.TEXT]:s,[e.DIVIDER]:u,[e.BOX]:j,[e.SLOT]:v,[e.IMAGE]:E,[e.TABLE]:I,[e.SCALE_VIEW]:T};function L(o){return n[o]}export{t as Field,m as Label,r as Row,L as getComponent};
|
@@ -12,5 +12,8 @@ export declare enum COMPONENT_TYPE {
|
|
12
12
|
DIVIDER = "DIVIDER",
|
13
13
|
BOX = "BOX",
|
14
14
|
SLOT = "SLOT",
|
15
|
-
IMAGE = "IMG"
|
15
|
+
IMAGE = "IMG",
|
16
|
+
TABLE = "TABLE",
|
17
|
+
SCALE_VIEW = "SCALE_VIEW"
|
16
18
|
}
|
19
|
+
export type SCALE_FORM_TYPE = 'EVALUATE_CHECKBOX_BLOCK' | 'EVALUATE_INPUT' | 'EVALUATE_SELECT' | 'EVALUATE_RADIO_BLOCK' | 'ID_CARD' | 'MOBILE' | 'RADIO_BLOCK' | 'CHECKBOX_BLOCK' | 'SELECT' | 'INPUT' | 'DATETIME';
|
@@ -1 +1 @@
|
|
1
|
-
const
|
1
|
+
const E=Symbol("InjectionTemplateRender"),I=Symbol("InjectionTemplateRenderEmit");var T=(E=>(E.FIELD="FIELD",E.FIELD_COMBINATION="FIELD_COMBINATION",E.LABEL="LABEL",E.ROW="ROW",E.BUTTON="BUTTON",E.TEXT="TEXT",E.DIVIDER="DIVIDER",E.BOX="BOX",E.SLOT="SLOT",E.IMAGE="IMG",E.TABLE="TABLE",E.SCALE_VIEW="SCALE_VIEW",E))(T||{});export{T as COMPONENT_TYPE,E as InjectionTemplateRender,I as InjectionTemplateRenderEmit};
|
@@ -1 +1 @@
|
|
1
|
-
.c-card-render{box-sizing:border-box;color:#000;font-size:0;line-height:1.6}.c-card-render__flex{display:flex}.c-card-render__flexAlignCenter{align-items:center}.c-card-render__flex-wrap{flex-wrap:wrap}.c-card-render__flex1{flex:1}.c-card-render__width100{width:100%}.c-card-render__color60{color:rgba(0,0,0,.6)}.c-card-render__color100{color:#000}.c-card-render__text-ellipsis{-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box!important;overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis;word-break:break-all}.c-card-render__nowrap{white-space:nowrap}.c-card-render__mgr8{margin-right:8px!important}.c-card-render__mgb8{margin-bottom:8px!important}.c-card-render__mgt4{margin-top:4px!important}.c-card-render__mgb4{margin-bottom:4px!important}.c-card-render__un-mgr8{margin-right:-8px!important}.c-card-render__bar{padding-left:8px;position:relative}.c-card-render__bar:before{background:var(--c-primary-color);border-radius:4px;content:"";height:12px;left:0;position:absolute;top:50%;transform:translateY(-50%);width:4px}.c-card-render__inline{display:inline}
|
1
|
+
.c-card-render{box-sizing:border-box;color:#000;font-size:0;line-height:1.6}.c-card-render__flex{display:flex}.c-card-render__flexAlignCenter{align-items:center}.c-card-render__flex-wrap{flex-wrap:wrap}.c-card-render__flex1{flex:1}.c-card-render__width100{width:100%}.c-card-render__color60{color:rgba(0,0,0,.6)}.c-card-render__color100{color:#000}.c-card-render__text-ellipsis{-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box!important;overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis;word-break:break-all}.c-card-render__nowrap{white-space:nowrap}.c-card-render__mgr8{margin-right:8px!important}.c-card-render__mgb8{margin-bottom:8px!important}.c-card-render__mgt4{margin-top:4px!important}.c-card-render__mgb4{margin-bottom:4px!important}.c-card-render__un-mgr8{margin-right:-8px!important}.c-card-render__bar{padding-left:8px;position:relative}.c-card-render__bar:before{background:var(--c-primary-color);border-radius:4px;content:"";height:12px;left:0;position:absolute;top:50%;transform:translateY(-50%);width:4px}.c-card-render__inline{display:inline}.c-card-render__table table{border-collapse:collapse;font-size:12px;margin:8px 0;width:100%}.c-card-render__table td,.c-card-render__table th{border:1px solid #ccc;padding:4px}.c-card-render__scaleForm{font-size:14px}.c-card-render__scaleFormItem{margin-bottom:4px}.c-card-render__scaleFormTitle{font-size:16px}.c-card-render__scaleFormOptions{align-items:center;display:flex;flex-wrap:wrap;gap:16px}.c-card-render__scaleFormOptionWrapper{padding:4px 0 4px 8px}
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as s,isRef as d,createSlots as i,renderList as
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as s,isRef as d,createSlots as i,renderList as c,withCtx as p,renderSlot as y,nextTick as f}from"vue";import{promiseTimeout as v}from"@vueuse/shared";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as h,handleInputEvent as D}from"../../../shared/hooks/useDateTime.js";import{isArray as g,isEqual as w,isString as b,isFunction as k,isNumber as V}from"lodash-es";import"@vue/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{subYears as S,addYears as _,isWithinInterval as A,format as I,sub as M,startOfDay as R,endOfDay as C}from"date-fns";var $=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"},holidays:{type:Array,default:()=>[]},type:{type:String,default:"date"},isDateDisabled:{type:Function}},emits:["update:formatted-value"],setup(e,{expose:$,emit:j}){const F=e,P=t(),U=a(null),q=a(null),x=a();let E="";const H=l({get:()=>W(F.formattedValue)?null:F.formattedValue,set(e){g(e)&&g(E)&&w(E,e)||E===e||(j("update:formatted-value",e,b(e)?Date.parse(e):g(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),E=e)}}),L=l((()=>F.type.includes("datetime"))),B=l((()=>Reflect.get(P,"format")?P.format:L.value?"yyyy-MM-dd HH:mm:ss":"month"===F.type?"yyyy-MM":"year"===F.type?"yyyy":"yyyy-MM-dd")),Y=l((()=>L.value?B.value.split(" "):"")),O=l((()=>{const e=e=>{const t=new Date(e),a=new Date,l=S(a,150),n=_(a,150);return!A(t,{start:l,end:n})};return k(F.isDateDisabled)?(t,...a)=>{var l;return(null==(l=F.isDateDisabled)?void 0:l.call(F,t,...a))||e(t)}:e})),{focus:T,blur:z,handleConfirm:G}=h(U,{formatRef:B,attrs:{...P,type:F.type,isDateDisabled:O.value},emit:j,allowedInvalidValue:F.allowedInvalidValue});async function J(e){!async function(e){var t;if(!e||!F.holidays.length)return;await v(0);const a=null==(t=U.value)?void 0:t.panelInstRef;if(!a)return;const l=a.$el;if(!l)return;N(),"daterange"===F.type?K.push(n((()=>a.startDateArray),".n-date-panel-calendar--start .n-date-panel-dates>div"),n((()=>a.endDateArray),".n-date-panel-calendar--end .n-date-panel-dates>div")):["date","datetime"].includes(F.type)&&K.push(n((()=>a.dateArray),".n-date-panel-calendar .n-date-panel-dates>div"));function n(e,t){const a=[],n=o(e,(e=>{a.forEach((e=>e.classList.remove("c-date-picker__holiday"))),a.length=0,g(e)&&Array.from(l.querySelectorAll(t)).forEach(((t,l)=>{const{ts:n}=e[l]||{};if(!V(n))return;const o=new Date(n);F.holidays.some((e=>e.getDate()===o.getDate()&&e.getMonth()===o.getMonth()&&e.getFullYear()===o.getFullYear()))&&(f((()=>t.classList.add("c-date-picker__holiday"))),a.push(t))}))}),{immediate:!0,deep:!0});return()=>{n(),a.length=0}}}(e),e&&L.value&&(await f(),async function e(t=0){var a;t>2||(q.value=null==(a=U.value)?void 0:a.panelInstRef,q.value?h(q,{formatRef:Y,attrs:{...P,type:F.type,isDateDisabled:O.value},isPanel:!0}):(await f(),e(++t)))}())}const K=[];function N(){K.forEach((e=>e())),K.length=0}async function Q(...e){var t,a,l,n,o,r;const u=null==(n=null==(l=null==(a=null==(t=U.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(F.type.includes("range")?null==(o=F.onConfirm)||o.call(F,...e):(await f(),u.focus(),G(u),u.blur(),null==(r=F.onConfirm)||r.call(F,Date.parse(u.value),u.value)),!(null==u?void 0:u.value)||!F.updateUnchangedValue||F.type.includes("range"))return;const s=u.value;D(u,I(new Date,B.value)),D(u,s)}function W(e){return F.allowedInvalidValue&&F.allowedInvalidValue===e}return n(N),o((()=>F.formattedValue),(e=>{x.value=W(e)?e:F.placeholder?F.placeholder:"选择日期时间",W(e)||(E=e)}),{immediate:!0}),$({$datePicker:U,focus:T,blur:z,setShortcutValue:async function(e){if(!F.type||!F.type.includes("range")||!U.value)return;const t=U.value.$el.querySelectorAll(".n-input__input-el");let a,l;const n=new Date;if("week"===e){const e=M(n,{weeks:1});a=I(R(e),B.value)}else{const e=M(n,{months:1});a=I(R(e),B.value)}l=I(C(n),B.value),D(t[0],a),await f(),D(t[1],l)}}),(t,a)=>(r(),u(s(m),{ref_key:"datePickerRef",ref:U,"onUpdate:show":J,onConfirm:Q,placeholder:x.value,to:e.to,type:e.type,"formatted-value":s(H),"onUpdate:formatted-value":a[0]||(a[0]=e=>d(H)?H.value=e:null),"is-date-disabled":s(O)},i({_:2},[c(t.$slots,((e,a)=>({name:a,fn:p((()=>[y(t.$slots,a)]))})))]),1032,["placeholder","to","type","formatted-value","is-date-disabled"]))}});export{$ as default};
|
@@ -48,7 +48,9 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
48
48
|
};
|
49
49
|
}>> & {
|
50
50
|
onSelect?: ((...args: any[]) => any) | undefined;
|
51
|
+
onError?: ((...args: any[]) => any) | undefined;
|
51
52
|
onChange?: ((...args: any[]) => any) | undefined;
|
53
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
52
54
|
onRemove?: ((...args: any[]) => any) | undefined;
|
53
55
|
onEdit?: ((...args: any[]) => any) | undefined;
|
54
56
|
onAdd?: ((...args: any[]) => any) | undefined;
|
@@ -57,7 +59,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
57
59
|
"onClick:grid"?: ((...args: any[]) => any) | undefined;
|
58
60
|
"onEvent-click"?: ((...args: any[]) => any) | undefined;
|
59
61
|
}>>;
|
60
|
-
emits: (event: "remove" | "edit" | "change" | "add" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", ...args: any[]) => void;
|
62
|
+
emits: (event: "remove" | "edit" | "error" | "change" | "add" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", ...args: any[]) => void;
|
61
63
|
canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
|
62
64
|
canvas: import("vue").Ref<any>;
|
63
65
|
pointTipProps: {
|
@@ -274,7 +276,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
274
276
|
list: unknown[];
|
275
277
|
show: boolean;
|
276
278
|
}>;
|
277
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "edit" | "change" | "add" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click")[], "remove" | "edit" | "change" | "add" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
279
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "edit" | "error" | "change" | "add" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click")[], "remove" | "edit" | "error" | "change" | "add" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
278
280
|
type: {
|
279
281
|
type: import("vue").PropType<import("./src/interface").IType>;
|
280
282
|
default: string;
|
@@ -299,7 +301,9 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
299
301
|
};
|
300
302
|
}>> & {
|
301
303
|
onSelect?: ((...args: any[]) => any) | undefined;
|
304
|
+
onError?: ((...args: any[]) => any) | undefined;
|
302
305
|
onChange?: ((...args: any[]) => any) | undefined;
|
306
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
303
307
|
onRemove?: ((...args: any[]) => any) | undefined;
|
304
308
|
onEdit?: ((...args: any[]) => any) | undefined;
|
305
309
|
onAdd?: ((...args: any[]) => any) | undefined;
|
@@ -42,7 +42,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
42
42
|
};
|
43
43
|
}>> & {
|
44
44
|
onSelect?: ((...args: any[]) => any) | undefined;
|
45
|
+
onError?: ((...args: any[]) => any) | undefined;
|
45
46
|
onChange?: ((...args: any[]) => any) | undefined;
|
47
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
46
48
|
onRemove?: ((...args: any[]) => any) | undefined;
|
47
49
|
onEdit?: ((...args: any[]) => any) | undefined;
|
48
50
|
onAdd?: ((...args: any[]) => any) | undefined;
|
@@ -51,7 +53,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
51
53
|
"onClick:grid"?: ((...args: any[]) => any) | undefined;
|
52
54
|
"onEvent-click"?: ((...args: any[]) => any) | undefined;
|
53
55
|
}>>;
|
54
|
-
emits: (event: "remove" | "edit" | "change" | "add" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", ...args: any[]) => void;
|
56
|
+
emits: (event: "remove" | "edit" | "error" | "change" | "add" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", ...args: any[]) => void;
|
55
57
|
canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
|
56
58
|
canvas: import("vue").Ref<any>;
|
57
59
|
pointTipProps: {
|
@@ -268,7 +270,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
268
270
|
list: unknown[];
|
269
271
|
show: boolean;
|
270
272
|
}>;
|
271
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "edit" | "change" | "add" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click")[], "remove" | "edit" | "change" | "add" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
273
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "edit" | "error" | "change" | "add" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click")[], "remove" | "edit" | "error" | "change" | "add" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
272
274
|
type: {
|
273
275
|
type: PropType<IType>;
|
274
276
|
default: string;
|
@@ -289,7 +291,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
289
291
|
};
|
290
292
|
}>> & {
|
291
293
|
onSelect?: ((...args: any[]) => any) | undefined;
|
294
|
+
onError?: ((...args: any[]) => any) | undefined;
|
292
295
|
onChange?: ((...args: any[]) => any) | undefined;
|
296
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
293
297
|
onRemove?: ((...args: any[]) => any) | undefined;
|
294
298
|
onEdit?: ((...args: any[]) => any) | undefined;
|
295
299
|
onAdd?: ((...args: any[]) => any) | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as
|
1
|
+
import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as n,normalizeStyle as l,unref as u,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import w from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import"./hooks/useShadow.js";import"./hooks/useCommon.js";import{useBirthProcessChart as g}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as R}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";import{useNewBirthProcessChart as y}from"./hooks/newBirthProcess/useNewBirthProcessChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},popupTipRender:{type:Function},addRenderItem:{type:Function}},emits:["change","add","remove","edit","right-click","select","add:prevent","click:grid","event-click","ready","error"],setup(e,{expose:j,emit:P}){const T=e,b=r(null),M=r(),x=t({show:!1,point:{x:0,y:0},list:[],movable:!1,sourceData:[],isTarget:!1}),I=t({show:!1,point:{x:0,y:0},list:[],target:null}),E=o((()=>{var e;return null==(e=M.value)?void 0:e.wrapperEl})),B=o((()=>({width:`${T.data.width||800}px`,height:`${T.data.height||500}px`}))),{propItems:L,redrawPoints:S,select:A,clickMenu:F,useMeasureRuler:H,useCaliper:_,useCaliperRuler:D,useRectRuler:G,updatePolyline:$,getGridInfo:q,redrawLinePoints:N}=function(){const e=[M,T,P,b,x,I];switch(T.type){case"birthProcess":return g(...e);case"surgicalAnesthesia":return k(...e,!!T.popupTipRender);case"electrocardiogram":return R(...e);case"newBirthProcess":return y(...e);default:return C(...e)}}();return s((()=>{if(b.value&&b.value instanceof HTMLCanvasElement)try{M.value=new f.Canvas(b.value,{width:L.canvasWidth,height:L.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})}catch(e){P("error","Error creating fabric.Canvas: "+e)}else P("error","canvasRef is not a HTMLCanvasElement")})),a((()=>{var e,r,t,o;null==(r=null==(e=M.value)?void 0:e.off)||r.call(e),null==(o=null==(t=M.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:S,redrawLinePoints:N,select:A,canvas:M,useMeasureRuler:H,useCaliper:_,useCaliperRuler:D,useRectRuler:G,updatePolyline:$,getGridInfo:q}),(r,t)=>(i(),n("div",{class:"c-fabric-chart",style:l(u(B))},[p("canvas",{ref_key:"canvasRef",ref:b},null,512),u(E)?(i(),n(c,{key:0},[h(v,d({popupTipRender:e.popupTipRender,...x},{propItems:u(L)}),null,16,["propItems"]),h(u(w),d({propItems:u(L)},I,{show:I.show,"onUpdate:show":t[0]||(t[0]=e=>I.show=e),onClickMenu:u(F)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{j as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as d,cloneDeep as u,omit as f,flatten as h,isNumber as g,pick as m}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const x=d(v,(t=>"add"!==t.type));function y(d,v,y,k,C,w,X,b,E){const{computedX:A,getXValue:L}=r(v),{getEqualXTypes:j,handleAddPrevent:P,isGridLimit:S,getPointEventProps:z}=s(d,y,v),{createShadowLines:I}=l(),{canvasWidth:M,other:T,yCellHeight:H,xCellWidth:O,endX:$,originX:B,originY:W,endY:Y,markHeight:D,event:_,topGridYCellHeight:V,extracorporealCirculationHeight:G}=v,K=new Map,R=u(T);let q=[],F=null;function J(){var o;if(!(null==(o=null==R?void 0:R.horizontal)?void 0:o.length))return;const n="horizontal";K.set(n,[]);const{horizontal:r}=R;let a=W+H/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:g,value:m}=o,p=A(g);if(!ot(p))return;const v=[],x=f&&e(s,{...c,left:p,top:a});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,a],{value:m,...d,originX:"left"});v.push(k);const C=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...z()});Object.assign(C,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:B,x2:$-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,tt(C),K.get(n).push(C)})),a+=H})),d.value.add(...K.get(n))}function N(){var t;if(!(null==(t=null==R?void 0:R.vertical)?void 0:t.length))return;const i="vertical";K.set(i,[]);const{vertical:o}=R;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!ot(c))return;const{lineHeight:d=H}=a;let u=W+r+d/2;l.forEach(((t,n)=>{const r=e(String(t.value),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:t},...z()});u+=d,tt(r),K.get(i).push(r)}));const f=K.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=c>$-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),d.value.add(...K.get(i))}function Q(t,e="add"){const{dataIndex:i,data:o,index:n,key:r,dataKey:a,time:l}=t,s=R[r],d=["mark","extracorporealCirculation"].includes(r)?s.dataList[i]:s[i];switch(e){case"remove":d.data.splice(n,1);break;case"change":if("mark"===r){d.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(o):(s.dataList.push({time:l,list:[o]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?d[a]=o:d.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=c(t,d.data),i=Array.isArray(o)?o:[o];d.data.splice(e,0,...i);break}}U(t)}function U(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...K.get(i)),K.delete(i),i){case"horizontal":J();break;case"vertical":N();break;case"mark":Z();break;case"extracorporealCirculation":rt()}}function Z(){if(!D)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=R.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";K.set(a,[]);const l=i([B-5,Y+D/2],{value:t,...o,originX:"right"});d.value.add(l);const s=Y+D+G,c=Y+G;let u=0;const f={};r.forEach(((t,i)=>{const{time:o,list:r=[]}=t,l=A(o);if(!ot(l))return;let h=c+1;r.forEach(((t,o)=>{var r;const{style:g}=t,m=e((null==g?void 0:g.type)||"circleAndText",{...(null==g?void 0:g.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:i,index:o}}),p=m.height;u&&l-u<=O&&(null==(r=f[`x_${u}`])||r.forEach((([t,e])=>{h+p>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:v,startTop:x,oldStartTop:y}=function(t,e){const i={};let o;if(t>Y){const r=t+e;i.y2=t+e/2,r>=s?n(Y-1):(o=t,t=r)}else n(t);function n(n){o=n,i.y2=n-e/2;t=n-e}return{topObj:i,startTop:t,oldStartTop:o}}(h,p);h=x,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",v.y2),K.get(a).push(m),tt(m),d.value.add(m)})),u=l})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:B,x2:$};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(K.get(a))}function tt(t){if(_.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{k.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{t.moving=!0,i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+G+D-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:i}=t,o=p(new Date,"yyyy-MM-dd HH:mm"),n=A(o);i.isCurrentTime&&i.x2<n&&n>0&&n<M&&(i.x2=n);e<i.x1&&t.set({x1:i.x1,x2:i.x1});e>i.x2&&t.set({x1:i.x2,x2:i.x2});it(t,"left"),it(t,"right")}(t):(w(t),function(t){const e=t.left+t.maxTextWidth>$?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),_.hovered&&et(t)})),t.on("mouseup",(r=>{var a;if(k.show=!1,1===r.button){if(!t.moving)return;t.moving=!1,i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=L(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),y("change",r),n&&Q(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(C.point={x:t.left,y:t.top},C.show=!0,C.target=t,C.list=x.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function et(t){k.isTarget=!0,k.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;const n="extracorporealCirculation"===e||"mark"===e;k.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=L(r);k.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(o=i.name),k.list.unshift(o+" ")),k.sourceData=[{type:"other",key:e,time:a,value:o}]}function it(t,e){const{shadowObjs:i,params:o}=t[`${e}ShadowBox`]||{};if(!i||!o)return;i.forEach((t=>d.value.remove(t)));o["left"===e?1:0]=t.left;const n=nt(...o);t[`${e}ShadowBox`]={shadowObjs:n,params:o}}function ot(t){return t>=B&&t<=$}function nt(...e){const[i,o,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),u=[[i,Y],[o,Y],[o,r],[i,r]],h=new t.Polygon(u.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),g=[];return["slash"].includes(l)&&g.push(...I(u,s.angle,s.space,c)),d.value.add(h,...g),K.get("extracorporealCirculation").push(h,...g),[h,...g]}function rt(){if(!G)return;const{dataList:e,ascendAortaStyle:i,extracorporealCirculationStyle:o}=R.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";K.set(n,[]);const r=Y+G;let a,l;function s(t){return t&&t>B&&t<M}function c(t){return void 0===t||""===t}e.forEach(((u,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:i,openAscendAorta:o,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),i&&(a=A(i.time)),o&&(l=A(o.time)),n&&(s=A(n.time)),[r,a,l,s]}(u);if(-1===h.findIndex((t=>t>0&&t<M)))return;let g;h.forEach(((m,v)=>{if(c(m))return;const x=h[v+1],y=h[v-1];if(s(m)||s(x)){const k=s(m)?m:B,C=s(x)?x:c(x)?null:$,w=s(y)?y:B,X={};if(v<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(v)?o:i],X.shadowObjs=nt(...X.params)),s(m)){const i=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(v),o=p(new Date,"yyyy-MM-dd HH:mm"),c=A(o),x=m<c&&s(c)?c:m,y=function(e,i){const o=new t.Line(e,{...i,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return tt(o),d.value.add(o),K.get("extracorporealCirculation").push(o),o}([m,Y,m,r],{origin:{dataIndex:f,dataKey:i,key:n,data:u[i],type:"other"},limitX:{x1:0===v?null!=a?a:B:w,x2:C||x,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(v)?{leftShadowBox:g}:{},...[0,1,2].includes(v)?{rightShadowBox:X}:{}});v===h.length-1&&(a=m,l=y),0===v&&l&&(l.limitX.x2=k)}g=X}}))}))}function at(t){const{code:e}=t;F&&(e.includes("Enter")||e.includes("Esc"))&&(e.includes("Esc")&&(F.text=""),F.exitEditing(),d.value.discardActiveObject(F))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,i=A(t),n=o([i,0,i,Y],e);d.value.add(n)}(),function(){var t;if(!(null==(t=null==R?void 0:R.horizontal)?void 0:t.length))return;q=[];const{horizontal:i}=R,o=B-5;let n=W+H/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l,data:s=[]}=t,c=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;q.push({type:"other",title:r,key:"horizontal",dataIndex:i,dataList:s.map((t=>A(t.time))),y1:n-c.height/2,y2:n+c.height/2}),(u=c).on("moving",(()=>{u.set("originX","center"),S(u)?et(u):k.show=!1})),u.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&S(u))if(j(K.get("horizontal"),u.left,"key",O).includes(u.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:L(u.left),value:u.origin.defaultAddValue},...u.origin};y("add",f(t,["isMenu"])),Q(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(c),n+=H}))}(),J(),N(),Z(),rt(),a.on((()=>{const t="horizontal",e=X(K.get(t));e.length>0?b((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const i=e[t];return R.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);U({key:t}),y("remove",i)})):E()})),_.evented&&(window.addEventListener("keydown",at,!0),d.value.on("mouse:up",(e=>{var i,o,n,r;if(1===e.button){const{target:a,pointer:l={}}=e,{x:s=0,y:c=0}=l;if(!S({left:s,top:c}))return;if(!(null==q?void 0:q.length)||F)return;if(a&&"horizontal"!==(null==(i=a.origin)?void 0:i.key))return;let u="";if(a){if(a.moving)return;u=null==(r=null==(n=null==(o=a.origin)?void 0:o.data)?void 0:n.value)?void 0:r.toString()}const f=q.find((({y1:t,y2:e})=>c>=t&&c<=e));g(null==f?void 0:f.dataIndex)&&(F=new t.Textbox(u,{left:s,top:c,width:100,height:100,fontSize:18,objectCaching:!1,hasControls:!1,borderColor:"#000",editingBorderColor:"#000",backgroundColor:"#fff",fontFamily:"微软雅黑"}),F.otherListPointHeightRangeItem={...f,left:s,target:a},d.value.add(F),d.value.setActiveObject(F),F.enterEditing(),u&&F.setSelectionEnd(u.length))}})),d.value.on("selection:cleared",(({deselected:t})=>{var e;if(null==t?void 0:t.find((t=>t.otherListPointHeightRangeItem))){let{text:t}=F;const{otherListPointHeightRangeItem:i}=F;if(t=t.replace(/^\s+|\s+$/g,""),d.value.remove(F),F=null,!t)return;const{left:o,target:n}=i;if(n){if(t==(null==(e=n.origin)?void 0:e.data.value))return;const i={...n.origin,data:{...n.origin.data,value:t}};y("change",i),Q(i,"change")}else{const e={...m(i,["title","type","key","dataIndex"]),data:{time:L(o),value:t}};y("add",e),Q(e)}}}))),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};y(i,n),"remove"===i&&Q(n,i)},handleKeydown:at}}export{y as useOther};
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as d,cloneDeep as u,omit as f,flatten as h,isNumber as g,pick as m}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const x=d(v,(t=>"add"!==t.type));function y(d,v,y,k,C,w,X,b,E){const{computedX:A,getXValue:L}=r(v),{getEqualXTypes:j,handleAddPrevent:P,isGridLimit:S,getPointEventProps:z}=s(d,y,v),{createShadowLines:I}=l(),{canvasWidth:M,other:T,yCellHeight:H,xCellWidth:O,endX:$,originX:B,originY:W,endY:Y,markHeight:D,event:_,topGridYCellHeight:V,extracorporealCirculationHeight:G}=v,K=new Map,R=u(T);let q=[],F=null;function J(){var o;if(!(null==(o=null==R?void 0:R.horizontal)?void 0:o.length))return;const n="horizontal";K.set(n,[]);const{horizontal:r}=R;let a=W+H/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:g,value:m}=o,p=A(g);if(!ot(p))return;const v=[],x=f&&e(s,{...c,left:p,top:a});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,a],{value:m,...d,originX:"left"});v.push(k);const C=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...z()});Object.assign(C,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:B,x2:$-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,tt(C),K.get(n).push(C)})),a+=H})),d.value.add(...K.get(n))}function N(){var t;if(!(null==(t=null==R?void 0:R.vertical)?void 0:t.length))return;const i="vertical";K.set(i,[]);const{vertical:o}=R;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!ot(c))return;const{lineHeight:d=H}=a;let u=W+r+d/2;l.forEach(((t,n)=>{const r=e(String(t.value),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:t},...z()});u+=d,tt(r),K.get(i).push(r)}));const f=K.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=c>$-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),d.value.add(...K.get(i))}function Q(t,e="add"){const{dataIndex:i,data:o,index:n,key:r,dataKey:a,time:l}=t,s=R[r],d=["mark","extracorporealCirculation"].includes(r)?s.dataList[i]:s[i];switch(e){case"remove":d.data.splice(n,1);break;case"change":if("mark"===r){d.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(o):(s.dataList.push({time:l,list:[o]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?d[a]=o:d.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=c(t,d.data),i=Array.isArray(o)?o:[o];d.data.splice(e,0,...i);break}}U(t)}function U(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...K.get(i)),K.delete(i),i){case"horizontal":J();break;case"vertical":N();break;case"mark":Z();break;case"extracorporealCirculation":rt()}}function Z(){if(!D)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=R.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";K.set(a,[]);const l=i([B-5,Y+D/2],{value:t,...o,originX:"right"});d.value.add(l);const s=Y+D+G,c=Y+G;let u=0;const f={};r.forEach(((t,i)=>{const{time:o,list:r=[]}=t,l=A(o);if(!ot(l))return;let h=c+1;r.forEach(((t,o)=>{var r;const{style:g}=t,m=e((null==g?void 0:g.type)||"circleAndText",{...(null==g?void 0:g.pointAttr)||n,...t.text?{text:t.text}:{},left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:i,index:o}}),p=m.height;u&&l-u<=O&&(null==(r=f[`x_${u}`])||r.forEach((([t,e])=>{h+p>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:v,startTop:x,oldStartTop:y}=function(t,e){const i={};let o;if(t>Y){const r=t+e;i.y2=t+e/2,r>=s?n(Y-1):(o=t,t=r)}else n(t);function n(n){o=n,i.y2=n-e/2;t=n-e}return{topObj:i,startTop:t,oldStartTop:o}}(h,p);h=x,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",v.y2),K.get(a).push(m),tt(m),d.value.add(m)})),u=l})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:B,x2:$};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(K.get(a))}function tt(t){if(_.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{k.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{t.moving=!0,i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+G+D-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:i}=t,o=p(new Date,"yyyy-MM-dd HH:mm"),n=A(o);i.isCurrentTime&&i.x2<n&&n>0&&n<M&&(i.x2=n);e<i.x1&&t.set({x1:i.x1,x2:i.x1});e>i.x2&&t.set({x1:i.x2,x2:i.x2});it(t,"left"),it(t,"right")}(t):(w(t),function(t){const e=t.left+t.maxTextWidth>$?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),_.hovered&&et(t)})),t.on("mouseup",(r=>{var a;if(k.show=!1,1===r.button){if(!t.moving)return;t.moving=!1,i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=L(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),y("change",r),n&&Q(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(C.point={x:t.left,y:t.top},C.show=!0,C.target=t,C.list=x.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function et(t){k.isTarget=!0,k.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;const n="extracorporealCirculation"===e||"mark"===e;k.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=L(r);k.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(o=i.name),k.list.unshift(o+" ")),k.sourceData=[{type:"other",key:e,time:a,value:o}]}function it(t,e){const{shadowObjs:i,params:o}=t[`${e}ShadowBox`]||{};if(!i||!o)return;i.forEach((t=>d.value.remove(t)));o["left"===e?1:0]=t.left;const n=nt(...o);t[`${e}ShadowBox`]={shadowObjs:n,params:o}}function ot(t){return t>=B&&t<=$}function nt(...e){const[i,o,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),u=[[i,Y],[o,Y],[o,r],[i,r]],h=new t.Polygon(u.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),g=[];return["slash"].includes(l)&&g.push(...I(u,s.angle,s.space,c)),d.value.add(h,...g),K.get("extracorporealCirculation").push(h,...g),[h,...g]}function rt(){if(!G)return;const{dataList:e,ascendAortaStyle:i,extracorporealCirculationStyle:o}=R.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";K.set(n,[]);const r=Y+G;let a,l;function s(t){return t&&t>B&&t<M}function c(t){return void 0===t||""===t}e.forEach(((u,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:i,openAscendAorta:o,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),i&&(a=A(i.time)),o&&(l=A(o.time)),n&&(s=A(n.time)),[r,a,l,s]}(u);if(-1===h.findIndex((t=>t>0&&t<M)))return;let g;h.forEach(((m,v)=>{if(c(m))return;const x=h[v+1],y=h[v-1];if(s(m)||s(x)){const k=s(m)?m:B,C=s(x)?x:c(x)?null:$,w=s(y)?y:B,X={};if(v<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(v)?o:i],X.shadowObjs=nt(...X.params)),s(m)){const i=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(v),o=p(new Date,"yyyy-MM-dd HH:mm"),c=A(o),x=m<c&&s(c)?c:m,y=function(e,i){const o=new t.Line(e,{...i,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return tt(o),d.value.add(o),K.get("extracorporealCirculation").push(o),o}([m,Y,m,r],{origin:{dataIndex:f,dataKey:i,key:n,data:u[i],type:"other"},limitX:{x1:0===v?null!=a?a:B:w,x2:C||x,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(v)?{leftShadowBox:g}:{},...[0,1,2].includes(v)?{rightShadowBox:X}:{}});v===h.length-1&&(a=m,l=y),0===v&&l&&(l.limitX.x2=k)}g=X}}))}))}function at(t){const{code:e}=t;F&&(e.includes("Enter")||e.includes("Esc"))&&(e.includes("Esc")&&(F.text=""),F.exitEditing(),d.value.discardActiveObject(F))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,i=A(t),n=o([i,0,i,Y],e);d.value.add(n)}(),function(){var t;if(!(null==(t=null==R?void 0:R.horizontal)?void 0:t.length))return;q=[];const{horizontal:i}=R,o=B-5;let n=W+H/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l,data:s=[]}=t,c=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;q.push({type:"other",title:r,key:"horizontal",dataIndex:i,dataList:s.map((t=>A(t.time))),y1:n-c.height/2,y2:n+c.height/2}),(u=c).on("moving",(()=>{u.set("originX","center"),S(u)?et(u):k.show=!1})),u.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&S(u))if(j(K.get("horizontal"),u.left,"key",O).includes(u.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:L(u.left),value:u.origin.defaultAddValue},...u.origin};y("add",f(t,["isMenu"])),Q(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(c),n+=H}))}(),J(),N(),Z(),rt(),a.on((()=>{const t="horizontal",e=X(K.get(t));e.length>0?b((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const i=e[t];return R.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);U({key:t}),y("remove",i)})):E()})),_.evented&&(window.addEventListener("keydown",at,!0),d.value.on("mouse:up",(e=>{var i,o,n,r;if(1===e.button){const{target:a,pointer:l={}}=e,{x:s=0,y:c=0}=l;if(!S({left:s,top:c}))return;if(!(null==q?void 0:q.length)||F)return;if(a&&"horizontal"!==(null==(i=a.origin)?void 0:i.key))return;let u="";if(a){if(a.moving)return;u=null==(r=null==(n=null==(o=a.origin)?void 0:o.data)?void 0:n.value)?void 0:r.toString()}const f=q.find((({y1:t,y2:e})=>c>=t&&c<=e));g(null==f?void 0:f.dataIndex)&&(F=new t.Textbox(u,{left:s,top:c,width:100,height:100,fontSize:18,objectCaching:!1,hasControls:!1,borderColor:"#000",editingBorderColor:"#000",backgroundColor:"#fff",fontFamily:"微软雅黑"}),F.otherListPointHeightRangeItem={...f,left:s,target:a},d.value.add(F),d.value.setActiveObject(F),F.enterEditing(),u&&F.setSelectionEnd(u.length))}})),d.value.on("selection:cleared",(({deselected:t})=>{var e;if(null==t?void 0:t.find((t=>t.otherListPointHeightRangeItem))){let{text:t}=F;const{otherListPointHeightRangeItem:i}=F;if(t=t.replace(/^\s+|\s+$/g,""),d.value.remove(F),F=null,!t)return;const{left:o,target:n}=i;if(n){if(t==(null==(e=n.origin)?void 0:e.data.value))return;const i={...n.origin,data:{...n.origin.data,value:t}};y("change",i),Q(i,"change")}else{const e={...m(i,["title","type","key","dataIndex"]),data:{time:L(o),value:t}};y("add",e),Q(e)}}}))),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};y(i,n),"remove"===i&&Q(n,i)},handleKeydown:at}}export{y as useOther};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as r}from"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import{setOtherType as n,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,b,w,Y,C,j){const x=15,D=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=b.data.grid||{};return~Q.value?e:[0,0]})),H=a((()=>{var e,a;const t=(null==(a=null==(e=b.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===Q.value?t[0]=t[0]+V.value[1]:Q.value>0&&(t[2]=t[2]+V.value[0]),t})),P=a((()=>0===Q.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:Q.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),X=a((()=>{const{top:e}=b.data;return e.date.show&&(e.date.height||x)||0})),L=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||x)||0})),M=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||x)||0})),I=a((()=>{var e,a,t;const{top:l}=b.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),O=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||x)||0})),N=a((()=>{var e;const{bottom:a}=b.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=b.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),R=a((()=>{const{mainYCell:e,subYCell:a,painSubYCell:t=5}=b.data.grid,l=Q.value>0?V.value[1]:V.value[0];return(e-1)*a+t+H.value[0]+H.value[2]+l})),T=a((()=>{var e;const{width:a,right:t=null,top:l}=b.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),W=a((()=>T.value-H.value[1]*z.value)),$=a((()=>{const{top:e,left:a}=b.data;return e.titleWidth+G.value})),A=a((()=>{const{bottom:e=null,height:a}=b.data;if(!e)return a;return a-(e.height||30)})),q=a((()=>{var e;const{top:a}=b.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||x)||0;return X.value+t+l+L.value+M.value+O.value})),z=a((()=>(T.value-$.value)/k.value)),B=a((()=>(A.value-q.value)/R.value)),G=a((()=>{var e,a;const{left:t}=b.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),E=a((()=>{var e,a;const{top:t,grid:l}=b.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let r=$.value-z.value;const n=t.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(n):e.concat(d(c(new Date(n.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{r+=z.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:r,center:r+z.value/2,scaleCell:(l-t)/z.value}}))));return v(o)})),F=a((()=>{var e;return(null==(e=b.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),J=a((()=>{const{left:e}=b.data;return v(e.yScaleValue.filter((e=>e.show)).map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:n(a.title,e.type),unit:e.unit,dataIndex:t,isOneLine:o(e)}))))))})),K=a((()=>{const{left:e}=b.data,a=e.yScaleValue.find((e=>"pain"===e.type));if(!a)return 0;const{numberVerticalPosition:t="bottom"}=a;return"center"===t?B.value/2:0})),Q=a((()=>{const{left:e}=b.data,a=e.yScaleValue.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),U=a((()=>{const{painSubYCell:e=5}=b.data.grid;return-1===Q.value?0:B.value*e})),Z=a((()=>{const{left:e}=b.data;return(e.yScaleValue.find((e=>"pain"===e.type))||{}).borderColor})),_=a((()=>{const{left:e}=b.data,a={originY:q.value+V.value[0]*B.value,endY:A.value-V.value[1]*B.value-K.value};return 0===Q.value&&e.yScaleValue.length>1?a.endY=a.originY+U.value-K.value:Q.value===e.yScaleValue.length-1&&(a.originY=a.endY-U.value+K.value),a})),ee=a((()=>{const{left:e}=b.data,a={originY:q.value+H.value[0]*B.value,endY:A.value-H.value[2]*B.value};return 0===Q.value&&e.yScaleValue.length>1?a.originY=_.value.endY+K.value+H.value[0]*B.value:Q.value===e.yScaleValue.length-1&&(a.endY=_.value.originY-H.value[2]*B.value),a})),ae=a((()=>{var e,a;const{top:t,grid:l}=b.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),te=a((()=>{var e;const{left:a,right:t}=b.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>s(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),le=e({canvasWidth:b.data.width,canvasHeight:b.data.height,borderStyle:{...u,...b.data.borderStyle||{}},selectionStyle:b.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:O.value,topList:ae.value,breathingHeight:N.value,hospitalizationDate:b.data.hospitalizationDate,grid:b.data.grid,top:b.data.top,left:b.data.left,right:b.data.right,bottom:b.data.bottom,other:b.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:_.value,vitalSignsOriginY:ee.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:G.value,originX:$.value,originY:q.value,endX:T.value,endXLimit:W.value,endY:A.value,xCellWidth:z.value,yCellHeight:B.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:te.value,config:b.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:P.value,painScalePositionSurplusHeight:K.value,painBorderColor:Z.value}),{computedX:ue,computedY:ie,getXValue:re,getYValue:ne}=i(le);return t((()=>S.value),(e=>{e&&function(){try{h(S,le);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:n}=m(S,le,w,ue,ie,re,ne,b.addRenderItem,C,j);D.redrawPoints=l,D.clickMenu=u;const{drawScaleValue:o}=p(S,le,w,e,C,ue,ie,re,ne,a,t,i);g(S,le,o),f(S,le),y(S,le,w,ue,ie,n);const{select:s}=r(S,le,w);D.select=s,setTimeout((()=>{w("ready",!0)}),10)}catch(e){console.log("error ==>",e),w("error",e)}}()}),{immediate:!0}),{propItems:le,...l(D)}}export{S as useTemperatureChart};
|
@@ -210,6 +210,7 @@ declare const FieldEditor: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
210
210
|
fixMemoLeak: {
|
211
211
|
type: BooleanConstructor;
|
212
212
|
};
|
213
|
+
lazyRender: BooleanConstructor;
|
213
214
|
}, {
|
214
215
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
215
216
|
fieldList: {
|
@@ -412,6 +413,7 @@ declare const FieldEditor: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
412
413
|
fixMemoLeak: {
|
413
414
|
type: BooleanConstructor;
|
414
415
|
};
|
416
|
+
lazyRender: BooleanConstructor;
|
415
417
|
}>> & {
|
416
418
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
417
419
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -586,6 +588,8 @@ declare const FieldEditor: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
586
588
|
linebarTextDirection: "horizontal" | "vertical";
|
587
589
|
autoWidth: number | boolean;
|
588
590
|
feedbackType: "default" | "tooltip";
|
591
|
+
fixMemoLeak: boolean;
|
592
|
+
lazyRender: boolean;
|
589
593
|
}>) => Record<string, import("@formily/json-schema").Stringify<{
|
590
594
|
[key: symbol]: any;
|
591
595
|
[key: `x-${string}`]: any;
|
@@ -972,6 +976,7 @@ declare const FieldEditor: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
972
976
|
fixMemoLeak: {
|
973
977
|
type: BooleanConstructor;
|
974
978
|
};
|
979
|
+
lazyRender: BooleanConstructor;
|
975
980
|
}>> & {
|
976
981
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
977
982
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -1003,9 +1008,10 @@ declare const FieldEditor: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
1003
1008
|
linebarTextDirection: "horizontal" | "vertical";
|
1004
1009
|
autoWidth: number | boolean;
|
1005
1010
|
feedbackType: "default" | "tooltip";
|
1011
|
+
fixMemoLeak: boolean;
|
1012
|
+
lazyRender: boolean;
|
1006
1013
|
operationalFormInit: boolean;
|
1007
1014
|
incrementalRender: boolean;
|
1008
|
-
fixMemoLeak: boolean;
|
1009
1015
|
}>;
|
1010
1016
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
1011
1017
|
export default FieldEditor;
|