@aplus-frontend/ui 0.0.2 → 0.0.4
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/src/ap-table/ap-table.vue.d.ts +1 -5
- package/es/src/ap-table/ap-table.vue.mjs +133 -123
- package/es/src/ap-table/components/interface.d.ts +12 -0
- package/es/src/ap-table/components/status/index.vue.d.ts +14 -0
- package/es/src/ap-table/components/status/index.vue.mjs +4 -0
- package/es/src/ap-table/components/status/index.vue2.mjs +17 -0
- package/es/src/ap-table/constants.d.ts +20 -25
- package/es/src/ap-table/constants.mjs +19 -16
- package/es/src/ap-table/interface.d.ts +32 -7
- package/es/src/ap-table/utils.d.ts +204 -2
- package/es/src/ap-table/utils.mjs +87 -40
- package/es/src/ap-tag/style/ap-tag-group.css +1 -0
- package/es/src/ap-tag/style/ap-tag.css +1 -0
- package/es/src/pro-form/components/form-action.vue2.mjs +37 -35
- package/es/src/pro-form/hooks/use-advanced.mjs +45 -45
- package/es/src/pro-table/style/pro-table.css +3 -0
- package/es/src/theme/antd-global-overwrite/admin/index.css +104 -49
- package/es/src/theme/antd-global-overwrite/admin/pagination.css +30 -14
- package/es/src/theme/antd-global-overwrite/admin/steps.css +39 -15
- package/es/src/theme/antd-global-overwrite/admin/table.css +35 -20
- package/es/src/theme/antd-global-overwrite/aplus/index.css +110 -53
- package/es/src/theme/antd-global-overwrite/aplus/pagination.css +38 -18
- package/es/src/theme/antd-global-overwrite/aplus/steps.css +37 -15
- package/es/src/theme/antd-global-overwrite/aplus/table.css +35 -20
- package/es/src/theme/ap-tag/ap-tag-group.css +1 -0
- package/es/src/theme/ap-tag/ap-tag.css +1 -0
- package/es/src/theme/pro-table/pro-table.css +3 -0
- package/lib/src/ap-table/ap-table.vue.d.ts +1 -5
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/interface.d.ts +12 -0
- package/lib/src/ap-table/components/status/index.vue.d.ts +14 -0
- package/lib/src/ap-table/components/status/index.vue.js +1 -0
- package/lib/src/ap-table/components/status/index.vue2.js +1 -0
- package/lib/src/ap-table/constants.d.ts +20 -25
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/interface.d.ts +32 -7
- package/lib/src/ap-table/utils.d.ts +204 -2
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/ap-tag/style/ap-tag-group.css +1 -0
- package/lib/src/ap-tag/style/ap-tag.css +1 -0
- package/lib/src/pro-form/components/form-action.vue2.js +1 -1
- package/lib/src/pro-form/hooks/use-advanced.js +1 -1
- package/lib/src/pro-table/style/pro-table.css +3 -0
- package/lib/src/theme/antd-global-overwrite/admin/index.css +104 -49
- package/lib/src/theme/antd-global-overwrite/admin/pagination.css +30 -14
- package/lib/src/theme/antd-global-overwrite/admin/steps.css +39 -15
- package/lib/src/theme/antd-global-overwrite/admin/table.css +35 -20
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +110 -53
- package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +38 -18
- package/lib/src/theme/antd-global-overwrite/aplus/steps.css +37 -15
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +35 -20
- package/lib/src/theme/ap-tag/ap-tag-group.css +1 -0
- package/lib/src/theme/ap-tag/ap-tag.css +1 -0
- package/lib/src/theme/pro-table/pro-table.css +3 -0
- package/package.json +1 -1
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import { ValueEnum, ValueEnumType } from './interface';
|
|
1
|
+
import { ApColumnType, ApTableValueFields, ValueEnum, ValueEnumType } from './interface';
|
|
2
|
+
import { Translator } from '../config-provider';
|
|
3
|
+
import { AlignType, FixedType, Key, CellEllipsisType, DataIndex, ColumnType, GetComponentProps, ColumnGroupType } from 'ant-design-vue/es/vc-table/interface';
|
|
4
|
+
import { ColumnTitle, CompareFn, SortOrder, FilterDropdownProps, FilterValue, FilterSearchType, ColumnFilterItem } from 'ant-design-vue/es/table/interface';
|
|
5
|
+
import { Breakpoint } from 'ant-design-vue/es/_util/responsiveObserve';
|
|
6
|
+
import { ExtractPropTypes, PropType, CSSProperties } from 'vue';
|
|
7
|
+
import { VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
8
|
+
import { TriggerType } from 'ant-design-vue/es/tooltip/abstractTooltipProps';
|
|
9
|
+
import { TooltipPlacement, AdjustOverflow } from 'ant-design-vue/es/tooltip';
|
|
10
|
+
import { LiteralUnion, VueNode } from 'ant-design-vue/es/_util/type';
|
|
11
|
+
import { PresetColorType } from 'ant-design-vue/es/_util/colors';
|
|
12
|
+
import { AlignType, BuildInPlacements } from 'ant-design-vue/es/vc-trigger/interface';
|
|
13
|
+
import { TableColumnType } from 'ant-design-vue';
|
|
2
14
|
|
|
3
15
|
export type FieldValueType = 'multiple' | 'multipleNumber' | 'dayjs' | 'dayjsRange' | 'dayjsDayRange' | 'number' | 'boolean' | 'object';
|
|
4
16
|
export declare const formatParamsValueType: (type: FieldValueType | Record<string, FieldValueType>, value: any, cb: (t: FieldValueType, value: any) => any) => any;
|
|
@@ -28,5 +40,195 @@ export declare const objectToMap: (value: ValueEnum | undefined) => ValueEnumMap
|
|
|
28
40
|
* @param valueEnumParams
|
|
29
41
|
* @returns
|
|
30
42
|
*/
|
|
31
|
-
export declare const valueEnumToArray: (valueEnumParams: ValueEnum) => OptionType;
|
|
43
|
+
export declare const valueEnumToArray: (valueEnumParams: ValueEnum) => Partial<OptionType>[];
|
|
44
|
+
/**
|
|
45
|
+
* 获取列在查询表单中的排序
|
|
46
|
+
* @param order
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export declare const getColumnOrder: (order?: number) => number;
|
|
50
|
+
/**
|
|
51
|
+
* 获取查询表单的placeholder
|
|
52
|
+
* @param t
|
|
53
|
+
* @param valueType
|
|
54
|
+
* @param placeholder
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
export declare const getPlaceholder: (t: Translator, valueType?: keyof ApTableValueFields, placeholder?: string) => string | string[] | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* 获取对象形式的FieldProps
|
|
60
|
+
* @param fieldProps
|
|
61
|
+
* @param record
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
export declare function getFieldProps<RecordType = any>(fieldProps: ApColumnType<any, any>['fieldProps'], opt?: {
|
|
65
|
+
value: any;
|
|
66
|
+
text: any;
|
|
67
|
+
record: any;
|
|
68
|
+
index: number;
|
|
69
|
+
renderIndex: number;
|
|
70
|
+
column: ApColumnType<any, RecordType>;
|
|
71
|
+
}): any;
|
|
72
|
+
/**
|
|
73
|
+
* 获取表格的渲染类型
|
|
74
|
+
* @param item
|
|
75
|
+
* @returns
|
|
76
|
+
*/
|
|
77
|
+
export declare function getTableRenderType(item: ApColumnType<any, any>): "number" | "text" | "select" | "switch" | "index" | "status" | "checkbox" | "radio" | "date" | "action" | "dateRange" | "textArea";
|
|
78
|
+
/**
|
|
79
|
+
* 处理表格render组件的props
|
|
80
|
+
* @param item
|
|
81
|
+
* @param renderOption
|
|
82
|
+
* @returns
|
|
83
|
+
*/
|
|
84
|
+
export declare function getTableRenderProps(item: ApColumnType<any, any>, renderOption: any): any;
|
|
85
|
+
/**
|
|
86
|
+
* 将apColumn转化为column
|
|
87
|
+
* @param column
|
|
88
|
+
* @returns
|
|
89
|
+
*/
|
|
90
|
+
export declare function apColumnToColumn(column: ApColumnType<any>): {
|
|
91
|
+
align?: AlignType | undefined;
|
|
92
|
+
class?: string | undefined;
|
|
93
|
+
title?: ColumnTitle<any>;
|
|
94
|
+
width?: string | number | undefined;
|
|
95
|
+
slots?: {
|
|
96
|
+
filterIcon?: string | undefined;
|
|
97
|
+
filterDropdown?: string | undefined;
|
|
98
|
+
customRender?: string | undefined;
|
|
99
|
+
title?: string | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
fixed?: FixedType | undefined;
|
|
102
|
+
key?: Key | undefined;
|
|
103
|
+
responsive?: Breakpoint[] | undefined;
|
|
104
|
+
maxWidth?: number | undefined;
|
|
105
|
+
minWidth?: number | undefined;
|
|
106
|
+
ellipsis?: CellEllipsisType | undefined;
|
|
107
|
+
colSpan?: number | undefined;
|
|
108
|
+
dataIndex?: DataIndex | undefined;
|
|
109
|
+
customRender?: ((opt: {
|
|
110
|
+
value: any;
|
|
111
|
+
text: any;
|
|
112
|
+
record: any;
|
|
113
|
+
index: number;
|
|
114
|
+
renderIndex: number;
|
|
115
|
+
column: ColumnType<any>;
|
|
116
|
+
}) => any) | undefined;
|
|
117
|
+
rowSpan?: number | undefined;
|
|
118
|
+
resizable?: boolean | undefined;
|
|
119
|
+
customCell?: GetComponentProps<any> | undefined;
|
|
120
|
+
onCellClick?: ((record: any, e: MouseEvent) => void) | undefined;
|
|
121
|
+
className?: string | undefined;
|
|
122
|
+
customHeaderCell?: GetComponentProps< ColumnType<any> | ColumnGroupType<any>> | undefined;
|
|
123
|
+
customFilterDropdown?: boolean | undefined;
|
|
124
|
+
__originColumn__?: any;
|
|
125
|
+
sorter?: ((boolean | CompareFn<any> | {
|
|
126
|
+
compare?: CompareFn<any> | undefined;
|
|
127
|
+
multiple?: number | undefined;
|
|
128
|
+
}) & (string | boolean | CompareFn<any> | {
|
|
129
|
+
compare?: CompareFn<any> | undefined;
|
|
130
|
+
multiple?: number | undefined;
|
|
131
|
+
})) | undefined;
|
|
132
|
+
sortOrder?: SortOrder | undefined;
|
|
133
|
+
defaultSortOrder?: SortOrder | undefined;
|
|
134
|
+
sortDirections?: SortOrder[] | undefined;
|
|
135
|
+
showSorterTooltip?: boolean | Partial< ExtractPropTypes<{
|
|
136
|
+
title: VueTypeValidableDef<any>;
|
|
137
|
+
trigger: PropType< TriggerType | TriggerType[]>;
|
|
138
|
+
open: {
|
|
139
|
+
type: BooleanConstructor;
|
|
140
|
+
default: any;
|
|
141
|
+
};
|
|
142
|
+
visible: {
|
|
143
|
+
type: BooleanConstructor;
|
|
144
|
+
default: any;
|
|
145
|
+
};
|
|
146
|
+
placement: PropType<TooltipPlacement>;
|
|
147
|
+
color: PropType<LiteralUnion<PresetColorType>>;
|
|
148
|
+
transitionName: StringConstructor;
|
|
149
|
+
overlayStyle: {
|
|
150
|
+
type: PropType<CSSProperties>;
|
|
151
|
+
default: CSSProperties;
|
|
152
|
+
};
|
|
153
|
+
overlayInnerStyle: {
|
|
154
|
+
type: PropType<CSSProperties>;
|
|
155
|
+
default: CSSProperties;
|
|
156
|
+
};
|
|
157
|
+
overlayClassName: StringConstructor;
|
|
158
|
+
openClassName: StringConstructor;
|
|
159
|
+
prefixCls: StringConstructor;
|
|
160
|
+
mouseEnterDelay: NumberConstructor;
|
|
161
|
+
mouseLeaveDelay: NumberConstructor;
|
|
162
|
+
getPopupContainer: PropType<(triggerNode: HTMLElement) => HTMLElement>;
|
|
163
|
+
arrowPointAtCenter: {
|
|
164
|
+
type: BooleanConstructor;
|
|
165
|
+
default: any;
|
|
166
|
+
};
|
|
167
|
+
arrow: {
|
|
168
|
+
type: PropType<boolean | {
|
|
169
|
+
pointAtCenter?: boolean | undefined;
|
|
170
|
+
}>;
|
|
171
|
+
default: boolean | {
|
|
172
|
+
pointAtCenter?: boolean | undefined;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
autoAdjustOverflow: {
|
|
176
|
+
type: PropType<boolean | AdjustOverflow>;
|
|
177
|
+
default: boolean | AdjustOverflow;
|
|
178
|
+
};
|
|
179
|
+
destroyTooltipOnHide: {
|
|
180
|
+
type: BooleanConstructor;
|
|
181
|
+
default: any;
|
|
182
|
+
};
|
|
183
|
+
align: {
|
|
184
|
+
type: PropType<AlignType>;
|
|
185
|
+
default: AlignType;
|
|
186
|
+
};
|
|
187
|
+
builtinPlacements: {
|
|
188
|
+
type: PropType<BuildInPlacements>;
|
|
189
|
+
default: BuildInPlacements;
|
|
190
|
+
};
|
|
191
|
+
children: ArrayConstructor;
|
|
192
|
+
onVisibleChange: PropType<(vis: boolean) => void>;
|
|
193
|
+
'onUpdate:visible': PropType<(vis: boolean) => void>;
|
|
194
|
+
onOpenChange: PropType<(vis: boolean) => void>;
|
|
195
|
+
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
196
|
+
}>> | undefined;
|
|
197
|
+
filtered?: boolean | undefined;
|
|
198
|
+
filterDropdown?: VueNode | ((props: FilterDropdownProps<any>) => VueNode);
|
|
199
|
+
filterMultiple?: boolean | undefined;
|
|
200
|
+
filteredValue?: FilterValue | null | undefined;
|
|
201
|
+
defaultFilteredValue?: FilterValue | null | undefined;
|
|
202
|
+
filterIcon?: VueNode | ((opt: {
|
|
203
|
+
filtered: boolean;
|
|
204
|
+
column: TableColumnType<any>;
|
|
205
|
+
}) => VueNode);
|
|
206
|
+
filterMode?: "menu" | "tree" | undefined;
|
|
207
|
+
filterSearch?: FilterSearchType<ColumnFilterItem> | undefined;
|
|
208
|
+
onFilter?: ((value: string | number | boolean, record: any) => boolean) | undefined;
|
|
209
|
+
filterDropdownOpen?: boolean | undefined;
|
|
210
|
+
onFilterDropdownOpenChange?: ((visible: boolean) => void) | undefined;
|
|
211
|
+
filterResetToDefaultFilteredValue?: boolean | undefined;
|
|
212
|
+
filterDropdownVisible?: boolean | undefined;
|
|
213
|
+
onFilterDropdownVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
214
|
+
children?: ApColumnType<any, any>[] | undefined;
|
|
215
|
+
span?: number | undefined;
|
|
216
|
+
tooltip?: string | undefined;
|
|
217
|
+
copyable?: boolean | undefined;
|
|
218
|
+
hideInSearch?: boolean | undefined;
|
|
219
|
+
hideInTable?: boolean | undefined;
|
|
220
|
+
valueEnum?: ValueEnum | undefined;
|
|
221
|
+
customRenderFormItem?: ((config: ApColumnType<"text", any>) => any) | undefined;
|
|
222
|
+
valueType?: keyof ApTableValueFields | undefined;
|
|
223
|
+
fieldProps?: any;
|
|
224
|
+
order?: number | undefined;
|
|
225
|
+
filters?: true | ColumnFilterItem[] | undefined;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* 更新查询表单的的props
|
|
229
|
+
* @param item
|
|
230
|
+
* @param fieldProps
|
|
231
|
+
* @returns
|
|
232
|
+
*/
|
|
233
|
+
export declare function updateFormProps(item: ApColumnType<any, any>, fieldProps: any): any;
|
|
32
234
|
export {};
|
|
@@ -1,63 +1,110 @@
|
|
|
1
|
-
import { isObject as
|
|
2
|
-
const
|
|
1
|
+
import { isObject as s, isArray as c, isUndefined as f, isFunction as l, omit as d, isBoolean as p } from "lodash-unified";
|
|
2
|
+
const m = (e, t, n) => {
|
|
3
3
|
let o = {};
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
}) : o = n(
|
|
7
|
-
},
|
|
8
|
-
switch (
|
|
4
|
+
return s(e) ? Object.keys(e).forEach((u) => {
|
|
5
|
+
s(e[u]) ? o[u] = m(e[u], t[u], n) : o[u] = n(e[u], t);
|
|
6
|
+
}) : o = n(e, t), o;
|
|
7
|
+
}, h = (e, t) => {
|
|
8
|
+
switch (e) {
|
|
9
9
|
case "dayjs":
|
|
10
|
-
return
|
|
10
|
+
return t.valueOf();
|
|
11
11
|
case "dayjsRange":
|
|
12
|
-
return
|
|
12
|
+
return t.map((n) => n.valueOf());
|
|
13
13
|
case "dayjsDayRange": {
|
|
14
|
-
const [n, o] =
|
|
14
|
+
const [n, o] = t;
|
|
15
15
|
return [n.startOf("day").valueOf(), o.endOf("day").valueOf()];
|
|
16
16
|
}
|
|
17
17
|
case "multiple":
|
|
18
18
|
case "multipleNumber":
|
|
19
|
-
return
|
|
19
|
+
return c(t) ? t : [t];
|
|
20
20
|
case "boolean":
|
|
21
|
-
return
|
|
21
|
+
return t;
|
|
22
22
|
case "object":
|
|
23
|
-
return
|
|
23
|
+
return t;
|
|
24
24
|
default:
|
|
25
|
-
return
|
|
25
|
+
return t;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function y(e) {
|
|
29
|
+
return c(e) ? e.join(".") : e;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
return
|
|
31
|
+
function x(e) {
|
|
32
|
+
const t = Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();
|
|
33
|
+
return t === "string" && typeof e == "object" ? "object" : e === null ? "null" : e === void 0 ? "undefined" : t;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
return n.forEach((o,
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
if (typeof
|
|
41
|
-
|
|
42
|
-
text:
|
|
43
|
-
value:
|
|
44
|
-
label:
|
|
45
|
-
disabled:
|
|
35
|
+
const T = (e) => x(e) === "map" ? e : new Map(Object.entries(e || {})), a = (e) => {
|
|
36
|
+
const t = [], n = T(e);
|
|
37
|
+
return n.forEach((o, u) => {
|
|
38
|
+
const r = n.get(u) || n.get(`${u}`);
|
|
39
|
+
if (r) {
|
|
40
|
+
if (typeof r == "object" && (r != null && r.text)) {
|
|
41
|
+
t.push({
|
|
42
|
+
text: r == null ? void 0 : r.text,
|
|
43
|
+
value: u,
|
|
44
|
+
label: r == null ? void 0 : r.text,
|
|
45
|
+
disabled: r.disabled
|
|
46
46
|
});
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
text:
|
|
51
|
-
label:
|
|
52
|
-
value:
|
|
49
|
+
t.push({
|
|
50
|
+
text: r,
|
|
51
|
+
label: r,
|
|
52
|
+
value: u
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
55
|
+
}), t;
|
|
56
|
+
}, E = (e) => f(e) || e < 0 ? 0 : e, j = (e, t, n) => {
|
|
57
|
+
if (n)
|
|
58
|
+
return n;
|
|
59
|
+
const o = ["select", "date"], u = [
|
|
60
|
+
"text",
|
|
61
|
+
"textArea",
|
|
62
|
+
"number"
|
|
63
|
+
];
|
|
64
|
+
if (t === "dateRange")
|
|
65
|
+
return [e("ap.common.chooseText"), e("ap.common.chooseText")];
|
|
66
|
+
if (o.includes(t))
|
|
67
|
+
return e("ap.common.chooseText");
|
|
68
|
+
if (u.includes(t))
|
|
69
|
+
return e("ap.common.inputText");
|
|
56
70
|
};
|
|
71
|
+
function b(e, t) {
|
|
72
|
+
return !e || !l(e) ? e : e(t);
|
|
73
|
+
}
|
|
74
|
+
function O(e) {
|
|
75
|
+
let t = e.valueType || "text";
|
|
76
|
+
return e.valueEnum && (t = "status"), t;
|
|
77
|
+
}
|
|
78
|
+
function F(e, t) {
|
|
79
|
+
const n = b(e.fieldProps, t), o = (n == null ? void 0 : n.field) || n || {}, u = e.valueType === "switch", r = e.valueType === "index", i = u ? { checked: t.value } : { value: r ? t.index + 1 : t.value };
|
|
80
|
+
return e.valueEnum && (o.valueEnum = e.valueEnum), {
|
|
81
|
+
...d(o, ["request"]),
|
|
82
|
+
...i
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function v(e) {
|
|
86
|
+
const t = { ...e };
|
|
87
|
+
return p(e.filters) && e.filters && e.valueEnum && (t.filters = a(e.valueEnum)), t;
|
|
88
|
+
}
|
|
89
|
+
function w(e, t) {
|
|
90
|
+
var o;
|
|
91
|
+
const n = t || {};
|
|
92
|
+
return e.valueEnum && !((o = n.field) != null && o.options) && (n.field = {
|
|
93
|
+
...n.field,
|
|
94
|
+
options: a(e.valueEnum)
|
|
95
|
+
}), n;
|
|
96
|
+
}
|
|
57
97
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
b as
|
|
98
|
+
v as apColumnToColumn,
|
|
99
|
+
y as dataIndexToStr,
|
|
100
|
+
m as formatParamsValueType,
|
|
101
|
+
E as getColumnOrder,
|
|
102
|
+
b as getFieldProps,
|
|
103
|
+
j as getPlaceholder,
|
|
104
|
+
F as getTableRenderProps,
|
|
105
|
+
O as getTableRenderType,
|
|
106
|
+
T as objectToMap,
|
|
107
|
+
h as parseFieldValue,
|
|
108
|
+
w as updateFormProps,
|
|
109
|
+
a as valueEnumToArray
|
|
63
110
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as T, computed as
|
|
2
|
-
import { Col as F, Form as
|
|
3
|
-
import { BaseButton as
|
|
4
|
-
import { BasicArrow as
|
|
5
|
-
import { useFormContext as
|
|
1
|
+
import { defineComponent as T, computed as s, openBlock as a, createBlock as l, unref as e, normalizeProps as z, mergeProps as m, withCtx as o, createElementVNode as V, normalizeStyle as A, createVNode as g, renderSlot as i, createTextVNode as p, toDisplayString as d, createCommentVNode as r, normalizeClass as $ } from "vue";
|
|
2
|
+
import { Col as F, Form as G } from "ant-design-vue";
|
|
3
|
+
import { BaseButton as f } from "../../base-button/index.mjs";
|
|
4
|
+
import { BasicArrow as R } from "../../basic/index.mjs";
|
|
5
|
+
import { useFormContext as j } from "../hooks/use-form-context.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
7
|
import "./style/form-action.css";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useGlobalConfig as P } from "../../config-provider/hooks/use-global-config.mjs";
|
|
9
|
+
import { useLocale as W } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as q } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
11
|
const X = /* @__PURE__ */ T({
|
|
11
12
|
name: "BasicFormAction",
|
|
12
13
|
__name: "form-action",
|
|
@@ -23,75 +24,76 @@ const X = /* @__PURE__ */ T({
|
|
|
23
24
|
hideAdvanceBtn: { type: Boolean }
|
|
24
25
|
},
|
|
25
26
|
emits: ["toggle-advanced"],
|
|
26
|
-
setup(h, { emit:
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
setup(h, { emit: C }) {
|
|
28
|
+
const u = h, b = C, O = P("uiMode"), k = s(() => O.value === "aplus" ? {} : {
|
|
29
|
+
color: "#34b77c"
|
|
30
|
+
}), { t: n } = W(), { em: c } = q("form-action"), { resetAction: w, submitAction: x } = j(), B = s(() => {
|
|
31
|
+
const { actionColOptions: t } = u;
|
|
29
32
|
return {
|
|
30
|
-
style: { textAlign: "right" },
|
|
31
|
-
|
|
32
|
-
...N,
|
|
33
|
-
...x
|
|
33
|
+
style: { textAlign: "right", flex: 1, maxWidth: "100%", minWidth: "25%" },
|
|
34
|
+
...t
|
|
34
35
|
};
|
|
35
|
-
}),
|
|
36
|
+
}), y = s(() => Object.assign(
|
|
36
37
|
{
|
|
37
38
|
text: n("ap.common.resetText")
|
|
38
39
|
},
|
|
39
|
-
|
|
40
|
-
)),
|
|
40
|
+
u.resetButtonOptions
|
|
41
|
+
)), v = s(() => Object.assign(
|
|
41
42
|
{
|
|
42
43
|
text: n("ap.common.queryText")
|
|
43
44
|
},
|
|
44
|
-
|
|
45
|
+
u.submitButtonOptions
|
|
45
46
|
));
|
|
46
47
|
function S() {
|
|
47
48
|
b("toggle-advanced");
|
|
48
49
|
}
|
|
49
|
-
return (t,
|
|
50
|
+
return (t, N) => t.showActionButtonGroup ? (a(), l(e(F), z(m({ key: 0 }, B.value)), {
|
|
50
51
|
default: o(() => [
|
|
51
52
|
V("div", {
|
|
52
|
-
style:
|
|
53
|
+
style: A([{ width: "100%" }, { textAlign: B.value.style.textAlign }])
|
|
53
54
|
}, [
|
|
54
|
-
|
|
55
|
+
g(e(G).Item, null, {
|
|
55
56
|
default: o(() => [
|
|
56
57
|
i(t.$slots, "resetBefore"),
|
|
57
|
-
t.showResetButton ? (a(),
|
|
58
|
+
t.showResetButton ? (a(), l(e(f), m({
|
|
58
59
|
key: 0,
|
|
59
60
|
type: "default",
|
|
60
61
|
class: e(c)("button", "space")
|
|
61
|
-
},
|
|
62
|
+
}, y.value, { onClick: e(w) }), {
|
|
62
63
|
default: o(() => [
|
|
63
|
-
|
|
64
|
+
p(d(y.value.text), 1)
|
|
64
65
|
]),
|
|
65
66
|
_: 1
|
|
66
|
-
}, 16, ["class", "onClick"])) :
|
|
67
|
+
}, 16, ["class", "onClick"])) : r("", !0),
|
|
67
68
|
i(t.$slots, "submitBefore"),
|
|
68
|
-
t.showSubmitButton ? (a(),
|
|
69
|
+
t.showSubmitButton ? (a(), l(e(f), m({
|
|
69
70
|
key: 1,
|
|
70
71
|
type: "primary",
|
|
71
72
|
class: e(c)("button", "space")
|
|
72
|
-
},
|
|
73
|
+
}, v.value, { onClick: e(x) }), {
|
|
73
74
|
default: o(() => [
|
|
74
|
-
|
|
75
|
+
p(d(v.value.text), 1)
|
|
75
76
|
]),
|
|
76
77
|
_: 1
|
|
77
|
-
}, 16, ["class", "onClick"])) :
|
|
78
|
+
}, 16, ["class", "onClick"])) : r("", !0),
|
|
78
79
|
i(t.$slots, "advanceBefore"),
|
|
79
|
-
t.showAdvancedButton && !t.hideAdvanceBtn ? (a(),
|
|
80
|
+
t.showAdvancedButton && !t.hideAdvanceBtn ? (a(), l(e(f), {
|
|
80
81
|
key: 2,
|
|
81
82
|
type: "link",
|
|
82
83
|
size: "small",
|
|
84
|
+
style: A(k.value),
|
|
83
85
|
onClick: S
|
|
84
86
|
}, {
|
|
85
87
|
default: o(() => [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class:
|
|
88
|
+
p(d(t.isAdvanced ? e(n)("ap.common.closeText") : e(n)("ap.common.expandText")) + " ", 1),
|
|
89
|
+
g(e(R), {
|
|
90
|
+
class: $(e(c)("item", "space")),
|
|
89
91
|
expand: !t.isAdvanced,
|
|
90
92
|
up: ""
|
|
91
93
|
}, null, 8, ["class", "expand"])
|
|
92
94
|
]),
|
|
93
95
|
_: 1
|
|
94
|
-
})) :
|
|
96
|
+
}, 8, ["style"])) : r("", !0),
|
|
95
97
|
i(t.$slots, "advanceAfter")
|
|
96
98
|
]),
|
|
97
99
|
_: 3
|
|
@@ -99,7 +101,7 @@ const X = /* @__PURE__ */ T({
|
|
|
99
101
|
], 4)
|
|
100
102
|
]),
|
|
101
103
|
_: 3
|
|
102
|
-
}, 16)) :
|
|
104
|
+
}, 16)) : r("", !0);
|
|
103
105
|
}
|
|
104
106
|
});
|
|
105
107
|
export {
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import { isNumber as
|
|
1
|
+
import { getCurrentInstance as N, computed as T, unref as d, watch as X, shallowReactive as g } from "vue";
|
|
2
|
+
import { isNumber as F, isObject as U, isBoolean as j, isFunction as k } from "lodash-unified";
|
|
3
3
|
import { useDebounceFn as D } from "@vueuse/core";
|
|
4
4
|
import { useBreakpoint as G, ScreenEnum as A } from "./use-break-point.mjs";
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
advanceState:
|
|
8
|
-
emit:
|
|
9
|
-
getProps:
|
|
10
|
-
getSchema:
|
|
11
|
-
formModel:
|
|
12
|
-
defaultValueRef:
|
|
5
|
+
const f = 24, l = 18;
|
|
6
|
+
function J({
|
|
7
|
+
advanceState: s,
|
|
8
|
+
emit: B,
|
|
9
|
+
getProps: o,
|
|
10
|
+
getSchema: h,
|
|
11
|
+
formModel: v,
|
|
12
|
+
defaultValueRef: b
|
|
13
13
|
}) {
|
|
14
|
-
const p =
|
|
15
|
-
if (!
|
|
14
|
+
const p = N(), { screenRef: y, realWidthRef: L } = G(), E = T(() => {
|
|
15
|
+
if (!s.isAdvanced)
|
|
16
16
|
return 0;
|
|
17
|
-
const n = d(
|
|
18
|
-
if (
|
|
17
|
+
const n = d(o).emptySpan || 0;
|
|
18
|
+
if (F(n))
|
|
19
19
|
return n;
|
|
20
|
-
if (
|
|
21
|
-
const { span:
|
|
22
|
-
return n[
|
|
20
|
+
if (U(n)) {
|
|
21
|
+
const { span: e = 0 } = n, t = d(y);
|
|
22
|
+
return n[t.toLowerCase()] || e || 0;
|
|
23
23
|
}
|
|
24
24
|
return 0;
|
|
25
|
-
}),
|
|
26
|
-
|
|
25
|
+
}), R = D(W, 30);
|
|
26
|
+
X(
|
|
27
27
|
[
|
|
28
|
-
() => d(
|
|
29
|
-
() =>
|
|
30
|
-
() => d(
|
|
28
|
+
() => d(h),
|
|
29
|
+
() => s.isAdvanced,
|
|
30
|
+
() => d(L)
|
|
31
31
|
],
|
|
32
32
|
() => {
|
|
33
|
-
const { showAdvancedButton: n } = d(
|
|
34
|
-
n &&
|
|
33
|
+
const { showAdvancedButton: n } = d(o);
|
|
34
|
+
n && R();
|
|
35
35
|
},
|
|
36
36
|
{ immediate: !0 }
|
|
37
37
|
);
|
|
38
|
-
function I(n,
|
|
39
|
-
const c = d(
|
|
40
|
-
return c <= A.LG ?
|
|
38
|
+
function I(n, e = 0, t = !1) {
|
|
39
|
+
const c = d(L), i = parseInt(n.md) || parseInt(n.xs) || parseInt(n.sm) || n.span || f, r = parseInt(n.lg) || i, a = parseInt(n.xl) || r, u = parseInt(n.xxl) || a;
|
|
40
|
+
return c <= A.LG ? e += i : c < A.XL ? e += r : c < A.XXL ? e += a : e += u, t ? (s.hideAdvanceBtn = !1, e <= f + l ? (s.hideAdvanceBtn = !0, s.isAdvanced = !0) : e > f + l && e <= f * (d(o).autoAdvancedLine || 3) ? s.hideAdvanceBtn = !1 : s.isLoad || (s.isLoad = !0, s.isAdvanced = !0), { isAdvanced: s.isAdvanced, itemColSum: e }) : e > l * (d(o).alwaysShowLines || 1) ? { isAdvanced: s.isAdvanced, itemColSum: e } : { isAdvanced: !0, itemColSum: e };
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
function
|
|
42
|
+
const w = g({});
|
|
43
|
+
function W() {
|
|
44
44
|
var c;
|
|
45
|
-
let n = 0,
|
|
46
|
-
const { baseColProps:
|
|
47
|
-
for (const i of d(
|
|
45
|
+
let n = 0, e = 0;
|
|
46
|
+
const { baseColProps: t = {} } = d(o);
|
|
47
|
+
for (const i of d(h)) {
|
|
48
48
|
const { show: r, colProps: a } = i;
|
|
49
49
|
let u = !0;
|
|
50
50
|
if (j(r) && (u = r), k(r) && (u = r({
|
|
51
51
|
schema: i,
|
|
52
|
-
model:
|
|
52
|
+
model: v,
|
|
53
53
|
field: i.field,
|
|
54
54
|
values: {
|
|
55
|
-
...d(
|
|
56
|
-
...
|
|
55
|
+
...d(b),
|
|
56
|
+
...v
|
|
57
57
|
}
|
|
58
|
-
})), u && (a ||
|
|
59
|
-
const { itemColSum:
|
|
60
|
-
{ ...
|
|
58
|
+
})), u && (a || t)) {
|
|
59
|
+
const { itemColSum: _, isAdvanced: x } = I(
|
|
60
|
+
{ ...t, ...a },
|
|
61
61
|
n
|
|
62
62
|
);
|
|
63
|
-
n =
|
|
63
|
+
n = _ || 0, x && (e = n), w[i.field] = x;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
(c = p == null ? void 0 : p.proxy) == null || c.$forceUpdate(),
|
|
67
|
-
d(
|
|
66
|
+
(c = p == null ? void 0 : p.proxy) == null || c.$forceUpdate(), s.actionSpan = e % f + d(E), I(
|
|
67
|
+
d(o).actionColOptions || { span: f },
|
|
68
68
|
n,
|
|
69
69
|
!0
|
|
70
|
-
),
|
|
70
|
+
), B("advanced-change");
|
|
71
71
|
}
|
|
72
72
|
function O() {
|
|
73
|
-
|
|
73
|
+
s.isAdvanced = !s.isAdvanced;
|
|
74
74
|
}
|
|
75
|
-
return { handleToggleAdvanced: O, fieldsIsAdvancedMap:
|
|
75
|
+
return { handleToggleAdvanced: O, fieldsIsAdvancedMap: w };
|
|
76
76
|
}
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
J as default
|
|
79
79
|
};
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
border-radius: 2px;
|
|
17
17
|
background-color: #fff;
|
|
18
18
|
}
|
|
19
|
+
.aplus-pro-table-form-container .ant-form .ant-form-item {
|
|
20
|
+
margin-bottom: 16px;
|
|
21
|
+
}
|
|
19
22
|
.aplus-pro-table-form-container-no-divide .ant-form {
|
|
20
23
|
border-bottom-left-radius: 0 !important;
|
|
21
24
|
border-bottom-right-radius: 0 !important;
|