cnhis-design-vue 3.1.51-release.0 → 3.1.51-release.1
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/base-search/index.d.ts +13 -8
- package/es/components/base-search/src/index.vue.d.ts +13 -8
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/classification/index.d.ts +57 -15
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +57 -15
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +57 -15
- package/es/components/classification/src/index.vue.d.ts +57 -15
- 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/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/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.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/form-config/index.d.ts +174 -25
- package/es/components/form-config/src/FormConfig.vue.d.ts +175 -26
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -4
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +13 -10
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +121 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
- package/es/components/form-config/src/constants/index.d.ts +19 -1
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useDataNormalize.d.ts +1 -1
- package/es/components/form-config/src/hooks/useDataNormalize.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +7 -3
- package/es/components/form-config/style/index.css +1 -1
- package/es/components/form-render/index.d.ts +4 -4
- package/es/components/form-render/src/FormRender.vue.d.ts +2 -2
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -4
- package/es/components/form-render/src/components/renderer/select.d.ts +10 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/components/form-render/src/types/index.d.ts +1 -19
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +1 -1
- package/es/components/iho-table/src/types/index.d.ts +2 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +13 -13
- package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -13
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +5 -5
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +4 -4
- package/es/components/quick-search/index.d.ts +13 -8
- package/es/components/quick-search/src/index.vue.d.ts +13 -8
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +6 -5
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -5
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +52 -7
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue.d.ts +34 -2
- package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +36 -4
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +1 -6
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +57 -15
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.d.ts +58 -0
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +56 -1
- package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +4 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +55 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +1 -7
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/tool/transformData.d.ts +1 -6
- package/es/components/table-filter/src/tool/transformData.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +16 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +19 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +20 -0
- package/es/shared/utils/business.d.ts +1 -2
- package/package.json +2 -2
|
@@ -434,10 +434,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
434
434
|
className: string;
|
|
435
435
|
displayCategory: string;
|
|
436
436
|
filterConditions: {
|
|
437
|
-
value: string;
|
|
438
|
-
key: string;
|
|
439
437
|
condition: string;
|
|
438
|
+
key: string;
|
|
440
439
|
presetVal: string;
|
|
440
|
+
value: string;
|
|
441
|
+
isAccurateSearch?: boolean | undefined;
|
|
442
|
+
accurateSearchKey?: string | undefined;
|
|
441
443
|
}[];
|
|
442
444
|
};
|
|
443
445
|
loading: import("vue").Ref<boolean>;
|
|
@@ -465,12 +467,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
465
467
|
updateCondition: (index: number, val: any) => void;
|
|
466
468
|
getParamCfg: (key: string) => any;
|
|
467
469
|
initFilterConditions: (tableId: string, rawConditions: import("../../../../../../es/components/table-filter/src/types").ISearchConfigType) => Promise<void>;
|
|
468
|
-
getRawFilterConditions: () =>
|
|
469
|
-
field_key: any;
|
|
470
|
-
con: any;
|
|
471
|
-
value: any;
|
|
472
|
-
unit: any;
|
|
473
|
-
}[];
|
|
470
|
+
getRawFilterConditions: () => any[];
|
|
474
471
|
findConditionByDisplayCategory: (sid: string) => unknown;
|
|
475
472
|
handleDisplayCategorySelectProxy: (item: import("../../../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
|
|
476
473
|
clearFormData: () => void;
|
|
@@ -501,6 +498,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
501
498
|
type: StringConstructor;
|
|
502
499
|
default: null;
|
|
503
500
|
};
|
|
501
|
+
isAccurate: {
|
|
502
|
+
type: BooleanConstructor;
|
|
503
|
+
};
|
|
504
504
|
}, {
|
|
505
505
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
506
506
|
paramCfg: {
|
|
@@ -515,13 +515,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
515
515
|
type: StringConstructor;
|
|
516
516
|
default: null;
|
|
517
517
|
};
|
|
518
|
+
isAccurate: {
|
|
519
|
+
type: BooleanConstructor;
|
|
520
|
+
};
|
|
518
521
|
}>> & {
|
|
519
522
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
523
|
+
"onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
|
|
520
524
|
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
521
525
|
}>>;
|
|
522
|
-
emit: (event: "update:modelValue" | "update:presetVal", ...args: any[]) => void;
|
|
526
|
+
emit: (event: "update:modelValue" | "update:isAccurate" | "update:presetVal", ...args: any[]) => void;
|
|
523
527
|
valueCp: import("vue").WritableComputedRef<any>;
|
|
524
528
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
529
|
+
isAccurateCp: import("vue").WritableComputedRef<boolean>;
|
|
525
530
|
widgetType: import("vue").ComputedRef<any>;
|
|
526
531
|
Date: import("vue").DefineComponent<{
|
|
527
532
|
componentCfg: {
|
|
@@ -671,35 +676,67 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
671
676
|
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
672
677
|
}, {
|
|
673
678
|
modelValue: string | number | unknown[];
|
|
674
|
-
presetVal: string;
|
|
675
679
|
paramCfg: Record<string, any>;
|
|
680
|
+
presetVal: string;
|
|
676
681
|
}>;
|
|
677
682
|
InputFilter: import("vue").DefineComponent<{
|
|
683
|
+
paramCfg: {
|
|
684
|
+
type: ObjectConstructor;
|
|
685
|
+
default: null;
|
|
686
|
+
};
|
|
678
687
|
modelValue: {
|
|
679
688
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
680
689
|
default: null;
|
|
681
690
|
};
|
|
691
|
+
isAccurateFilter: {
|
|
692
|
+
type: BooleanConstructor;
|
|
693
|
+
};
|
|
682
694
|
}, {
|
|
683
695
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
696
|
+
paramCfg: {
|
|
697
|
+
type: ObjectConstructor;
|
|
698
|
+
default: null;
|
|
699
|
+
};
|
|
684
700
|
modelValue: {
|
|
685
701
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
686
702
|
default: null;
|
|
687
703
|
};
|
|
704
|
+
isAccurateFilter: {
|
|
705
|
+
type: BooleanConstructor;
|
|
706
|
+
};
|
|
688
707
|
}>> & {
|
|
689
708
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
709
|
+
"onUpdate:isAccurateFilter"?: ((...args: any[]) => any) | undefined;
|
|
690
710
|
}>>;
|
|
691
|
-
emit: (event: "update:modelValue", ...args: any[]) => void;
|
|
711
|
+
emit: (event: "update:modelValue" | "update:isAccurateFilter", ...args: any[]) => void;
|
|
712
|
+
optionList: import("vue").Ref<{
|
|
713
|
+
label: string;
|
|
714
|
+
value: number;
|
|
715
|
+
}[]>;
|
|
692
716
|
valueCp: import("vue").WritableComputedRef<any>;
|
|
717
|
+
isAccurateFilterCp: import("vue").WritableComputedRef<number>;
|
|
718
|
+
isShowSearch: import("vue").ComputedRef<any>;
|
|
693
719
|
NInput: any;
|
|
694
|
-
|
|
720
|
+
NSelect: any;
|
|
721
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:isAccurateFilter")[], "update:modelValue" | "update:isAccurateFilter", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
722
|
+
paramCfg: {
|
|
723
|
+
type: ObjectConstructor;
|
|
724
|
+
default: null;
|
|
725
|
+
};
|
|
695
726
|
modelValue: {
|
|
696
727
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
697
728
|
default: null;
|
|
698
729
|
};
|
|
730
|
+
isAccurateFilter: {
|
|
731
|
+
type: BooleanConstructor;
|
|
732
|
+
};
|
|
699
733
|
}>> & {
|
|
700
734
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
735
|
+
"onUpdate:isAccurateFilter"?: ((...args: any[]) => any) | undefined;
|
|
701
736
|
}, {
|
|
702
737
|
modelValue: string | number | unknown[];
|
|
738
|
+
paramCfg: Record<string, any>;
|
|
739
|
+
isAccurateFilter: boolean;
|
|
703
740
|
}>;
|
|
704
741
|
InputNumber: import("vue").DefineComponent<{
|
|
705
742
|
modelValue: {
|
|
@@ -1228,8 +1265,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1228
1265
|
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
1229
1266
|
}, {
|
|
1230
1267
|
modelValue: string | number | unknown[];
|
|
1231
|
-
presetVal: string;
|
|
1232
1268
|
paramCfg: Record<string, any>;
|
|
1269
|
+
presetVal: string;
|
|
1233
1270
|
}>;
|
|
1234
1271
|
SelectLabel: import("vue").DefineComponent<{
|
|
1235
1272
|
paramCfg: {
|
|
@@ -1295,7 +1332,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1295
1332
|
SELECTLABEL: string;
|
|
1296
1333
|
SELECTDYNAMIC: string;
|
|
1297
1334
|
};
|
|
1298
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:presetVal")[], "update:modelValue" | "update:presetVal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1335
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:isAccurate" | "update:presetVal")[], "update:modelValue" | "update:isAccurate" | "update:presetVal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1299
1336
|
paramCfg: {
|
|
1300
1337
|
type: ObjectConstructor;
|
|
1301
1338
|
default: null;
|
|
@@ -1308,13 +1345,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1308
1345
|
type: StringConstructor;
|
|
1309
1346
|
default: null;
|
|
1310
1347
|
};
|
|
1348
|
+
isAccurate: {
|
|
1349
|
+
type: BooleanConstructor;
|
|
1350
|
+
};
|
|
1311
1351
|
}>> & {
|
|
1312
1352
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1353
|
+
"onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
|
|
1313
1354
|
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
1314
1355
|
}, {
|
|
1315
1356
|
modelValue: string | number | unknown[];
|
|
1316
|
-
presetVal: string;
|
|
1317
1357
|
paramCfg: Record<string, any>;
|
|
1358
|
+
presetVal: string;
|
|
1359
|
+
isAccurate: boolean;
|
|
1318
1360
|
}>;
|
|
1319
1361
|
ConditionEnums: {
|
|
1320
1362
|
NULL: string;
|
|
@@ -648,10 +648,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
648
648
|
className: string;
|
|
649
649
|
displayCategory: string;
|
|
650
650
|
filterConditions: {
|
|
651
|
-
value: string;
|
|
652
|
-
key: string;
|
|
653
651
|
condition: string;
|
|
652
|
+
key: string;
|
|
654
653
|
presetVal: string;
|
|
654
|
+
value: string;
|
|
655
|
+
isAccurateSearch?: boolean | undefined;
|
|
656
|
+
accurateSearchKey?: string | undefined;
|
|
655
657
|
}[];
|
|
656
658
|
};
|
|
657
659
|
loading: import("vue").Ref<boolean>;
|
|
@@ -679,12 +681,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
679
681
|
updateCondition: (index: number, val: any) => void;
|
|
680
682
|
getParamCfg: (key: string) => any;
|
|
681
683
|
initFilterConditions: (tableId: string, rawConditions: import("../../../../es/components/table-filter/src/types").ISearchConfigType) => Promise<void>;
|
|
682
|
-
getRawFilterConditions: () =>
|
|
683
|
-
field_key: any;
|
|
684
|
-
con: any;
|
|
685
|
-
value: any;
|
|
686
|
-
unit: any;
|
|
687
|
-
}[];
|
|
684
|
+
getRawFilterConditions: () => any[];
|
|
688
685
|
findConditionByDisplayCategory: (sid: string) => unknown;
|
|
689
686
|
handleDisplayCategorySelectProxy: (item: import("../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
|
|
690
687
|
clearFormData: () => void;
|
|
@@ -715,6 +712,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
715
712
|
type: StringConstructor;
|
|
716
713
|
default: null;
|
|
717
714
|
};
|
|
715
|
+
isAccurate: {
|
|
716
|
+
type: BooleanConstructor;
|
|
717
|
+
};
|
|
718
718
|
}, {
|
|
719
719
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
720
720
|
paramCfg: {
|
|
@@ -729,13 +729,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
729
729
|
type: StringConstructor;
|
|
730
730
|
default: null;
|
|
731
731
|
};
|
|
732
|
+
isAccurate: {
|
|
733
|
+
type: BooleanConstructor;
|
|
734
|
+
};
|
|
732
735
|
}>> & {
|
|
733
736
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
737
|
+
"onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
|
|
734
738
|
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
735
739
|
}>>;
|
|
736
|
-
emit: (event: "update:modelValue" | "update:presetVal", ...args: any[]) => void;
|
|
740
|
+
emit: (event: "update:modelValue" | "update:isAccurate" | "update:presetVal", ...args: any[]) => void;
|
|
737
741
|
valueCp: import("vue").WritableComputedRef<any>;
|
|
738
742
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
743
|
+
isAccurateCp: import("vue").WritableComputedRef<boolean>;
|
|
739
744
|
widgetType: import("vue").ComputedRef<any>;
|
|
740
745
|
Date: import("vue").DefineComponent<{
|
|
741
746
|
componentCfg: {
|
|
@@ -885,35 +890,67 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
885
890
|
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
886
891
|
}, {
|
|
887
892
|
modelValue: string | number | unknown[];
|
|
888
|
-
presetVal: string;
|
|
889
893
|
paramCfg: Record<string, any>;
|
|
894
|
+
presetVal: string;
|
|
890
895
|
}>;
|
|
891
896
|
InputFilter: import("vue").DefineComponent<{
|
|
897
|
+
paramCfg: {
|
|
898
|
+
type: ObjectConstructor;
|
|
899
|
+
default: null;
|
|
900
|
+
};
|
|
892
901
|
modelValue: {
|
|
893
902
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
894
903
|
default: null;
|
|
895
904
|
};
|
|
905
|
+
isAccurateFilter: {
|
|
906
|
+
type: BooleanConstructor;
|
|
907
|
+
};
|
|
896
908
|
}, {
|
|
897
909
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
910
|
+
paramCfg: {
|
|
911
|
+
type: ObjectConstructor;
|
|
912
|
+
default: null;
|
|
913
|
+
};
|
|
898
914
|
modelValue: {
|
|
899
915
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
900
916
|
default: null;
|
|
901
917
|
};
|
|
918
|
+
isAccurateFilter: {
|
|
919
|
+
type: BooleanConstructor;
|
|
920
|
+
};
|
|
902
921
|
}>> & {
|
|
903
922
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
923
|
+
"onUpdate:isAccurateFilter"?: ((...args: any[]) => any) | undefined;
|
|
904
924
|
}>>;
|
|
905
|
-
emit: (event: "update:modelValue", ...args: any[]) => void;
|
|
925
|
+
emit: (event: "update:modelValue" | "update:isAccurateFilter", ...args: any[]) => void;
|
|
926
|
+
optionList: import("vue").Ref<{
|
|
927
|
+
label: string;
|
|
928
|
+
value: number;
|
|
929
|
+
}[]>;
|
|
906
930
|
valueCp: import("vue").WritableComputedRef<any>;
|
|
931
|
+
isAccurateFilterCp: import("vue").WritableComputedRef<number>;
|
|
932
|
+
isShowSearch: import("vue").ComputedRef<any>;
|
|
907
933
|
NInput: any;
|
|
908
|
-
|
|
934
|
+
NSelect: any;
|
|
935
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:isAccurateFilter")[], "update:modelValue" | "update:isAccurateFilter", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
936
|
+
paramCfg: {
|
|
937
|
+
type: ObjectConstructor;
|
|
938
|
+
default: null;
|
|
939
|
+
};
|
|
909
940
|
modelValue: {
|
|
910
941
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
911
942
|
default: null;
|
|
912
943
|
};
|
|
944
|
+
isAccurateFilter: {
|
|
945
|
+
type: BooleanConstructor;
|
|
946
|
+
};
|
|
913
947
|
}>> & {
|
|
914
948
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
949
|
+
"onUpdate:isAccurateFilter"?: ((...args: any[]) => any) | undefined;
|
|
915
950
|
}, {
|
|
916
951
|
modelValue: string | number | unknown[];
|
|
952
|
+
paramCfg: Record<string, any>;
|
|
953
|
+
isAccurateFilter: boolean;
|
|
917
954
|
}>;
|
|
918
955
|
InputNumber: import("vue").DefineComponent<{
|
|
919
956
|
modelValue: {
|
|
@@ -1442,8 +1479,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1442
1479
|
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
1443
1480
|
}, {
|
|
1444
1481
|
modelValue: string | number | unknown[];
|
|
1445
|
-
presetVal: string;
|
|
1446
1482
|
paramCfg: Record<string, any>;
|
|
1483
|
+
presetVal: string;
|
|
1447
1484
|
}>;
|
|
1448
1485
|
SelectLabel: import("vue").DefineComponent<{
|
|
1449
1486
|
paramCfg: {
|
|
@@ -1509,7 +1546,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1509
1546
|
SELECTLABEL: string;
|
|
1510
1547
|
SELECTDYNAMIC: string;
|
|
1511
1548
|
};
|
|
1512
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:presetVal")[], "update:modelValue" | "update:presetVal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1549
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:isAccurate" | "update:presetVal")[], "update:modelValue" | "update:isAccurate" | "update:presetVal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1513
1550
|
paramCfg: {
|
|
1514
1551
|
type: ObjectConstructor;
|
|
1515
1552
|
default: null;
|
|
@@ -1522,13 +1559,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1522
1559
|
type: StringConstructor;
|
|
1523
1560
|
default: null;
|
|
1524
1561
|
};
|
|
1562
|
+
isAccurate: {
|
|
1563
|
+
type: BooleanConstructor;
|
|
1564
|
+
};
|
|
1525
1565
|
}>> & {
|
|
1526
1566
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1567
|
+
"onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
|
|
1527
1568
|
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
1528
1569
|
}, {
|
|
1529
1570
|
modelValue: string | number | unknown[];
|
|
1530
|
-
presetVal: string;
|
|
1531
1571
|
paramCfg: Record<string, any>;
|
|
1572
|
+
presetVal: string;
|
|
1573
|
+
isAccurate: boolean;
|
|
1532
1574
|
}>;
|
|
1533
1575
|
ConditionEnums: {
|
|
1534
1576
|
NULL: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,b,j,C,P){const{cumputedX:S,cumputedY:E,getXValue:G,getYValue:M}=c(b),{getEqualXTypes:T,handleAddPrevent:Y,isGridLimit:L,setPrevAndNextPoint:X}=h(x,j,b),{xAxis:A,grid:I,originX:H,originY:W,xCellWidth:N,endY:O,startTime:V,leftAddAreaWidth:D,leftScales:R,rightScales:$,yCellHeight:B,endX:F,scaleValues:q,canvasWidth:z,borderStyle:J,rightAddAreaWidth:K,event:Q,originYCervix:U,other:Z,canvasHeight:_}=b,ee=k(q),te=new Set;function oe(){ee.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=se(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=se(P,e);h=o?t([...s,...o],{...v}):null}let E,T;if(d.childbirth){const e=s[1]+B;E=o([s[0],s[1],e],w),c.push(E),T=n([s[0]+N/2,e-B/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(T)}const Y=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:Y,rightLine:h,arrowGroup:E,arrowGroupText:T,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};Y?p=r(k,{left:Y.get("x2"),top:Y.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){Q.hovered&&(e.on("mouseover",(()=>{le(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{re(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+N/2,top:e.top+B/2})}(e),Q.hovered&&le(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:G(e.left),value:M(t,e.top)}};x.value.discardActiveObject(),j("change",o),ne(o,"change")}}))}(p),a.push(p),te.add(p))}(se(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));X(e),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function ne(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=ee.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ie()}function ie(){var e;te.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...te]))),te.clear(),oe()}function re(e){const t=e.prevPoint?e.prevPoint.left:H,o=e.nextPoint?e.nextPoint.left:F;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<U&&e.set("top",U),e.top<W&&e.set("top",W),e.top>O&&e.set("top",O),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function le(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:M(n,e.top)}`,`时间 ${G(e.left).slice(-5)}`],C.show=!0}function se(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=E(t.key,t.range,e.value);return[o,n<W?W:n>O?O:n]}}function ae(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...J,width:z-D-K-1,height:O-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:F;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),E=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=O-o*B*k,a=0===o?O-8:o!==S.length-1||W||U&&"FHR"!==v?s:W+8;!w||(0===o||o===E-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,B,W,E))}));const G=new e.Rect({...a,strokeWidth:.5,width:c,height:O,left:P,top:O/2}),M=n([P,W>0?W-B/2:B/2],{value:String(h),...i,...g}),T=new e.Group([...C,...j,G,...M?[M]:[]],{objectCaching:!1,...s});x.value.add(T),T.sendToBack(),r+=c}))}t(R),t($,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=A.time,{show:u,range:c=[0,23],position:d,style:f}=A.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=H+N/2,y=B/2;for(let e=0;e<I.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):ae(p.at(-1),r);p.push(t);const s="top"===l?W-y:O+y;g.push(n([m+e*N,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:_-y;v.push(n([m+e*N,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(Z),n=[],i={},r=ee.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=E(o,n,10),l=[0,t],s=[-t/e,0],a=[(O-i-t)/e,O-i],u=[F-H,e*(F-H)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=H&&o<=F&&n>=i&&n<=O}function h([e,t]){return[H+e,O-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=ee.find((e=>e.key===o));if(r){const r=E(o,i,0);n.push(t([H,r,F,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-H,O-E(o,a,l.value)],[p,h]=[S(c.time)-H,O-E(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),oe(),function(){function e(e,t){const o=ee.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=H&&o<=F&&n>=W&&n<=O&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],[...te].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],ee.filter((e=>e.show)).forEach((i=>{if(!T([...te],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<U)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=z-K/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=q.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(re(u),le(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(T([...te],u.left,"key").includes(u.origin.key))Y("repeat");else{const e={data:{time:G(u.left),value:M(u.origin.key,u.top)},...u.origin};j("add",e),ne(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(O-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(R,D/2),t($,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),ne(o,"remove")):(Object.assign(o,{data:{time:G(e.pointer.x),value:M(e.origin.key,e.pointer.y)}}),j("add",o),ne(o))},redrawPoints:ie}}export{x as useBirthProcess};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as a,reactive as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import{useCanvasEvent as s}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import"naive-ui";import{useBirthProcess as d}from"./useBirthProcess.js";function n(n,o,v,c,h,m){const f=e(),p=e(),g=e(),x=a((()=>o.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),w=a((()=>o.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=a((()=>{var e;return(null==(e=w.value)?void 0:e.length)?30:0})),V=a((()=>{var e;return 30+(null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),b=a((()=>{var e;const{width:a}=o.data,t=null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-y.value-t})),j=a((()=>o.data.grid.mainXCell)),A=a((()=>{const e=o.data.grid.mainYCell||14;return o.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),C=a((()=>(b.value-V.value)/j.value)),k=a((()=>{const{xAxis:e,height:a}=o.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(A.value+t)})),Y=a((()=>{const{xAxis:e}=o.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return k.value*a})),S=a((()=>{var e;const{scaleValues:a}=o.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!Y.value)return Y.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return H.value-l*r*k.value})),H=a((()=>{const{xAxis:e,height:a}=o.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-k.value*t})),P=a((()=>i(o.data.xAxis.time.startTime))),X=a((()=>36e5/C.value)),F=a((()=>{const{scaleValues:e}=o.data,a=e.find((e=>"cervix"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),R=a((()=>{const{scaleValues:e}=o.data,a=e.find((e=>"FHR"===e.key));return k.value/((null==a?void 0:a.spaceValue)||10)})),W=a((()=>{const{scaleValues:e}=o.data,a=e.find((e=>"fetalPresentation"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),O=a((()=>{var e;return(null==(e=o.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),M=t({canvasWidth:o.data.width,canvasHeight:o.data.height,borderStyle:{...u,...o.data.borderStyle||{}},selectionStyle:o.data.selectionStyle||{},grid:o.data.grid,other:o.data.other,originX:V.value,endX:b.value,originY:Y.value,endY:H.value,xCellWidth:C.value,yCellHeight:k.value,gridXNumber:j.value,gridYNumber:A.value,xAxis:o.data.xAxis,leftScales:x.value,rightScales:w.value,leftAddAreaWidth:30,rightAddAreaWidth:y.value,startTime:P.value,timeXCell:X.value,cervixYCell:F.value,FHRYCell:R.value,fetalPresentationYCell:W.value,scaleValues:o.data.scaleValues,event:O.value,originYCervix:S.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=d(n,M,v,h,m);p.value=a,g.value=e;const{select:t}=s(n,M,v);f.value=t}))})),{propItems:M,redrawPoints:p,select:f,clickMenu:g}}export{n as useBirthProcessChart};
|
|
1
|
+
import{ref as e,computed as a,reactive as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import{useCanvasEvent as s}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import"naive-ui";import"@vueuse/core";import{useBirthProcess as d}from"./useBirthProcess.js";function n(n,o,v,c,h,m){const f=e(),p=e(),g=e(),x=a((()=>o.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),w=a((()=>o.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=a((()=>{var e;return(null==(e=w.value)?void 0:e.length)?30:0})),V=a((()=>{var e;return 30+(null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),b=a((()=>{var e;const{width:a}=o.data,t=null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-y.value-t})),j=a((()=>o.data.grid.mainXCell)),A=a((()=>{const e=o.data.grid.mainYCell||14;return o.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),C=a((()=>(b.value-V.value)/j.value)),k=a((()=>{const{xAxis:e,height:a}=o.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(A.value+t)})),Y=a((()=>{const{xAxis:e}=o.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return k.value*a})),S=a((()=>{var e;const{scaleValues:a}=o.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!Y.value)return Y.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return H.value-l*r*k.value})),H=a((()=>{const{xAxis:e,height:a}=o.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-k.value*t})),P=a((()=>i(o.data.xAxis.time.startTime))),X=a((()=>36e5/C.value)),F=a((()=>{const{scaleValues:e}=o.data,a=e.find((e=>"cervix"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),R=a((()=>{const{scaleValues:e}=o.data,a=e.find((e=>"FHR"===e.key));return k.value/((null==a?void 0:a.spaceValue)||10)})),W=a((()=>{const{scaleValues:e}=o.data,a=e.find((e=>"fetalPresentation"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),O=a((()=>{var e;return(null==(e=o.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),M=t({canvasWidth:o.data.width,canvasHeight:o.data.height,borderStyle:{...u,...o.data.borderStyle||{}},selectionStyle:o.data.selectionStyle||{},grid:o.data.grid,other:o.data.other,originX:V.value,endX:b.value,originY:Y.value,endY:H.value,xCellWidth:C.value,yCellHeight:k.value,gridXNumber:j.value,gridYNumber:A.value,xAxis:o.data.xAxis,leftScales:x.value,rightScales:w.value,leftAddAreaWidth:30,rightAddAreaWidth:y.value,startTime:P.value,timeXCell:X.value,cervixYCell:F.value,FHRYCell:R.value,fetalPresentationYCell:W.value,scaleValues:o.data.scaleValues,event:O.value,originYCervix:S.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=d(n,M,v,h,m);p.value=a,g.value=e;const{select:t}=s(n,M,v);f.value=t}))})),{propItems:M,redrawPoints:p,select:f,clickMenu:g}}export{n as useBirthProcessChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as o,drawPoint as i}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as u,isEffectiveNode as c,getTime as p}from"../../utils/index.js";import{cloneDeep as d,omit as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as v}from"@vueuse/core";function y(y,g,h,k,x){const{cumputedX:L,cumputedY:P,getXValue:w,getYValue:b}=r(g),{xCellWidth:A,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:I,event:T,scaleValues:M,xAxis:S,startTime:V,timeXCell:X,itemList:$,dialog:O}=g,Y=new Map,D=new Set,_=d(M);let N=[],z=null;const G=new Set;l(y,g);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:F}=s(y,h,g),{pause:R,resume:W}=v((()=>{!function(){for(const e of G)e.set("opacity",1===e.opacity?.5:1),y.value.renderAll()}()}),800);function B(){_.forEach((e=>{e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:i={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:i,lineStyle:l}){if(!e||!n)return;const r=P(t.type,t.range,n),a=o([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});T.hovered&&i&&(a.on("mousemove",(({pointer:e})=>{k.point={...e||{x:a.left,y:a.top}},k.list=[`${i} ${n}${t.unit||""}`],k.show=!0})),a.on("mouseout",(()=>{k.show=!1}))),y.value.add(a)}a(n),a(i),a(l),a(r)}(t,e),Z(t,n,e))}))}))}function H(e=[]){if(!(null==z?void 0:z.areaPos))return[];const{startPos:t,endPos:n}=z.areaPos,[o,i]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:ae()).filter((e=>e.left>=o&&e.left<=i&&e.top>=l&&e.top<=r))}function Q(e){O.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),U()},onNegativeClick:()=>U(),onClose:()=>U()})}function U(){z&&y.value.remove(z),z=null}function Z(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];Y.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:o,type:i}=n.origin;o===t&&i===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let d,v,x=c;l.key&&(x=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:C="",key:K,type:j="circle"}=x,E=re(c.list[u+1],n);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(v=o([...e,...E],P));const I=f[u-1],M={origin:{data:l,title:C,key:c.key,selfKey:K,unit:a,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:I,rightLine:v,...L,...g.event.hovered?g.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:g.event};I?d=i(j,{left:I.get("x2"),top:I.get("y2"),...M}):e&&(M.leftLine=null,d=i(j,{left:e[0],top:e[1],...M}));f.push(v),d&&(d.originLeft=d.left,d.originTop=d.top,function(e){T.hovered&&(e.on("mouseover",(()=>{ie(e,"hover")})),e.on("mouseout",(()=>{k.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{le(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),T.hovered&&ie(e),function(e){const{originLeft:t,originTop:n,left:o,top:i,origin:l}=e,r=~~((o-t)/A);if(o>t+A&&!e.nextPoint){if(0===N.length){ee(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const o=t+A*r;if(N.every((e=>e.left!==o))){const t=w(o),n=b(l.type,i);N.push({data:{time:t,value:n,...l.selfKey!==l.key?{key:l.selfKey}:{}},left:o,top:i}),ee(e,[...e.prevPointer,o,i])}N.length<r&&function(e,t){const{originLeft:n,originTop:o,origin:i}=e;let l=1;for(;l<=t;){const t=n+A*l,r=N.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=N.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=N[l-1]||{left:n,top:o},f=~~((r.left-(t-A))/A),u=(r.top-s.top)/f;a.top=s.top+u,a.left=t,a.data={time:w(t),value:b(i.type,a.top),...i.selfKey!==i.key?{key:i.selfKey}:{}},N.splice(l,0,a),ee(e,[s.left,s.top,a.left,a.top])}}l++}}(e,r)}if(N.length>0&&o<N[N.length-1].left){for(const e of D)e.left>o&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(N=N.filter((e=>e.left<=o)),0===N.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(N.length>0){const t=N.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(k.show=!1,1===t.button){const{type:t,selfKey:n}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:b(t,e.top)}};if(y.value.discardActiveObject(),N.length>0){const e=N.map((e=>e.data)),i=_.find((e=>e.type===t)),l=i.dataList.findIndex((e=>e.key===n));h("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:l,key:n,data:e}),te({...o,data:e})}else h("change",{...m(o,["selfKey","lineAttr"]),key:n}),te(o,"change")}}))}(d),null==(p=Y.get(c.key))||p.push(d))}(re(l,n),l,u,e)})),Promise.all(Y.get(e.key)).then((t=>{const n=f.filter((e=>e));F(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:o={}}=t.panicValue||{},{max:i={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:o},i){!t&&n&&o&&e.forEach((e=>{const t=e.origin.data.value;"max"===i&&t<n||"min"===i&&t>n||G.add(e)}))}r(n,"max"),r(o,"min"),r(i,"max"),r(l,"min")}(t,e)}))}function ee(e,t){const[,,n,i]=t;e.clone((l=>{l.set({left:n,top:i}),e.prevPointer=[n,i];const r=o(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function te(e,t="add",n=1){const{data:o,index:i,key:l,type:r}=e;let{dataIndex:a}=e;const s=_.find((e=>e.type===r)),f=s.dataList.find(((e,t)=>(a=t,e.key===l)));switch(t){case"remove":f.list.splice(i,n);break;case"change":f.list[i]=o;break;default:{const e=Array.isArray(o)?o[0].time:o.time,t=u(e,f.list),n=Array.isArray(o)?o:[o];f.list.splice(t,0,...n);break}}ne({dataIndex:a,scaleValue:s})}function ne(e){var t,n,o;if(D.size&&(null==(t=y.value)||t.remove(...oe([...D]))),D.clear(),N=[],e){const{dataIndex:t,scaleValue:o}=e,i=o.dataList[t];null==(n=y.value)||n.remove(...oe(Y.get(i.key))),Y.delete(i.key),Z(i,t,o)}else Y.size&&(null==(o=y.value)||o.remove(...oe(ae()))),Y.clear(),B()}function oe(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function ie(e,t="moving"){const{title:n,type:o,data:i,unit:l}=e.origin;k.point={x:e.left,y:e.top};const r=`${"hover"===t?i.value:b(o,e.top)}`;k.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],k.show=!0}function le(e){e.setCoords();const t=6e4/X,n=e.prevPoint?e.prevPoint.left+t:K,o=e.nextPoint?e.nextPoint.left-t:j;e.top<E&&e.set("top",E),e.top>I&&e.set("top",I),e.left<n&&e.set("left",n),e.left>o&&e.set("left",o)}function re(e,t){if(c(e)&&function(e){const t=Date.parse(S.list.at(-1)),n=p(e);return n>=V&&n<=t}(e.time)){const n=L(e.time),o=P(t.type,t.range,e.value);return[n,o<E?E:o>I?I:o]}}function ae(){return Array.from(Y.values()).flat()}return e((()=>{R()})),B(),function(){if(!T.evented)return;let e=!1,o={x:0,y:0};y.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=j&&n>=E&&n<=I)if(e.target){if("main"!==e.target.__type)return;o(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:i,maxTop:l}=f(e.target);ae().forEach((o=>{"main"===o.__type&&o.left>t&&o.left<n&&o.top>i&&o.top<l&&x.list.push({renderItem:()=>o.origin.title,origin:{...o.origin},mode:"remove",pointer:e.pointer})})),1===x.list.length&&(x.show=!1,console.log("当前时间段内无可删除节点"))}else o(e.pointer,null,["新增节点"]),$.forEach((n=>{J(ae(),t,"key",2*A).includes(n.linkKey||n.key)||x.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===x.list.length&&(x.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function o(e,t,n){Object.assign(x,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=H();t.length>0?Q((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return te(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);h("remove",e)})):a.emit(z)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,o=t.pointer)})),y.value.on("mouse:move",(i=>{if(!e)return;const{x:l,y:r}=o,{x:a,y:s}=i.pointer;z&&y.value.remove(z),z=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),z.areaPos={startPos:o,endPos:i.pointer},y.value.add(z)}))}(),{redrawPoints:ne,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(h("remove",n),te(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:b(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),h("add",n),te({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:le,setPopup:ie,updateData:te,getGridPoints:ae,getContainPoints:H,showDialog:Q,removeCurrentSelection:U}}export{y as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function p(p,h,f,m,g,v,y,k){const{getYValue:w,getXValue:j}=s(h),{getEqualXTypes:x,handleAddPrevent:b,isGridLimit:W}=u(p,f,h),{originY:X,endY:C,borderStyle:E,left:S,itemList:Y,scaleValues:K,originX:L,endX:V,yCellHeight:G,markHeight:H,canvasWidth:N,canvasHeight:T,xCellWidth:M}=h;!function(){if(!S)return;const{title:t,titleWidth:i,titleStyle:o}=S,n=e({width:i,height:C-X+H,...E},{value:t.split("").join("\n"),...o||{}},{left:0,top:X},!0);p.value.add(n)}(),K.forEach(((e,i)=>{var o,s;const u="left"===e.layout?L-5:V+5,{range:c,spaceValue:h,title:f,unit:m,titleStyle:g,spaceGridNumber:v=1,showNumber:y,showMaxMinNumber:k}=e,w=[],j=d(c,h),x=j.length;j.forEach(((t,i)=>{const o=0===i?C-5:C-i*G*v;!y||(0===i||i===x-1)&&!k||w.push(a(String(t),{...e,position:e.layout},u,o))}));const b=f&&n(["left"===e.layout?S.width/2:V+(N-V)/2,(null!=(s=null==(o=w.at(-1))?void 0:o.top)?s:330)-G],{value:`${f}${m?"\n"+m:""}`,...r,...g}),W=new t.Group([...w,...b?[b]:[]],{objectCaching:!1,...l});p.value.add(W),W.sendToBack()})),function(){const e=new t.Rect({width:L-S.titleWidth,height:C-X+H,left:S.titleWidth,top:X,...i,originX:"left",originY:"top",...E});p.value.add(e);const n=c(Y),r=c(S.externalIconList||[]).map((t=>({...t,isExternal:!0})));let l=C;const s=S.titleWidth+15;r.concat(n.reverse()).forEach((t=>{l-=10;const e=t.title,{text:i,icon:n}=o(e,t,{text:{left:s,top:l},icon:{leftX:s,topY:l,...t.isExternal?{evented:!1,selectable:!1}:{},origin:{linkKey:t.linkKey}}});var r;l-=i.height||30,(r=n).on("moving",(()=>{r.set("originX","center"),W(r)?(g(r),v(r)):m.show=!1})),r.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&W(r)){const t=r.origin.linkKey||r.origin.key;if(x(k(),r.left,"key",2*M).includes(t))b("repeat");else{const e={data:{time:j(r.left),value:w(r.origin.type,r.top),...r.origin.linkKey?{key:r.origin.key}:{}},...r.origin};f("add",e),y({...e,key:t})}}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(r)})),p.value.add(i,n)}))}(),p.value.add(new t.Rect({left:0,top:0,width:N-E.strokeWidth,height:T-E.strokeWidth,fill:"transparent",...E}))}export{p as useLeft};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as s}from"../../constants/index.js";import"naive-ui";function d(d,u,
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as s}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";function d(d,c,u,f,h,m,g,p,v){const{cumputedX:x,getXValue:k}=o(c),{getEqualXTypes:y,handleAddPrevent:X,isGridLimit:b}=r(d,u,c),{other:P,yCellHeight:w,xCellWidth:j,endX:C,originX:E,originY:z,endY:A,markHeight:L,event:S,topGridYCellHeight:I}=c,H=new Map,M=l(P);function T(){var o;if(!(null==(o=null==M?void 0:M.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=M;let a=z+w/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:u={},data:f}=o;let h=null;f.forEach(((o,f)=>{const{time:m,value:g}=o,p=x(m);if(!B(p))return;const v=e(s,{...c,left:p,top:a}),k=p+v.width/2+2,y=i([k,a],{value:g,...u,originX:"left"}),X=new t.Group([v,y],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});Object.assign(X,{originLeft:p,iconHalfWidth:v.width/2,origin:{type:"other",key:n,dataIndex:r,index:f,data:o,title:l},limitX:{x1:E,x2:C-X.width}}),h&&(X.limitX.x1=h.left,h.limitX.x2=X.left,X.prevPoint=h,h.nextPoint=X),h=X,O(X),H.get(n).push(X),d.value.add(X)})),a+=w}))}function W(){var t;if(!(null==(t=null==M?void 0:M.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=M;o.forEach(((t,o)=>{const{textStyle:n={},data:r,time:a}=t,l=x(a);if(!B(l))return;let s=z+w/2;r.forEach(((t,r)=>{const a=e(String(t),{...n,lockMovementY:!0,left:l,originX:"left",top:s,origin:{type:"other",key:i,dataIndex:o,index:r,data:{value:t}}});s+=w,O(a),H.get(i).push(a),d.value.add(a)}));const c=H.get(i).filter((t=>t.origin.dataIndex===o)),u=Math.max(...c.map((t=>t.width))),f=l>C-u;c.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=u,f&&t.setCoords().set("originX","right")}))}))}function Y(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=M[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}V(t)}function V(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":T();break;case"vertical":W();break;case"mark":G()}}function G(){if(!(null==P?void 0:P.mark)||!L)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=P.mark,a=i([E-5,A+L/2],{value:t,...o,originX:"right"});d.value.add(a);const l=A+L,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=x(i);if(!B(r))return;let a=A;o.forEach((t=>{let i=!1;const o=e("circleAndText",{...n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),c=o.height;a+c<=l&&a>=A?(o.set("top",a+c/2),a+=c):(i||(a=A,i=!0),o.set("top",a-c/2),a-=c),s.push(o),O(o),d.value.add(o)}))})),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:E,x2:C};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function O(t){if(S.hovered&&(t.on("mouseover",(()=>{q(t)})),t.on("mouseout",(()=>{f.show=!1}))),!S.evented)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2);if("mark"===t.origin.key){t.top<z&&t.set("top",z);const e=A+L-t.height/2;t.top>e&&t.set("top",e)}t.originLeft&&t.iconHalfWidth&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(m(t),function(t){const e=t.left+t.maxTextWidth>C?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),S.hovered&&q(t)})),t.on("mouseup",(n=>{var r;if(f.show=!1,1===n.button){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=k(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),u("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(h.point={x:t.left,y:t.top},h.show=!0,h.target=t,h.list=s.map((t=>({...t,renderItem:()=>t.label}))))}))}function q(t){var e;f.point={x:t.left,y:"mark"===t.origin.key?t.top:t.top+I/2},f.list=[`时间 ${k(null!=(e=t.originLeft)?e:t.left).slice(-5)}`],"mark"===t.origin.key&&f.list.unshift(t.origin.data.name+" "),f.show=!0}function B(t){return t>=E&&t<=C}return function(){var t;if(!(null==(t=null==M?void 0:M.horizontal)?void 0:t.length))return;const{horizontal:i}=M,o=E-5;let n=z+w/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r},originLeft:o,originTop:n});var c;(c=s).on("moving",(()=>{c.set("originX","center"),b(c)?q(c):f.show=!1})),c.on("mouseup:before",(t=>{if(f.show=!1,0===t.e.button&&b(c))if(y(H.get("horizontal"),c.left,"key",j).includes(c.origin.key))X("repeat");else{const t={data:{time:k(c.left),value:c.origin.defaultAddValue},...c.origin};u("add",t),Y(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(c)})),d.value.add(s),n+=w}))}(),T(),W(),G(),n.on((()=>{const t="horizontal",e=g(H.get(t));e.length>0?p((()=>{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 Object.keys(e).map((t=>{const i=e[t];return M.horizontal[t].data.splice(i[0].index,i.length),i})).flat()}(e);V({key:t}),u("remove",i)})):v()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};u(i,o),"remove"===i&&Y(o,i)}}}export{d as useOther};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";function c(c,u,d,m,h){const{cumputedX:p,getXValue:v}=a(u),{originX:
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function c(c,u,d,m,h){const{cumputedX:p,getXValue:v}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const f=E(n,e,i);n&&(n.set(f),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:f,halfY:c}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:c};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,c],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),p=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,$(p),p}function $(t){I.hovered&&(t.on("mouseover",(()=>{W(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&W(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function W(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=v(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(c,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a}=S;if(!l)return;const f=[],u=X+l/2;r.forEach(((t,i)=>{const n=s+i*L*a;f.push(e([n,u],{value:t.slice(11,16)}))}));const d=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;d&&c.value.add(d);const m=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y}),h=e([x+(w-x)/2,u],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});c.value.add(m,h)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,v={value:h,...r};(null==(n=i.children)?void 0:n.length)?(v.value=h.split("").join("\n"),t(i.children)):(v.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=f(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:f,continue:c}=t,[u,d]=f,m=u&&p(u),h=d&&p(d),v=M({...r,x:m},{isCustomIcon:!h&&!c,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!c});let X;if((v||m<g)&&(L||h>x)){X=l([v?m:g,o,L?h:x,o],e)}const C={startLine:v,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),v&&z.add(v),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&c.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},v,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&c.value.add(a),z.size&&c.value.add(...z)}()}export{c as useTop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultTextStyle as i,defaultStyle as n}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";function o(o,s){const{xScaleList:
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultTextStyle as i,defaultStyle as n}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function o(o,s){const{xScaleList:r,originX:a,endX:l,endY:c,xCellWidth:h,canvasWidth:d,canvasHeight:u,bottom:p,breathingHeight:g,iconsWidth:m,borderStyle:v}=s;!function(){var s,d,u;if(!g||!p){const e=new t.Line([m,c-1,l,c-1],v);return o.value.add(e),e.sendToBack(),!1}const f=g,b=(null==(s=p.breathing)?void 0:s.list)||[],w=[];let j=!0;r.forEach(((t,n)=>{const o=a+n*h;let s="";b.forEach(((e,i)=>{const n=new Date(e.time).getTime();n>=t&&n<+t+t.scaleCell&&(s=e.value)}));const r=j?{top:-(f/2-10)}:{top:f/2-10};s&&(j=!j);const l=e({width:h,height:f,...v},Object.assign({},{text:String(s),...i},s?r:{}),{left:o,top:c});w.push(l)}));const x=e({width:l,height:f,...v},{text:String((null==(d=p.breathing)?void 0:d.title)+(null==(u=p.breathing)?void 0:u.unit)),...i,left:-(l-a)/2},{left:0,top:c});w.push(x);const S=w.length>0?new t.Group([...w],{...n}):null;S&&S.sendToBack(),S&&o.value.add(S)}()}export{o as useBottom};
|