cnhis-design-vue 3.2.1-beta.1 → 3.2.1-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/button-print/index.d.ts +1 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +15 -3
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/calendar/index.d.ts +11 -1
- package/es/components/calendar/src/Calendar.vue.d.ts +11 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +266 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/classification/src/index.vue.d.ts +3 -3
- package/es/components/drag-scroll/src/index.d.ts +3 -3
- package/es/components/drag-scroll/src/index.js +1 -1
- package/es/components/drag-scroll/src/types.d.ts +12 -7
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/field-set/index.d.ts +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -0
- package/es/components/field-set/src/Index.vue.d.ts +1 -1
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue.d.ts +71 -0
- package/es/components/field-set/src/TableStyle.vue.js +1 -0
- package/es/components/field-set/src/TableStyle.vue2.js +1 -0
- package/es/components/field-set/src/components/Row.vue.d.ts +1 -0
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +266 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +266 -0
- package/es/components/iho-table/src/plugins/dragScrollPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.d.ts +4 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/types.d.ts +11 -7
- package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.d.ts +17 -4
- package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +2 -0
- package/es/components/iho-table/src/utils/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/search-cascader/index.d.ts +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +1 -1
- package/es/components/search-cascader/src/components/SearchMenu.d.ts +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/style/index.css +1 -1
- package/es/components/table-export-field/style/table-export-field-iconfont.ttf +0 -0
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_1.png.js +1 -0
- package/es/shared/assets/img/table_style_2.png.js +1 -0
- package/es/shared/assets/img/table_style_3.png.js +1 -0
- package/es/shared/assets/img/table_style_4.png.js +1 -0
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/index.js +1 -1
- package/package.json +3 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -3030,6 +3030,139 @@ export declare const CallbackMaps: Map<string, {
|
|
|
3030
3030
|
isBatchSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
|
|
3031
3031
|
isSingleSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
|
|
3032
3032
|
dragScroll?: boolean | undefined;
|
|
3033
|
+
dragScrollConfig?: {
|
|
3034
|
+
dragEle?: string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | HTMLElement | {
|
|
3035
|
+
[x: string]: any;
|
|
3036
|
+
setup?: ((this: void, props: Readonly<import("@vue/shared").LooseRequired<any>>, ctx: import("vue").SetupContext<any>) => any) | undefined;
|
|
3037
|
+
name?: string | undefined;
|
|
3038
|
+
template?: string | object | undefined;
|
|
3039
|
+
render?: Function | undefined;
|
|
3040
|
+
components?: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>> | undefined;
|
|
3041
|
+
directives?: Record<string, import("vue").Directive<any, any>> | undefined;
|
|
3042
|
+
inheritAttrs?: boolean | undefined;
|
|
3043
|
+
emits?: any;
|
|
3044
|
+
expose?: string[] | undefined;
|
|
3045
|
+
serverPrefetch?: (() => Promise<any>) | undefined;
|
|
3046
|
+
compilerOptions?: {
|
|
3047
|
+
isCustomElement?: ((tag: string) => boolean) | undefined;
|
|
3048
|
+
whitespace?: "preserve" | "condense" | undefined;
|
|
3049
|
+
comments?: boolean | undefined;
|
|
3050
|
+
delimiters?: [string, string] | undefined;
|
|
3051
|
+
} | undefined;
|
|
3052
|
+
call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
|
|
3053
|
+
__isFragment?: undefined;
|
|
3054
|
+
__isTeleport?: undefined;
|
|
3055
|
+
__isSuspense?: undefined;
|
|
3056
|
+
__defaults?: {} | undefined;
|
|
3057
|
+
compatConfig?: {
|
|
3058
|
+
GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
|
|
3059
|
+
GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
|
|
3060
|
+
GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
|
|
3061
|
+
GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
|
|
3062
|
+
GLOBAL_SET?: boolean | "suppress-warning" | undefined;
|
|
3063
|
+
GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
|
|
3064
|
+
GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
|
|
3065
|
+
GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
|
|
3066
|
+
CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
|
|
3067
|
+
CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
|
|
3068
|
+
CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
|
|
3069
|
+
CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
|
|
3070
|
+
CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
|
|
3071
|
+
CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
|
|
3072
|
+
CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
|
|
3073
|
+
INSTANCE_SET?: boolean | "suppress-warning" | undefined;
|
|
3074
|
+
INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
|
|
3075
|
+
INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
|
|
3076
|
+
INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
|
|
3077
|
+
INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
|
|
3078
|
+
INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
|
|
3079
|
+
INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
|
|
3080
|
+
INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
|
|
3081
|
+
INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
|
|
3082
|
+
OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
|
|
3083
|
+
OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
|
|
3084
|
+
OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
|
|
3085
|
+
OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
|
|
3086
|
+
WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
|
|
3087
|
+
PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
|
|
3088
|
+
V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
|
|
3089
|
+
CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
|
|
3090
|
+
ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
|
|
3091
|
+
ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
|
|
3092
|
+
TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
|
|
3093
|
+
TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
|
|
3094
|
+
COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
|
|
3095
|
+
COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
|
|
3096
|
+
COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
|
|
3097
|
+
RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
|
|
3098
|
+
FILTERS?: boolean | "suppress-warning" | undefined;
|
|
3099
|
+
PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
|
|
3100
|
+
MODE?: 2 | 3 | ((comp: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | null) => 2 | 3) | undefined;
|
|
3101
|
+
} | undefined;
|
|
3102
|
+
data?: ((this: any, vm: any) => any) | undefined;
|
|
3103
|
+
computed?: import("vue").ComputedOptions | undefined;
|
|
3104
|
+
methods?: import("vue").MethodOptions | undefined;
|
|
3105
|
+
watch?: {
|
|
3106
|
+
[x: string]: (string | import("vue").WatchCallback<any, any> | ({
|
|
3107
|
+
handler: string | import("vue").WatchCallback<any, any>;
|
|
3108
|
+
} & import("vue").WatchOptions<boolean>)) | (string | import("vue").WatchCallback<any, any> | ({
|
|
3109
|
+
handler: string | import("vue").WatchCallback<any, any>;
|
|
3110
|
+
} & import("vue").WatchOptions<boolean>))[];
|
|
3111
|
+
} | undefined;
|
|
3112
|
+
provide?: import("vue").ComponentProvideOptions | undefined;
|
|
3113
|
+
inject?: (string[] | {
|
|
3114
|
+
[x: string]: string | symbol | {
|
|
3115
|
+
from?: string | symbol | undefined;
|
|
3116
|
+
default?: unknown;
|
|
3117
|
+
};
|
|
3118
|
+
[x: symbol]: string | symbol | {
|
|
3119
|
+
from?: string | symbol | undefined;
|
|
3120
|
+
default?: unknown;
|
|
3121
|
+
};
|
|
3122
|
+
}) | undefined;
|
|
3123
|
+
filters?: Record<string, Function> | undefined;
|
|
3124
|
+
mixins?: any[] | undefined;
|
|
3125
|
+
extends?: any;
|
|
3126
|
+
beforeCreate?: (() => void) | undefined;
|
|
3127
|
+
created?: (() => void) | undefined;
|
|
3128
|
+
beforeMount?: (() => void) | undefined;
|
|
3129
|
+
mounted?: (() => void) | undefined;
|
|
3130
|
+
beforeUpdate?: (() => void) | undefined;
|
|
3131
|
+
updated?: (() => void) | undefined;
|
|
3132
|
+
activated?: (() => void) | undefined;
|
|
3133
|
+
deactivated?: (() => void) | undefined;
|
|
3134
|
+
beforeDestroy?: (() => void) | undefined;
|
|
3135
|
+
beforeUnmount?: (() => void) | undefined;
|
|
3136
|
+
destroyed?: (() => void) | undefined;
|
|
3137
|
+
unmounted?: (() => void) | undefined;
|
|
3138
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | undefined;
|
|
3139
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | undefined;
|
|
3140
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | undefined;
|
|
3141
|
+
delimiters?: [string, string] | undefined;
|
|
3142
|
+
__differentiator?: string | number | symbol | undefined;
|
|
3143
|
+
__isBuiltIn?: boolean | undefined;
|
|
3144
|
+
__file?: string | undefined;
|
|
3145
|
+
__name?: string | undefined;
|
|
3146
|
+
} | undefined;
|
|
3147
|
+
changeCursor?: boolean | undefined;
|
|
3148
|
+
scrollTarget?: any;
|
|
3149
|
+
duration?: number | undefined;
|
|
3150
|
+
type?: "px" | "percent" | undefined;
|
|
3151
|
+
isDraggableEle?: ((event: MouseEvent) => boolean) | undefined;
|
|
3152
|
+
getScrollState?: ((target: import("../../../..").DragScrollTargetType | undefined) => {
|
|
3153
|
+
scrollTop: number;
|
|
3154
|
+
scrollLeft: number;
|
|
3155
|
+
}) | undefined;
|
|
3156
|
+
setScrollState?: ((target: import("../../../..").DragScrollTargetType | undefined, state: {
|
|
3157
|
+
scrollTarget: any;
|
|
3158
|
+
scrollTop: number;
|
|
3159
|
+
scrollLeft: number;
|
|
3160
|
+
offsetX: number;
|
|
3161
|
+
offsetY: number;
|
|
3162
|
+
startScrollX: number;
|
|
3163
|
+
startScrollY: number;
|
|
3164
|
+
}) => void) | undefined;
|
|
3165
|
+
} | undefined;
|
|
3033
3166
|
selectType?: "checkbox" | "radio" | null | undefined;
|
|
3034
3167
|
rowDraggable?: boolean | undefined;
|
|
3035
3168
|
showSeq?: boolean | undefined;
|
|
@@ -5494,6 +5627,139 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5494
5627
|
isBatchSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
|
|
5495
5628
|
isSingleSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
|
|
5496
5629
|
dragScroll?: boolean | undefined;
|
|
5630
|
+
dragScrollConfig?: {
|
|
5631
|
+
dragEle?: string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | HTMLElement | {
|
|
5632
|
+
[x: string]: any;
|
|
5633
|
+
setup?: ((this: void, props: Readonly<import("@vue/shared").LooseRequired<any>>, ctx: import("vue").SetupContext<any>) => any) | undefined;
|
|
5634
|
+
name?: string | undefined;
|
|
5635
|
+
template?: string | object | undefined;
|
|
5636
|
+
render?: Function | undefined;
|
|
5637
|
+
components?: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>> | undefined;
|
|
5638
|
+
directives?: Record<string, import("vue").Directive<any, any>> | undefined;
|
|
5639
|
+
inheritAttrs?: boolean | undefined;
|
|
5640
|
+
emits?: any;
|
|
5641
|
+
expose?: string[] | undefined;
|
|
5642
|
+
serverPrefetch?: (() => Promise<any>) | undefined;
|
|
5643
|
+
compilerOptions?: {
|
|
5644
|
+
isCustomElement?: ((tag: string) => boolean) | undefined;
|
|
5645
|
+
whitespace?: "preserve" | "condense" | undefined;
|
|
5646
|
+
comments?: boolean | undefined;
|
|
5647
|
+
delimiters?: [string, string] | undefined;
|
|
5648
|
+
} | undefined;
|
|
5649
|
+
call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
|
|
5650
|
+
__isFragment?: undefined;
|
|
5651
|
+
__isTeleport?: undefined;
|
|
5652
|
+
__isSuspense?: undefined;
|
|
5653
|
+
__defaults?: {} | undefined;
|
|
5654
|
+
compatConfig?: {
|
|
5655
|
+
GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
|
|
5656
|
+
GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
|
|
5657
|
+
GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
|
|
5658
|
+
GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
|
|
5659
|
+
GLOBAL_SET?: boolean | "suppress-warning" | undefined;
|
|
5660
|
+
GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
|
|
5661
|
+
GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
|
|
5662
|
+
GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
|
|
5663
|
+
CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
|
|
5664
|
+
CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
|
|
5665
|
+
CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
|
|
5666
|
+
CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
|
|
5667
|
+
CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
|
|
5668
|
+
CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
|
|
5669
|
+
CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
|
|
5670
|
+
INSTANCE_SET?: boolean | "suppress-warning" | undefined;
|
|
5671
|
+
INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
|
|
5672
|
+
INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
|
|
5673
|
+
INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
|
|
5674
|
+
INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
|
|
5675
|
+
INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
|
|
5676
|
+
INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
|
|
5677
|
+
INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
|
|
5678
|
+
INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
|
|
5679
|
+
OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
|
|
5680
|
+
OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
|
|
5681
|
+
OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
|
|
5682
|
+
OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
|
|
5683
|
+
WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
|
|
5684
|
+
PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
|
|
5685
|
+
V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
|
|
5686
|
+
CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
|
|
5687
|
+
ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
|
|
5688
|
+
ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
|
|
5689
|
+
TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
|
|
5690
|
+
TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
|
|
5691
|
+
COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
|
|
5692
|
+
COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
|
|
5693
|
+
COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
|
|
5694
|
+
RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
|
|
5695
|
+
FILTERS?: boolean | "suppress-warning" | undefined;
|
|
5696
|
+
PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
|
|
5697
|
+
MODE?: 2 | 3 | ((comp: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | null) => 2 | 3) | undefined;
|
|
5698
|
+
} | undefined;
|
|
5699
|
+
data?: ((this: any, vm: any) => any) | undefined;
|
|
5700
|
+
computed?: import("vue").ComputedOptions | undefined;
|
|
5701
|
+
methods?: import("vue").MethodOptions | undefined;
|
|
5702
|
+
watch?: {
|
|
5703
|
+
[x: string]: (string | import("vue").WatchCallback<any, any> | ({
|
|
5704
|
+
handler: string | import("vue").WatchCallback<any, any>;
|
|
5705
|
+
} & import("vue").WatchOptions<boolean>)) | (string | import("vue").WatchCallback<any, any> | ({
|
|
5706
|
+
handler: string | import("vue").WatchCallback<any, any>;
|
|
5707
|
+
} & import("vue").WatchOptions<boolean>))[];
|
|
5708
|
+
} | undefined;
|
|
5709
|
+
provide?: import("vue").ComponentProvideOptions | undefined;
|
|
5710
|
+
inject?: (string[] | {
|
|
5711
|
+
[x: string]: string | symbol | {
|
|
5712
|
+
from?: string | symbol | undefined;
|
|
5713
|
+
default?: unknown;
|
|
5714
|
+
};
|
|
5715
|
+
[x: symbol]: string | symbol | {
|
|
5716
|
+
from?: string | symbol | undefined;
|
|
5717
|
+
default?: unknown;
|
|
5718
|
+
};
|
|
5719
|
+
}) | undefined;
|
|
5720
|
+
filters?: Record<string, Function> | undefined;
|
|
5721
|
+
mixins?: any[] | undefined;
|
|
5722
|
+
extends?: any;
|
|
5723
|
+
beforeCreate?: (() => void) | undefined;
|
|
5724
|
+
created?: (() => void) | undefined;
|
|
5725
|
+
beforeMount?: (() => void) | undefined;
|
|
5726
|
+
mounted?: (() => void) | undefined;
|
|
5727
|
+
beforeUpdate?: (() => void) | undefined;
|
|
5728
|
+
updated?: (() => void) | undefined;
|
|
5729
|
+
activated?: (() => void) | undefined;
|
|
5730
|
+
deactivated?: (() => void) | undefined;
|
|
5731
|
+
beforeDestroy?: (() => void) | undefined;
|
|
5732
|
+
beforeUnmount?: (() => void) | undefined;
|
|
5733
|
+
destroyed?: (() => void) | undefined;
|
|
5734
|
+
unmounted?: (() => void) | undefined;
|
|
5735
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | undefined;
|
|
5736
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | undefined;
|
|
5737
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | undefined;
|
|
5738
|
+
delimiters?: [string, string] | undefined;
|
|
5739
|
+
__differentiator?: string | number | symbol | undefined;
|
|
5740
|
+
__isBuiltIn?: boolean | undefined;
|
|
5741
|
+
__file?: string | undefined;
|
|
5742
|
+
__name?: string | undefined;
|
|
5743
|
+
} | undefined;
|
|
5744
|
+
changeCursor?: boolean | undefined;
|
|
5745
|
+
scrollTarget?: any;
|
|
5746
|
+
duration?: number | undefined;
|
|
5747
|
+
type?: "px" | "percent" | undefined;
|
|
5748
|
+
isDraggableEle?: ((event: MouseEvent) => boolean) | undefined;
|
|
5749
|
+
getScrollState?: ((target: import("../../../..").DragScrollTargetType | undefined) => {
|
|
5750
|
+
scrollTop: number;
|
|
5751
|
+
scrollLeft: number;
|
|
5752
|
+
}) | undefined;
|
|
5753
|
+
setScrollState?: ((target: import("../../../..").DragScrollTargetType | undefined, state: {
|
|
5754
|
+
scrollTarget: any;
|
|
5755
|
+
scrollTop: number;
|
|
5756
|
+
scrollLeft: number;
|
|
5757
|
+
offsetX: number;
|
|
5758
|
+
offsetY: number;
|
|
5759
|
+
startScrollX: number;
|
|
5760
|
+
startScrollY: number;
|
|
5761
|
+
}) => void) | undefined;
|
|
5762
|
+
} | undefined;
|
|
5497
5763
|
selectType?: "checkbox" | "radio" | null | undefined;
|
|
5498
5764
|
rowDraggable?: boolean | undefined;
|
|
5499
5765
|
showSeq?: boolean | undefined;
|
|
@@ -699,6 +699,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
699
699
|
handleInitConditions: () => Promise<void>;
|
|
700
700
|
validate: () => Promise<unknown>;
|
|
701
701
|
saveAdd: () => void;
|
|
702
|
+
/**
|
|
703
|
+
* 改变展示方式
|
|
704
|
+
*/
|
|
702
705
|
cancelSaveAdd: () => void;
|
|
703
706
|
checkActionList: () => boolean;
|
|
704
707
|
NSpin: any;
|
|
@@ -1447,9 +1450,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1447
1450
|
isSecondDisabled(second: number, minute: number | null, hour: number | null): boolean | 0;
|
|
1448
1451
|
};
|
|
1449
1452
|
NSelect: any;
|
|
1450
|
-
/**
|
|
1451
|
-
* 改变展示方式
|
|
1452
|
-
*/
|
|
1453
1453
|
NPopover: any;
|
|
1454
1454
|
CDatePicker: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
|
1455
1455
|
updateUnchangedValue: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Directive } from 'vue';
|
|
2
|
-
import { DragScrollConfig } from '../../../components/drag-scroll';
|
|
3
|
-
export declare function useDragScroll(uuid: any, config: DragScrollConfig): () => void;
|
|
4
|
-
export declare const DragScroll: Directive<HTMLElement, Partial<DragScrollConfig
|
|
2
|
+
import { DragScrollConfig, DragScrollTargetType } from '../../../components/drag-scroll';
|
|
3
|
+
export declare function useDragScroll<T extends DragScrollTargetType>(uuid: any, config: DragScrollConfig<T>): () => void;
|
|
4
|
+
export declare const DragScroll: Directive<HTMLElement, Partial<DragScrollConfig<any>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findAncestor as e,isHTMLElement as t}from"../../../shared/utils/index.js";import{useThrottleFn as r}from"@vueuse/core";import{isFunction as
|
|
1
|
+
import{findAncestor as e,isHTMLElement as t}from"../../../shared/utils/index.js";import{useThrottleFn as r}from"@vueuse/core";import{isFunction as l,isObject as s,isString as o,flow as n}from"lodash-es";import{unref as a}from"vue";const c={events:new Map,regist(e,t,r){window.addEventListener(t,r);const l=this.events.get(e)||[];l.push((()=>window.removeEventListener(t,r))),this.events.set(e,l)},stopper(e){var t;n(null!=(t=this.events.get(e))?t:[])(),this.events.delete(e)}};class i{constructor(){this.queue=[],this.lock=!1}add(e){this.queue.push(e),this.execute()}async execute(){if(!this.lock){this.lock=!0;try{for(;this.queue.length;)await this.queue.shift()()}finally{this.lock=!1}}}clear(){this.queue.length=0}}function u(o,n){var a;c.stopper(o);let u=0,g=0,d=0,p=0,f=!1;const m=new i;return c.regist(o,"mousemove",r((r=>{var s;if(!f){const t=h(n.dragEle);if(!t)return;if(!1!==n.changeCursor){const s=r.target;if(!e(s,(e=>e===t)))return;const o=!l(n.isDraggableEle)||n.isDraggableEle(r);t.style.cursor=o?"grab":"default"}return}const{pageX:o,pageY:a}=r,c=o-u,i=a-g;m.add((()=>{let e=Math.max(0,d-c),r=Math.max(0,p-i);const s=h(n.scrollTarget);if("percent"===n.type)if(t(s)){const{scrollWidth:t,scrollHeight:l,clientHeight:o,clientWidth:n}=s;e=Math.max(0,d-c/n*t),r=Math.max(0,p-i/o*l)}else console.warn(`[DragScroll]: scrollTarget ${s} is not HTMLElement`);l(n.setScrollState)?n.setScrollState(n.scrollTarget,{scrollTarget:n.scrollTarget,scrollLeft:e,scrollTop:r,startScrollX:d,startScrollY:p,offsetX:c,offsetY:i}):null==s||s.scrollTo(e,r)})),window.getSelection&&(null==(s=window.getSelection())||s.removeAllRanges())}),null!=(a=n.duration)?a:50)),c.regist(o,"mousedown",(t=>{const r=h(n.dragEle);if(!r)return;const o=t.target;if(!e(o,(e=>e===r)))return;if(!(!l(n.isDraggableEle)||n.isDraggableEle(t)))return;const a=l(n.getScrollState)?n.getScrollState(n.scrollTarget):h(n.scrollTarget);s(a)&&(u=t.pageX,g=t.pageY,d=a.scrollLeft,p=a.scrollTop,f=!0)})),c.regist(o,"mouseup",(()=>{f=!1,m.clear()})),()=>c.stopper(o)}const g={mounted(e,t){u(e,Object.assign({dragEle:e,scrollTarget:e},t.value))},unmounted(e){c.stopper(e)},updated(e,t){c.stopper(e),u(e,Object.assign({dragEle:e,scrollTarget:e},t.value))}};function h(e){return e=a(e),o(e)?document.querySelector(e):t(e)?e:s(e)?Reflect.get(e,"$el"):null}export{g as DragScroll,u as useDragScroll};
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { MaybeRef } from '@vueuse/shared';
|
|
2
2
|
import { Component } from 'vue';
|
|
3
|
-
declare type
|
|
4
|
-
export declare type DragScrollConfig = Partial<{
|
|
5
|
-
dragEle:
|
|
3
|
+
export declare type DragScrollTargetType = MaybeRef<HTMLElement | string | Component>;
|
|
4
|
+
export declare type DragScrollConfig<T extends DragScrollTargetType = any> = Partial<{
|
|
5
|
+
dragEle: DragScrollTargetType;
|
|
6
6
|
changeCursor: boolean;
|
|
7
|
-
scrollTarget:
|
|
7
|
+
scrollTarget: T;
|
|
8
8
|
duration: number;
|
|
9
|
+
type: 'percent' | 'px';
|
|
9
10
|
isDraggableEle: (event: MouseEvent) => boolean;
|
|
10
|
-
getScrollState: (target:
|
|
11
|
+
getScrollState: (target: DragScrollTargetType | undefined) => {
|
|
11
12
|
scrollTop: number;
|
|
12
13
|
scrollLeft: number;
|
|
13
14
|
};
|
|
14
|
-
setScrollState: (target:
|
|
15
|
+
setScrollState: (target: DragScrollTargetType | undefined, state: {
|
|
16
|
+
scrollTarget: T;
|
|
15
17
|
scrollTop: number;
|
|
16
18
|
scrollLeft: number;
|
|
19
|
+
offsetX: number;
|
|
20
|
+
offsetY: number;
|
|
21
|
+
startScrollX: number;
|
|
22
|
+
startScrollY: number;
|
|
17
23
|
}) => void;
|
|
18
24
|
}>;
|
|
19
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,inject as a,computed as t,watch as u,openBlock as n,createBlock as i,unref as o,normalizeClass as v,isRef as d,withCtx as r,createVNode as s,normalizeStyle as p,createElementVNode as f,createTextVNode as m,createCommentVNode as c,createElementBlock as y,Fragment as h,renderList as _,withDirectives as g,withKeys as b,withModifiers as x,vShow as k,toDisplayString as M}from"vue";import{useMessage as w,NModal as H,NCard as C,NButton as U,NForm as S,NFormItem as j,NInput as O,NTooltip as I,NSelect as z,NGrid as T,NGridItem as N,NIcon as Y,NInputNumber as $,NPopover as L,NDatePicker as V,NTimePicker as B,NSwitch as D}from"naive-ui";import{isMulti as F,isShowOptions as P,isNumber as q,isDate as A,isCandidate as E,isTextarea as J}from"../utils/index.js";import K from"moment";import{InjectionExpandFieldApiConfig as R}from"../constants/index.js";import W from"../hooks/useAsyncData.js";import{HtmlTypeList as X}from"../utils/constant.js";import{isJSON as G,isValidDate as Q}from"../utils/tool.js";import Z from"./FormBatchOptionsModal.vue.js";import ee from"./FormItemPerson.vue.js";const le={class:"svg-wrap"},ae={class:"flex_right"},te={class:"options-title"},ue=f("span",null,"字段键名",-1),ne=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),ie={class:"options-title"},oe=f("span",null,"字段问号提示",-1),ve=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),de={class:"options-title"},re=f("span",null,"选项值",-1),se=f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},[f("path",{d:"M12 12h2v12h-2z",fill:"currentColor"}),f("path",{d:"M18 12h2v12h-2z",fill:"currentColor"}),f("path",{d:"M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z",fill:"currentColor"}),f("path",{d:"M12 2h8v2h-8z",fill:"currentColor"})],-1),pe={class:"options-title"},fe=f("span",null,"默认值",-1),me=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),ce={style:{display:"flex","align-items":"center"}},ye=f("span",null,"选择",-1),he={style:{width:"100%"}},_e={key:0,class:"validate_tip"};var ge=e({__name:"form",props:{visible:{type:Boolean,default:!1},formOntype:{type:String,default:"add"},formItemData:{type:Object,default:()=>({})},id:{type:String,default:""},orgId:{type:String,default:""},conditionList:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},emits:["cancelModal"],setup(e,{emit:ge}){const be=e,xe=w(),ke="请输入默认值",Me={name:[{required:!0,message:"请输入字段标题",trigger:["input","blur"]}],html_type:[{required:!0,message:"请选择字段类型",trigger:["input","blur"]}]},we=[{value:"yyyy-MM-dd HH:mm:ss",label:"年-月-日 时:分:秒"},{value:"yyyy-MM-dd HH:mm",label:"年-月-日 时:分"},{value:"yyyy-MM-dd",label:"年-月-日"},{value:"yyyy-MM",label:"年-月"},{value:"MM-dd HH:mm",label:"月-日 时:分"},{value:"MM-dd",label:"月-日"},{value:"HH:mm:ss",label:"时:分:秒"},{value:"HH:mm",label:"时:分"}],He=[{value:"12",label:"整行"},{value:"6",label:"半行"},{value:"4",label:"1/3行"},{value:"8",label:"2/3行"},{value:"3",label:"1/4行"},{value:"9",label:"3/4行"},{value:"2",label:"1/6行"},{value:"10",label:"5/6行"},{value:"1.5",label:"1/8行"},{value:"10.5",label:"7/8行"}],Ce=l(!1),Ue=l("860px");let Se=l({maxHeight:"496px",height:"496px"});const{saveOrUpdateExtendField:je}=W(),Oe=a(R),Ie=l(null),ze=l({name:void 0,remark:void 0,is_edit:"1",is_null:"1",is_show:"1",key:"",val_key:void 0,validate:{},html_type:"INPUT",name_i18n:void 0,elem_width:"12",default_val:void 0,label_type:void 0,isMultiSelect:"0",decimal_length:void 0,date_format:""}),Te=l([{text:void 0,value:void 0}]),Ne=l({format:"yyyy-MM-dd HH:mm:ss",dateType:"date",mode:"date",value:null,showTime:!0,open:!1,componentType:"datetime"}),Ye=l({obj_type:"",vali_obj:"",event_obj:"",max_length:"",min_length:"",min_value:"",max_value:""}),$e=l({value_key:"",levelSetting:[],search_key:[],level_num:void 0,render_key:[],name:"",level_key:"",id:"",type:"",primary_key:"",sqlExpression:"",conObj:"",add_btn:"",setting:{cascading:[]}}),Le=l(!1),Ve=l(!1),Be=l(void 0),De=l(!1),Fe=l(!1);l(!1);const Pe=l(!1),qe=l(""),Ae=t((()=>"edit"===be.formOntype)),Ee=t((()=>ze.value.html_type||""));t((()=>"TEXTAREA"===Ee.value?1e3:255));const Je=t((()=>Te.value.filter((e=>e.value&&e.text)))),Ke=t((()=>F(Ee.value))),Re=t((()=>"date"===Ne.value.dateType));function We(e){Pe.value=e}function Xe(e){let l=e;"string"!=typeof e&&(l=JSON.stringify(e)),ze.value.default_val=l}function Ge(e){Ne.value.value=null,ze.value.default_val=void 0,il(e)}function Qe(){Ce.value=!Ce.value;let e=document.body.clientHeight;"860px"===Ue.value?(Ue.value="100%",Se.value.maxHeight=`${e}px`,Se.value.height=`${e}px`):(Ue.value="860px",Se.value.maxHeight="496px",Se.value.height="")}function Ze(e){return["HH:mm:ss","HH:mm"].includes(e)}function el(e,l){switch(e){case"isNull":Le.value=l,ze.value.is_null=l?"0":"1";break;case"isMultiSelect":Ve.value=l,ze.value.isMultiSelect=l?"1":"0"}}function ll(){if("add"===be.formOntype)return;let e=Object.assign({},be.formItemData),l=e.setting;l&&G(l)&&(l=JSON.parse(l),delete e.setting,Object.assign(e,{...l})),e.key=e.code,delete e.code,A(e.html_type)&&function(e){il(e.date_format);let l=e.default_val;l&&!l.startsWith("${")&&(Ze(e.date_format)&&(l=`${K().format("YYYY-MM-dd")} ${l}`),Q(new Date(l))&&(Ne.value.value=K(l)))}(e),F(e.html_type)&&(e.default_val=function(e){let l=e.default_val;return l?l.split(",").filter(Boolean):[]}(e)),Le.value="0"==e.is_null,Ve.value="1"==e.isMultiSelect,Ye.value=Object.assign(Ye.value,e.validate||{}),$e.value=Object.assign($e.value,e.wordbook||{}),ze.value=Object.assign(ze.value,e||{}),P(e.html_type)&&function(e){let l=(null==e?void 0:e.optionValue)||[];l.length||l.push({text:void 0,value:void 0}),Te.value=[...l],delete e.optionValue}(e)}function al(e){ze.value.html_type=e,Te.value=[{text:void 0,value:void 0}];let l=function(){if(F(Ee.value))return[]}();ze.value.default_val=l,A(e)?ze.value.date_format="yyyy-MM-dd HH:mm:ss":ze.value.date_format=""}function tl(){Te.value.push({value:"",text:""})}function ul(e){let l=e;(e<0||0===e)&&(l=0),e>5&&(l=5),Be.value=0===l?l:l||void 0}function nl(e){Te.value=e}function il(e){let l=e||"yyyy-MM-dd HH:mm:ss",a=Ze(l)?"time":"date",t="yyyy-MM"===l?"month":"date";let u=function(e){return["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd HH:mm"].includes(e)}(l),n="";["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd HH:mm"].includes(e)&&(n="datetime"),["yyyy-MM-dd","MM-dd"].includes(e)&&(n="date"),Object.assign(Ne.value,{format:l,dateType:a,mode:t,showTime:u,componentType:n})}function ol(e,l){if(e)return l&&(l.includes("yyyy")&&(l=l.replace("yyyy","YYYY")),l.includes("dd")&&(l=l.replace("dd","DD"))),K(e).format(l)}function vl(){Ne.value.open=!Ne.value.open}function dl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l}function rl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l,Ne.value.format.includes("HH:mm")||vl()}function sl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l}function pl(){ge("cancelModal"),Ue.value="860px",Se.value={height:"496px",maxHeight:"496px"},Ce.value=!1,ze.value={name:void 0,remark:void 0,is_edit:"1",is_null:"1",is_show:"1",key:"",val_key:void 0,validate:{},html_type:"INPUT",name_i18n:void 0,elem_width:"12",default_val:void 0,label_type:void 0,isMultiSelect:"0",decimal_length:void 0,date_format:""}}function fl(){var e;null==(e=Ie.value)||e.validate((async e=>{if(e)return;let l=Object.assign({},ze.value);if(l.validate={...Ye.value},l.extendId=be.id,P(Ee.value)){let e=function(){let e={validate:!1,message:"请完善选项配置"};if(!Te.value||!Te.value.length)return e;let l,a,t,u=0,n=Te.value.length,i=!1;for(;u<n;u++){if(l=Te.value[u],a=l.value?l.value.trim():l.value,t=l.text?l.text.trim():l.text,!a||!t){i=!0;break}l.value=a,l.text=t}return[...new Set(Te.value.map((e=>e.value)))].length!==Te.value.length?(e.message="选项值不能重复",e):(!i&&(e.validate=!0),e)}();if(!e.validate)return De.value=!0,void xe.warning(e.message);De.value=!1,l.option=[...Te.value]}if(q(Ee.value)?l.default_val=function(e){let l=e.default_val;if(void 0===Be.value)return l;if(!l)return l;let a=String(l).split(".")[1];return a&&a.length!==Be.value?Number(l.toFixed(Be.value)):l}(l):F(Ee.value)&&(l.default_val=l.default_val.join(",")),!E(Ee.value)||function(e){let{default_val:l}=e;qe.value="",l&&G(l)&&(l=JSON.parse(l));let a=function(e,l){if(!e)return;if("string"!=typeof e)return;if(!(e=e.trim()))return!0;if(!e.startsWith("${"))return ml(l,"请输入有效系统变量"),"error";let a=/\${sys.(.*?)\}/g.exec(e);if(!a||!a[1])return ml(l,"请输入有效系统变量"),"error";return!0}(l,e);if(a)return"error"!==a;if(console.log("saveOjb.isMultiSelect>>>",e.isMultiSelect),console.log("default_val?.length>>>",null==l?void 0:l.length),"0"===e.isMultiSelect&&(null==l?void 0:l.length)>1)return console.log("进入到判断里面了>>>>>"),ml(e,"选人组件为单选"),!1;return!0}(l)){for(let e in l){let a=l[e];"string"==typeof a&&(l[e]=null==a?void 0:a.trim())}console.log("saveOjb>>>",l),await async function(e={}){Fe.value=!0;try{const l=await je(e,Oe);if(Fe.value=!1,"SUCCESS"!==(null==l?void 0:l.result))return void xe.error((null==l?void 0:l.resultMsg)||"保存失败");pl()}catch(e){Fe.value=!1}}(l)}}))}function ml(e,l){qe.value=l}return u((()=>be.visible),(e=>{e&&ll()})),(l,a)=>(n(),i(o(H),{class:v(["expand-field-modal-block",{"modal-screen":Ce.value}]),show:e.visible,"onUpdate:show":a[22]||(a[22]=e=>d(visible)?visible.value=e:null),maskClosable:!1,width:Ue.value,bodyStyle:o(Se),closable:!1,centered:"",onPositiveClick:fl,onNegativeClick:pl},{default:r((()=>[s(o(C),{style:p({width:Ue.value,...o(Se)}),title:"add"===be.formOntype?"新增拓展字段":"编辑拓展字段",bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":r((()=>[f("div",le,[f("i",{onClick:Qe,class:v(["iconfont-expand-field",Ce.value?"icon-expand-field-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-expand-field-menzhenyishengzhanxitongtubiaozuidahua"])},null,2),f("i",{onClick:pl,class:"iconfont-expand-field icon-expand-field-menzhenyishengzhanxitongtubiaoguanbi"})])])),footer:r((()=>[f("div",ae,[s(o(U),{onClick:pl},{default:r((()=>[m("取消")])),_:1}),s(o(U),{type:"info",onClick:fl},{default:r((()=>[m("保存")])),_:1})])])),default:r((()=>[s(o(S),{ref_key:"formRef",ref:Ie,model:ze.value,rules:Me},{default:r((()=>[s(o(j),{path:"name",label:"字段标题","require-mark-placement":"left"},{default:r((()=>[s(o(O),{value:ze.value.name,"onUpdate:value":a[0]||(a[0]=e=>ze.value.name=e),maxlength:100,clearable:"",placeholder:"请输入"},null,8,["value"])])),_:1}),s(o(j),{path:"key"},{label:r((()=>[f("div",te,[ue,s(o(I),{duration:0},{trigger:r((()=>[ne])),default:r((()=>[m(" 数据库字段键名,不填写时由系统生成,填写则以填写为准 ")])),_:1})])])),default:r((()=>[s(o(O),{value:ze.value.key,"onUpdate:value":a[1]||(a[1]=e=>ze.value.key=e),maxlength:32,disabled:o(Ae),clearable:"",placeholder:"数据库字段键名,不填写时由系统生成,填写则以填写为准"},null,8,["value","disabled"])])),_:1}),s(o(j),{path:"html_type",label:"字段类型","require-mark-placement":"left"},{default:r((()=>[s(o(z),{value:ze.value.html_type,"onUpdate:value":[a[2]||(a[2]=e=>ze.value.html_type=e),al],placeholder:"请选择字段类型",clearable:"",filterable:"",options:o(X)},null,8,["value","options"])])),_:1}),s(o(j),{path:"remark",label:"字段问号提示"},{label:r((()=>[f("div",ie,[oe,s(o(I),{duration:0},{trigger:r((()=>[ve])),default:r((()=>[m(" 设置后该字段旁会有问号图标,鼠标悬浮展示“问号提示”内容,常用于告诉用户该字段的含义 ")])),_:1})])])),default:r((()=>[s(o(O),{value:ze.value.remark,"onUpdate:value":a[3]||(a[3]=e=>ze.value.remark=e),placeholder:"请输入",type:"textarea",clearable:"",maxlength:255,rows:3},null,8,["value"])])),_:1}),c(" 选项值>>>>>类型对应关系 "),o(P)(o(Ee))?(n(),i(o(j),{key:0},{label:r((()=>[f("div",de,[re,f("span",{class:"batch-span",onClick:tl},"添加选项"),f("span",{class:"batch-span",onClick:a[4]||(a[4]=()=>We(!0))},"批量编辑")])])),default:r((()=>[f("div",{class:v(["options-item",{"options-item-err":De.value}])},[(n(!0),y(h,null,_(Te.value,((e,l)=>(n(),i(o(T),{class:"mgb-10",key:l,cols:24,"x-gap":8,"y-gap":8},{default:r((()=>[s(o(N),{span:11},{default:r((()=>[s(o(O),{value:e.value,"onUpdate:value":l=>e.value=l,maxLength:100,allowClear:"",placeholder:"选项值"},null,8,["value","onUpdate:value"])])),_:2},1024),s(o(N),{span:11},{default:r((()=>[s(o(O),{value:e.text,"onUpdate:value":l=>e.text=l,maxLength:100,allowClear:"",placeholder:"选项文本"},null,8,["value","onUpdate:value"])])),_:2},1024),s(o(N),{span:2,class:"flex-center"},{default:r((()=>[Te.value.length>1?(n(),i(o(Y),{key:0,onClick:a=>function(e,l){Te.value.splice(l,1);let a=ze.value.default_val;if(F(Ee.value)){if(!a||!a.length)return;let l=a.findIndex((l=>l===e.value));l||a.splice(l,1)}else{if(!a)return;a===e.value&&(a=void 0)}ze.value.default_val=a}(e,l)},{default:r((()=>[se])),_:2},1032,["onClick"])):c("v-if",!0)])),_:2},1024)])),_:2},1024)))),128))],2)])),_:1})):c("v-if",!0),o(q)(o(Ee))?(n(),i(o(j),{key:1,path:"decimal_length",label:"小数位"},{default:r((()=>[s(o($),{style:{width:"100%"},min:0,max:5,placeholder:"请输入",precision:0,clearable:"",value:ze.value.decimal_length,"onUpdate:value":[a[5]||(a[5]=e=>ze.value.decimal_length=e),ul]},null,8,["value"])])),_:1})):c("v-if",!0),o(A)(o(Ee))?(n(),i(o(j),{key:2,path:"date_format",label:"日期格式"},{default:r((()=>[s(o(z),{style:{width:"100%"},value:ze.value.date_format,"onUpdate:value":[a[6]||(a[6]=e=>ze.value.date_format=e),Ge],placeholder:"请选择",options:we},null,8,["value"])])),_:1})):c("v-if",!0),c(" 默认值>>>>>类型对应关系 "),s(o(j),{path:"default_val",label:"默认值"},{label:r((()=>[f("div",pe,[fe,o(E)(o(Ee))?(n(),i(o(I),{key:0,duration:0},{trigger:r((()=>[me])),default:r((()=>[m(" 支持输入系统变量当前操作人${sys.userId},也支持选择一个人 ")])),_:1})):c("v-if",!0)])])),default:r((()=>[o(J)(o(Ee))?(n(),i(o(O),{key:0,value:ze.value.default_val,"onUpdate:value":a[7]||(a[7]=e=>ze.value.default_val=e),placeholder:ke,type:"textarea",clearable:"",maxlength:1e3,rows:3},null,8,["value"])):o(q)(o(Ee))?(n(),y(h,{key:1},[c(" 数字框 "),s(o($),{style:{width:"100%"},clearable:"",placeholder:ke,precision:Be.value,value:ze.value.default_val,"onUpdate:value":a[8]||(a[8]=e=>ze.value.default_val=e)},null,8,["precision","value"])],2112)):o(P)(o(Ee))?(n(),y(h,{key:2},[c(" 下拉框、横向单选、纵向单选、横向多选、纵向多选、下拉多选框 "),s(o(z),{style:{width:"100%"},multiple:o(Ke),clearable:"",value:ze.value.default_val,"onUpdate:value":a[9]||(a[9]=e=>ze.value.default_val=e),"label-field":"text",placeholder:ke,options:o(Je)},null,8,["multiple","value","options"])],2112)):o(A)(o(Ee))?(n(),y(h,{key:3},[c(" 日期 "),f("div",ce,[s(o(O),{clearable:"",maxLength:255,value:ze.value.default_val,"onUpdate:value":a[10]||(a[10]=e=>ze.value.default_val=e),placeholder:ke},null,8,["value"]),o(Re)?(n(),y(h,{key:0},["month"===Ne.value.mode?(n(),i(o(L),{key:0,trigger:"click",show:Ne.value.open},{trigger:r((()=>[s(o(U),{type:"info",onClick:vl},{default:r((()=>[m("选择")])),_:1})])),default:r((()=>[s(o(V),{panel:"",value:Ne.value.value,"onUpdate:value":[a[11]||(a[11]=e=>Ne.value.value=e),dl],type:"month","input-readonly":"",clearable:"",onConfirm:vl},null,8,["value"])])),_:1},8,["show"])):(n(),i(o(L),{key:1,trigger:"click",show:Ne.value.open},{trigger:r((()=>[s(o(U),{type:"info",onClick:vl},{default:r((()=>[m("选择")])),_:1})])),default:r((()=>[s(o(V),{panel:"",value:Ne.value.value,"onUpdate:value":[a[12]||(a[12]=e=>Ne.value.value=e),rl],format:Ne.value.format,type:Ne.value.componentType,"input-readonly":"",clearable:"",onConfirm:vl},null,8,["value","format","type"])])),_:1},8,["show"]))],64)):(n(),y(h,{key:1},[c(' <n-input\n allowClear\n :maxLength="255"\n v-model:value="dateInfo.value"\n @keydown.enter.prevent\n :placeholder="defaultPlaceholder"\n /> '),s(o(U),{type:"info",class:"date-time-button"},{default:r((()=>[ye,s(o(B),{value:Ne.value.value,"onUpdate:value":[a[13]||(a[13]=e=>Ne.value.value=e),sl],format:Ne.value.format,"input-readonly":"",clearable:""},null,8,["value","format"])])),_:1}),c(' <n-popover trigger="click">\n <template #trigger>\n <n-button type="info">选择</n-button>\n </template>\n <n-time-picker\n panel\n v-model:value="dateInfo.value"\n :format="dateInfo.format"\n input-readonly\n clearable\n @update:value="timeChange"\n >\n <template v-slot:icon>111</template>\n\n </n-time-picker>\n </n-popover> ')],64))])],2112)):o(E)(o(Ee))?(n(),y(h,{key:4},[c(" 选人组件(增加一个选人组件) "),f("div",he,[g(s(o(O),{allowClear:"",maxLength:255,value:ze.value.default_val,"onUpdate:value":a[14]||(a[14]=e=>ze.value.default_val=e),onKeydown:a[15]||(a[15]=b(x((()=>{}),["prevent"]),["enter"])),placeholder:ke},null,8,["value"]),[[k,!1]]),c(' 点击弹出选人组件弹窗 :mainForm="this" '),s(ee,{orgId:e.orgId,defaultValue:ze.value.default_val,onCheckPerson:Xe},null,8,["orgId","defaultValue"]),qe.value?(n(),y("span",_e,M(qe.value),1)):c("v-if",!0),c(' <n-button type="info">选择</n-button> ')])],2112)):(n(),y(h,{key:5},[c(" 其他 "),s(o(O),{value:ze.value.default_val,"onUpdate:value":a[16]||(a[16]=e=>ze.value.default_val=e),onKeydown:a[17]||(a[17]=b(x((()=>{}),["prevent"]),["enter"])),placeholder:"请输入默认值"},null,8,["value"])],2112))])),_:1}),s(o(j),{path:"elem_width",label:"宽度"},{default:r((()=>[s(o(z),{value:ze.value.elem_width,"onUpdate:value":a[18]||(a[18]=e=>ze.value.elem_width=e),placeholder:"请选择宽度",options:He},null,8,["value"])])),_:1}),s(o(j),{path:"isNull",label:"是否必填","label-placement":"left"},{default:r((()=>[s(o(D),{value:Le.value,"onUpdate:value":[a[19]||(a[19]=e=>Le.value=e),a[20]||(a[20]=e=>el("isNull",e))]},null,8,["value"])])),_:1}),o(E)(o(Ee))?(n(),i(o(j),{key:3,"label-placement":"left",path:"isMultiSelect",label:"是否多选"},{default:r((()=>[s(o(D),{value:Ve.value,"onUpdate:value":a[21]||(a[21]=e=>el("isMultiSelect",e))},null,8,["value"])])),_:1})):c("v-if",!0)])),_:1},8,["model"]),s(Z,{visible:Pe.value,options:Te.value,onHandleSaveBatch:nl,onTriggerBatch:We},null,8,["visible","options"])])),_:1},8,["style","title"])])),_:1},8,["class","show","width","bodyStyle"]))}});export{ge as default};
|
|
1
|
+
import{defineComponent as e,ref as l,inject as a,computed as t,watch as u,openBlock as n,createBlock as i,unref as o,normalizeClass as v,isRef as d,withCtx as r,createVNode as s,normalizeStyle as p,createElementVNode as f,createTextVNode as m,createCommentVNode as c,createElementBlock as y,Fragment as h,renderList as _,withDirectives as g,withKeys as b,withModifiers as x,vShow as k,toDisplayString as M}from"vue";import{useMessage as w,NModal as H,NCard as C,NButton as U,NForm as S,NFormItem as j,NInput as O,NTooltip as I,NSelect as z,NGrid as T,NGridItem as N,NIcon as Y,NInputNumber as $,NPopover as L,NDatePicker as V,NTimePicker as B,NSwitch as D}from"naive-ui";import{isMulti as F,isShowOptions as P,isNumber as q,isDate as A,isCandidate as E,isTextarea as J}from"../utils/index.js";import K from"moment";import{InjectionExpandFieldApiConfig as R}from"../constants/index.js";import W from"../hooks/useAsyncData.js";import{HtmlTypeList as X}from"../utils/constant.js";import{isJSON as G,isValidDate as Q}from"../utils/tool.js";import Z from"./FormBatchOptionsModal.vue.js";import ee from"./FormItemPerson.vue.js";const le={class:"svg-wrap"},ae={class:"flex_right"},te={class:"options-title"},ue=f("span",null,"字段键名",-1),ne=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),ie={class:"options-title"},oe=f("span",null,"字段问号提示",-1),ve=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),de={class:"options-title"},re=f("span",null,"选项值",-1),se=f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},[f("path",{d:"M12 12h2v12h-2z",fill:"currentColor"}),f("path",{d:"M18 12h2v12h-2z",fill:"currentColor"}),f("path",{d:"M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z",fill:"currentColor"}),f("path",{d:"M12 2h8v2h-8z",fill:"currentColor"})],-1),pe={class:"options-title"},fe=f("span",null,"默认值",-1),me=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),ce={style:{display:"flex","align-items":"center"}},ye=f("span",null,"选择",-1),he={style:{width:"100%"}},_e={key:0,class:"validate_tip"};var ge=e({__name:"form",props:{visible:{type:Boolean,default:!1},formOntype:{type:String,default:"add"},formItemData:{type:Object,default:()=>({})},id:{type:String,default:""},orgId:{type:String,default:""},conditionList:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},emits:["cancelModal"],setup(e,{emit:ge}){const be=e,xe=w(),ke="请输入默认值",Me={name:[{required:!0,message:"请输入字段标题",trigger:["input","blur"]}],html_type:[{required:!0,message:"请选择字段类型",trigger:["input","blur"]}]},we=[{value:"yyyy-MM-dd HH:mm:ss",label:"年-月-日 时:分:秒"},{value:"yyyy-MM-dd HH:mm",label:"年-月-日 时:分"},{value:"yyyy-MM-dd",label:"年-月-日"},{value:"yyyy-MM",label:"年-月"},{value:"MM-dd HH:mm",label:"月-日 时:分"},{value:"MM-dd",label:"月-日"},{value:"HH:mm:ss",label:"时:分:秒"},{value:"HH:mm",label:"时:分"}],He=[{value:"12",label:"整行"},{value:"6",label:"半行"},{value:"4",label:"1/3行"},{value:"8",label:"2/3行"},{value:"3",label:"1/4行"},{value:"9",label:"3/4行"},{value:"2",label:"1/6行"},{value:"10",label:"5/6行"},{value:"1.5",label:"1/8行"},{value:"10.5",label:"7/8行"}],Ce=l(!1),Ue=l("860px");let Se=l({maxHeight:"496px",height:"496px"});const{saveOrUpdateExtendField:je}=W(),Oe=a(R),Ie=l(null),ze=l({name:void 0,remark:void 0,is_edit:"1",is_null:"1",is_show:"1",key:"",val_key:void 0,validate:{},html_type:"INPUT",name_i18n:void 0,elem_width:"12",default_val:void 0,label_type:void 0,isMultiSelect:"0",decimal_length:void 0,date_format:""}),Te=l([{text:void 0,value:void 0}]),Ne=l({format:"yyyy-MM-dd HH:mm:ss",dateType:"date",mode:"date",value:null,showTime:!0,open:!1,componentType:"datetime"}),Ye=l({obj_type:"",vali_obj:"",event_obj:"",max_length:"",min_length:"",min_value:"",max_value:""}),$e=l({value_key:"",levelSetting:[],search_key:[],level_num:void 0,render_key:[],name:"",level_key:"",id:"",type:"",primary_key:"",sqlExpression:"",conObj:"",add_btn:"",setting:{cascading:[]}}),Le=l(!1),Ve=l(!1),Be=l(void 0),De=l(!1),Fe=l(!1);l(!1);const Pe=l(!1),qe=l(""),Ae=t((()=>"edit"===be.formOntype)),Ee=t((()=>ze.value.html_type||""));t((()=>"TEXTAREA"===Ee.value?1e3:255));const Je=t((()=>Te.value.filter((e=>e.value&&e.text)))),Ke=t((()=>F(Ee.value))),Re=t((()=>"date"===Ne.value.dateType));function We(e){Pe.value=e}function Xe(e){let l=e;"string"!=typeof e&&(l=JSON.stringify(e)),ze.value.default_val=l}function Ge(e){Ne.value.value=null,ze.value.default_val=void 0,il(e)}function Qe(){Ce.value=!Ce.value;let e=document.body.clientHeight;"860px"===Ue.value?(Ue.value="100%",Se.value.maxHeight=`${e}px`,Se.value.height=`${e}px`):(Ue.value="860px",Se.value.maxHeight="496px",Se.value.height="")}function Ze(e){return["HH:mm:ss","HH:mm"].includes(e)}function el(e,l){switch(e){case"isNull":Le.value=l,ze.value.is_null=l?"0":"1";break;case"isMultiSelect":Ve.value=l,ze.value.isMultiSelect=l?"1":"0"}}function ll(){if("add"===be.formOntype)return;let e=Object.assign({},be.formItemData),l=e.setting;l&&G(l)&&(l=JSON.parse(l),delete e.setting,Object.assign(e,{...l})),e.key=e.code,delete e.code,A(e.html_type)&&function(e){il(e.date_format);let l=e.default_val;l&&!l.startsWith("${")&&(Ze(e.date_format)&&(l=`${K().format("YYYY-MM-dd")} ${l}`),Q(new Date(l))&&(Ne.value.value=K(l)))}(e),F(e.html_type)&&(e.default_val=function(e){let l=e.default_val;return l?l.split(",").filter(Boolean):[]}(e)),Le.value="0"==e.is_null,Ve.value="1"==e.isMultiSelect,Ye.value=Object.assign(Ye.value,e.validate||{}),$e.value=Object.assign($e.value,e.wordbook||{}),ze.value=Object.assign(ze.value,e||{}),P(e.html_type)&&function(e){let l=(null==e?void 0:e.optionValue)||[];l.length||l.push({text:void 0,value:void 0}),Te.value=[...l],delete e.optionValue}(e)}function al(e){ze.value.html_type=e,Te.value=[{text:void 0,value:void 0}];let l=function(){if(F(Ee.value))return[]}();ze.value.default_val=l,A(e)?ze.value.date_format="yyyy-MM-dd HH:mm:ss":ze.value.date_format=""}function tl(){Te.value.push({value:"",text:""})}function ul(e){let l=e;(e<0||0===e)&&(l=0),e>5&&(l=5),Be.value=0===l?l:l||void 0}function nl(e){Te.value=e}function il(e){let l=e||"yyyy-MM-dd HH:mm:ss",a=Ze(l)?"time":"date",t="yyyy-MM"===l?"month":"date";let u=function(e){return["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd HH:mm"].includes(e)}(l),n="";["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd HH:mm"].includes(e)&&(n="datetime"),["yyyy-MM-dd","MM-dd"].includes(e)&&(n="date"),Object.assign(Ne.value,{format:l,dateType:a,mode:t,showTime:u,componentType:n})}function ol(e,l){if(e)return l&&(l.includes("yyyy")&&(l=l.replace("yyyy","YYYY")),l.includes("dd")&&(l=l.replace("dd","DD"))),K(e).format(l)}function vl(){Ne.value.open=!Ne.value.open}function dl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l}function rl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l,Ne.value.format.includes("HH:mm")||vl()}function sl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l}function pl(){ge("cancelModal"),Ue.value="860px",Se.value={height:"496px",maxHeight:"496px"},Ce.value=!1,ze.value={name:void 0,remark:void 0,is_edit:"1",is_null:"1",is_show:"1",key:"",val_key:void 0,validate:{},html_type:"INPUT",name_i18n:void 0,elem_width:"12",default_val:void 0,label_type:void 0,isMultiSelect:"0",decimal_length:void 0,date_format:""}}function fl(){var e;null==(e=Ie.value)||e.validate((async e=>{if(e)return;let l=Object.assign({},ze.value);if(l.validate={...Ye.value},l.extendId=be.id,P(Ee.value)){let e=function(){let e={validate:!1,message:"请完善选项配置"};if(!Te.value||!Te.value.length)return e;let l,a,t,u=0,n=Te.value.length,i=!1;for(;u<n;u++){if(l=Te.value[u],a=l.value?l.value.trim():l.value,t=l.text?l.text.trim():l.text,!a||!t){i=!0;break}l.value=a,l.text=t}return[...new Set(Te.value.map((e=>e.value)))].length!==Te.value.length?(e.message="选项值不能重复",e):(!i&&(e.validate=!0),e)}();if(!e.validate)return De.value=!0,void xe.warning(e.message);De.value=!1,l.option=[...Te.value]}if(q(Ee.value)?l.default_val=function(e){let l=e.default_val;if(void 0===Be.value)return l;if(!l)return l;let a=String(l).split(".")[1];return a&&a.length!==Be.value?Number(l.toFixed(Be.value)):l}(l):F(Ee.value)&&(l.default_val=l.default_val.join(",")),!E(Ee.value)||function(e){let{default_val:l}=e;qe.value="",l&&G(l)&&(l=JSON.parse(l));let a=function(e,l){if(!e)return;if("string"!=typeof e)return;if(!(e=e.trim()))return!0;if(!e.startsWith("${"))return ml(l,"请输入有效系统变量"),"error";let a=/\${sys.(.*?)\}/g.exec(e);if(!a||!a[1])return ml(l,"请输入有效系统变量"),"error";return!0}(l,e);if(a)return"error"!==a;if(console.log("saveOjb.isMultiSelect>>>",e.isMultiSelect),console.log("default_val?.length>>>",null==l?void 0:l.length),"0"===e.isMultiSelect&&(null==l?void 0:l.length)>1)return console.log("进入到判断里面了>>>>>"),ml(e,"选人组件为单选"),!1;return!0}(l)){for(let e in l){let a=l[e];"string"==typeof a&&(l[e]=null==a?void 0:a.trim())}console.log("saveOjb>>>",l),await async function(e={}){Fe.value=!0;try{const l=await je(e,Oe);if(Fe.value=!1,"SUCCESS"!==(null==l?void 0:l.result))return void xe.error((null==l?void 0:l.resultMsg)||"保存失败");pl()}catch(e){Fe.value=!1}}(l)}}))}function ml(e,l){qe.value=l}return u((()=>be.visible),(e=>{e&&ll()})),(l,a)=>(n(),i(o(H),{class:v(["expand-field-modal-block",{"modal-screen":Ce.value}]),show:e.visible,"onUpdate:show":a[22]||(a[22]=e=>d(visible)?visible.value=e:null),maskClosable:!1,width:Ue.value,bodyStyle:o(Se),closable:!1,centered:"",onPositiveClick:fl,onNegativeClick:pl},{default:r((()=>[s(o(C),{style:p({width:Ue.value,...o(Se)}),title:"add"===be.formOntype?"新增拓展字段":"编辑拓展字段",bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":r((()=>[f("div",le,[f("i",{onClick:Qe,class:v(["iconfont-expand-field",Ce.value?"icon-expand-field-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-expand-field-menzhenyishengzhanxitongtubiaozuidahua"])},null,2),f("i",{onClick:pl,class:"iconfont-expand-field icon-expand-field-menzhenyishengzhanxitongtubiaoguanbi"})])])),footer:r((()=>[f("div",ae,[s(o(U),{onClick:pl},{default:r((()=>[m("取消")])),_:1}),s(o(U),{type:"info",onClick:fl},{default:r((()=>[m("保存")])),_:1})])])),default:r((()=>[s(o(S),{ref_key:"formRef",ref:Ie,model:ze.value,rules:Me},{default:r((()=>[s(o(j),{path:"name",label:"字段标题","require-mark-placement":"left"},{default:r((()=>[s(o(O),{value:ze.value.name,"onUpdate:value":a[0]||(a[0]=e=>ze.value.name=e),maxlength:100,clearable:"",placeholder:"请输入"},null,8,["value"])])),_:1}),s(o(j),{path:"key"},{label:r((()=>[f("div",te,[ue,s(o(I),{duration:0},{trigger:r((()=>[ne])),default:r((()=>[m(" 数据库字段键名,不填写时由系统生成,填写则以填写为准 ")])),_:1})])])),default:r((()=>[s(o(O),{value:ze.value.key,"onUpdate:value":a[1]||(a[1]=e=>ze.value.key=e),maxlength:32,disabled:o(Ae),clearable:"",placeholder:"数据库字段键名,不填写时由系统生成,填写则以填写为准"},null,8,["value","disabled"])])),_:1}),s(o(j),{path:"html_type",label:"字段类型","require-mark-placement":"left"},{default:r((()=>[s(o(z),{value:ze.value.html_type,"onUpdate:value":[a[2]||(a[2]=e=>ze.value.html_type=e),al],placeholder:"请选择字段类型",clearable:"",filterable:"",options:o(X)},null,8,["value","options"])])),_:1}),s(o(j),{path:"remark",label:"字段问号提示"},{label:r((()=>[f("div",ie,[oe,s(o(I),{duration:0},{trigger:r((()=>[ve])),default:r((()=>[m(" 设置后该字段旁会有问号图标,鼠标悬浮展示“问号提示”内容,常用于告诉用户该字段的含义 ")])),_:1})])])),default:r((()=>[s(o(O),{value:ze.value.remark,"onUpdate:value":a[3]||(a[3]=e=>ze.value.remark=e),placeholder:"请输入",type:"textarea",clearable:"",maxlength:255,rows:3},null,8,["value"])])),_:1}),c(" 选项值>>>>>类型对应关系 "),o(P)(o(Ee))?(n(),i(o(j),{key:0},{label:r((()=>[f("div",de,[re,f("span",{class:"batch-span",onClick:tl},"添加选项"),f("span",{class:"batch-span",onClick:a[4]||(a[4]=()=>We(!0))},"批量编辑")])])),default:r((()=>[f("div",{class:v(["options-item",{"options-item-err":De.value}])},[(n(!0),y(h,null,_(Te.value,((e,l)=>(n(),i(o(T),{class:"mgb-10",key:l,cols:24,"x-gap":8,"y-gap":8},{default:r((()=>[s(o(N),{span:11},{default:r((()=>[s(o(O),{value:e.value,"onUpdate:value":l=>e.value=l,maxLength:100,allowClear:"",placeholder:"选项值"},null,8,["value","onUpdate:value"])])),_:2},1024),s(o(N),{span:11},{default:r((()=>[s(o(O),{value:e.text,"onUpdate:value":l=>e.text=l,maxLength:100,allowClear:"",placeholder:"选项文本"},null,8,["value","onUpdate:value"])])),_:2},1024),s(o(N),{span:2,class:"flex-center"},{default:r((()=>[Te.value.length>1?(n(),i(o(Y),{key:0,onClick:a=>function(e,l){Te.value.splice(l,1);let a=ze.value.default_val;if(F(Ee.value)){if(!a||!a.length)return;let l=a.findIndex((l=>l===e.value));l||a.splice(l,1)}else{if(!a)return;a===e.value&&(a=void 0)}ze.value.default_val=a}(e,l)},{default:r((()=>[se])),_:2},1032,["onClick"])):c("v-if",!0)])),_:2},1024)])),_:2},1024)))),128))],2)])),_:1})):c("v-if",!0),o(q)(o(Ee))?(n(),i(o(j),{key:1,path:"decimal_length",label:"小数位"},{default:r((()=>[s(o($),{style:{width:"100%"},min:0,max:5,placeholder:"请输入",precision:0,clearable:"",value:ze.value.decimal_length,"onUpdate:value":[a[5]||(a[5]=e=>ze.value.decimal_length=e),ul]},null,8,["value"])])),_:1})):c("v-if",!0),o(A)(o(Ee))?(n(),i(o(j),{key:2,path:"date_format",label:"日期格式"},{default:r((()=>[s(o(z),{style:{width:"100%"},value:ze.value.date_format,"onUpdate:value":[a[6]||(a[6]=e=>ze.value.date_format=e),Ge],placeholder:"请选择",options:we},null,8,["value"])])),_:1})):c("v-if",!0),c(" 默认值>>>>>类型对应关系 "),s(o(j),{path:"default_val",label:"默认值"},{label:r((()=>[f("div",pe,[fe,o(E)(o(Ee))?(n(),i(o(I),{key:0,duration:0},{trigger:r((()=>[me])),default:r((()=>[m(" 支持输入系统变量当前操作人${sys.userId},也支持选择一个人 ")])),_:1})):c("v-if",!0)])])),default:r((()=>[o(J)(o(Ee))?(n(),i(o(O),{key:0,value:ze.value.default_val,"onUpdate:value":a[7]||(a[7]=e=>ze.value.default_val=e),placeholder:ke,type:"textarea",clearable:"",maxlength:1e3,rows:3},null,8,["value"])):o(q)(o(Ee))?(n(),y(h,{key:1},[c(" 数字框 "),s(o($),{style:{width:"100%"},clearable:"",placeholder:ke,precision:Be.value,value:ze.value.default_val,"onUpdate:value":a[8]||(a[8]=e=>ze.value.default_val=e)},null,8,["precision","value"])],2112)):o(P)(o(Ee))?(n(),y(h,{key:2},[c(" 下拉框、横向单选、纵向单选、横向多选、纵向多选、下拉多选框 "),s(o(z),{style:{width:"100%"},multiple:o(Ke),clearable:"",value:ze.value.default_val,"onUpdate:value":a[9]||(a[9]=e=>ze.value.default_val=e),"label-field":"text",placeholder:ke,options:o(Je)},null,8,["multiple","value","options"])],2112)):o(A)(o(Ee))?(n(),y(h,{key:3},[c(" 日期 "),f("div",ce,[s(o(O),{clearable:"",maxLength:255,value:ze.value.default_val,"onUpdate:value":a[10]||(a[10]=e=>ze.value.default_val=e),placeholder:ke},null,8,["value"]),o(Re)?(n(),y(h,{key:0},["month"===Ne.value.mode?(n(),i(o(L),{key:0,trigger:"click",show:Ne.value.open},{trigger:r((()=>[s(o(U),{type:"info",onClick:vl},{default:r((()=>[m("选择")])),_:1})])),default:r((()=>[s(o(V),{panel:"",value:Ne.value.value,"onUpdate:value":[a[11]||(a[11]=e=>Ne.value.value=e),dl],type:"month","input-readonly":"",clearable:"",onConfirm:vl},null,8,["value"])])),_:1},8,["show"])):(n(),i(o(L),{key:1,trigger:"click",show:Ne.value.open},{trigger:r((()=>[s(o(U),{type:"info",onClick:vl},{default:r((()=>[m("选择")])),_:1})])),default:r((()=>[s(o(V),{panel:"",value:Ne.value.value,"onUpdate:value":[a[12]||(a[12]=e=>Ne.value.value=e),rl],format:Ne.value.format,type:Ne.value.componentType,"input-readonly":"",clearable:"",onConfirm:vl},null,8,["value","format","type"])])),_:1},8,["show"]))],64)):(n(),y(h,{key:1},[c(' <n-input\r\n allowClear\r\n :maxLength="255"\r\n v-model:value="dateInfo.value"\r\n @keydown.enter.prevent\r\n :placeholder="defaultPlaceholder"\r\n /> '),s(o(U),{type:"info",class:"date-time-button"},{default:r((()=>[ye,s(o(B),{value:Ne.value.value,"onUpdate:value":[a[13]||(a[13]=e=>Ne.value.value=e),sl],format:Ne.value.format,"input-readonly":"",clearable:""},null,8,["value","format"])])),_:1}),c(' <n-popover trigger="click">\r\n <template #trigger>\r\n <n-button type="info">选择</n-button>\r\n </template>\r\n <n-time-picker\r\n panel\r\n v-model:value="dateInfo.value"\r\n :format="dateInfo.format"\r\n input-readonly\r\n clearable\r\n @update:value="timeChange"\r\n >\r\n <template v-slot:icon>111</template>\r\n\r\n </n-time-picker>\r\n </n-popover> ')],64))])],2112)):o(E)(o(Ee))?(n(),y(h,{key:4},[c(" 选人组件(增加一个选人组件) "),f("div",he,[g(s(o(O),{allowClear:"",maxLength:255,value:ze.value.default_val,"onUpdate:value":a[14]||(a[14]=e=>ze.value.default_val=e),onKeydown:a[15]||(a[15]=b(x((()=>{}),["prevent"]),["enter"])),placeholder:ke},null,8,["value"]),[[k,!1]]),c(' 点击弹出选人组件弹窗 :mainForm="this" '),s(ee,{orgId:e.orgId,defaultValue:ze.value.default_val,onCheckPerson:Xe},null,8,["orgId","defaultValue"]),qe.value?(n(),y("span",_e,M(qe.value),1)):c("v-if",!0),c(' <n-button type="info">选择</n-button> ')])],2112)):(n(),y(h,{key:5},[c(" 其他 "),s(o(O),{value:ze.value.default_val,"onUpdate:value":a[16]||(a[16]=e=>ze.value.default_val=e),onKeydown:a[17]||(a[17]=b(x((()=>{}),["prevent"]),["enter"])),placeholder:"请输入默认值"},null,8,["value"])],2112))])),_:1}),s(o(j),{path:"elem_width",label:"宽度"},{default:r((()=>[s(o(z),{value:ze.value.elem_width,"onUpdate:value":a[18]||(a[18]=e=>ze.value.elem_width=e),placeholder:"请选择宽度",options:He},null,8,["value"])])),_:1}),s(o(j),{path:"isNull",label:"是否必填","label-placement":"left"},{default:r((()=>[s(o(D),{value:Le.value,"onUpdate:value":[a[19]||(a[19]=e=>Le.value=e),a[20]||(a[20]=e=>el("isNull",e))]},null,8,["value"])])),_:1}),o(E)(o(Ee))?(n(),i(o(j),{key:3,"label-placement":"left",path:"isMultiSelect",label:"是否多选"},{default:r((()=>[s(o(D),{value:Ve.value,"onUpdate:value":a[21]||(a[21]=e=>el("isMultiSelect",e))},null,8,["value"])])),_:1})):c("v-if",!0)])),_:1},8,["model"]),s(Z,{visible:Pe.value,options:Te.value,onHandleSaveBatch:nl,onTriggerBatch:We},null,8,["visible","options"])])),_:1},8,["style","title"])])),_:1},8,["class","show","width","bodyStyle"]))}});export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}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 c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L){const{computedX:P,computedY:b,getXValue:w,getYValue:A}=r(h),{xCellWidth:I,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:X,event:M,scaleValues:T,xAxis:V,startTime:Y,timeXCell:S,itemList:$,dialog:F}=h,O=new Map,D=new Set,_=p(T);let z=[],N=null;const G=new Set;l(y,h);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:R}=s(y,k,h),{pause:W,resume:B}=g((()=>{!function(){if(!G.size)return;for(const e of G)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function H(){_.forEach((e=>{e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=b(t.type,t.range,n),a=i([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{x.point={...e||{x:a.left,y:a.top}},x.list=[`${o} ${n}${t.unit||""}`],x.show=!0})),a.on("mouseout",(()=>{x.show=!1}))),y.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ee(t,n,e))}))}))}function Q(e=[]){if(!(null==N?void 0:N.areaPos))return[];const{startPos:t,endPos:n}=N.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:fe()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function U(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),Z()},onNegativeClick:()=>Z(),onClose:()=>Z()})}function Z(){N&&y.value.remove(N),N=null}function ee(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];O.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,g=u;l.key&&(g=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:b="",key:C,type:K="circle"}=g,j=se(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:b,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...h.event.hovered?h.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:h.event};e&&(E||(X.leftLine=null),p=o(K,{left:e[0],top:e[1],...X}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){M.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ae(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),M.hovered&&re(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/I);if(a>l+I){if(0===z.length){ne(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+I*c;if(z.every((e=>e.left!==u))){const t=w(u),n=A(f.type,s);z.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),ne(e,[...e.prevPointer,u,s])}if(z.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+I*l,r=z.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=z.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=z[l-1]||{left:n,top:i},f=~~((r.left-(t-I))/I),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:w(t),value:A(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},z.splice(l,0,a),ne(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=O.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=I/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?te(e,"#999"):te(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(z.length>0&&i<z[z.length-1].left){for(const e of D)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(z=z.filter((e=>e.left<=i)),0===z.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(z.length>0){const t=z.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:A(t,e.top)}};if(y.value.discardActiveObject(),z.length>0){const l=_.find((e=>e.type===t));let r=-1;const a=z.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void oe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ie({...o,data:a,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ie(o,"change")}}))}(p),null==(d=O.get(u.key))||d.push(p))}(se(l,n),l,c,e)})),Promise.all(O.get(e.key)).then((t=>{const n=f.filter((e=>e));R(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||G.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function te(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function ne(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function ie(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=_.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}oe({dataIndex:s,scaleValue:f})}function oe(e){var t,n,i;if(D.size&&(null==(t=y.value)||t.remove(...le([...D]))),D.clear(),z=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...le(O.get(o.key))),O.delete(o.key),ee(o,t,i)}else O.size&&(null==(i=y.value)||i.remove(...le(fe()))),O.clear(),H()}function le(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 re(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;x.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:A(i,e.top)}`;x.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],x.show=!0}function ae(e){e.setCoords();const t=6e4/S,n=e.prevPoint?e.prevPoint.left+t:K,i=j;e.top<E&&e.set("top",E),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function se(e,t){if(u(e)&&function(e){const t=Date.parse(V.list.at(-1)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=P(e.time),i=b(t.type,t.range,e.value);return[n,i<E?E:i>X?X:i]}}function fe(){return v(Array.from(O.values()))}return e((()=>{W()})),H(),function(){if(!M.evented)return;let e=!1,i={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<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);fe().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{J(fe(),t,"key",2*I).includes(n.linkKey||n.key)||L.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===L.list.length&&(L.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Q();t.length>0?U((()=>{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 ie(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);k("remove",e)})):a.emit(N)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),y.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;N&&y.value.remove(N),N=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),N.areaPos={startPos:i,endPos:o.pointer},y.value.add(N)}))}(),{redrawPoints:oe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),ie(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),ie({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ae,setPopup:re,updateData:ie,getGridPoints:fe,getContainPoints:Q,showDialog:U,removeCurrentSelection:Z}}export{y as useCenter};
|
|
1
|
+
import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}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 c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L){const{computedX:P,computedY:b,getXValue:w,getYValue:A}=r(h),{xCellWidth:I,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:X,event:M,scaleValues:V,xAxis:T,startTime:Y,timeXCell:S,itemList:$,dialog:F}=h,O=new Map,D=new Set,_=p(V);let z=[],N=null;const G=new Set;l(y,h);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:R}=s(y,k,h),{pause:W,resume:B}=g((()=>{!function(){if(!G.size)return;for(const e of G)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function H(){_.forEach((e=>{const{range:t=[],spaceValue:n}=e;n&&(t[0]||t[1])&&e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=b(t.type,t.range,n),a=i([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{x.point={...e||{x:a.left,y:a.top}},x.list=[`${o} ${n}${t.unit||""}`],x.show=!0})),a.on("mouseout",(()=>{x.show=!1}))),y.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ee(t,n,e))}))}))}function Q(e=[]){if(!(null==N?void 0:N.areaPos))return[];const{startPos:t,endPos:n}=N.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:fe()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function U(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),Z()},onNegativeClick:()=>Z(),onClose:()=>Z()})}function Z(){N&&y.value.remove(N),N=null}function ee(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];O.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,g=u;l.key&&(g=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:b="",key:C,type:K="circle"}=g,j=se(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:b,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...h.event.hovered?h.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:h.event};e&&(E||(X.leftLine=null),p=o(K,{left:e[0],top:e[1],...X}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){M.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ae(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),M.hovered&&re(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/I);if(a>l+I){if(0===z.length){ne(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+I*c;if(z.every((e=>e.left!==u))){const t=w(u),n=A(f.type,s);z.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),ne(e,[...e.prevPointer,u,s])}if(z.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+I*l,r=z.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=z.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=z[l-1]||{left:n,top:i},f=~~((r.left-(t-I))/I),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:w(t),value:A(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},z.splice(l,0,a),ne(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=O.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=I/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?te(e,"#999"):te(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(z.length>0&&i<z[z.length-1].left){for(const e of D)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(z=z.filter((e=>e.left<=i)),0===z.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(z.length>0){const t=z.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:A(t,e.top)}};if(y.value.discardActiveObject(),z.length>0){const l=_.find((e=>e.type===t));let r=-1;const a=z.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void oe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ie({...o,data:a,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ie(o,"change")}}))}(p),null==(d=O.get(u.key))||d.push(p))}(se(l,n),l,c,e)})),Promise.all(O.get(e.key)).then((t=>{const n=f.filter((e=>e));R(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||G.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function te(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function ne(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function ie(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=_.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}oe({dataIndex:s,scaleValue:f})}function oe(e){var t,n,i;if(D.size&&(null==(t=y.value)||t.remove(...le([...D]))),D.clear(),z=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...le(O.get(o.key))),O.delete(o.key),ee(o,t,i)}else O.size&&(null==(i=y.value)||i.remove(...le(fe()))),O.clear(),H()}function le(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 re(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;x.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:A(i,e.top)}`;x.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],x.show=!0}function ae(e){e.setCoords();const t=6e4/S,n=e.prevPoint?e.prevPoint.left+t:K,i=j;e.top<E&&e.set("top",E),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function se(e,t){if(u(e)&&function(e){const t=Date.parse(T.list.at(-1)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=P(e.time),i=b(t.type,t.range,e.value);return[n,i<E?E:i>X?X:i]}}function fe(){return v(Array.from(O.values()))}return e((()=>{W()})),H(),function(){if(!M.evented)return;let e=!1,i={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<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);fe().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{J(fe(),t,"key",2*I).includes(n.linkKey||n.key)||L.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===L.list.length&&(L.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Q();t.length>0?U((()=>{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 ie(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);k("remove",e)})):a.emit(N)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),y.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;N&&y.value.remove(N),N=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),N.areaPos={startPos:i,endPos:o.pointer},y.value.add(N)}))}(),{redrawPoints:oe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),ie(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),ie({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ae,setPopup:re,updateData:ie,getGridPoints:fe,getContainPoints:Q,showDialog:U,removeCurrentSelection:Z}}export{y as useCenter};
|
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as
|
|
1
|
+
import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as n}from"vue";import{useDialog as l}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"../useEvent.js";import{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useCenter as f}from"./useCenter.js";import{useOther as g}from"./useOther.js";function y(y,w,x,b,j,C){const Y=l(),H=e(),S=e(),D=e(),A=t((()=>w.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),M=t((()=>{var e;return null!=(e=w.data.left.width)?e:0})),T=t((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell})),X=t((()=>{const{grid:e}=w.data;return e.mainYCell*e.subYCell})),G=t((()=>{const{treeData:e=[],show:t=!0}=w.data.top;return t?s(e):0})),V=t((()=>w.data.top.tree.cellHeight)),k=t((()=>V.value*G.value)),P=t((()=>te(_("drug")||"top"))),L=t((()=>P.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=w.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(w.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(T.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:M.value}})),E=function(){const{show:e=!0}=w.data.top;if(!e)return[];const t=d(w.data.top.treeData);let a=0;const{cellWidth:r,cellHeight:i}=w.data.top.tree;return function e(t,n=0){t.forEach((t=>{var l;const o={top:a*i+P.value,left:n*r,width:r,height:i};if(a++,null==(l=t.children)?void 0:l.length){a--;const r=s(t.children);o.height=r*i,e(t.children,n+1)}else o.width=M.value-o.left;Object.assign(t,o)}))}(t),t}(),W=t((()=>te(_("xAxis")||"center"))),I=t((()=>{var e;const{width:t,right:a}=w.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),q=t((()=>te(_("intraoperatively")||"bottom"))),z=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=w.data.other)?void 0:e.mark)||{};return t&&a?a:0})),B=t((()=>q.value+(w.data.height-k.value-O.value.height-z.value))),F=t((()=>(I.value-M.value)/T.value)),J=t((()=>(B.value-q.value)/X.value)),K=t((()=>O.value.spaceTimeStamp/F.value)),Q=t((()=>{const{scaleValues:e}=w.data;return p(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),R=t((()=>ae("pulse"))),U=t((()=>ae("temperature"))),Z=t((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),$=a({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...o,...w.data.borderStyle},pointSelectionStyle:w.data.pointSelectionStyle||{},grid:w.data.grid,top:w.data.top,left:w.data.left,other:w.data.other,topGridYNumber:r(G),topGridYCellHeight:r(V),topGridOriginY:r(P),topGridEndY:r(L),treeData:E,xAxis:r(O),originYXAxis:r(W),startTime:r(N),timeXCell:r(K),gridXNumber:r(T),gridYNumber:r(X),xCellWidth:r(F),yCellHeight:r(J),originX:r(M),endX:r(I),originY:r(q),endY:r(B),markHeight:r(z),itemList:r(Q),scaleValues:w.data.scaleValues,pulseYCell:r(R),temperatureYCell:r(U),event:r(Z),dialog:Y});function _(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ee(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return w.data.height-k.value-a}}function te(e){switch(e){case"top":return 0;case"center":return ee("top");default:return ee("top")+ee("center")}}function ae(e){const{scaleValues:t}=w.data,a=t.find((t=>t.type===e));return J.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await n(),v(y,$,x,j);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=f(y,$,x,j,C);h(y,$,x,j,a,r,i,l);const{clickMenu:d}=g(y,$,x,j,C,a,o,u,s);S.value=e,D.value=e=>{const{item:a}=e;a.type&&m.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:$,redrawPoints:S,select:H,clickMenu:D}}export{y as useSurgicalAnesthesiaChart};
|
|
@@ -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";import"@vueuse/core";function c(c,u,d,m,h){const{computedX:
|
|
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{computedX:v,getXValue:p}=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}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}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=p(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});c.value.add(m);const{show:h=!0}=C;if(!h)return;const v=e([x+(w-x)/2,u],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});c.value.add(v)}(),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,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.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&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!c,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!c});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,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),p&&z.add(p),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},p,{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};
|