@aplus-frontend/ui 0.4.0 → 0.4.1
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/modal-form/index.vue.mjs +58 -54
- package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/es/src/business/hooks/usePageListApTable.mjs +31 -31
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Button as V, Flex as
|
|
1
|
+
import { isVNode as D, defineComponent as L, useSlots as A, ref as p, watch as G, cloneVNode as I, computed as K, createVNode as u, mergeProps as b, unref as n, openBlock as g, createElementBlock as W, Fragment as H, withCtx as F, renderSlot as w, createTextVNode as J, toDisplayString as Q, createElementVNode as X, normalizeClass as Y, createBlock as x, resolveDynamicComponent as N, createCommentVNode as Z } from "vue";
|
|
2
|
+
import { Button as V, Flex as ee, Space as te, Modal as le } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { getSingleVNode as
|
|
5
|
+
import { getSingleVNode as oe } from "../../utils/slot.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import { omit as
|
|
8
|
-
import { useControllableValue as
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useGlobalConfig as
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
import
|
|
13
|
-
function
|
|
14
|
-
return typeof c == "function" || Object.prototype.toString.call(c) === "[object Object]" && !
|
|
7
|
+
import { omit as ae } from "lodash-unified";
|
|
8
|
+
import { useControllableValue as ne } from "../../hooks/useControllableValue.mjs";
|
|
9
|
+
import { useLocale as se } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useGlobalConfig as ie } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
import ue from "../ap-form.vue2.mjs";
|
|
13
|
+
function S(c) {
|
|
14
|
+
return typeof c == "function" || Object.prototype.toString.call(c) === "[object Object]" && !D(c);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const _e = /* @__PURE__ */ L({
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
19
19
|
layout: {
|
|
@@ -91,30 +91,33 @@ const Se = /* @__PURE__ */ D({
|
|
|
91
91
|
},
|
|
92
92
|
emits: ["update:open"],
|
|
93
93
|
setup(c, {
|
|
94
|
-
expose:
|
|
95
|
-
emit:
|
|
94
|
+
expose: _,
|
|
95
|
+
emit: M
|
|
96
96
|
}) {
|
|
97
|
-
const o = c,
|
|
98
|
-
value:
|
|
97
|
+
const o = c, y = A(), R = M, a = p(), C = p(0), m = p(), i = p(!1), {
|
|
98
|
+
value: U,
|
|
99
99
|
updateValue: f
|
|
100
|
-
} =
|
|
100
|
+
} = ne(o, R, {
|
|
101
101
|
valuePropName: "open",
|
|
102
|
-
defaultValue: !1
|
|
102
|
+
defaultValue: !1,
|
|
103
|
+
beforeUpdateValue(e) {
|
|
104
|
+
return e && (C.value += 1), !0;
|
|
105
|
+
}
|
|
103
106
|
}), {
|
|
104
107
|
t: v
|
|
105
|
-
} =
|
|
108
|
+
} = se(), h = ie("uiMode", "aplus"), {
|
|
106
109
|
b: j,
|
|
107
|
-
e:
|
|
108
|
-
} =
|
|
109
|
-
|
|
110
|
+
e: T
|
|
111
|
+
} = re("ap-form-modal-form");
|
|
112
|
+
G(() => a.value, (e) => {
|
|
110
113
|
var t;
|
|
111
114
|
e && m.value && ((t = e.setFieldsValue) == null || t.call(e, m.value), m.value = void 0);
|
|
112
115
|
});
|
|
113
|
-
const
|
|
116
|
+
const B = oe(y.trigger), k = B ? I(B, {
|
|
114
117
|
onClick: () => {
|
|
115
118
|
f(!0);
|
|
116
119
|
}
|
|
117
|
-
}) : null, O =
|
|
120
|
+
}) : null, O = K(() => {
|
|
118
121
|
var t, l, r, d;
|
|
119
122
|
const e = [];
|
|
120
123
|
if (o.submitter === !1)
|
|
@@ -122,23 +125,23 @@ const Se = /* @__PURE__ */ D({
|
|
|
122
125
|
if (o.showCancel) {
|
|
123
126
|
let s;
|
|
124
127
|
e.push(u(V, {
|
|
125
|
-
onClick:
|
|
128
|
+
onClick: P,
|
|
126
129
|
disabled: i.value
|
|
127
|
-
},
|
|
130
|
+
}, S(s = v("ap.common.cancelText")) ? s : {
|
|
128
131
|
default: () => [s]
|
|
129
132
|
}));
|
|
130
133
|
}
|
|
131
|
-
return ((t = o.submitter) == null ? void 0 : t.resetButtonProps) !== !1 && e.push(u(V,
|
|
134
|
+
return ((t = o.submitter) == null ? void 0 : t.resetButtonProps) !== !1 && e.push(u(V, b(((l = o.submitter) == null ? void 0 : l.resetButtonProps) || {}, {
|
|
132
135
|
key: "reset",
|
|
133
136
|
disabled: i.value,
|
|
134
|
-
onClick:
|
|
137
|
+
onClick: z,
|
|
135
138
|
htmlType: "reset"
|
|
136
139
|
}), {
|
|
137
140
|
default: () => {
|
|
138
141
|
var s;
|
|
139
142
|
return [((s = o.submitter) == null ? void 0 : s.resetText) || v("ap.common.resetText")];
|
|
140
143
|
}
|
|
141
|
-
})), ((r = o.submitter) == null ? void 0 : r.submitButtonProps) !== !1 && e.push(u(V,
|
|
144
|
+
})), ((r = o.submitter) == null ? void 0 : r.submitButtonProps) !== !1 && e.push(u(V, b({
|
|
142
145
|
type: "primary",
|
|
143
146
|
key: "submit",
|
|
144
147
|
htmlType: "submit"
|
|
@@ -149,29 +152,30 @@ const Se = /* @__PURE__ */ D({
|
|
|
149
152
|
var s;
|
|
150
153
|
return [((s = o.submitter) == null ? void 0 : s.submitText) || v("ap.common.okText")];
|
|
151
154
|
}
|
|
152
|
-
})), u(
|
|
155
|
+
})), u(ee, {
|
|
153
156
|
justify: "flex-end",
|
|
154
|
-
|
|
157
|
+
key: n(C),
|
|
158
|
+
class: T(n(h) === "admin" ? "footer-admin" : "footer")
|
|
155
159
|
}, {
|
|
156
|
-
default: () => [
|
|
160
|
+
default: () => [y.submitter ? y.submitter(e) : u(te, null, S(e) ? e : {
|
|
157
161
|
default: () => [e]
|
|
158
162
|
})]
|
|
159
163
|
});
|
|
160
164
|
});
|
|
161
|
-
function
|
|
165
|
+
function z() {
|
|
162
166
|
var e, t, l;
|
|
163
167
|
o.submitter !== !1 && ((e = a.value) == null || e.resetFields(), (l = (t = o.submitter) == null ? void 0 : t.onReset) == null || l.call(t));
|
|
164
168
|
}
|
|
165
|
-
async function
|
|
169
|
+
async function E(e) {
|
|
166
170
|
var t, l, r;
|
|
167
171
|
if (o.submitter !== !1)
|
|
168
172
|
try {
|
|
169
173
|
(l = (t = o.submitter) == null ? void 0 : t.onSubmit) == null || l.call(t), i.value = !0;
|
|
170
174
|
const d = (r = o.onFinish) == null ? void 0 : r.call(o, e);
|
|
171
175
|
if (o.submitTimeout && d instanceof Promise) {
|
|
172
|
-
const
|
|
176
|
+
const q = setTimeout(() => i.value = !1, o.submitTimeout);
|
|
173
177
|
d.finally(() => {
|
|
174
|
-
clearTimeout(
|
|
178
|
+
clearTimeout(q), i.value = !1;
|
|
175
179
|
});
|
|
176
180
|
}
|
|
177
181
|
await d && f(!1);
|
|
@@ -179,13 +183,13 @@ const Se = /* @__PURE__ */ D({
|
|
|
179
183
|
i.value = !1;
|
|
180
184
|
}
|
|
181
185
|
}
|
|
182
|
-
function
|
|
186
|
+
function P() {
|
|
183
187
|
n(i) || f(!1);
|
|
184
188
|
}
|
|
185
|
-
function
|
|
189
|
+
function $(e) {
|
|
186
190
|
!e && n(i) || f(e);
|
|
187
191
|
}
|
|
188
|
-
return
|
|
192
|
+
return _({
|
|
189
193
|
resetFields: () => {
|
|
190
194
|
var e;
|
|
191
195
|
(e = a.value) == null || e.resetFields();
|
|
@@ -228,39 +232,39 @@ const Se = /* @__PURE__ */ D({
|
|
|
228
232
|
}
|
|
229
233
|
}), (e, t) => {
|
|
230
234
|
var l;
|
|
231
|
-
return g(), W(H, null, [u(n(
|
|
232
|
-
open: n(
|
|
235
|
+
return g(), W(H, null, [u(n(le), b(e.modalProps, {
|
|
236
|
+
open: n(U),
|
|
233
237
|
footer: null,
|
|
234
238
|
width: e.width,
|
|
235
239
|
class: n(j)(),
|
|
236
240
|
"body-style": {
|
|
237
241
|
...((l = e.modalProps) == null ? void 0 : l.bodyStyle) || {},
|
|
238
|
-
padding: n(
|
|
242
|
+
padding: n(h) === "admin" ? "0px !important" : "20px !important"
|
|
239
243
|
// 这里使用内联样式目的是为了使用最高优先级覆盖设置的全局样式
|
|
240
244
|
// 使用ModalForm你可能无法再自定义body的样式
|
|
241
245
|
},
|
|
242
|
-
"onUpdate:open":
|
|
243
|
-
onCancel:
|
|
246
|
+
"onUpdate:open": $,
|
|
247
|
+
onCancel: P
|
|
244
248
|
}), {
|
|
245
|
-
title: F(() => [
|
|
246
|
-
default: F(() => [u(
|
|
249
|
+
title: F(() => [w(e.$slots, "title", {}, () => [J(Q(o.title), 1)])]),
|
|
250
|
+
default: F(() => [u(ue, b({
|
|
247
251
|
ref_key: "formRef",
|
|
248
252
|
ref: a
|
|
249
|
-
}, n(
|
|
250
|
-
onFinish:
|
|
253
|
+
}, n(ae)(o, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"]), {
|
|
254
|
+
onFinish: E
|
|
251
255
|
}), {
|
|
252
|
-
default: F(() => [
|
|
253
|
-
class:
|
|
254
|
-
}, [
|
|
256
|
+
default: F(() => [X("div", {
|
|
257
|
+
class: Y(n(T)(n(h) === "admin" ? "content-admin" : "content"))
|
|
258
|
+
}, [w(e.$slots, "default")], 2), (g(), x(N(O.value)))]),
|
|
255
259
|
_: 3
|
|
256
260
|
}, 16)]),
|
|
257
261
|
_: 3
|
|
258
|
-
}, 16, ["open", "width", "class", "body-style"]), n(
|
|
262
|
+
}, 16, ["open", "width", "class", "body-style"]), n(k) ? (g(), x(N(n(k)), {
|
|
259
263
|
key: 0
|
|
260
|
-
})) :
|
|
264
|
+
})) : Z("", !0)], 64);
|
|
261
265
|
};
|
|
262
266
|
}
|
|
263
267
|
});
|
|
264
268
|
export {
|
|
265
|
-
|
|
269
|
+
_e as default
|
|
266
270
|
};
|
|
@@ -30,7 +30,7 @@ export interface UsePageListApTable extends ApTableProps {
|
|
|
30
30
|
export declare function usePageListApTable(props?: UsePageListApTable): [ApTableProps, {
|
|
31
31
|
reload: () => void;
|
|
32
32
|
reset: () => void;
|
|
33
|
-
getSearchFormValues: () => any;
|
|
33
|
+
getSearchFormValues: (transform: boolean) => any;
|
|
34
34
|
getApTableInstance: () => {
|
|
35
35
|
submit: () => void;
|
|
36
36
|
reset: () => void;
|
|
@@ -50,6 +50,6 @@ export declare function usePageListApTable(props?: UsePageListApTable): [ApTable
|
|
|
50
50
|
} | undefined;
|
|
51
51
|
getShownColumns: () => TableColumnsType<any>;
|
|
52
52
|
} | null | undefined;
|
|
53
|
-
getSearchFormValuesAndSorted: () => any;
|
|
53
|
+
getSearchFormValuesAndSorted: (transform: boolean) => any;
|
|
54
54
|
clearSelection: () => void;
|
|
55
55
|
}];
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { merge as d, cloneDeep as h } from "lodash-unified";
|
|
2
2
|
import { ref as S } from "vue";
|
|
3
3
|
import { useTableRefresh as b } from "./useTableRefresh.mjs";
|
|
4
|
-
function g(
|
|
5
|
-
return
|
|
4
|
+
function g(s) {
|
|
5
|
+
return s === !0 ? {} : s === !1 ? {
|
|
6
6
|
refreshBefore: () => !1
|
|
7
|
-
} :
|
|
7
|
+
} : s;
|
|
8
8
|
}
|
|
9
|
-
function I(
|
|
10
|
-
const
|
|
9
|
+
function I(s) {
|
|
10
|
+
const o = S(null), {
|
|
11
11
|
isShowRowSelection: u = !0,
|
|
12
12
|
clearSelectionOnRequest: i = !0,
|
|
13
|
-
transformSearchFormValues:
|
|
14
|
-
api:
|
|
13
|
+
transformSearchFormValues: a,
|
|
14
|
+
api: l,
|
|
15
15
|
tableRefresh: f = !1,
|
|
16
16
|
...m
|
|
17
|
-
} =
|
|
18
|
-
let
|
|
17
|
+
} = s || {};
|
|
18
|
+
let n = null;
|
|
19
19
|
const c = () => {
|
|
20
20
|
var e, r;
|
|
21
|
-
(r = (e =
|
|
21
|
+
(r = (e = o.value) == null ? void 0 : e.rowSelection) == null || r.clearAll();
|
|
22
22
|
};
|
|
23
23
|
return b({
|
|
24
24
|
...g(f),
|
|
25
|
-
apTableRef:
|
|
25
|
+
apTableRef: o
|
|
26
26
|
}), [d(
|
|
27
27
|
{
|
|
28
28
|
// scroll,tableLayout,columnResizable设置表格可拖动
|
|
@@ -31,18 +31,18 @@ function I(a) {
|
|
|
31
31
|
columnResizable: !0,
|
|
32
32
|
// 表格header吸顶效果
|
|
33
33
|
class: "ap-table--sticky",
|
|
34
|
-
request:
|
|
35
|
-
|
|
36
|
-
const r =
|
|
34
|
+
request: l ? async (e) => {
|
|
35
|
+
n = e.sort;
|
|
36
|
+
const r = a ? a(e) : e;
|
|
37
37
|
try {
|
|
38
|
-
if (!
|
|
39
|
-
const { records:
|
|
38
|
+
if (!l) throw new Error("api is not defined");
|
|
39
|
+
const { records: t, total: p } = await l(r);
|
|
40
40
|
return i && c(), {
|
|
41
|
-
data:
|
|
41
|
+
data: t,
|
|
42
42
|
total: p
|
|
43
43
|
};
|
|
44
|
-
} catch (
|
|
45
|
-
return console.error(
|
|
44
|
+
} catch (t) {
|
|
45
|
+
return console.error(t), {
|
|
46
46
|
data: [],
|
|
47
47
|
total: 0
|
|
48
48
|
};
|
|
@@ -54,29 +54,29 @@ function I(a) {
|
|
|
54
54
|
columnWidth: 50
|
|
55
55
|
} : void 0,
|
|
56
56
|
ref(e) {
|
|
57
|
-
|
|
57
|
+
o.value = e;
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
m
|
|
61
61
|
), {
|
|
62
62
|
reload: () => {
|
|
63
63
|
var e;
|
|
64
|
-
(e =
|
|
64
|
+
(e = o.value) == null || e.submit();
|
|
65
65
|
},
|
|
66
66
|
reset: () => {
|
|
67
67
|
var e;
|
|
68
|
-
(e =
|
|
68
|
+
(e = o.value) == null || e.reset();
|
|
69
69
|
},
|
|
70
|
-
getSearchFormValues: () => {
|
|
71
|
-
var
|
|
72
|
-
const
|
|
73
|
-
return
|
|
70
|
+
getSearchFormValues: (e) => {
|
|
71
|
+
var t;
|
|
72
|
+
const r = ((t = o.value) == null ? void 0 : t.getSearchFormValues(e)) || {};
|
|
73
|
+
return a ? a(r) : r;
|
|
74
74
|
},
|
|
75
|
-
getApTableInstance: () =>
|
|
76
|
-
getSearchFormValuesAndSorted: () => {
|
|
77
|
-
var
|
|
78
|
-
const
|
|
79
|
-
return
|
|
75
|
+
getApTableInstance: () => o.value,
|
|
76
|
+
getSearchFormValuesAndSorted: (e) => {
|
|
77
|
+
var t;
|
|
78
|
+
const r = ((t = o.value) == null ? void 0 : t.getSearchFormValues(e)) || {};
|
|
79
|
+
return r.sort = n && h(n), a ? a(r) : r;
|
|
80
80
|
},
|
|
81
81
|
clearSelection: c
|
|
82
82
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../../hooks/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../../hooks/index.js");const M=require("../../utils/slot.js");require("../../config-provider/index.js");const U=require("lodash-unified"),j=require("../../hooks/useControllableValue.js"),O=require("../../config-provider/hooks/use-locale.js"),R=require("../../config-provider/hooks/use-global-config.js"),z=require("../../config-provider/hooks/use-namespace.js"),D=require("../ap-form.vue2.js");function C(c){return typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!e.isVNode(c)}const E=e.defineComponent({__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},open:{type:Boolean,default:void 0},"onUpdate:open":{},modalProps:{default:()=>({})},title:{},width:{default:800},onFinish:{},submitter:{type:[Boolean,Object],default:()=>({resetButtonProps:!1})},showCancel:{type:Boolean,default:!0},submitTimeout:{}},emits:["update:open"],setup(c,{expose:B,emit:T}){const a=c,p=e.useSlots(),k=T,n=e.ref(),y=e.ref(0),f=e.ref(),r=e.ref(!1),{value:N,updateValue:m}=j.useControllableValue(a,k,{valuePropName:"open",defaultValue:!1,beforeUpdateValue(t){return t&&(y.value+=1),!0}}),{t:b}=O.useLocale(),v=R.useGlobalConfig("uiMode","aplus"),{b:P,e:g}=z.useNamespace("ap-form-modal-form");e.watch(()=>n.value,t=>{var l;t&&f.value&&((l=t.setFieldsValue)==null||l.call(t,f.value),f.value=void 0)});const h=M.getSingleVNode(p.trigger),V=h?e.cloneVNode(h,{onClick:()=>{m(!0)}}):null,_=e.computed(()=>{var l,o,u,i;const t=[];if(a.submitter===!1)return null;if(a.showCancel){let s;t.push(e.createVNode(d.Button,{onClick:F,disabled:r.value},C(s=b("ap.common.cancelText"))?s:{default:()=>[s]}))}return((l=a.submitter)==null?void 0:l.resetButtonProps)!==!1&&t.push(e.createVNode(d.Button,e.mergeProps(((o=a.submitter)==null?void 0:o.resetButtonProps)||{},{key:"reset",disabled:r.value,onClick:q,htmlType:"reset"}),{default:()=>{var s;return[((s=a.submitter)==null?void 0:s.resetText)||b("ap.common.resetText")]}})),((u=a.submitter)==null?void 0:u.submitButtonProps)!==!1&&t.push(e.createVNode(d.Button,e.mergeProps({type:"primary",key:"submit",htmlType:"submit"},((i=a.submitter)==null?void 0:i.submitButtonProps)||{},{loading:r.value}),{default:()=>{var s;return[((s=a.submitter)==null?void 0:s.submitText)||b("ap.common.okText")]}})),e.createVNode(d.Flex,{justify:"flex-end",key:e.unref(y),class:g(e.unref(v)==="admin"?"footer-admin":"footer")},{default:()=>[p.submitter?p.submitter(t):e.createVNode(d.Space,null,C(t)?t:{default:()=>[t]})]})});function q(){var t,l,o;a.submitter!==!1&&((t=n.value)==null||t.resetFields(),(o=(l=a.submitter)==null?void 0:l.onReset)==null||o.call(l))}async function w(t){var l,o,u;if(a.submitter!==!1)try{(o=(l=a.submitter)==null?void 0:l.onSubmit)==null||o.call(l),r.value=!0;const i=(u=a.onFinish)==null?void 0:u.call(a,t);if(a.submitTimeout&&i instanceof Promise){const x=setTimeout(()=>r.value=!1,a.submitTimeout);i.finally(()=>{clearTimeout(x),r.value=!1})}await i&&m(!1)}finally{r.value=!1}}function F(){e.unref(r)||m(!1)}function S(t){!t&&e.unref(r)||m(t)}return B({resetFields:()=>{var t;(t=n.value)==null||t.resetFields()},clearValidate:t=>{var l;(l=n.value)==null||l.clearValidate(t)},validateFields:(t,l)=>{var o;return(o=n.value)==null?void 0:o.validateFields(t,l)},getFieldsValue:t=>{var l;return(l=n.value)==null?void 0:l.getFieldsValue(t)},validate:(t,l)=>{var o;return(o=n.value)==null?void 0:o.validate(t,l)},scrollToField:(t,l={})=>{var o;(o=n.value)==null||o.scrollToField(t,l)},setFieldValue:(t,l)=>{var o,u;(u=(o=n.value)==null?void 0:o.setFieldValue)==null||u.call(o,t,l)},setFieldsValue:t=>{var l,o;if(!n.value){f.value=t;return}(o=(l=n.value)==null?void 0:l.setFieldsValue)==null||o.call(l,t)},getInternalInstance:t=>{var l;return(l=n.value)==null?void 0:l.getInternalInstance(t)}}),(t,l)=>{var o;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(d.Modal),e.mergeProps(t.modalProps,{open:e.unref(N),footer:null,width:t.width,class:e.unref(P)(),"body-style":{...((o=t.modalProps)==null?void 0:o.bodyStyle)||{},padding:e.unref(v)==="admin"?"0px !important":"20px !important"},"onUpdate:open":S,onCancel:F}),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),default:e.withCtx(()=>[e.createVNode(D.default,e.mergeProps({ref_key:"formRef",ref:n},e.unref(U.omit)(a,["modalProps","open","onUpdate:open","title","width","onFinish","submitter"]),{onFinish:w}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(g)(e.unref(v)==="admin"?"content-admin":"content"))},[e.renderSlot(t.$slots,"default")],2),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.value)))]),_:3},16)]),_:3},16,["open","width","class","body-style"]),e.unref(V)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V)),{key:0})):e.createCommentVNode("",!0)],64)}}});exports.default=E;
|
|
@@ -30,7 +30,7 @@ export interface UsePageListApTable extends ApTableProps {
|
|
|
30
30
|
export declare function usePageListApTable(props?: UsePageListApTable): [ApTableProps, {
|
|
31
31
|
reload: () => void;
|
|
32
32
|
reset: () => void;
|
|
33
|
-
getSearchFormValues: () => any;
|
|
33
|
+
getSearchFormValues: (transform: boolean) => any;
|
|
34
34
|
getApTableInstance: () => {
|
|
35
35
|
submit: () => void;
|
|
36
36
|
reset: () => void;
|
|
@@ -50,6 +50,6 @@ export declare function usePageListApTable(props?: UsePageListApTable): [ApTable
|
|
|
50
50
|
} | undefined;
|
|
51
51
|
getShownColumns: () => TableColumnsType<any>;
|
|
52
52
|
} | null | undefined;
|
|
53
|
-
getSearchFormValuesAndSorted: () => any;
|
|
53
|
+
getSearchFormValuesAndSorted: (transform: boolean) => any;
|
|
54
54
|
clearSelection: () => void;
|
|
55
55
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-unified"),S=require("vue"),m=require("./useTableRefresh.js");function g(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-unified"),S=require("vue"),m=require("./useTableRefresh.js");function g(o){return o===!0?{}:o===!1?{refreshBefore:()=>!1}:o}function v(o){const a=S.ref(null),{isShowRowSelection:i=!0,clearSelectionOnRequest:f=!0,transformSearchFormValues:s,api:l,tableRefresh:d=!1,...h}=o||{};let n=null;const c=()=>{var e,r;(r=(e=a.value)==null?void 0:e.rowSelection)==null||r.clearAll()};m.useTableRefresh({...g(d),apTableRef:a});const b=async e=>{n=e.sort;const r=s?s(e):e;try{if(!l)throw new Error("api is not defined");const{records:t,total:p}=await l(r);return f&&c(),{data:t,total:p}}catch(t){return console.error(t),{data:[],total:0}}};return[u.merge({scroll:{x:"100%",y:"100%"},tableLayout:"fixed",columnResizable:!0,class:"ap-table--sticky",request:l?b:void 0,rowSelection:i?{mode:"internal",fixed:"left",columnWidth:50}:void 0,ref(e){a.value=e}},h),{reload:()=>{var e;(e=a.value)==null||e.submit()},reset:()=>{var e;(e=a.value)==null||e.reset()},getSearchFormValues:e=>{var t;const r=((t=a.value)==null?void 0:t.getSearchFormValues(e))||{};return s?s(r):r},getApTableInstance:()=>a.value,getSearchFormValuesAndSorted:e=>{var t;const r=((t=a.value)==null?void 0:t.getSearchFormValues(e))||{};return r.sort=n&&u.cloneDeep(n),s?s(r):r},clearSelection:c}]}exports.usePageListApTable=v;
|