@vue-start/pro 0.4.13 → 0.5.0

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/dist/index.es.js CHANGED
@@ -1,158 +1,350 @@
1
- import { defineComponent as L, createVNode as b, mergeProps as R, isVNode as ie, computed as w, h as Z, inject as J, reactive as B, Fragment as oe, provide as Q, ref as $ } from "vue";
2
- import { map as M, isString as fe, forEach as z, reduce as ee, size as V, get as v, set as _, pick as K, omit as C, isArray as U, some as ve, keys as k, isFunction as H, head as tt, isObject as Fe, filter as G, split as nt, isEmpty as rt, mergeWith as xe, sortBy as ke, cloneDeep as at, isUndefined as ot, concat as ct, debounce as ut, clone as st, isBoolean as pe } from "lodash";
3
- import { merge as dt, filter as he, tap as be, Subject as it } from "rxjs";
4
- import { useEffect as ce, setReactiveValue as lt, useWatch as mt } from "@vue-start/hooks";
5
- import { useRequestProvide as ge, isDoneRequestActor as qe, isFailedRequestActor as Ke } from "@vue-start/request";
6
- import { useRouter as ft, useRoute as pt } from "vue-router";
7
- function yt(e) {
8
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ie(e);
9
- }
10
- const Et = () => ({
11
- row: {
12
- type: Object,
13
- default: void 0
14
- },
15
- col: {
16
- type: Object
1
+ var It = Object.defineProperty;
2
+ var Mt = (e, t, n) => t in e ? It(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var X = (e, t, n) => (Mt(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { defineComponent as M, provide as re, inject as Q, ref as j, computed as R, h as ie, isVNode as be, reactive as z, createVNode as h, Fragment as B, mergeProps as O, createTextVNode as je, toRef as Dt } from "vue";
5
+ import { reduce as V, get as b, isFunction as w, map as A, isString as Te, forEach as ee, size as J, set as ae, pick as K, omit as C, isArray as ne, some as se, keys as $, head as Nt, isObject as Se, filter as x, split as Ot, isEmpty as Lt, mergeWith as At, startsWith as Rt, mapKeys as wt, has as Xe, debounce as $t, clone as kt, isBoolean as ue, every as Ft, sortBy as Je, cloneDeep as Kt } from "lodash";
6
+ import { Observable as xt, filter as ve, tap as Pe, merge as jt, Subject as qt } from "rxjs";
7
+ import { useEffect as W, useState as we, setReactiveValue as Qe, useWatch as Ye, useUpdateKey as Ut, useResizeObserver as Bt } from "@vue-start/hooks";
8
+ import { useRequestProvide as ye, isDoneRequestActor as Ze, isFailedRequestActor as et } from "@vue-start/request";
9
+ import { map as Vt, distinctUntilChanged as Gt } from "rxjs/operators";
10
+ import { useRouter as _t, useRoute as zt } from "vue-router";
11
+ const Wt = () => ({
12
+ elementMap: { type: Object },
13
+ formElementMap: { type: Object },
14
+ columns: { type: Array },
15
+ columnState: { type: Object }
16
+ }), de = Wt(), Ht = () => ({
17
+ elementMap: { type: Object },
18
+ formElementMap: { type: Object },
19
+ registerStores: { type: Array },
20
+ registerActors: { type: Array },
21
+ registerMetas: { type: Array }
22
+ }), $e = Symbol("pro-config"), Y = () => Q($e) || {}, dr = M({
23
+ props: {
24
+ ...Ht()
17
25
  },
18
- items: {
19
- type: Array
26
+ setup: (e, { slots: t }) => {
27
+ const n = V(e.registerStores, (c, f) => ({ ...c, [f.key]: f }), {}), s = V(e.registerActors, (c, f) => ({ ...c, [f.actor.name]: f }), {}), o = V(e.registerMetas, (c, f) => ({ ...c, [f.actorName]: f }), {});
28
+ ln(o, s);
29
+ const { dispatchRequest: a } = ye(), r = (c, f, p) => {
30
+ const g = b(s, c);
31
+ if (!!g)
32
+ return a(g.actor, f, p);
33
+ };
34
+ return re($e, {
35
+ elementMap: e.elementMap,
36
+ formElementMap: e.formElementMap,
37
+ registerStoreMap: n,
38
+ registerActorMap: s,
39
+ registerMetaMap: o,
40
+ dispatchRequest: r
41
+ }), () => {
42
+ var c;
43
+ return (c = t.default) == null ? void 0 : c.call(t);
44
+ };
20
45
  }
21
- }), $t = (e, n) => L({
22
- props: {
23
- ...Et()
24
- },
25
- setup: (o) => () => {
26
- let t;
27
- return b(e, o.row, yt(t = M(o.items, (u) => b(n, R({
28
- key: u.rowKey
29
- }, o.col, u.col), {
30
- default: () => [u.vNode]
31
- }))) ? t : {
32
- default: () => [t]
46
+ }), mr = (e = {}) => (t) => {
47
+ t.provide($e, e);
48
+ }, Xt = Object.prototype.hasOwnProperty, qe = (e, t) => e === t ? e !== 0 || t !== 0 || 1 / e === 1 / t : e !== e && t !== t, Jt = (e, t) => {
49
+ if (qe(e, t))
50
+ return !0;
51
+ if (typeof e != "object" || e === null || typeof t != "object" || t === null)
52
+ return !1;
53
+ const n = Object.keys(e), s = Object.keys(t);
54
+ if (n.length !== s.length)
55
+ return !1;
56
+ for (let o = 0; o < n.length; o++)
57
+ if (!Xt.call(t, n[o]) || !qe(e[n[o]], t[n[o]]))
58
+ return !1;
59
+ return !0;
60
+ }, Qt = "$store", Ie = () => Q(Qt), Yt = (e, t) => (n = {}, s) => {
61
+ const o = typeof e == "function" ? e(s) : e;
62
+ if (o === "")
63
+ return n;
64
+ const a = t(n[o], s), r = {};
65
+ for (const c in n)
66
+ c !== o && (r[c] = n[c]);
67
+ return typeof a < "u" && (r[o] = a), r;
68
+ };
69
+ class Zt {
70
+ constructor(t) {
71
+ X(this, "group");
72
+ X(this, "name");
73
+ X(this, "stage");
74
+ X(this, "effect");
75
+ X(this, "arg");
76
+ X(this, "opts");
77
+ this.group = t.group || "UN_GROUPED", this.name = t.name || "UN_NAMED", this.stage = t.stage, this.effect = t.effect, this.arg = t.arg || {}, this.opts = t.opts || {};
78
+ }
79
+ static of(t) {
80
+ return new this({ group: t });
81
+ }
82
+ named(t, n) {
83
+ return new this.constructor({
84
+ ...this,
85
+ name: t,
86
+ opts: {
87
+ ...this.opts,
88
+ ...n
89
+ }
90
+ });
91
+ }
92
+ staged(t) {
93
+ return new this.constructor({
94
+ ...this,
95
+ stage: t
96
+ });
97
+ }
98
+ effectWith(t) {
99
+ return new this.constructor({
100
+ ...this,
101
+ effect: t
102
+ });
103
+ }
104
+ effectOn(t, n) {
105
+ return this.effectWith(Yt(t, n));
106
+ }
107
+ with(t, n) {
108
+ return new this.constructor({
109
+ ...this,
110
+ arg: t,
111
+ opts: {
112
+ ...this.opts,
113
+ ...n
114
+ }
33
115
  });
34
116
  }
35
- }), Ue = (e) => (n, o) => {
36
- const { requestSubject$: t } = ge(), u = new Set(M(n, (r) => fe(r) ? r : r.name));
37
- ce(() => {
38
- const r = t.pipe(
39
- he(e),
40
- be((s) => {
41
- u.has(s.name) && o(s);
117
+ invoke(t) {
118
+ t.dispatch(this);
119
+ }
120
+ get type() {
121
+ let t = !1;
122
+ for (const n in this.opts)
123
+ n !== "parentActor" && (this.opts[n], t = !0);
124
+ return `@@${this.group}/${this.name}${this.stage ? `::${this.stage}` : ""}${t ? `${JSON.stringify(this.opts)}` : ""}`;
125
+ }
126
+ is(t) {
127
+ const n = this.isSameGroup(t) && t.name === this.name;
128
+ return this.stage ? n && t.stage === this.stage : n;
129
+ }
130
+ isSameGroup(t) {
131
+ return t.group === this.group;
132
+ }
133
+ }
134
+ class Me extends xt {
135
+ constructor(n, s, o = Jt) {
136
+ super((a) => this.state$.pipe(
137
+ Vt((r) => {
138
+ const c = this.mapper(r);
139
+ return o(c, this._value) || (this._value = c), this._value;
140
+ }),
141
+ Gt()
142
+ ).subscribe(a));
143
+ X(this, "_value");
144
+ this.state$ = n, this.mapper = s;
145
+ }
146
+ static from(n, s) {
147
+ return new Me(n, s, s.equalFn);
148
+ }
149
+ get value() {
150
+ return typeof this._value > "u" && (this._value = this.mapper(this.state$.value)), this._value;
151
+ }
152
+ }
153
+ const en = (e, t) => {
154
+ const [n, s] = we(t || e.value);
155
+ return W(() => {
156
+ const o = e.subscribe((a) => {
157
+ s(a);
158
+ });
159
+ return () => {
160
+ o && o.unsubscribe();
161
+ };
162
+ }, void 0), n;
163
+ }, tn = (e, t) => {
164
+ const n = j(t || e.value);
165
+ return W(() => {
166
+ const s = e.subscribe((o) => {
167
+ n.value = o;
168
+ });
169
+ return () => {
170
+ s && s.unsubscribe();
171
+ };
172
+ }, []), n;
173
+ }, nn = (e, t) => Me.from(e, t), rn = (e) => nn(Ie(), e || ((t) => t)), an = Zt.of("state"), tt = an.named("update").effectOn(
174
+ (e) => e.opts.key,
175
+ (e, t) => t.arg(e)
176
+ ), nt = () => {
177
+ const e = Ie();
178
+ return (t, n, s, o) => {
179
+ const a = `${s ? "$" : ""}${t}`, r = w(o) ? o() : o;
180
+ tt.with(
181
+ (c = r) => w(n) ? n(c) : n,
182
+ { key: a }
183
+ ).invoke(e);
184
+ };
185
+ }, on = (e, t, n) => {
186
+ const s = `${n ? "$" : ""}${e}`, o = w(t) ? t() : t, a = Ie(), r = (p) => tt.with(
187
+ (g = o) => w(p) ? p(g) : p,
188
+ { key: s }
189
+ ).invoke(a), c = Me.from(a, (p) => b(p, [s], o));
190
+ return [en(c), r];
191
+ }, sn = (e, t, n = !1) => () => {
192
+ const [s, o] = on(e, t, n);
193
+ return [s, o];
194
+ }, rt = (e) => (t, n) => {
195
+ const { requestSubject$: s } = ye(), o = new Set(A(t, (a) => Te(a) ? a : a.name));
196
+ W(() => {
197
+ const a = s.pipe(
198
+ ve(e),
199
+ Pe((r) => {
200
+ o.has(r.name) && n(r);
42
201
  })
43
202
  ).subscribe();
44
203
  return () => {
45
- r.unsubscribe();
204
+ a.unsubscribe();
46
205
  };
47
206
  }, []);
48
- }, Vt = Ue(qe), Xt = Ue(Ke), St = (e, n, o) => {
49
- const { requestSubject$: t, dispatchRequest: u } = ge(), r = new Set(M(e, (m) => fe(m) ? m : m.name)), s = {};
50
- ce(() => {
51
- const m = dt(
52
- t.pipe(
53
- he(qe),
54
- be((y) => {
55
- var E, l;
56
- r.has(y.name) && ((E = n.onSuccess) == null || E.call(n, y), (l = n.onFinish) == null || l.call(n, y), s[y.name] = void 0);
207
+ }, fr = rt(Ze), pr = rt(et), cn = (e, t, n) => {
208
+ const { requestSubject$: s, dispatchRequest: o } = ye(), a = new Set(A(e, (c) => Te(c) ? c : c.name)), r = {};
209
+ W(() => {
210
+ const c = jt(
211
+ s.pipe(
212
+ ve(Ze),
213
+ Pe((f) => {
214
+ var p, g;
215
+ a.has(f.name) && ((p = t.onSuccess) == null || p.call(t, f), (g = t.onFinish) == null || g.call(t, f), r[f.name] = void 0);
57
216
  })
58
217
  ),
59
- t.pipe(
60
- he(Ke),
61
- be((y) => {
62
- var E, l;
63
- r.has(y.name) && ((E = n.onFailed) == null || E.call(n, y), (l = n.onFinish) == null || l.call(n, y), s[y.name] = void 0);
218
+ s.pipe(
219
+ ve(et),
220
+ Pe((f) => {
221
+ var p, g;
222
+ a.has(f.name) && ((p = t.onFailed) == null || p.call(t, f), (g = t.onFinish) == null || g.call(t, f), r[f.name] = void 0);
64
223
  })
65
224
  )
66
225
  ).subscribe();
67
226
  return () => {
68
- m.unsubscribe(), o && z(s, (y) => {
69
- y && u({ ...y, stage: "CANCEL" });
227
+ c.unsubscribe(), n && ee(r, (f) => {
228
+ f && o({ ...f, stage: "CANCEL" });
70
229
  });
71
230
  };
72
231
  }, []);
73
- }, Be = (e) => e.formValueType || e.valueType || "text", te = (e) => {
74
- var n;
75
- return ((n = e.formItemProps) == null ? void 0 : n.name) || e.dataIndex;
76
- }, Pe = (e, n, o = !0) => {
77
- var m;
78
- const t = Be(n), u = v(e, t);
79
- if (!u)
232
+ }, un = (e, t, n) => {
233
+ var o;
234
+ const s = (o = e.res) == null ? void 0 : o.data;
235
+ return t ? t(s, e) : n ? b(s, n) : s;
236
+ }, yr = () => {
237
+ const e = Ie(), { registerMetaMap: t, dispatchRequest: n } = Y();
238
+ return (s) => {
239
+ const o = b(t, s);
240
+ if (!o)
241
+ return;
242
+ const a = o.storeName || s;
243
+ b(e.value, a) || n(s, o.initParams || {});
244
+ };
245
+ }, ln = (e, t) => {
246
+ const { requestSubject$: n } = ye(), s = nt(), o = (a) => {
247
+ const r = b(e, a.name), c = b(t, a.name);
248
+ return !!(r && c && c.actor);
249
+ };
250
+ W(() => {
251
+ const a = n.pipe(
252
+ ve(o),
253
+ Pe((r) => {
254
+ const c = b(e, r.name);
255
+ if (!c)
256
+ return;
257
+ const f = c.storeName || r.name, p = un(r, c.convertData, c.convertPath);
258
+ s(f, p, !1, void 0);
259
+ })
260
+ ).subscribe();
261
+ return () => {
262
+ a.unsubscribe();
263
+ };
264
+ }, []);
265
+ }, at = (e) => e.formValueType || e.valueType || "text", oe = (e) => {
266
+ var t;
267
+ return ((t = e.formItemProps) == null ? void 0 : t.name) || e.dataIndex;
268
+ }, ot = (e, t, n = !0) => {
269
+ var c;
270
+ const s = at(t), o = b(e, s);
271
+ if (!o)
80
272
  return null;
81
- const r = te(n), s = o ? n.formItemProps : C(n.formItemProps, "rules");
82
- return Z(u, {
83
- key: r,
84
- name: r,
85
- label: n.title,
86
- ...s,
87
- fieldProps: C(n.formFieldProps, "slots"),
88
- showProps: n.showProps
89
- }, (m = n.formFieldProps) == null ? void 0 : m.slots);
90
- }, $e = (e, n, o) => {
91
- var r;
92
- const t = n.valueType || "text", u = v(e, t);
93
- return u ? Z(u, {
94
- ...C(n.formFieldProps, "slots"),
95
- showProps: n.showProps,
96
- value: o
97
- }, (r = n.formFieldProps) == null ? void 0 : r.slots) : null;
98
- }, Te = (e, n) => M(n, (o) => ne(e, o)), Ve = (e, n) => {
99
- var u;
100
- const o = n.elementProps, t = {
101
- ...n.elementProps
273
+ const a = oe(t), r = n ? t.formItemProps : C(t.formItemProps, "rules");
274
+ return ie(o, {
275
+ key: a,
276
+ name: a,
277
+ label: t.title,
278
+ ...r,
279
+ fieldProps: C(t.formFieldProps, "slots"),
280
+ showProps: t.showProps
281
+ }, (c = t.formFieldProps) == null ? void 0 : c.slots);
282
+ }, ke = (e, t, n) => {
283
+ var a;
284
+ const s = t.valueType || "text", o = b(e, s);
285
+ return o ? ie(o, {
286
+ ...C(t.formFieldProps, "slots"),
287
+ showProps: t.showProps,
288
+ value: n
289
+ }, (a = t.formFieldProps) == null ? void 0 : a.slots) : null;
290
+ }, Fe = (e, t) => A(t, (n) => me(e, n)), st = (e, t) => {
291
+ var o;
292
+ const n = t.elementProps, s = {
293
+ ...t.elementProps
102
294
  };
103
- return z((u = n.highConfig$) == null ? void 0 : u.registerPropsTrans, (r) => {
104
- const s = v(o, r.name);
105
- if (!(!s || ie(s))) {
106
- if (U(s)) {
107
- if (ve(s, (m) => ie(m)))
295
+ return ee((o = t.highConfig$) == null ? void 0 : o.registerPropsTrans, (a) => {
296
+ const r = b(n, a.name);
297
+ if (!(!r || be(r))) {
298
+ if (ne(r)) {
299
+ if (se(r, (c) => be(c)))
108
300
  return;
109
- _(t, r.name, Te(e, s));
301
+ ae(s, a.name, Fe(e, r));
110
302
  return;
111
303
  }
112
- !s.elementType || (r.isFun ? _(t, r.name, (...m) => {
113
- const y = r.needParams ? {
114
- ...s.elementProps,
115
- params$: m
116
- } : s.elementProps;
117
- return ne(e, {
118
- ...s,
119
- elementProps: y
304
+ !r.elementType || (a.isFun ? ae(s, a.name, (...c) => {
305
+ const f = a.needParams ? {
306
+ ...r.elementProps,
307
+ params$: c
308
+ } : r.elementProps;
309
+ return me(e, {
310
+ ...r,
311
+ elementProps: f
120
312
  });
121
- }) : _(t, r.name, ne(e, s)));
313
+ }) : ae(s, a.name, me(e, r)));
122
314
  }
123
- }), t;
124
- }, Xe = (e, n) => {
125
- const o = V(n.children) > 0 ? Te(e, n.children) : void 0, t = n.childrenSlotName || "default", u = C(n.slots, o ? t : "");
126
- return z(k(u), (r) => {
127
- const s = u[r];
128
- s && !H(s) && s.elementType && (u[r] = (...m) => {
129
- const y = s.needParams ? {
130
- ...s.elementProps,
131
- params$: m
132
- } : s.elementProps;
133
- return ne(e, {
134
- ...s,
135
- elementProps: y
315
+ }), s;
316
+ }, ct = (e, t) => {
317
+ const n = J(t.children) > 0 ? Fe(e, t.children) : void 0, s = t.childrenSlotName || "default", o = C(t.slots, n ? s : "");
318
+ return ee($(o), (a) => {
319
+ const r = o[a];
320
+ r && !w(r) && r.elementType && (o[a] = (...c) => {
321
+ const f = r.needParams ? {
322
+ ...r.elementProps,
323
+ params$: c
324
+ } : r.elementProps;
325
+ return me(e, {
326
+ ...r,
327
+ elementProps: f
136
328
  });
137
329
  });
138
330
  }), {
139
- [t]: o ? () => o : void 0,
140
- ...u
331
+ [s]: n ? () => n : void 0,
332
+ ...o
141
333
  };
142
- }, ne = (e, n) => {
143
- const o = v(e, n.elementType) || n.elementType;
144
- if (n.highConfig$)
145
- return Z(bt, {
146
- key: n.elementId,
334
+ }, me = (e, t) => {
335
+ const n = b(e, t.elementType) || t.elementType;
336
+ if (t.highConfig$)
337
+ return ie(mn, {
338
+ key: t.elementId,
147
339
  elementMap: e,
148
- elementConfig: n
340
+ elementConfig: t
149
341
  });
150
- const t = Xe(e, n), u = Ve(e, n);
151
- return Z(o, {
152
- key: n.elementId,
153
- ...u
154
- }, t);
155
- }, ht = (e) => U(e) ? tt(e) : fe(e) && e.indexOf(".") > 0 ? e.substring(0, e.indexOf(".")) : e, bt = L({
342
+ const s = ct(e, t), o = st(e, t);
343
+ return ie(n, {
344
+ key: t.elementId,
345
+ ...o
346
+ }, s);
347
+ }, dn = (e) => ne(e) ? Nt(e) : Te(e) && e.indexOf(".") > 0 ? e.substring(0, e.indexOf(".")) : e, mn = M({
156
348
  props: {
157
349
  elementMap: {
158
350
  type: Object
@@ -163,43 +355,55 @@ const Et = () => ({
163
355
  },
164
356
  setup: (e) => {
165
357
  const {
166
- state: n,
167
- sendEvent: o
168
- } = ue(), {
169
- elementMap: t,
170
- elementConfig: u
171
- } = e, r = u.highConfig$, s = Ve(t, u), m = ee(r.registerEventList, (f, a) => ({
172
- ...f,
173
- [a.name]: (...c) => {
174
- o({
175
- type: a.sendEventName || u.elementId,
176
- payload: c
358
+ state: t,
359
+ sendEvent: n
360
+ } = he(), {
361
+ elementMap: s,
362
+ elementConfig: o
363
+ } = e, a = o.highConfig$, r = st(s, o), c = V(a.registerEventList, (m, u) => ({
364
+ ...m,
365
+ [u.name]: (...l) => {
366
+ n({
367
+ type: u.sendEventName || o.elementId,
368
+ payload: l
177
369
  });
178
370
  }
179
- }), {}), y = w(() => {
180
- if (!r.registerStateList || V(r.registerStateList) <= 0)
371
+ }), {}), f = R(() => {
372
+ if (!a.registerStateList || J(a.registerStateList) <= 0)
181
373
  return;
182
- const f = {
183
- ...s
184
- }, a = M(r.registerStateList, (c) => {
185
- const d = c.mapName || c.name, i = v(n, c.name);
186
- return _(f, d, i), ht(d);
374
+ const m = {
375
+ ...r
376
+ }, u = A(a.registerStateList, (l) => {
377
+ const y = l.mapName || l.name, i = b(t, l.name);
378
+ return ae(m, y, i), dn(y);
187
379
  });
188
- return K(f, a);
189
- }), E = v(t, u.elementType) || u.elementType, l = Xe(t, u);
190
- return () => v(y.value, "show$") === !1 ? null : Z(E, {
191
- key: u.elementId,
192
- ...s,
193
- ...C(y.value, "show$"),
194
- ...m
195
- }, l);
380
+ return K(m, u);
381
+ }), p = b(s, o.elementType) || o.elementType, g = ct(s, o);
382
+ return () => b(f.value, "show$") === !1 ? null : ie(p, {
383
+ key: o.elementId,
384
+ ...r,
385
+ ...C(f.value, "show$"),
386
+ ...c
387
+ }, g);
196
388
  }
197
- }), ze = Symbol("pro-module"), ue = () => J(ze), Pt = (e) => {
198
- Q(ze, e);
199
- }, re = {
389
+ }), ut = Symbol("pro-module"), he = () => Q(ut), fn = (e) => {
390
+ re(ut, e);
391
+ }, Ke = (e) => {
392
+ const {
393
+ subject$: t
394
+ } = he();
395
+ W(() => {
396
+ const n = t.subscribe({
397
+ next: (s) => {
398
+ e(s);
399
+ }
400
+ });
401
+ return () => n.unsubscribe();
402
+ }, []);
403
+ }, fe = {
200
404
  Success: "request-success$",
201
405
  Fail: "request-fail$"
202
- }, vt = () => ({
406
+ }, pn = () => ({
203
407
  state: {
204
408
  type: Object
205
409
  },
@@ -212,753 +416,945 @@ const Et = () => ({
212
416
  requests: {
213
417
  type: Array
214
418
  }
215
- }), ye = L({
419
+ }), Ne = M({
216
420
  props: {
217
- ...vt()
421
+ ...pn()
218
422
  },
219
423
  setup: (e, {
220
- slots: n,
221
- expose: o
424
+ slots: t,
425
+ expose: n
222
426
  }) => {
223
- const t = (a) => U(a) ? Te(e.elementMap, a) : ne(e.elementMap, a), u = new it(), r = (a) => {
224
- u.next(a);
225
- }, s = e.state || B({}), m = (a) => {
226
- const c = s[a.type], d = H(a.payload) ? a.payload(c) : a.payload;
227
- if (Fe(c)) {
228
- lt(s[a.type], d);
427
+ const s = (u) => ne(u) ? Fe(e.elementMap, u) : me(e.elementMap, u), o = new qt(), a = (u) => {
428
+ o.next(u);
429
+ }, r = e.state || z({}), c = (u) => {
430
+ const l = r[u.type], y = w(u.payload) ? u.payload(l) : u.payload;
431
+ if (Se(l)) {
432
+ Qe(r[u.type], y);
229
433
  return;
230
434
  }
231
- s[a.type] = d;
435
+ r[u.type] = y;
232
436
  }, {
233
- dispatchRequest: y
234
- } = ge(), E = ee(e.requests, (a, c) => {
235
- var d;
437
+ dispatchRequest: f
438
+ } = ye(), p = V(e.requests, (u, l) => {
439
+ var y;
236
440
  return {
237
- ...a,
238
- [(d = c.actor) == null ? void 0 : d.name]: c
441
+ ...u,
442
+ [(y = l.actor) == null ? void 0 : y.name]: l
239
443
  };
240
- }, {}), l = ee(e.requests, (a, c) => ({
241
- ...a,
242
- [c.action]: c
243
- }), {}), f = (a, ...c) => {
244
- const d = v(E, a) || v(l, a);
245
- if (!d)
444
+ }, {}), g = V(e.requests, (u, l) => ({
445
+ ...u,
446
+ [l.action]: l
447
+ }), {}), m = (u, ...l) => {
448
+ const y = b(p, u) || b(g, u);
449
+ if (!y)
246
450
  return;
247
451
  let i;
248
- d.convertParams ? i = d.convertParams(...c) : i = v(c, 0), d.loadingName && m({
249
- type: d.loadingName,
452
+ y.convertParams ? i = y.convertParams(...l) : i = b(l, 0), y.loadingName && c({
453
+ type: y.loadingName,
250
454
  payload: !0
251
- }), y(d.actor, i);
455
+ }), f(y.actor, i);
252
456
  };
253
- return St(k(E), {
254
- onSuccess: (a) => {
255
- var d, i;
256
- const c = v(E, a.name);
257
- if (c != null && c.stateName) {
258
- const h = c.convertData ? c.convertData(a) : (d = a.res) == null ? void 0 : d.data;
259
- m({
260
- type: c.stateName,
261
- payload: h
457
+ return cn($(p), {
458
+ onSuccess: (u) => {
459
+ var y, i;
460
+ const l = b(p, u.name);
461
+ if (l != null && l.stateName) {
462
+ const d = l.convertData ? l.convertData(u) : (y = u.res) == null ? void 0 : y.data;
463
+ c({
464
+ type: l.stateName,
465
+ payload: d
262
466
  });
263
467
  }
264
- r({
265
- type: re.Success,
468
+ a({
469
+ type: fe.Success,
266
470
  payload: {
267
- actor: a,
268
- requestOpts: c
471
+ actor: u,
472
+ requestOpts: l
269
473
  }
270
- }), (i = c.onSuccess) == null || i.call(c, a);
474
+ }), (i = l.onSuccess) == null || i.call(l, u);
271
475
  },
272
- onFailed: (a) => {
273
- var d;
274
- const c = v(E, a.name);
275
- r({
276
- type: re.Fail,
476
+ onFailed: (u) => {
477
+ var y;
478
+ const l = b(p, u.name);
479
+ a({
480
+ type: fe.Fail,
277
481
  payload: {
278
- actor: a,
279
- requestOpts: c
482
+ actor: u,
483
+ requestOpts: l
280
484
  }
281
- }), (d = c.onFailed) == null || d.call(c, a);
485
+ }), (y = l.onFailed) == null || y.call(l, u);
282
486
  },
283
- onFinish: (a) => {
284
- const c = v(E, [a.name, "loadingName"]);
285
- c && m({
286
- type: c,
487
+ onFinish: (u) => {
488
+ const l = b(p, [u.name, "loadingName"]);
489
+ l && c({
490
+ type: l,
287
491
  payload: !1
288
492
  });
289
493
  }
290
- }, !0), Pt({
494
+ }, !0), fn({
291
495
  elementMap: e.elementMap,
292
- subject$: u,
293
- sendEvent: r,
294
- state: s,
295
- dispatch: m,
496
+ subject$: o,
497
+ sendEvent: a,
498
+ state: r,
499
+ dispatch: c,
296
500
  requests: e.requests,
297
- sendRequest: f
298
- }), o({
299
- sendEvent: r,
300
- sendRequest: f
501
+ sendRequest: m
502
+ }), n({
503
+ sendEvent: a,
504
+ sendRequest: m
301
505
  }), () => {
302
- var a;
303
- return b(oe, null, [V(e.elementConfigs) > 0 && t(e.elementConfigs), (a = n.default) == null ? void 0 : a.call(n)]);
506
+ var u;
507
+ return h(B, null, [J(e.elementConfigs) > 0 && s(e.elementConfigs), (u = t.default) == null ? void 0 : u.call(t)]);
304
508
  };
305
509
  }
306
- }), De = (e) => {
307
- const { subject$: n } = ue();
308
- ce(() => {
309
- const o = n.subscribe({
310
- next: (t) => {
311
- e(t);
312
- }
313
- });
314
- return () => o.unsubscribe();
315
- }, []);
316
- }, gt = () => ({
317
- elementMap: { type: Object },
318
- formElementMap: { type: Object },
319
- columns: { type: Array },
320
- columnState: { type: Object }
321
- }), Ce = gt(), Tt = () => ({
322
- config: { type: Object, default: {} }
323
- }), Ie = Symbol("pro-config"), Le = () => J(Ie) || {}, zt = L({
510
+ }), hr = () => {
511
+ const e = nt(), { registerStoreMap: t } = Y();
512
+ return (n, s) => {
513
+ const o = b(t, n);
514
+ !o || e(n, s, !!o.persist, o.initialState);
515
+ };
516
+ }, gr = (e) => {
517
+ const { registerStoreMap: t } = Y(), n = b(t, e), s = `${n != null && n.persist ? "$" : ""}${n == null ? void 0 : n.key}`;
518
+ return tn(rn((a) => {
519
+ const r = b(a, s);
520
+ return r || (w(n == null ? void 0 : n.initialState) ? n == null ? void 0 : n.initialState() : n == null ? void 0 : n.initialState);
521
+ }));
522
+ }, lt = sn("access", void 0, !0), yn = () => {
523
+ const [e] = lt();
524
+ return e;
525
+ }, br = () => {
526
+ const [e, t] = lt();
527
+ return [e, t, () => {
528
+ t(void 0);
529
+ }];
530
+ }, Sr = M((e, { slots: t, emit: n }) => {
531
+ const s = yn(), o = R(() => s && s.token);
532
+ return W(() => {
533
+ o.value || n("toLogin");
534
+ }, o), () => {
535
+ var a;
536
+ return o.value ? (a = t.default) == null ? void 0 : a.call(t) : null;
537
+ };
538
+ }), it = Symbol("logon-user"), vr = () => Q(it), Pr = M((e, { slots: t }) => {
539
+ const [n, s] = we(), [o, a] = we();
540
+ return re(it, { user: n, setUser: s, per: o, setPer: a, opts: {} }), () => {
541
+ var c;
542
+ return (c = t.default) == null ? void 0 : c.call(t);
543
+ };
544
+ }), dt = "Loading$", hn = "Row$", gn = "Col$", bn = "Button$", Sn = "ProDescriptions$", vn = "ProDescriptionsItem$", Pn = "Pagination$", En = "Popover$", Cn = "Checkbox$", Tn = "Modal$", In = "Form$", Mn = "FormItem$", Dn = "Table$", Nn = "ProForm$", On = "ProSearchForm$", Ln = "ProTable$", H = () => {
545
+ const { elementMap: e } = Y();
546
+ return (t) => b(e, t);
547
+ };
548
+ function An(e) {
549
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !be(e);
550
+ }
551
+ const Rn = () => ({
552
+ row: {
553
+ type: Object,
554
+ default: void 0
555
+ },
556
+ col: {
557
+ type: Object
558
+ },
559
+ items: {
560
+ type: Array
561
+ }
562
+ }), Oe = M({
324
563
  props: {
325
- ...Tt()
564
+ ...Rn()
326
565
  },
327
- setup: (e, { slots: n }) => (Q(Ie, e.config), () => {
328
- var o;
329
- return (o = n.default) == null ? void 0 : o.call(n);
330
- })
331
- }), Gt = (e = {}) => (n) => {
332
- n.provide(Ie, e);
333
- }, Ge = Symbol("pro-curd"), se = () => J(Ge), Dt = (e) => Q(Ge, e);
334
- var T = /* @__PURE__ */ ((e) => (e.LIST = "LIST", e.DETAIL = "DETAIL", e.ADD = "ADD", e.EDIT = "EDIT", e.DELETE = "DELETE", e))(T || {}), D = /* @__PURE__ */ ((e) => (e.EMIT = "EMIT", e.EXECUTE = "EXECUTE", e.PAGE = "PAGE", e.SUCCESS = "SUCCESS", e.FAIL = "FAIL", e))(D || {}), q = /* @__PURE__ */ ((e) => (e.ADD = "ADD", e.EDIT = "EDIT", e.DETAIL = "DETAIL", e))(q || {}), ae = /* @__PURE__ */ ((e) => (e.NORMAL = "NORMAL", e.CONTINUE = "CONTINUE", e))(ae || {});
335
- const Ct = (e, n, o) => {
336
- if (n) {
337
- const t = G(k(n), (u) => !n[u]);
338
- return C(e, t);
566
+ setup: (e) => {
567
+ const t = H(), n = t(hn), s = t(gn);
568
+ return () => {
569
+ let o;
570
+ return !n || !s ? null : h(n, e.row, An(o = A(e.items, (a) => h(s, O({
571
+ key: a.rowKey
572
+ }, e.col, a.col), {
573
+ default: () => [a.vNode]
574
+ }))) ? o : {
575
+ default: () => [o]
576
+ });
577
+ };
339
578
  }
340
- if (o) {
341
- const t = G(k(o), (u) => !o[u](e));
342
- return C(e, t);
579
+ }), wn = (e, t, n) => {
580
+ if (t) {
581
+ const s = x($(t), (o) => !t[o]);
582
+ return C(e, s);
583
+ }
584
+ if (n) {
585
+ const s = x($(n), (o) => !n[o](e));
586
+ return C(e, s);
343
587
  }
344
588
  return e;
345
- }, We = (e) => {
589
+ }, mt = (e) => {
346
590
  if (!!e)
347
- return U(e) ? e : e && fe(e) && e.indexOf(".") > 0 ? nt(e, ".") : [e];
348
- }, Ae = (e, n, o) => !n || !o ? e : M(e, (t) => {
349
- const u = H(o) ? o(t) : o, r = v(n, u);
350
- return !r || rt(r) || H(r) || !Fe(r) ? t : xe(t, r, (s, m) => {
351
- if (U(s) || U(m))
352
- return m;
591
+ return ne(e) ? e : e && Te(e) && e.indexOf(".") > 0 ? Ot(e, ".") : [e];
592
+ }, De = (e, t, n) => !t || !n ? e : A(e, (s) => {
593
+ const o = w(n) ? n(s) : b(s, n), a = b(t, o);
594
+ return !a || Lt(a) || w(a) || !Se(a) ? s : At(s, a, (r, c) => {
595
+ if (ne(r) || ne(c))
596
+ return c;
353
597
  });
354
- }), Y = (e, n) => {
355
- const o = ee(
598
+ }), ce = (e, t) => {
599
+ const n = V(
356
600
  e,
357
- (t, u) => ({
358
- ...t,
359
- [u]: (...r) => {
360
- var s, m;
361
- return (m = (s = n.value) == null ? void 0 : s[u]) == null ? void 0 : m.call(s, ...r);
601
+ (s, o) => ({
602
+ ...s,
603
+ [o]: (...a) => {
604
+ var r, c;
605
+ return (c = (r = t.value) == null ? void 0 : r[o]) == null ? void 0 : c.call(r, ...a);
362
606
  }
363
607
  }),
364
608
  {}
365
609
  );
366
- return o.originRef = n, o;
367
- }, Wt = (e, n, o) => {
368
- const t = { originRef: e, ...o };
369
- return n && V(n) > 0 && z(n, (u) => {
370
- t[u] = (...r) => {
371
- var s, m;
372
- return (m = (s = e.value) == null ? void 0 : s[u]) == null ? void 0 : m.call(s, ...r);
610
+ return n.originRef = t, n;
611
+ }, Er = (e, t, n) => {
612
+ const s = { originRef: e, ...n };
613
+ return t && J(t) > 0 && ee(t, (o) => {
614
+ s[o] = (...a) => {
615
+ var r, c;
616
+ return (c = (r = e.value) == null ? void 0 : r[o]) == null ? void 0 : c.call(r, ...a);
373
617
  };
374
- }), t;
375
- }, It = {
376
- page: 1,
377
- pageSize: 10
378
- }, Lt = () => ({
618
+ }), s;
619
+ }, ft = (e, t) => b(e, ["extra", t]) || b(e, t), le = (e, t) => {
620
+ const n = $(e), s = `${t}-`, o = x(n, (r) => Rt(r, s)), a = K(e, o);
621
+ return wt(a, (r) => r.replace(s, ""));
622
+ }, pt = Symbol("pro-form-list"), yt = () => Q(pt), ht = (e) => {
623
+ re(pt, e);
624
+ }, $n = M({
625
+ props: {
626
+ pathList: {
627
+ type: Array
628
+ }
629
+ },
630
+ setup: (e, {
631
+ slots: t
632
+ }) => (ht({
633
+ pathList: e.pathList
634
+ }), () => {
635
+ var n;
636
+ return (n = t.default) == null ? void 0 : n.call(t);
637
+ })
638
+ }), kn = () => ({
379
639
  rowKey: {
380
640
  type: String,
381
641
  default: "id"
382
642
  },
383
- operates: {
384
- type: Array
643
+ name: {
644
+ type: [String, Number, Array],
645
+ required: !0
646
+ }
647
+ }), Cr = M({
648
+ props: {
649
+ ...kn()
385
650
  },
386
- listProps: {
651
+ setup: (e, {
652
+ slots: t
653
+ }) => {
654
+ const s = H()(Mn), {
655
+ formState: o,
656
+ readonly: a
657
+ } = bt(), r = yt(), c = mt(e.name), f = r != null && r.pathList ? [...r.pathList, ...c] : c, p = () => {
658
+ let m = b(o, f);
659
+ ne(m) || (m = []), m.push({
660
+ [e.rowKey]: new Date().valueOf()
661
+ }), ae(o, f, m);
662
+ }, g = (m) => {
663
+ const u = b(o, f);
664
+ J(u) <= 0 || u.splice(m, 1);
665
+ };
666
+ return () => s ? h(s, C(e, "rowKey"), {
667
+ default: () => {
668
+ var m;
669
+ return [A(b(o, f), (u, l) => h($n, {
670
+ key: u[e.rowKey] || l,
671
+ pathList: [...f, l]
672
+ }, {
673
+ default: () => {
674
+ var y, i, d;
675
+ return [h("div", {
676
+ class: "pro-form-list-item"
677
+ }, [(y = t.default) == null ? void 0 : y.call(t), !a.value && h(B, null, [h("div", {
678
+ class: "pro-form-list-item-add",
679
+ onClick: p
680
+ }, [(i = t.itemAdd) == null ? void 0 : i.call(t)]), h("div", {
681
+ class: "pro-form-list-item-minus",
682
+ onClick: () => g(l)
683
+ }, [(d = t.itemMinus) == null ? void 0 : d.call(t)])])])];
684
+ }
685
+ })), !a.value && h("div", {
686
+ class: "pro-form-list-add",
687
+ onClick: p
688
+ }, [(m = t.add) == null ? void 0 : m.call(t)])];
689
+ }
690
+ }) : null;
691
+ }
692
+ }), gt = Symbol("pro-form"), bt = () => Q(gt), Fn = (e) => {
693
+ re(gt, e);
694
+ };
695
+ let U;
696
+ (function(e) {
697
+ e.RESET = "RESET", e.SUBMIT = "SUBMIT", e.CONTINUE = "CONTINUE";
698
+ })(U || (U = {}));
699
+ const Ue = () => ({
700
+ clsName: {
701
+ type: String,
702
+ default: "pro-form"
703
+ },
704
+ model: {
387
705
  type: Object
388
706
  },
389
- formProps: {
707
+ readonly: {
708
+ type: Boolean,
709
+ default: void 0
710
+ },
711
+ showState: {
390
712
  type: Object
391
713
  },
392
- descProps: {
714
+ showStateRules: {
393
715
  type: Object
394
716
  },
395
- modalProps: {
717
+ readonlyState: {
718
+ type: Object
719
+ },
720
+ readonlyStateRules: {
721
+ type: Object
722
+ },
723
+ disableState: {
724
+ type: Object
725
+ },
726
+ disableStateRules: {
727
+ type: Object
728
+ },
729
+ needRules: {
730
+ type: Boolean,
731
+ default: !0
732
+ },
733
+ provideExtra: {
396
734
  type: Object
735
+ },
736
+ operate: {
737
+ type: Object
738
+ },
739
+ submitLoading: {
740
+ type: Boolean
741
+ },
742
+ formMethods: {
743
+ type: Array
397
744
  }
398
- }), _e = ["sendCurdEvent", "refreshList", "sendEvent", "sendRequest"], Me = L({
745
+ }), Kn = M({
746
+ inheritAttrs: !1,
399
747
  props: {
400
- ...Ce,
401
- ...Lt()
748
+ ...de,
749
+ ...Ue(),
750
+ ...C(Oe.props, "items")
402
751
  },
403
752
  setup: (e, {
404
- slots: n,
405
- expose: o
753
+ slots: t,
754
+ emit: n,
755
+ expose: s,
756
+ attrs: o
406
757
  }) => {
407
758
  const {
408
- elementMap: t,
409
- state: u,
410
- sendEvent: r,
411
- sendRequest: s
412
- } = ue(), m = w(() => Ae(e.columns, e.columnState, (g) => te(g))), y = (g, O = !0) => Pe(e.formElementMap, g, O), E = (g, O) => $e(t, g, O), l = (g, O) => {
413
- const W = G(m.value, (j) => {
414
- const x = v(j, ["extra", g]) || v(j, g);
415
- return O ? x !== !1 : x;
416
- });
417
- return ke(W, (j) => v(j, ["extra", `${g}Sort`]) || v(j, `${g}Sort`));
418
- }, f = w(() => l("form", !0)), a = w(() => l("detail", !0)), c = w(() => l("table", !0)), d = w(() => l("search"));
419
- let i;
420
- const h = (g) => {
421
- s(T.LIST, {
422
- ...i,
423
- ...g
759
+ elementMap: a,
760
+ formElementMap: r
761
+ } = Y(), c = e.elementMap || a, f = e.formElementMap || r, p = e.model || z({}), g = e.showState || z({}), m = e.readonlyState || z({}), u = e.disableState || z({});
762
+ W(() => {
763
+ e.showStateRules && ee(e.showStateRules, (I, E) => {
764
+ g[E] = I(p);
765
+ }), e.readonlyStateRules && ee(e.readonlyStateRules, (I, E) => {
766
+ m[E] = I(p);
767
+ }), e.disableStateRules && ee(e.disableStateRules, (I, E) => {
768
+ u[E] = I(p);
424
769
  });
425
- }, p = (g) => {
426
- r({
427
- type: g.action,
428
- payload: C(g, "action", "source"),
429
- source: g.source
430
- });
431
- };
432
- De(({
433
- type: g,
434
- payload: O,
435
- source: W
436
- }) => {
437
- if (W)
438
- return;
439
- let j = g, x = O == null ? void 0 : O.type;
440
- j === re.Success && (j = v(O, ["requestOpts", "action"]), x = D.SUCCESS);
441
- const {
442
- values: X,
443
- record: de
444
- } = O;
445
- switch (j) {
446
- case T.LIST:
447
- x === D.EMIT && (i = X, h());
448
- return;
449
- case T.ADD:
450
- x === D.EXECUTE && s(T.ADD, X, u.detailData);
451
- return;
452
- case T.EDIT:
453
- x === D.EXECUTE && s(T.EDIT, X, u.detailData);
770
+ }, p);
771
+ const l = R(() => e.readonly), y = R(() => De(e.columns, e.columnState, (I) => oe(I))), i = (I) => {
772
+ const E = wn(I, g, e.showStateRules);
773
+ n("finish", E, I);
774
+ }, d = j();
775
+ s(ce(e.formMethods || [], d)), Fn({
776
+ formState: p,
777
+ showState: g,
778
+ readonlyState: m,
779
+ disableState: u,
780
+ elementMap: c,
781
+ formElementMap: f,
782
+ readonly: l,
783
+ columns: y,
784
+ formRef: d,
785
+ ...e.provideExtra
786
+ });
787
+ const v = [{
788
+ value: U.RESET,
789
+ label: "\u91CD\u7F6E"
790
+ }, {
791
+ value: U.SUBMIT,
792
+ label: "\u63D0\u4EA4",
793
+ extraProps: {
794
+ type: "primary"
795
+ }
796
+ }], S = R(() => {
797
+ const I = e.operate, E = (I == null ? void 0 : I.items) || v;
798
+ return A(E, (N) => (!N.onClick && !b(I == null ? void 0 : I.itemState, [N.value, "onClick"]) && (N.value === U.RESET ? N.onClick = () => {
799
+ var F;
800
+ if (I != null && I.onReset) {
801
+ I.onReset();
454
802
  return;
455
- case T.DELETE:
456
- x === D.EMIT ? s(T.DELETE, de, e.rowKey) : x === D.SUCCESS && h();
803
+ }
804
+ (F = d.value) == null || F.resetFields();
805
+ } : N.value === U.SUBMIT ? N.onClick = () => {
806
+ var F;
807
+ if (I != null && I.onSubmit) {
808
+ I.onSubmit();
457
809
  return;
458
- }
459
- j && g === D.EXECUTE && s(j, X);
460
- });
461
- const S = ee(e.operates, (g, O) => ({
462
- ...g,
463
- [O.action]: O
464
- }), {}), P = (g) => v(S, g), N = w(() => e.listProps), F = w(() => e.formProps), I = w(() => e.descProps), A = w(() => e.modalProps);
465
- return Dt({
466
- columns: m,
467
- getSignColumns: l,
468
- getFormItemVNode: y,
469
- getItemVNode: E,
470
- elementMap: t,
471
- formElementMap: e.formElementMap,
472
- rowKey: e.rowKey,
473
- curdState: u,
474
- formColumns: f,
475
- descColumns: a,
476
- tableColumns: c,
477
- searchColumns: d,
478
- sendCurdEvent: p,
479
- operates: e.operates,
480
- getOperate: P,
481
- refreshList: h,
482
- listProps: N,
483
- formProps: F,
484
- descProps: I,
485
- modalProps: A
486
- }), o({
487
- sendCurdEvent: p,
488
- refreshList: h
489
- }), () => {
490
- var g;
491
- return (g = n.default) == null ? void 0 : g.call(n);
810
+ }
811
+ (F = d.value) == null || F.submit();
812
+ } : N.value === U.CONTINUE && (I == null ? void 0 : I.onContinue) && (N.onClick = () => {
813
+ I.onContinue();
814
+ })), N.value === U.SUBMIT && !Xe(N, "loading") && (N.loading = e.submitLoading), N));
815
+ }), P = (I) => {
816
+ const E = oe(I);
817
+ return E && t[E] ? t[E](I, p) : ot(f, I, e.needRules);
492
818
  };
819
+ ht({});
820
+ const k = $(Ue()), D = $(C(Oe.props, "items")), Z = b(a, In);
821
+ return () => Z ? h(Z, O({
822
+ ref: d,
823
+ class: e.clsName
824
+ }, C(o, "onFinish"), C(e, ...k, ...D, "onFinish", "operate"), {
825
+ model: p,
826
+ onFinish: i
827
+ }), {
828
+ default: () => {
829
+ var I, E, N;
830
+ return [(I = t.start) == null ? void 0 : I.call(t), f && J(y.value) > 0 && h(B, null, [e.row ? h(Oe, {
831
+ row: e.row,
832
+ col: e.col,
833
+ items: A(y.value, (F) => ({
834
+ rowKey: oe(F),
835
+ vNode: P(F),
836
+ col: b(F, ["extra", "col"])
837
+ }))
838
+ }, null) : A(y.value, (F) => P(F))]), (E = t.default) == null ? void 0 : E.call(t), e.operate && h(St, O({
839
+ clsName: "pro-form-operate",
840
+ items: S.value
841
+ }, C(e.operate, "items", "onReset", "onSubmit", "onContinue")), null), (N = t.end) == null ? void 0 : N.call(t)];
842
+ }
843
+ }) : null;
844
+ }
845
+ });
846
+ let Ee;
847
+ (function(e) {
848
+ e.AUTO = "AUTO", e.MANUAL = "MANUAL";
849
+ })(Ee || (Ee = {}));
850
+ const Be = () => ({
851
+ initEmit: {
852
+ type: Boolean,
853
+ default: !0
854
+ },
855
+ searchMode: {
856
+ type: String,
857
+ default: Ee.AUTO
858
+ },
859
+ debounceKeys: {
860
+ type: Array
861
+ },
862
+ debounceTypes: {
863
+ type: Array,
864
+ default: ["text"]
865
+ },
866
+ debounceTime: {
867
+ type: Number,
868
+ default: 800
493
869
  }
494
- }), le = L({
870
+ }), Tr = M({
495
871
  props: {
496
- ...C(ye.props, "state", "requests"),
497
- ...Me.props,
498
- curdState: {
499
- type: Object
872
+ ...Be(),
873
+ needRules: {
874
+ type: Boolean,
875
+ default: !1
500
876
  }
501
877
  },
502
878
  setup: (e, {
503
- slots: n,
504
- expose: o
879
+ slots: t,
880
+ expose: n
505
881
  }) => {
506
- const {
507
- elementMap: t,
508
- formElementMap: u
509
- } = Le(), r = $(), s = $(), m = e.curdState || B({
510
- detailData: {}
511
- }), y = {
512
- [T.LIST]: {
513
- convertParams: (a) => a,
514
- convertData: (a) => {
515
- var c;
516
- return (c = a.res) == null ? void 0 : c.data;
517
- },
518
- loadingName: "listLoading",
519
- stateName: "listData"
520
- },
521
- [T.DETAIL]: {
522
- convertParams: (a, c) => K(a, c),
523
- convertData: (a) => {
524
- var c;
525
- return (c = a.res) == null ? void 0 : c.data;
526
- },
527
- loadingName: "detailLoading",
528
- stateName: "detailData",
529
- label: "\u8BE6\u60C5"
530
- },
531
- [T.ADD]: {
532
- convertParams: (a, c) => ({
533
- body: {
534
- ...c,
535
- ...a
536
- }
537
- }),
538
- loadingName: "operateLoading",
539
- label: "\u6DFB\u52A0"
540
- },
541
- [T.EDIT]: {
542
- convertParams: (a, c) => ({
543
- body: {
544
- ...c,
545
- ...a
546
- }
547
- }),
548
- loadingName: "operateLoading",
549
- label: "\u7F16\u8F91"
550
- },
551
- [T.DELETE]: {
552
- convertParams: (a, c) => K(a, c),
553
- label: "\u5220\u9664"
882
+ const o = H()(Nn), a = e.model || z({}), r = new Set(e.debounceTypes), c = A(x(e.columns, (y) => {
883
+ const i = at(y);
884
+ return r.has(i);
885
+ }), (y) => oe(y)), f = j(), p = e.formMethods || [];
886
+ n(ce(p, f));
887
+ const g = () => {
888
+ var y;
889
+ (y = f.value) == null || y.submit();
890
+ }, m = $t(() => {
891
+ g();
892
+ }, e.debounceTime);
893
+ W(() => {
894
+ e.initEmit && g();
895
+ }, []);
896
+ const u = (y, i, d) => se(d, (v) => b(y, v) !== b(i, v));
897
+ Ye((y, i) => {
898
+ if (e.searchMode !== Ee.AUTO)
899
+ return;
900
+ const d = J(e.debounceKeys) > 0 ? e.debounceKeys : c;
901
+ if (J(d) > 0 && u(y, i, d)) {
902
+ m();
903
+ return;
554
904
  }
555
- }, E = M(e.operates, (a) => ({
556
- ...v(y, a.action),
557
- ...a
558
- })), l = G(E, (a) => a.actor), f = k(C(ye.props, "state", "requests"));
559
- return o({
560
- sendCurdEvent: (a) => {
561
- var c;
562
- (c = s.value) == null || c.sendCurdEvent(a);
563
- },
564
- refreshList: (a) => {
565
- var c;
566
- (c = s.value) == null || c.refreshList(a);
567
- },
568
- sendEvent: (a) => {
569
- var c;
570
- (c = r.value) == null || c.sendEvent(a);
571
- },
572
- sendRequest: (a, ...c) => {
573
- var d;
574
- (d = r.value) == null || d.sendRequest(a, ...c);
575
- }
576
- }), () => b(ye, R({
577
- ref: r
578
- }, K(e, f), {
579
- elementMap: e.elementMap || t,
580
- state: m,
581
- requests: l
582
- }), {
583
- default: () => [b(Me, R({
584
- ref: s
585
- }, C(e, ...f, "curdState", "operates"), {
586
- formElementMap: e.formElementMap || u,
587
- operates: E
588
- }), n)]
589
- });
905
+ g();
906
+ }, () => kt(a));
907
+ const l = $(C(Be(), "columns"));
908
+ return () => o ? h(o, O({
909
+ ref: f
910
+ }, C(e, l), {
911
+ model: a
912
+ }), t) : null;
590
913
  }
591
- }), At = () => ({
592
- defaultAddRecord: {
914
+ }), Ve = () => ({
915
+ readonly: {
916
+ type: Boolean,
917
+ default: void 0
918
+ },
919
+ fieldProps: {
920
+ type: Object
921
+ },
922
+ showProps: {
923
+ type: Object
924
+ },
925
+ slots: {
593
926
  type: Object
594
927
  }
595
- }), Ee = L({
928
+ }), Ir = (e, t) => ({
929
+ InputComp: n,
930
+ valueType: s,
931
+ name: o
932
+ }) => M({
933
+ name: o,
596
934
  props: {
597
- ...At()
935
+ ...e.props,
936
+ ...Ve()
598
937
  },
599
- setup: (e) => {
600
- var c;
938
+ setup: (a, {
939
+ slots: r
940
+ }) => {
601
941
  const {
602
- dispatch: n,
603
- sendRequest: o
604
- } = ue(), {
605
- rowKey: t,
606
- curdState: u,
607
- listProps: r,
608
- getOperate: s,
609
- refreshList: m
610
- } = se(), y = (c = r == null ? void 0 : r.value) == null ? void 0 : c.pageState, E = (d) => {
611
- const i = s(T.DETAIL);
612
- i != null && i.actor ? o(T.DETAIL, d, t) : n({
613
- type: "detailData",
614
- payload: at(d)
942
+ formState: c,
943
+ showState: f,
944
+ readonlyState: p,
945
+ disableState: g,
946
+ readonly: m,
947
+ elementMap: u
948
+ } = bt(), l = yt(), y = R(() => ue(a.readonly) ? a.readonly : ue(p[a.name]) ? p[a.name] : m.value), i = mt(a.name), d = l != null && l.pathList ? [...l.pathList, ...i] : i, v = (P) => {
949
+ ae(c, d, P);
950
+ }, S = $(Ve());
951
+ return () => {
952
+ const P = b(f, d);
953
+ if (ue(P) && !P)
954
+ return null;
955
+ const k = b(c, d), D = b(u, s);
956
+ return h(e, O(C(a, ...S, "name", "slots"), {
957
+ name: d
958
+ }), {
959
+ default: () => [y.value ? h(B, null, [D ? h(D, O({
960
+ value: k
961
+ }, a.fieldProps, {
962
+ showProps: a.showProps
963
+ }), r) : h("span", null, [k])]) : h(n, O(t(k, v, b(g, d)), a.fieldProps), r)],
964
+ ...a.slots
615
965
  });
616
- }, l = (d, {
617
- record: i
618
- }) => {
619
- d === D.EMIT && (n({
620
- type: "mode",
621
- payload: q.DETAIL
622
- }), E(i));
623
- }, f = (d) => {
624
- d === D.EMIT ? (n({
625
- type: "mode",
626
- payload: q.ADD
627
- }), n({
628
- type: "detailData",
629
- payload: e.defaultAddRecord || {}
630
- })) : d === D.SUCCESS && (y && (y.page = 1), m(), u.addAction === ae.CONTINUE ? n({
631
- type: "detailData",
632
- payload: e.defaultAddRecord || {}
633
- }) : n({
634
- type: "mode",
635
- payload: void 0
636
- }));
637
- }, a = (d, {
638
- record: i
639
- }) => {
640
- d === D.EMIT ? (n({
641
- type: "mode",
642
- payload: q.EDIT
643
- }), E(i)) : d === D.SUCCESS && (n({
644
- type: "mode",
645
- payload: void 0
646
- }), m());
647
966
  };
648
- return De(({
649
- type: d,
650
- payload: i,
651
- source: h
652
- }) => {
653
- if (h)
654
- return;
655
- let p = d, S = i == null ? void 0 : i.type;
656
- const P = i == null ? void 0 : i.record;
657
- switch (p === re.Success && (p = v(i, ["requestOpts", "action"]), S = D.SUCCESS), p) {
658
- case T.DETAIL:
659
- l(S, {
660
- record: P
661
- });
662
- break;
663
- case T.ADD:
664
- f(S);
665
- break;
666
- case T.EDIT:
667
- a(S, {
668
- record: P
669
- });
670
- break;
671
- }
672
- }), () => null;
673
967
  }
674
- }), _t = L({
675
- props: {
676
- ...le.props,
677
- ...Ee.props
968
+ });
969
+ function xn(e) {
970
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !be(e);
971
+ }
972
+ const jn = () => ({
973
+ clsName: {
974
+ type: String,
975
+ default: "pro-operate"
678
976
  },
679
- setup: (e, {
680
- slots: n,
681
- expose: o
682
- }) => {
683
- const t = $();
684
- o(Y(_e, t));
685
- const u = k(Ee.props);
686
- return () => b(le, R({
687
- ref: t
688
- }, C(e, u)), {
689
- default: () => {
690
- var r;
691
- return [b(Ee, K(e, u), null), (r = n.default) == null ? void 0 : r.call(n)];
692
- }
693
- });
694
- }
695
- }), Ot = () => ({
696
- defaultAddRecord: {
697
- type: Object
977
+ items: {
978
+ type: Array
698
979
  },
699
- routeBack: {
700
- type: Function
701
- }
702
- }), Se = L({
703
- props: {
704
- ...Ot()
980
+ itemState: {
981
+ type: Object
705
982
  },
706
- setup: (e) => {
707
- const n = ft(), o = pt(), {
708
- dispatch: t,
709
- sendRequest: u
710
- } = ue(), {
711
- rowKey: r,
712
- curdState: s
713
- } = se(), m = (f) => {
714
- f === D.PAGE && (t({
715
- type: "mode",
716
- payload: void 0
717
- }), t({
718
- type: "detailData",
719
- payload: {}
720
- }), t({
721
- type: "detailLoading",
722
- payload: !1
723
- }), t({
724
- type: "addAction",
725
- payload: void 0
726
- }));
727
- }, y = (f, {
728
- record: a
729
- }) => {
730
- f === D.EMIT ? n.push({
731
- path: `${o.path}/detail`,
732
- query: K(a, r)
733
- }) : f === D.PAGE && (t({
734
- type: "mode",
735
- payload: q.DETAIL
736
- }), u(T.DETAIL, o.query, r));
737
- }, E = (f) => {
738
- f === D.EMIT ? n.push({
739
- path: `${o.path}/add`
740
- }) : f === D.PAGE ? (t({
741
- type: "mode",
742
- payload: q.ADD
743
- }), t({
744
- type: "detailData",
745
- payload: e.defaultAddRecord || {}
746
- })) : f === D.SUCCESS && (s.addAction === ae.CONTINUE ? t({
747
- type: "detailData",
748
- payload: e.defaultAddRecord || {}
749
- }) : e.routeBack ? e.routeBack(T.ADD) : n.go(-1));
750
- }, l = (f, {
751
- record: a
752
- }) => {
753
- f === D.EMIT ? n.push({
754
- path: `${o.path}/edit`,
755
- query: K(a, r)
756
- }) : f === D.PAGE ? (t({
757
- type: "mode",
758
- payload: q.EDIT
759
- }), u(T.DETAIL, o.query, r)) : f === D.SUCCESS && (e.routeBack ? e.routeBack(T.EDIT) : n.go(-1));
760
- };
761
- return De(({
762
- type: f,
763
- payload: a,
764
- source: c
765
- }) => {
766
- if (c)
767
- return;
768
- let d = f, i = a == null ? void 0 : a.type;
769
- const h = a == null ? void 0 : a.record;
770
- switch (d === re.Success && (d = v(a, ["requestOpts", "action"]), i = D.SUCCESS), d) {
771
- case T.LIST:
772
- m(i);
773
- break;
774
- case T.DETAIL:
775
- y(i, {
776
- record: h
777
- });
778
- break;
779
- case T.ADD:
780
- E(i);
781
- break;
782
- case T.EDIT:
783
- l(i, {
784
- record: h
785
- });
786
- break;
787
- }
788
- }), () => null;
983
+ elementKey: {
984
+ type: String,
985
+ default: bn
789
986
  }
790
- }), Ht = L({
987
+ }), St = M({
791
988
  props: {
792
- ...le.props,
793
- ...Se.props
989
+ ...jn()
794
990
  },
795
991
  setup: (e, {
796
- slots: n,
797
- expose: o
992
+ slots: t
798
993
  }) => {
799
- const t = $();
800
- o(Y(_e, t));
801
- const u = k(Se.props);
802
- return () => b(le, R({
803
- ref: t
804
- }, C(e, u)), {
805
- default: () => {
806
- var r;
807
- return [b(Se, K(e, u), null), (r = n.default) == null ? void 0 : r.call(n)];
808
- }
809
- });
994
+ const n = H(), s = e.elementKey ? n(e.elementKey) : void 0, o = R(() => {
995
+ const r = x(e.items, (c) => w(c.show) ? c.show() : ue(c.show) ? c.show : !0);
996
+ return A(r, (c) => Xe(e.itemState, c.value) ? {
997
+ ...c,
998
+ ...b(e.itemState, c.value)
999
+ } : c);
1000
+ }), a = (r) => {
1001
+ var c;
1002
+ (c = r.onClick) == null || c.call(r, r.value);
1003
+ };
1004
+ return () => h("div", {
1005
+ class: e.clsName
1006
+ }, [A(o.value, (r) => {
1007
+ const c = w(r.disabled) ? r.disabled() : r.disabled, f = w(r.loading) ? r.loading() : r.loading, p = w(r.label) ? r.label() : r.label, g = w(r.extraProps) ? r.extraProps() : r.extraProps, m = {
1008
+ ...C(r, "show", "disabled", "element"),
1009
+ disabled: c
1010
+ };
1011
+ return r.element && w(r.element) ? r.element(m) : t[r.value] ? t[r.value](m) : s ? h(s, O({
1012
+ disabled: c,
1013
+ loading: f,
1014
+ onClick: () => a(r)
1015
+ }, g), xn(p) ? p : {
1016
+ default: () => [p]
1017
+ }) : h("div", {
1018
+ class: `${e.clsName}-item`,
1019
+ onClick: () => a(r)
1020
+ }, [p]);
1021
+ })]);
810
1022
  }
811
- });
812
- function Mt(e) {
813
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ie(e);
814
- }
815
- const Jt = (e, n) => L({
1023
+ }), qn = () => ({
1024
+ clsName: {
1025
+ type: String,
1026
+ default: "pro-table-toolbar-column"
1027
+ },
1028
+ signName: {
1029
+ type: String,
1030
+ default: "columnSetting"
1031
+ },
1032
+ popoverProps: Object
1033
+ }), Un = M({
816
1034
  props: {
817
- ...e.props,
818
- renderItem: {
819
- type: Function
820
- },
821
- signName: {
822
- type: String
823
- }
1035
+ ...qn()
824
1036
  },
825
- setup: (o, {
1037
+ setup: (e, {
826
1038
  slots: t
827
1039
  }) => {
828
- const {
829
- getItemVNode: u,
830
- curdState: r,
831
- descColumns: s,
832
- getSignColumns: m
833
- } = se(), y = w(() => {
834
- const E = o.signName ? m(o.signName) : s.value;
835
- return M(E, (l) => {
836
- var d;
837
- let f;
838
- const a = (d = o.renderItem) == null ? void 0 : d.call(o, l);
839
- if (a)
840
- return a;
841
- const c = v(r.detailData, l.dataIndex);
842
- return b(n, R({
843
- key: l.dataIndex,
844
- label: l.title
845
- }, v(l.extra, "desc")), Mt(f = u(l, c)) ? f : {
846
- default: () => [f]
847
- });
1040
+ const n = H(), s = n(En), o = n(Cn), {
1041
+ originColumns: a,
1042
+ state: r
1043
+ } = Bn(), [c, f] = Ut();
1044
+ Ye(() => {
1045
+ f();
1046
+ }, () => r.selectIds);
1047
+ const p = R(() => V(r.selectIds, (i, d) => ({
1048
+ ...i,
1049
+ [d]: !0
1050
+ }), {})), g = (i) => ft(i, e.signName), m = R(() => {
1051
+ const i = Ft(a.value, (v) => {
1052
+ const S = g(v);
1053
+ return S != null && S.disabled ? !0 : b(p.value, v.dataIndex);
1054
+ }), d = se(a.value, (v) => {
1055
+ const S = g(v);
1056
+ return S != null && S.disabled ? !0 : b(p.value, v.dataIndex);
848
1057
  });
849
- });
850
- return () => b(e, o, {
1058
+ return {
1059
+ checked: i,
1060
+ indeterminate: i ? !1 : d
1061
+ };
1062
+ }), u = (i) => {
1063
+ var v;
1064
+ (Se(i) ? (v = i.target) == null ? void 0 : v.checked : i) ? r.selectIds = A(a.value, (S) => S.dataIndex) : r.selectIds = A(x(a.value, (S) => {
1065
+ var P;
1066
+ return !!((P = g(S)) != null && P.disabled);
1067
+ }), (S) => S.dataIndex);
1068
+ }, l = () => {
1069
+ r.selectIds = A(x(a.value, (i) => {
1070
+ var d;
1071
+ return ((d = g(i)) == null ? void 0 : d.initShow) !== !1;
1072
+ }), (i) => i.dataIndex);
1073
+ }, y = (i, d) => {
1074
+ var S;
1075
+ (Se(d) ? (S = d.target) == null ? void 0 : S.checked : d) ? r.selectIds = [...r.selectIds, i.dataIndex] : r.selectIds = x(r.selectIds, (P) => i.dataIndex !== P);
1076
+ };
1077
+ return () => s ? h(s, O({
1078
+ trigger: "click"
1079
+ }, e.popoverProps), {
851
1080
  default: () => {
852
- var E, l;
853
- return [(E = t.start) == null ? void 0 : E.call(t), y.value, (l = t.default) == null ? void 0 : l.call(t)];
1081
+ var i;
1082
+ return [((i = t.default) == null ? void 0 : i.call(t)) || "\u5217\u8BBE\u7F6E"];
854
1083
  },
855
- ...C(t, "default", "start")
856
- });
1084
+ content: () => h("div", {
1085
+ class: `${e.clsName}`
1086
+ }, [h("div", {
1087
+ class: `${e.clsName}-header`
1088
+ }, [h(o, {
1089
+ checked: m.value.checked,
1090
+ indeterminate: m.value.indeterminate,
1091
+ onChange: u
1092
+ }, {
1093
+ default: () => [je("\u5217\u5C55\u793A")]
1094
+ }), h("a", {
1095
+ onClick: l
1096
+ }, [je("\u91CD\u7F6E")])]), h("div", {
1097
+ key: c.value,
1098
+ class: `${e.clsName}-list`
1099
+ }, [A(a.value, (i) => {
1100
+ const d = g(i);
1101
+ return h(o, {
1102
+ checked: b(p.value, i.dataIndex, !1),
1103
+ disabled: d == null ? void 0 : d.disabled,
1104
+ onChange: (v) => {
1105
+ y(i, v);
1106
+ }
1107
+ }, {
1108
+ default: () => [i.title]
1109
+ });
1110
+ })])]),
1111
+ ...C(t, "default")
1112
+ }) : null;
857
1113
  }
858
- }), wt = () => ({
859
- signName: {
860
- type: String
861
- },
862
- modelName: {
1114
+ }), vt = Symbol("pro-table"), Bn = () => Q(vt), Vn = (e) => {
1115
+ re(vt, e);
1116
+ }, Ge = () => ({
1117
+ clsName: {
863
1118
  type: String,
864
- default: "detailData"
1119
+ default: "pro-table"
865
1120
  },
866
- operateBar: {
867
- type: Boolean,
868
- default: !0
1121
+ operate: {
1122
+ type: Object
869
1123
  },
870
- showContinueAdd: {
871
- type: Boolean,
872
- default: !1
1124
+ columnEmptyText: {
1125
+ type: String
873
1126
  },
874
- okText: {
875
- type: String,
876
- default: "\u786E\u5B9A"
1127
+ column: {
1128
+ type: Object
1129
+ },
1130
+ serialNumber: {
1131
+ type: [Boolean, Object]
877
1132
  },
878
- okButtonProps: {
1133
+ paginationState: {
879
1134
  type: Object
880
1135
  },
881
- continueText: {
882
- type: String,
883
- default: "\u786E\u5B9A\u5E76\u7EE7\u7EED"
1136
+ toolbar: {
1137
+ type: Object
884
1138
  },
885
- continueButtonProps: {
1139
+ provideExtra: {
886
1140
  type: Object
1141
+ },
1142
+ tableMethods: {
1143
+ type: Array
887
1144
  }
888
- }), Qt = (e, n, o, t) => L({
1145
+ }), Mr = M({
889
1146
  inheritAttrs: !1,
890
1147
  props: {
891
- ...e.props,
892
- ...wt()
1148
+ ...de,
1149
+ ...Ge()
893
1150
  },
894
- setup: (u, {
895
- slots: r,
896
- attrs: s,
897
- expose: m
1151
+ setup: (e, {
1152
+ slots: t,
1153
+ expose: n,
1154
+ attrs: s
898
1155
  }) => {
899
1156
  const {
900
- elementMap: y,
901
- formElementMap: E,
902
- curdState: l,
903
- formColumns: f,
904
- getSignColumns: a,
905
- sendCurdEvent: c
906
- } = se(), d = $(), i = w(() => u.signName ? a(u.signName) : f.value), h = (P, N) => {
907
- if (s.onFinish) {
908
- s.onFinish(P, N);
909
- return;
1157
+ elementMap: o
1158
+ } = Y(), a = e.elementMap || o, r = b(o, Dn), c = () => ({
1159
+ title: "\u5E8F\u53F7",
1160
+ dataIndex: "serialNumber",
1161
+ width: 80,
1162
+ ...e.column,
1163
+ ...ue(e.serialNumber) ? void 0 : e.serialNumber,
1164
+ customRender: ({
1165
+ index: d
1166
+ }) => {
1167
+ var v, S;
1168
+ return ((v = e.paginationState) == null ? void 0 : v.page) && ((S = e.paginationState) == null ? void 0 : S.pageSize) ? e.paginationState.pageSize * (e.paginationState.page - 1) + d + 1 : d + 1;
910
1169
  }
911
- l.mode === q.EDIT ? c({
912
- action: T.EDIT,
913
- type: D.EXECUTE,
914
- values: P
915
- }) : c({
916
- action: T.ADD,
917
- type: D.EXECUTE,
918
- values: P
1170
+ }), f = () => {
1171
+ const d = e.operate, v = A(d.items, (P) => ({
1172
+ ...P,
1173
+ ...b(d.itemState, P.value)
1174
+ })), S = Je(v, (P) => P.sort);
1175
+ return {
1176
+ ...e.column,
1177
+ title: "\u64CD\u4F5C",
1178
+ dataIndex: "operate",
1179
+ fixed: "right",
1180
+ ...d.column,
1181
+ customRender: ({
1182
+ record: P
1183
+ }) => {
1184
+ const k = A(S, (D) => ({
1185
+ value: D.value,
1186
+ label: D.label,
1187
+ show: w(D.show) ? D.show(P) : D.show,
1188
+ disabled: w(D.disabled) ? D.disabled(P) : D.disabled,
1189
+ loading: w(D.loading) ? D.loading(P) : D.loading,
1190
+ extraProps: w(D.extraProps) ? D.extraProps(P) : D.extraProps,
1191
+ onClick: () => {
1192
+ var Z;
1193
+ (Z = D.onClick) == null || Z.call(D, P);
1194
+ },
1195
+ element: w(D.element) ? () => D.element(P, D) : D.element
1196
+ }));
1197
+ return h(St, {
1198
+ clsName: d.clsName || `${e.clsName}-operate`,
1199
+ items: k,
1200
+ elementKey: d.elementKey
1201
+ }, null);
1202
+ }
1203
+ };
1204
+ }, g = z({
1205
+ selectIds: (() => {
1206
+ var S, P;
1207
+ const d = ((P = (S = e.toolbar) == null ? void 0 : S.columnSetting) == null ? void 0 : P.signName) || "columnSetting", v = x(e.columns, (k) => {
1208
+ var D;
1209
+ return ((D = ft(k, d)) == null ? void 0 : D.initShow) !== !1;
1210
+ });
1211
+ return e.serialNumber && v.unshift(c()), A(v, (k) => k.dataIndex);
1212
+ })()
1213
+ }), m = Dt(e, "columns"), u = R(() => {
1214
+ const d = V(g.selectIds, (v, S) => ({
1215
+ ...v,
1216
+ [S]: !0
1217
+ }), {});
1218
+ return x(e.columns, (v) => b(d, v.dataIndex));
1219
+ }), l = R(() => {
1220
+ const d = De(u.value, e.columnState, (S) => S.dataIndex), v = A(d, (S) => {
1221
+ const P = {
1222
+ ...e.column,
1223
+ ...S
1224
+ };
1225
+ return S.customRender || (P.customRender = ({
1226
+ text: k
1227
+ }) => ke(a, {
1228
+ ...S,
1229
+ showProps: {
1230
+ ...S.showProps,
1231
+ content: e.columnEmptyText
1232
+ }
1233
+ }, k) || k || e.columnEmptyText), P;
919
1234
  });
920
- }, p = () => {
921
- var P;
922
- l.addAction = ae.NORMAL, (P = d.value) == null || P.submit();
923
- }, S = () => {
924
- var P;
925
- l.addAction = ae.CONTINUE, (P = d.value) == null || P.submit();
1235
+ return e.serialNumber && v.unshift(c()), e.operate && e.operate.items && se(e.operate.items, (S) => S.show) && v.push(f()), v;
1236
+ }), y = j();
1237
+ Vn({
1238
+ columns: l,
1239
+ originColumns: m,
1240
+ state: g,
1241
+ tableRef: y,
1242
+ toolbar: e.toolbar,
1243
+ ...e.provideExtra
1244
+ }), n(ce(e.tableMethods || [], y));
1245
+ const i = $(Ge());
1246
+ return () => {
1247
+ var v, S, P;
1248
+ if (!r)
1249
+ return null;
1250
+ const d = t.toolbar ? t.toolbar() : void 0;
1251
+ return h("div", O({
1252
+ class: e.clsName
1253
+ }, K(s, "class")), [(d || ((v = e.toolbar) == null ? void 0 : v.columnSetting)) && h("div", {
1254
+ class: `${e.clsName}-toolbar`
1255
+ }, [d, ((S = e.toolbar) == null ? void 0 : S.columnSetting) && h(Un, (P = e.toolbar) == null ? void 0 : P.columnSetting, null)]), h(r, O({
1256
+ ref: y
1257
+ }, C(s, "class"), C(e, i), {
1258
+ columns: l.value
1259
+ }), t)]);
926
1260
  };
927
- return m(Y(t, d)), () => b(e, R({
928
- ref: d
929
- }, C(s, "onFinish"), u, {
930
- elementMap: u.elementMap || y,
931
- formElementMap: u.formElementMap || E,
932
- columns: u.columns || i.value,
933
- model: u.model || l[u.modelName],
934
- readonly: l.mode === q.DETAIL,
935
- onFinish: h
936
- }, o == null ? void 0 : o(l)), {
937
- default: () => {
938
- var P, N, F, I, A;
939
- return [(P = r.divide) == null ? void 0 : P.call(r), u.operateBar && b("div", {
940
- class: "pro-curd-form-operate"
941
- }, [(N = r.operateStart) == null ? void 0 : N.call(r), l.mode !== q.DETAIL && b(n, R({
942
- onClick: p
943
- }, u.okButtonProps, {
944
- loading: l.operateLoading
945
- }), {
946
- default: () => [u.okText]
947
- }), (F = r.operateCenter) == null ? void 0 : F.call(r), u.showContinueAdd && l.mode === q.ADD && b(n, R({
948
- onClick: S
949
- }, u.continueButtonProps, {
950
- loading: l.operateLoading
951
- }), {
952
- default: () => [u.continueText]
953
- }), (I = r.operateEnd) == null ? void 0 : I.call(r)]), (A = r.default) == null ? void 0 : A.call(r)];
954
- },
955
- ...C(r, "default", "divide", "operateStart", "operateCenter", "operateEnd")
956
- });
957
1261
  }
958
- }), Rt = () => ({
959
- extraInSearch: {
1262
+ }), Gn = () => ({
1263
+ title: {
1264
+ type: String
1265
+ },
1266
+ subTitle: {
1267
+ type: String
1268
+ },
1269
+ showBack: Boolean,
1270
+ hideWhileNoHistory: {
1271
+ type: Boolean,
1272
+ default: !0
1273
+ }
1274
+ }), Le = M({
1275
+ props: {
1276
+ ...Gn()
1277
+ },
1278
+ setup: (e, {
1279
+ slots: t,
1280
+ emit: n
1281
+ }) => () => {
1282
+ var o, a, r, c;
1283
+ const s = e.hideWhileNoHistory && ((a = (o = window.history) == null ? void 0 : o.state) == null ? void 0 : a.back) || e.hideWhileNoHistory === !1;
1284
+ return h("div", {
1285
+ class: "pro-page-header"
1286
+ }, [e.showBack && s && h("div", {
1287
+ class: "pro-page-header-back",
1288
+ onClick: () => {
1289
+ n("back");
1290
+ }
1291
+ }, [t.backIcon ? t.backIcon() : "\u8FD4\u56DE"]), h("div", {
1292
+ class: "pro-page-header-title"
1293
+ }, [t.title ? t.title() : e.title]), h("div", {
1294
+ class: "pro-page-header-sub-title"
1295
+ }, [t.subTitle ? t.subTitle() : e.subTitle]), h("div", {
1296
+ class: "pro-page-header-space"
1297
+ }, [(r = t.space) == null ? void 0 : r.call(t)]), h("div", {
1298
+ class: "pro-page-header-extra"
1299
+ }, [(c = t.extra) == null ? void 0 : c.call(t)])]);
1300
+ }
1301
+ }), _n = () => ({
1302
+ loading: {
960
1303
  type: Boolean,
961
- default: void 0
1304
+ default: !1
1305
+ },
1306
+ loadingOpts: Object,
1307
+ fillMode: {
1308
+ type: Boolean,
1309
+ default: !0
1310
+ }
1311
+ }), Dr = M({
1312
+ props: {
1313
+ ...Le.props,
1314
+ ..._n()
1315
+ },
1316
+ setup: (e, {
1317
+ slots: t,
1318
+ emit: n
1319
+ }) => {
1320
+ const o = H()(dt), a = j(), r = j(0);
1321
+ Bt(a, (f) => {
1322
+ var g;
1323
+ const p = (g = f[0]) == null ? void 0 : g.contentRect;
1324
+ r.value = p == null ? void 0 : p.height;
1325
+ });
1326
+ const c = $(Le.props);
1327
+ return () => {
1328
+ var g, m, u;
1329
+ const f = e.title || t.title || e.subTitle || t.subTitle || t.extra, p = !!t.footer;
1330
+ return h("div", {
1331
+ class: "pro-page"
1332
+ }, [f && h(Le, O(K(e, c), {
1333
+ onBack: () => {
1334
+ n("back");
1335
+ }
1336
+ }), K(t, "backIcon", "title", "subTitle", "space", "extra")), e.loading && o ? h(o, O({
1337
+ loading: !0
1338
+ }, e.loadingOpts), {
1339
+ default: () => [h("div", {
1340
+ class: "pro-loading-dom"
1341
+ }, null)]
1342
+ }) : h("div", {
1343
+ ref: a,
1344
+ style: r.value > 0 ? `height:${r.value > 0}` : "",
1345
+ class: "pro-page-content"
1346
+ }, [e.fillMode ? h(B, null, [r.value > 0 && ((g = t.default) == null ? void 0 : g.call(t))]) : (m = t.default) == null ? void 0 : m.call(t)]), !e.loading && p && h("div", {
1347
+ class: "pro-page-footer"
1348
+ }, [(u = t.footer) == null ? void 0 : u.call(t)])]);
1349
+ };
1350
+ }
1351
+ }), zn = Object.freeze({
1352
+ page: 1,
1353
+ pageSize: 10
1354
+ }), Wn = () => ({
1355
+ clsName: {
1356
+ type: String,
1357
+ default: "pro-list"
962
1358
  },
963
1359
  searchProps: {
964
1360
  type: Object
@@ -969,543 +1365,900 @@ const Jt = (e, n) => L({
969
1365
  paginationProps: {
970
1366
  type: Object
971
1367
  },
972
- showPagination: {
973
- type: Boolean,
974
- default: !0
975
- },
976
1368
  pageState: {
977
1369
  type: Object
978
1370
  }
979
- }), Yt = (e, n) => L({
1371
+ }), _e = M({
980
1372
  props: {
981
- ...Rt()
1373
+ ...Wn()
982
1374
  },
983
- setup: (o, {
984
- slots: t
1375
+ setup: (e, {
1376
+ slots: t,
1377
+ emit: n
985
1378
  }) => {
986
- const {
987
- elementMap: u,
988
- formElementMap: r,
989
- curdState: s,
990
- searchColumns: m,
991
- tableColumns: y,
992
- sendCurdEvent: E,
993
- operates: l
994
- } = se(), f = o.pageState || B({
995
- ...It
1379
+ const s = H(), o = s(On), a = s(Ln), r = s(Pn), c = e.pageState || z({
1380
+ ...zn
996
1381
  });
997
- let a;
998
- const c = () => {
999
- E({
1000
- action: T.LIST,
1001
- type: D.EMIT,
1002
- values: {
1003
- ...a,
1004
- ...f
1005
- }
1382
+ let f;
1383
+ const p = () => {
1384
+ n("search", {
1385
+ ...f,
1386
+ ...c
1006
1387
  });
1007
- }, d = (p) => {
1008
- a = p, f.page = 1, c();
1009
- }, i = M(G(l, (p) => {
1010
- const S = p.action;
1011
- return S === T.DETAIL || S === T.EDIT || S === T.DELETE || p.tableOperate;
1012
- }), (p) => {
1013
- const S = {
1014
- ...K(p, "label", "element", "disabled", "sort", "onClick"),
1015
- show: ot(p == null ? void 0 : p.show) ? !1 : p == null ? void 0 : p.show,
1016
- value: p.action
1017
- };
1018
- return S.onClick || (S.onClick = (P) => {
1019
- E({
1020
- action: p.action,
1021
- type: D.EMIT,
1022
- record: P
1023
- });
1024
- }), S;
1025
- }), h = (p) => M(p, (S) => S.onClick ? S : {
1026
- ...S,
1027
- onClick: (P) => {
1028
- E({
1029
- action: "operate",
1030
- type: S.value,
1031
- record: P
1032
- });
1033
- }
1034
- });
1388
+ }, g = (i, d) => {
1389
+ f = i, c.page = d || 1, p();
1390
+ }, m = (i, d) => {
1391
+ c.page = i, c.pageSize = d, p();
1392
+ }, u = le(t, "search"), l = le(t, "table"), y = le(t, "pagination");
1035
1393
  return () => {
1036
- var N, F, I, A, g, O, W, j, x, X;
1037
- const p = o.tableProps, S = {
1038
- elementMap: u,
1039
- columns: y.value,
1040
- ...C(p, "slots", "operate"),
1041
- operate: xe({
1042
- items: i
1043
- }, p == null ? void 0 : p.operate, (de, Oe) => {
1044
- if (U(de) && U(Oe))
1045
- return ct(de, h(Oe));
1046
- }),
1394
+ var i, d, v, S;
1395
+ return h(B, null, [(i = t.start) == null ? void 0 : i.call(t), t.search ? t.search({
1396
+ executeSearchWithResetPage: g,
1397
+ pageState: c
1398
+ }) : h(B, null, [o ? h(o, O({
1399
+ clsName: `${e.clsName}-search`
1400
+ }, C(e.searchProps, "onFinish"), {
1401
+ onFinish: (P) => g(P)
1402
+ }), u) : null]), (d = t.divide) == null ? void 0 : d.call(t), t.table ? t.table() : h(B, null, [h(B, null, [a ? h(a, O({
1403
+ clsName: `${e.clsName}-table`,
1047
1404
  paginationState: {
1048
- page: f.page,
1049
- pageSize: f.pageSize
1050
- },
1051
- loading: s.listLoading,
1052
- dataSource: (N = s.listData) == null ? void 0 : N.dataSource
1053
- }, P = t.extra ? b("div", {
1054
- class: "pro-curd-list-extra"
1055
- }, [t.extra()]) : null;
1056
- return b(oe, null, [(F = t.start) == null ? void 0 : F.call(t), t.search ? t.search({
1057
- executeSearchWithResetPage: d
1058
- }) : b(e, R({
1059
- formElementMap: r,
1060
- columns: m.value
1061
- }, C(o.searchProps, "slots"), {
1062
- onFinish: d
1063
- }), {
1064
- default: () => [o.extraInSearch && P],
1065
- ...(I = o.searchProps) == null ? void 0 : I.slots
1066
- }), (A = t.divide) == null ? void 0 : A.call(t), !o.extraInSearch && P, t.table ? t.table(S) : b(n, S, p == null ? void 0 : p.slots), (g = t.divide2) == null ? void 0 : g.call(t), o.showPagination && b("div", {
1067
- class: "pro-curd-list-footer"
1068
- }, [(O = t.footerStart) == null ? void 0 : O.call(t), (j = t.pagination) == null ? void 0 : j.call(t, f, (W = s.listData) == null ? void 0 : W.total, c), (x = t.footerEnd) == null ? void 0 : x.call(t)]), (X = t.end) == null ? void 0 : X.call(t)]);
1405
+ page: c.page,
1406
+ pageSize: c.pageSize
1407
+ }
1408
+ }, e.tableProps), l) : null])]), (v = t.divide2) == null ? void 0 : v.call(t), t.pagination ? t.pagination({
1409
+ executePageChange: m,
1410
+ pageState: c
1411
+ }) : h(B, null, [r ? h(r, O({
1412
+ clsName: `${e.clsName}-pagination`
1413
+ }, C(e.paginationProps, "onChange"), {
1414
+ page: c.page,
1415
+ pageSize: c.pageSize,
1416
+ onComposeChange: m
1417
+ }), y) : null]), (S = t.end) == null ? void 0 : S.call(t)]);
1069
1418
  };
1070
1419
  }
1071
- }), He = Symbol("pro-form-list"), Je = () => J(He), Qe = (e) => {
1072
- Q(He, e);
1073
- }, Nt = L({
1074
- props: {
1075
- pathList: {
1076
- type: Array
1077
- }
1420
+ }), ze = () => ({
1421
+ clsName: {
1422
+ type: String,
1423
+ default: "pro-desc"
1078
1424
  },
1079
- setup: (e, {
1080
- slots: n
1081
- }) => (Qe({
1082
- pathList: e.pathList
1083
- }), () => {
1084
- var o;
1085
- return (o = n.default) == null ? void 0 : o.call(n);
1086
- })
1087
- }), Zt = (e) => L({
1425
+ model: {
1426
+ type: Object
1427
+ }
1428
+ }), Hn = M({
1088
1429
  props: {
1089
- ...e.props,
1090
- rowKey: {
1091
- type: String,
1092
- default: "id"
1093
- }
1430
+ ...de,
1431
+ ...ze()
1094
1432
  },
1095
- setup: (n, {
1096
- slots: o
1433
+ setup: (e, {
1434
+ slots: t
1097
1435
  }) => {
1098
1436
  const {
1099
- formState: t,
1100
- readonly: u
1101
- } = Ze(), r = Je(), s = We(n.name), m = r != null && r.pathList ? [...r.pathList, ...s] : s, y = () => {
1102
- let l = v(t, m);
1103
- U(l) || (l = []), l.push({
1104
- [n.rowKey]: new Date().valueOf()
1105
- }), _(t, m, l);
1106
- }, E = (l) => {
1107
- const f = v(t, m);
1108
- V(f) <= 0 || f.splice(l, 1);
1109
- };
1110
- return () => b(e, C(n, "rowKey"), {
1111
- default: () => {
1112
- var l;
1113
- return [M(v(t, m), (f, a) => b(Nt, {
1114
- key: f[n.rowKey] || a,
1115
- pathList: [...m, a]
1116
- }, {
1117
- default: () => {
1118
- var c, d, i;
1119
- return [b("div", {
1120
- class: "pro-form-list-item"
1121
- }, [(c = o.default) == null ? void 0 : c.call(o), !u.value && b(oe, null, [b("div", {
1122
- class: "pro-form-list-item-add",
1123
- onClick: y
1124
- }, [(d = o.itemAdd) == null ? void 0 : d.call(o)]), b("div", {
1125
- class: "pro-form-list-item-minus",
1126
- onClick: () => E(a)
1127
- }, [(i = o.itemMinus) == null ? void 0 : i.call(o)])])])];
1128
- }
1129
- })), !u.value && b("div", {
1130
- class: "pro-form-list-add",
1131
- onClick: y
1132
- }, [(l = o.add) == null ? void 0 : l.call(o)])];
1133
- }
1437
+ elementMap: n
1438
+ } = Y(), s = e.elementMap || n, o = H(), a = o(Sn), r = o(vn), c = R(() => De(e.columns, e.columnState, "dataIndex")), f = A(e.columns, (u) => u.dataIndex), p = C(t, ...f, ...A(f, (u) => u + "Label")), g = $(de), m = $(ze());
1439
+ return () => !a || !r ? null : h(a, O({
1440
+ class: e.clsName
1441
+ }, C(e, ...g, ...m, "model")), {
1442
+ default: () => [A(c.value, (u) => {
1443
+ const l = u.dataIndex, y = b(e.model, l);
1444
+ return h(r, O({
1445
+ class: `${e.clsName}-item`
1446
+ }, b(u.extra, "desc"), {
1447
+ label: t[`${l}Label`] ? t[`${l}Label`]() : u.title
1448
+ }), {
1449
+ default: () => [t[l] ? t[l]() : ke(s, u, y)]
1450
+ });
1451
+ })],
1452
+ ...p
1134
1453
  });
1135
1454
  }
1136
- }), Ye = Symbol("pro-form"), Ze = () => J(Ye), jt = (e) => {
1137
- Q(Ye, e);
1138
- }, we = () => ({
1139
- model: {
1140
- type: Object
1141
- },
1142
- readonly: {
1143
- type: Boolean,
1144
- default: void 0
1145
- },
1146
- showState: {
1147
- type: Object
1148
- },
1149
- showStateRules: {
1150
- type: Object
1455
+ }), Pt = Symbol("pro-curd"), G = () => Q(Pt), Xn = (e) => re(Pt, e);
1456
+ var T = /* @__PURE__ */ ((e) => (e.LIST = "LIST", e.DETAIL = "DETAIL", e.ADD = "ADD", e.EDIT = "EDIT", e.DELETE = "DELETE", e))(T || {}), L = /* @__PURE__ */ ((e) => (e.EMIT = "EMIT", e.EXECUTE = "EXECUTE", e.PAGE = "PAGE", e.SUCCESS = "SUCCESS", e.FAIL = "FAIL", e))(L || {}), te = /* @__PURE__ */ ((e) => (e.ADD = "ADD", e.EDIT = "EDIT", e.DETAIL = "DETAIL", e))(te || {}), pe = /* @__PURE__ */ ((e) => (e.NORMAL = "NORMAL", e.CONTINUE = "CONTINUE", e))(pe || {});
1457
+ const Jn = () => ({
1458
+ rowKey: {
1459
+ type: String,
1460
+ default: "id"
1151
1461
  },
1152
- readonlyState: {
1153
- type: Object
1462
+ operates: {
1463
+ type: Array
1154
1464
  },
1155
- readonlyStateRules: {
1465
+ listProps: {
1156
1466
  type: Object
1157
1467
  },
1158
- disableState: {
1468
+ formProps: {
1159
1469
  type: Object
1160
1470
  },
1161
- disableStateRules: {
1471
+ descProps: {
1162
1472
  type: Object
1163
1473
  },
1164
- needRules: {
1165
- type: Boolean,
1166
- default: !0
1167
- },
1168
- provideExtra: {
1474
+ modalProps: {
1169
1475
  type: Object
1170
1476
  }
1171
- }), en = (e, n, o) => L({
1172
- inheritAttrs: !1,
1477
+ }), Et = ["sendCurdEvent", "refreshList", "sendEvent", "sendRequest"], We = M({
1173
1478
  props: {
1174
- ...e.props,
1175
- ...Ce,
1176
- ...we(),
1177
- ...C(n.props, "items")
1479
+ ...de,
1480
+ ...Jn()
1178
1481
  },
1179
- setup: (t, {
1180
- slots: u,
1181
- emit: r,
1182
- expose: s,
1183
- attrs: m
1482
+ setup: (e, {
1483
+ slots: t,
1484
+ expose: n
1184
1485
  }) => {
1185
1486
  const {
1186
- elementMap: y,
1187
- formElementMap: E
1188
- } = Le(), l = t.elementMap || y, f = t.formElementMap || E, a = t.model || B({}), c = t.showState || B({}), d = t.readonlyState || B({}), i = t.disableState || B({});
1189
- ce(() => {
1190
- t.showStateRules && z(t.showStateRules, (I, A) => {
1191
- c[A] = I(a);
1192
- }), t.readonlyStateRules && z(t.readonlyStateRules, (I, A) => {
1193
- d[A] = I(a);
1194
- }), t.disableStateRules && z(t.disableStateRules, (I, A) => {
1195
- i[A] = I(a);
1487
+ elementMap: s,
1488
+ state: o,
1489
+ sendEvent: a,
1490
+ sendRequest: r
1491
+ } = he(), c = R(() => De(e.columns, e.columnState, (E) => oe(E))), f = (E, N = !0) => ot(e.formElementMap, E, N), p = (E, N) => ke(s, E, N), g = (E, N) => {
1492
+ const F = x(c.value, (q) => {
1493
+ const _ = b(q, ["extra", E]) || b(q, E);
1494
+ return N ? _ !== !1 : _;
1196
1495
  });
1197
- }, a);
1198
- const h = w(() => t.readonly), p = w(() => Ae(t.columns, t.columnState, (I) => te(I))), S = (I) => {
1199
- const A = Ct(I, c, t.showStateRules);
1200
- r("finish", A, I);
1201
- }, P = $();
1202
- s(Y(o, P)), jt({
1203
- formState: a,
1204
- showState: c,
1205
- readonlyState: d,
1206
- disableState: i,
1207
- elementMap: l,
1208
- formElementMap: f,
1209
- readonly: h,
1210
- columns: p,
1211
- formRef: P,
1212
- ...t.provideExtra
1213
- }), Qe({});
1214
- const N = k(we()), F = k(C(n.props, "items"));
1215
- return () => b(e, R({
1216
- ref: P
1217
- }, C(m, "onFinish"), C(t, ...N, ...F, "onFinish"), {
1218
- model: a,
1219
- onFinish: S
1220
- }), {
1221
- default: () => {
1222
- var I, A;
1223
- return [(I = u.start) == null ? void 0 : I.call(u), f && V(p.value) > 0 && b(oe, null, [t.row ? b(n, {
1224
- row: t.row,
1225
- col: t.col,
1226
- items: M(p.value, (g) => ({
1227
- rowKey: te(g),
1228
- vNode: Pe(f, g, t.needRules),
1229
- col: v(g, ["extra", "col"])
1230
- }))
1231
- }, null) : M(p.value, (g) => Pe(f, g, t.needRules))]), (A = u.default) == null ? void 0 : A.call(u)];
1232
- },
1233
- ...C(u, "default")
1496
+ return Je(F, (q) => b(q, ["extra", `${E}Sort`]) || b(q, `${E}Sort`));
1497
+ }, m = R(() => g("form", !0)), u = R(() => g("detail", !0)), l = R(() => g("table", !0)), y = R(() => g("search"));
1498
+ let i;
1499
+ const d = (E) => {
1500
+ r(T.LIST, {
1501
+ ...i,
1502
+ ...E
1503
+ });
1504
+ }, v = (E) => {
1505
+ a({
1506
+ type: E.action,
1507
+ payload: C(E, "action", "source"),
1508
+ source: E.source
1509
+ });
1510
+ };
1511
+ Ke(({
1512
+ type: E,
1513
+ payload: N,
1514
+ source: F
1515
+ }) => {
1516
+ if (F)
1517
+ return;
1518
+ let q = E, _ = N == null ? void 0 : N.type;
1519
+ q === fe.Success && (q = b(N, ["requestOpts", "action"]), _ = L.SUCCESS);
1520
+ const {
1521
+ values: ge,
1522
+ record: Tt
1523
+ } = N;
1524
+ switch (q) {
1525
+ case T.LIST:
1526
+ _ === L.EMIT && (i = ge, d());
1527
+ return;
1528
+ case T.ADD:
1529
+ _ === L.EXECUTE && r(T.ADD, ge, o.detailData);
1530
+ return;
1531
+ case T.EDIT:
1532
+ _ === L.EXECUTE && r(T.EDIT, ge, o.detailData);
1533
+ return;
1534
+ case T.DELETE:
1535
+ _ === L.EMIT ? r(T.DELETE, Tt, e.rowKey) : _ === L.SUCCESS && d();
1536
+ return;
1537
+ }
1538
+ q && E === L.EXECUTE && r(q, ge);
1234
1539
  });
1540
+ const S = V(e.operates, (E, N) => ({
1541
+ ...E,
1542
+ [N.action]: N
1543
+ }), {}), P = (E) => b(S, E), k = R(() => e.listProps), D = R(() => e.formProps), Z = R(() => e.descProps), I = R(() => e.modalProps);
1544
+ return Xn({
1545
+ columns: c,
1546
+ getSignColumns: g,
1547
+ getFormItemVNode: f,
1548
+ getItemVNode: p,
1549
+ elementMap: s,
1550
+ formElementMap: e.formElementMap,
1551
+ rowKey: e.rowKey,
1552
+ curdState: o,
1553
+ formColumns: m,
1554
+ descColumns: u,
1555
+ tableColumns: l,
1556
+ searchColumns: y,
1557
+ sendCurdEvent: v,
1558
+ operates: e.operates,
1559
+ getOperate: P,
1560
+ refreshList: d,
1561
+ listProps: k,
1562
+ formProps: D,
1563
+ descProps: Z,
1564
+ modalProps: I
1565
+ }), n({
1566
+ sendCurdEvent: v,
1567
+ refreshList: d
1568
+ }), () => {
1569
+ var E;
1570
+ return (E = t.default) == null ? void 0 : E.call(t);
1571
+ };
1235
1572
  }
1236
- });
1237
- let me;
1238
- (function(e) {
1239
- e.AUTO = "AUTO", e.MANUAL = "MANUAL";
1240
- })(me || (me = {}));
1241
- const Re = () => ({
1242
- initEmit: {
1243
- type: Boolean,
1244
- default: !0
1245
- },
1246
- searchMode: {
1247
- type: String,
1248
- default: me.AUTO
1249
- },
1250
- debounceKeys: {
1251
- type: Array
1252
- },
1253
- debounceTypes: {
1254
- type: Array,
1255
- default: ["text"]
1573
+ }), Ce = M({
1574
+ props: {
1575
+ ...C(Ne.props, "state", "requests"),
1576
+ ...We.props,
1577
+ curdState: {
1578
+ type: Object
1579
+ }
1256
1580
  },
1257
- debounceTime: {
1258
- type: Number,
1259
- default: 800
1581
+ setup: (e, {
1582
+ slots: t,
1583
+ expose: n
1584
+ }) => {
1585
+ const {
1586
+ elementMap: s,
1587
+ formElementMap: o
1588
+ } = Y(), a = j(), r = j(), c = e.curdState || z({
1589
+ detailData: {}
1590
+ }), f = {
1591
+ [T.LIST]: {
1592
+ convertParams: (u) => u,
1593
+ convertData: (u) => {
1594
+ var l;
1595
+ return (l = u.res) == null ? void 0 : l.data;
1596
+ },
1597
+ loadingName: "listLoading",
1598
+ stateName: "listData"
1599
+ },
1600
+ [T.DETAIL]: {
1601
+ convertParams: (u, l) => K(u, l),
1602
+ convertData: (u) => {
1603
+ var l;
1604
+ return (l = u.res) == null ? void 0 : l.data;
1605
+ },
1606
+ loadingName: "detailLoading",
1607
+ stateName: "detailData",
1608
+ label: "\u8BE6\u60C5"
1609
+ },
1610
+ [T.ADD]: {
1611
+ convertParams: (u, l) => ({
1612
+ body: {
1613
+ ...l,
1614
+ ...u
1615
+ }
1616
+ }),
1617
+ loadingName: "operateLoading",
1618
+ label: "\u6DFB\u52A0"
1619
+ },
1620
+ [T.EDIT]: {
1621
+ convertParams: (u, l) => ({
1622
+ body: {
1623
+ ...l,
1624
+ ...u
1625
+ }
1626
+ }),
1627
+ loadingName: "operateLoading",
1628
+ label: "\u7F16\u8F91"
1629
+ },
1630
+ [T.DELETE]: {
1631
+ convertParams: (u, l) => K(u, l),
1632
+ label: "\u5220\u9664"
1633
+ }
1634
+ }, p = A(e.operates, (u) => ({
1635
+ ...b(f, u.action),
1636
+ ...u
1637
+ })), g = x(p, (u) => u.actor), m = $(C(Ne.props, "state", "requests"));
1638
+ return n({
1639
+ sendCurdEvent: (u) => {
1640
+ var l;
1641
+ (l = r.value) == null || l.sendCurdEvent(u);
1642
+ },
1643
+ refreshList: (u) => {
1644
+ var l;
1645
+ (l = r.value) == null || l.refreshList(u);
1646
+ },
1647
+ sendEvent: (u) => {
1648
+ var l;
1649
+ (l = a.value) == null || l.sendEvent(u);
1650
+ },
1651
+ sendRequest: (u, ...l) => {
1652
+ var y;
1653
+ (y = a.value) == null || y.sendRequest(u, ...l);
1654
+ }
1655
+ }), () => h(Ne, O({
1656
+ ref: a
1657
+ }, K(e, m), {
1658
+ elementMap: e.elementMap || s,
1659
+ state: c,
1660
+ requests: g
1661
+ }), {
1662
+ default: () => [h(We, O({
1663
+ ref: r
1664
+ }, C(e, ...m, "curdState", "operates"), {
1665
+ formElementMap: e.formElementMap || o,
1666
+ operates: p
1667
+ }), t)]
1668
+ });
1669
+ }
1670
+ }), Qn = () => ({
1671
+ defaultAddRecord: {
1672
+ type: Object
1260
1673
  }
1261
- }), tn = (e, n, o) => L({
1674
+ }), Ae = M({
1262
1675
  props: {
1263
- ...e.props,
1264
- ...n,
1265
- ...Re()
1676
+ ...Qn()
1266
1677
  },
1267
- setup: (t, {
1268
- slots: u,
1269
- expose: r
1270
- }) => {
1271
- const s = t.model || B({}), m = new Set(t.debounceTypes), y = M(G(t.columns, (d) => {
1272
- const i = Be(d);
1273
- return m.has(i);
1274
- }), (d) => te(d)), E = $();
1275
- r(Y(o, E));
1276
- const l = () => {
1277
- var d;
1278
- (d = E.value) == null || d.submit();
1279
- }, f = ut(() => {
1280
- l();
1281
- }, t.debounceTime);
1282
- ce(() => {
1283
- t.initEmit && l();
1284
- }, []);
1285
- const a = (d, i, h) => ve(h, (p) => v(d, p) !== v(i, p));
1286
- mt((d, i) => {
1287
- if (t.searchMode !== me.AUTO)
1288
- return;
1289
- const h = V(t.debounceKeys) > 0 ? t.debounceKeys : y;
1290
- if (V(h) > 0 && a(d, i, h)) {
1291
- f();
1678
+ setup: (e) => {
1679
+ var l;
1680
+ const {
1681
+ dispatch: t,
1682
+ sendRequest: n
1683
+ } = he(), {
1684
+ rowKey: s,
1685
+ curdState: o,
1686
+ listProps: a,
1687
+ getOperate: r,
1688
+ refreshList: c
1689
+ } = G(), f = (l = a == null ? void 0 : a.value) == null ? void 0 : l.pageState, p = (y) => {
1690
+ const i = r(T.DETAIL);
1691
+ i != null && i.actor ? n(T.DETAIL, y, s) : t({
1692
+ type: "detailData",
1693
+ payload: Kt(y)
1694
+ });
1695
+ }, g = (y, {
1696
+ record: i
1697
+ }) => {
1698
+ y === L.EMIT && (t({
1699
+ type: "mode",
1700
+ payload: te.DETAIL
1701
+ }), p(i));
1702
+ }, m = (y) => {
1703
+ y === L.EMIT ? (t({
1704
+ type: "mode",
1705
+ payload: te.ADD
1706
+ }), t({
1707
+ type: "detailData",
1708
+ payload: e.defaultAddRecord || {}
1709
+ })) : y === L.SUCCESS && (f && (f.page = 1), c(), o.addAction === pe.CONTINUE ? t({
1710
+ type: "detailData",
1711
+ payload: e.defaultAddRecord || {}
1712
+ }) : t({
1713
+ type: "mode",
1714
+ payload: void 0
1715
+ }));
1716
+ }, u = (y, {
1717
+ record: i
1718
+ }) => {
1719
+ y === L.EMIT ? (t({
1720
+ type: "mode",
1721
+ payload: te.EDIT
1722
+ }), p(i)) : y === L.SUCCESS && (t({
1723
+ type: "mode",
1724
+ payload: void 0
1725
+ }), c());
1726
+ };
1727
+ return Ke(({
1728
+ type: y,
1729
+ payload: i,
1730
+ source: d
1731
+ }) => {
1732
+ if (d)
1292
1733
  return;
1734
+ let v = y, S = i == null ? void 0 : i.type;
1735
+ const P = i == null ? void 0 : i.record;
1736
+ switch (v === fe.Success && (v = b(i, ["requestOpts", "action"]), S = L.SUCCESS), v) {
1737
+ case T.DETAIL:
1738
+ g(S, {
1739
+ record: P
1740
+ });
1741
+ break;
1742
+ case T.ADD:
1743
+ m(S);
1744
+ break;
1745
+ case T.EDIT:
1746
+ u(S, {
1747
+ record: P
1748
+ });
1749
+ break;
1293
1750
  }
1294
- l();
1295
- }, () => st(s));
1296
- const c = k(C(Re(), "columns"));
1297
- return () => b(e, R({
1298
- ref: E
1299
- }, C(t, c), {
1300
- model: s
1301
- }), u);
1751
+ }), () => null;
1302
1752
  }
1303
- }), Ne = () => ({
1304
- readonly: {
1305
- type: Boolean,
1306
- default: void 0
1753
+ }), Nr = M({
1754
+ props: {
1755
+ ...Ce.props,
1756
+ ...Ae.props
1307
1757
  },
1308
- fieldProps: {
1758
+ setup: (e, {
1759
+ slots: t,
1760
+ expose: n
1761
+ }) => {
1762
+ const s = j();
1763
+ n(ce(Et, s));
1764
+ const o = $(Ae.props);
1765
+ return () => h(Ce, O({
1766
+ ref: s
1767
+ }, C(e, o)), {
1768
+ default: () => {
1769
+ var a;
1770
+ return [h(Ae, K(e, o), null), (a = t.default) == null ? void 0 : a.call(t)];
1771
+ }
1772
+ });
1773
+ }
1774
+ }), Yn = () => ({
1775
+ defaultAddRecord: {
1309
1776
  type: Object
1310
1777
  },
1311
- showProps: {
1312
- type: Object
1778
+ routeBack: {
1779
+ type: Function
1780
+ }
1781
+ }), Re = M({
1782
+ props: {
1783
+ ...Yn()
1313
1784
  },
1314
- slots: {
1315
- type: Object
1785
+ setup: (e) => {
1786
+ const t = _t(), n = zt(), {
1787
+ dispatch: s,
1788
+ sendRequest: o
1789
+ } = he(), {
1790
+ rowKey: a,
1791
+ curdState: r
1792
+ } = G(), c = (m) => {
1793
+ m === L.PAGE && (s({
1794
+ type: "mode",
1795
+ payload: void 0
1796
+ }), s({
1797
+ type: "detailData",
1798
+ payload: {}
1799
+ }), s({
1800
+ type: "detailLoading",
1801
+ payload: !1
1802
+ }), s({
1803
+ type: "addAction",
1804
+ payload: void 0
1805
+ }));
1806
+ }, f = (m, {
1807
+ record: u
1808
+ }) => {
1809
+ m === L.EMIT ? t.push({
1810
+ path: `${n.path}/detail`,
1811
+ query: K(u, a)
1812
+ }) : m === L.PAGE && (s({
1813
+ type: "mode",
1814
+ payload: te.DETAIL
1815
+ }), o(T.DETAIL, n.query, a));
1816
+ }, p = (m) => {
1817
+ m === L.EMIT ? t.push({
1818
+ path: `${n.path}/add`
1819
+ }) : m === L.PAGE ? (s({
1820
+ type: "mode",
1821
+ payload: te.ADD
1822
+ }), s({
1823
+ type: "detailData",
1824
+ payload: e.defaultAddRecord || {}
1825
+ })) : m === L.SUCCESS && (r.addAction === pe.CONTINUE ? s({
1826
+ type: "detailData",
1827
+ payload: e.defaultAddRecord || {}
1828
+ }) : e.routeBack ? e.routeBack(T.ADD) : t.go(-1));
1829
+ }, g = (m, {
1830
+ record: u
1831
+ }) => {
1832
+ m === L.EMIT ? t.push({
1833
+ path: `${n.path}/edit`,
1834
+ query: K(u, a)
1835
+ }) : m === L.PAGE ? (s({
1836
+ type: "mode",
1837
+ payload: te.EDIT
1838
+ }), o(T.DETAIL, n.query, a)) : m === L.SUCCESS && (e.routeBack ? e.routeBack(T.EDIT) : t.go(-1));
1839
+ };
1840
+ return Ke(({
1841
+ type: m,
1842
+ payload: u,
1843
+ source: l
1844
+ }) => {
1845
+ if (l)
1846
+ return;
1847
+ let y = m, i = u == null ? void 0 : u.type;
1848
+ const d = u == null ? void 0 : u.record;
1849
+ switch (y === fe.Success && (y = b(u, ["requestOpts", "action"]), i = L.SUCCESS), y) {
1850
+ case T.LIST:
1851
+ c(i);
1852
+ break;
1853
+ case T.DETAIL:
1854
+ f(i, {
1855
+ record: d
1856
+ });
1857
+ break;
1858
+ case T.ADD:
1859
+ p(i);
1860
+ break;
1861
+ case T.EDIT:
1862
+ g(i, {
1863
+ record: d
1864
+ });
1865
+ break;
1866
+ }
1867
+ }), () => null;
1316
1868
  }
1317
- }), nn = (e, n) => ({
1318
- InputComp: o,
1319
- valueType: t,
1320
- name: u
1321
- }) => L({
1322
- name: u,
1869
+ }), Or = M({
1323
1870
  props: {
1324
- ...e.props,
1325
- ...Ne()
1871
+ ...Ce.props,
1872
+ ...Re.props
1873
+ },
1874
+ setup: (e, {
1875
+ slots: t,
1876
+ expose: n
1877
+ }) => {
1878
+ const s = j();
1879
+ n(ce(Et, s));
1880
+ const o = $(Re.props);
1881
+ return () => h(Ce, O({
1882
+ ref: s
1883
+ }, C(e, o)), {
1884
+ default: () => {
1885
+ var a;
1886
+ return [h(Re, K(e, o), null), (a = t.default) == null ? void 0 : a.call(t)];
1887
+ }
1888
+ });
1889
+ }
1890
+ }), Zn = M({
1891
+ props: {
1892
+ ..._e.props,
1893
+ clsName: {
1894
+ type: String,
1895
+ default: "pro-curd-list"
1896
+ }
1326
1897
  },
1327
- setup: (r, {
1328
- slots: s
1898
+ setup: (e, {
1899
+ slots: t
1329
1900
  }) => {
1330
1901
  const {
1331
- formState: m,
1332
- showState: y,
1333
- readonlyState: E,
1334
- disableState: l,
1335
- readonly: f,
1336
- elementMap: a
1337
- } = Ze(), c = Je(), d = w(() => pe(r.readonly) ? r.readonly : pe(E[r.name]) ? E[r.name] : f.value), i = We(r.name), h = c != null && c.pathList ? [...c.pathList, ...i] : i, p = (P) => {
1338
- _(m, h, P);
1339
- }, S = k(Ne());
1902
+ elementMap: n,
1903
+ formElementMap: s,
1904
+ curdState: o,
1905
+ searchColumns: a,
1906
+ tableColumns: r,
1907
+ sendCurdEvent: c,
1908
+ operates: f
1909
+ } = G(), p = A(
1910
+ x(f, (m) => {
1911
+ const u = m.action;
1912
+ return u === T.DETAIL || u === T.EDIT || u === T.DELETE || m.tableOperate;
1913
+ }),
1914
+ (m) => {
1915
+ const u = {
1916
+ ...K(m, "label", "show", "disabled", "loading", "extraProps", "onClick", "element"),
1917
+ value: m.action
1918
+ };
1919
+ return u.onClick || (u.onClick = (l) => {
1920
+ c({
1921
+ action: m.action,
1922
+ type: L.EMIT,
1923
+ record: l
1924
+ });
1925
+ }), u;
1926
+ }
1927
+ ), g = (m) => {
1928
+ c({
1929
+ action: T.LIST,
1930
+ type: L.EMIT,
1931
+ values: m
1932
+ });
1933
+ };
1340
1934
  return () => {
1341
- const P = v(y, h);
1342
- if (pe(P) && !P)
1343
- return null;
1344
- const N = v(m, h), F = v(a, t);
1345
- return b(e, R(C(r, ...S, "name", "slots"), {
1346
- name: h
1935
+ var v, S;
1936
+ const m = e.searchProps, u = {
1937
+ formElementMap: s,
1938
+ columns: a.value,
1939
+ ...m
1940
+ }, l = e.tableProps, y = {
1941
+ elementMap: n,
1942
+ columns: r.value,
1943
+ loading: o.listLoading,
1944
+ dataSource: (v = o.listData) == null ? void 0 : v.dataSource,
1945
+ ...C(l, "operate"),
1946
+ operate: {
1947
+ items: p,
1948
+ ...l == null ? void 0 : l.operate
1949
+ }
1950
+ }, i = e.paginationProps, d = {
1951
+ total: (S = o.listData) == null ? void 0 : S.total,
1952
+ ...i
1953
+ };
1954
+ return h(_e, O(C(e, "searchProps", "tableProps", "paginationProps"), {
1955
+ searchProps: u,
1956
+ tableProps: y,
1957
+ paginationProps: d,
1958
+ onSearch: g
1347
1959
  }), {
1348
- default: () => [d.value ? b(oe, null, [F ? b(F, R({
1349
- value: N
1350
- }, r.fieldProps, {
1351
- showProps: r.showProps
1352
- }), s) : b("span", null, [N])]) : b(o, R(n(N, p, v(l, h)), r.fieldProps), s)],
1353
- ...r.slots
1960
+ ...t,
1961
+ search: t.search ? (P) => t.search(P, u) : void 0,
1962
+ pagination: t.pagination ? (P) => t.pagination(P, d) : void 0
1354
1963
  });
1355
1964
  };
1356
1965
  }
1357
- }), et = Symbol("pro-table"), rn = () => J(et), Ft = (e) => {
1358
- Q(et, e);
1359
- }, je = () => ({
1360
- operate: {
1361
- type: Object
1966
+ }), Lr = M(() => {
1967
+ const {
1968
+ listProps: e
1969
+ } = G();
1970
+ return () => h(Zn, C(e == null ? void 0 : e.value, "slots"), b(e == null ? void 0 : e.value, "slots"));
1971
+ }), er = () => ({
1972
+ clsName: {
1973
+ type: String,
1974
+ default: "pro-curd-form"
1362
1975
  },
1363
- columnEmptyText: {
1976
+ signName: {
1364
1977
  type: String
1978
+ }
1979
+ }), xe = M({
1980
+ props: {
1981
+ ...er()
1365
1982
  },
1366
- column: {
1367
- type: Object
1983
+ setup: (e, {
1984
+ slots: t,
1985
+ expose: n,
1986
+ attrs: s
1987
+ }) => {
1988
+ const {
1989
+ elementMap: o,
1990
+ formElementMap: a,
1991
+ curdState: r,
1992
+ formColumns: c,
1993
+ getSignColumns: f,
1994
+ sendCurdEvent: p
1995
+ } = G(), g = j();
1996
+ n(ce(e.formMethods || [], g));
1997
+ const m = R(() => e.signName ? f(e.signName) : c.value), u = () => {
1998
+ var d;
1999
+ r.addAction = pe.NORMAL, (d = g.value) == null || d.submit();
2000
+ }, l = () => {
2001
+ var d;
2002
+ r.addAction = pe.CONTINUE, (d = g.value) == null || d.submit();
2003
+ }, y = [
2004
+ {
2005
+ value: U.RESET,
2006
+ label: "\u91CD\u7F6E"
2007
+ },
2008
+ {
2009
+ value: U.SUBMIT,
2010
+ label: "\u63D0\u4EA4",
2011
+ extraProps: {
2012
+ type: "primary"
2013
+ }
2014
+ },
2015
+ {
2016
+ value: U.CONTINUE,
2017
+ label: "\u786E\u5B9A\u5E76\u7EE7\u7EED",
2018
+ extraProps: {
2019
+ type: "primary"
2020
+ },
2021
+ show: !1
2022
+ }
2023
+ ], i = (d) => {
2024
+ s.onFinish || (r.mode === T.EDIT ? p({
2025
+ action: T.EDIT,
2026
+ type: L.EXECUTE,
2027
+ values: d
2028
+ }) : p({
2029
+ action: T.ADD,
2030
+ type: L.EXECUTE,
2031
+ values: d
2032
+ }));
2033
+ };
2034
+ return () => h(Kn, O({
2035
+ ref: g
2036
+ }, C(e, "operate"), {
2037
+ elementMap: e.elementMap || o,
2038
+ formElementMap: e.formElementMap || a,
2039
+ columns: e.columns || m.value,
2040
+ readonly: r.mode === T.DETAIL,
2041
+ model: e.model || r.detailData,
2042
+ hideRequiredMark: r.mode === T.DETAIL,
2043
+ operate: e.operate ? {
2044
+ items: y,
2045
+ onSubmit: u,
2046
+ onContinue: l,
2047
+ ...e.operate
2048
+ } : void 0,
2049
+ onFinish: i
2050
+ }), t);
2051
+ }
2052
+ }), Ar = M(() => {
2053
+ const {
2054
+ formProps: e
2055
+ } = G();
2056
+ return () => h(xe, C(e == null ? void 0 : e.value, "slots"), b(e == null ? void 0 : e.value, "slots"));
2057
+ }), tr = () => ({
2058
+ clsName: {
2059
+ type: String,
2060
+ default: "pro-curd-desc"
1368
2061
  },
1369
- serialNumber: {
1370
- type: Boolean
2062
+ signName: {
2063
+ type: String
2064
+ }
2065
+ }), nr = M({
2066
+ props: {
2067
+ ...tr()
1371
2068
  },
1372
- paginationState: {
1373
- type: Object
2069
+ setup: (e, {
2070
+ slots: t
2071
+ }) => {
2072
+ const {
2073
+ curdState: n,
2074
+ descColumns: s,
2075
+ getSignColumns: o
2076
+ } = G(), a = R(() => e.signName ? o(e.signName) : s.value);
2077
+ return () => h(Hn, O(C(e, "signName", "model", "columns"), {
2078
+ model: e.model || n.detailData,
2079
+ columns: a.value
2080
+ }), t);
2081
+ }
2082
+ }), Rr = M(() => {
2083
+ const {
2084
+ descProps: e
2085
+ } = G();
2086
+ return () => h(nr, C(e == null ? void 0 : e.value, "slots"), b(e == null ? void 0 : e.value, "slots"));
2087
+ }), He = () => ({
2088
+ clsName: {
2089
+ type: String,
2090
+ default: "pro-curd-modal"
1374
2091
  },
1375
- provideExtra: {
1376
- type: Object
2092
+ validMode: {
2093
+ type: Array,
2094
+ default: [T.ADD, T.DETAIL, T.EDIT]
1377
2095
  }
1378
- }), an = (e, n, o) => L({
2096
+ }), Ct = M({
1379
2097
  props: {
1380
- ...e.props,
1381
- ...Ce,
1382
- ...n,
1383
- ...je()
2098
+ ...He()
1384
2099
  },
1385
- setup: (t, {
1386
- slots: u,
1387
- expose: r
2100
+ setup: (e, {
2101
+ slots: t
1388
2102
  }) => {
1389
- const {
1390
- elementMap: s
1391
- } = Le(), m = t.elementMap || s, y = () => ({
1392
- title: "\u5E8F\u53F7",
1393
- dataIndex: "serialNumber",
1394
- width: 80,
1395
- ...t.column,
1396
- customRender: ({
1397
- index: c
1398
- }) => {
1399
- var d, i;
1400
- return ((d = t.paginationState) == null ? void 0 : d.page) && ((i = t.paginationState) == null ? void 0 : i.pageSize) ? t.paginationState.pageSize * (t.paginationState.page - 1) + c + 1 : c + 1;
1401
- }
1402
- }), E = () => {
1403
- const c = t.operate, d = M(c.items, (h) => ({
1404
- ...h,
1405
- ...v(c.itemState, h.value)
1406
- })), i = ke(d, (h) => h.sort);
1407
- return {
1408
- ...t.column,
1409
- title: "\u64CD\u4F5C",
1410
- dataIndex: "operate",
1411
- fixed: "right",
1412
- ...c.column,
1413
- customRender: ({
1414
- record: h
1415
- }) => {
1416
- const p = G(i, (S) => S.show && H(S.show) ? S.show(h) : S.show !== !1);
1417
- return b("div", {
1418
- class: "pro-table-operate"
1419
- }, [M(p, (S) => H(S.element) ? S.element(h, S) : b("div", {
1420
- class: "pro-table-operate-item",
1421
- key: S.value,
1422
- onClick: () => {
1423
- var P;
1424
- (P = S.onClick) == null || P.call(S, h);
1425
- }
1426
- }, [S.label]))]);
1427
- }
1428
- };
1429
- }, l = w(() => {
1430
- const c = Ae(t.columns, t.columnState, (i) => i.dataIndex), d = M(c, (i) => {
1431
- const h = {
1432
- ...t.column,
1433
- ...i
1434
- };
1435
- return i.customRender || (h.customRender = ({
1436
- text: p
1437
- }) => $e(m, {
1438
- ...i,
1439
- showProps: {
1440
- ...i.showProps,
1441
- content: t.columnEmptyText
1442
- }
1443
- }, p) || p || t.columnEmptyText), h;
2103
+ const n = H(), s = n(Tn), o = n(dt), {
2104
+ curdState: a,
2105
+ getOperate: r
2106
+ } = G(), c = () => {
2107
+ a.mode = void 0, Qe(a.detailData, {}), a.detailLoading = !1, a.addAction = void 0;
2108
+ }, f = $(He());
2109
+ return () => {
2110
+ var g;
2111
+ const p = a.mode;
2112
+ return !se(e.validMode, (m) => m === p) || !s ? null : h(s, O(C(e, f), {
2113
+ visible: se(e.validMode, (m) => m === p),
2114
+ title: e.title || ((g = r(a.mode)) == null ? void 0 : g.label),
2115
+ confirmLoading: a.operateLoading,
2116
+ maskClosable: a.mode === T.DETAIL,
2117
+ onCancel: c
2118
+ }), {
2119
+ default: () => {
2120
+ var m;
2121
+ return [a.detailLoading && o ? h(o, {
2122
+ loading: !0
2123
+ }, {
2124
+ default: () => [h("div", {
2125
+ class: `${e.clsName}-loading-dom`
2126
+ }, null)]
2127
+ }) : (m = t.default) == null ? void 0 : m.call(t)];
2128
+ },
2129
+ ...C(t, "default")
1444
2130
  });
1445
- return t.serialNumber && d.unshift(y()), t.operate && t.operate.items && ve(t.operate.items, (i) => i.show) && d.push(E()), d;
1446
- }), f = $();
1447
- Ft({
1448
- columns: l,
1449
- tableRef: f,
1450
- ...t.provideExtra
1451
- }), r(Y(o || [], f));
1452
- const a = k(je());
1453
- return () => b(e, R({
1454
- ref: f
1455
- }, C(t, a), {
1456
- columns: l.value
1457
- }), u);
2131
+ };
2132
+ }
2133
+ }), wr = M({
2134
+ props: {
2135
+ modalProps: Object,
2136
+ formProps: Object
2137
+ },
2138
+ setup: (e, {
2139
+ slots: t
2140
+ }) => {
2141
+ const n = j(), s = le(t, "modal"), o = le(t, "form");
2142
+ return () => h(Ct, O(e.modalProps, {
2143
+ onOk: () => {
2144
+ var a;
2145
+ (a = n.value) == null || a.submit();
2146
+ }
2147
+ }), {
2148
+ default: () => [h(xe, O({
2149
+ ref: n
2150
+ }, e.formProps), o)],
2151
+ ...s
2152
+ });
1458
2153
  }
2154
+ }), $r = M(() => {
2155
+ const {
2156
+ modalProps: e,
2157
+ formProps: t
2158
+ } = G(), n = j();
2159
+ return () => h(Ct, O(C(e, "slots"), {
2160
+ onOk: () => {
2161
+ var s;
2162
+ (s = n.value) == null || s.submit();
2163
+ }
2164
+ }), {
2165
+ default: () => [h(xe, O({
2166
+ ref: n
2167
+ }, C(t, "slots")), b(t, "slots"))],
2168
+ ...b(e, "slots")
2169
+ });
1459
2170
  });
1460
2171
  export {
2172
+ bn as ButtonKey,
2173
+ Cn as CheckboxKey,
2174
+ gn as ColKey,
1461
2175
  T as CurdAction,
1462
- ae as CurdAddAction,
1463
- q as CurdCurrentMode,
1464
- _e as CurdMethods,
1465
- D as CurdSubAction,
1466
- zt as ProConfig,
1467
- le as ProCurd,
1468
- _t as ProModalCurd,
1469
- ye as ProModule,
1470
- Ht as ProPageCurd,
1471
- re as RequestAction,
1472
- me as SearchMode,
1473
- bt as Wrapper,
1474
- We as convertPathToList,
1475
- Jt as createCurdDesc,
1476
- Qt as createCurdForm,
1477
- Yt as createCurdList,
1478
- Y as createExpose,
1479
- Wt as createExposeObj,
1480
- en as createForm,
1481
- nn as createFormItemCompFn,
1482
- Zt as createFormList,
1483
- $t as createGrid,
1484
- Gt as createProConfig,
1485
- tn as createSearchForm,
1486
- an as createTable,
1487
- It as defaultPage,
1488
- te as getColumnFormItemName,
1489
- Be as getColumnValueType,
1490
- ht as getFirstPropName,
1491
- Pe as getFormItemEl,
1492
- $e as getItemEl,
1493
- Ct as getValidValues,
1494
- Ae as mergeStateToList,
1495
- Ce as proBaseProps,
1496
- Dt as provideProCurd,
1497
- Qe as provideProFormList,
1498
- Pt as provideProModule,
1499
- ne as renderElement,
1500
- Te as renderElements,
1501
- St as useComposeRequestActor,
1502
- Vt as useDoneRequestActor,
1503
- Xt as useFailedRequestActor,
1504
- De as useModuleEvent,
1505
- Le as useProConfig,
1506
- se as useProCurd,
1507
- Ze as useProForm,
1508
- Je as useProFormList,
1509
- ue as useProModule,
1510
- rn as useProTable
2176
+ pe as CurdAddAction,
2177
+ te as CurdCurrentMode,
2178
+ Et as CurdMethods,
2179
+ L as CurdSubAction,
2180
+ vn as DescriptionsItemKey,
2181
+ Sn as DescriptionsKey,
2182
+ U as FormAction,
2183
+ Mn as FormItemKey,
2184
+ In as FormKey,
2185
+ dt as LoadingKey,
2186
+ Pr as LogonUser,
2187
+ it as LogonUserKey,
2188
+ Tn as ModalKey,
2189
+ Sr as MustLogon,
2190
+ Le as PageHeader,
2191
+ Pn as PaginationKey,
2192
+ En as PopoverKey,
2193
+ dr as ProConfig,
2194
+ Ce as ProCurd,
2195
+ nr as ProCurdDesc,
2196
+ Rr as ProCurdDescConnect,
2197
+ xe as ProCurdForm,
2198
+ Ar as ProCurdFormConnect,
2199
+ Zn as ProCurdList,
2200
+ Lr as ProCurdListConnect,
2201
+ Ct as ProCurdModal,
2202
+ wr as ProCurdModalForm,
2203
+ $r as ProCurdModalFormConnect,
2204
+ Hn as ProDesc,
2205
+ Kn as ProForm,
2206
+ Nn as ProFormKey,
2207
+ Cr as ProFormList,
2208
+ Oe as ProGrid,
2209
+ _e as ProList,
2210
+ Nr as ProModalCurd,
2211
+ Ne as ProModule,
2212
+ St as ProOperate,
2213
+ Dr as ProPage,
2214
+ Or as ProPageCurd,
2215
+ Tr as ProSearchForm,
2216
+ On as ProSearchFormKey,
2217
+ Mr as ProTable,
2218
+ Ln as ProTableKey,
2219
+ fe as RequestAction,
2220
+ hn as RowKey,
2221
+ Ee as SearchMode,
2222
+ Dn as TableKey,
2223
+ mn as Wrapper,
2224
+ mt as convertPathToList,
2225
+ un as convertResData,
2226
+ ce as createExpose,
2227
+ Er as createExposeObj,
2228
+ Ir as createFormItemCompFn,
2229
+ mr as createProConfig,
2230
+ zn as defaultPage,
2231
+ le as filterSlotsByPrefix,
2232
+ oe as getColumnFormItemName,
2233
+ at as getColumnValueType,
2234
+ dn as getFirstPropName,
2235
+ ot as getFormItemEl,
2236
+ ke as getItemEl,
2237
+ ft as getSignValue,
2238
+ wn as getValidValues,
2239
+ De as mergeStateToList,
2240
+ de as proBaseProps,
2241
+ Xn as provideProCurd,
2242
+ ht as provideProFormList,
2243
+ fn as provideProModule,
2244
+ me as renderElement,
2245
+ Fe as renderElements,
2246
+ yn as useAccess,
2247
+ br as useAccessMgr,
2248
+ cn as useComposeRequestActor,
2249
+ yr as useDispatchMeta,
2250
+ hr as useDispatchStore,
2251
+ fr as useDoneRequestActor,
2252
+ pr as useFailedRequestActor,
2253
+ H as useGetCompByKey,
2254
+ vr as useLogonUser,
2255
+ ln as useMetaRegister,
2256
+ Ke as useModuleEvent,
2257
+ Y as useProConfig,
2258
+ G as useProCurd,
2259
+ bt as useProForm,
2260
+ yt as useProFormList,
2261
+ he as useProModule,
2262
+ Bn as useProTable,
2263
+ gr as useReadStore
1511
2264
  };