@aplus-frontend/ui 0.0.3 → 0.0.5
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-form/ap-form-item-group/index.vue.mjs +23 -21
- package/es/src/ap-form/ap-form.vue.d.ts +7 -2
- package/es/src/ap-form/ap-form.vue2.mjs +85 -52
- package/es/src/ap-form/context.d.ts +14 -0
- package/es/src/ap-form/hooks/use-watch.d.ts +7 -0
- package/es/src/ap-form/hooks/use-watch.mjs +30 -0
- package/es/src/ap-form/index.d.ts +2 -0
- package/es/src/ap-form/index.mjs +13 -11
- package/es/src/ap-form/interface.d.ts +17 -7
- package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/es/src/ap-form/modal-form/index.vue.mjs +1 -1
- package/es/src/ap-form/search-form/index.vue.mjs +27 -27
- package/es/src/ap-table/ap-table.vue.d.ts +2 -0
- package/es/src/ap-table/ap-table.vue.mjs +112 -111
- 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 +34 -4
- package/es/src/ap-table/utils.d.ts +174 -1
- package/es/src/ap-table/utils.mjs +75 -48
- package/es/src/pro-form/helper.mjs +7 -7
- package/es/src/theme/antd-global-overwrite/admin/alert.css +3 -0
- package/es/src/theme/antd-global-overwrite/admin/index.css +72 -29
- 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/aplus/alert.css +3 -0
- package/es/src/theme/antd-global-overwrite/aplus/index.css +78 -33
- 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/utils/index.mjs +32 -32
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +7 -2
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/context.d.ts +14 -0
- package/lib/src/ap-form/hooks/use-watch.d.ts +7 -0
- package/lib/src/ap-form/hooks/use-watch.js +1 -0
- package/lib/src/ap-form/index.d.ts +2 -0
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/interface.d.ts +17 -7
- package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -0
- 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 +34 -4
- package/lib/src/ap-table/utils.d.ts +174 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/pro-form/helper.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/alert.css +3 -0
- package/lib/src/theme/antd-global-overwrite/admin/index.css +72 -29
- 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/aplus/alert.css +3 -0
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +78 -33
- 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/utils/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { apTableRenderItemMap as
|
|
1
|
+
import { defineComponent as $, computed as u, createVNode as d, mergeProps as m, unref as l, watch as H, openBlock as p, createElementBlock as c, normalizeClass as h, normalizeStyle as T, withCtx as f, Fragment as G, renderList as x, createBlock as Q, resolveDynamicComponent as U, createCommentVNode as B, createElementVNode as P, renderSlot as I, createSlots as J, toDisplayString as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
|
|
2
|
+
import { Typography as ee, Table as ae, Tooltip as te } from "ant-design-vue";
|
|
3
|
+
import { ApForm as oe } from "../ap-form/index.mjs";
|
|
4
|
+
import { apTableRenderItemMap as le, 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 re } from "./hooks/use-table-paging.mjs";
|
|
7
|
+
import { isUndefined as de, omit as se } from "lodash-unified";
|
|
8
8
|
import "./style/ap-table.css";
|
|
9
|
-
import { QuestionCircleOutlined as
|
|
10
|
-
import {
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import { useGlobalConfig as
|
|
14
|
-
const
|
|
9
|
+
import { QuestionCircleOutlined as ue } from "@ant-design/icons-vue";
|
|
10
|
+
import { apColumnToColumn as pe, getTableRenderType as ie, getTableRenderProps as me, getColumnOrder as k, updateFormProps as ce, getFieldProps as fe, getPlaceholder as ge } from "./utils.mjs";
|
|
11
|
+
import { useLocale as ye } from "../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useNamespace as be } from "../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useGlobalConfig as he } from "../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
const Ce = {
|
|
15
15
|
key: 0
|
|
16
|
-
},
|
|
16
|
+
}, Ee = /* @__PURE__ */ $({
|
|
17
17
|
name: "ApTable",
|
|
18
18
|
__name: "ap-table",
|
|
19
19
|
props: {
|
|
@@ -122,170 +122,171 @@ const he = {
|
|
|
122
122
|
default: "middle"
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
|
-
setup(
|
|
126
|
-
expose:
|
|
125
|
+
setup(O, {
|
|
126
|
+
expose: z
|
|
127
127
|
}) {
|
|
128
|
-
const
|
|
129
|
-
t:
|
|
130
|
-
} =
|
|
128
|
+
const n = O, {
|
|
129
|
+
t: E
|
|
130
|
+
} = ye(), {
|
|
131
131
|
e: C,
|
|
132
132
|
b: g
|
|
133
|
-
} =
|
|
134
|
-
var
|
|
135
|
-
let e = ((
|
|
133
|
+
} = be("ap-table"), L = he("uiMode"), y = u(() => {
|
|
134
|
+
var t;
|
|
135
|
+
let e = ((t = n.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
|
|
136
136
|
return e = e.map((a) => ({
|
|
137
|
-
...a,
|
|
137
|
+
...pe(a),
|
|
138
138
|
customRender({
|
|
139
|
-
value:
|
|
139
|
+
value: o,
|
|
140
140
|
...r
|
|
141
141
|
}) {
|
|
142
142
|
let s;
|
|
143
143
|
if (a.customRender)
|
|
144
144
|
s = a.customRender({
|
|
145
|
-
value:
|
|
145
|
+
value: o,
|
|
146
146
|
...r,
|
|
147
147
|
column: a
|
|
148
148
|
});
|
|
149
149
|
else {
|
|
150
|
-
const
|
|
151
|
-
value:
|
|
150
|
+
const w = ie(a), q = le[w], K = me(a, {
|
|
151
|
+
value: o,
|
|
152
152
|
...r
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
} : {
|
|
156
|
-
value: G ? r.index + 1 : t
|
|
157
|
-
};
|
|
158
|
-
s = d(R, f(O($, ["request"]), Q, {
|
|
153
|
+
});
|
|
154
|
+
s = d(q, m(K, {
|
|
159
155
|
mode: "read"
|
|
160
156
|
}), null);
|
|
161
157
|
}
|
|
162
|
-
return
|
|
158
|
+
return A(a, o, s);
|
|
163
159
|
}
|
|
164
160
|
})), e;
|
|
165
|
-
}),
|
|
166
|
-
var e,
|
|
167
|
-
return ((a = (
|
|
168
|
-
let s =
|
|
169
|
-
return
|
|
170
|
-
})) == null ? void 0 : a.map((
|
|
171
|
-
const r =
|
|
161
|
+
}), F = u(() => {
|
|
162
|
+
var e, t, a;
|
|
163
|
+
return ((a = (t = (e = n.columns) == null ? void 0 : e.filter((o) => !o.hideInSearch && o.dataIndex && (o.valueType || o.customRenderFormItem) && !v.includes(o.valueType))) == null ? void 0 : t.sort((o, r) => {
|
|
164
|
+
let s = k(o.order);
|
|
165
|
+
return k(r.order) - s;
|
|
166
|
+
})) == null ? void 0 : a.map((o) => {
|
|
167
|
+
const r = ce(o, fe(o.fieldProps));
|
|
172
168
|
return {
|
|
173
|
-
...
|
|
169
|
+
...o,
|
|
174
170
|
fieldProps: {
|
|
171
|
+
label: o.title,
|
|
172
|
+
name: o.dataIndex,
|
|
175
173
|
...r || {},
|
|
176
|
-
label: t.title,
|
|
177
|
-
name: t.dataIndex,
|
|
178
174
|
// 格式化placeholder
|
|
179
|
-
placeholder:
|
|
175
|
+
placeholder: ge(E, o.valueType, r == null ? void 0 : r.placeholder)
|
|
180
176
|
}
|
|
181
177
|
};
|
|
182
178
|
})) || [];
|
|
183
|
-
}),
|
|
184
|
-
formRef:
|
|
185
|
-
submit:
|
|
186
|
-
reset:
|
|
187
|
-
tableProps:
|
|
188
|
-
handleTableChange:
|
|
189
|
-
data:
|
|
190
|
-
} =
|
|
179
|
+
}), V = u(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), N = u(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
|
|
180
|
+
formRef: b,
|
|
181
|
+
submit: S,
|
|
182
|
+
reset: R,
|
|
183
|
+
tableProps: i,
|
|
184
|
+
handleTableChange: D,
|
|
185
|
+
data: j
|
|
186
|
+
} = re({
|
|
191
187
|
async request(e) {
|
|
192
|
-
var a,
|
|
193
|
-
const
|
|
194
|
-
return (
|
|
195
|
-
data: (
|
|
196
|
-
total: (
|
|
188
|
+
var a, o;
|
|
189
|
+
const t = await ((a = n.request) == null ? void 0 : a.call(n, e));
|
|
190
|
+
return (o = n.onLoad) == null || o.call(n, (t == null ? void 0 : t.data) || []), {
|
|
191
|
+
data: (t == null ? void 0 : t.data) || [],
|
|
192
|
+
total: (t == null ? void 0 : t.total) || 0
|
|
197
193
|
};
|
|
198
194
|
},
|
|
199
|
-
filterFields:
|
|
200
|
-
sortFields:
|
|
201
|
-
defaultParams:
|
|
202
|
-
defaultData:
|
|
203
|
-
manual:
|
|
204
|
-
defaultCurrent:
|
|
205
|
-
defaultPageSize:
|
|
206
|
-
formatParams:
|
|
207
|
-
}),
|
|
208
|
-
...
|
|
209
|
-
...
|
|
210
|
-
loading:
|
|
211
|
-
pagination:
|
|
195
|
+
filterFields: l(N),
|
|
196
|
+
sortFields: l(V),
|
|
197
|
+
defaultParams: n.params,
|
|
198
|
+
defaultData: n.defaultData,
|
|
199
|
+
manual: n.manual,
|
|
200
|
+
defaultCurrent: n.pagination ? n.pagination.defaultCurrent : void 0,
|
|
201
|
+
defaultPageSize: n.pagination ? n.pagination.defaultPageSize : void 0,
|
|
202
|
+
formatParams: n.beforeSearchSubmit
|
|
203
|
+
}), W = u(() => ({
|
|
204
|
+
...n,
|
|
205
|
+
...l(i),
|
|
206
|
+
loading: de(n.loading) ? l(i).loading : n.loading,
|
|
207
|
+
pagination: n.pagination === !1 ? !1 : l(i).pagination
|
|
212
208
|
}));
|
|
213
|
-
function
|
|
214
|
-
return
|
|
209
|
+
function A(e, t, a) {
|
|
210
|
+
return v.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ee.Text, {
|
|
215
211
|
copyable: e.copyable ? {
|
|
216
|
-
text:
|
|
212
|
+
text: t,
|
|
217
213
|
tooltip: !1
|
|
218
214
|
} : !1,
|
|
219
215
|
ellipsis: e.ellipsis ? {
|
|
220
|
-
tooltip:
|
|
216
|
+
tooltip: t
|
|
221
217
|
} : !1,
|
|
222
218
|
content: a
|
|
223
219
|
}, null) : a;
|
|
224
220
|
}
|
|
225
|
-
|
|
226
|
-
var
|
|
227
|
-
(
|
|
221
|
+
H(() => l(j).loading, (e) => {
|
|
222
|
+
var t;
|
|
223
|
+
(t = n.onLoadingChange) == null || t.call(n, e);
|
|
228
224
|
});
|
|
229
|
-
function
|
|
230
|
-
var
|
|
231
|
-
(
|
|
225
|
+
function M(e) {
|
|
226
|
+
var t, a, o;
|
|
227
|
+
(o = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || o.call(a, e);
|
|
228
|
+
}
|
|
229
|
+
function _() {
|
|
230
|
+
var e, t, a;
|
|
231
|
+
return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
|
|
232
232
|
}
|
|
233
|
-
return
|
|
234
|
-
submit: () =>
|
|
235
|
-
reset: () =>
|
|
236
|
-
setSearchFormValues:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
233
|
+
return z({
|
|
234
|
+
submit: () => S(),
|
|
235
|
+
reset: () => R(),
|
|
236
|
+
setSearchFormValues: M,
|
|
237
|
+
getSearchFormValues: _
|
|
238
|
+
}), (e, t) => (p(), c("div", {
|
|
239
|
+
class: h(e.card ? null : l(g)("wrapper"))
|
|
240
|
+
}, [e.searchForm !== !1 && F.value.length > 0 ? (p(), c("div", {
|
|
240
241
|
key: 0,
|
|
241
|
-
class:
|
|
242
|
+
class: h(e.card ? l(C)("search-wrapper") : null),
|
|
242
243
|
style: T(e.searchFormWrapperStyle)
|
|
243
|
-
}, [d(
|
|
244
|
+
}, [d(l(oe).SearchForm, m(e.searchForm || {}, {
|
|
244
245
|
ref_key: "formRef",
|
|
245
|
-
ref:
|
|
246
|
+
ref: b,
|
|
246
247
|
"custom-reset": "",
|
|
247
|
-
onSubmit:
|
|
248
|
-
onReset:
|
|
249
|
-
"submit-loading":
|
|
248
|
+
onSubmit: l(S),
|
|
249
|
+
onReset: l(R),
|
|
250
|
+
"submit-loading": l(i).loading
|
|
250
251
|
}), {
|
|
251
|
-
default:
|
|
252
|
+
default: f(() => [(p(!0), c(G, null, x(F.value, (a) => (p(), Q(U(a.customRenderFormItem ? a.customRenderFormItem(a) : l(ne)[a.valueType || "text"]), m({
|
|
252
253
|
key: a.dataIndex,
|
|
253
254
|
ref_for: !0
|
|
254
255
|
}, a.fieldProps || {}, {
|
|
255
256
|
span: a.span
|
|
256
257
|
}), null, 16, ["span"]))), 128))]),
|
|
257
258
|
_: 1
|
|
258
|
-
}, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
259
|
-
class:
|
|
259
|
+
}, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : B("", !0), P("div", {
|
|
260
|
+
class: h(e.card ? l(C)("table-wrapper") : null),
|
|
260
261
|
style: T(e.tableWrapperStyle)
|
|
261
|
-
}, [
|
|
262
|
-
class:
|
|
263
|
-
},
|
|
264
|
-
onChange:
|
|
265
|
-
columns:
|
|
266
|
-
}),
|
|
267
|
-
headerCell:
|
|
262
|
+
}, [I(e.$slots, "title"), d(l(ae), m({
|
|
263
|
+
class: l(L) === "admin" ? l(g)("table-admin") : l(g)("table")
|
|
264
|
+
}, W.value, {
|
|
265
|
+
onChange: l(D),
|
|
266
|
+
columns: y.value
|
|
267
|
+
}), J({
|
|
268
|
+
headerCell: f(({
|
|
268
269
|
column: a,
|
|
269
|
-
title:
|
|
270
|
-
}) => [a.tooltip ? (
|
|
270
|
+
title: o
|
|
271
|
+
}) => [a.tooltip ? (p(), c("span", Ce, [P("span", null, X(o), 1), d(l(te), {
|
|
271
272
|
title: a.tooltip,
|
|
272
273
|
placement: "bottom"
|
|
273
274
|
}, {
|
|
274
|
-
default:
|
|
275
|
+
default: f(() => [d(l(ue), {
|
|
275
276
|
style: {
|
|
276
277
|
color: "#0070ff",
|
|
277
278
|
"padding-left": "4px"
|
|
278
279
|
}
|
|
279
280
|
})]),
|
|
280
281
|
_: 2
|
|
281
|
-
}, 1032, ["title"])])) :
|
|
282
|
+
}, 1032, ["title"])])) : B("", !0)]),
|
|
282
283
|
_: 2
|
|
283
|
-
}, [
|
|
284
|
-
name:
|
|
285
|
-
fn:
|
|
284
|
+
}, [x(l(se)(e.$slots, "title"), (a, o) => ({
|
|
285
|
+
name: o,
|
|
286
|
+
fn: f((r) => [I(e.$slots, o, Y(Z(r || {})))])
|
|
286
287
|
}))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
|
|
287
288
|
}
|
|
288
289
|
});
|
|
289
290
|
export {
|
|
290
|
-
|
|
291
|
+
Ee as default
|
|
291
292
|
};
|
|
@@ -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,7 +51,7 @@ 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 */
|
|
@@ -102,6 +108,10 @@ export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text', Re
|
|
|
102
108
|
* @description 值越大,越排在前面,请设置正整数,设置为0或负数将会无效
|
|
103
109
|
*/
|
|
104
110
|
order?: number;
|
|
111
|
+
/**
|
|
112
|
+
* 表头的菜单筛选项,设置为true后会尝试使用valueEnum生成filters
|
|
113
|
+
*/
|
|
114
|
+
filters?: ColumnType<RecordType>['filters'] | true;
|
|
105
115
|
};
|
|
106
116
|
export type RequestData<T> = {
|
|
107
117
|
data: T[] | undefined;
|
|
@@ -186,7 +196,27 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
186
196
|
*/
|
|
187
197
|
size?: 'middle' | 'small';
|
|
188
198
|
};
|
|
189
|
-
export type ApTableExpose = {
|
|
199
|
+
export type ApTableExpose<SearchParamsType = Recordable> = {
|
|
200
|
+
/**
|
|
201
|
+
* 查询表单提交
|
|
202
|
+
*/
|
|
190
203
|
submit: () => void;
|
|
204
|
+
/**
|
|
205
|
+
* 查询表单重置
|
|
206
|
+
*/
|
|
191
207
|
reset: () => void;
|
|
208
|
+
/**
|
|
209
|
+
* 设置查询表单的值
|
|
210
|
+
* @param fields
|
|
211
|
+
* @returns
|
|
212
|
+
*/
|
|
213
|
+
setSearchFormValues: (fields: Partial<SearchParamsType>) => void;
|
|
214
|
+
/**
|
|
215
|
+
* 获取查询表单值
|
|
216
|
+
* @returns
|
|
217
|
+
*/
|
|
218
|
+
getSearchFormValues: () => Partial<SearchParamsType>;
|
|
219
|
+
};
|
|
220
|
+
export type FixedApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = Omit<ApColumnType<ValueType, RecordType>, 'filters'> & {
|
|
221
|
+
filters?: ColumnType<RecordType>['filters'];
|
|
192
222
|
};
|