@aplus-frontend/ui 0.0.1 → 0.0.3
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-field/date/index.vue.d.ts +63 -5
- package/es/src/ap-field/date/index.vue.mjs +115 -46
- package/es/src/ap-field/date-range/index.vue.d.ts +68 -6
- package/es/src/ap-field/date-range/index.vue.mjs +135 -62
- package/es/src/ap-field/interface.d.ts +3 -7
- package/es/src/ap-field/select/index.vue.d.ts +45 -179
- package/es/src/ap-field/select/index.vue.mjs +137 -66
- package/es/src/ap-form/items/date/index.vue.mjs +27 -29
- package/es/src/ap-form/items/date-range/index.vue.d.ts +1 -1
- package/es/src/ap-form/items/date-range/index.vue.mjs +27 -29
- package/es/src/ap-form/items/interface.d.ts +1 -1
- package/es/src/ap-form/items/select/index.vue.mjs +32 -32
- package/es/src/ap-table/ap-table.vue.d.ts +7 -7
- package/es/src/ap-table/ap-table.vue.mjs +141 -117
- package/es/src/ap-table/constants.d.ts +3092 -1827
- package/es/src/ap-table/hooks/use-table-paging.mjs +23 -23
- package/es/src/ap-table/interface.d.ts +21 -13
- package/es/src/ap-table/utils.d.ts +47 -0
- package/es/src/ap-table/utils.mjs +68 -20
- 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/button.css +0 -11
- package/es/src/theme/antd-global-overwrite/admin/index.css +35 -31
- package/es/src/theme/antd-global-overwrite/admin/table.css +35 -20
- package/es/src/theme/antd-global-overwrite/aplus/button.css +0 -11
- package/es/src/theme/antd-global-overwrite/aplus/index.css +35 -31
- 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/es/src/utils/index.d.ts +8 -0
- package/es/src/utils/index.mjs +40 -32
- package/es/src/work-order-modal/work-order-modal.vue.mjs +6 -8
- package/lib/src/ap-field/date/index.vue.d.ts +63 -5
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.d.ts +68 -6
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +3 -7
- package/lib/src/ap-field/select/index.vue.d.ts +45 -179
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/interface.d.ts +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +7 -7
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +3092 -1827
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +21 -13
- package/lib/src/ap-table/utils.d.ts +47 -0
- 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/button.css +0 -11
- package/lib/src/theme/antd-global-overwrite/admin/index.css +35 -31
- package/lib/src/theme/antd-global-overwrite/admin/table.css +35 -20
- package/lib/src/theme/antd-global-overwrite/aplus/button.css +0 -11
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +35 -31
- 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/lib/src/utils/index.d.ts +8 -0
- package/lib/src/utils/index.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +3 -3
|
@@ -17,11 +17,11 @@ const ae = ({
|
|
|
17
17
|
sortFields: E = []
|
|
18
18
|
}) => {
|
|
19
19
|
let F = 0, f = {};
|
|
20
|
-
const L = (e) => T ? T(e) : e,
|
|
20
|
+
const L = (e) => T ? T(e) : e, i = v(), l = v(y), g = v(S), { t: V } = Y(), n = v({
|
|
21
21
|
total: 0,
|
|
22
22
|
records: A,
|
|
23
23
|
loading: !1
|
|
24
|
-
}),
|
|
24
|
+
}), b = async (e) => {
|
|
25
25
|
var o;
|
|
26
26
|
const a = L(e), t = Date.now();
|
|
27
27
|
F = t, n.value.loading = !0;
|
|
@@ -36,7 +36,7 @@ const ae = ({
|
|
|
36
36
|
} finally {
|
|
37
37
|
n.value.loading = !1;
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, w = (e) => {
|
|
40
40
|
const a = {};
|
|
41
41
|
return Object.entries(e).forEach(([t, o]) => {
|
|
42
42
|
if (a[t] = o, z && o) {
|
|
@@ -45,30 +45,30 @@ const ae = ({
|
|
|
45
45
|
}
|
|
46
46
|
}), a;
|
|
47
47
|
}, M = (e) => {
|
|
48
|
-
var o, s, d, p, m, u,
|
|
49
|
-
const a = ((s = (o =
|
|
48
|
+
var o, s, d, p, m, u, c;
|
|
49
|
+
const a = ((s = (o = i.value) == null ? void 0 : o.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
|
|
50
50
|
Object.entries(a).forEach(([$, K]) => {
|
|
51
51
|
P && P.indexOf($) > -1 && (t[$] = K);
|
|
52
|
-
}), (p = (d =
|
|
52
|
+
}), (p = (d = i.value) == null ? void 0 : d.apForm) == null || p.resetFields(), (c = (u = (m = i.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || c.call(u, t), e == null || e();
|
|
53
53
|
}, h = (e) => {
|
|
54
54
|
f = e;
|
|
55
|
-
const a =
|
|
56
|
-
|
|
55
|
+
const a = w(e);
|
|
56
|
+
b(a);
|
|
57
57
|
}, q = (e) => {
|
|
58
58
|
h({
|
|
59
59
|
...f,
|
|
60
60
|
...e
|
|
61
61
|
});
|
|
62
|
-
},
|
|
62
|
+
}, C = () => {
|
|
63
63
|
var a, t;
|
|
64
|
-
const e = ((t = (a =
|
|
64
|
+
const e = ((t = (a = i.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
65
65
|
h({
|
|
66
66
|
...e,
|
|
67
|
-
|
|
67
|
+
current: 1,
|
|
68
68
|
pageSize: f.pageSize || S
|
|
69
69
|
});
|
|
70
70
|
}, J = () => {
|
|
71
|
-
M(
|
|
71
|
+
M(C);
|
|
72
72
|
}, Q = () => {
|
|
73
73
|
h(f);
|
|
74
74
|
}, G = (e) => {
|
|
@@ -78,14 +78,14 @@ const ae = ({
|
|
|
78
78
|
});
|
|
79
79
|
}, O = (e, a, t) => {
|
|
80
80
|
var m, u;
|
|
81
|
-
const o = ((u = (m =
|
|
81
|
+
const o = ((u = (m = i.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
|
|
82
82
|
l.value = e.current, g.value = e.pageSize;
|
|
83
83
|
const s = X(t) ? [...t] : [t], d = {};
|
|
84
|
-
for (const
|
|
85
|
-
E.includes(
|
|
84
|
+
for (const c of s)
|
|
85
|
+
E.includes(c.field) && (d[W(c.field)] = c.order);
|
|
86
86
|
const p = {};
|
|
87
|
-
for (const
|
|
88
|
-
B.includes(
|
|
87
|
+
for (const c of Object.keys(a))
|
|
88
|
+
B.includes(c) && (p[c] = a[c]);
|
|
89
89
|
h({
|
|
90
90
|
...o,
|
|
91
91
|
filter: p,
|
|
@@ -96,14 +96,14 @@ const ae = ({
|
|
|
96
96
|
};
|
|
97
97
|
N(() => {
|
|
98
98
|
var a, t;
|
|
99
|
-
const e = ((t = (a =
|
|
99
|
+
const e = ((t = (a = i.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
100
100
|
if (f = {
|
|
101
101
|
current: r(l),
|
|
102
102
|
pageSize: r(g),
|
|
103
103
|
...e
|
|
104
104
|
}, !x) {
|
|
105
|
-
const o =
|
|
106
|
-
|
|
105
|
+
const o = w(f);
|
|
106
|
+
b(o);
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
const H = j(() => r(n).total === 0 ? "-" : `${r(l.value)}/${Math.ceil(
|
|
@@ -116,7 +116,7 @@ const ae = ({
|
|
|
116
116
|
total: r(n).total,
|
|
117
117
|
showSizeChanger: !0,
|
|
118
118
|
showQuickJumper: !0,
|
|
119
|
-
showTotal: (e) => `${
|
|
119
|
+
showTotal: (e) => `${V("ap.apTable.pagination.totalLeft", { total: e })} ${V(
|
|
120
120
|
"ap.apTable.pagination.totalRight",
|
|
121
121
|
{ page: r(H) }
|
|
122
122
|
)}`
|
|
@@ -125,8 +125,8 @@ const ae = ({
|
|
|
125
125
|
dataSource: r(n).records
|
|
126
126
|
}));
|
|
127
127
|
return {
|
|
128
|
-
formRef:
|
|
129
|
-
submit:
|
|
128
|
+
formRef: i,
|
|
129
|
+
submit: C,
|
|
130
130
|
reset: J,
|
|
131
131
|
refresh: Q,
|
|
132
132
|
refreshByDelete: G,
|
|
@@ -7,7 +7,7 @@ import { CSSProperties } from 'vue';
|
|
|
7
7
|
import { ApActionGroupProps } from '../ap-action';
|
|
8
8
|
import { ApTableIndexProps } from './components/interface';
|
|
9
9
|
|
|
10
|
-
type
|
|
10
|
+
export type ValueEnumType = {
|
|
11
11
|
text: string;
|
|
12
12
|
status?: string;
|
|
13
13
|
color?: string;
|
|
@@ -44,7 +44,7 @@ export type ApTableValueFields = {
|
|
|
44
44
|
*/
|
|
45
45
|
index: ApTableIndexProps;
|
|
46
46
|
};
|
|
47
|
-
export type ValueEnum = Record<string,
|
|
47
|
+
export type ValueEnum = Record<string, ValueEnumType>;
|
|
48
48
|
export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children'> & {
|
|
49
49
|
sorter?: string | boolean | CompareFn<T> | {
|
|
50
50
|
compare?: CompareFn<T>;
|
|
@@ -52,8 +52,8 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children'> & {
|
|
|
52
52
|
multiple?: number;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> = ExtraProColumnType<any> & {
|
|
56
|
-
children?: ApColumnType[];
|
|
55
|
+
export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = ExtraProColumnType<any> & {
|
|
56
|
+
children?: ApColumnType<any, RecordType>[];
|
|
57
57
|
/**
|
|
58
58
|
* 表单项所占据的格子数(1-24格)
|
|
59
59
|
*/
|
|
@@ -75,8 +75,7 @@ export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> =
|
|
|
75
75
|
*/
|
|
76
76
|
hideInTable?: boolean;
|
|
77
77
|
/**
|
|
78
|
-
* 值的枚举,会自动转化把值当成 key 来取出要显示的内容(也会作为select
|
|
79
|
-
* @deprecated 未实现请使用`fieldProps.options`
|
|
78
|
+
* 值的枚举,会自动转化把值当成 key 来取出要显示的内容(也会作为select等组件的选项)
|
|
80
79
|
*/
|
|
81
80
|
valueEnum?: ValueEnum;
|
|
82
81
|
/**
|
|
@@ -90,7 +89,19 @@ export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> =
|
|
|
90
89
|
/**
|
|
91
90
|
* 值类型额外配置的参数(用于查询表单渲染)
|
|
92
91
|
*/
|
|
93
|
-
fieldProps?: ApTableValueFields[ValueType]
|
|
92
|
+
fieldProps?: ApTableValueFields[ValueType] | ((opt?: {
|
|
93
|
+
value: any;
|
|
94
|
+
text: any;
|
|
95
|
+
record: RecordType;
|
|
96
|
+
index: number;
|
|
97
|
+
renderIndex: number;
|
|
98
|
+
column: ApColumnType<ValueType, RecordType>;
|
|
99
|
+
}) => ApTableValueFields[ValueType]);
|
|
100
|
+
/**
|
|
101
|
+
* 用于表单项排序的字段
|
|
102
|
+
* @description 值越大,越排在前面,请设置正整数,设置为0或负数将会无效
|
|
103
|
+
*/
|
|
104
|
+
order?: number;
|
|
94
105
|
};
|
|
95
106
|
export type RequestData<T> = {
|
|
96
107
|
data: T[] | undefined;
|
|
@@ -100,7 +111,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
100
111
|
/**
|
|
101
112
|
* 列配置
|
|
102
113
|
*/
|
|
103
|
-
columns?: ApColumnType<any>[];
|
|
114
|
+
columns?: ApColumnType<any, RecordType>[];
|
|
104
115
|
/**
|
|
105
116
|
* 是否启用卡片样式
|
|
106
117
|
*/
|
|
@@ -111,9 +122,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
111
122
|
params?: ParamsType;
|
|
112
123
|
/**
|
|
113
124
|
* 自定义渲染搜索表单
|
|
114
|
-
* @
|
|
115
|
-
* @param defaultDom
|
|
116
|
-
* @returns
|
|
125
|
+
* @deprecated 未实现 暂不可用
|
|
117
126
|
*/
|
|
118
127
|
searchFormRender?: (props: ApTableProps<RecordType, ParamsType, ValueType>, defaultDom: any) => any;
|
|
119
128
|
/**
|
|
@@ -129,7 +138,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
129
138
|
}) => Promise<Partial<RequestData<RecordType>>>;
|
|
130
139
|
/**
|
|
131
140
|
* 数据加载完成后触发
|
|
132
|
-
* @
|
|
141
|
+
* @deprecated 已弃用,请自行实现类似效果
|
|
133
142
|
* @returns
|
|
134
143
|
*/
|
|
135
144
|
onLoad?: (data: RecordType[]) => void;
|
|
@@ -181,4 +190,3 @@ export type ApTableExpose = {
|
|
|
181
190
|
submit: () => void;
|
|
182
191
|
reset: () => void;
|
|
183
192
|
};
|
|
184
|
-
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ApColumnType, ApTableValueFields, ValueEnum, ValueEnumType } from './interface';
|
|
2
|
+
import { Translator } from '../config-provider';
|
|
3
|
+
|
|
1
4
|
export type FieldValueType = 'multiple' | 'multipleNumber' | 'dayjs' | 'dayjsRange' | 'dayjsDayRange' | 'number' | 'boolean' | 'object';
|
|
2
5
|
export declare const formatParamsValueType: (type: FieldValueType | Record<string, FieldValueType>, value: any, cb: (t: FieldValueType, value: any) => any) => any;
|
|
3
6
|
/**
|
|
@@ -12,3 +15,47 @@ export declare const parseFieldValue: (t: FieldValueType, value: any) => any;
|
|
|
12
15
|
* @returns
|
|
13
16
|
*/
|
|
14
17
|
export declare function dataIndexToStr(dataIndex: string | number | (string | number)[]): string | number;
|
|
18
|
+
type OptionType = {
|
|
19
|
+
label?: string;
|
|
20
|
+
text?: string;
|
|
21
|
+
value?: any;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
25
|
+
type ValueEnumMap = Map<string | number | boolean, ValueEnumType>;
|
|
26
|
+
export declare const objectToMap: (value: ValueEnum | undefined) => ValueEnumMap;
|
|
27
|
+
/**
|
|
28
|
+
* valueEnum转options array
|
|
29
|
+
* @param valueEnumParams
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
export declare const valueEnumToArray: (valueEnumParams: ValueEnum) => OptionType;
|
|
33
|
+
/**
|
|
34
|
+
* 获取列在查询表单中的排序
|
|
35
|
+
* @param order
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
export declare const getColumnOrder: (order?: number) => number;
|
|
39
|
+
/**
|
|
40
|
+
* 获取查询表单的placeholder
|
|
41
|
+
* @param t
|
|
42
|
+
* @param valueType
|
|
43
|
+
* @param placeholder
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
export declare const getPlaceholder: (t: Translator, valueType?: keyof ApTableValueFields, placeholder?: string) => string | string[] | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* 获取对象形式的FieldProps
|
|
49
|
+
* @param fieldProps
|
|
50
|
+
* @param record
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
export declare function getFieldProps<RecordType = any>(fieldProps: ApColumnType<any, any>['fieldProps'], opt?: {
|
|
54
|
+
value: any;
|
|
55
|
+
text: any;
|
|
56
|
+
record: any;
|
|
57
|
+
index: number;
|
|
58
|
+
renderIndex: number;
|
|
59
|
+
column: ApColumnType<any, RecordType>;
|
|
60
|
+
}): any;
|
|
61
|
+
export {};
|
|
@@ -1,35 +1,83 @@
|
|
|
1
|
-
import { isObject as
|
|
2
|
-
const f = (
|
|
3
|
-
let
|
|
4
|
-
return t
|
|
5
|
-
t
|
|
6
|
-
}) :
|
|
7
|
-
},
|
|
8
|
-
switch (
|
|
1
|
+
import { isObject as c, isArray as u, isUndefined as i, isFunction as a } from "lodash-unified";
|
|
2
|
+
const f = (t, e, n) => {
|
|
3
|
+
let s = {};
|
|
4
|
+
return c(t) ? Object.keys(t).forEach((o) => {
|
|
5
|
+
c(t[o]) ? s[o] = f(t[o], e[o], n) : s[o] = n(t[o], e);
|
|
6
|
+
}) : s = n(t, e), s;
|
|
7
|
+
}, p = (t, e) => {
|
|
8
|
+
switch (t) {
|
|
9
9
|
case "dayjs":
|
|
10
|
-
return
|
|
10
|
+
return e.valueOf();
|
|
11
11
|
case "dayjsRange":
|
|
12
|
-
return
|
|
12
|
+
return e.map((n) => n.valueOf());
|
|
13
13
|
case "dayjsDayRange": {
|
|
14
|
-
const [
|
|
15
|
-
return [
|
|
14
|
+
const [n, s] = e;
|
|
15
|
+
return [n.startOf("day").valueOf(), s.endOf("day").valueOf()];
|
|
16
16
|
}
|
|
17
17
|
case "multiple":
|
|
18
18
|
case "multipleNumber":
|
|
19
|
-
return
|
|
19
|
+
return u(e) ? e : [e];
|
|
20
20
|
case "boolean":
|
|
21
|
-
return
|
|
21
|
+
return e;
|
|
22
22
|
case "object":
|
|
23
|
-
return
|
|
23
|
+
return e;
|
|
24
24
|
default:
|
|
25
|
-
return
|
|
25
|
+
return e;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function b(t) {
|
|
29
|
+
return u(t) ? t.join(".") : t;
|
|
30
|
+
}
|
|
31
|
+
function d(t) {
|
|
32
|
+
const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
|
|
33
|
+
return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
|
|
34
|
+
}
|
|
35
|
+
const l = (t) => d(t) === "map" ? t : new Map(Object.entries(t || {})), g = (t) => {
|
|
36
|
+
const e = [], n = l(t);
|
|
37
|
+
return n.forEach((s, o) => {
|
|
38
|
+
const r = n.get(o) || n.get(`${o}`);
|
|
39
|
+
if (r) {
|
|
40
|
+
if (typeof r == "object" && (r != null && r.text)) {
|
|
41
|
+
e.push({
|
|
42
|
+
text: r == null ? void 0 : r.text,
|
|
43
|
+
value: o,
|
|
44
|
+
label: r == null ? void 0 : r.text,
|
|
45
|
+
disabled: r.disabled
|
|
46
|
+
});
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
e.push({
|
|
50
|
+
text: r,
|
|
51
|
+
label: r,
|
|
52
|
+
value: o
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}), e;
|
|
56
|
+
}, j = (t) => i(t) || t < 0 ? 0 : t, x = (t, e, n) => {
|
|
57
|
+
if (n)
|
|
58
|
+
return n;
|
|
59
|
+
const s = ["select", "date"], o = [
|
|
60
|
+
"text",
|
|
61
|
+
"textArea",
|
|
62
|
+
"number"
|
|
63
|
+
];
|
|
64
|
+
if (e === "dateRange")
|
|
65
|
+
return [t("ap.common.chooseText"), t("ap.common.chooseText")];
|
|
66
|
+
if (s.includes(e))
|
|
67
|
+
return t("ap.common.chooseText");
|
|
68
|
+
if (o.includes(e))
|
|
69
|
+
return t("ap.common.inputText");
|
|
70
|
+
};
|
|
71
|
+
function O(t, e) {
|
|
72
|
+
return !t || !a(t) ? t : t(e);
|
|
30
73
|
}
|
|
31
74
|
export {
|
|
32
|
-
|
|
75
|
+
b as dataIndexToStr,
|
|
33
76
|
f as formatParamsValueType,
|
|
34
|
-
|
|
77
|
+
j as getColumnOrder,
|
|
78
|
+
O as getFieldProps,
|
|
79
|
+
x as getPlaceholder,
|
|
80
|
+
l as objectToMap,
|
|
81
|
+
p as parseFieldValue,
|
|
82
|
+
g as valueEnumToArray
|
|
35
83
|
};
|
|
@@ -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;
|