@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
|
@@ -140,11 +140,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
140
140
|
};
|
|
141
141
|
align: {
|
|
142
142
|
type: PropType<AlignType>;
|
|
143
|
-
default: AlignType;
|
|
144
|
-
* tips
|
|
145
|
-
* 通常情况下,表格渲染是不需要请求网络数据的,因此这里删掉request,
|
|
146
|
-
* 如果需要做映射,可以在外部发起一次网络请求,然后使用valueEnum设置匹配枚举。
|
|
147
|
-
*/
|
|
143
|
+
default: AlignType;
|
|
148
144
|
};
|
|
149
145
|
builtinPlacements: {
|
|
150
146
|
type: PropType<BuildInPlacements>;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { apTableRenderItemMap as
|
|
1
|
+
import { defineComponent as K, computed as u, createVNode as d, mergeProps as m, unref as n, watch as $, openBlock as p, createElementBlock as c, normalizeClass as b, normalizeStyle as T, withCtx as f, Fragment as H, renderList as x, createBlock as G, resolveDynamicComponent as Q, createCommentVNode as B, createElementVNode as P, renderSlot as I, createSlots as U, toDisplayString as J, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
|
+
import { Typography as Z, Table as ee, Tooltip as ae } from "ant-design-vue";
|
|
3
|
+
import { ApForm as te } from "../ap-form/index.mjs";
|
|
4
|
+
import { apTableRenderItemMap as oe, noRenderAsFormItemValueList as v, apTableFormItemMap as ne } from "./constants.mjs";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useTablePaging as
|
|
7
|
-
import {
|
|
6
|
+
import { useTablePaging as le } from "./hooks/use-table-paging.mjs";
|
|
7
|
+
import { isUndefined as re, omit as de } from "lodash-unified";
|
|
8
8
|
import "./style/ap-table.css";
|
|
9
|
-
import { QuestionCircleOutlined as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
9
|
+
import { QuestionCircleOutlined as se } from "@ant-design/icons-vue";
|
|
10
|
+
import { apColumnToColumn as ue, getTableRenderType as pe, getTableRenderProps as ie, getColumnOrder as k, updateFormProps as me, getFieldProps as ce, getPlaceholder as fe } from "./utils.mjs";
|
|
11
|
+
import { useLocale as ge } from "../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useNamespace as ye } from "../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useGlobalConfig as be } from "../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
const he = {
|
|
13
15
|
key: 0
|
|
14
|
-
},
|
|
16
|
+
}, ze = /* @__PURE__ */ K({
|
|
15
17
|
name: "ApTable",
|
|
16
18
|
__name: "ap-table",
|
|
17
19
|
props: {
|
|
@@ -120,144 +122,152 @@ const fe = {
|
|
|
120
122
|
default: "middle"
|
|
121
123
|
}
|
|
122
124
|
},
|
|
123
|
-
setup(
|
|
124
|
-
expose:
|
|
125
|
+
setup(O, {
|
|
126
|
+
expose: z
|
|
125
127
|
}) {
|
|
126
|
-
const
|
|
128
|
+
const l = O, {
|
|
129
|
+
t: E
|
|
130
|
+
} = ge(), {
|
|
127
131
|
e: h,
|
|
128
|
-
b:
|
|
129
|
-
} =
|
|
130
|
-
var
|
|
131
|
-
let
|
|
132
|
-
return
|
|
133
|
-
...
|
|
132
|
+
b: g
|
|
133
|
+
} = ye("ap-table"), L = be("uiMode"), y = u(() => {
|
|
134
|
+
var o;
|
|
135
|
+
let e = ((o = l.columns) == null ? void 0 : o.filter((a) => !a.hideInTable)) || [];
|
|
136
|
+
return e = e.map((a) => ({
|
|
137
|
+
...ue(a),
|
|
134
138
|
customRender({
|
|
135
|
-
value:
|
|
136
|
-
...
|
|
139
|
+
value: t,
|
|
140
|
+
...r
|
|
137
141
|
}) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
column: e
|
|
142
|
+
let s;
|
|
143
|
+
if (a.customRender)
|
|
144
|
+
s = a.customRender({
|
|
145
|
+
value: t,
|
|
146
|
+
...r,
|
|
147
|
+
column: a
|
|
145
148
|
});
|
|
146
149
|
else {
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
g = r(A, p(k(M, ["request"]), $, {
|
|
150
|
+
const w = pe(a), _ = oe[w], q = ie(a, {
|
|
151
|
+
value: t,
|
|
152
|
+
...r
|
|
153
|
+
});
|
|
154
|
+
s = d(_, m(q, {
|
|
153
155
|
mode: "read"
|
|
154
156
|
}), null);
|
|
155
157
|
}
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
})), a;
|
|
159
|
-
}), C = d(() => {
|
|
160
|
-
var a, t;
|
|
161
|
-
return ((t = (a = n.columns) == null ? void 0 : a.filter((e) => !e.hideInSearch && e.dataIndex && (e.valueType || e.customRenderFormItem) && !v.includes(e.valueType))) == null ? void 0 : t.map((e) => ({
|
|
162
|
-
...e,
|
|
163
|
-
fieldProps: {
|
|
164
|
-
...e.fieldProps || {},
|
|
165
|
-
label: e.title,
|
|
166
|
-
name: e.dataIndex
|
|
158
|
+
return A(a, t, s);
|
|
167
159
|
}
|
|
168
|
-
}))
|
|
169
|
-
}),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
160
|
+
})), e;
|
|
161
|
+
}), C = u(() => {
|
|
162
|
+
var e, o, a;
|
|
163
|
+
return ((a = (o = (e = l.columns) == null ? void 0 : e.filter((t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !v.includes(t.valueType))) == null ? void 0 : o.sort((t, r) => {
|
|
164
|
+
let s = k(t.order);
|
|
165
|
+
return k(r.order) - s;
|
|
166
|
+
})) == null ? void 0 : a.map((t) => {
|
|
167
|
+
const r = me(t, ce(t.fieldProps));
|
|
168
|
+
return {
|
|
169
|
+
...t,
|
|
170
|
+
fieldProps: {
|
|
171
|
+
label: t.title,
|
|
172
|
+
name: t.dataIndex,
|
|
173
|
+
...r || {},
|
|
174
|
+
// 格式化placeholder
|
|
175
|
+
placeholder: fe(E, t.valueType, r == null ? void 0 : r.placeholder)
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
})) || [];
|
|
179
|
+
}), N = u(() => n(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), D = u(() => n(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
|
|
180
|
+
formRef: F,
|
|
181
|
+
submit: R,
|
|
182
|
+
reset: S,
|
|
173
183
|
tableProps: i,
|
|
174
|
-
handleTableChange:
|
|
175
|
-
data:
|
|
176
|
-
} =
|
|
177
|
-
async request(
|
|
178
|
-
var
|
|
179
|
-
const
|
|
180
|
-
return (
|
|
181
|
-
data: (
|
|
182
|
-
total: (
|
|
184
|
+
handleTableChange: V,
|
|
185
|
+
data: j
|
|
186
|
+
} = le({
|
|
187
|
+
async request(e) {
|
|
188
|
+
var a, t;
|
|
189
|
+
const o = await ((a = l.request) == null ? void 0 : a.call(l, e));
|
|
190
|
+
return (t = l.onLoad) == null || t.call(l, (o == null ? void 0 : o.data) || []), {
|
|
191
|
+
data: (o == null ? void 0 : o.data) || [],
|
|
192
|
+
total: (o == null ? void 0 : o.total) || 0
|
|
183
193
|
};
|
|
184
194
|
},
|
|
185
|
-
filterFields:
|
|
186
|
-
sortFields:
|
|
187
|
-
defaultParams:
|
|
188
|
-
defaultData:
|
|
189
|
-
manual:
|
|
190
|
-
defaultCurrent:
|
|
191
|
-
defaultPageSize:
|
|
192
|
-
formatParams:
|
|
193
|
-
}),
|
|
194
|
-
...
|
|
195
|
-
...
|
|
196
|
-
loading:
|
|
197
|
-
pagination:
|
|
195
|
+
filterFields: n(D),
|
|
196
|
+
sortFields: n(N),
|
|
197
|
+
defaultParams: l.params,
|
|
198
|
+
defaultData: l.defaultData,
|
|
199
|
+
manual: l.manual,
|
|
200
|
+
defaultCurrent: l.pagination ? l.pagination.defaultCurrent : void 0,
|
|
201
|
+
defaultPageSize: l.pagination ? l.pagination.defaultPageSize : void 0,
|
|
202
|
+
formatParams: l.beforeSearchSubmit
|
|
203
|
+
}), W = u(() => ({
|
|
204
|
+
...l,
|
|
205
|
+
...n(i),
|
|
206
|
+
loading: re(l.loading) ? n(i).loading : l.loading,
|
|
207
|
+
pagination: l.pagination === !1 ? !1 : n(i).pagination
|
|
198
208
|
}));
|
|
199
|
-
function
|
|
200
|
-
return v.includes(
|
|
201
|
-
copyable:
|
|
202
|
-
text:
|
|
209
|
+
function A(e, o, a) {
|
|
210
|
+
return v.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(Z.Text, {
|
|
211
|
+
copyable: e.copyable ? {
|
|
212
|
+
text: o,
|
|
203
213
|
tooltip: !1
|
|
204
214
|
} : !1,
|
|
205
|
-
ellipsis:
|
|
206
|
-
tooltip:
|
|
215
|
+
ellipsis: e.ellipsis ? {
|
|
216
|
+
tooltip: o
|
|
207
217
|
} : !1,
|
|
208
|
-
content:
|
|
209
|
-
}, null) :
|
|
218
|
+
content: a
|
|
219
|
+
}, null) : a;
|
|
210
220
|
}
|
|
211
|
-
|
|
212
|
-
var
|
|
213
|
-
(
|
|
221
|
+
$(() => n(j).loading, (e) => {
|
|
222
|
+
var o;
|
|
223
|
+
(o = l.onLoadingChange) == null || o.call(l, e);
|
|
214
224
|
});
|
|
215
|
-
function
|
|
216
|
-
var
|
|
217
|
-
(
|
|
225
|
+
function M(e) {
|
|
226
|
+
var o, a, t;
|
|
227
|
+
(t = (a = (o = F.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || t.call(a, e);
|
|
218
228
|
}
|
|
219
|
-
return
|
|
220
|
-
submit: () =>
|
|
221
|
-
reset: () =>
|
|
222
|
-
setSearchFormValues:
|
|
223
|
-
}), (
|
|
224
|
-
class: b(
|
|
225
|
-
}, [
|
|
229
|
+
return z({
|
|
230
|
+
submit: () => R(),
|
|
231
|
+
reset: () => S(),
|
|
232
|
+
setSearchFormValues: M
|
|
233
|
+
}), (e, o) => (p(), c("div", {
|
|
234
|
+
class: b(e.card ? null : n(g)("wrapper"))
|
|
235
|
+
}, [e.searchForm !== !1 && C.value.length > 0 ? (p(), c("div", {
|
|
226
236
|
key: 0,
|
|
227
|
-
class: b(
|
|
228
|
-
style:
|
|
229
|
-
}, [
|
|
237
|
+
class: b(e.card ? n(h)("search-wrapper") : null),
|
|
238
|
+
style: T(e.searchFormWrapperStyle)
|
|
239
|
+
}, [d(n(te).SearchForm, m(e.searchForm || {}, {
|
|
230
240
|
ref_key: "formRef",
|
|
231
|
-
ref:
|
|
241
|
+
ref: F,
|
|
232
242
|
"custom-reset": "",
|
|
233
|
-
onSubmit:
|
|
234
|
-
onReset:
|
|
235
|
-
"submit-loading":
|
|
243
|
+
onSubmit: n(R),
|
|
244
|
+
onReset: n(S),
|
|
245
|
+
"submit-loading": n(i).loading
|
|
236
246
|
}), {
|
|
237
|
-
default:
|
|
238
|
-
key:
|
|
247
|
+
default: f(() => [(p(!0), c(H, null, x(C.value, (a) => (p(), G(Q(a.customRenderFormItem ? a.customRenderFormItem(a) : n(ne)[a.valueType || "text"]), m({
|
|
248
|
+
key: a.dataIndex,
|
|
239
249
|
ref_for: !0
|
|
240
|
-
},
|
|
241
|
-
span:
|
|
250
|
+
}, a.fieldProps || {}, {
|
|
251
|
+
span: a.span
|
|
242
252
|
}), null, 16, ["span"]))), 128))]),
|
|
243
253
|
_: 1
|
|
244
|
-
}, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : B("", !0),
|
|
245
|
-
class: b(
|
|
246
|
-
style:
|
|
247
|
-
}, [
|
|
248
|
-
class:
|
|
249
|
-
},
|
|
250
|
-
onChange:
|
|
254
|
+
}, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : B("", !0), P("div", {
|
|
255
|
+
class: b(e.card ? n(h)("table-wrapper") : null),
|
|
256
|
+
style: T(e.tableWrapperStyle)
|
|
257
|
+
}, [I(e.$slots, "title"), d(n(ee), m({
|
|
258
|
+
class: n(L) === "admin" ? n(g)("table-admin") : n(g)("table")
|
|
259
|
+
}, W.value, {
|
|
260
|
+
onChange: n(V),
|
|
251
261
|
columns: y.value
|
|
252
|
-
}),
|
|
253
|
-
headerCell:
|
|
254
|
-
column:
|
|
255
|
-
title:
|
|
256
|
-
}) => [
|
|
257
|
-
title:
|
|
262
|
+
}), U({
|
|
263
|
+
headerCell: f(({
|
|
264
|
+
column: a,
|
|
265
|
+
title: t
|
|
266
|
+
}) => [a.tooltip ? (p(), c("span", he, [P("span", null, J(t), 1), d(n(ae), {
|
|
267
|
+
title: a.tooltip,
|
|
258
268
|
placement: "bottom"
|
|
259
269
|
}, {
|
|
260
|
-
default:
|
|
270
|
+
default: f(() => [d(n(se), {
|
|
261
271
|
style: {
|
|
262
272
|
color: "#0070ff",
|
|
263
273
|
"padding-left": "4px"
|
|
@@ -266,12 +276,12 @@ const fe = {
|
|
|
266
276
|
_: 2
|
|
267
277
|
}, 1032, ["title"])])) : B("", !0)]),
|
|
268
278
|
_: 2
|
|
269
|
-
}, [
|
|
270
|
-
name:
|
|
271
|
-
fn:
|
|
279
|
+
}, [x(n(de)(e.$slots, "title"), (a, t) => ({
|
|
280
|
+
name: t,
|
|
281
|
+
fn: f((r) => [I(e.$slots, t, X(Y(r || {})))])
|
|
272
282
|
}))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
|
|
273
283
|
}
|
|
274
284
|
});
|
|
275
285
|
export {
|
|
276
|
-
|
|
286
|
+
ze as default
|
|
277
287
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ValueEnum } from '../interface';
|
|
2
|
+
|
|
1
3
|
export type ApTablePaginationProps = {
|
|
2
4
|
/** dataSource的总数量 */
|
|
3
5
|
total?: number;
|
|
@@ -18,3 +20,13 @@ export type ApTableIndexProps = {
|
|
|
18
20
|
*/
|
|
19
21
|
value?: any;
|
|
20
22
|
};
|
|
23
|
+
export type ApTableStatusProps = {
|
|
24
|
+
/**
|
|
25
|
+
* 配置的值到配置的枚举值
|
|
26
|
+
*/
|
|
27
|
+
valueEnum: ValueEnum;
|
|
28
|
+
/**
|
|
29
|
+
* 当前的值
|
|
30
|
+
*/
|
|
31
|
+
value?: any;
|
|
32
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApTableStatusProps } from '../interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare const _default: DefineComponent<__VLS_TypePropsToRuntimeProps<ApTableStatusProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ApTableStatusProps>>>, {}, {}>;
|
|
5
|
+
export default _default;
|
|
6
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
7
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
8
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
9
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
10
|
+
} : {
|
|
11
|
+
type: PropType<T[K]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent as n, computed as o, openBlock as u, createBlock as a, unref as m, normalizeProps as p, mergeProps as l, createCommentVNode as c } from "vue";
|
|
2
|
+
import { Badge as s } from "ant-design-vue";
|
|
3
|
+
const v = /* @__PURE__ */ n({
|
|
4
|
+
name: "_ApTableStatus",
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: {
|
|
7
|
+
valueEnum: {},
|
|
8
|
+
value: {}
|
|
9
|
+
},
|
|
10
|
+
setup(t) {
|
|
11
|
+
const e = t, r = o(() => e.valueEnum[e.value]);
|
|
12
|
+
return (_, d) => r.value ? (u(), a(m(s), p(l({ key: 0 }, r.value)), null, 16)) : c("", !0);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
v as default
|
|
17
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApTableValueFields } from './interface';
|
|
1
|
+
import { ApTableValueFields, ValueEnum } from './interface';
|
|
2
2
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, DefineComponent, PublicProps, VNode, RendererNode, RendererElement, CSSProperties, ComputedRef } from 'vue';
|
|
3
3
|
import { ColSize } from 'ant-design-vue/es/grid';
|
|
4
4
|
import { ApFieldDateProps, ApFieldDateRangeProps, ApFieldNumberProps, ApFieldRadioProps, ApFieldSelectProps, ApFieldSwitchProps, ApFieldTextProps, ApFieldTextAreaProps, ApFieldCheckboxProps, FieldMode } from '../ap-field';
|
|
@@ -2482,9 +2482,6 @@ export declare const apTableFormItemMap: {
|
|
|
2482
2482
|
addonAfter?: any;
|
|
2483
2483
|
prefix?: any;
|
|
2484
2484
|
default?: any;
|
|
2485
|
-
/**
|
|
2486
|
-
* 表格到查询表单的映射
|
|
2487
|
-
*/
|
|
2488
2485
|
upIcon?: any;
|
|
2489
2486
|
downIcon?: any;
|
|
2490
2487
|
}> & {
|
|
@@ -2492,9 +2489,6 @@ export declare const apTableFormItemMap: {
|
|
|
2492
2489
|
addonAfter?: any;
|
|
2493
2490
|
prefix?: any;
|
|
2494
2491
|
default?: any;
|
|
2495
|
-
/**
|
|
2496
|
-
* 表格到查询表单的映射
|
|
2497
|
-
*/
|
|
2498
2492
|
upIcon?: any;
|
|
2499
2493
|
downIcon?: any;
|
|
2500
2494
|
};
|
|
@@ -5305,17 +5299,13 @@ export declare const apTableFormItemMap: {
|
|
|
5305
5299
|
validateFirst: boolean;
|
|
5306
5300
|
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
5307
5301
|
$slots: Readonly<{
|
|
5308
|
-
addonAfter: any;
|
|
5309
|
-
* 表格到查询表单的映射
|
|
5310
|
-
*/
|
|
5302
|
+
addonAfter: any;
|
|
5311
5303
|
addonBefore: any;
|
|
5312
5304
|
prefix: any;
|
|
5313
5305
|
suffix: any;
|
|
5314
5306
|
clearIcon: any;
|
|
5315
5307
|
}> & {
|
|
5316
|
-
addonAfter: any;
|
|
5317
|
-
* 表格到查询表单的映射
|
|
5318
|
-
*/
|
|
5308
|
+
addonAfter: any;
|
|
5319
5309
|
addonBefore: any;
|
|
5320
5310
|
prefix: any;
|
|
5321
5311
|
suffix: any;
|
|
@@ -9820,9 +9810,6 @@ export declare const apTableRenderItemMap: {
|
|
|
9820
9810
|
default: any;
|
|
9821
9811
|
type: PropType<any>;
|
|
9822
9812
|
};
|
|
9823
|
-
/**
|
|
9824
|
-
* 表格自定义渲染
|
|
9825
|
-
*/
|
|
9826
9813
|
icon: {
|
|
9827
9814
|
default: any;
|
|
9828
9815
|
type: PropType<any>;
|
|
@@ -10193,9 +10180,6 @@ export declare const apTableRenderItemMap: {
|
|
|
10193
10180
|
default: any;
|
|
10194
10181
|
type: PropType<any>;
|
|
10195
10182
|
};
|
|
10196
|
-
/**
|
|
10197
|
-
* 表格自定义渲染
|
|
10198
|
-
*/
|
|
10199
10183
|
icon: {
|
|
10200
10184
|
default: any;
|
|
10201
10185
|
type: PropType<any>;
|
|
@@ -10577,9 +10561,6 @@ export declare const apTableRenderItemMap: {
|
|
|
10577
10561
|
default: any;
|
|
10578
10562
|
type: PropType<any>;
|
|
10579
10563
|
};
|
|
10580
|
-
/**
|
|
10581
|
-
* 表格自定义渲染
|
|
10582
|
-
*/
|
|
10583
10564
|
icon: {
|
|
10584
10565
|
default: any;
|
|
10585
10566
|
type: PropType<any>;
|
|
@@ -10958,9 +10939,6 @@ export declare const apTableRenderItemMap: {
|
|
|
10958
10939
|
default: any;
|
|
10959
10940
|
type: PropType<any>;
|
|
10960
10941
|
};
|
|
10961
|
-
/**
|
|
10962
|
-
* 表格自定义渲染
|
|
10963
|
-
*/
|
|
10964
10942
|
icon: {
|
|
10965
10943
|
default: any;
|
|
10966
10944
|
type: PropType<any>;
|
|
@@ -12333,6 +12311,23 @@ export declare const apTableRenderItemMap: {
|
|
|
12333
12311
|
}>>, {
|
|
12334
12312
|
bordered: boolean;
|
|
12335
12313
|
}, {}>;
|
|
12314
|
+
status: DefineComponent<{
|
|
12315
|
+
valueEnum: {
|
|
12316
|
+
type: PropType<ValueEnum>;
|
|
12317
|
+
required: true;
|
|
12318
|
+
};
|
|
12319
|
+
value: {
|
|
12320
|
+
type: PropType<any>;
|
|
12321
|
+
};
|
|
12322
|
+
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
12323
|
+
valueEnum: {
|
|
12324
|
+
type: PropType<ValueEnum>;
|
|
12325
|
+
required: true;
|
|
12326
|
+
};
|
|
12327
|
+
value: {
|
|
12328
|
+
type: PropType<any>;
|
|
12329
|
+
};
|
|
12330
|
+
}>>, {}, {}>;
|
|
12336
12331
|
};
|
|
12337
12332
|
/**
|
|
12338
12333
|
* 不需要渲染到Form表单的valueType字段
|
|
@@ -2,6 +2,7 @@ import "../ap-action/index.mjs";
|
|
|
2
2
|
import "../ap-field/index.mjs";
|
|
3
3
|
import "../ap-form/index.mjs";
|
|
4
4
|
import "./components/index/index.vue.mjs";
|
|
5
|
+
import "./components/status/index.vue.mjs";
|
|
5
6
|
import m from "../ap-form/items/date/index.vue.mjs";
|
|
6
7
|
import o from "../ap-form/items/date-range/index.vue.mjs";
|
|
7
8
|
import r from "../ap-form/items/number/index.vue.mjs";
|
|
@@ -11,18 +12,19 @@ import f from "../ap-form/items/switch/index.vue.mjs";
|
|
|
11
12
|
import a from "../ap-form/items/text/index.vue.mjs";
|
|
12
13
|
import _ from "../ap-form/items/text-area/index.vue.mjs";
|
|
13
14
|
import c from "../ap-form/items/checkbox/index.vue.mjs";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
15
|
+
import n from "../ap-field/date/index.vue.mjs";
|
|
16
|
+
import e from "../ap-field/date-range/index.vue.mjs";
|
|
17
|
+
import s from "../ap-field/number/index.vue.mjs";
|
|
18
|
+
import p from "../ap-field/radio/index.vue.mjs";
|
|
18
19
|
import $ from "../ap-field/select/index.vue.mjs";
|
|
19
20
|
import d from "../ap-field/switch/index.vue.mjs";
|
|
20
21
|
import x from "../ap-field/text/index.vue.mjs";
|
|
21
22
|
import b from "../ap-field/text-area/index.vue.mjs";
|
|
22
23
|
import h from "../ap-field/checkbox/index.vue.mjs";
|
|
23
24
|
import l from "../ap-action/group/index.vue.mjs";
|
|
24
|
-
import
|
|
25
|
-
|
|
25
|
+
import u from "./components/index/index.vue2.mjs";
|
|
26
|
+
import R from "./components/status/index.vue2.mjs";
|
|
27
|
+
const Q = {
|
|
26
28
|
date: m,
|
|
27
29
|
dateRange: o,
|
|
28
30
|
number: r,
|
|
@@ -32,24 +34,25 @@ const N = {
|
|
|
32
34
|
text: a,
|
|
33
35
|
textArea: _,
|
|
34
36
|
checkbox: c
|
|
35
|
-
},
|
|
36
|
-
date:
|
|
37
|
-
dateRange:
|
|
38
|
-
number:
|
|
39
|
-
radio:
|
|
37
|
+
}, S = {
|
|
38
|
+
date: n,
|
|
39
|
+
dateRange: e,
|
|
40
|
+
number: s,
|
|
41
|
+
radio: p,
|
|
40
42
|
select: $,
|
|
41
43
|
switch: d,
|
|
42
44
|
text: x,
|
|
43
45
|
textArea: b,
|
|
44
46
|
checkbox: h,
|
|
45
47
|
action: l,
|
|
46
|
-
index:
|
|
47
|
-
|
|
48
|
+
index: u,
|
|
49
|
+
status: R
|
|
50
|
+
}, U = [
|
|
48
51
|
"action",
|
|
49
52
|
"index"
|
|
50
53
|
];
|
|
51
54
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
Q as apTableFormItemMap,
|
|
56
|
+
S as apTableRenderItemMap,
|
|
57
|
+
U as noRenderAsFormItemValueList
|
|
55
58
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColumnType, TableProps } from 'ant-design-vue/es/table';
|
|
2
2
|
import { CompareFn, SortOrder } from 'ant-design-vue/es/table/interface';
|
|
3
3
|
import { ApFormSearchFormProps } from '../ap-form';
|
|
4
|
-
import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextProps } from '
|
|
4
|
+
import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextProps } from '../ap-form/items/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
6
6
|
import { CSSProperties } from 'vue';
|
|
7
7
|
import { ApActionGroupProps } from '../ap-action';
|
|
@@ -9,7 +9,13 @@ import { ApTableIndexProps } from './components/interface';
|
|
|
9
9
|
|
|
10
10
|
export type ValueEnumType = {
|
|
11
11
|
text: string;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* 当前枚举值与定义的状态,等同于Badge的status
|
|
14
|
+
*/
|
|
15
|
+
status?: 'success' | 'error' | 'processing' | 'warning' | 'default';
|
|
16
|
+
/**
|
|
17
|
+
* 如果status预定义的颜色无法满足需求,你可以自定义徽标的颜色,注意`color`比`status`的优先级更高
|
|
18
|
+
*/
|
|
13
19
|
color?: string;
|
|
14
20
|
disabled?: boolean;
|
|
15
21
|
};
|
|
@@ -45,15 +51,15 @@ export type ApTableValueFields = {
|
|
|
45
51
|
index: ApTableIndexProps;
|
|
46
52
|
};
|
|
47
53
|
export type ValueEnum = Record<string, ValueEnumType>;
|
|
48
|
-
export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children'> & {
|
|
54
|
+
export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters'> & {
|
|
49
55
|
sorter?: string | boolean | CompareFn<T> | {
|
|
50
56
|
compare?: CompareFn<T>;
|
|
51
57
|
/** Config multiple sorter order priority */
|
|
52
58
|
multiple?: number;
|
|
53
59
|
};
|
|
54
60
|
};
|
|
55
|
-
export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> = ExtraProColumnType<any> & {
|
|
56
|
-
children?: ApColumnType[];
|
|
61
|
+
export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = ExtraProColumnType<any> & {
|
|
62
|
+
children?: ApColumnType<any, RecordType>[];
|
|
57
63
|
/**
|
|
58
64
|
* 表单项所占据的格子数(1-24格)
|
|
59
65
|
*/
|
|
@@ -89,7 +95,23 @@ export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> =
|
|
|
89
95
|
/**
|
|
90
96
|
* 值类型额外配置的参数(用于查询表单渲染)
|
|
91
97
|
*/
|
|
92
|
-
fieldProps?: ApTableValueFields[ValueType]
|
|
98
|
+
fieldProps?: ApTableValueFields[ValueType] | ((opt?: {
|
|
99
|
+
value: any;
|
|
100
|
+
text: any;
|
|
101
|
+
record: RecordType;
|
|
102
|
+
index: number;
|
|
103
|
+
renderIndex: number;
|
|
104
|
+
column: ApColumnType<ValueType, RecordType>;
|
|
105
|
+
}) => ApTableValueFields[ValueType]);
|
|
106
|
+
/**
|
|
107
|
+
* 用于表单项排序的字段
|
|
108
|
+
* @description 值越大,越排在前面,请设置正整数,设置为0或负数将会无效
|
|
109
|
+
*/
|
|
110
|
+
order?: number;
|
|
111
|
+
/**
|
|
112
|
+
* 表头的菜单筛选项,设置为true后会尝试使用valueEnum生成filters
|
|
113
|
+
*/
|
|
114
|
+
filters?: ColumnType<RecordType>['filters'] | true;
|
|
93
115
|
};
|
|
94
116
|
export type RequestData<T> = {
|
|
95
117
|
data: T[] | undefined;
|
|
@@ -99,7 +121,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
99
121
|
/**
|
|
100
122
|
* 列配置
|
|
101
123
|
*/
|
|
102
|
-
columns?: ApColumnType<any>[];
|
|
124
|
+
columns?: ApColumnType<any, RecordType>[];
|
|
103
125
|
/**
|
|
104
126
|
* 是否启用卡片样式
|
|
105
127
|
*/
|
|
@@ -178,3 +200,6 @@ export type ApTableExpose = {
|
|
|
178
200
|
submit: () => void;
|
|
179
201
|
reset: () => void;
|
|
180
202
|
};
|
|
203
|
+
export type FixedApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = Omit<ApColumnType<ValueType, RecordType>, 'filters'> & {
|
|
204
|
+
filters?: ColumnType<RecordType>['filters'];
|
|
205
|
+
};
|