cnhis-design-vue 3.1.45-beta.1 → 3.1.45-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/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/fabric-chart/index.d.ts +40 -5
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +40 -5
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.d.ts +2 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.js +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +4 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +20 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +4 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -0
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useRight.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/fabric-chart/src/hooks/useGrid.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +13 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +2 -1
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/field-set/index.d.ts +157 -38
- package/es/components/field-set/src/FieldSet.vue.d.ts +160 -23
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +132 -0
- package/es/components/field-set/src/components/Row.vue.js +1 -0
- package/es/components/field-set/src/components/Row.vue2.js +1 -0
- package/es/components/field-set/src/types/index.d.ts +1 -0
- package/es/components/field-set/src/utils/index.d.ts +7 -0
- package/es/components/field-set/src/utils/index.js +1 -0
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +3534 -21
- package/es/components/form-config/src/FormConfig.vue.d.ts +3534 -21
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +31 -4
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +33 -4
- package/es/components/form-config/src/components/FormConfigMaterialItem.d.ts +11 -1
- package/es/components/form-config/src/components/FormConfigMaterialItem.js +1 -1
- package/es/components/form-config/src/components/renderer/DefaultNode.vue.d.ts +2 -0
- package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
- package/es/components/form-config/src/constants/index.d.ts +1 -0
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +2 -0
- package/es/components/form-config/style/index.css +1 -1
- package/es/components/form-render/index.d.ts +31 -4
- package/es/components/form-render/src/FormRender.vue.d.ts +31 -4
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +31 -4
- package/es/components/form-render/src/components/renderer/combination.d.ts +5 -5
- package/es/components/form-render/src/components/renderer/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/jsonCombination/index.d.ts +5 -5
- package/es/components/form-render/src/components/renderer/jsonCombination/index.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
- package/es/components/form-render/src/constants/index.d.ts +2 -0
- package/es/components/form-render/src/constants/index.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -1
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +3 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useNuiThemeOverrides.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +2 -0
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +72 -10
- package/es/components/info-header/src/InfoHeader.vue.d.ts +72 -10
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +31 -4
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +31 -4
- package/es/components/keyboard/index.d.ts +1 -1
- package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
- package/es/components/recommend-search/index.d.ts +2 -2
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +2 -2
- package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/search-cascader/index.d.ts +16 -3
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +16 -3
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +31 -4
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +31 -4
- 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/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/hooks/useAsyncQueue.d.ts +3 -1
- package/es/shared/hooks/useAsyncQueue.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/search-cascader/src/hooks/index.d.ts +0 -1
- package/es/components/search-cascader/src/hooks/index.js +0 -1
- package/es/components/search-cascader/src/hooks/useCssVariable.d.ts +0 -3
- package/es/components/search-cascader/src/hooks/useCssVariable.js +0 -1
|
@@ -2154,6 +2154,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2154
2154
|
onSetup(): void;
|
|
2155
2155
|
beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
|
|
2156
2156
|
afterRequest(fieldKey: string, payload?: any): import("../../../../../../es/shared/types").AnyObject[];
|
|
2157
|
+
afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[]): void;
|
|
2157
2158
|
}>>;
|
|
2158
2159
|
};
|
|
2159
2160
|
requestInstance: {
|
|
@@ -2173,6 +2174,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2173
2174
|
type: (BooleanConstructor | StringConstructor)[];
|
|
2174
2175
|
default: boolean;
|
|
2175
2176
|
};
|
|
2177
|
+
uniqueCacheData: {
|
|
2178
|
+
type: BooleanConstructor;
|
|
2179
|
+
default: boolean;
|
|
2180
|
+
};
|
|
2176
2181
|
}, {
|
|
2177
2182
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
2178
2183
|
fieldList: {
|
|
@@ -2286,6 +2291,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2286
2291
|
onSetup(): void;
|
|
2287
2292
|
beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
|
|
2288
2293
|
afterRequest(fieldKey: string, payload?: any): import("../../../../../../es/shared/types").AnyObject[];
|
|
2294
|
+
afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[]): void;
|
|
2289
2295
|
}>>;
|
|
2290
2296
|
};
|
|
2291
2297
|
requestInstance: {
|
|
@@ -2305,12 +2311,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2305
2311
|
type: (BooleanConstructor | StringConstructor)[];
|
|
2306
2312
|
default: boolean;
|
|
2307
2313
|
};
|
|
2314
|
+
uniqueCacheData: {
|
|
2315
|
+
type: BooleanConstructor;
|
|
2316
|
+
default: boolean;
|
|
2317
|
+
};
|
|
2308
2318
|
}>> & {
|
|
2309
2319
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
2310
2320
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
2311
2321
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
2312
2322
|
}>>;
|
|
2313
|
-
emit: (event: "
|
|
2323
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
2314
2324
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
2315
2325
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
2316
2326
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
@@ -2330,6 +2340,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2330
2340
|
title: string;
|
|
2331
2341
|
}[]>;
|
|
2332
2342
|
onScroll: (scrollEvent: Event) => void;
|
|
2343
|
+
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
2344
|
+
onSetup(): void;
|
|
2345
|
+
beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
|
|
2346
|
+
afterRequest(fieldKey: string, payload?: any): import("../../../../../../es/shared/types").AnyObject[];
|
|
2347
|
+
afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[]): void;
|
|
2348
|
+
}>>[T]> | undefined) => import("../../../../../../es/shared/types").UndefinedAble<ReturnType<Required<Partial<{
|
|
2349
|
+
onSetup(): void;
|
|
2350
|
+
beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
|
|
2351
|
+
afterRequest(fieldKey: string, payload?: any): import("../../../../../../es/shared/types").AnyObject[];
|
|
2352
|
+
afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[]): void;
|
|
2353
|
+
}>>[T]>>;
|
|
2333
2354
|
triggerAutoHidden: (field: import("../../../../../../es/components/form-render").GeneralField) => Promise<void>;
|
|
2334
2355
|
observeFormGraph: Record<string, import("../../../../../../es/components/form-render").GeneralField>;
|
|
2335
2356
|
setGraph: (field: import("../../../../../../es/components/form-render").GeneralField) => void;
|
|
@@ -2473,11 +2494,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2473
2494
|
onFocus: (...args: any[]) => Promise<void>;
|
|
2474
2495
|
onBlur: (...args: any[]) => Promise<void>;
|
|
2475
2496
|
onInput: (...args: any[]) => Promise<void>;
|
|
2497
|
+
editable: boolean;
|
|
2476
2498
|
reset: (options?: import("../../../../../../es/components/form-render").IFieldResetOptions | undefined) => Promise<void>;
|
|
2477
2499
|
title: string;
|
|
2478
|
-
editable: boolean;
|
|
2479
2500
|
visible: boolean;
|
|
2480
|
-
submit: <
|
|
2501
|
+
submit: <T_1>(onSubmit?: ((values: any) => void | Promise<T_1>) | undefined) => Promise<T_1>;
|
|
2481
2502
|
validator: import("../../../../../../es/components/form-render").FieldValidator;
|
|
2482
2503
|
pattern: import("../../../../../../es/components/form-render").FieldPatternTypes;
|
|
2483
2504
|
content: any;
|
|
@@ -2621,7 +2642,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2621
2642
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
2622
2643
|
}>;
|
|
2623
2644
|
NTabs: any;
|
|
2624
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
2645
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2625
2646
|
fieldList: {
|
|
2626
2647
|
type: import("vue").PropType<import("../../../../../../es/components/form-render").FieldItem[]>;
|
|
2627
2648
|
};
|
|
@@ -2733,6 +2754,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2733
2754
|
onSetup(): void;
|
|
2734
2755
|
beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
|
|
2735
2756
|
afterRequest(fieldKey: string, payload?: any): import("../../../../../../es/shared/types").AnyObject[];
|
|
2757
|
+
afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[]): void;
|
|
2736
2758
|
}>>;
|
|
2737
2759
|
};
|
|
2738
2760
|
requestInstance: {
|
|
@@ -2752,6 +2774,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2752
2774
|
type: (BooleanConstructor | StringConstructor)[];
|
|
2753
2775
|
default: boolean;
|
|
2754
2776
|
};
|
|
2777
|
+
uniqueCacheData: {
|
|
2778
|
+
type: BooleanConstructor;
|
|
2779
|
+
default: boolean;
|
|
2780
|
+
};
|
|
2755
2781
|
}>> & {
|
|
2756
2782
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
2757
2783
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -2768,6 +2794,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2768
2794
|
enterToNextWidget: boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void);
|
|
2769
2795
|
linebarAutoHidden: boolean;
|
|
2770
2796
|
bordered: string | boolean;
|
|
2797
|
+
uniqueCacheData: boolean;
|
|
2771
2798
|
}>;
|
|
2772
2799
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
2773
2800
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -166,6 +166,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
166
166
|
onSetup(): void;
|
|
167
167
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
168
168
|
afterRequest(fieldKey: string, payload?: any): import("../../../..").AnyObject[];
|
|
169
|
+
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[]): void;
|
|
169
170
|
}>>;
|
|
170
171
|
};
|
|
171
172
|
requestInstance: {
|
|
@@ -185,6 +186,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
185
186
|
type: (BooleanConstructor | StringConstructor)[];
|
|
186
187
|
default: boolean;
|
|
187
188
|
};
|
|
189
|
+
uniqueCacheData: {
|
|
190
|
+
type: BooleanConstructor;
|
|
191
|
+
default: boolean;
|
|
192
|
+
};
|
|
188
193
|
}, {
|
|
189
194
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
190
195
|
fieldList: {
|
|
@@ -298,6 +303,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
298
303
|
onSetup(): void;
|
|
299
304
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
300
305
|
afterRequest(fieldKey: string, payload?: any): import("../../../..").AnyObject[];
|
|
306
|
+
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[]): void;
|
|
301
307
|
}>>;
|
|
302
308
|
};
|
|
303
309
|
requestInstance: {
|
|
@@ -317,12 +323,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
317
323
|
type: (BooleanConstructor | StringConstructor)[];
|
|
318
324
|
default: boolean;
|
|
319
325
|
};
|
|
326
|
+
uniqueCacheData: {
|
|
327
|
+
type: BooleanConstructor;
|
|
328
|
+
default: boolean;
|
|
329
|
+
};
|
|
320
330
|
}>> & {
|
|
321
331
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
322
332
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
323
333
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
324
334
|
}>>;
|
|
325
|
-
emit: (event: "
|
|
335
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
326
336
|
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
327
337
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
328
338
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
@@ -342,6 +352,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
342
352
|
title: string;
|
|
343
353
|
}[]>;
|
|
344
354
|
onScroll: (scrollEvent: Event) => void;
|
|
355
|
+
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
356
|
+
onSetup(): void;
|
|
357
|
+
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
358
|
+
afterRequest(fieldKey: string, payload?: any): import("../../../..").AnyObject[];
|
|
359
|
+
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[]): void;
|
|
360
|
+
}>>[T]> | undefined) => import("../../../..").UndefinedAble<ReturnType<Required<Partial<{
|
|
361
|
+
onSetup(): void;
|
|
362
|
+
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
363
|
+
afterRequest(fieldKey: string, payload?: any): import("../../../..").AnyObject[];
|
|
364
|
+
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[]): void;
|
|
365
|
+
}>>[T]>>;
|
|
345
366
|
triggerAutoHidden: (field: import("../../../../../../es/components/form-render").GeneralField) => Promise<void>;
|
|
346
367
|
observeFormGraph: Record<string, import("../../../../../../es/components/form-render").GeneralField>;
|
|
347
368
|
setGraph: (field: import("../../../../../../es/components/form-render").GeneralField) => void;
|
|
@@ -485,11 +506,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
485
506
|
onFocus: (...args: any[]) => Promise<void>;
|
|
486
507
|
onBlur: (...args: any[]) => Promise<void>;
|
|
487
508
|
onInput: (...args: any[]) => Promise<void>;
|
|
509
|
+
editable: boolean;
|
|
488
510
|
reset: (options?: import("../../../../../../es/components/form-render").IFieldResetOptions | undefined) => Promise<void>;
|
|
489
511
|
title: string;
|
|
490
|
-
editable: boolean;
|
|
491
512
|
visible: boolean;
|
|
492
|
-
submit: <
|
|
513
|
+
submit: <T_1>(onSubmit?: ((values: any) => void | Promise<T_1>) | undefined) => Promise<T_1>;
|
|
493
514
|
validator: import("../../../../../../es/components/form-render").FieldValidator;
|
|
494
515
|
pattern: import("../../../../../../es/components/form-render").FieldPatternTypes;
|
|
495
516
|
content: any;
|
|
@@ -633,7 +654,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
633
654
|
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
634
655
|
}>;
|
|
635
656
|
NTabs: any;
|
|
636
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
657
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
637
658
|
fieldList: {
|
|
638
659
|
type: import("vue").PropType<FieldItem[]>;
|
|
639
660
|
};
|
|
@@ -745,6 +766,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
745
766
|
onSetup(): void;
|
|
746
767
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
747
768
|
afterRequest(fieldKey: string, payload?: any): import("../../../..").AnyObject[];
|
|
769
|
+
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[]): void;
|
|
748
770
|
}>>;
|
|
749
771
|
};
|
|
750
772
|
requestInstance: {
|
|
@@ -764,6 +786,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
764
786
|
type: (BooleanConstructor | StringConstructor)[];
|
|
765
787
|
default: boolean;
|
|
766
788
|
};
|
|
789
|
+
uniqueCacheData: {
|
|
790
|
+
type: BooleanConstructor;
|
|
791
|
+
default: boolean;
|
|
792
|
+
};
|
|
767
793
|
}>> & {
|
|
768
794
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
769
795
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
@@ -780,6 +806,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
780
806
|
enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
|
|
781
807
|
linebarAutoHidden: boolean;
|
|
782
808
|
bordered: string | boolean;
|
|
809
|
+
uniqueCacheData: boolean;
|
|
783
810
|
}>;
|
|
784
811
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
785
812
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -297,7 +297,7 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
297
297
|
positionInitialValue: import("@vueuse/core").Position;
|
|
298
298
|
moveOffset: import("@vueuse/core").Position;
|
|
299
299
|
}>;
|
|
300
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "keydown")[], "
|
|
300
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "keydown")[], "keydown" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
301
301
|
mode: {
|
|
302
302
|
type: import("vue").PropType<"number" | "day" | "dose" | "english">;
|
|
303
303
|
default: string;
|
|
@@ -298,7 +298,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
298
298
|
positionInitialValue: Position;
|
|
299
299
|
moveOffset: Position;
|
|
300
300
|
}>;
|
|
301
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "keydown")[], "
|
|
301
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "keydown")[], "keydown" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
302
302
|
mode: {
|
|
303
303
|
type: PropType<"number" | "day" | "dose" | "english">;
|
|
304
304
|
default: string;
|
|
@@ -293,7 +293,7 @@ declare const RecommendSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
293
293
|
type: BooleanConstructor;
|
|
294
294
|
default: boolean;
|
|
295
295
|
};
|
|
296
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "
|
|
296
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "keydown" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
297
297
|
displayValue: {
|
|
298
298
|
type: StringConstructor;
|
|
299
299
|
};
|
|
@@ -525,7 +525,7 @@ declare const RecommendSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
525
525
|
type: BooleanConstructor;
|
|
526
526
|
default: boolean;
|
|
527
527
|
};
|
|
528
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "
|
|
528
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "keydown" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
529
529
|
displayValue: {
|
|
530
530
|
type: StringConstructor;
|
|
531
531
|
};
|
|
@@ -295,7 +295,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
295
295
|
type: BooleanConstructor;
|
|
296
296
|
default: boolean;
|
|
297
297
|
};
|
|
298
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "
|
|
298
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "keydown" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
299
299
|
displayValue: {
|
|
300
300
|
type: StringConstructor;
|
|
301
301
|
};
|
|
@@ -527,7 +527,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
527
527
|
type: BooleanConstructor;
|
|
528
528
|
default: boolean;
|
|
529
529
|
};
|
|
530
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "
|
|
530
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "keydown" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
531
531
|
displayValue: {
|
|
532
532
|
type: StringConstructor;
|
|
533
533
|
};
|
|
@@ -32,7 +32,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
32
|
type: BooleanConstructor;
|
|
33
33
|
default: boolean;
|
|
34
34
|
};
|
|
35
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "
|
|
35
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "keydown" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
36
|
displayValue: {
|
|
37
37
|
type: StringConstructor;
|
|
38
38
|
};
|
|
@@ -185,7 +185,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
185
185
|
type: BooleanConstructor;
|
|
186
186
|
default: boolean;
|
|
187
187
|
};
|
|
188
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "
|
|
188
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "keydown" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
189
189
|
displayValue: {
|
|
190
190
|
type: StringConstructor;
|
|
191
191
|
};
|
|
@@ -140,7 +140,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
140
140
|
type: BooleanConstructor;
|
|
141
141
|
default: boolean;
|
|
142
142
|
};
|
|
143
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "
|
|
143
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "update:show" | "keydown" | "search" | "openMenu" | "closeMenu")[], "search" | "closeMenu" | "keydown" | "clear" | "update:show" | "openMenu", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
144
144
|
displayValue: {
|
|
145
145
|
type: StringConstructor;
|
|
146
146
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,reactive as t,ref as a,watch as o,nextTick as
|
|
1
|
+
import{defineComponent as e,reactive as t,ref as a,watch as o,nextTick as n,openBlock as i,createElementBlock as l,createCommentVNode as s,Fragment as r,unref as u,createBlock as c,mergeProps as p,createElementVNode as d,normalizeClass as m,normalizeStyle as v,createVNode as f,withCtx as g,renderList as y,toDisplayString as b,createTextVNode as k,resolveDynamicComponent as C,h as S}from"vue";import w from"./hooks/use-noData.js";import{getScaleViewState as h}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as A}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as O}from"./hooks/scaleview-submit.js";import{handleQueryParams as _,isCollection as j,isEvaluation as T}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import P from"./components/NoData.vue.js";import D from"./components/EvaluateCountdown.vue.js";import F from"./components/EvaluatePage.vue.js";import B from"./components/AnswerParse.vue.js";import N from"./components/ScaleScore.js";import{useDialog as x,useMessage as I,NForm as q,NFormItem as M,NButton as R}from"naive-ui";const K={class:"c-scale-view-block"},V=["innerHTML"],H={key:0,class:"required-text"},U={key:1,class:"evalute-label"},W=["onClick"],J=d("i",{class:"scale-view-iconfont icon-scale-view-dengpao"},null,-1),Y={key:1,class:"footer"};var X=e({__name:"ScaleView",props:{guageData:{type:Object,default:()=>({})},styleSetting:{type:Object,default:()=>({})},ids:{type:Object,default:()=>({guage_id:"",db_id:void 0})},params:{default:()=>({}),type:Object},noBtn:{type:[Boolean,String,Number],default:!1},hideBtn:{type:[Boolean,String,Number],default:!1},isLock:{type:[Boolean,String,Number],default:!1},type:{type:String,default:""},openType:{type:String,default:""},scaleApiConfig:{type:Object,default:()=>({})},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])},getLabelList:{type:Function,default:()=>Promise.resolve([])},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},uploadPictureUrl:{type:String,default:""},uploadFileUrl:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"},sourceType:{type:String,default:""},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})}},emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:X,emit:G}){const Q=e,{ScaleViewState:Z}=h(),$=t(Z),z=x(),ee=I(),te=a(null),ae=a(null),{noDataState:oe,setNoData:ne,resetNodata:ie}=w(),le=_(),{showEvatip:se,isFormBoldOpen:re,scaleStyle:ue,handlePageClass:ce,isShowItem:pe,handleShowQuestionNumber:de,hasScore:me,isPreviewScale:ve,showEvaluateEntry:fe,showEvaluateCoundownPage:ge,showSaveBtn:ye,showEvaluateLabel:be,showAnswerParse:ke,propsConfig:Ce,evaluatePageProps:Se,evaluateCountdownProps:we,skipCover:he,scaleEdit:Ee}=E(Q,$,{query:le}),{initForm:Ae}=A(Q,$,G,{query:le}),{submitMethod:Oe}=O(Q,$,G,{query:le}),{nextLogicEvent:_e,handleDynamicDataRelation:je}=L(Q,$);(()=>{let{id:e}=le;e&&($.shareId=e)})();const Te=e=>{try{ie(),Ae(e)}catch(e){console.log(e,"--error"),$.spinning=!1,$.hasFrontAddress=!1,ne(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};o((()=>Q.ids),((e,t)=>{t?e.guage_id&&e.guage_id!=t.guage_id&&Te(e):e.guage_id&&Te(e)}),{immediate:!0}),o((()=>Q.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;$.form={},$.formArray=[];const t=JSON.parse(JSON.stringify(e));n((()=>{Ae(t)}))}),{immediate:!0});const Le=e=>{$.showEvaluateSettingWrap=!1,$.showEvaluateCountdown=!!e,G("startWriteScale")},Pe=()=>{console.log("----closeEvaluateCountdown"),$.showEvaluateCountdown=!1,ve.value||($.banSubmit=!0,Oe(),z.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>({})}))},De=e=>{z.warning({title:"提示",content:()=>S("div",{class:"evatip-container"},[S("span","答案解析:"),S("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},Fe=(e,t,a)=>{console.log(e,"--val");let{choiceObj:o,isSetObj:n}=a||{};switch(t.type.includes("SELECT")||($.form[t.val_key]=e),t.type){case"SELECT":case"EVALUATE_SELECT":{let{value:a,list:o=[]}=e;$.form[t.val_key]=a,_e(e,t,$.formArray),je(o,t,$.formArray)}break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":n&&($.choiceComObj[t.val_key]=o),_e(e,t,$.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":_e(e,t,$.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":$.submitForm[t.val_key]=e}},Be=(e,t)=>{console.log(t),$.form[t.val_key]=e},Ne=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const t=e||[],a=[],o=[];return t.forEach((e=>{o.push(e),a.push(e.labelName)})),$.labelSelectedList=t,{labelStr:a.join(","),labels:o}},xe=()=>{var e;if(!$.formArray.find((e=>T(e.type))))return void Ie("确认要提交吗?");let{evaluateResultSetting:t}=$.config;if(!t||!Object.keys(t).length&&!fe.value||Ee.value)return void Ie("确认要结束测评吗?");if("formIframe"==Q.openType&&fe.value)return void G("submitNoRequest");let a="确定要提前结束测评吗?";if(ge.value&&(null==(e=te.value)?void 0:e.getCountdownObj)){const e=te.value.getCountdownObj(),{setAnswered:t,totalLen:o}=e;t<o?a="存在未作答的题目,确定要提前结束测评吗?":!(null==$?void 0:$.showEvaluateCountdown)&&(a="确认要结束测评吗?")}he.value&&!(null==$?void 0:$.showEvaluateCountdown)&&(a="确认要结束测评吗?"),Ie(a)},Ie=e=>{z.warning({title:"温馨提示",content:()=>S("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:async()=>{const e=await qe();G("onSubmit",e)},onNegativeClick(){}})},qe=()=>new Promise(((e,t)=>{var a;null==(a=ae.value)||a.validate((t=>{var a;if(t){console.log(t);let o=(null==(a=t[0])?void 0:a[0])||{},n=o.field,i=o.message,l=$.formArray.find((e=>e.databaseTitle===n));return l&&(n=l.title),ee.error(n+i),e(!1),!1}{const t=Oe();e(t)}}))})),Me=()=>{G("onCloseSetting")};return X({getScaleData:()=>({...$}),onSubmitForm:qe,cancel:Me}),(e,t)=>(i(),l("div",K,[s(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="加载中"></n-spin>\n </template> '),$.spinning||$.hasFrontAddress?s("v-if",!0):(i(),l(r,{key:0},[u(oe).noData?(i(),c(P,{key:0,noDataImg:u(oe).noDataImg,noDataTip:u(oe).noDataTip},null,8,["noDataImg","noDataTip"])):(i(),l(r,{key:1},[u(fe)&&!u(he)?(i(),c(F,p({key:0},u(Se),{onWriteGuage:Le}),null,16)):(i(),l(r,{key:1},[u(ge)?(i(),c(D,p({key:0,ref_key:"countdownDom",ref:te},u(we),{onCloseEvaluateCountdown:Pe}),null,16)):s("v-if",!0),d("div",{class:m(["scale-container",{"scale-container-nopadding":u(ce),"scale-container-hasfooter":u(ye)}]),style:v(u(ue))},[u(me)?(i(),c(u(N),{key:0,config:$.config,maxScore:$.maxScore},null,8,["config","maxScore"])):s("v-if",!0),f(u(q),{ref_key:"formRef",ref:ae,model:$.form,rules:$.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(i(!0),l(r,null,y($.formArray,((e,t)=>(i(),l(r,{key:(e.id||e.seq)+t},[u(pe)(e)?(i(),c(u(M),{key:0,path:e.val_key,"show-label":!u(j)(e.type),class:"c-scle-form-item"},{label:g((()=>[d("span",{class:m({"scale-label-required":u(re)(e)}),innerHTML:u(de)(e)},null,10,V),u(re)(e)?(i(),l("span",H,"(必填)")):s("v-if",!0),u(be)(e)?(i(),l("span",U,b(u(be)(e)),1)):s("v-if",!0),u(se)(e)?(i(),l("span",{key:2,class:"evalute-tip",onClick:t=>(async e=>{var t;if($.evatipMap[e.id])return void De($.evatipMap[e.id]);let a="getSubjectAnswer";const o=(null==(t=Q.scaleApiConfig)?void 0:t[a])||null;if(!o||"function"!=typeof o)return void ee.error(`${a} Is not a function`);let n=await o(e.id);n&&($.evatipMap[e.id]||($.evatipMap[e.id]=n,De(n)))})(e)},[J,k(" 查看提示 ")],8,W)):s("v-if",!0)])),default:g((()=>[(i(),c(C(e.renderCom),p(u(Ce)(e,t),{key:(e.id||e.seq)+t,onScaleChange:Fe,onOnChange:t=>((e,t)=>{$.form[t.val_key]=Ne(e)})(t,e),onVodFileList:Be}),null,16,["onOnChange"])),u(ke)(e)?(i(),c(B,{key:0,item:e},null,8,["item"])):s("v-if",!0)])),_:2},1032,["path","show-label"])):s("v-if",!0)],64)))),128))])),_:1},8,["model","rules"])],6),u(ye)?(i(),l("div",Y,[s(" 分享的链接 隐藏取消按钮 "),"guage"!==Q.sourceType?(i(),c(u(R),{key:0,onClick:Me},{default:g((()=>[k("取消")])),_:1})):s("v-if",!0),Q.isLock?s("v-if",!0):(i(),c(u(R),{key:1,onClick:xe,disabled:$.banSubmit,type:"primary"},{default:g((()=>[k(" 保存 ")])),_:1},8,["disabled"]))])):s("v-if",!0)],64))],64))],64))]))}});export{X as default};
|
|
@@ -45,6 +45,10 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
45
45
|
beforeSetValue: {
|
|
46
46
|
type: import("vue").PropType<(value: string | import("../../../es/shared/types").AnyObject[]) => void | (string | import("../../../es/shared/types").AnyObject[]) | Promise<string | import("../../../es/shared/types").AnyObject[]>>;
|
|
47
47
|
};
|
|
48
|
+
menuWidth: {
|
|
49
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
50
|
+
default: number;
|
|
51
|
+
};
|
|
48
52
|
}, {
|
|
49
53
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
50
54
|
value: {
|
|
@@ -92,6 +96,10 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
92
96
|
beforeSetValue: {
|
|
93
97
|
type: import("vue").PropType<(value: string | import("../../../es/shared/types").AnyObject[]) => void | (string | import("../../../es/shared/types").AnyObject[]) | Promise<string | import("../../../es/shared/types").AnyObject[]>>;
|
|
94
98
|
};
|
|
99
|
+
menuWidth: {
|
|
100
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
101
|
+
default: number;
|
|
102
|
+
};
|
|
95
103
|
}>> & {
|
|
96
104
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
97
105
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -102,9 +110,9 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
102
110
|
onClear: () => void;
|
|
103
111
|
onClick: (evt: Event) => void;
|
|
104
112
|
onKeydown: (evt: KeyboardEvent) => void;
|
|
105
|
-
cssVariable: {
|
|
106
|
-
'--menu-width': number;
|
|
107
|
-
}
|
|
113
|
+
cssVariable: import("vue").ComputedRef<{
|
|
114
|
+
'--menu-width': string | number;
|
|
115
|
+
}>;
|
|
108
116
|
eventBus: import("../../../es/shared/types").AnyObject;
|
|
109
117
|
uuid: string;
|
|
110
118
|
show: import("vue").Ref<boolean> | import("vue").WritableComputedRef<boolean>;
|
|
@@ -226,6 +234,10 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
226
234
|
beforeSetValue: {
|
|
227
235
|
type: import("vue").PropType<(value: string | import("../../../es/shared/types").AnyObject[]) => void | (string | import("../../../es/shared/types").AnyObject[]) | Promise<string | import("../../../es/shared/types").AnyObject[]>>;
|
|
228
236
|
};
|
|
237
|
+
menuWidth: {
|
|
238
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
239
|
+
default: number;
|
|
240
|
+
};
|
|
229
241
|
}>> & {
|
|
230
242
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
231
243
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -240,5 +252,6 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
240
252
|
editPlaceholder: string;
|
|
241
253
|
labelKey: string;
|
|
242
254
|
checkAbleLevel: number | "last";
|
|
255
|
+
menuWidth: string | number;
|
|
243
256
|
}>>;
|
|
244
257
|
export default SearchCascader;
|
|
@@ -47,6 +47,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
47
|
beforeSetValue: {
|
|
48
48
|
type: PropType<(value: ValueType) => void | ValueType | Promise<ValueType>>;
|
|
49
49
|
};
|
|
50
|
+
menuWidth: {
|
|
51
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
52
|
+
default: number;
|
|
53
|
+
};
|
|
50
54
|
}, {
|
|
51
55
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
52
56
|
value: {
|
|
@@ -94,6 +98,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
94
98
|
beforeSetValue: {
|
|
95
99
|
type: PropType<(value: ValueType) => void | ValueType | Promise<ValueType>>;
|
|
96
100
|
};
|
|
101
|
+
menuWidth: {
|
|
102
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
103
|
+
default: number;
|
|
104
|
+
};
|
|
97
105
|
}>> & {
|
|
98
106
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
99
107
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -104,9 +112,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
104
112
|
onClear: () => void;
|
|
105
113
|
onClick: (evt: Event) => void;
|
|
106
114
|
onKeydown: (evt: KeyboardEvent) => void;
|
|
107
|
-
cssVariable: {
|
|
108
|
-
'--menu-width': number;
|
|
109
|
-
}
|
|
115
|
+
cssVariable: import("vue").ComputedRef<{
|
|
116
|
+
'--menu-width': string | number;
|
|
117
|
+
}>;
|
|
110
118
|
eventBus: AnyObject;
|
|
111
119
|
uuid: string;
|
|
112
120
|
show: import("vue").Ref<boolean> | import("vue").WritableComputedRef<boolean>;
|
|
@@ -228,6 +236,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
228
236
|
beforeSetValue: {
|
|
229
237
|
type: PropType<(value: ValueType) => void | ValueType | Promise<ValueType>>;
|
|
230
238
|
};
|
|
239
|
+
menuWidth: {
|
|
240
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
241
|
+
default: number;
|
|
242
|
+
};
|
|
231
243
|
}>> & {
|
|
232
244
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
233
245
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -242,5 +254,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
242
254
|
editPlaceholder: string;
|
|
243
255
|
labelKey: string;
|
|
244
256
|
checkAbleLevel: number | "last";
|
|
257
|
+
menuWidth: string | number;
|
|
245
258
|
}>;
|
|
246
259
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,
|
|
1
|
+
import{defineComponent as e,computed as a,provide as l,ref as t,nextTick as o,watch as r,openBlock as u,createBlock as n,unref as i,isRef as s,normalizeStyle as c,withCtx as d,createVNode as v,createElementVNode as p,renderSlot as f}from"vue";import{uuidGenerator as y}from"../../../shared/utils/index.js";import{NOOP as h}from"@vue/shared";import{useDebounceFn as m,useEventBus as g,useVModel as b,onClickOutside as w}from"@vueuse/core";import{isString as k,isArray as S,isFunction as K,isObject as _}from"lodash-es";import{NPopover as N,NInput as C}from"naive-ui";import{InjectionSearchCascaderCheckAbleLevel as P,InjectionKeyboardEventBus as x,InjectionSearchCascaderLoadingNode as A,InjectionSearchCascaderValue as U}from"./constants/index.js";import{SearchMenu as W}from"./components/SearchMenu.js";const j=["id"];var F=e({__name:"SearchCascader",props:{value:{type:[String,Array]},show:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},childKey:{type:String,default:"children"},placeholder:{type:String,default:"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},search:{type:Function},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},checkAbleLevel:{type:[Number,String],default:"last"},beforeSetValue:{type:Function},menuWidth:{type:[Number,String],default:150}},emits:["update:value","focus","update:show"],setup(e,{expose:F,emit:L}){const V=e;function B(){var e;e=[],Promise.resolve(K(V.beforeSetValue)?V.beforeSetValue(e):e).then((e=>L("update:value",e)),h)}function E(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&G()}const I=m((e=>{var a;"INPUT"!==(null==(a=e.target)?void 0:a.tagName)||"Enter"!==e.code||M.value?T.emit(e.key):G()}),50),R=a((()=>({"--menu-width":V.menuWidth}))),T=g("cascaderKeydown"),$=y(),M=b(V,"show",L);l(P,a((()=>V.checkAbleLevel))),l(x,T);const q=t(""),z=a({get:()=>M.value?q.value:k(V.value)?V.value:S(V.value)?V.value.reduce(((e,a,l)=>0===l?a[V.labelKey]:e+" / "+a[V.labelKey]),""):"",set(e){q.value=e,Z(void 0,e)}});function D(e){L("focus",e)}function G(){M.value||(M.value=!0,q.value="",Z())}async function H(){var e;M.value=!1,null==(e=J.value)||e.blur()}const J=t();w(J,(e=>{var a;if(!M.value)return;const l=e;if(!l.target)return H();!function(e){let a=!1,l=e;for(;l;){if(l.id===$){a=!0;break}l=l.parentElement}return a}(l.target)?H():null==(a=J.value)||a.focus()}));const O=t(),Q=t(),X=t(),Y=t(null);l(A,Y),l(U,a((()=>V.value)));const Z=m((async(e,a)=>{var l;const{type:t,node:r}=e||{};try{if("update"===t)return void(K(V.search)&&V.search({...r,isLeaf:!0}));Y.value=r;const e=await(K(V.search)&&V.search(r,a));Q.value=_(e)||S(e)?e:r,console.log("current_node_value=>",Q.value)}finally{Y.value=null,await o(),null==(l=O.value)||l.syncPosition()}}),400),ee=e=>{X.value=e};return r((()=>V.show),(e=>{e&&(X.value={})})),F({getWidth(){var e;if(!J.value)return 0;const a=null==(e=J.value)?void 0:e.$el;return a?a.clientWidth:void 0}}),(a,l)=>(u(),n(i(N),{class:"search-cascader",trigger:"manual",show:i(M),"onUpdate:show":l[1]||(l[1]=e=>s(M)?M.value=e:null),"show-arrow":!1,placement:"bottom-start",style:c(i(R)),width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:O},{trigger:d((()=>[v(i(C),{class:"search-cascader__input",placeholder:i(M)?e.editPlaceholder:e.placeholder,clearable:e.clearable,onClear:B,value:i(z),"onUpdate:value":l[0]||(l[0]=e=>s(z)?z.value=e:null),ref_key:"inputRef",ref:J,onFocus:D,onClick:E,onKeydown:i(I)},null,8,["placeholder","clearable","value","onKeydown"])])),default:d((()=>[p("section",{id:i($)},[v(i(W),{"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:i(Z),onChangeCursor:ee,"current-node":Q.value,"cursor-node":X.value},{empty:d((()=>[f(a.$slots,"empty")])),_:3},8,["label-key","value-key","options","onNodeClick","current-node","cursor-node"])],8,j)])),_:3},8,["show","style","width"]))}});export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as r,createVNode as t,createTextVNode as o,computed as n,inject as
|
|
1
|
+
import{defineComponent as e,ref as r,createVNode as t,createTextVNode as o,computed as n,inject as l,withModifiers as a}from"vue";import{traverse as c}from"../../../../shared/utils/index.js";import{Reload as s,ChevronForward as u}from"@vicons/ionicons5";import{NOOP as i}from"@vue/shared";import{useVirtualList as d}from"@vueuse/core";import{isArray as p,isFunction as f,isNumber as v,isEqual as y,isString as h}from"lodash-es";import{NCheckbox as m}from"naive-ui";import{InjectionSearchCascaderLoadingNode as g,InjectionSearchCascaderValue as N,InjectionSearchCascaderCheckAbleLevel as C,InjectionKeyboardEventBus as b}from"../constants/index.js";const k=e({props:{options:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},level:{type:Number,required:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},cursorNode:{type:Object,default:()=>({})}},emits:["nodeClick","changeCursor"],setup(e,{emit:r}){const o=n((()=>e.options)),{list:c,containerProps:f,wrapperProps:k}=d(o,{itemHeight:32,overscan:5}),K=l(g),_=l(N),x=l(C),A=l(b),S=n((()=>v(x.value)&&x.value<=e.level));function j(e){return Object.keys(e).length<=0}function w(r){return e.cursorNode==r}function I(r){const t=function(e){const r=[e];let t=e;for(;t.parent;)t=t.parent,r.unshift(t);return r}(r);if(p(_.value))return y(o(t,e.valueKey),o(_.value,e.valueKey));if(h(_.value)){const r=_.value.split("/").map((e=>e.trim()));return y(r,o(t,e.labelKey))}return!1;function o(e,r){return e.map((e=>e[r]))}}function O(e){const r=f.ref.value;if(r){const t=32*e-(null==r?void 0:r.clientHeight);r.scrollTo(0,t>0?t:0)}}return A.on((function(t){if("ArrowUp"===t){if(j(e.cursorNode))return;const t=o.value.findIndex((r=>r===e.cursorNode));if(t>=0){const e=0===t?o.value.length-1:t-1,n=o.value[e];r("changeCursor",n),O(e+3)}}if("ArrowRight"===t){if(j(e.cursorNode))return;r("nodeClick",{type:"search",node:e.cursorNode}),r("changeCursor",{})}if("ArrowDown"===t){if(j(e.cursorNode))return r("changeCursor",o.value[0]);const t=o.value.findIndex((r=>r===e.cursorNode));if(t>=0){const e=t>=o.value.length-1?0:t+1,n=o.value[e];r("changeCursor",n),O(e+1)}}if("ArrowLeft"===t&&e.activeNodes.length){const t=e.activeNodes.slice(-1);r("changeCursor",t[0])}"Enter"===t&&(S.value?r("nodeClick",{type:"update",node:e.cursorNode}):r("nodeClick",{type:"search",node:e.cursorNode}))})),()=>t("div",{class:"search-cascader__optionWrapper",ref:f.ref,style:f.style,onScroll:f.onScroll},[t("div",{style:k.value.style},[c.value.map((o=>{return t("div",{class:["search-cascader__option",{"search-cascader__option--active":(n=o.data,(null==(l=e.activeNodes)?void 0:l.includes(n))||w(o.data))}],onClick:()=>r("nodeClick",{type:"search",node:o.data}),title:o.data[e.labelKey]},[t("div",{class:"search-cascader__optionText"},[S.value?t(m,{style:{marginRight:"8px"},checked:I(o.data),onClick:a(i,["stop"]),onUpdateChecked:e=>e&&function(e){r("nodeClick",{type:"update",node:e})}(o.data)},null):null,o.data[e.labelKey]]),K.value===o.data?t(s,{class:"rotate"},null):o.data.isLeaf?null:t(u,null,null)]);var n,l}))])])}}),K=e({props:{childKey:{type:String,default:"children"},options:{type:Array,default:()=>[]},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},currentNode:{type:Object},cursorNode:{type:Object}},emits:["nodeClick","changeCursor"],setup(e,{slots:n,emit:l}){const a=r([]);function s(r,o){return t(k,{level:o+1,labelKey:e.labelKey,valueKey:e.valueKey,activeNodes:a.value,onNodeClick:e=>l("nodeClick",e),onChangeCursor:e=>l("changeCursor",e),options:r,cursorNode:e.cursorNode},null)}function u(r){let t=!1;return c(r,((r,o)=>{e.currentNode===r&&(t=!0,o())}),["children"]),console.log("node_result=>",r,t,e.currentNode),t}function i(){if(!p(e.options)||!e.currentNode)return[];const r=[e.options];let t=e.options;for(a.value.length=0;p(t);){const o=t.find(u);if(!o)break;a.value.push(o),t=o[e.childKey],r.push(t)}if(e.cursorNode){const t=r.findIndex((r=>(r&&r.findIndex((r=>r===e.cursorNode)))>=0));if(t>=0){const e=r.slice(0,t+1);return a.value.splice(t,r.length),e}}return r}return()=>t("section",{class:"search-cascader__menuWrapper"},[p(e.options)&&e.options.length?e.currentNode?i().map(s):s(e.options,0):t("section",{class:"search-cascader__emptyWrapper"},[f(n.empty)?n.empty():t("section",null,[o("empty")])])])}});export{K as SearchMenu};
|