cnhis-design-vue 3.1.51-release.0 → 3.1.51-release.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/base-search/index.d.ts +13 -8
- package/es/components/base-search/src/index.vue.d.ts +13 -8
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/callback/index.d.ts +69 -0
- package/es/components/callback/index.js +1 -0
- package/es/components/callback/src/components/dialog/drawer.vue.d.ts +353 -0
- package/es/components/callback/src/components/dialog/drawer.vue.js +1 -0
- package/es/components/callback/src/components/dialog/drawer.vue2.js +1 -0
- package/es/components/callback/src/components/dialog/modal.vue.d.ts +166 -0
- package/es/components/callback/src/components/dialog/modal.vue.js +1 -0
- package/es/components/callback/src/components/dialog/modal.vue2.js +1 -0
- package/es/components/callback/src/components/popup/index.vue.d.ts +48 -0
- package/es/components/callback/src/components/popup/index.vue.js +1 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue.d.ts +62 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue.js +1 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue2.js +1 -0
- package/es/components/callback/src/components/render/enums.d.ts +5 -0
- package/es/components/callback/src/components/render/enums.js +1 -0
- package/es/components/callback/src/components/render/index.vue.d.ts +57 -0
- package/es/components/callback/src/components/render/index.vue.js +1 -0
- package/es/components/callback/src/components/render/popupMaps.d.ts +5700 -0
- package/es/components/callback/src/components/render/popupMaps.js +1 -0
- package/es/components/callback/src/index.vue.d.ts +68 -0
- package/es/components/callback/src/index.vue.js +1 -0
- package/es/components/callback/src/index.vue2.js +1 -0
- package/es/components/callback/src/types/index.d.ts +11 -0
- package/es/components/callback/style/callback-iconfont.ttf +0 -0
- package/es/components/callback/style/index.css +1 -0
- package/es/components/classification/index.d.ts +57 -15
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +57 -15
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +57 -15
- package/es/components/classification/src/index.vue.d.ts +57 -15
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/expand-field/index.d.ts +0 -13
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +0 -13
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +0 -13
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +0 -13
- package/es/components/expand-field/src/index.vue.d.ts +0 -13
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/form-config/index.d.ts +174 -25
- package/es/components/form-config/src/FormConfig.vue.d.ts +175 -26
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -4
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +13 -10
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +121 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
- package/es/components/form-config/src/constants/index.d.ts +19 -1
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useDataNormalize.d.ts +1 -1
- package/es/components/form-config/src/hooks/useDataNormalize.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +7 -3
- package/es/components/form-config/style/index.css +1 -1
- package/es/components/form-render/index.d.ts +4 -4
- package/es/components/form-render/src/FormRender.vue.d.ts +2 -2
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -4
- package/es/components/form-render/src/components/renderer/remoteSearch.d.ts +79 -2
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +10 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +16 -10
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/components/form-render/src/types/index.d.ts +1 -19
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +1 -1
- package/es/components/iho-table/src/types/index.d.ts +2 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +4 -3
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +13 -13
- package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -13
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +5 -5
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +4 -4
- package/es/components/quick-search/index.d.ts +13 -8
- package/es/components/quick-search/src/index.vue.d.ts +13 -8
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +615 -255
- package/es/components/select-label/index.d.ts +617 -256
- package/es/components/select-label/index.js +1 -1
- package/es/components/{iho-select-label/src/LabelFormContent.vue.d.ts → select-label/src/ihoLabel/IhoLabelFormContent.vue.d.ts} +5 -5
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -0
- package/es/components/{iho-select-label/src/SelectLabel.vue.d.ts → select-label/src/ihoLabel/IhoSelectLabel.vue.d.ts} +7 -7
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -0
- package/es/components/{iho-select-label/src/components/label-classify.vue.d.ts → select-label/src/ihoLabel/iho-label-classify.vue.d.ts} +1 -1
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -0
- package/es/components/select-label/src/index.vue.d.ts +899 -0
- package/es/components/select-label/src/index.vue.js +1 -0
- package/es/components/select-label/src/index.vue2.js +1 -0
- package/es/components/shortcut-setter/index.d.ts +6 -5
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -5
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +52 -7
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue.d.ts +34 -2
- package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +36 -4
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +1 -6
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +57 -15
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.d.ts +58 -0
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +56 -1
- package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +4 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +55 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +1 -7
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/tool/transformData.d.ts +1 -6
- package/es/components/table-filter/src/tool/transformData.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +16 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +19 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/directive/flexibleResize.d.ts +4 -0
- package/es/{components/classification/src → shared}/directive/flexibleResize.js +1 -1
- package/es/shared/directive/index.d.ts +1 -0
- package/es/shared/directive/index.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +27 -0
- package/es/shared/utils/business.d.ts +1 -2
- package/es/shared/utils/index.d.ts +3 -3
- package/package.json +2 -2
- package/es/components/classification/src/directive/flexibleResize.d.ts +0 -28
- package/es/components/iho-select-label/index.d.ts +0 -363
- package/es/components/iho-select-label/index.js +0 -1
- package/es/components/iho-select-label/src/LabelFormContent.vue.js +0 -1
- package/es/components/iho-select-label/src/LabelFormContent.vue2.js +0 -1
- package/es/components/iho-select-label/src/SelectLabel.vue.js +0 -1
- package/es/components/iho-select-label/src/SelectLabel.vue2.js +0 -1
- package/es/components/iho-select-label/src/components/label-classify.vue.js +0 -1
- package/es/components/iho-select-label/src/components/label-classify.vue2.js +0 -1
- package/es/components/iho-select-label/style/iho-select-label-iconfont.ttf +0 -0
- package/es/components/iho-select-label/style/index.css +0 -1
- package/es/components/table-filter/src/types/tool.d.ts +0 -7
- /package/es/components/{iho-select-label → callback}/src/types/index.js +0 -0
- /package/es/components/{iho-select-label → select-label}/src/types/index.d.ts +0 -0
- /package/es/components/{table-filter/src/types/tool.js → select-label/src/types/index.js} +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { FormLowCodeReactions, LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/types';
|
|
2
|
+
import { FormConfigItem } from '../../../../../es/components/form-config';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: ArrayConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
default: () => never[];
|
|
8
|
+
};
|
|
9
|
+
}, {
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: FormLowCodeReactions.Config[];
|
|
12
|
+
};
|
|
13
|
+
emit: (event: "update:modelValue" | "validateFailure", ...args: any[]) => void;
|
|
14
|
+
cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
15
|
+
valueRef: import("vue").Ref<{
|
|
16
|
+
conObj: {
|
|
17
|
+
con: LOW_CODE_VALUE_RELATION;
|
|
18
|
+
field_key: string;
|
|
19
|
+
value: unknown;
|
|
20
|
+
}[];
|
|
21
|
+
sqlExpression?: string | undefined;
|
|
22
|
+
showField?: string[] | undefined;
|
|
23
|
+
hideField?: string[] | undefined;
|
|
24
|
+
requiredField?: string[] | undefined;
|
|
25
|
+
notRequiredField?: string[] | undefined;
|
|
26
|
+
enabledField?: string[] | undefined;
|
|
27
|
+
disabledField?: string[] | undefined;
|
|
28
|
+
__oppositeBindField?: any | undefined;
|
|
29
|
+
__oppositeTargetField?: any | undefined;
|
|
30
|
+
}[]>;
|
|
31
|
+
expandedName: import("vue").Ref<string>;
|
|
32
|
+
addConnection: () => void;
|
|
33
|
+
removeConnection: (index: number) => void;
|
|
34
|
+
getOppositeBtnText: (item: FormLowCodeReactions.Config) => string | undefined;
|
|
35
|
+
unBindOpposite: (item: FormLowCodeReactions.Config) => void;
|
|
36
|
+
addOppositeCondition: (item: FormLowCodeReactions.Config) => void;
|
|
37
|
+
getOppositeSqlExpression: (expression?: string) => string | undefined;
|
|
38
|
+
createOppositeCondition: (config: FormLowCodeReactions.Config) => FormLowCodeReactions.Config;
|
|
39
|
+
isOppositeConfig: (c1: FormLowCodeReactions.Config, c2: FormLowCodeReactions.Config) => boolean;
|
|
40
|
+
onUpdateExpandedNames: (value: string[]) => void;
|
|
41
|
+
getBinderFieldDesc: (index: number) => string;
|
|
42
|
+
addCondition: (config: FormLowCodeReactions.Config) => void;
|
|
43
|
+
removeCondition: (config: FormLowCodeReactions.Config, index: number) => void;
|
|
44
|
+
onUpdateConditionType: (condition: FormLowCodeReactions.ConObj, type: LOW_CODE_VALUE_RELATION) => void;
|
|
45
|
+
showRef: import("vue").Ref<boolean>;
|
|
46
|
+
fieldListRef: import("vue").Ref<FormConfigItem[]>;
|
|
47
|
+
fieldOptions: import("vue").ComputedRef<FormConfigItem[]>;
|
|
48
|
+
currentTypeList: string[];
|
|
49
|
+
dialog: import("naive-ui").DialogApi;
|
|
50
|
+
onNegativeClick: () => Promise<void>;
|
|
51
|
+
onPositiveClick: () => Promise<void>;
|
|
52
|
+
configValidate: () => Promise<void>;
|
|
53
|
+
HelpCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
54
|
+
NButton: any;
|
|
55
|
+
NModal: any;
|
|
56
|
+
NSpace: any;
|
|
57
|
+
NScrollbar: any;
|
|
58
|
+
NThing: any;
|
|
59
|
+
NInputGroup: import("vue").DefineComponent<{
|
|
60
|
+
[x: string]: never;
|
|
61
|
+
[x: number]: never;
|
|
62
|
+
[x: symbol]: never;
|
|
63
|
+
}, {
|
|
64
|
+
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
65
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
|
+
[x: string]: never;
|
|
67
|
+
[x: number]: never;
|
|
68
|
+
[x: symbol]: never;
|
|
69
|
+
}>>, {}>;
|
|
70
|
+
NSelect: any;
|
|
71
|
+
NInput: any;
|
|
72
|
+
NCollapse: any;
|
|
73
|
+
NCollapseItem: import("vue").DefineComponent<{
|
|
74
|
+
readonly title: StringConstructor;
|
|
75
|
+
readonly name: import("vue").PropType<string | number>;
|
|
76
|
+
readonly disabled: BooleanConstructor;
|
|
77
|
+
readonly displayDirective: import("vue").PropType<"if" | "show">;
|
|
78
|
+
}, {
|
|
79
|
+
rtlEnabled: import("vue").Ref<import("naive-ui/es/config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
80
|
+
collapseSlots: Readonly<{
|
|
81
|
+
[name: string]: import("vue").Slot | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
randomName: string;
|
|
84
|
+
mergedClsPrefix: import("vue").Ref<string>;
|
|
85
|
+
collapsed: import("vue").ComputedRef<boolean>;
|
|
86
|
+
mergedDisplayDirective: import("vue").ComputedRef<"if" | "show">;
|
|
87
|
+
arrowPlacement: import("vue").ComputedRef<"left" | "right">;
|
|
88
|
+
handleClick(e: MouseEvent): void;
|
|
89
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
90
|
+
readonly title: StringConstructor;
|
|
91
|
+
readonly name: import("vue").PropType<string | number>;
|
|
92
|
+
readonly disabled: BooleanConstructor;
|
|
93
|
+
readonly displayDirective: import("vue").PropType<"if" | "show">;
|
|
94
|
+
}>>, {
|
|
95
|
+
readonly disabled: boolean;
|
|
96
|
+
}>;
|
|
97
|
+
NEllipsis: any;
|
|
98
|
+
NEmpty: any;
|
|
99
|
+
NTooltip: any;
|
|
100
|
+
NIcon: any;
|
|
101
|
+
conditionTypeOptions: {
|
|
102
|
+
value: LOW_CODE_VALUE_RELATION;
|
|
103
|
+
label: string;
|
|
104
|
+
}[];
|
|
105
|
+
connectionTypeOptions: {
|
|
106
|
+
value: string;
|
|
107
|
+
label: string;
|
|
108
|
+
}[];
|
|
109
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "validateFailure")[], "update:modelValue" | "validateFailure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
110
|
+
modelValue: {
|
|
111
|
+
type: ArrayConstructor;
|
|
112
|
+
required: true;
|
|
113
|
+
default: () => never[];
|
|
114
|
+
};
|
|
115
|
+
}>> & {
|
|
116
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
117
|
+
onValidateFailure?: ((...args: any[]) => any) | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
modelValue: unknown[];
|
|
120
|
+
}>;
|
|
121
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./FormConfigEventSetting.vue2.js";import t from"../../../../_virtual/_plugin-vue_export-helper.js";var r=t(e,[["__file","FormConfigEventSetting.vue"]]);export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,ref as l,watchEffect as o,watch as n,inject as i,computed as t,reactive as a,openBlock as s,createElementBlock as d,createVNode as u,unref as p,withCtx as r,createTextVNode as c,normalizeStyle as _,createElementVNode as v,Fragment as f,renderList as m,createBlock as h,toDisplayString as g,withModifiers as y,createCommentVNode as b,normalizeClass as F}from"vue";import{useTheme as k}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as x,isEmpty as O,isArray as j,union as C,omit as T}from"lodash-es";import{traverse as B}from"../../../../shared/utils/index.js";import{HelpCircleSharp as E}from"@vicons/ionicons5";import{useDialog as N,NButton as U,NModal as L,NScrollbar as z,NCollapse as q,NCollapseItem as w,NEllipsis as P,NThing as R,NSpace as $,NInputGroup as I,NSelect as A,NInput as D,NTooltip as V,NIcon as M,NEmpty as W}from"naive-ui";import{conditionOppositeMap as H,connectionTypeOptions as S,connectionTypeOppositeMap as X,InjectionFieldList as G,conditionTypeOptions as J}from"../constants/index.js";const K={class:"form-config__connectionOperation"},Q={class:"form-config__connectionConditionHeaderDesc"},Y={class:"form-config__connectionCondition"},Z={class:"form-config__connectionConditionItem"},ee={style:{"margin-right":"8px"}},le={class:"form-config__connectionFieldType"},oe=["onClick"],ne={style:{display:"inline-flex","align-items":"center",gap:"4px","margin-bottom":"4px"}};var ie=e({__name:"FormConfigEventSetting",props:{modelValue:{default:()=>[]}},emits:["update:modelValue","validateFailure"],setup(e,{emit:ie}){const te=e,ae=k(),se=l([]),de=l("");function ue(){se.value.push({conObj:[]}),de.value=se.value.length-1+""}function pe(e){return e.__oppositeBindField?`已绑定互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeBindField))+1}`:e.__oppositeTargetField?`已关联互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeTargetField))+1}`:void 0}function re(e){return null==e?void 0:e.replace(/(AND|OR)/g,(e=>"AND"===e?"OR":"AND"))}function ce(e){var l;const o=e.__oppositeTargetField||{conObj:[]};return o.conObj=x(e.conObj),null==(l=o.conObj)||l.forEach((e=>{e.con=H[e.con]})),o.sqlExpression=re(e.sqlExpression),S.forEach((({value:l})=>{O(e[l])?Reflect.deleteProperty(o,X[l]):o[X[l]]=x(e[l])})),o.__oppositeBindField=e,o}function _e(e,l){var o,n,i,t;return(null==(o=e.conObj)?void 0:o.length)===(null==(n=l.conObj)?void 0:n.length)&&(!(e.conObj&&l.conObj&&e.conObj.some((e=>!l.conObj.find((l=>{return n=l,(o=e).field_key===n.field_key&&o.con&&H[o.con]===n.con&&o.value===n.value;var o,n})))))&&(i=e.sqlExpression,t=l.sqlExpression,(!i&&!t||re(i)===t)&&!S.some((({value:o})=>{return n=e[o],i=l[X[o]],!(n&&i?n.length===i.length&&n.every((e=>i.some((l=>e===l)))):!n&&!i);var n,i}))))}function ve(e){de.value=e[0]}function fe(e){const l=se.value[e];if(!l)return"";const o=l.conObj||[],n=S.reduce(((e,{value:o})=>(j(l[o])&&l[o].length&&e.push(...l[o].map(t)),e)),[]),i=C([...o.map((({field_key:e})=>t(e))),...n]).filter((e=>!!e));return i.length?`( 相关字段: ${i} )`:"";function t(e){var l,o;return null!=(o=null==(l=ge.value.find((l=>e===l.key)))?void 0:l.name)?o:e}}o((()=>{se.value.forEach((e=>{e.__oppositeTargetField&&(e.__oppositeTargetField=ce(e))}))}));const me=l(!1);n(me,(e=>{e&&(se.value=x(te.modelValue),se.value.forEach(((e,l)=>{if(e.__oppositeBindField||e.__oppositeTargetField)return;const o=se.value.find(((o,n)=>n!==l&&!o.__oppositeBindField&&!o.__oppositeTargetField&&_e(o,e)));o&&(o.__oppositeBindField=e,e.__oppositeTargetField=o)})))}));const he=i(G,l([])),ge=t((()=>{const e=[];return B(he.value,(l=>{!["NEWLINE","LINE_BAR","COMPLEX","COMBINATION"].includes(l.type)&&e.push(l)})),e})),ye=a([]),be=N();async function Fe(){be.warning({title:"提示",content:"直接关闭弹窗会丢失已编辑的配置, 确定要关闭吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{me.value=!1,se.value=[]}})}async function ke(){try{await function(){var e;const l=[];return null==(e=se.value)||e.forEach(((e,o)=>{const n=[];e.conObj&&e.conObj.length?e.conObj.forEach(((e,l)=>{e.field_key||n.push(`条件${l+1}字段为空`),e.con||n.push(`条件${l+1}判断类型为空`),["NULL","NOT_NULL"].includes(e.con)||!e.con||e.value||n.push(`条件${l+1}值为空`)})):n.push("联动条件为空"),S.every((({value:l})=>!e[l]||!e[l].length))&&n.push("联动字段为空"),n.length&&l.push(`联动${o+1}: ${n}`)})),l.length?Promise.reject(l):Promise.resolve()}(),me.value=!1,ie("update:modelValue",se.value.map((e=>T(e,["__oppositeBindField","__oppositeTargetField"]))))}catch(e){ie("validateFailure",e)}}return(e,l)=>(s(),d("section",null,[u(p(U),{size:"small",onClick:l[0]||(l[0]=e=>me.value=!0)},{default:r((()=>[c("调整联动绑定")])),_:1}),u(p(L),{show:me.value,"onUpdate:show":l[1]||(l[1]=e=>me.value=e),closable:!1,bordered:!1,"show-icon":!1,title:"联动绑定设置",preset:"dialog","mask-closable":!1,"close-on-esc":!1,style:_({width:"1000px",...p(ae)}),class:"form-config__connectionModal"},{action:r((()=>[u(p(U),{size:"small",onClick:Fe},{default:r((()=>[c("取消")])),_:1}),u(p(U),{size:"small",onClick:ke,type:"primary"},{default:r((()=>[c("确定")])),_:1})])),default:r((()=>[v("header",K,[u(p(U),{onClick:ue,size:"small"},{default:r((()=>[c("新增联动")])),_:1})]),u(p(z),{style:{"max-height":"500px","min-height":"500px"}},{default:r((()=>[u(p(q),{accordion:"","expanded-names":de.value,"onUpdate:expandedNames":ve},{default:r((()=>[(s(!0),d(f,null,m(se.value,((e,l)=>(s(),h(p(w),{name:l+""},{header:r((()=>[c(" 联动"+g(l+1)+" ",1),u(p(P),{class:"form-config__connectionConditionHeaderDesc",style:{"max-width":"500px"}},{default:r((()=>[c(g(fe(l)),1)])),_:2},1024)])),"header-extra":r((()=>[e.__oppositeBindField||e.__oppositeTargetField?(s(),d(f,{key:1},[v("span",Q,"( "+g(pe(e))+" )",1),u(p(U),{quaternary:"",type:"primary",size:"small",onClick:y((l=>function(e){const l=e.__oppositeTargetField||e.__oppositeBindField;l&&[l,e].forEach((e=>{Reflect.deleteProperty(e,"__oppositeBindField"),Reflect.deleteProperty(e,"__oppositeTargetField")}))}(e)),["stop"])},{default:r((()=>[c("解除互斥")])),_:2},1032,["onClick"])],64)):(s(),h(p(U),{key:0,onClick:y((l=>function(e){se.value.push(e.__oppositeTargetField=ce(e))}(e)),["stop"]),quaternary:"",type:"primary",size:"small"},{default:r((()=>[c(" 创建互斥条件 ")])),_:2},1032,["onClick"])),u(p(U),{onClick:y((e=>function(e){var l;const o=null==(l=se.value)?void 0:l.splice(e,1);null==o||o.forEach((e=>{const l=e.__oppositeTargetField||e.__oppositeBindField;l&&(Reflect.deleteProperty(l,"__oppositeTargetField"),Reflect.deleteProperty(l,"__oppositeBindField"))})),ye.splice(e,1),!de.value||+de.value<e||(de.value=de.value===e+""?"":+de.value-1+"")}(l)),["stop"]),quaternary:"",type:"error",size:"small"},{default:r((()=>[c("移除")])),_:2},1032,["onClick"])])),default:r((()=>[u(p(R),{class:"form-config__connectionWrapper"},{default:r((()=>[u(p($),{justify:"space-between",wrap:!1},{default:r((()=>[v("section",Y,[v("header",null,[c(" 条件 "),e.__oppositeBindField?b("v-if",!0):(s(),h(p(U),{key:0,size:"small",quaternary:"",type:"primary",onClick:l=>{var o;j((o=e).conObj)?o.conObj.push({}):o.conObj=[{}]}},{default:r((()=>[c(" 添加条件 ")])),_:2},1032,["onClick"]))]),u(p(z),{style:{"max-height":"145px","min-height":"145px"},class:"form-config__connectionWrapper"},{default:r((()=>[(s(!0),d(f,null,m(e.conObj||[],((l,o)=>(s(),d("div",Z,[v("span",ee,g(o+1),1),u(p(I),{size:"small"},{default:r((()=>[u(p(A),{value:l.field_key,"onUpdate:value":e=>l.field_key=e,disabled:!!e.__oppositeBindField,placeholder:"请选择字段",options:p(ge),"label-field":"name","value-field":"key",filterable:""},null,8,["value","onUpdate:value","disabled","options"]),u(p(A),{value:l.con,disabled:!!e.__oppositeBindField,"onUpdate:value":e=>function(e,l){e.con=l,["NOT_NULL","NULL"].includes(l)&&Reflect.deleteProperty(e,"value")}(l,e),placeholder:"请选择判断类型",options:p(J)},null,8,["value","disabled","onUpdate:value","options"]),l.con&&!["NULL","NOT_NULL"].includes(l.con)?(s(),h(p(D),{key:0,disabled:!!e.__oppositeBindField,value:l.value,"onUpdate:value":e=>l.value=e,placeholder:"请输入值",clearable:""},null,8,["disabled","value","onUpdate:value"])):b("v-if",!0)])),_:2},1024),u(p(U),{disabled:!!e.__oppositeBindField,quaternary:"",onClick:l=>function(e,l){j(e.conObj)&&e.conObj.splice(l,1)}(e,o),type:"error",size:"small"},{default:r((()=>[c(" 移除 ")])),_:2},1032,["disabled","onClick"])])))),256))])),_:2},1024)]),v("section",le,[v("div",null,[(s(!0),d(f,null,m(p(S),(o=>{var n,i;return s(),d("div",{key:o.value,class:F({"is-active":ye[l]===o.value}),onClick:e=>ye[l]=o.value},g(o.label)+" ( "+g(null!=(i=null==(n=e[o.value])?void 0:n.length)?i:0)+" ) ",11,oe)})),128))]),v("div",null,[ye[l]?(s(),h(p(A),{key:0,value:e[ye[l]],"onUpdate:value":o=>e[ye[l]]=o,disabled:!!e.__oppositeBindField,multiple:"",placeholder:"请选择字段",options:p(ge),"label-field":"name","value-field":"key",filterable:"","max-tag-count":10},null,8,["value","onUpdate:value","disabled","options"])):b("v-if",!0)])])])),_:2},1024),v("section",null,[v("label",null,[v("span",ne,[c(" 条件逻辑 "),u(p(V),null,{trigger:r((()=>[u(p(M),{size:"16",component:p(E)},null,8,["component"])])),default:r((()=>[c(" 非必填, 默认为需要全部满足. 示例: (1 AND 2) OR 3, 表示 条件1和2需要满足其一, 条件3必须满足 ")])),_:1})]),u(p(D),{value:e.sqlExpression,"onUpdate:value":l=>e.sqlExpression=l,disabled:!!e.__oppositeBindField,placeholder:"请输入条件逻辑"},null,8,["value","onUpdate:value","disabled"])])])])),_:2},1024)])),_:2},1032,["name"])))),256))])),_:1},8,["expanded-names"]),se.value.length?b("v-if",!0):(s(),h(p(W),{key:0,size:"huge",style:{"margin-top":"20px"},description:"无联动配置"}))])),_:1})])),_:1},8,["show","style"])]))}});export{ie as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UndefinedAble } from '../../../../../es/shared/types';
|
|
1
|
+
import { FormLowCodeReactions, LOW_CODE_VALUE_RELATION, UndefinedAble } from '../../../../../es/shared/types';
|
|
2
2
|
import { InjectionKey, Ref } from 'vue';
|
|
3
3
|
import { FormConfigItem } from '../../../../../es/components/form-config';
|
|
4
4
|
export declare const WidgetTextMap: Map<string, string>;
|
|
@@ -77,8 +77,26 @@ export declare function isVisibleOptionConfig(): {
|
|
|
77
77
|
value: boolean;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
+
export declare const conditionOppositeMap: Record<LOW_CODE_VALUE_RELATION, LOW_CODE_VALUE_RELATION>;
|
|
81
|
+
export declare const conditionTypeOptions: {
|
|
82
|
+
value: LOW_CODE_VALUE_RELATION;
|
|
83
|
+
label: string;
|
|
84
|
+
}[];
|
|
85
|
+
export declare const connectionTypeOppositeMap: {
|
|
86
|
+
showField: string;
|
|
87
|
+
hideField: string;
|
|
88
|
+
requiredField: string;
|
|
89
|
+
notRequiredField: string;
|
|
90
|
+
enabledField: string;
|
|
91
|
+
disabledField: string;
|
|
92
|
+
};
|
|
93
|
+
export declare const connectionTypeOptions: {
|
|
94
|
+
value: string;
|
|
95
|
+
label: string;
|
|
96
|
+
}[];
|
|
80
97
|
export declare const FORM_CONFIG_GROUP = "__display";
|
|
81
98
|
export declare const InjectionFieldList: InjectionKey<Ref<FormConfigItem[]>>;
|
|
82
99
|
export declare const InjectionMaterialList: InjectionKey<Ref<FormConfigItem[]>>;
|
|
100
|
+
export declare const InjectionLowCodeReactions: InjectionKey<Ref<FormLowCodeReactions.Config[]>>;
|
|
83
101
|
export declare const InjectionActiveFieldItem: InjectionKey<Ref<UndefinedAble<FormConfigItem>>>;
|
|
84
102
|
export declare const InjectionFormConfigEmit: InjectionKey<(event: 'addItem' | 'removeItem', ...args: unknown[]) => void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{range as e}from"lodash-es";const
|
|
1
|
+
import{range as e}from"lodash-es";const l=new Map([["LINE_BAR","分线栏"],["NEWLINE","分行符"]]);var a=(e=>(e.NAME="name",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(a||{});function i(){return{option:[{text:"整行",value:"ALL_LINE"},{text:"半行",value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function t(){return{option:e(1,11).map((e=>({text:`${e}行`,value:e})))}}function u(){return{open:{describe:"默认展开",value:!0},close:{describe:"默认收起",value:!1}}}function d(){return{open:{describe:"可折叠",value:!0},close:{describe:"不可折叠",value:!1}}}function n(){return{open:{describe:"可编辑",value:!0},close:{describe:"不可编辑",value:!1}}}function o(){return{open:{describe:"必填",value:!0},close:{describe:"不必填",value:!1}}}function E(){return{open:{describe:"显示",value:!0},close:{describe:"隐藏",value:!1}}}const r={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},b=[{value:"EQ",label:"等于"},{value:"NEQ",label:"不等于"},{value:"CL",label:"包含"},{value:"NC",label:"不包含"},{value:"NULL",label:"为空"},{value:"NOT_NULL",label:"不为空"},{value:"BIG",label:"大于"},{value:"BIGEQ",label:"大于等于"},{value:"LESS",label:"小于"},{value:"LESSEQ",label:"小于等于"}],v={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},L=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],c="__display",s=Symbol("InjectionFieldList"),F=Symbol("InjectionMaterialList"),N=Symbol("InjectionLowCodeReactions"),I=Symbol("InjectionActiveFieldItem"),S=Symbol("InjectionFormConfigEmit");export{a as EditAbleField,c as FORM_CONFIG_GROUP,I as InjectionActiveFieldItem,s as InjectionFieldList,S as InjectionFormConfigEmit,N as InjectionLowCodeReactions,F as InjectionMaterialList,l as WidgetTextMap,r as conditionOppositeMap,b as conditionTypeOptions,v as connectionTypeOppositeMap,L as connectionTypeOptions,n as isEditOptionConfig,d as isNotFoldOptionConfig,o as isNullOptionConfig,u as isShowOptionConfig,E as isVisibleOptionConfig,t as rowsOptionConfig,i as widgetWidthOptionConfig};
|
|
@@ -3,5 +3,5 @@ export declare function useDataNormalize(props: {
|
|
|
3
3
|
fieldVisitor?: FormConfigVisitor;
|
|
4
4
|
}): {
|
|
5
5
|
transform: (fieldList: FormConfigItem[]) => FormConfigItem[];
|
|
6
|
-
inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean) => FormConfigItem[];
|
|
6
|
+
inverseTransform: (fieldList: FormConfigItem[], withOriginalSetting: boolean, otherConfig?: Partial<FormConfigItem>) => FormConfigItem[];
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e,r){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>r?e:n(e,["originalSetting"])))}}}export{r as useDataNormalize};
|
|
1
|
+
import{isObject as e,omit as n}from"lodash-es";function r(r){return{transform:function(n){let i=null;const t=r.fieldVisitor;return n.reduce(((n,r)=>(r.originalSetting&&e(t)&&t[r.key]&&t[r.key]({field:r.originalSetting,replace(e){r.originalSetting=e}}),"LINE_BAR"===r.type?(r.children=[],i=r.children,n.push(r),n):i?(i.push(r),n):(n.push(r),n))),[])},inverseTransform:function(e,r,i){return e.reduce(((e,r)=>("LINE_BAR"===r.type?(e.push(n(r,["children"])),e.push(...r.children||[])):e.push(r),e)),[]).map((e=>{const t=r?e:n(e,["originalSetting"]);return i?{...t,...i}:t}))}}}export{r as useDataNormalize};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, FunctionalComponent } from 'vue';
|
|
2
|
-
import { ArrayAble } from '../../../../../es/shared/types';
|
|
2
|
+
import { ArrayAble, FormLowCodeReactions } from '../../../../../es/shared/types';
|
|
3
3
|
import { FieldItem } from '../../../../../es/components/form-render';
|
|
4
4
|
interface Matcher {
|
|
5
5
|
(type: string): boolean;
|
|
@@ -36,9 +36,13 @@ export interface FormConfigTextFormatter {
|
|
|
36
36
|
(formConfigItem: FormConfigItem, parsedText: string): string;
|
|
37
37
|
}
|
|
38
38
|
export interface FormConfigExpose {
|
|
39
|
-
loadData(payload: Record<'fieldList', FormConfigItem[]>
|
|
39
|
+
loadData(payload: Record<'fieldList', FormConfigItem[]> & {
|
|
40
|
+
lowCodeReactions?: FormLowCodeReactions.Config[];
|
|
41
|
+
}): void;
|
|
40
42
|
validate(): Promise<unknown>;
|
|
41
|
-
getData(withOriginalSetting?: boolean): Record<'fieldList' | 'materialList', FormConfigItem[]
|
|
43
|
+
getData(withOriginalSetting?: boolean): Record<'fieldList' | 'materialList', FormConfigItem[]> & {
|
|
44
|
+
lowCodeReactions: FormLowCodeReactions.Config[];
|
|
45
|
+
};
|
|
42
46
|
clearExtraList(): void;
|
|
43
47
|
}
|
|
44
48
|
interface FieldVisitorContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.form-config,.form-config__material{display:flex;justify-content:space-between}.form-config__material{border-radius:8px;box-sizing:border-box;flex-direction:column;flex-shrink:0;padding:16px;width:200px}.form-config__materialHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__materialContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;flex-shrink:0;flex:1;gap:8px;max-height:var(--max-height);min-height:200px;overflow-y:auto;padding:16px}.form-config__materialExtraList{margin-top:12px}.form-config__displayWrapper{border-radius:8px;box-sizing:border-box;flex-shrink:0;flex:1;min-width:400px;padding:16px 0}.form-config__displayHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__displayContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:grid!important;flex-shrink:0;gap:8px;grid-template-columns:repeat(24,minmax(0,1fr));height:fit-content;max-height:var(--max-height);overflow-y:auto;padding:16px}.form-config__displayContentItem{grid-column:span var(--item-column) /span var(--item-column);position:relative}.form-config__config{border-radius:8px;box-sizing:border-box;flex-shrink:0;padding:16px;width:240px}.form-config__configHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__configContent{border:none;border-radius:8px;box-sizing:border-box;flex-shrink:0;max-height:var(--max-height);min-height:38px;overflow-y:auto;padding:16px}.form-config__renderer{box-sizing:border-box;cursor:move;justify-content:flex-start;width:100%}.form-config__renderer--default{align-items:center;box-sizing:border-box;display:flex;padding:8px 0;position:relative;user-select:none;width:100%}.form-config__renderer--defaultWrapper{align-items:center;border-radius:2px;box-sizing:border-box;display:inline-flex;height:34px;padding:0 14px;transition:all .3s linear}.form-config__renderer--defaultWrapper.is-disabled{background-color:transparent;border:1px dashed var(--c-primary-color)}.form-config__renderer--defaultWrapper:not(.is-disabled){background-color:rgba(46,51,56,.05);border:1px dashed transparent}.form-config__renderer--defaultWrapper:not(.is-disabled):hover{background-color:rgba(46,51,56,.09)}.form-config__renderer--defaultWrapper:not(.is-disabled):active{background-color:rgba(46,51,56,.15)}.form-config__renderer--complex{border:1px dashed var(--c-primary-color);border-radius:8px;padding:8px}.form-config__renderer--complexHeader{display:flex;justify-content:center;margin-top:-8px;padding:8px;position:relative}.form-config__renderer--complex--grid{display:grid!important;gap:8px;grid-column:span var(--item-column) /span var(--item-column);grid-template-columns:repeat(24,minmax(0,1fr));min-height:24px}.form-config__renderer--complex--flex{display:flex;min-height:24px}.form-config .is-required{padding-left:16px!important}.form-config .is-required:before{color:red;content:"*";left:8px;position:absolute}.form-config .is-extra:before{border-bottom:6px solid transparent;border-left:6px solid var(--c-primary-color);border-right:6px solid transparent;border-top:6px solid var(--c-primary-color);content:"";height:0;left:0;position:absolute;top:0;width:0}.form-config .is-active{color:var(--c-primary-color)!important}.form-config .is-choosing{box-shadow:inset var(--c-primary-color) 0 0 0 2px;opacity:.7}.form-config .is-choosing-area{background:hsla(0,0%,50%,.1)}.form-config [is-hovering=true] .form-config__renderer--closeButton{visibility:visible}.form-config .form-config__renderer--closeButton{position:absolute;right:4px;top:50%;transform:translateY(-50%);visibility:hidden}
|
|
1
|
+
.form-config,.form-config__material{display:flex;justify-content:space-between}.form-config__material{border-radius:8px;box-sizing:border-box;flex-direction:column;flex-shrink:0;padding:16px;width:200px}.form-config__materialHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__materialContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;flex-shrink:0;flex:1;gap:8px;max-height:var(--max-height);min-height:200px;overflow-y:auto;padding:16px}.form-config__materialExtraList{margin-top:12px}.form-config__displayWrapper{border-radius:8px;box-sizing:border-box;flex-shrink:0;flex:1;min-width:400px;padding:16px 0}.form-config__displayHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__displayContent{border:1px dashed hsla(0,0%,50%,.35);border-radius:8px;box-sizing:border-box;display:grid!important;flex-shrink:0;gap:8px;grid-template-columns:repeat(24,minmax(0,1fr));height:fit-content;max-height:var(--max-height);overflow-y:auto;padding:16px}.form-config__displayContentItem{grid-column:span var(--item-column) /span var(--item-column);position:relative}.form-config__config{border-radius:8px;box-sizing:border-box;flex-shrink:0;padding:16px;width:240px}.form-config__configHeader{align-items:center;display:flex;height:40px;justify-content:space-between}.form-config__configContent{border:none;border-radius:8px;box-sizing:border-box;flex-shrink:0;max-height:var(--max-height);min-height:38px;overflow-y:auto;padding:16px}.form-config__renderer{box-sizing:border-box;cursor:move;justify-content:flex-start;width:100%}.form-config__renderer--default{align-items:center;box-sizing:border-box;display:flex;padding:8px 0;position:relative;user-select:none;width:100%}.form-config__renderer--defaultWrapper{align-items:center;border-radius:2px;box-sizing:border-box;display:inline-flex;height:34px;padding:0 14px;transition:all .3s linear}.form-config__renderer--defaultWrapper.is-disabled{background-color:transparent;border:1px dashed var(--c-primary-color)}.form-config__renderer--defaultWrapper:not(.is-disabled){background-color:rgba(46,51,56,.05);border:1px dashed transparent}.form-config__renderer--defaultWrapper:not(.is-disabled):hover{background-color:rgba(46,51,56,.09)}.form-config__renderer--defaultWrapper:not(.is-disabled):active{background-color:rgba(46,51,56,.15)}.form-config__renderer--complex{border:1px dashed var(--c-primary-color);border-radius:8px;padding:8px}.form-config__renderer--complexHeader{display:flex;justify-content:center;margin-top:-8px;padding:8px;position:relative}.form-config__renderer--complex--grid{display:grid!important;gap:8px;grid-column:span var(--item-column) /span var(--item-column);grid-template-columns:repeat(24,minmax(0,1fr));min-height:24px}.form-config__renderer--complex--flex{display:flex;min-height:24px}.form-config .is-required{padding-left:16px!important}.form-config .is-required:before{color:red;content:"*";left:8px;position:absolute}.form-config .is-extra:before{border-bottom:6px solid transparent;border-left:6px solid var(--c-primary-color);border-right:6px solid transparent;border-top:6px solid var(--c-primary-color);content:"";height:0;left:0;position:absolute;top:0;width:0}.form-config .is-active{color:var(--c-primary-color)!important}.form-config .is-choosing{box-shadow:inset var(--c-primary-color) 0 0 0 2px;opacity:.7}.form-config .is-choosing-area{background:hsla(0,0%,50%,.1)}.form-config [is-hovering=true] .form-config__renderer--closeButton{visibility:visible}.form-config .form-config__renderer--closeButton{position:absolute;right:4px;top:50%;transform:translateY(-50%);visibility:hidden}.form-config__connectionModal .n-collapse .n-collapse-item:not(:first-of-type){margin-top:4px}.form-config__connectionModal .n-collapse .n-collapse-item .n-collapse-item__header{padding-top:4px}.form-config__connectionOperation{margin-bottom:8px}.form-config__connectionWrapper{border:1px solid #e5e5e5;border-radius:4px;padding:8px}.form-config__connectionCondition{width:450px}.form-config__connectionCondition>header{align-items:center;display:flex;gap:12px}.form-config__connectionConditionHeaderDesc{color:#a5a5a5;display:inline-block;margin-left:12px}.form-config__connectionConditionItem{align-items:center;display:flex;margin-bottom:4px}.form-config__connectionConditionItem>div:first-of-type{flex:1}.form-config__connectionFieldType{display:flex;height:100%}.form-config__connectionFieldType>div:first-of-type{display:flex;flex-direction:column;height:100%;justify-content:space-between;margin-right:-1px}.form-config__connectionFieldType>div:first-of-type>div{background:#f5f5f5;border:1px solid #e5e5e5;cursor:pointer;padding:2px 4px 2px 8px}.form-config__connectionFieldType>div:first-of-type>div:not(:last-of-type){margin-bottom:4px}.form-config__connectionFieldType>div:first-of-type>div.is-active{background:#fff;border-right-color:#fff;color:var(--c-primary-color);z-index:1}.form-config__connectionFieldType>div:nth-of-type(2){border:1px solid #e5e5e5;padding:8px;width:300px}
|
|
@@ -131,7 +131,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
131
131
|
default: boolean;
|
|
132
132
|
};
|
|
133
133
|
lowCodeReactions: {
|
|
134
|
-
type: import("vue").PropType<import("
|
|
134
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
135
135
|
};
|
|
136
136
|
operationalForm: {
|
|
137
137
|
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -276,7 +276,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
276
276
|
default: boolean;
|
|
277
277
|
};
|
|
278
278
|
lowCodeReactions: {
|
|
279
|
-
type: import("vue").PropType<import("
|
|
279
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
280
280
|
};
|
|
281
281
|
operationalForm: {
|
|
282
282
|
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -435,7 +435,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
435
435
|
businessFormatter: import("./src/types").FormBusinessFormatter;
|
|
436
436
|
requestInstance: import("./src/hooks").RequestInstance;
|
|
437
437
|
enterToNextWidget: boolean | ((fieldItem: import("./src/types").FieldItem) => boolean | void);
|
|
438
|
-
lowCodeReactions: import("
|
|
438
|
+
lowCodeReactions: import("../../../es/shared/types").FormLowCodeReactions.Config[];
|
|
439
439
|
linebarAutoHidden: boolean;
|
|
440
440
|
bordered: string | boolean;
|
|
441
441
|
uniqueCacheData: boolean;
|
|
@@ -846,7 +846,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
846
846
|
default: boolean;
|
|
847
847
|
};
|
|
848
848
|
lowCodeReactions: {
|
|
849
|
-
type: import("vue").PropType<import("
|
|
849
|
+
type: import("vue").PropType<import("../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
850
850
|
};
|
|
851
851
|
operationalForm: {
|
|
852
852
|
type: import("vue").PropType<import("../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyObject, FormOperationalConfig } from '../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, FormLowCodeReactions, FormOperationalConfig } from '../../../../es/shared/types';
|
|
2
2
|
import { Field } from '@formily/core';
|
|
3
3
|
import { Component, FunctionalComponent, PropType } from 'vue';
|
|
4
4
|
import { RequestInstance } from './hooks';
|
|
5
|
-
import { FieldItem, FieldVisitor, FormBusinessFormatter
|
|
5
|
+
import { FieldItem, FieldVisitor, FormBusinessFormatter } from './types';
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{
|
|
7
7
|
fieldList: {
|
|
8
8
|
type: PropType<FieldItem[]>;
|
|
@@ -129,7 +129,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
129
129
|
default: boolean;
|
|
130
130
|
};
|
|
131
131
|
lowCodeReactions: {
|
|
132
|
-
type: import("vue").PropType<import("../../../../es/
|
|
132
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
133
133
|
};
|
|
134
134
|
operationalForm: {
|
|
135
135
|
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -274,7 +274,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
274
274
|
default: boolean;
|
|
275
275
|
};
|
|
276
276
|
lowCodeReactions: {
|
|
277
|
-
type: import("vue").PropType<import("../../../../es/
|
|
277
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
278
278
|
};
|
|
279
279
|
operationalForm: {
|
|
280
280
|
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -433,7 +433,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
433
433
|
businessFormatter: import("../../../../es/components/form-render").FormBusinessFormatter;
|
|
434
434
|
requestInstance: import("../../../../es/components/form-render").RequestInstance;
|
|
435
435
|
enterToNextWidget: boolean | ((fieldItem: import("../../../../es/components/form-render").FieldItem) => boolean | void);
|
|
436
|
-
lowCodeReactions: import("../../../../es/
|
|
436
|
+
lowCodeReactions: import("../../../../es/shared/types").FormLowCodeReactions.Config[];
|
|
437
437
|
linebarAutoHidden: boolean;
|
|
438
438
|
bordered: string | boolean;
|
|
439
439
|
uniqueCacheData: boolean;
|
|
@@ -844,7 +844,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
844
844
|
default: boolean;
|
|
845
845
|
};
|
|
846
846
|
lowCodeReactions: {
|
|
847
|
-
type: import("vue").PropType<import("../../../../es/
|
|
847
|
+
type: import("vue").PropType<import("../../../../es/shared/types").FormLowCodeReactions.Config[]>;
|
|
848
848
|
};
|
|
849
849
|
operationalForm: {
|
|
850
850
|
type: import("vue").PropType<import("../../../../es/shared/types").FormOperationalConfig[]>;
|
|
@@ -3,7 +3,7 @@ import { PropType } from 'vue';
|
|
|
3
3
|
import { UrlConfig } from '../../../../../../es/components/form-render';
|
|
4
4
|
export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
5
5
|
value: {
|
|
6
|
-
type: PropType<
|
|
6
|
+
type: PropType<string | null>;
|
|
7
7
|
};
|
|
8
8
|
requestCache: {
|
|
9
9
|
type: BooleanConstructor;
|
|
@@ -22,17 +22,54 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
22
22
|
type: StringConstructor;
|
|
23
23
|
default: string;
|
|
24
24
|
};
|
|
25
|
+
showField: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
25
28
|
urlConfig: {
|
|
26
29
|
type: PropType<UrlConfig>;
|
|
27
30
|
};
|
|
31
|
+
autograph: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
};
|
|
34
|
+
wordbook: {
|
|
35
|
+
type: PropType<Partial<{
|
|
36
|
+
level_num: number;
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
render_key: string[];
|
|
40
|
+
search_key: string[];
|
|
41
|
+
value_key: string;
|
|
42
|
+
queryParams: string[];
|
|
43
|
+
primary_key: string;
|
|
44
|
+
type: string;
|
|
45
|
+
level_key: string;
|
|
46
|
+
link_key: string;
|
|
47
|
+
link_key_split: string;
|
|
48
|
+
show_key: string | string[];
|
|
49
|
+
conObj: AnyObject[];
|
|
50
|
+
conObjFirstLevel: AnyObject[];
|
|
51
|
+
setting: Partial<{
|
|
52
|
+
cascading: {
|
|
53
|
+
'form.name': string;
|
|
54
|
+
value: string;
|
|
55
|
+
}[];
|
|
56
|
+
}>;
|
|
57
|
+
}>>;
|
|
58
|
+
};
|
|
28
59
|
onChange: {};
|
|
29
60
|
useLoading: {
|
|
30
61
|
type: BooleanConstructor;
|
|
31
62
|
default: boolean;
|
|
32
63
|
};
|
|
64
|
+
lazyRequest: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
};
|
|
68
|
+
multiple: BooleanConstructor;
|
|
69
|
+
deletable: BooleanConstructor;
|
|
33
70
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
71
|
value: {
|
|
35
|
-
type: PropType<
|
|
72
|
+
type: PropType<string | null>;
|
|
36
73
|
};
|
|
37
74
|
requestCache: {
|
|
38
75
|
type: BooleanConstructor;
|
|
@@ -51,21 +88,61 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
51
88
|
type: StringConstructor;
|
|
52
89
|
default: string;
|
|
53
90
|
};
|
|
91
|
+
showField: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
};
|
|
54
94
|
urlConfig: {
|
|
55
95
|
type: PropType<UrlConfig>;
|
|
56
96
|
};
|
|
97
|
+
autograph: {
|
|
98
|
+
type: StringConstructor;
|
|
99
|
+
};
|
|
100
|
+
wordbook: {
|
|
101
|
+
type: PropType<Partial<{
|
|
102
|
+
level_num: number;
|
|
103
|
+
id: string;
|
|
104
|
+
name: string;
|
|
105
|
+
render_key: string[];
|
|
106
|
+
search_key: string[];
|
|
107
|
+
value_key: string;
|
|
108
|
+
queryParams: string[];
|
|
109
|
+
primary_key: string;
|
|
110
|
+
type: string;
|
|
111
|
+
level_key: string;
|
|
112
|
+
link_key: string;
|
|
113
|
+
link_key_split: string;
|
|
114
|
+
show_key: string | string[];
|
|
115
|
+
conObj: AnyObject[];
|
|
116
|
+
conObjFirstLevel: AnyObject[];
|
|
117
|
+
setting: Partial<{
|
|
118
|
+
cascading: {
|
|
119
|
+
'form.name': string;
|
|
120
|
+
value: string;
|
|
121
|
+
}[];
|
|
122
|
+
}>;
|
|
123
|
+
}>>;
|
|
124
|
+
};
|
|
57
125
|
onChange: {};
|
|
58
126
|
useLoading: {
|
|
59
127
|
type: BooleanConstructor;
|
|
60
128
|
default: boolean;
|
|
61
129
|
};
|
|
130
|
+
lazyRequest: {
|
|
131
|
+
type: BooleanConstructor;
|
|
132
|
+
default: boolean;
|
|
133
|
+
};
|
|
134
|
+
multiple: BooleanConstructor;
|
|
135
|
+
deletable: BooleanConstructor;
|
|
62
136
|
}>> & {
|
|
63
137
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
64
138
|
}, {
|
|
65
139
|
options: AnyObject[];
|
|
140
|
+
multiple: boolean;
|
|
66
141
|
labelField: string;
|
|
67
142
|
valueField: string;
|
|
143
|
+
lazyRequest: boolean;
|
|
68
144
|
requestCache: boolean;
|
|
145
|
+
deletable: boolean;
|
|
69
146
|
allowCreate: boolean;
|
|
70
147
|
useLoading: boolean;
|
|
71
148
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,
|
|
1
|
+
import{defineComponent as e,watch as l,inject as o,computed as a,createVNode as t}from"vue";import{connect as n,mapProps as u}from"@formily/vue";import{HelpCircleSharp as r}from"@vicons/ionicons5";import{useVModel as i,useDebounceFn as s}from"@vueuse/core";import{cloneDeep as p,isString as v}from"lodash-es";import{NSelect as d,NSpin as m,NEmpty as f,NTooltip as c,NIcon as y,NTag as g}from"naive-ui";import"../../../index.js";import{InjectionChangeContextCollector as h}from"../../constants/index.js";import{useCommonInjection as C,useSelectOptionProps as b}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as j,assignClearBindVisited as F,createVisitedSetter as w}from"../../utils/schema.js";import{useFormField as x}from"../../hooks/useFormField.js";import{useUrlConfigOptions as B,useAutographOptions as K}from"../../hooks/useFormRenderOptions.js";const S=n(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},allowCreate:Boolean,labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},onChange:{},useLoading:{type:Boolean,default:!0},lazyRequest:{type:Boolean,default:!0},multiple:Boolean,deletable:Boolean},emits:["update:value"],setup(e,{slots:n,emit:u}){const j=i(e,"value",u),{field:F,fieldKey:S}=x(),{injectValueValidate:k,injectValueBindKey:O}=C();k(j);const D=O(j),R={onRequestConfigChange:({fetchData:e,valueKey:l})=>e(j.value,{[l]:j.value}),onDepsChange:({fetchData:e,valueKey:l})=>e(j.value,{[l]:j.value})},{labelKey:q,valueKey:L,showKey:P,fetchData:V,searchContent:I,fullOptions:U,loading:z}=e.urlConfig?B(e,j,R):K(e,j,R),A=s(((e="",l="label")=>V(e,{["value"===l?L.value:"keyword"]:e})),300);l(j,(e=>{if(e&&!U.value.find((l=>l[L.value]===e)))return A(e,"value")}));o(h).setContext(S.value,(e=>{return{currentOption:p((l=e,U.value.find((e=>e[L.value]===l))))};var l}));const{menuProps:T,nodeProps:$}=b(),E=a((()=>U.value.length||!e.allowCreate?U.value:I.value?[{[q.value]:I.value,[L.value]:I.value},...U.value]:U.value));async function G(e){z.value=e,e&&A()}function H(e){const l=e.alias||e[q.value];if(!l||!v(l))return"";const o=l;return e.desc?t("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[o,e.desc?t(c,null,{trigger:()=>t(y,{component:r},null),default:()=>e.desc}):null]):o}function J({option:l,handleClose:o}){var a;const n=null!=(a=P.value&&l[P.value])?a:l[q.value];if(!e.multiple)return n;return e.deletable?t(g,{closable:!0,onClose:function(e){e.stopPropagation(),o()}},{default:()=>n}):`${n};`}return()=>t(d,{remote:!0,filterable:!0,key:D.value,value:j.value,"onUpdate:value":e=>j.value=e,labelField:q.value,valueField:L.value,"menu-props":T,"node-props":$,onSearch:A,"onUpdate:show":G,options:E.value,onFocus:w(F),renderLabel:H,renderTag:J},{empty:()=>e.useLoading&&z.value?t(m,null,null):t(f,{description:"无数据"},null),...n})}}),u(j,F));export{S as REMOTE_SEARCH};
|
|
@@ -102,6 +102,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
102
102
|
multiple: {
|
|
103
103
|
type: BooleanConstructor;
|
|
104
104
|
};
|
|
105
|
+
deletable: {
|
|
106
|
+
type: BooleanConstructor;
|
|
107
|
+
default: boolean;
|
|
108
|
+
};
|
|
105
109
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend")[], "update:value" | "postRecommend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
106
110
|
value: {
|
|
107
111
|
type: PropType<ArrayAble<string | number> | null>;
|
|
@@ -201,6 +205,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
201
205
|
multiple: {
|
|
202
206
|
type: BooleanConstructor;
|
|
203
207
|
};
|
|
208
|
+
deletable: {
|
|
209
|
+
type: BooleanConstructor;
|
|
210
|
+
default: boolean;
|
|
211
|
+
};
|
|
204
212
|
}>> & {
|
|
205
213
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
206
214
|
onPostRecommend?: ((...args: any[]) => any) | undefined;
|
|
@@ -212,13 +220,14 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
212
220
|
allowModify: boolean;
|
|
213
221
|
lazyRequest: boolean;
|
|
214
222
|
requestCache: boolean;
|
|
223
|
+
deletable: boolean;
|
|
224
|
+
shouldSave: boolean;
|
|
215
225
|
recommend: boolean;
|
|
216
226
|
recommendCache: boolean;
|
|
217
227
|
commonNum: number;
|
|
218
228
|
recentNum: number;
|
|
219
229
|
allowCreate: boolean;
|
|
220
230
|
useLoading: boolean;
|
|
221
|
-
shouldSave: boolean;
|
|
222
231
|
showCustomValue: boolean;
|
|
223
232
|
cursorPlacement: "end" | "start";
|
|
224
233
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as l,inject as t,useAttrs as o,ref as a,createVNode as u,mergeProps as n,toRaw as r,nextTick as s}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{HelpCircleSharp as p}from"@vicons/ionicons5";import{promiseTimeout as m}from"@vueuse/shared";import{cloneDeep as c,isArray as d,isString as v,isObject as f,omit as y}from"lodash-es";import{useCommonInjection as h,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as S,useComplexOptionsSpan as
|
|
1
|
+
import{defineComponent as e,computed as l,inject as t,useAttrs as o,ref as a,createVNode as u,mergeProps as n,toRaw as r,nextTick as s}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{HelpCircleSharp as p}from"@vicons/ionicons5";import{promiseTimeout as m}from"@vueuse/shared";import{cloneDeep as c,isArray as d,isString as v,isObject as f,omit as y}from"lodash-es";import{useCommonInjection as h,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as S,useComplexOptionsSpan as b}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as j,InjectionFormUUID as C}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import{NSelect as w,NTooltip as k,NIcon as F,NTag as B}from"naive-ui";import"date-fns";import{assignUpdateValue as x,assignClearBindVisited as O,createVisitedSetter as A}from"../../utils/schema.js";import{useFormField as H}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as P,mapProps as R}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as V,useAutographOptions as K,useRecommendOptions as L,searchContentMatcher as E}from"../../hooks/useFormRenderOptions.js";const _=P(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0}},emits:["update:value","postRecommend"],setup(e,{slots:x,emit:O}){const P=l({get:()=>e.value,async set(e){O("update:value",e),J(e)}}),R=l((()=>(e.multiple&&e.allowModify&&console.warn("多选模式下不支持allowModify"),!e.multiple&&e.allowModify))),{labelKey:_,valueKey:I,showKey:N,fetchData:M,searchContent:W,fullOptions:q,filterOptions:U,remoteOptions:z,loading:D}=e.urlConfig?V(e,P):K(e,P),{renderComplexOption:T,hasComplexOption:$}=S(e,P),{getRecommend:G,postRecommend:J,sortedOptions:Q}=L(e,U,O,_,I),{field:X,fieldKey:Y}=H();t(j).setContext(Y.value,(e=>({currentOption:c(function(e){const l=re(q.value);return d(e)?function(e){const t=l.reduce(((e,l)=>(e[l[I.value]]=l,e)),{});return e.map((e=>t[e]))}(e):(t=e,l.find((e=>e[I.value]===t)));var t}(e))})));const Z=async(e="")=>(W.value=e,Promise.allSettled([M(e),G(e)])),{injectValueValidate:ee,injectValueWatchFromEmpty:le,injectValueBindKey:te}=h();le(P,Z),ee(P);const oe=te(P),{menuProps:ae,nodeProps:ue}=g();function ne(e){const l=e[_.value];if(!l||!v(l))return"";const t=W.value?E(W.value,l):null,o=t?u("section",null,[t.map(((e,l)=>0!==l&&e?u("span",{style:{color:l%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):l;return e.desc?u("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[o,e.desc?u(k,null,{trigger:()=>u(F,{component:p},null),default:()=>e.desc}):null]):o}function re(l){return e.allowCreate&&W.value&&!l.some((e=>e[_.value]===W.value))?[...l,{[_.value]:W.value,[I.value]:W.value,created:!0,shouldSave:e.shouldSave}]:l}const se=l((()=>re(R.value?q.value:Q.value))),ie=o(),pe=l((()=>{if(e.allowCreate||e.showCustomValue)return P.value;const l=e.multiple&&d(P.value);return q.value.find((e=>l?P.value.includes(e[I.value]):e[I.value]===P.value))?P.value:null})),me=a(!1);async function ce(e){e&&await Z(),me.value=e}let de=null;async function ve(l,t){P.value=l,de&&f(t)&&R.value&&(de.focus(),await s(),de.value=t[_.value]||"",de.dispatchEvent(new CustomEvent("input")),"start"===e.cursorPlacement&&de.setSelectionRange(0,0)),z.value&&t&&i(t).forEach((e=>{if(!f(e))return;const l=e;l.created&&l.shouldSave&&z.value.push(y(r(l),["created","shouldSave"]))}))}const fe=t(C),{getSpan:ye}=b(),he=A(X,(async l=>{var t,o,a;R.value&&(de=l.target,de&&P.value&&(await s(),de.value=null!=(a=null!=(o=null==(t=q.value.find((e=>e[I.value]===P.value)))?void 0:t[_.value])?o:P.value)?a:"",de.dispatchEvent(new CustomEvent("input")),"start"===e.cursorPlacement&&(await m(0),de.setSelectionRange(0,0))))}));function ge(e){if(!R.value)return;if(de=e.target,!de)return;if(!de.value)return P.value=null;const l=q.value.find((e=>e[_.value]===de.value));l?P.value=l[I.value]:(W.value=de.value,P.value=de.value)}function Se({option:l,handleClose:t}){var o;const a=null!=(o=N.value&&l[N.value])?o:l[_.value];return e.multiple?e.deletable?u(B,{closable:!0,onClose:e=>{e.stopPropagation(),t()}},{default:()=>a}):`${a} ;`:a}function be(l){return u(w,n({key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:D.value,value:pe.value,onUpdateValue:ve,"menu-props":ae,"node-props":ue,labelField:_.value,valueField:I.value,options:se.value,onSearch:Z,show:me.value,"onUpdate:show":ce,onFocus:he,onBlur:ge,renderLabel:ne,renderTag:Se},l,ie),x)}return()=>{var e,l;if(!$.value)return be();const t=null!=(l=null==(e=X.value.decoratorProps)?void 0:e.span)?l:6,o=ye(fe,X.value.address);return u("section",{class:"form-render__selectChildField",style:{"--column":o+t}},[be({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),q.value.map((e=>T({option:e,value:P.value,valueKey:I.value,labelKey:_.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":o}}})))])}}}),R({dataSource:"options"},x,O));export{_ as SELECT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as p,createLinebarId as a}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),x=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=f(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},_=e=>{var o,t,r,s,p;const a=x(e);e.urlConfig?d(a,e):e.autograph&&m(a,e);const l=!!e.__multiple,c="1"===e.allowModify;return Object.assign(a["x-component-props"],{multiple:l,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowModify:c,allowCreate:"1"===e.free_entry||!!a["x-component-props"].allowCreate||c,shouldSave:"1"===e.save_free_entry,showField:null!=(r=e.show_key)?r:null==(t=e.componentProps)?void 0:t.showField,maxTagCount:null!=(p=i(e.multi_select_value))?p:null==(s=a["x-component-props"])?void 0:s.maxTagCount,...n(e,["lazyRequest","requestCache"])}),l&&(a.type="array"),a},h=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:a(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),b=new Map([["LINEBAR",y],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",_],["REMOTE_SEARCH",_],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),v=e=>{if(e.suffixConfig)return w(e);return(b.get(e.html_type)||g)(e)},w=o=>{if(!o.suffixConfig&&!o.prefixConfig)return v(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=x(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:p(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),i},{FieldNormalizeWaterfallHook:C,FieldListNormalizeWaterfallHook:O}=s();function j(o,n={column:9999}){let i=null;return O.call(t(o),n).reduce(((e,o,p)=>{var a;const l=null==(a=(o=C.call(o,n)).validate)?void 0:a.obj_type;return l&&u&&u.collect(l,t(o)),"LINEBAR"===o.html_type?(e[s(o)]=r(y(o),p),i=e[s(o)].properties={}):i?i[s(o)]=r(v(o),p):(i=null,e[s(o)]=r(v(o),p)),e}),{});function r(e,o){return e["x-index"]=o,e}function s(o){return o.suffixConfig?p([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{u as useFieldListAdaptor};
|