@aplus-frontend/ui 0.1.20 → 0.1.21
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-modal/interface.d.ts +3 -3
- package/es/src/ap-table/ap-table.vue.mjs +107 -107
- package/es/src/ap-table/constants.mjs +11 -9
- package/es/src/ap-table/hooks/use-table-paging.d.ts +12 -2
- package/es/src/ap-table/hooks/use-table-paging.mjs +115 -103
- package/es/src/ap-table/interface.d.ts +13 -4
- package/es/src/ap-table/style/ap-table.css +9 -0
- package/es/src/ap-table/utils.d.ts +4 -4
- package/es/src/ap-table/utils.mjs +44 -39
- package/es/src/business/ap-image/ApImage.vue.d.ts +12 -64
- package/es/src/business/ap-image/ApImage.vue2.mjs +35 -31
- package/es/src/business/ap-image/interface.d.ts +17 -0
- package/es/src/business/index.d.ts +47 -48
- package/es/src/config-provider/config-provider.mjs +9 -9
- package/es/src/locale/lang/en.mjs +4 -2
- package/es/src/locale/lang/zh-cn.mjs +4 -2
- package/es/src/theme/ap-table/ap-table.css +9 -0
- package/es/src/theme/css-var/index.mjs +23 -7
- package/lib/src/ap-modal/interface.d.ts +3 -3
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +12 -2
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +13 -4
- package/lib/src/ap-table/style/ap-table.css +9 -0
- package/lib/src/ap-table/utils.d.ts +4 -4
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-image/ApImage.vue.d.ts +12 -64
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-image/interface.d.ts +17 -0
- package/lib/src/business/index.d.ts +47 -48
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-table/ap-table.css +9 -0
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +3 -3
|
@@ -1,145 +1,157 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { parseFieldValue as
|
|
3
|
-
import { isArray as
|
|
1
|
+
import { ref as x, nextTick as Z, unref as o, onMounted as _, computed as V, createVNode as P } from "vue";
|
|
2
|
+
import { parseFieldValue as I, dataIndexToStr as k } from "../utils.mjs";
|
|
3
|
+
import { isArray as ee } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { useLocale as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
import { useLocale as te } from "../../config-provider/hooks/use-locale.mjs";
|
|
6
|
+
import { useNamespace as ae } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
const le = ({
|
|
8
|
+
manual: B = !1,
|
|
9
|
+
defaultCurrent: E = 1,
|
|
10
|
+
defaultPageSize: w = 10,
|
|
11
|
+
request: M,
|
|
12
|
+
defaultParams: N = {},
|
|
13
|
+
defaultData: $ = [],
|
|
14
|
+
formatParams: C,
|
|
15
|
+
paramsValueTypeMap: y,
|
|
16
|
+
resetFieldsIgnores: O,
|
|
17
|
+
filterFields: q,
|
|
18
|
+
sortFields: J,
|
|
19
|
+
showLessItems: b = !1,
|
|
20
|
+
showTotal: L = !0
|
|
18
21
|
}) => {
|
|
19
|
-
let
|
|
20
|
-
const
|
|
22
|
+
let z = 0, p = {};
|
|
23
|
+
const Q = (e) => C ? C(e) : e, l = x(), c = x(E), f = x(w), {
|
|
24
|
+
t: S
|
|
25
|
+
} = te(), {
|
|
26
|
+
b: F
|
|
27
|
+
} = ae("ap-table"), r = x({
|
|
21
28
|
total: 0,
|
|
22
|
-
records:
|
|
29
|
+
records: $,
|
|
23
30
|
loading: !1
|
|
24
|
-
}),
|
|
25
|
-
var
|
|
26
|
-
const a =
|
|
27
|
-
|
|
31
|
+
}), R = async (e) => {
|
|
32
|
+
var n;
|
|
33
|
+
const a = Q(e), t = Date.now();
|
|
34
|
+
z = t, r.value.loading = !0;
|
|
28
35
|
try {
|
|
29
|
-
const s = await
|
|
30
|
-
...
|
|
36
|
+
const s = await M({
|
|
37
|
+
...N,
|
|
31
38
|
...a
|
|
32
39
|
});
|
|
33
|
-
|
|
40
|
+
z === t && (r.value.total = s.total || ((n = s.data) == null ? void 0 : n.length) || 0, r.value.records = [...s.data || []]);
|
|
34
41
|
} catch {
|
|
35
|
-
|
|
42
|
+
z === t && (r.value.records = [], r.value.total = 0);
|
|
36
43
|
} finally {
|
|
37
|
-
|
|
44
|
+
r.value.loading = !1;
|
|
38
45
|
}
|
|
39
|
-
},
|
|
46
|
+
}, j = (e) => {
|
|
40
47
|
const a = {};
|
|
41
|
-
return Object.entries(e).forEach(([t,
|
|
42
|
-
if (a[t] =
|
|
43
|
-
const s =
|
|
44
|
-
s && (a[t] =
|
|
48
|
+
return Object.entries(e).forEach(([t, n]) => {
|
|
49
|
+
if (a[t] = n, y && n) {
|
|
50
|
+
const s = y[t];
|
|
51
|
+
s && (a[t] = I(s, n));
|
|
45
52
|
}
|
|
46
53
|
}), a;
|
|
47
|
-
},
|
|
48
|
-
var
|
|
49
|
-
const a = ((s = (
|
|
50
|
-
Object.entries(a).forEach(([v,
|
|
51
|
-
|
|
52
|
-
}), await ((
|
|
54
|
+
}, G = async (e) => {
|
|
55
|
+
var n, s, g, d, m, u, h;
|
|
56
|
+
const a = ((s = (n = l.value) == null ? void 0 : n.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
|
|
57
|
+
Object.entries(a).forEach(([v, i]) => {
|
|
58
|
+
O && O.indexOf(v) > -1 && (t[v] = i);
|
|
59
|
+
}), await ((d = (g = l.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || h.call(u, t), Z(() => {
|
|
53
60
|
e == null || e();
|
|
54
61
|
});
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
const a =
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
...
|
|
62
|
+
}, T = (e) => {
|
|
63
|
+
p = e;
|
|
64
|
+
const a = j(e);
|
|
65
|
+
R(a);
|
|
66
|
+
}, H = (e) => {
|
|
67
|
+
T({
|
|
68
|
+
...p,
|
|
62
69
|
...e
|
|
63
70
|
});
|
|
64
|
-
},
|
|
71
|
+
}, D = () => {
|
|
65
72
|
var a, t;
|
|
66
73
|
const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
67
|
-
|
|
74
|
+
c.value = 1, T({
|
|
68
75
|
...e,
|
|
69
76
|
current: 1,
|
|
70
|
-
pageSize:
|
|
77
|
+
pageSize: p.pageSize || w
|
|
71
78
|
});
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
const a = o(
|
|
78
|
-
|
|
79
|
-
current:
|
|
79
|
+
}, K = () => {
|
|
80
|
+
G(D);
|
|
81
|
+
}, U = () => {
|
|
82
|
+
T(p);
|
|
83
|
+
}, W = (e) => {
|
|
84
|
+
const a = o(r).total - e, t = Math.ceil(a / o(f)), n = o(c) > t ? t : o(c);
|
|
85
|
+
H({
|
|
86
|
+
current: n > 0 ? n : 1
|
|
80
87
|
});
|
|
81
|
-
},
|
|
88
|
+
}, A = (e, a, t) => {
|
|
82
89
|
var m, u, h, v;
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
const s =
|
|
86
|
-
for (const
|
|
87
|
-
(h = o(
|
|
88
|
-
const
|
|
89
|
-
for (const
|
|
90
|
-
(v = o(
|
|
91
|
-
|
|
92
|
-
...
|
|
93
|
-
filter:
|
|
94
|
-
sort:
|
|
90
|
+
const n = ((u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
|
|
91
|
+
c.value = e.current, f.value = e.pageSize;
|
|
92
|
+
const s = ee(t) ? [...t] : [t], g = {};
|
|
93
|
+
for (const i of s)
|
|
94
|
+
(h = o(J)) != null && h.includes(i.field) && (g[k(i.field)] = i.order);
|
|
95
|
+
const d = {};
|
|
96
|
+
for (const i of Object.keys(a))
|
|
97
|
+
(v = o(q)) != null && v.includes(i) && (d[i] = a[i]);
|
|
98
|
+
T({
|
|
99
|
+
...n,
|
|
100
|
+
filter: d,
|
|
101
|
+
sort: g,
|
|
95
102
|
current: e.current,
|
|
96
103
|
pageSize: e.pageSize
|
|
97
104
|
});
|
|
98
105
|
};
|
|
99
|
-
|
|
106
|
+
_(() => {
|
|
100
107
|
var a, t;
|
|
101
108
|
const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
102
|
-
if (
|
|
103
|
-
current: o(
|
|
104
|
-
pageSize: o(
|
|
109
|
+
if (p = {
|
|
110
|
+
current: o(c),
|
|
111
|
+
pageSize: o(f),
|
|
105
112
|
...e
|
|
106
|
-
}, !
|
|
107
|
-
const
|
|
108
|
-
|
|
113
|
+
}, !B) {
|
|
114
|
+
const n = j(p);
|
|
115
|
+
R(n);
|
|
109
116
|
}
|
|
110
117
|
});
|
|
111
|
-
const
|
|
112
|
-
o(
|
|
113
|
-
)}`), K = z(() => ({
|
|
114
|
-
loading: o(n).loading,
|
|
118
|
+
const X = V(() => o(r).total === 0 ? "-" : `${o(c.value)}/${Math.ceil(o(r).total / o(f))}`), Y = V(() => ({
|
|
119
|
+
loading: o(r).loading,
|
|
115
120
|
pagination: {
|
|
116
|
-
current: o(
|
|
117
|
-
pageSize: o(
|
|
118
|
-
total: o(
|
|
119
|
-
showSizeChanger: !
|
|
120
|
-
showQuickJumper: !
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
current: o(c),
|
|
122
|
+
pageSize: o(f),
|
|
123
|
+
total: o(r).total,
|
|
124
|
+
showSizeChanger: !b,
|
|
125
|
+
showQuickJumper: !b,
|
|
126
|
+
showLessItems: b,
|
|
127
|
+
size: "default",
|
|
128
|
+
showTotal: L ? (e) => P("span", {
|
|
129
|
+
class: F("pagination-total-wrapper")
|
|
130
|
+
}, [S("ap.apTable.pagination.totalLeftPrefix"), " ", P("span", {
|
|
131
|
+
class: F("pagination-count-text")
|
|
132
|
+
}, [e]), " ", S("ap.apTable.pagination.totalLeftSuffix"), P("span", {
|
|
133
|
+
class: F("pagination--total-right")
|
|
134
|
+
}, [S("ap.apTable.pagination.totalRightPrefix"), " ", P("span", {
|
|
135
|
+
class: F("pagination-count-text")
|
|
136
|
+
}, [o(X)]), " ", S("ap.apTable.pagination.totalRightSuffix")])]) : void 0
|
|
125
137
|
},
|
|
126
|
-
onChange:
|
|
127
|
-
dataSource: o(
|
|
138
|
+
onChange: A,
|
|
139
|
+
dataSource: o(r).records
|
|
128
140
|
}));
|
|
129
141
|
return {
|
|
130
142
|
formRef: l,
|
|
131
|
-
submit:
|
|
132
|
-
reset:
|
|
133
|
-
refresh:
|
|
134
|
-
refreshByDelete:
|
|
135
|
-
data:
|
|
136
|
-
current:
|
|
137
|
-
pageSize:
|
|
138
|
-
handleTableChange:
|
|
139
|
-
tableProps:
|
|
140
|
-
dataSource:
|
|
143
|
+
submit: D,
|
|
144
|
+
reset: K,
|
|
145
|
+
refresh: U,
|
|
146
|
+
refreshByDelete: W,
|
|
147
|
+
data: r,
|
|
148
|
+
current: c,
|
|
149
|
+
pageSize: f,
|
|
150
|
+
handleTableChange: A,
|
|
151
|
+
tableProps: Y,
|
|
152
|
+
dataSource: V(() => o(r).records)
|
|
141
153
|
};
|
|
142
154
|
};
|
|
143
155
|
export {
|
|
144
|
-
|
|
156
|
+
le as useTablePaging
|
|
145
157
|
};
|
|
@@ -162,6 +162,18 @@ export type RequestData<T> = {
|
|
|
162
162
|
data: T[] | undefined;
|
|
163
163
|
total: number;
|
|
164
164
|
} & Record<string, any>;
|
|
165
|
+
export type ApTablePaginationConfig = {
|
|
166
|
+
defaultCurrent?: number;
|
|
167
|
+
defaultPageSize?: number;
|
|
168
|
+
/**
|
|
169
|
+
* 是否显示较少页面内容
|
|
170
|
+
*/
|
|
171
|
+
showLessItems?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* 用于显示数据总量和当前数据顺序
|
|
174
|
+
*/
|
|
175
|
+
showTotal?: boolean;
|
|
176
|
+
};
|
|
165
177
|
export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection'> & {
|
|
166
178
|
/**
|
|
167
179
|
* 列配置
|
|
@@ -230,10 +242,7 @@ export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<R
|
|
|
230
242
|
/**
|
|
231
243
|
* 是否显示分页器(特定的分页器)或者指定默认的当前页和pageSize
|
|
232
244
|
*/
|
|
233
|
-
pagination?: false |
|
|
234
|
-
defaultCurrent?: number;
|
|
235
|
-
defaultPageSize?: number;
|
|
236
|
-
};
|
|
245
|
+
pagination?: false | ApTablePaginationConfig;
|
|
237
246
|
/**
|
|
238
247
|
* 自定义查询表单容器样式
|
|
239
248
|
*/
|
|
@@ -86,3 +86,12 @@
|
|
|
86
86
|
.aplus-ap-table .ant-table-cell .ant-typography {
|
|
87
87
|
margin-bottom: 0;
|
|
88
88
|
}
|
|
89
|
+
.aplus-ap-table-pagination-count-text {
|
|
90
|
+
color: var(--ap-table-pagination-total-count-color, #182948);
|
|
91
|
+
}
|
|
92
|
+
.aplus-ap-table-pagination--total-right {
|
|
93
|
+
padding-left: 12px;
|
|
94
|
+
}
|
|
95
|
+
.aplus-ap-table-pagination-total-wrapper {
|
|
96
|
+
color: var(--ap-table-pagination-total-color, #526A90);
|
|
97
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ApColumnType, ApTableValueFields, ValueEnum, ValueEnumType } from './interface';
|
|
2
2
|
import { Translator, ValueTypeRenderConfig } from '../config-provider';
|
|
3
3
|
import { apTableRenderItemMap } from './constants';
|
|
4
|
-
import { VNode, CreateComponentPublicInstance, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase,
|
|
4
|
+
import { VNode, CreateComponentPublicInstance, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, VNodeArrayChildren } from 'vue';
|
|
5
5
|
import { ColSize } from 'ant-design-vue/es/grid';
|
|
6
6
|
import { ApFieldTextPasswordProps, ApFieldTextProps, ApFieldTextAreaProps, ApFieldNumberProps, ApFieldDateProps, ApFieldDateRangeProps, ApFieldRadioProps, ApFieldSelectProps, ApFieldSwitchProps, ApFieldCheckboxProps } from '..';
|
|
7
7
|
import { RuleObject } from 'ant-design-vue/es/form';
|
|
8
8
|
import { FormLabelAlign } from 'ant-design-vue/es/form/interface';
|
|
9
9
|
import { ApFormItemSlots, ApFormItemTextPassword } from '../ap-form';
|
|
10
10
|
import { InputFocusOptions } from 'ant-design-vue/es/vc-input/utils/commonUtils';
|
|
11
|
+
import { ColumnTitleProps } from 'ant-design-vue/es/table/interface';
|
|
12
|
+
import { VueNode } from 'ant-design-vue/es/_util/type';
|
|
11
13
|
export type FieldValueType = 'multiple' | 'multipleNumber' | 'dayjs' | 'dayjsRange' | 'dayjsDayRange' | 'number' | 'boolean' | 'object';
|
|
12
14
|
export declare const formatParamsValueType: (type: FieldValueType | Record<string, FieldValueType>, value: any, cb: (t: FieldValueType, value: any) => any) => any;
|
|
13
15
|
/**
|
|
@@ -8425,7 +8427,5 @@ export declare function objectToString(value: any): any;
|
|
|
8425
8427
|
export declare function getTableTitle(column: ApColumnType<any>, slot?: (props: {
|
|
8426
8428
|
title: any;
|
|
8427
8429
|
column: ApColumnType<any>;
|
|
8428
|
-
}) => any, tooltipColor?: string):
|
|
8429
|
-
[key: string]: any;
|
|
8430
|
-
}>[] | import("vue/jsx-runtime").JSX.Element | (() => import("vue/jsx-runtime").JSX.Element);
|
|
8430
|
+
}) => any, tooltipColor?: string): number | boolean | void | VNodeArrayChildren | import("vue/jsx-runtime").JSX.Element | ((props: ColumnTitleProps<any>) => VNodeArrayChildren | VueNode) | null;
|
|
8431
8431
|
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { isVNode as d, createVNode as
|
|
2
|
-
import { isObject as
|
|
1
|
+
import { isVNode as d, createVNode as u, mergeProps as a, cloneVNode as T, Fragment as b } from "vue";
|
|
2
|
+
import { isObject as l, isArray as f, isUndefined as y, isFunction as g, omit as h, isBoolean as j, isString as c } from "lodash-unified";
|
|
3
3
|
import { apTableRenderItemMap as F, apTableFormItemMap as O, ellipsisTitleStyle as E } from "./constants.mjs";
|
|
4
4
|
import { isType as S } from "@fruits-chain/utils";
|
|
5
5
|
import "../ap-form/index.mjs";
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { QuestionCircleOutlined as
|
|
8
|
-
import
|
|
9
|
-
function
|
|
6
|
+
import { Tooltip as x } from "ant-design-vue";
|
|
7
|
+
import { QuestionCircleOutlined as N } from "@ant-design/icons-vue";
|
|
8
|
+
import I from "../ap-form/ap-form-item.vue.mjs";
|
|
9
|
+
function v(t) {
|
|
10
10
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !d(t);
|
|
11
11
|
}
|
|
12
12
|
const C = (t, e, n) => {
|
|
13
13
|
let o = {};
|
|
14
|
-
return
|
|
15
|
-
|
|
14
|
+
return l(t) ? Object.keys(t).forEach((i) => {
|
|
15
|
+
l(t[i]) ? o[i] = C(t[i], e[i], n) : o[i] = n(t[i], e);
|
|
16
16
|
}) : o = n(t, e), o;
|
|
17
17
|
}, J = (t, e) => {
|
|
18
18
|
switch (t) {
|
|
@@ -26,7 +26,7 @@ const C = (t, e, n) => {
|
|
|
26
26
|
}
|
|
27
27
|
case "multiple":
|
|
28
28
|
case "multipleNumber":
|
|
29
|
-
return
|
|
29
|
+
return f(e) ? e : [e];
|
|
30
30
|
case "boolean":
|
|
31
31
|
return e;
|
|
32
32
|
case "object":
|
|
@@ -36,7 +36,7 @@ const C = (t, e, n) => {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
function L(t) {
|
|
39
|
-
return
|
|
39
|
+
return f(t) ? t.join(".") : t;
|
|
40
40
|
}
|
|
41
41
|
function P(t) {
|
|
42
42
|
const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
|
|
@@ -44,13 +44,13 @@ function P(t) {
|
|
|
44
44
|
}
|
|
45
45
|
const V = (t) => P(t) === "map" ? t : new Map(Object.entries(t || {})), p = (t) => {
|
|
46
46
|
const e = [], n = V(t);
|
|
47
|
-
return n.forEach((o,
|
|
48
|
-
const r = n.get(
|
|
47
|
+
return n.forEach((o, i) => {
|
|
48
|
+
const r = n.get(i) || n.get(`${i}`);
|
|
49
49
|
if (r) {
|
|
50
50
|
if (typeof r == "object" && (r != null && r.text)) {
|
|
51
51
|
e.push({
|
|
52
52
|
text: r == null ? void 0 : r.text,
|
|
53
|
-
value:
|
|
53
|
+
value: i,
|
|
54
54
|
label: r == null ? void 0 : r.text,
|
|
55
55
|
disabled: r.disabled
|
|
56
56
|
});
|
|
@@ -59,46 +59,46 @@ const V = (t) => P(t) === "map" ? t : new Map(Object.entries(t || {})), p = (t)
|
|
|
59
59
|
e.push({
|
|
60
60
|
text: r,
|
|
61
61
|
label: r,
|
|
62
|
-
value:
|
|
62
|
+
value: i
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}), e;
|
|
66
|
-
}, Q = (t) =>
|
|
66
|
+
}, Q = (t) => y(t) || t < 0 ? 0 : t, U = (t, e, n) => {
|
|
67
67
|
if (n)
|
|
68
68
|
return n;
|
|
69
|
-
const o = ["select", "date"],
|
|
69
|
+
const o = ["select", "date"], i = ["text", "textArea", "number"];
|
|
70
70
|
if (e === "dateRange")
|
|
71
71
|
return [t("ap.common.chooseText"), t("ap.common.chooseText")];
|
|
72
72
|
if (o.includes(e))
|
|
73
73
|
return t("ap.common.chooseText");
|
|
74
|
-
if (
|
|
74
|
+
if (i.includes(e))
|
|
75
75
|
return t("ap.common.inputText");
|
|
76
76
|
};
|
|
77
77
|
function w(t, e) {
|
|
78
|
-
return !t || !
|
|
78
|
+
return !t || !g(t) ? t : t(e);
|
|
79
79
|
}
|
|
80
80
|
function z(t) {
|
|
81
81
|
let e = t.valueType || "text";
|
|
82
82
|
return t.valueEnum && (e = "status"), e;
|
|
83
83
|
}
|
|
84
84
|
function G(t, e, n, o) {
|
|
85
|
-
var
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
return
|
|
85
|
+
var s;
|
|
86
|
+
const i = F[t];
|
|
87
|
+
if (i)
|
|
88
|
+
return u(i, a(e, {
|
|
89
89
|
mode: "read"
|
|
90
90
|
}), null);
|
|
91
91
|
const r = o == null ? void 0 : o[t];
|
|
92
|
-
return ((
|
|
92
|
+
return ((s = r == null ? void 0 : r.render) == null ? void 0 : s.call(r, e.value, n, e)) || e.value;
|
|
93
93
|
}
|
|
94
94
|
function K(t, e) {
|
|
95
95
|
if (t.customRenderFormItem)
|
|
96
96
|
return () => {
|
|
97
|
-
const
|
|
98
|
-
return T(
|
|
97
|
+
const i = t.customRenderFormItem(t);
|
|
98
|
+
return T(i, {
|
|
99
99
|
...t.fieldProps,
|
|
100
100
|
span: t.span,
|
|
101
|
-
...
|
|
101
|
+
...i.props || {}
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
104
|
const n = O[t.valueType];
|
|
@@ -107,30 +107,30 @@ function K(t, e) {
|
|
|
107
107
|
const o = e == null ? void 0 : e[t.valueType];
|
|
108
108
|
return () => {
|
|
109
109
|
var r;
|
|
110
|
-
const
|
|
111
|
-
return
|
|
110
|
+
const i = (r = o == null ? void 0 : o.renderFormItem) == null ? void 0 : r.call(o, t.fieldProps.field);
|
|
111
|
+
return i ? u(I, a(t.fieldProps, {
|
|
112
112
|
span: t.span
|
|
113
|
-
}),
|
|
114
|
-
default: () => [
|
|
113
|
+
}), v(i) ? i : {
|
|
114
|
+
default: () => [i]
|
|
115
115
|
}) : null;
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
function W(t, e) {
|
|
119
|
-
const n = w(t.fieldProps, e), o = (n == null ? void 0 : n.field) || n || {},
|
|
119
|
+
const n = w(t.fieldProps, e), o = (n == null ? void 0 : n.field) || n || {}, i = t.valueType === "switch", r = t.valueType === "index", s = i ? {
|
|
120
120
|
checked: e.value
|
|
121
121
|
} : {
|
|
122
122
|
value: r ? e.index + 1 : e.value
|
|
123
123
|
};
|
|
124
124
|
return t.valueEnum && (o.valueEnum = t.valueEnum), {
|
|
125
|
-
...
|
|
126
|
-
...
|
|
125
|
+
...h(o, ["request"]),
|
|
126
|
+
...s
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
function X(t) {
|
|
130
130
|
const e = {
|
|
131
131
|
...t
|
|
132
132
|
};
|
|
133
|
-
return
|
|
133
|
+
return j(t.filters) && t.filters && t.valueEnum && (e.filters = p(t.valueEnum)), e;
|
|
134
134
|
}
|
|
135
135
|
function Y(t, e) {
|
|
136
136
|
var o;
|
|
@@ -156,14 +156,19 @@ function k(t, e, n) {
|
|
|
156
156
|
});
|
|
157
157
|
if (o && (o.length > 1 || o[0].children !== "v-if"))
|
|
158
158
|
return o;
|
|
159
|
-
const r =
|
|
159
|
+
const r = c(t.title) ? u("span", {
|
|
160
160
|
style: E,
|
|
161
161
|
title: t.title
|
|
162
|
-
}, [t.title]),
|
|
163
|
-
|
|
162
|
+
}, [t.title]) : t.title, s = t.tooltip ? c(t.tooltip) ? u(b, null, [t.tooltip]) : t.tooltip(t) : null, m = () => u("span", {
|
|
163
|
+
style: {
|
|
164
|
+
display: "inline-flex",
|
|
165
|
+
alignItems: "center"
|
|
166
|
+
}
|
|
167
|
+
}, [r, u(x, {
|
|
168
|
+
title: s,
|
|
164
169
|
placement: "bottom"
|
|
165
170
|
}, {
|
|
166
|
-
default: () => [
|
|
171
|
+
default: () => [u(N, {
|
|
167
172
|
style: {
|
|
168
173
|
padding: "4px",
|
|
169
174
|
color: n,
|
|
@@ -171,7 +176,7 @@ function k(t, e, n) {
|
|
|
171
176
|
}
|
|
172
177
|
}, null)]
|
|
173
178
|
})]);
|
|
174
|
-
return
|
|
179
|
+
return s ? m : r;
|
|
175
180
|
}
|
|
176
181
|
export {
|
|
177
182
|
X as apColumnToColumn,
|
|
@@ -1,65 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ImagePreviewType } from 'ant-design-vue/es/vc-image';
|
|
5
|
-
import { MouseEventHandler } from 'ant-design-vue/es/_util/EventInterface';
|
|
6
|
-
declare const _default: DefineComponent<{
|
|
7
|
-
getOssAccess: PropType<() => Promise<accessCreate>>;
|
|
8
|
-
src: StringConstructor;
|
|
9
|
-
wrapperClassName: StringConstructor;
|
|
10
|
-
wrapperStyle: {
|
|
11
|
-
type: PropType< CSSProperties>;
|
|
12
|
-
default: CSSProperties;
|
|
13
|
-
};
|
|
14
|
-
rootClassName: StringConstructor;
|
|
15
|
-
prefixCls: StringConstructor;
|
|
16
|
-
previewPrefixCls: StringConstructor;
|
|
17
|
-
previewMask: {
|
|
18
|
-
type: PropType<false | (() => any)>;
|
|
19
|
-
default: any;
|
|
20
|
-
};
|
|
21
|
-
placeholder: VueTypeValidableDef<any>;
|
|
22
|
-
fallback: StringConstructor;
|
|
23
|
-
preview: {
|
|
24
|
-
type: PropType<boolean | ImagePreviewType>;
|
|
25
|
-
default: boolean | ImagePreviewType;
|
|
26
|
-
};
|
|
27
|
-
onClick: {
|
|
28
|
-
type: PropType< MouseEventHandler>;
|
|
29
|
-
};
|
|
30
|
-
onError: {
|
|
31
|
-
type: PropType<OnErrorEventHandlerNonNull>;
|
|
32
|
-
};
|
|
33
|
-
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
34
|
-
getOssAccess: PropType<() => Promise<accessCreate>>;
|
|
35
|
-
src: StringConstructor;
|
|
36
|
-
wrapperClassName: StringConstructor;
|
|
37
|
-
wrapperStyle: {
|
|
38
|
-
type: PropType< CSSProperties>;
|
|
39
|
-
default: CSSProperties;
|
|
40
|
-
};
|
|
41
|
-
rootClassName: StringConstructor;
|
|
42
|
-
prefixCls: StringConstructor;
|
|
43
|
-
previewPrefixCls: StringConstructor;
|
|
44
|
-
previewMask: {
|
|
45
|
-
type: PropType<false | (() => any)>;
|
|
46
|
-
default: any;
|
|
47
|
-
};
|
|
48
|
-
placeholder: VueTypeValidableDef<any>;
|
|
49
|
-
fallback: StringConstructor;
|
|
50
|
-
preview: {
|
|
51
|
-
type: PropType<boolean | ImagePreviewType>;
|
|
52
|
-
default: boolean | ImagePreviewType;
|
|
53
|
-
};
|
|
54
|
-
onClick: {
|
|
55
|
-
type: PropType< MouseEventHandler>;
|
|
56
|
-
};
|
|
57
|
-
onError: {
|
|
58
|
-
type: PropType<OnErrorEventHandlerNonNull>;
|
|
59
|
-
};
|
|
60
|
-
}>>, {
|
|
61
|
-
preview: boolean | ImagePreviewType;
|
|
62
|
-
wrapperStyle: CSSProperties;
|
|
63
|
-
previewMask: false | (() => any);
|
|
64
|
-
}, {}>;
|
|
1
|
+
import { ApImageProps } from './interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
declare const _default: DefineComponent<__VLS_TypePropsToOption<ApImageProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<ApImageProps>>>, {}, {}>;
|
|
65
4
|
export default _default;
|
|
5
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
6
|
+
type __VLS_TypePropsToOption<T> = {
|
|
7
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
8
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
9
|
+
} : {
|
|
10
|
+
type: PropType<T[K]>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
};
|