@aplus-frontend/ui 0.2.10 → 0.2.12
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/index.mjs +41 -39
- package/es/src/ap-form/ap-form.vue.d.ts +4 -0
- package/es/src/ap-form/ap-form.vue2.mjs +131 -108
- package/es/src/ap-form/drawer-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/drawer-form/index.vue.mjs +43 -37
- package/es/src/ap-form/interface.d.ts +8 -0
- package/es/src/ap-form/modal-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/modal-form/index.vue.mjs +26 -20
- package/es/src/ap-form/search-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/search-form/index.vue.mjs +37 -31
- package/es/src/ap-form/utils/params.d.ts +17 -0
- package/es/src/ap-form/utils/params.mjs +19 -0
- package/es/src/ap-list/index.vue.d.ts +1 -0
- package/es/src/ap-list/index.vue.mjs +85 -79
- package/es/src/ap-list/interface.d.ts +7 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +84 -75
- package/es/src/ap-table/interface.d.ts +1 -0
- package/es/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
- package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +80 -70
- package/es/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
- package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +44 -34
- package/es/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
- package/es/src/business/ap-group-search/extension-select/style/css.js +1 -0
- package/es/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
- package/es/src/business/ap-group-search/extension-select/style/index.js +1 -0
- package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +9 -9
- package/es/src/business/ap-group-search/index.d.ts +28 -0
- package/es/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
- package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +50 -50
- package/es/src/business/ap-group-search/popover-select/style/css.js +1 -1
- package/es/src/business/ap-group-search/popover-select/style/index.js +1 -1
- package/es/src/business/ap-image/ApImage.vue2.mjs +16 -14
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +58 -38
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +227 -0
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.mjs +4 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
- package/es/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
- package/es/src/business/ap-upload-file/hook/useInjectContext.mjs +9 -0
- package/es/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
- package/es/src/business/ap-upload-file/hook/useOss.mjs +30 -0
- package/es/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
- package/es/src/business/ap-upload-file/hook/useProps.mjs +28 -0
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +27 -0
- package/es/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
- package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +18 -0
- package/es/src/business/ap-upload-file/index.d.ts +3 -0
- package/es/src/business/ap-upload-file/index.mjs +2 -0
- package/es/src/business/ap-upload-file/interface.d.ts +29 -0
- package/es/src/business/ap-upload-file/interface.mjs +1 -0
- package/es/src/business/ap-upload-file/utils/accept.d.ts +16 -0
- package/es/src/business/ap-upload-file/utils/accept.mjs +55 -0
- package/es/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
- package/es/src/business/ap-upload-file/utils/fileList.mjs +16 -0
- package/es/src/business/ap-upload-file/utils/upload.d.ts +10 -0
- package/es/src/business/ap-upload-file/utils/upload.mjs +62 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +43 -42
- package/es/src/config-provider/config-provider.d.ts +8 -0
- package/es/src/config-provider/css-var.d.ts +8 -0
- package/es/src/config-provider/css-var.mjs +25 -9
- package/es/src/config-provider/index.d.ts +48 -0
- package/es/src/index.mjs +33 -31
- package/es/src/locale/lang/en.mjs +1 -1
- package/es/src/locale/lang/zh-cn.mjs +1 -1
- package/es/src/path-map.mjs +3 -1
- package/es/src/utils/index.d.ts +12 -0
- package/es/src/utils/index.mjs +27 -18
- package/lib/index.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +4 -0
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +8 -0
- package/lib/src/ap-form/modal-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/utils/params.d.ts +17 -0
- package/lib/src/ap-form/utils/params.js +1 -0
- package/lib/src/ap-list/index.vue.d.ts +1 -0
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-list/interface.d.ts +7 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/interface.d.ts +1 -0
- package/lib/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
- package/lib/src/business/ap-group-search/ap-group-search.vue2.js +1 -1
- package/lib/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
- package/lib/src/business/ap-group-search/extension-select/index.vue2.js +1 -1
- package/lib/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
- package/lib/src/business/ap-group-search/extension-select/style/css.js +1 -0
- package/lib/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
- package/lib/src/business/ap-group-search/extension-select/style/index.js +1 -0
- package/lib/src/business/ap-group-search/images/icon-line-select.vue.js +1 -1
- package/lib/src/business/ap-group-search/index.d.ts +28 -0
- package/lib/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
- package/lib/src/business/ap-group-search/popover-select/index.vue2.js +2 -2
- package/lib/src/business/ap-group-search/popover-select/style/css.js +1 -1
- package/lib/src/business/ap-group-search/popover-select/style/index.js +1 -1
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
- package/lib/src/business/ap-upload-file/hook/useInjectContext.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
- package/lib/src/business/ap-upload-file/hook/useOss.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
- package/lib/src/business/ap-upload-file/hook/useProps.js +1 -0
- package/lib/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
- package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -0
- package/lib/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
- package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -0
- package/lib/src/business/ap-upload-file/index.d.ts +3 -0
- package/lib/src/business/ap-upload-file/index.js +1 -0
- package/lib/src/business/ap-upload-file/interface.d.ts +29 -0
- package/lib/src/business/ap-upload-file/interface.js +1 -0
- package/lib/src/business/ap-upload-file/utils/accept.d.ts +16 -0
- package/lib/src/business/ap-upload-file/utils/accept.js +1 -0
- package/lib/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
- package/lib/src/business/ap-upload-file/utils/fileList.js +1 -0
- package/lib/src/business/ap-upload-file/utils/upload.d.ts +10 -0
- package/lib/src/business/ap-upload-file/utils/upload.js +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +8 -0
- package/lib/src/config-provider/css-var.d.ts +8 -0
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/config-provider/index.d.ts +48 -0
- package/lib/src/index.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/path-map.js +1 -1
- package/lib/src/utils/index.d.ts +12 -0
- package/lib/src/utils/index.js +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isVNode as ne, defineComponent as le, useSlots as re, ref as se, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ie, createVNode as n, Fragment as _, openBlock as m, createBlock as y, mergeProps as ue, withCtx as
|
|
2
|
-
import { Col as
|
|
1
|
+
import { isVNode as ne, defineComponent as le, useSlots as re, ref as se, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ie, createVNode as n, Fragment as _, openBlock as m, createBlock as y, mergeProps as ue, withCtx as S, resolveDynamicComponent as A, createElementBlock as ce, renderList as pe } from "vue";
|
|
2
|
+
import { Col as B, Flex as M, Space as de, Button as E, Row as fe } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../item/index.vue2.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
@@ -11,14 +11,14 @@ import { isDef as $ } from "../../utils/index.mjs";
|
|
|
11
11
|
import { diffFormItem as Ce } from "./utils.mjs";
|
|
12
12
|
import { useControllableValue as ge } from "../../hooks/useControllableValue.mjs";
|
|
13
13
|
import { useNamespace as _e } from "../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
-
import { useGlobalConfig as
|
|
15
|
-
import { useLocale as
|
|
14
|
+
import { useGlobalConfig as Be } from "../../config-provider/hooks/use-global-config.mjs";
|
|
15
|
+
import { useLocale as Fe } from "../../config-provider/hooks/use-locale.mjs";
|
|
16
16
|
import L from "../item/index.vue.mjs";
|
|
17
|
-
import
|
|
18
|
-
function
|
|
17
|
+
import Re from "../ap-form.vue2.mjs";
|
|
18
|
+
function Se(h) {
|
|
19
19
|
return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !ne(h);
|
|
20
20
|
}
|
|
21
|
-
const i = 24,
|
|
21
|
+
const i = 24, We = /* @__PURE__ */ le({
|
|
22
22
|
name: "ApFormSearchForm",
|
|
23
23
|
__name: "index",
|
|
24
24
|
props: {
|
|
@@ -65,6 +65,12 @@ const i = 24, qe = /* @__PURE__ */ le({
|
|
|
65
65
|
onFinishFailed: {},
|
|
66
66
|
onValidate: {},
|
|
67
67
|
initialValues: {},
|
|
68
|
+
syncToUrl: {
|
|
69
|
+
type: [Boolean, Function]
|
|
70
|
+
},
|
|
71
|
+
syncToUrlPriority: {
|
|
72
|
+
type: Boolean
|
|
73
|
+
},
|
|
68
74
|
collapse: {
|
|
69
75
|
type: Boolean,
|
|
70
76
|
default: void 0
|
|
@@ -98,23 +104,23 @@ const i = 24, qe = /* @__PURE__ */ le({
|
|
|
98
104
|
},
|
|
99
105
|
emits: ["update:collapse"],
|
|
100
106
|
setup(h, {
|
|
101
|
-
expose:
|
|
102
|
-
emit:
|
|
107
|
+
expose: U,
|
|
108
|
+
emit: W
|
|
103
109
|
}) {
|
|
104
110
|
var N;
|
|
105
|
-
const s = re(), a = h,
|
|
111
|
+
const s = re(), a = h, q = W, {
|
|
106
112
|
value: u,
|
|
107
|
-
updateValue:
|
|
108
|
-
} = ge(a,
|
|
113
|
+
updateValue: z
|
|
114
|
+
} = ge(a, q, {
|
|
109
115
|
valuePropName: "collapse",
|
|
110
116
|
defaultValuePropName: "defaultCollapse"
|
|
111
117
|
}), {
|
|
112
|
-
b:
|
|
113
|
-
} = _e("ap-form-search-form"), G =
|
|
118
|
+
b: H
|
|
119
|
+
} = _e("ap-form-search-form"), G = Be("uiMode"), {
|
|
114
120
|
t: b
|
|
115
|
-
} =
|
|
121
|
+
} = Fe(), C = se();
|
|
116
122
|
function J() {
|
|
117
|
-
|
|
123
|
+
z(!o(u));
|
|
118
124
|
}
|
|
119
125
|
function K() {
|
|
120
126
|
var e, t;
|
|
@@ -125,17 +131,17 @@ const i = 24, qe = /* @__PURE__ */ le({
|
|
|
125
131
|
a.customReset || (t = (e = C.value) == null ? void 0 : e.resetFields) == null || t.call(e), (l = a.onReset) == null || l.call(a);
|
|
126
132
|
}
|
|
127
133
|
let v = [];
|
|
128
|
-
const
|
|
134
|
+
const F = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / a.countPerRow));
|
|
129
135
|
j(() => s.default(), (e) => {
|
|
130
|
-
v =
|
|
136
|
+
v = F.value, F.value = Ce(v, D(e));
|
|
131
137
|
}), j(() => {
|
|
132
138
|
var e;
|
|
133
139
|
return (e = s.extra) == null ? void 0 : e.call(s);
|
|
134
140
|
}, (e) => {
|
|
135
141
|
p.value = e;
|
|
136
142
|
});
|
|
137
|
-
const X = (e) => $(e) ? (he(e) ? e : [e]).join("") : Date.now(),
|
|
138
|
-
const e =
|
|
143
|
+
const X = (e) => $(e) ? (he(e) ? e : [e]).join("") : Date.now(), R = g(() => {
|
|
144
|
+
const e = F.value, t = [], l = [], r = o(w);
|
|
139
145
|
let d = 0;
|
|
140
146
|
e.forEach((c) => {
|
|
141
147
|
const f = c.props;
|
|
@@ -168,7 +174,7 @@ const i = 24, qe = /* @__PURE__ */ le({
|
|
|
168
174
|
};
|
|
169
175
|
}), Y = g(() => {
|
|
170
176
|
let e;
|
|
171
|
-
const t = o(
|
|
177
|
+
const t = o(R), l = n(B, {
|
|
172
178
|
span: o(w),
|
|
173
179
|
key: "actionWrapper"
|
|
174
180
|
}, {
|
|
@@ -198,37 +204,37 @@ const i = 24, qe = /* @__PURE__ */ le({
|
|
|
198
204
|
}), a.extraInAction ? o(p) : null]
|
|
199
205
|
})]
|
|
200
206
|
})]
|
|
201
|
-
}), r = !a.extraInAction && o(p) ? n(
|
|
207
|
+
}), r = !a.extraInAction && o(p) ? n(B, {
|
|
202
208
|
span: o(u) ? t.actualExtraSpan : t.defaultExtraSpan,
|
|
203
209
|
key: "extraNode"
|
|
204
210
|
}, {
|
|
205
211
|
default: () => [n(L, null, {
|
|
206
212
|
default: () => [n(M, {
|
|
207
213
|
justify: !o(u) && (t.defaultExtraSpan === i || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
|
|
208
|
-
},
|
|
214
|
+
}, Se(e = o(p)) ? e : {
|
|
209
215
|
default: () => [e]
|
|
210
216
|
})]
|
|
211
217
|
})]
|
|
212
|
-
}) : null, d = n(
|
|
218
|
+
}) : null, d = n(B, {
|
|
213
219
|
span: t.defaultExtraSpan
|
|
214
220
|
}, null);
|
|
215
221
|
return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? n(_, null, [r || d, l]) : n(_, null, [l, r]);
|
|
216
222
|
});
|
|
217
|
-
return
|
|
223
|
+
return U({
|
|
218
224
|
apForm: g(() => o(C))
|
|
219
|
-
}), (e, t) => (m(), y(
|
|
220
|
-
class: o(
|
|
225
|
+
}), (e, t) => (m(), y(Re, ue({
|
|
226
|
+
class: o(H)(),
|
|
221
227
|
ref_key: "apForm",
|
|
222
228
|
ref: C
|
|
223
229
|
}, o(ye)(a, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
224
|
-
default:
|
|
230
|
+
default: S(() => [(m(), y(A(R.value.hideNode))), n(o(fe), {
|
|
225
231
|
gutter: 16
|
|
226
232
|
}, {
|
|
227
|
-
default:
|
|
233
|
+
default: S(() => [(m(!0), ce(_, null, pe(R.value.nodes, (l) => (m(), y(o(B), {
|
|
228
234
|
key: l.key,
|
|
229
235
|
span: l.span
|
|
230
236
|
}, {
|
|
231
|
-
default:
|
|
237
|
+
default: S(() => [(m(), y(A(l.node)))]),
|
|
232
238
|
_: 2
|
|
233
239
|
}, 1032, ["span"]))), 128)), (m(), y(A(Y.value)))]),
|
|
234
240
|
_: 1
|
|
@@ -238,5 +244,5 @@ const i = 24, qe = /* @__PURE__ */ le({
|
|
|
238
244
|
}
|
|
239
245
|
});
|
|
240
246
|
export {
|
|
241
|
-
|
|
247
|
+
We as default
|
|
242
248
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Recordable } from '../../type';
|
|
2
|
+
import { ApFormProps } from '../interface';
|
|
3
|
+
import { UrlParams } from '@vueuse/core';
|
|
4
|
+
/**
|
|
5
|
+
* 获取查询参数
|
|
6
|
+
* @param syncToUrl
|
|
7
|
+
* @param params
|
|
8
|
+
* @param type
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function genParams(syncToUrl: ApFormProps['syncToUrl'], params: Recordable, type: 'get' | 'set'): any;
|
|
12
|
+
/**
|
|
13
|
+
* 设置表单数据到url查询参数(覆盖模式)
|
|
14
|
+
* @param ins
|
|
15
|
+
* @param params
|
|
16
|
+
*/
|
|
17
|
+
export declare function setToParams(ins: UrlParams, params: Recordable): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { runFunction as r } from "../../utils/index.mjs";
|
|
2
|
+
function u(o, t, e) {
|
|
3
|
+
return o === !0 ? t : r(o, t, e);
|
|
4
|
+
}
|
|
5
|
+
function c(o) {
|
|
6
|
+
const t = Object.keys(o);
|
|
7
|
+
for (const e of t)
|
|
8
|
+
o[e] = null;
|
|
9
|
+
}
|
|
10
|
+
function i(o, t) {
|
|
11
|
+
c(o);
|
|
12
|
+
const e = Object.keys(t);
|
|
13
|
+
for (const n of e)
|
|
14
|
+
t[n] != null && (o[n] = t[n]);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
u as genParams,
|
|
18
|
+
i as setToParams
|
|
19
|
+
};
|
|
@@ -10,6 +10,7 @@ declare const _default: <RecordType extends Recordable>(__VLS_props: NonNullable
|
|
|
10
10
|
refresh: () => void;
|
|
11
11
|
refreshByDelete: (n: number) => void;
|
|
12
12
|
scrollToFirstRow: (selector?: string) => void;
|
|
13
|
+
getSearchFormValuesIfSetted: (transform?: boolean) => Partial<any>;
|
|
13
14
|
}>): void;
|
|
14
15
|
attrs: any;
|
|
15
16
|
slots: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Empty as
|
|
1
|
+
import { defineComponent as M, ref as W, unref as t, computed as l, watch as j, openBlock as s, createBlock as A, normalizeClass as u, withCtx as G, createElementVNode as U, normalizeStyle as D, renderSlot as f, createVNode as k, createElementBlock as g, Fragment as H, renderList as J, mergeProps as K, createCommentVNode as Q } from "vue";
|
|
2
|
+
import { Empty as B, Spin as X, Pagination as Y } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-table/index.mjs";
|
|
4
4
|
import "../config-provider/index.mjs";
|
|
5
|
-
import { isUndefined as
|
|
6
|
-
import { useOfflineList as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import { useTablePaging as
|
|
9
|
-
const
|
|
5
|
+
import { isUndefined as E, omit as Z } from "lodash-unified";
|
|
6
|
+
import { useOfflineList as x } from "./hooks/use-offline-list.mjs";
|
|
7
|
+
import { useNamespace as ee } from "../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
import { useTablePaging as te } from "../ap-table/hooks/use-table-paging.mjs";
|
|
9
|
+
const fe = /* @__PURE__ */ M({
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
12
12
|
dataSource: {},
|
|
@@ -22,111 +22,117 @@ const ue = /* @__PURE__ */ F({
|
|
|
22
22
|
containerStyle: {},
|
|
23
23
|
footerWarpperStyle: {}
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
formRef:
|
|
28
|
-
submit:
|
|
29
|
-
reset:
|
|
25
|
+
setup(w, { expose: V }) {
|
|
26
|
+
const F = B.PRESENTED_IMAGE_SIMPLE, n = w, { b: p, e: S } = ee("ap-list"), h = W(), {
|
|
27
|
+
formRef: y,
|
|
28
|
+
submit: v,
|
|
29
|
+
reset: b,
|
|
30
30
|
handleTableChange: L,
|
|
31
|
-
data:
|
|
32
|
-
refresh:
|
|
33
|
-
refreshByDelete:
|
|
34
|
-
tableProps:
|
|
35
|
-
} =
|
|
31
|
+
data: c,
|
|
32
|
+
refresh: T,
|
|
33
|
+
refreshByDelete: z,
|
|
34
|
+
tableProps: C
|
|
35
|
+
} = te({
|
|
36
36
|
async request(a) {
|
|
37
37
|
var o;
|
|
38
|
-
const
|
|
38
|
+
const e = await ((o = n.request) == null ? void 0 : o.call(n, a));
|
|
39
39
|
return {
|
|
40
|
-
data: (
|
|
41
|
-
total: (
|
|
40
|
+
data: (e == null ? void 0 : e.data) || [],
|
|
41
|
+
total: (e == null ? void 0 : e.total) || 0
|
|
42
42
|
};
|
|
43
43
|
},
|
|
44
|
-
defaultParams:
|
|
45
|
-
defaultData:
|
|
46
|
-
manual:
|
|
47
|
-
defaultCurrent:
|
|
48
|
-
defaultPageSize:
|
|
49
|
-
formatParams:
|
|
50
|
-
}),
|
|
51
|
-
pagination:
|
|
52
|
-
dataSource:
|
|
53
|
-
onChange:
|
|
54
|
-
} =
|
|
55
|
-
function
|
|
56
|
-
if (
|
|
57
|
-
|
|
44
|
+
defaultParams: n.params,
|
|
45
|
+
defaultData: n.defaultData,
|
|
46
|
+
manual: n.manual,
|
|
47
|
+
defaultCurrent: n.pagination ? n.pagination.defaultCurrent : void 0,
|
|
48
|
+
defaultPageSize: n.pagination ? n.pagination.defaultPageSize : void 0,
|
|
49
|
+
formatParams: n.beforeSearchSubmit
|
|
50
|
+
}), I = { form: y }, {
|
|
51
|
+
pagination: P,
|
|
52
|
+
dataSource: N,
|
|
53
|
+
onChange: R
|
|
54
|
+
} = x(n);
|
|
55
|
+
function q(a, e) {
|
|
56
|
+
if (t(r)) {
|
|
57
|
+
R(a, e);
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
L(
|
|
61
|
-
{ current: a, pageSize:
|
|
61
|
+
{ current: a, pageSize: e },
|
|
62
62
|
{},
|
|
63
63
|
{},
|
|
64
64
|
{ currentDataSource: [], action: "paginate" }
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
|
-
const
|
|
68
|
-
var a,
|
|
69
|
-
return
|
|
70
|
-
}), r =
|
|
71
|
-
|
|
72
|
-
() =>
|
|
67
|
+
const d = l(() => t(r) ? t(N) : t(c).records), m = l(() => E(n.loading) ? t(c).loading : n.loading), O = l(() => {
|
|
68
|
+
var a, e;
|
|
69
|
+
return n.pagination === !1 ? !1 : ((a = n.pagination) == null ? void 0 : a.hideOnSinglePage) !== !0 ? !0 : t(r) ? (((e = n.dataSource) == null ? void 0 : e.length) || 0) > t(P).pageSize : t(c).total > t(C).pagination.pageSize;
|
|
70
|
+
}), r = l(() => !E(n.dataSource));
|
|
71
|
+
j(
|
|
72
|
+
() => t(m),
|
|
73
73
|
(a) => {
|
|
74
|
-
var
|
|
75
|
-
(
|
|
74
|
+
var e;
|
|
75
|
+
(e = n.onLoadingChange) == null || e.call(n, a);
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
function _(a) {
|
|
79
|
-
var
|
|
80
|
-
(o = (
|
|
79
|
+
var e, o;
|
|
80
|
+
(o = (e = h.value) == null ? void 0 : e.querySelector(a || ":first-child")) == null || o.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
function $(a = !1) {
|
|
83
|
+
var i;
|
|
84
|
+
const e = (i = y.value) == null ? void 0 : i.apForm, o = a ? e == null ? void 0 : e.getFieldsValueTransformed : e == null ? void 0 : e.getFieldsValue;
|
|
85
|
+
return (o == null ? void 0 : o()) || {};
|
|
86
|
+
}
|
|
87
|
+
return V({
|
|
88
|
+
submit: () => v(),
|
|
89
|
+
reset: () => b(),
|
|
90
|
+
refresh: () => T(),
|
|
91
|
+
refreshByDelete: (a) => z(a),
|
|
92
|
+
scrollToFirstRow: _,
|
|
93
|
+
getSearchFormValuesIfSetted: $
|
|
94
|
+
}), (a, e) => (s(), A(t(X), {
|
|
95
|
+
spinning: m.value,
|
|
96
|
+
class: u(t(p)("spin"))
|
|
91
97
|
}, {
|
|
92
|
-
default:
|
|
93
|
-
|
|
94
|
-
class:
|
|
95
|
-
style:
|
|
98
|
+
default: G(() => [
|
|
99
|
+
U("div", {
|
|
100
|
+
class: u(t(p)()),
|
|
101
|
+
style: D(a.containerStyle)
|
|
96
102
|
}, [
|
|
97
|
-
|
|
98
|
-
formIns:
|
|
99
|
-
submit:
|
|
100
|
-
reset:
|
|
103
|
+
f(a.$slots, "header", {
|
|
104
|
+
formIns: I,
|
|
105
|
+
submit: t(v),
|
|
106
|
+
reset: t(b)
|
|
101
107
|
}),
|
|
102
|
-
|
|
108
|
+
d.value.length === 0 ? f(a.$slots, "empty", {
|
|
103
109
|
key: 0,
|
|
104
|
-
loading:
|
|
110
|
+
loading: m.value
|
|
105
111
|
}, () => [
|
|
106
|
-
|
|
107
|
-
]) : (
|
|
112
|
+
k(t(B), { image: t(F) }, null, 8, ["image"])
|
|
113
|
+
]) : (s(), g("div", {
|
|
108
114
|
key: 1,
|
|
109
115
|
ref_key: "contentRef",
|
|
110
|
-
ref:
|
|
111
|
-
class:
|
|
116
|
+
ref: h,
|
|
117
|
+
class: u(t(S)("content"))
|
|
112
118
|
}, [
|
|
113
|
-
|
|
114
|
-
(
|
|
119
|
+
f(a.$slots, "renderContent", { dataSource: d.value }, () => [
|
|
120
|
+
(s(!0), g(H, null, J(d.value, (o, i) => f(a.$slots, "renderItem", {
|
|
115
121
|
item: o,
|
|
116
|
-
index:
|
|
122
|
+
index: i
|
|
117
123
|
})), 256))
|
|
118
124
|
])
|
|
119
125
|
], 2)),
|
|
120
|
-
|
|
126
|
+
O.value ? (s(), g("div", {
|
|
121
127
|
key: 2,
|
|
122
|
-
class:
|
|
123
|
-
style:
|
|
128
|
+
class: u(t(S)("footer")),
|
|
129
|
+
style: D(a.footerWarpperStyle)
|
|
124
130
|
}, [
|
|
125
|
-
|
|
126
|
-
r.value ?
|
|
127
|
-
{ onChange:
|
|
131
|
+
k(t(Y), K(
|
|
132
|
+
r.value ? t(P) : t(Z)(t(C).pagination, ["showTotal"]),
|
|
133
|
+
{ onChange: q }
|
|
128
134
|
), null, 16)
|
|
129
|
-
], 6)) :
|
|
135
|
+
], 6)) : Q("", !0)
|
|
130
136
|
], 6)
|
|
131
137
|
]),
|
|
132
138
|
_: 3
|
|
@@ -134,5 +140,5 @@ const ue = /* @__PURE__ */ F({
|
|
|
134
140
|
}
|
|
135
141
|
});
|
|
136
142
|
export {
|
|
137
|
-
|
|
143
|
+
fe as default
|
|
138
144
|
};
|
|
@@ -96,4 +96,11 @@ export type ApListExpose = {
|
|
|
96
96
|
* @returns
|
|
97
97
|
*/
|
|
98
98
|
scrollToFirstRow: (selector?: string) => void;
|
|
99
|
+
/**
|
|
100
|
+
* 获取查询表单的值
|
|
101
|
+
* @description 只有在自定义查询表单并且绑定了formRef才能获取到查询表单的值
|
|
102
|
+
* @param transform 是否获取转换后的值,默认为`false`
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
getSearchFormValuesIfSetted: (transform?: boolean) => Recordable;
|
|
99
106
|
};
|
|
@@ -1,118 +1,127 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isDef as
|
|
3
|
-
import
|
|
4
|
-
import { useInjectApTable as
|
|
5
|
-
import { isObject as B, mergeWith as E, isBoolean as
|
|
6
|
-
function a(
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
n(o), (
|
|
1
|
+
import { ref as j, shallowRef as z, unref as d, computed as D, watchEffect as G } from "vue";
|
|
2
|
+
import { isDef as W } from "../../utils/index.mjs";
|
|
3
|
+
import X, { customCloneColumnStates as A, getColumnStateString as q } from "../components/setting/utils.mjs";
|
|
4
|
+
import { useInjectApTable as H } from "../context.mjs";
|
|
5
|
+
import { isObject as B, mergeWith as E, isBoolean as L, omit as P, isNumber as N } from "lodash-unified";
|
|
6
|
+
function a(t, n) {
|
|
7
|
+
t.forEach((o) => {
|
|
8
|
+
var i;
|
|
9
|
+
n(o), (i = o.children) != null && i.length && a(o.children, n);
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Q(t, n) {
|
|
13
13
|
if (!n)
|
|
14
14
|
return {};
|
|
15
|
-
const o =
|
|
15
|
+
const o = t.getItem(n);
|
|
16
16
|
return o ? JSON.parse(o) : {};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
if (B(
|
|
20
|
-
return E({},
|
|
18
|
+
function F(t, n) {
|
|
19
|
+
if (B(t) && B(n))
|
|
20
|
+
return E({}, t, n, F);
|
|
21
21
|
}
|
|
22
|
-
const b = Number.MAX_SAFE_INTEGER
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
const b = Number.MAX_SAFE_INTEGER;
|
|
23
|
+
function U(t, n, o, i) {
|
|
24
|
+
return i ? i.fixed : n ? n.fixed : o && "fixed" in o ? o.fixed : L(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
|
|
25
|
+
}
|
|
26
|
+
const te = (t, n) => {
|
|
27
|
+
const o = j(n), i = z(
|
|
28
|
+
A(n)
|
|
29
|
+
), { columnsBackup: p, updateColumns: l } = H(), I = t.persistenceType || "localStorage", x = window[I];
|
|
30
|
+
function T() {
|
|
31
|
+
const e = Q(
|
|
32
|
+
x,
|
|
33
|
+
t.persistenceKey
|
|
34
|
+
), r = E(
|
|
31
35
|
{},
|
|
32
|
-
|
|
36
|
+
t.defaultValue || {},
|
|
33
37
|
e,
|
|
34
|
-
|
|
35
|
-
), s =
|
|
36
|
-
function
|
|
37
|
-
return R.map((
|
|
38
|
-
var
|
|
39
|
-
const
|
|
40
|
-
key:
|
|
41
|
-
label:
|
|
38
|
+
F
|
|
39
|
+
), s = d(p);
|
|
40
|
+
function c(R, u, _) {
|
|
41
|
+
return R.map((f) => {
|
|
42
|
+
var k, v;
|
|
43
|
+
const w = (u == null ? void 0 : u[f.key]) || {}, h = {
|
|
44
|
+
key: f.key,
|
|
45
|
+
label: f.title,
|
|
42
46
|
show: !0,
|
|
43
|
-
fixed:
|
|
47
|
+
fixed: U(
|
|
48
|
+
f,
|
|
49
|
+
e[f.key],
|
|
50
|
+
(k = t.defaultValue) == null ? void 0 : k[f.key],
|
|
51
|
+
_
|
|
52
|
+
),
|
|
44
53
|
disabled: !1,
|
|
45
|
-
...
|
|
54
|
+
...P(w, ["children", "fixed"])
|
|
46
55
|
};
|
|
47
|
-
return h.children = (
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
return h.children = (v = f.children) != null && v.length ? c(
|
|
57
|
+
f.children,
|
|
58
|
+
w.children,
|
|
50
59
|
h
|
|
51
60
|
) : void 0, h;
|
|
52
61
|
}).sort(O);
|
|
53
62
|
}
|
|
54
|
-
return
|
|
63
|
+
return c(s || [], r);
|
|
55
64
|
}
|
|
56
|
-
function O(e,
|
|
65
|
+
function O(e, r) {
|
|
57
66
|
const s = N(e.order) ? e.order : b;
|
|
58
|
-
let
|
|
59
|
-
return e.fixed === "right" &&
|
|
67
|
+
let c = N(r.order) ? r.order : b;
|
|
68
|
+
return e.fixed === "right" && r.fixed !== "right" && (c = s - 1), r.fixed === "left" && e.fixed !== "left" && (c = s - 1), s - c;
|
|
60
69
|
}
|
|
61
|
-
const
|
|
62
|
-
function
|
|
63
|
-
const e =
|
|
64
|
-
a(e, (
|
|
65
|
-
!
|
|
70
|
+
const g = D(() => d(o).every((e) => e.show));
|
|
71
|
+
function C() {
|
|
72
|
+
const e = d(o);
|
|
73
|
+
a(e, (r) => {
|
|
74
|
+
!r.disabled && (r.show = !0);
|
|
66
75
|
});
|
|
67
76
|
}
|
|
68
|
-
function
|
|
69
|
-
const e =
|
|
70
|
-
a(e, (
|
|
71
|
-
!
|
|
77
|
+
function y() {
|
|
78
|
+
const e = d(o);
|
|
79
|
+
a(e, (r) => {
|
|
80
|
+
!r.disabled && (r.show = !1);
|
|
72
81
|
});
|
|
73
82
|
}
|
|
74
83
|
function K() {
|
|
75
|
-
|
|
84
|
+
d(g) ? y() : C();
|
|
76
85
|
}
|
|
77
|
-
function J(e,
|
|
78
|
-
a(
|
|
79
|
-
s.key === e && (s.show =
|
|
86
|
+
function J(e, r) {
|
|
87
|
+
a(d(o), (s) => {
|
|
88
|
+
s.key === e && (s.show = W(r) ? r : !s.show);
|
|
80
89
|
});
|
|
81
90
|
}
|
|
82
|
-
function
|
|
91
|
+
function S(e) {
|
|
83
92
|
o.value = e;
|
|
84
93
|
}
|
|
85
94
|
function M(e) {
|
|
86
|
-
|
|
95
|
+
i.value = e;
|
|
87
96
|
}
|
|
88
|
-
function
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
|
|
97
|
+
function m(e) {
|
|
98
|
+
if (t.persistenceKey) {
|
|
99
|
+
const r = q(e);
|
|
100
|
+
x.setItem(t.persistenceKey, JSON.stringify(r));
|
|
92
101
|
}
|
|
93
102
|
}
|
|
94
|
-
return
|
|
95
|
-
var
|
|
96
|
-
const e =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
return G(() => {
|
|
104
|
+
var r;
|
|
105
|
+
const e = T();
|
|
106
|
+
S(e), (r = t.onChange) == null || r.call(t, e), l == null || l(
|
|
107
|
+
X(
|
|
108
|
+
d(p),
|
|
109
|
+
d(e)
|
|
101
110
|
)
|
|
102
|
-
),
|
|
111
|
+
), i.value = A(e), m(e);
|
|
103
112
|
}), {
|
|
104
113
|
columnState: o,
|
|
105
|
-
selectAll:
|
|
106
|
-
unSelectAll:
|
|
114
|
+
selectAll: C,
|
|
115
|
+
unSelectAll: y,
|
|
107
116
|
toggleSelect: J,
|
|
108
|
-
setColumnState:
|
|
109
|
-
isAllSelected:
|
|
117
|
+
setColumnState: S,
|
|
118
|
+
isAllSelected: g,
|
|
110
119
|
toggleSelectAll: K,
|
|
111
|
-
columnStateBackup:
|
|
120
|
+
columnStateBackup: i,
|
|
112
121
|
setColumnStateBackup: M,
|
|
113
|
-
cacheColumnStateIfNeeded:
|
|
122
|
+
cacheColumnStateIfNeeded: m
|
|
114
123
|
};
|
|
115
124
|
};
|
|
116
125
|
export {
|
|
117
|
-
|
|
126
|
+
te as useTableColumnState
|
|
118
127
|
};
|