@vue-start/pro 0.4.9 → 0.4.11

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,410 +1,158 @@
1
- import { defineComponent, createVNode, mergeProps, isVNode, computed, h, inject, reactive, Fragment, provide, ref } from 'vue';
2
- import { map, isString, forEach, reduce, size, get, set, pick, omit, isArray, some, keys, isFunction, head, isObject, filter as filter$1, split, isEmpty, mergeWith, sortBy, concat, isUndefined, debounce, clone, isBoolean } from 'lodash';
3
- import { filter, tap, merge, Subject } from 'rxjs';
4
- import { useEffect, setReactiveValue, useWatch } from '@vue-start/hooks';
5
- import { useRequestProvide, isFailedRequestActor, isPreRequestActor, isDoneRequestActor } from '@vue-start/request';
6
- import { useRouter, useRoute } from 'vue-router';
7
-
8
- function ownKeys(object, enumerableOnly) {
9
- var keys = Object.keys(object);
10
-
11
- if (Object.getOwnPropertySymbols) {
12
- var symbols = Object.getOwnPropertySymbols(object);
13
- enumerableOnly && (symbols = symbols.filter(function (sym) {
14
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
15
- })), keys.push.apply(keys, symbols);
16
- }
17
-
18
- return keys;
1
+ import { defineComponent as A, createVNode as v, mergeProps as M, isVNode as ie, computed as w, h as Q, inject as re, reactive as K, Fragment as ae, provide as oe, ref as U } from "vue";
2
+ import { map as O, isString as fe, forEach as W, reduce as Y, size as X, get as P, set as _, pick as k, omit as I, isArray as q, some as Pe, keys as N, isFunction as H, head as Ye, isObject as Re, filter as z, split as Ze, isEmpty as et, mergeWith as je, sortBy as Ne, cloneDeep as tt, isUndefined as nt, concat as rt, debounce as at, clone as ot, isBoolean as ye } from "lodash";
3
+ import { merge as ct, filter as he, tap as be, Subject as ut } from "rxjs";
4
+ import { useEffect as ce, setReactiveValue as st, useWatch as dt } from "@vue-start/hooks";
5
+ import { useRequestProvide as ge, isDoneRequestActor as Fe, isFailedRequestActor as xe } from "@vue-start/request";
6
+ import { useRouter as it, useRoute as lt } from "vue-router";
7
+ function mt(e) {
8
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ie(e);
19
9
  }
20
-
21
- function _objectSpread2(target) {
22
- for (var i = 1; i < arguments.length; i++) {
23
- var source = null != arguments[i] ? arguments[i] : {};
24
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
25
- _defineProperty(target, key, source[key]);
26
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
27
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
28
- });
10
+ const ft = () => ({
11
+ row: {
12
+ type: Object,
13
+ default: void 0
14
+ },
15
+ col: {
16
+ type: Object
17
+ },
18
+ items: {
19
+ type: Array
29
20
  }
30
-
31
- return target;
32
- }
33
-
34
- function _defineProperty(obj, key, value) {
35
- if (key in obj) {
36
- Object.defineProperty(obj, key, {
37
- value: value,
38
- enumerable: true,
39
- configurable: true,
40
- writable: true
21
+ }), kt = (e, n) => A({
22
+ props: {
23
+ ...ft()
24
+ },
25
+ setup: (a) => () => {
26
+ let t;
27
+ return v(e, a.row, mt(t = O(a.items, (o) => v(n, M({
28
+ key: o.rowKey
29
+ }, a.col, o.col), {
30
+ default: () => [o.vNode]
31
+ }))) ? t : {
32
+ default: () => [t]
41
33
  });
42
- } else {
43
- obj[key] = value;
44
34
  }
45
-
46
- return obj;
47
- }
48
-
49
- function _toConsumableArray(arr) {
50
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
51
- }
52
-
53
- function _arrayWithoutHoles(arr) {
54
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
55
- }
56
-
57
- function _iterableToArray(iter) {
58
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
59
- }
60
-
61
- function _unsupportedIterableToArray(o, minLen) {
62
- if (!o) return;
63
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
64
- var n = Object.prototype.toString.call(o).slice(8, -1);
65
- if (n === "Object" && o.constructor) n = o.constructor.name;
66
- if (n === "Map" || n === "Set") return Array.from(o);
67
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
68
- }
69
-
70
- function _arrayLikeToArray(arr, len) {
71
- if (len == null || len > arr.length) len = arr.length;
72
-
73
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
74
-
75
- return arr2;
76
- }
77
-
78
- function _nonIterableSpread() {
79
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
80
- }
81
-
82
- function _isSlot$1(s) {
83
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
84
- }
85
-
86
- var proGridProps = function proGridProps() {
87
- return {
88
- row: {
89
- type: Object,
90
- "default": undefined
91
- },
92
- col: {
93
- type: Object
94
- },
95
- items: {
96
- type: Array
97
- }
98
- };
99
- };
100
-
101
- var createGrid = function createGrid(Row, Col) {
102
- return defineComponent({
103
- props: _objectSpread2({}, proGridProps()),
104
- setup: function setup(props) {
105
- return function () {
106
- var _slot;
107
-
108
- return createVNode(Row, props.row, _isSlot$1(_slot = map(props.items, function (item) {
109
- return createVNode(Col, mergeProps({
110
- "key": item.rowKey
111
- }, props.col, item.col), {
112
- "default": function _default() {
113
- return [item.vNode];
114
- }
115
- });
116
- })) ? _slot : {
117
- "default": function _default() {
118
- return [_slot];
119
- }
120
- });
121
- };
122
- }
123
- });
124
- };
125
-
126
- var createUseRequestActor = function createUseRequestActor(filterFun) {
127
- return function (actors, callback) {
128
- var _useRequestProvide = useRequestProvide(),
129
- requestSubject$ = _useRequestProvide.requestSubject$;
130
-
131
- var nameSet = new Set(map(actors, function (actor) {
132
- return isString(actor) ? actor : actor.name;
133
- }));
134
- useEffect(function () {
135
- var sub = requestSubject$.pipe(filter(filterFun), tap(function (actor) {
136
- if (nameSet.has(actor.name)) {
137
- callback(actor);
138
- }
139
- })).subscribe();
140
- return function () {
141
- sub.unsubscribe();
142
- };
143
- }, []);
144
- };
145
- };
146
-
147
- var useDoneRequestActor = createUseRequestActor(isDoneRequestActor);
148
- var useFailedRequestActor = createUseRequestActor(isFailedRequestActor);
149
- var useComposeRequestActor = function useComposeRequestActor(actors, options, cancelWhileUnmount) {
150
- var _useRequestProvide2 = useRequestProvide(),
151
- requestSubject$ = _useRequestProvide2.requestSubject$,
152
- dispatchRequest = _useRequestProvide2.dispatchRequest;
153
-
154
- var nameSet = new Set(map(actors, function (actor) {
155
- return isString(actor) ? actor : actor.name;
156
- }));
157
- var lastRequestActors = {};
158
- useEffect(function () {
159
- var sub = merge(requestSubject$.pipe(filter(isPreRequestActor), tap(function (actor) {
160
- if (nameSet.has(actor.name)) {
161
- var _options$onStart;
162
-
163
- (_options$onStart = options.onStart) === null || _options$onStart === void 0 ? void 0 : _options$onStart.call(options, actor);
164
- lastRequestActors[actor.name] = actor;
165
- }
166
- })), requestSubject$.pipe(filter(isDoneRequestActor), tap(function (actor) {
167
- if (nameSet.has(actor.name)) {
168
- var _options$onSuccess, _options$onFinish;
169
-
170
- (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call(options, actor);
171
- (_options$onFinish = options.onFinish) === null || _options$onFinish === void 0 ? void 0 : _options$onFinish.call(options, actor);
172
- lastRequestActors[actor.name] = undefined;
173
- }
174
- })), requestSubject$.pipe(filter(isFailedRequestActor), tap(function (actor) {
175
- if (nameSet.has(actor.name)) {
176
- var _options$onFailed, _options$onFinish2;
177
-
178
- (_options$onFailed = options.onFailed) === null || _options$onFailed === void 0 ? void 0 : _options$onFailed.call(options, actor);
179
- (_options$onFinish2 = options.onFinish) === null || _options$onFinish2 === void 0 ? void 0 : _options$onFinish2.call(options, actor);
180
- lastRequestActors[actor.name] = undefined;
181
- }
182
- }))).subscribe();
183
- return function () {
184
- sub.unsubscribe();
185
-
186
- if (cancelWhileUnmount) {
187
- //组件销毁的时候cancel请求
188
- forEach(lastRequestActors, function (actor) {
189
- actor && dispatchRequest(_objectSpread2(_objectSpread2({}, actor), {}, {
190
- stage: "CANCEL"
191
- }));
192
- });
193
- }
35
+ }), ke = (e) => (n, a) => {
36
+ const { requestSubject$: t } = ge(), o = new Set(O(n, (r) => fe(r) ? r : r.name));
37
+ ce(() => {
38
+ const r = t.pipe(
39
+ he(e),
40
+ be((l) => {
41
+ o.has(l.name) && a(l);
42
+ })
43
+ ).subscribe();
44
+ return () => {
45
+ r.unsubscribe();
194
46
  };
195
47
  }, []);
196
- };
197
-
198
- /***************************************** curd模式 *****************************************/
199
-
200
- /**
201
- * 获取Column的valueType,默认"text"
202
- * @param column
203
- */
204
- var getColumnValueType = function getColumnValueType(column) {
205
- return column.formValueType || column.valueType || "text";
206
- };
207
- /**
208
- *获取Column的FormItem name
209
- * @param column
210
- */
211
-
212
- var getColumnFormItemName = function getColumnFormItemName(column) {
213
- var _column$formItemProps;
214
-
215
- return ((_column$formItemProps = column.formItemProps) === null || _column$formItemProps === void 0 ? void 0 : _column$formItemProps.name) || column.dataIndex;
216
- };
217
- /**
218
- * 根据Column生成FormItem VNode
219
- * formFieldProps中的slots参数会以v-slots的形式传递到FormItem的录入组件(子组件)中
220
- * @param formElementMap
221
- * @param column
222
- * @param needRules
223
- */
224
-
225
- var getFormItemEl = function getFormItemEl(formElementMap, column) {
226
- var _column$formFieldProp;
227
-
228
- var needRules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
229
- var valueType = getColumnValueType(column);
230
- var Comp = get(formElementMap, valueType);
231
-
232
- if (!Comp) {
233
- return null;
234
- }
235
-
236
- var name = getColumnFormItemName(column);
237
- var itemProps = needRules ? column.formItemProps : omit(column.formItemProps, "rules");
238
- return h(Comp, _objectSpread2(_objectSpread2({
239
- key: name,
240
- name: name,
241
- label: column.title
242
- }, itemProps), {}, {
243
- fieldProps: omit(column.formFieldProps, "slots"),
244
- showProps: column.showProps
245
- }), (_column$formFieldProp = column.formFieldProps) === null || _column$formFieldProp === void 0 ? void 0 : _column$formFieldProp.slots);
246
- };
247
- /**
248
- * 根据Column生成Item VNode
249
- * @param elementMap
250
- * @param column
251
- * @param value
252
- */
253
-
254
- var getItemEl = function getItemEl(elementMap, column, value) {
255
- var _column$formFieldProp2;
256
-
257
- var valueType = column.valueType || "text";
258
- var Comp = get(elementMap, valueType);
259
-
260
- if (!Comp) {
48
+ }, qt = ke(Fe), Kt = ke(xe), yt = (e, n, a) => {
49
+ const { requestSubject$: t, dispatchRequest: o } = ge(), r = new Set(O(e, (f) => fe(f) ? f : f.name)), l = {};
50
+ ce(() => {
51
+ const f = ct(
52
+ t.pipe(
53
+ he(Fe),
54
+ be((y) => {
55
+ var p, c;
56
+ r.has(y.name) && ((p = n.onSuccess) == null || p.call(n, y), (c = n.onFinish) == null || c.call(n, y), l[y.name] = void 0);
57
+ })
58
+ ),
59
+ t.pipe(
60
+ he(xe),
61
+ be((y) => {
62
+ var p, c;
63
+ r.has(y.name) && ((p = n.onFailed) == null || p.call(n, y), (c = n.onFinish) == null || c.call(n, y), l[y.name] = void 0);
64
+ })
65
+ )
66
+ ).subscribe();
67
+ return () => {
68
+ f.unsubscribe(), a && W(l, (y) => {
69
+ y && o({ ...y, stage: "CANCEL" });
70
+ });
71
+ };
72
+ }, []);
73
+ }, qe = (e) => e.formValueType || e.valueType || "text", Z = (e) => {
74
+ var n;
75
+ return ((n = e.formItemProps) == null ? void 0 : n.name) || e.dataIndex;
76
+ }, ve = (e, n, a = !0) => {
77
+ var f;
78
+ const t = qe(n), o = P(e, t);
79
+ if (!o)
261
80
  return null;
262
- }
263
-
264
- return h(Comp, _objectSpread2(_objectSpread2({}, omit(column.formFieldProps, "slots")), {}, {
265
- showProps: column.showProps,
266
- value: value
267
- }), (_column$formFieldProp2 = column.formFieldProps) === null || _column$formFieldProp2 === void 0 ? void 0 : _column$formFieldProp2.slots);
268
- };
269
- /***************************************** 通用模式 *****************************************/
270
-
271
- var renderElements = function renderElements(elementMap, elementConfigs) {
272
- return map(elementConfigs, function (elementConfig) {
273
- return renderElement(elementMap, elementConfig);
274
- });
275
- };
276
- /**
277
- * props转换
278
- */
279
-
280
- var convertPropsEl = function convertPropsEl(elementMap, elementConfig) {
281
- var _elementConfig$highCo;
282
-
283
- var elementProps = elementConfig.elementProps;
284
-
285
- var nextProps = _objectSpread2({}, elementConfig.elementProps);
286
-
287
- forEach((_elementConfig$highCo = elementConfig.highConfig$) === null || _elementConfig$highCo === void 0 ? void 0 : _elementConfig$highCo.registerPropsTrans, function (item) {
288
- var target = get(elementProps, item.name);
289
-
290
- if (!target || isVNode(target)) {
291
- return;
292
- }
293
-
294
- if (isArray(target)) {
295
- //如果list中存在VNode,不转换
296
- if (some(target, function (sub) {
297
- return isVNode(sub);
298
- })) {
81
+ const r = Z(n), l = a ? n.formItemProps : I(n.formItemProps, "rules");
82
+ return Q(o, {
83
+ key: r,
84
+ name: r,
85
+ label: n.title,
86
+ ...l,
87
+ fieldProps: I(n.formFieldProps, "slots"),
88
+ showProps: n.showProps
89
+ }, (f = n.formFieldProps) == null ? void 0 : f.slots);
90
+ }, Ke = (e, n, a) => {
91
+ var r;
92
+ const t = n.valueType || "text", o = P(e, t);
93
+ return o ? Q(o, {
94
+ ...I(n.formFieldProps, "slots"),
95
+ showProps: n.showProps,
96
+ value: a
97
+ }, (r = n.formFieldProps) == null ? void 0 : r.slots) : null;
98
+ }, Te = (e, n) => O(n, (a) => ee(e, a)), Ue = (e, n) => {
99
+ var o;
100
+ const a = n.elementProps, t = {
101
+ ...n.elementProps
102
+ };
103
+ return W((o = n.highConfig$) == null ? void 0 : o.registerPropsTrans, (r) => {
104
+ const l = P(a, r.name);
105
+ if (!(!l || ie(l))) {
106
+ if (q(l)) {
107
+ if (Pe(l, (f) => ie(f)))
108
+ return;
109
+ _(t, r.name, Te(e, l));
299
110
  return;
300
- } //如果碰到特殊场景,可以替换成单个渲染模式
301
-
302
-
303
- set(nextProps, item.name, renderElements(elementMap, target));
304
- return;
305
- }
306
-
307
- if (!target.elementType) {
308
- return;
111
+ }
112
+ !l.elementType || (r.isFun ? _(t, r.name, (...f) => {
113
+ const y = r.needParams ? {
114
+ ...l.elementProps,
115
+ params$: f
116
+ } : l.elementProps;
117
+ return ee(e, {
118
+ ...l,
119
+ elementProps: y
120
+ });
121
+ }) : _(t, r.name, ee(e, l)));
309
122
  }
310
-
311
- if (item.isFun) {
312
- set(nextProps, item.name, function () {
313
- for (var _len = arguments.length, params$ = new Array(_len), _key = 0; _key < _len; _key++) {
314
- params$[_key] = arguments[_key];
315
- }
316
-
317
- var ep = item.needParams ? _objectSpread2(_objectSpread2({}, target.elementProps), {}, {
318
- params$: params$
319
- }) : target.elementProps;
320
- return renderElement(elementMap, _objectSpread2(_objectSpread2({}, target), {}, {
321
- elementProps: ep
322
- }));
123
+ }), t;
124
+ }, Be = (e, n) => {
125
+ const a = X(n.children) > 0 ? Te(e, n.children) : void 0, t = n.childrenSlotName || "default", o = I(n.slots, a ? t : "");
126
+ return W(N(o), (r) => {
127
+ const l = o[r];
128
+ l && !H(l) && l.elementType && (o[r] = (...f) => {
129
+ const y = l.needParams ? {
130
+ ...l.elementProps,
131
+ params$: f
132
+ } : l.elementProps;
133
+ return ee(e, {
134
+ ...l,
135
+ elementProps: y
323
136
  });
324
- } else {
325
- set(nextProps, item.name, renderElement(elementMap, target));
326
- }
327
- });
328
- return nextProps;
329
- };
330
- /**
331
- * slots转换
332
- */
333
-
334
-
335
- var convertSlots = function convertSlots(elementMap, elementConfig) {
336
- var children = size(elementConfig.children) > 0 ? renderElements(elementMap, elementConfig.children) : undefined; //children插槽名称
337
-
338
- var childrenSlotName = elementConfig.childrenSlotName || "default";
339
- var validSlots = omit(elementConfig.slots, children ? childrenSlotName : ""); //如果slots注册的是 IElementConfig ,进行转换
340
-
341
- forEach(keys(validSlots), function (k) {
342
- var v = validSlots[k]; //IElementConfig
343
-
344
- if (v && !isFunction(v) && v.elementType) {
345
- validSlots[k] = function () {
346
- for (var _len2 = arguments.length, params$ = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
347
- params$[_key2] = arguments[_key2];
348
- }
349
-
350
- //如果需要params,在props中注入 params$
351
- var elementProps = v.needParams ? _objectSpread2(_objectSpread2({}, v.elementProps), {}, {
352
- params$: params$
353
- }) : v.elementProps;
354
- return renderElement(elementMap, _objectSpread2(_objectSpread2({}, v), {}, {
355
- elementProps: elementProps
356
- }));
357
- };
358
- }
359
- });
360
- return _objectSpread2(_defineProperty({}, childrenSlotName, children ? function () {
361
- return children;
362
- } : undefined), validSlots);
363
- };
364
- /**
365
- *
366
- * @param elementMap
367
- * @param elementConfig
368
- */
369
-
370
-
371
- var renderElement = function renderElement(elementMap, elementConfig) {
372
- var El = get(elementMap, elementConfig.elementType) || elementConfig.elementType; //如果有highConfig$,包裹一层Wrapper
373
-
374
- if (elementConfig.highConfig$) {
375
- return h(Wrapper, {
376
- key: elementConfig.elementId,
377
- elementMap: elementMap,
378
- elementConfig: elementConfig
379
137
  });
380
- }
381
-
382
- var slots = convertSlots(elementMap, elementConfig);
383
- var elementProps = convertPropsEl(elementMap, elementConfig);
384
- return h(El, _objectSpread2({
385
- key: elementConfig.elementId
386
- }, elementProps), slots);
387
- };
388
- /**
389
- * 获取第一层级属性名
390
- * 如:['aaa','bbb',...] 中的 'aaa'
391
- * 如:"aaa.bbb.ccc..." 中的 'aaa'
392
- */
393
-
394
- var getFirstPropName = function getFirstPropName(name) {
395
- if (isArray(name)) {
396
- return head(name);
397
- } else if (isString(name) && name.indexOf(".") > 0) {
398
- return name.substring(0, name.indexOf("."));
399
- }
400
-
401
- return name;
402
- };
403
- /**
404
- * 处理highConfig$
405
- */
406
-
407
- var Wrapper = defineComponent({
138
+ }), {
139
+ [t]: a ? () => a : void 0,
140
+ ...o
141
+ };
142
+ }, ee = (e, n) => {
143
+ const a = P(e, n.elementType) || n.elementType;
144
+ if (n.highConfig$)
145
+ return Q(Et, {
146
+ key: n.elementId,
147
+ elementMap: e,
148
+ elementConfig: n
149
+ });
150
+ const t = Be(e, n), o = Ue(e, n);
151
+ return Q(a, {
152
+ key: n.elementId,
153
+ ...o
154
+ }, t);
155
+ }, pt = (e) => q(e) ? Ye(e) : fe(e) && e.indexOf(".") > 0 ? e.substring(0, e.indexOf(".")) : e, Et = A({
408
156
  props: {
409
157
  elementMap: {
410
158
  type: Object
@@ -413,2274 +161,1341 @@ var Wrapper = defineComponent({
413
161
  type: Object
414
162
  }
415
163
  },
416
- setup: function setup(props) {
417
- var _useProModule = useProModule(),
418
- state = _useProModule.state,
419
- sendEvent = _useProModule.sendEvent;
420
-
421
- var elementMap = props.elementMap,
422
- elementConfig = props.elementConfig;
423
- var highConfig$ = elementConfig.highConfig$; //转换props
424
-
425
- var elementProps = convertPropsEl(elementMap, elementConfig); //事件订阅
426
-
427
- var events = reduce(highConfig$.registerEventList, function (pair, item) {
428
- return _objectSpread2(_objectSpread2({}, pair), {}, _defineProperty({}, item.name, function () {
429
- for (var _len3 = arguments.length, params = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
430
- params[_key3] = arguments[_key3];
431
- }
432
-
433
- sendEvent({
434
- type: item.sendEventName || elementConfig.elementId,
435
- payload: params
164
+ setup: (e) => {
165
+ const {
166
+ state: n,
167
+ sendEvent: a
168
+ } = ue(), {
169
+ elementMap: t,
170
+ elementConfig: o
171
+ } = e, r = o.highConfig$, l = Ue(t, o), f = Y(r.registerEventList, (u, s) => ({
172
+ ...u,
173
+ [s.name]: (...i) => {
174
+ a({
175
+ type: s.sendEventName || o.elementId,
176
+ payload: i
436
177
  });
437
- }));
438
- }, {}); //receiveStateList 订阅
439
-
440
- var receiveStates = computed(function () {
441
- if (!highConfig$.registerStateList || size(highConfig$.registerStateList) <= 0) {
442
- return undefined;
443
178
  }
444
-
445
- var changeProps = _objectSpread2({}, elementProps); //赋值 && 返回一级属性名称
446
-
447
-
448
- var firstPropNameList = map(highConfig$.registerStateList, function (item) {
449
- var targetName = item.mapName || item.name; //从state中取值
450
-
451
- var value = get(state, item.name); //赋值
452
-
453
- set(changeProps, targetName, value); //返回一级属性名称
454
-
455
- return getFirstPropName(targetName);
179
+ }), {}), y = w(() => {
180
+ if (!r.registerStateList || X(r.registerStateList) <= 0)
181
+ return;
182
+ const u = {
183
+ ...l
184
+ }, s = O(r.registerStateList, (i) => {
185
+ const d = i.mapName || i.name, m = P(n, i.name);
186
+ return _(u, d, m), pt(d);
456
187
  });
457
- return pick(changeProps, firstPropNameList);
458
- });
459
- var El = get(elementMap, elementConfig.elementType) || elementConfig.elementType;
460
- var slots = convertSlots(elementMap, elementConfig);
461
- return function () {
462
- //如果标记show$值为false,不渲染组件
463
- var show$ = get(receiveStates.value, "show$");
464
-
465
- if (show$ === false) {
466
- return null;
467
- }
468
-
469
- return h(El, _objectSpread2(_objectSpread2(_objectSpread2({
470
- key: elementConfig.elementId
471
- }, elementProps), omit(receiveStates.value, "show$")), events), slots);
472
- };
188
+ return k(u, s);
189
+ }), p = P(t, o.elementType) || o.elementType, c = Be(t, o);
190
+ return () => P(y.value, "show$") === !1 ? null : Q(p, {
191
+ key: o.elementId,
192
+ ...l,
193
+ ...I(y.value, "show$"),
194
+ ...f
195
+ }, c);
473
196
  }
474
- });
475
-
476
- var ProModuleKey = Symbol("pro-module");
477
- var useProModule = function useProModule() {
478
- return inject(ProModuleKey);
479
- };
480
- var provideProModule = function provideProModule(ctx) {
481
- provide(ProModuleKey, ctx);
482
- };
483
- var RequestAction = {
197
+ }), $e = Symbol("pro-module"), ue = () => re($e), St = (e) => {
198
+ oe($e, e);
199
+ }, te = {
484
200
  Success: "request-success$",
485
201
  Fail: "request-fail$"
486
- };
487
-
488
- var proModuleProps = function proModuleProps() {
489
- return {
490
- /**
491
- * module状态
492
- */
493
- state: {
494
- type: Object
495
- },
496
-
497
- /**
498
- * 组件集
499
- */
500
- elementMap: {
501
- type: Object
502
- },
503
-
504
- /**
505
- * 组件描述(树)
506
- */
507
- elementConfigs: {
508
- type: Array
509
- },
510
-
511
- /**
512
- * requests
513
- */
514
- requests: {
515
- type: Array
516
- }
517
- };
518
- };
519
-
520
- var ProModule = defineComponent({
521
- props: _objectSpread2({}, proModuleProps()),
522
- setup: function setup(props, _ref) {
523
- var slots = _ref.slots,
524
- expose = _ref.expose;
525
-
526
- /*********************************** render ***************************************/
527
- var render = function render(elementConfig) {
528
- if (isArray(elementConfig)) {
529
- return renderElements(props.elementMap, elementConfig);
530
- }
531
-
532
- return renderElement(props.elementMap, elementConfig);
533
- };
534
- /*********************************** 事件处理 ***************************************/
535
-
536
-
537
- var subject$ = new Subject(); //发送Module事件
538
-
539
- var sendEvent = function sendEvent(action) {
540
- subject$.next(action);
541
- };
542
- /*********************************** 页面状态 ***************************************/
543
-
544
-
545
- var state = props.state || reactive({});
546
-
547
- var dispatch = function dispatch(action) {
548
- var prev = state[action.type];
549
- var data = isFunction(action.payload) ? action.payload(prev) : action.payload; //如果要更新的属性值是 object ,执行覆盖操作
550
-
551
- if (isObject(prev)) {
552
- setReactiveValue(state[action.type], data);
202
+ }, ht = () => ({
203
+ state: {
204
+ type: Object
205
+ },
206
+ elementMap: {
207
+ type: Object
208
+ },
209
+ elementConfigs: {
210
+ type: Array
211
+ },
212
+ requests: {
213
+ type: Array
214
+ }
215
+ }), pe = A({
216
+ props: {
217
+ ...ht()
218
+ },
219
+ setup: (e, {
220
+ slots: n,
221
+ expose: a
222
+ }) => {
223
+ const t = (s) => q(s) ? Te(e.elementMap, s) : ee(e.elementMap, s), o = new ut(), r = (s) => {
224
+ o.next(s);
225
+ }, l = e.state || K({}), f = (s) => {
226
+ const i = l[s.type], d = H(s.payload) ? s.payload(i) : s.payload;
227
+ if (Re(i)) {
228
+ st(l[s.type], d);
553
229
  return;
554
230
  }
555
-
556
- state[action.type] = data;
557
- };
558
- /*********************************** request ***************************************/
559
-
560
-
561
- var _useRequestProvide = useRequestProvide(),
562
- dispatchRequest = _useRequestProvide.dispatchRequest;
563
-
564
- var requestMap = reduce(props.requests, function (pair, item) {
565
- var _item$actor;
566
-
567
- return _objectSpread2(_objectSpread2({}, pair), {}, _defineProperty({}, (_item$actor = item.actor) === null || _item$actor === void 0 ? void 0 : _item$actor.name, item));
568
- }, {});
569
- var actionMap = reduce(props.requests, function (pair, item) {
570
- return _objectSpread2(_objectSpread2({}, pair), {}, _defineProperty({}, item.action, item));
571
- }, {}); //发送请求
572
-
573
- var sendRequest = function sendRequest(requestNameOrAction) {
574
- var requestOpts = get(requestMap, requestNameOrAction) || get(actionMap, requestNameOrAction);
575
-
576
- if (!requestOpts) {
231
+ l[s.type] = d;
232
+ }, {
233
+ dispatchRequest: y
234
+ } = ge(), p = Y(e.requests, (s, i) => {
235
+ var d;
236
+ return {
237
+ ...s,
238
+ [(d = i.actor) == null ? void 0 : d.name]: i
239
+ };
240
+ }, {}), c = Y(e.requests, (s, i) => ({
241
+ ...s,
242
+ [i.action]: i
243
+ }), {}), u = (s, ...i) => {
244
+ const d = P(p, s) || P(c, s);
245
+ if (!d)
577
246
  return;
578
- }
579
-
580
- var nextParams;
581
-
582
- for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
583
- params[_key - 1] = arguments[_key];
584
- }
585
-
586
- if (requestOpts.convertParams) {
587
- nextParams = requestOpts.convertParams.apply(requestOpts, params);
588
- } else {
589
- nextParams = get(params, 0);
590
- }
591
-
592
- dispatchRequest(requestOpts.actor, nextParams);
247
+ let m;
248
+ d.convertParams ? m = d.convertParams(...i) : m = P(i, 0), d.loadingName && f({
249
+ type: d.loadingName,
250
+ payload: !0
251
+ }), y(d.actor, m);
593
252
  };
594
-
595
- useComposeRequestActor(keys(requestMap), {
596
- onStart: function onStart(actor) {
597
- //如果设置了loading,将请求状态维护到state中
598
- var loadingName = get(requestMap, [actor.name, "loadingName"]);
599
-
600
- if (loadingName) {
601
- dispatch({
602
- type: loadingName,
603
- payload: true
253
+ return yt(N(p), {
254
+ onSuccess: (s) => {
255
+ var d, m;
256
+ const i = P(p, s.name);
257
+ if (i != null && i.stateName) {
258
+ const E = i.convertData ? i.convertData(s) : (d = s.res) == null ? void 0 : d.data;
259
+ f({
260
+ type: i.stateName,
261
+ payload: E
604
262
  });
605
263
  }
606
- },
607
- onSuccess: function onSuccess(actor) {
608
- var _requestOpts$onSucces;
609
-
610
- var requestOpts = get(requestMap, actor.name); //如果设置了stateName,将结果维护到state中
611
-
612
- if (requestOpts !== null && requestOpts !== void 0 && requestOpts.stateName) {
613
- var _actor$res;
614
-
615
- var data = requestOpts.convertData ? requestOpts.convertData(actor) : (_actor$res = actor.res) === null || _actor$res === void 0 ? void 0 : _actor$res.data;
616
- dispatch({
617
- type: requestOpts.stateName,
618
- payload: data
619
- });
620
- } //发送成功事件
621
-
622
-
623
- sendEvent({
624
- type: RequestAction.Success,
264
+ r({
265
+ type: te.Success,
625
266
  payload: {
626
- actor: actor,
627
- requestOpts: requestOpts
267
+ actor: s,
268
+ requestOpts: i
628
269
  }
629
- }); //回调事件
630
-
631
- (_requestOpts$onSucces = requestOpts.onSuccess) === null || _requestOpts$onSucces === void 0 ? void 0 : _requestOpts$onSucces.call(requestOpts, actor);
270
+ }), (m = i.onSuccess) == null || m.call(i, s);
632
271
  },
633
- onFailed: function onFailed(actor) {
634
- var _requestOpts$onFailed;
635
-
636
- var requestOpts = get(requestMap, actor.name); //发送失败事件
637
-
638
- sendEvent({
639
- type: RequestAction.Fail,
272
+ onFailed: (s) => {
273
+ var d;
274
+ const i = P(p, s.name);
275
+ r({
276
+ type: te.Fail,
640
277
  payload: {
641
- actor: actor,
642
- requestOpts: requestOpts
278
+ actor: s,
279
+ requestOpts: i
643
280
  }
644
- }); //回调事件
645
-
646
- (_requestOpts$onFailed = requestOpts.onFailed) === null || _requestOpts$onFailed === void 0 ? void 0 : _requestOpts$onFailed.call(requestOpts, actor);
281
+ }), (d = i.onFailed) == null || d.call(i, s);
647
282
  },
648
- onFinish: function onFinish(actor) {
649
- var loadingName = get(requestMap, [actor.name, "loadingName"]);
650
-
651
- if (loadingName) {
652
- dispatch({
653
- type: loadingName,
654
- payload: false
655
- });
656
- }
283
+ onFinish: (s) => {
284
+ const i = P(p, [s.name, "loadingName"]);
285
+ i && f({
286
+ type: i,
287
+ payload: !1
288
+ });
657
289
  }
658
- }, true);
659
- provideProModule({
660
- elementMap: props.elementMap,
661
- //
662
- subject$: subject$,
663
- sendEvent: sendEvent,
664
- //
665
- state: state,
666
- dispatch: dispatch,
667
- //
668
- requests: props.requests,
669
- sendRequest: sendRequest
670
- });
671
- expose({
672
- sendEvent: sendEvent,
673
- sendRequest: sendRequest
674
- });
675
- return function () {
676
- var _slots$default;
677
-
678
- return createVNode(Fragment, null, [size(props.elementConfigs) > 0 && render(props.elementConfigs), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]);
290
+ }, !0), St({
291
+ elementMap: e.elementMap,
292
+ subject$: o,
293
+ sendEvent: r,
294
+ state: l,
295
+ dispatch: f,
296
+ requests: e.requests,
297
+ sendRequest: u
298
+ }), a({
299
+ sendEvent: r,
300
+ sendRequest: u
301
+ }), () => {
302
+ var s;
303
+ return v(ae, null, [X(e.elementConfigs) > 0 && t(e.elementConfigs), (s = n.default) == null ? void 0 : s.call(n)]);
679
304
  };
680
305
  }
681
- });
682
-
683
- //订阅module事件
684
- var useModuleEvent = function useModuleEvent(cb) {
685
- var _useProModule = useProModule(),
686
- subject$ = _useProModule.subject$;
687
-
688
- useEffect(function () {
689
- var sub = subject$.subscribe({
690
- next: function next(action) {
691
- cb(action);
306
+ }), De = (e) => {
307
+ const { subject$: n } = ue();
308
+ ce(() => {
309
+ const a = n.subscribe({
310
+ next: (t) => {
311
+ e(t);
692
312
  }
693
313
  });
694
- return function () {
695
- return sub.unsubscribe();
696
- };
314
+ return () => a.unsubscribe();
697
315
  }, []);
698
- };
699
-
700
- var ProCurdKey = Symbol("pro-curd");
701
- var useProCurd = function useProCurd() {
702
- return inject(ProCurdKey);
703
- };
704
- var provideProCurd = function provideProCurd(ctx) {
705
- return provide(ProCurdKey, ctx);
706
- };
707
- /************************************ 常量 *************************************/
708
-
709
- /**
710
- * curd 5种Action
711
- */
712
-
713
- var CurdAction;
714
-
715
- (function (CurdAction) {
716
- CurdAction["LIST"] = "LIST";
717
- CurdAction["DETAIL"] = "DETAIL";
718
- CurdAction["ADD"] = "ADD";
719
- CurdAction["EDIT"] = "EDIT";
720
- CurdAction["DELETE"] = "DELETE";
721
- })(CurdAction || (CurdAction = {}));
722
-
723
- /**
724
- * 5种Action 的子事件
725
- */
726
- var CurdSubAction;
727
-
728
- (function (CurdSubAction) {
729
- CurdSubAction["EMIT"] = "EMIT";
730
- CurdSubAction["EXECUTE"] = "EXECUTE";
731
- CurdSubAction["PAGE"] = "PAGE";
732
- CurdSubAction["SUCCESS"] = "SUCCESS";
733
- CurdSubAction["FAIL"] = "FAIL";
734
- })(CurdSubAction || (CurdSubAction = {}));
735
-
736
- /**
737
- * curd 操作模式
738
- */
739
- var CurdCurrentMode;
740
-
741
- (function (CurdCurrentMode) {
742
- CurdCurrentMode["ADD"] = "ADD";
743
- CurdCurrentMode["EDIT"] = "EDIT";
744
- CurdCurrentMode["DETAIL"] = "DETAIL";
745
- })(CurdCurrentMode || (CurdCurrentMode = {}));
746
-
747
- /**
748
- * curd add 模式下 标记 "确定" "确定并继续" 触发
749
- */
750
- var CurdAddAction;
751
-
752
- (function (CurdAddAction) {
753
- CurdAddAction["NORMAL"] = "NORMAL";
754
- CurdAddAction["CONTINUE"] = "CONTINUE";
755
- })(CurdAddAction || (CurdAddAction = {}));
756
-
757
- /**
758
- * 剔除showState或showStateRules规则为!true的值
759
- * @param values
760
- * @param showState
761
- * @param showStateRules
762
- */
763
-
764
- var getValidValues = function getValidValues(values, showState, showStateRules) {
765
- if (showState) {
766
- var invalidKeys = filter$1(keys(showState), function (key) {
767
- return !showState[key];
768
- });
769
- return omit(values, invalidKeys);
770
- }
771
-
772
- if (showStateRules) {
773
- var _invalidKeys = filter$1(keys(showStateRules), function (key) {
774
- return !showStateRules[key](values);
775
- });
776
-
777
- return omit(values, _invalidKeys);
778
- }
779
-
780
- return values;
781
- };
782
- /**
783
- * string类型的path转为arr
784
- * @param path
785
- */
786
-
787
- var convertPathToList = function convertPathToList(path) {
788
- if (!path) {
789
- return undefined;
790
- }
791
-
792
- if (isArray(path)) {
793
- return path;
316
+ }, Ve = Symbol("pro-curd"), se = () => re(Ve), bt = (e) => oe(Ve, e);
317
+ var g = /* @__PURE__ */ ((e) => (e.LIST = "LIST", e.DETAIL = "DETAIL", e.ADD = "ADD", e.EDIT = "EDIT", e.DELETE = "DELETE", e))(g || {}), D = /* @__PURE__ */ ((e) => (e.EMIT = "EMIT", e.EXECUTE = "EXECUTE", e.PAGE = "PAGE", e.SUCCESS = "SUCCESS", e.FAIL = "FAIL", e))(D || {}), F = /* @__PURE__ */ ((e) => (e.ADD = "ADD", e.EDIT = "EDIT", e.DETAIL = "DETAIL", e))(F || {}), ne = /* @__PURE__ */ ((e) => (e.NORMAL = "NORMAL", e.CONTINUE = "CONTINUE", e))(ne || {});
318
+ const vt = (e, n, a) => {
319
+ if (n) {
320
+ const t = z(N(n), (o) => !n[o]);
321
+ return I(e, t);
794
322
  }
795
-
796
- if (path && isString(path) && path.indexOf(".") > 0) {
797
- return split(path, ".");
323
+ if (a) {
324
+ const t = z(N(a), (o) => !a[o](e));
325
+ return I(e, t);
798
326
  }
799
-
800
- return [path];
801
- };
802
- /**
803
- * 将listState 中的数据通过id merge到 list item中
804
- * ps:数组会替换
805
- * 注意:mergeWith 会改变原始对象
806
- * @param list
807
- * @param listState
808
- * @param id
809
- */
810
-
811
- var mergeStateToList = function mergeStateToList(list, listState, id) {
812
- if (!listState || !id) {
813
- return list;
814
- }
815
-
816
- return map(list, function (item) {
817
- var idName = isFunction(id) ? id(item) : id; //如果listState中有值,merge处理
818
-
819
- var stateData = get(listState, idName);
820
-
821
- if (!stateData || isEmpty(stateData) || isFunction(stateData) || !isObject(stateData)) {
822
- return item;
823
- } //只有是对象(键值对)才合并
824
-
825
-
826
- return mergeWith(item, stateData, function (objValue, srcValue) {
827
- //如果是数组,替换
828
- if (isArray(objValue) || isArray(srcValue)) {
829
- return srcValue;
830
- }
831
- });
327
+ return e;
328
+ }, Xe = (e) => {
329
+ if (!!e)
330
+ return q(e) ? e : e && fe(e) && e.indexOf(".") > 0 ? Ze(e, ".") : [e];
331
+ }, Ie = (e, n, a) => !n || !a ? e : O(e, (t) => {
332
+ const o = H(a) ? a(t) : a, r = P(n, o);
333
+ return !r || et(r) || H(r) || !Re(r) ? t : je(t, r, (l, f) => {
334
+ if (q(l) || q(f))
335
+ return f;
832
336
  });
833
- };
834
-
835
- /**
836
- * ref 传递
837
- */
838
-
839
- var createExpose = function createExpose(methods, targetRef) {
840
- return reduce(methods, function (pair, method) {
841
- return _objectSpread2(_objectSpread2({}, pair), {}, _defineProperty({}, method, function () {
842
- var _targetRef$value, _targetRef$value$meth;
843
-
844
- for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
845
- params[_key] = arguments[_key];
846
- }
847
-
848
- return (_targetRef$value = targetRef.value) === null || _targetRef$value === void 0 ? void 0 : (_targetRef$value$meth = _targetRef$value[method]) === null || _targetRef$value$meth === void 0 ? void 0 : _targetRef$value$meth.call.apply(_targetRef$value$meth, [_targetRef$value].concat(params));
849
- }));
850
- }, {});
851
- };
852
-
853
- var defaultPage = {
337
+ }), J = (e, n) => Y(
338
+ e,
339
+ (a, t) => ({
340
+ ...a,
341
+ [t]: (...o) => {
342
+ var r, l;
343
+ return (l = (r = n.value) == null ? void 0 : r[t]) == null ? void 0 : l.call(r, ...o);
344
+ }
345
+ }),
346
+ {}
347
+ ), Pt = {
854
348
  page: 1,
855
349
  pageSize: 10
856
- };
857
-
858
- var proCurdProps = function proCurdProps() {
859
- return {
860
- /**
861
- * 配置(静态)
862
- */
863
- columns: {
864
- type: Array
865
- },
866
-
867
- /**
868
- * 配置(动态)
869
- * columns动态属性兼容
870
- */
871
- columnState: {
872
- type: Object
873
- },
874
-
875
- /**
876
- * 录入组件集
877
- */
878
- formElementMap: {
879
- type: Object
880
- },
881
-
882
- /**
883
- * 列表 或 详情 的唯一标识
884
- */
885
- rowKey: {
886
- type: String,
887
- "default": "id"
888
- },
889
-
890
- /**
891
- * operates
892
- */
893
- operates: {
894
- type: Array
895
- },
896
-
897
- /************************* 子组件props *******************************/
898
- listProps: {
899
- type: Object
900
- },
901
- formProps: {
902
- type: Object
903
- },
904
- descProps: {
905
- type: Object
906
- },
907
- modalProps: {
908
- type: Object
909
- }
910
- };
911
- };
912
-
913
- var CurdMethods = ["sendCurdEvent", "refreshList", "sendEvent", "sendRequest"];
914
- var Curd = defineComponent({
915
- props: _objectSpread2({}, proCurdProps()),
916
- setup: function setup(props, _ref) {
917
- var slots = _ref.slots,
918
- expose = _ref.expose;
919
-
920
- var _ref2 = useProModule(),
921
- elementMap = _ref2.elementMap,
922
- state = _ref2.state,
923
- sendEvent = _ref2.sendEvent,
924
- sendRequest = _ref2.sendRequest;
925
- /**
926
- * columns columnState 合并
927
- */
928
-
929
-
930
- var columns = computed(function () {
931
- return mergeStateToList(props.columns, props.columnState, function (item) {
932
- return getColumnFormItemName(item);
350
+ }, gt = () => ({
351
+ columns: {
352
+ type: Array
353
+ },
354
+ columnState: {
355
+ type: Object
356
+ },
357
+ formElementMap: {
358
+ type: Object
359
+ },
360
+ rowKey: {
361
+ type: String,
362
+ default: "id"
363
+ },
364
+ operates: {
365
+ type: Array
366
+ },
367
+ listProps: {
368
+ type: Object
369
+ },
370
+ formProps: {
371
+ type: Object
372
+ },
373
+ descProps: {
374
+ type: Object
375
+ },
376
+ modalProps: {
377
+ type: Object
378
+ }
379
+ }), ze = ["sendCurdEvent", "refreshList", "sendEvent", "sendRequest"], Ae = A({
380
+ props: {
381
+ ...gt()
382
+ },
383
+ setup: (e, {
384
+ slots: n,
385
+ expose: a
386
+ }) => {
387
+ const {
388
+ elementMap: t,
389
+ state: o,
390
+ sendEvent: r,
391
+ sendRequest: l
392
+ } = ue(), f = w(() => Ie(e.columns, e.columnState, (T) => Z(T))), y = (T, L = !0) => ve(e.formElementMap, T, L), p = (T, L) => Ke(t, T, L), c = (T, L) => {
393
+ const G = z(f.value, (R) => {
394
+ const j = P(R, ["extra", T]) || P(R, T);
395
+ return L ? j !== !1 : j;
933
396
  });
934
- });
935
- /*********************************** 渲染组件 ***************************************/
936
- // 获取FormItem VNode
937
-
938
- var getFormItemVNode = function getFormItemVNode(column) {
939
- var needRules = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
940
- return getFormItemEl(props.formElementMap, column, needRules);
941
- }; // 获取Item VNode
942
-
943
-
944
- var getItemVNode = function getItemVNode(column, value) {
945
- return getItemEl(elementMap, column, value);
946
- };
947
- /**
948
- * ${signName} 配置为true 会被选择
949
- * @param signName
950
- * @param opposite 如果为true,未配置(undefined)会被选择
951
- */
952
-
953
-
954
- var getSignColumns = function getSignColumns(signName, opposite) {
955
- var signColumns = filter$1(columns.value, function (item) {
956
- var sign = get(item, ["extra", signName]) || get(item, signName);
957
-
958
- if (opposite) {
959
- //不为false 即为选中
960
- return sign !== false;
961
- } //只有true 才为选中
962
-
963
-
964
- return sign;
397
+ return Ne(G, (R) => P(R, ["extra", `${T}Sort`]) || P(R, `${T}Sort`));
398
+ }, u = w(() => c("form", !0)), s = w(() => c("detail", !0)), i = w(() => c("table", !0)), d = w(() => c("search"));
399
+ let m;
400
+ const E = (T) => {
401
+ l(g.LIST, {
402
+ ...m,
403
+ ...T
965
404
  });
966
- return sortBy(signColumns, function (item) {
967
- return get(item, ["extra", "".concat(signName, "Sort")]) || get(item, "".concat(signName, "Sort"));
405
+ }, S = (T) => {
406
+ r({
407
+ type: T.action,
408
+ payload: I(T, "action", "source"),
409
+ source: T.source
968
410
  });
969
411
  };
970
-
971
- var formColumns = computed(function () {
972
- return getSignColumns("form", true);
973
- });
974
- var descColumns = computed(function () {
975
- return getSignColumns("detail", true);
976
- });
977
- var tableColumns = computed(function () {
978
- return getSignColumns("table", true);
979
- });
980
- var searchColumns = computed(function () {
981
- return getSignColumns("search");
982
- });
983
- /******************************** 逻辑 *************************************/
984
- //上一次发起列表请求的参数
985
-
986
- var prevListParams; //刷新列表
987
-
988
- var handleSearch = function handleSearch(extra) {
989
- sendRequest(CurdAction.LIST, _objectSpread2(_objectSpread2({}, prevListParams), extra));
990
- }; //发送事件
991
-
992
-
993
- var sendCurdEvent = function sendCurdEvent(event) {
994
- sendEvent({
995
- type: event.action,
996
- payload: omit(event, "action", "source"),
997
- source: event.source
998
- });
999
- }; //事件订阅
1000
-
1001
-
1002
- useModuleEvent(function (event) {
1003
- //如果当前event存在source 不处理
1004
- if (event.source) {
412
+ De(({
413
+ type: T,
414
+ payload: L,
415
+ source: G
416
+ }) => {
417
+ if (G)
1005
418
  return;
1006
- }
1007
-
1008
- var action = event.type;
1009
- var _ref3 = event.payload,
1010
- type = _ref3.type,
1011
- values = _ref3.values,
1012
- record = _ref3.record;
1013
-
1014
- switch (action) {
1015
- case CurdAction.LIST:
1016
- if (type === CurdSubAction.EMIT) {
1017
- prevListParams = values;
1018
- handleSearch();
1019
- }
1020
-
419
+ let R = T, j = L == null ? void 0 : L.type;
420
+ R === te.Success && (R = P(L, ["requestOpts", "action"]), j = D.SUCCESS);
421
+ const {
422
+ values: V,
423
+ record: de
424
+ } = L;
425
+ switch (R) {
426
+ case g.LIST:
427
+ j === D.EMIT && (m = V, E());
1021
428
  return;
1022
-
1023
- case CurdAction.ADD:
1024
- if (type === CurdSubAction.EXECUTE) {
1025
- sendRequest(CurdAction.ADD, values, state.detailData);
1026
- }
1027
-
429
+ case g.ADD:
430
+ j === D.EXECUTE && l(g.ADD, V, o.detailData);
1028
431
  return;
1029
-
1030
- case CurdAction.EDIT:
1031
- if (type === CurdSubAction.EXECUTE) {
1032
- sendRequest(CurdAction.EDIT, values, state.detailData);
1033
- }
1034
-
432
+ case g.EDIT:
433
+ j === D.EXECUTE && l(g.EDIT, V, o.detailData);
1035
434
  return;
1036
-
1037
- case CurdAction.DELETE:
1038
- if (type === CurdSubAction.EMIT) {
1039
- sendRequest(CurdAction.DELETE, record, props.rowKey);
1040
- }
1041
-
435
+ case g.DELETE:
436
+ j === D.EMIT ? l(g.DELETE, de, e.rowKey) : j === D.SUCCESS && E();
1042
437
  return;
1043
- } //非 CurdAction 五种操作的其他请求
1044
-
1045
-
1046
- if (action && type === CurdSubAction.EXECUTE) {
1047
- sendRequest(action, values);
1048
438
  }
439
+ R && T === D.EXECUTE && l(R, V);
1049
440
  });
1050
- var operateMap = reduce(props.operates, function (pair, item) {
1051
- return _objectSpread2(_objectSpread2({}, pair), {}, _defineProperty({}, item.action, item));
1052
- }, {}); //根据Action获取ICurdOperateOpts
1053
-
1054
- var getOperate = function getOperate(action) {
1055
- return get(operateMap, action);
1056
- };
1057
-
1058
- var listProps = computed(function () {
1059
- return props.listProps;
1060
- });
1061
- var formProps = computed(function () {
1062
- return props.formProps;
1063
- });
1064
- var descProps = computed(function () {
1065
- return props.descProps;
1066
- });
1067
- var modalProps = computed(function () {
1068
- return props.modalProps;
1069
- });
1070
- provideProCurd({
1071
- columns: columns,
1072
- getSignColumns: getSignColumns,
1073
- getFormItemVNode: getFormItemVNode,
1074
- getItemVNode: getItemVNode,
1075
- elementMap: elementMap,
1076
- formElementMap: props.formElementMap,
1077
- //
1078
- rowKey: props.rowKey,
1079
- curdState: state,
1080
- formColumns: formColumns,
1081
- descColumns: descColumns,
1082
- tableColumns: tableColumns,
1083
- searchColumns: searchColumns,
1084
- //
1085
- sendCurdEvent: sendCurdEvent,
1086
- //
1087
- getOperate: getOperate,
1088
- //
1089
- refreshList: handleSearch,
1090
- //
1091
- listProps: listProps,
1092
- formProps: formProps,
1093
- descProps: descProps,
1094
- modalProps: modalProps
1095
- });
1096
- expose({
1097
- sendCurdEvent: sendCurdEvent,
1098
- refreshList: handleSearch
1099
- });
1100
- return function () {
1101
- var _slots$default;
1102
-
1103
- return (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots);
441
+ const h = Y(e.operates, (T, L) => ({
442
+ ...T,
443
+ [L.action]: L
444
+ }), {}), b = (T) => P(h, T), C = w(() => e.listProps), x = w(() => e.formProps), B = w(() => e.descProps), $ = w(() => e.modalProps);
445
+ return bt({
446
+ columns: f,
447
+ getSignColumns: c,
448
+ getFormItemVNode: y,
449
+ getItemVNode: p,
450
+ elementMap: t,
451
+ formElementMap: e.formElementMap,
452
+ rowKey: e.rowKey,
453
+ curdState: o,
454
+ formColumns: u,
455
+ descColumns: s,
456
+ tableColumns: i,
457
+ searchColumns: d,
458
+ sendCurdEvent: S,
459
+ operates: e.operates,
460
+ getOperate: b,
461
+ refreshList: E,
462
+ listProps: C,
463
+ formProps: x,
464
+ descProps: B,
465
+ modalProps: $
466
+ }), a({
467
+ sendCurdEvent: S,
468
+ refreshList: E
469
+ }), () => {
470
+ var T;
471
+ return (T = n.default) == null ? void 0 : T.call(n);
1104
472
  };
1105
473
  }
1106
- });
1107
- var ProCurd = defineComponent({
1108
- props: _objectSpread2(_objectSpread2(_objectSpread2({}, omit(ProModule.props, "state", "requests")), Curd.props), {}, {
474
+ }), le = A({
475
+ props: {
476
+ ...I(pe.props, "state", "requests"),
477
+ ...Ae.props,
1109
478
  curdState: {
1110
479
  type: Object
1111
480
  }
1112
- }),
1113
- setup: function setup(props, _ref4) {
1114
- var _curdOperateOpts;
1115
-
1116
- var slots = _ref4.slots,
1117
- expose = _ref4.expose;
1118
- var moduleRef = ref();
1119
- var curdRef = ref();
1120
- var curdState = props.curdState || reactive({
481
+ },
482
+ setup: (e, {
483
+ slots: n,
484
+ expose: a
485
+ }) => {
486
+ const t = U(), o = U(), r = e.curdState || K({
1121
487
  detailData: {}
1122
- });
1123
- /****************** 请求处理 **********************/
1124
- //curd默认网络属性
1125
-
1126
- var curdOperateOpts = (_curdOperateOpts = {}, _defineProperty(_curdOperateOpts, CurdAction.LIST, {
1127
- convertParams: function convertParams(values) {
1128
- return values;
1129
- },
1130
- convertData: function convertData(actor) {
1131
- var _actor$res;
1132
-
1133
- return (_actor$res = actor.res) === null || _actor$res === void 0 ? void 0 : _actor$res.data;
1134
- },
1135
- loadingName: "listLoading",
1136
- stateName: "listData"
1137
- }), _defineProperty(_curdOperateOpts, CurdAction.DETAIL, {
1138
- convertParams: function convertParams(record, rowKey) {
1139
- return pick(record, rowKey);
488
+ }), l = {
489
+ [g.LIST]: {
490
+ convertParams: (c) => c,
491
+ convertData: (c) => {
492
+ var u;
493
+ return (u = c.res) == null ? void 0 : u.data;
494
+ },
495
+ loadingName: "listLoading",
496
+ stateName: "listData"
1140
497
  },
1141
- convertData: function convertData(actor) {
1142
- var _actor$res2;
1143
-
1144
- return (_actor$res2 = actor.res) === null || _actor$res2 === void 0 ? void 0 : _actor$res2.data;
498
+ [g.DETAIL]: {
499
+ convertParams: (c, u) => k(c, u),
500
+ convertData: (c) => {
501
+ var u;
502
+ return (u = c.res) == null ? void 0 : u.data;
503
+ },
504
+ loadingName: "detailLoading",
505
+ stateName: "detailData",
506
+ label: "\u8BE6\u60C5"
1145
507
  },
1146
- loadingName: "detailLoading",
1147
- stateName: "detailData",
1148
- label: "详情"
1149
- }), _defineProperty(_curdOperateOpts, CurdAction.ADD, {
1150
- convertParams: function convertParams(values, record) {
1151
- return {
1152
- body: _objectSpread2(_objectSpread2({}, record), values)
1153
- };
1154
- },
1155
- loadingName: "operateLoading",
1156
- label: "添加"
1157
- }), _defineProperty(_curdOperateOpts, CurdAction.EDIT, {
1158
- convertParams: function convertParams(values, record) {
1159
- return {
1160
- body: _objectSpread2(_objectSpread2({}, record), values)
1161
- };
508
+ [g.ADD]: {
509
+ convertParams: (c, u) => ({
510
+ body: {
511
+ ...u,
512
+ ...c
513
+ }
514
+ }),
515
+ loadingName: "operateLoading",
516
+ label: "\u6DFB\u52A0"
1162
517
  },
1163
- loadingName: "operateLoading",
1164
- label: "编辑"
1165
- }), _defineProperty(_curdOperateOpts, CurdAction.DELETE, {
1166
- convertParams: function convertParams(record, rowKey) {
1167
- return pick(record, rowKey);
518
+ [g.EDIT]: {
519
+ convertParams: (c, u) => ({
520
+ body: {
521
+ ...u,
522
+ ...c
523
+ }
524
+ }),
525
+ loadingName: "operateLoading",
526
+ label: "\u7F16\u8F91"
1168
527
  },
1169
- label: "删除"
1170
- }), _curdOperateOpts);
1171
- /****************************** columns分类 *************************************/
1172
-
1173
- var operates = map(props.operates, function (item) {
1174
- var curdOpts = get(curdOperateOpts, item.action);
1175
- return _objectSpread2(_objectSpread2({}, curdOpts), item);
1176
- }); //只取配置actor的项
1177
-
1178
- var requests = filter$1(operates, function (item) {
1179
- return item.actor;
1180
- });
1181
- var moduleKeys = keys(omit(ProModule.props, "state", "requests"));
1182
- expose({
1183
- sendCurdEvent: function sendCurdEvent(event) {
1184
- var _curdRef$value;
1185
-
1186
- (_curdRef$value = curdRef.value) === null || _curdRef$value === void 0 ? void 0 : _curdRef$value.sendCurdEvent(event);
528
+ [g.DELETE]: {
529
+ convertParams: (c, u) => k(c, u),
530
+ label: "\u5220\u9664"
531
+ }
532
+ }, f = O(e.operates, (c) => ({
533
+ ...P(l, c.action),
534
+ ...c
535
+ })), y = z(f, (c) => c.actor), p = N(I(pe.props, "state", "requests"));
536
+ return a({
537
+ sendCurdEvent: (c) => {
538
+ var u;
539
+ (u = o.value) == null || u.sendCurdEvent(c);
1187
540
  },
1188
- refreshList: function refreshList(extra) {
1189
- var _curdRef$value2;
1190
-
1191
- (_curdRef$value2 = curdRef.value) === null || _curdRef$value2 === void 0 ? void 0 : _curdRef$value2.refreshList(extra);
541
+ refreshList: (c) => {
542
+ var u;
543
+ (u = o.value) == null || u.refreshList(c);
1192
544
  },
1193
- sendEvent: function sendEvent(action) {
1194
- var _moduleRef$value;
1195
-
1196
- (_moduleRef$value = moduleRef.value) === null || _moduleRef$value === void 0 ? void 0 : _moduleRef$value.sendEvent(action);
545
+ sendEvent: (c) => {
546
+ var u;
547
+ (u = t.value) == null || u.sendEvent(c);
1197
548
  },
1198
- sendRequest: function sendRequest(requestNameOrAction) {
1199
- var _moduleRef$value2;
1200
-
1201
- for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1202
- params[_key - 1] = arguments[_key];
1203
- }
1204
-
1205
- (_moduleRef$value2 = moduleRef.value) === null || _moduleRef$value2 === void 0 ? void 0 : _moduleRef$value2.sendRequest.apply(_moduleRef$value2, [requestNameOrAction].concat(params));
549
+ sendRequest: (c, ...u) => {
550
+ var s;
551
+ (s = t.value) == null || s.sendRequest(c, ...u);
1206
552
  }
553
+ }), () => v(pe, M({
554
+ ref: t
555
+ }, k(e, p), {
556
+ state: r,
557
+ requests: y
558
+ }), {
559
+ default: () => [v(Ae, M({
560
+ ref: o
561
+ }, I(e, ...p, "curdState", "operates"), {
562
+ operates: f
563
+ }), n)]
1207
564
  });
1208
- return function () {
1209
- return createVNode(ProModule, mergeProps({
1210
- "ref": moduleRef
1211
- }, pick(props, moduleKeys), {
1212
- "state": curdState,
1213
- "requests": requests
1214
- }), {
1215
- "default": function _default() {
1216
- return [createVNode(Curd, mergeProps({
1217
- "ref": curdRef
1218
- }, omit.apply(void 0, [props].concat(_toConsumableArray(moduleKeys), ["curdState", "operates"])), {
1219
- "operates": operates
1220
- }), slots)];
1221
- }
1222
- });
1223
- };
1224
565
  }
1225
- });
1226
-
1227
- var modalCurdProps = function modalCurdProps() {
1228
- return {
1229
- defaultAddRecord: {
1230
- type: Object
1231
- }
1232
- };
1233
- };
1234
-
1235
- /**
1236
- * 事件处理
1237
- */
1238
- var ModalCurd = defineComponent({
1239
- props: _objectSpread2({}, modalCurdProps()),
1240
- setup: function setup(props) {
1241
- var _listProps$value;
1242
-
1243
- var _useProModule = useProModule(),
1244
- dispatch = _useProModule.dispatch,
1245
- sendRequest = _useProModule.sendRequest;
1246
-
1247
- var _useProCurd = useProCurd(),
1248
- rowKey = _useProCurd.rowKey,
1249
- curdState = _useProCurd.curdState,
1250
- listProps = _useProCurd.listProps,
1251
- getOperate = _useProCurd.getOperate,
1252
- refreshList = _useProCurd.refreshList;
1253
-
1254
- var pageState = (listProps === null || listProps === void 0 ? void 0 : (_listProps$value = listProps.value) === null || _listProps$value === void 0 ? void 0 : _listProps$value.pageState) || reactive(_objectSpread2({}, defaultPage)); //发送详情接口
1255
-
1256
- var sendDetailRequest = function sendDetailRequest(record) {
1257
- var operateOpts = getOperate(CurdAction.DETAIL);
1258
-
1259
- if (operateOpts !== null && operateOpts !== void 0 && operateOpts.actor) {
1260
- //如果注册了详情接口 发起请求
1261
- sendRequest(CurdAction.DETAIL, record, rowKey);
1262
- } else {
1263
- //直接使用当前record作为详情数据
1264
- dispatch({
1265
- type: "detailData",
1266
- payload: record
1267
- });
1268
- }
1269
- };
1270
-
1271
- var dealDetail = function dealDetail(subAction, _ref) {
1272
- var record = _ref.record;
1273
-
1274
- if (subAction === CurdSubAction.EMIT) {
1275
- dispatch({
1276
- type: "mode",
1277
- payload: CurdCurrentMode.DETAIL
1278
- });
1279
- sendDetailRequest(record);
1280
- }
566
+ }), Tt = () => ({
567
+ defaultAddRecord: {
568
+ type: Object
569
+ }
570
+ }), Ee = A({
571
+ props: {
572
+ ...Tt()
573
+ },
574
+ setup: (e) => {
575
+ var i;
576
+ const {
577
+ dispatch: n,
578
+ sendRequest: a
579
+ } = ue(), {
580
+ rowKey: t,
581
+ curdState: o,
582
+ listProps: r,
583
+ getOperate: l,
584
+ refreshList: f
585
+ } = se(), y = (i = r == null ? void 0 : r.value) == null ? void 0 : i.pageState, p = (d) => {
586
+ const m = l(g.DETAIL);
587
+ m != null && m.actor ? a(g.DETAIL, d, t) : n({
588
+ type: "detailData",
589
+ payload: tt(d)
590
+ });
591
+ }, c = (d, {
592
+ record: m
593
+ }) => {
594
+ d === D.EMIT && (n({
595
+ type: "mode",
596
+ payload: F.DETAIL
597
+ }), p(m));
598
+ }, u = (d) => {
599
+ d === D.EMIT ? (n({
600
+ type: "mode",
601
+ payload: F.ADD
602
+ }), n({
603
+ type: "detailData",
604
+ payload: e.defaultAddRecord || {}
605
+ })) : d === D.SUCCESS && (y && (y.page = 1), f(), o.addAction === ne.CONTINUE ? n({
606
+ type: "detailData",
607
+ payload: e.defaultAddRecord || {}
608
+ }) : n({
609
+ type: "mode",
610
+ payload: void 0
611
+ }));
612
+ }, s = (d, {
613
+ record: m
614
+ }) => {
615
+ d === D.EMIT ? (n({
616
+ type: "mode",
617
+ payload: F.EDIT
618
+ }), p(m)) : d === D.SUCCESS && (n({
619
+ type: "mode",
620
+ payload: void 0
621
+ }), f());
1281
622
  };
1282
-
1283
- var dealAdd = function dealAdd(subAction) {
1284
- if (subAction === CurdSubAction.EMIT) {
1285
- dispatch({
1286
- type: "mode",
1287
- payload: CurdCurrentMode.ADD
1288
- });
1289
- dispatch({
1290
- type: "detailData",
1291
- payload: props.defaultAddRecord || {}
1292
- });
1293
- } else if (subAction === CurdSubAction.SUCCESS) {
1294
- //添加成功
1295
- pageState.page = 1; //重置当前页数
1296
- //刷新List
1297
-
1298
- refreshList({
1299
- page: 1
1300
- });
1301
-
1302
- if (curdState.addAction === CurdAddAction.CONTINUE) {
1303
- dispatch({
1304
- type: "detailData",
1305
- payload: props.defaultAddRecord || {}
623
+ return De(({
624
+ type: d,
625
+ payload: m,
626
+ source: E
627
+ }) => {
628
+ if (E)
629
+ return;
630
+ let S = d, h = m == null ? void 0 : m.type;
631
+ const b = m == null ? void 0 : m.record;
632
+ switch (S === te.Success && (S = P(m, ["requestOpts", "action"]), h = D.SUCCESS), S) {
633
+ case g.DETAIL:
634
+ c(h, {
635
+ record: b
1306
636
  });
1307
- } else {
1308
- dispatch({
1309
- type: "mode",
1310
- payload: undefined
637
+ break;
638
+ case g.ADD:
639
+ u(h);
640
+ break;
641
+ case g.EDIT:
642
+ s(h, {
643
+ record: b
1311
644
  });
1312
- }
1313
- }
1314
- };
1315
-
1316
- var dealEdit = function dealEdit(subAction, _ref2) {
1317
- var record = _ref2.record;
1318
-
1319
- if (subAction === CurdSubAction.EMIT) {
1320
- dispatch({
1321
- type: "mode",
1322
- payload: CurdCurrentMode.EDIT
1323
- });
1324
- sendDetailRequest(record);
1325
- } else if (subAction === CurdSubAction.SUCCESS) {
1326
- // 编辑成功
1327
- dispatch({
1328
- type: "mode",
1329
- payload: undefined
1330
- }); //刷新列表
1331
-
1332
- refreshList();
645
+ break;
1333
646
  }
1334
- };
1335
-
1336
- var dealDelete = function dealDelete(subAction) {
1337
- if (subAction === CurdSubAction.SUCCESS) {
1338
- //刷新列表
1339
- refreshList();
647
+ }), () => null;
648
+ }
649
+ }), Ut = A({
650
+ props: {
651
+ ...le.props,
652
+ ...Ee.props
653
+ },
654
+ setup: (e, {
655
+ slots: n,
656
+ expose: a
657
+ }) => {
658
+ const t = U();
659
+ a(J(ze, t));
660
+ const o = N(Ee.props);
661
+ return () => v(le, M({
662
+ ref: t
663
+ }, I(e, o)), {
664
+ default: () => {
665
+ var r;
666
+ return [v(Ee, k(e, o), null), (r = n.default) == null ? void 0 : r.call(n)];
1340
667
  }
668
+ });
669
+ }
670
+ }), Dt = () => ({
671
+ defaultAddRecord: {
672
+ type: Object
673
+ },
674
+ routeBack: {
675
+ type: Function
676
+ }
677
+ }), Se = A({
678
+ props: {
679
+ ...Dt()
680
+ },
681
+ setup: (e) => {
682
+ const n = it(), a = lt(), {
683
+ dispatch: t,
684
+ sendRequest: o
685
+ } = ue(), {
686
+ rowKey: r,
687
+ curdState: l
688
+ } = se(), f = (u) => {
689
+ u === D.PAGE && (t({
690
+ type: "mode",
691
+ payload: void 0
692
+ }), t({
693
+ type: "detailData",
694
+ payload: {}
695
+ }), t({
696
+ type: "detailLoading",
697
+ payload: !1
698
+ }), t({
699
+ type: "addAction",
700
+ payload: void 0
701
+ }));
702
+ }, y = (u, {
703
+ record: s
704
+ }) => {
705
+ u === D.EMIT ? n.push({
706
+ path: `${a.path}/detail`,
707
+ query: k(s, r)
708
+ }) : u === D.PAGE && (t({
709
+ type: "mode",
710
+ payload: F.DETAIL
711
+ }), o(g.DETAIL, a.query, r));
712
+ }, p = (u) => {
713
+ u === D.EMIT ? n.push({
714
+ path: `${a.path}/add`
715
+ }) : u === D.PAGE ? (t({
716
+ type: "mode",
717
+ payload: F.ADD
718
+ }), t({
719
+ type: "detailData",
720
+ payload: e.defaultAddRecord || {}
721
+ })) : u === D.SUCCESS && (l.addAction === ne.CONTINUE ? t({
722
+ type: "detailData",
723
+ payload: e.defaultAddRecord || {}
724
+ }) : e.routeBack ? e.routeBack(g.ADD) : n.go(-1));
725
+ }, c = (u, {
726
+ record: s
727
+ }) => {
728
+ u === D.EMIT ? n.push({
729
+ path: `${a.path}/edit`,
730
+ query: k(s, r)
731
+ }) : u === D.PAGE ? (t({
732
+ type: "mode",
733
+ payload: F.EDIT
734
+ }), o(g.DETAIL, a.query, r)) : u === D.SUCCESS && (e.routeBack ? e.routeBack(g.EDIT) : n.go(-1));
1341
735
  };
1342
-
1343
- useModuleEvent(function (_ref3) {
1344
- var type = _ref3.type,
1345
- payload = _ref3.payload,
1346
- source = _ref3.source;
1347
-
1348
- if (source) {
736
+ return De(({
737
+ type: u,
738
+ payload: s,
739
+ source: i
740
+ }) => {
741
+ if (i)
1349
742
  return;
1350
- }
1351
-
1352
- var action = type;
1353
- var subAction = payload === null || payload === void 0 ? void 0 : payload.type;
1354
- var record = payload === null || payload === void 0 ? void 0 : payload.record;
1355
-
1356
- if (action === RequestAction.Success) {
1357
- //覆盖
1358
- action = get(payload, ["requestOpts", "action"]);
1359
- subAction = CurdSubAction.SUCCESS;
1360
- }
1361
-
1362
- switch (action) {
1363
- case CurdAction.DETAIL:
1364
- dealDetail(subAction, {
1365
- record: record
743
+ let d = u, m = s == null ? void 0 : s.type;
744
+ const E = s == null ? void 0 : s.record;
745
+ switch (d === te.Success && (d = P(s, ["requestOpts", "action"]), m = D.SUCCESS), d) {
746
+ case g.LIST:
747
+ f(m);
748
+ break;
749
+ case g.DETAIL:
750
+ y(m, {
751
+ record: E
1366
752
  });
1367
753
  break;
1368
-
1369
- case CurdAction.ADD:
1370
- dealAdd(subAction);
754
+ case g.ADD:
755
+ p(m);
1371
756
  break;
1372
-
1373
- case CurdAction.EDIT:
1374
- dealEdit(subAction, {
1375
- record: record
757
+ case g.EDIT:
758
+ c(m, {
759
+ record: E
1376
760
  });
1377
761
  break;
1378
-
1379
- case CurdAction.DELETE:
1380
- dealDelete(subAction);
1381
- break;
762
+ }
763
+ }), () => null;
764
+ }
765
+ }), Bt = A({
766
+ props: {
767
+ ...le.props,
768
+ ...Se.props
769
+ },
770
+ setup: (e, {
771
+ slots: n,
772
+ expose: a
773
+ }) => {
774
+ const t = U();
775
+ a(J(ze, t));
776
+ const o = N(Se.props);
777
+ return () => v(le, M({
778
+ ref: t
779
+ }, I(e, o)), {
780
+ default: () => {
781
+ var r;
782
+ return [v(Se, k(e, o), null), (r = n.default) == null ? void 0 : r.call(n)];
1382
783
  }
1383
784
  });
1384
- return function () {
1385
- return null;
1386
- };
1387
785
  }
1388
786
  });
1389
- var ProModalCurd = defineComponent({
1390
- props: _objectSpread2(_objectSpread2({}, ProCurd.props), ModalCurd.props),
1391
- setup: function setup(props, _ref4) {
1392
- var slots = _ref4.slots,
1393
- expose = _ref4.expose;
1394
- var curdRef = ref();
1395
- expose(createExpose(CurdMethods, curdRef));
1396
- var invalidKeys = keys(ModalCurd.props);
1397
- return function () {
1398
- var _slots$default;
1399
-
1400
- return createVNode(ProCurd, mergeProps({
1401
- "ref": curdRef
1402
- }, omit(props, invalidKeys)), {
1403
- "default": function _default() {
1404
- return [createVNode(ModalCurd, pick(props, invalidKeys), null), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
1405
- }
1406
- });
1407
- };
1408
- }
1409
- });
1410
-
1411
- var pageCurdProps = function pageCurdProps() {
1412
- return {
1413
- defaultAddRecord: {
1414
- type: Object
1415
- },
1416
- routeBack: {
787
+ function It(e) {
788
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ie(e);
789
+ }
790
+ const $t = (e, n) => A({
791
+ props: {
792
+ ...e.props,
793
+ renderItem: {
1417
794
  type: Function
795
+ },
796
+ signName: {
797
+ type: String
1418
798
  }
1419
- };
1420
- };
1421
-
1422
- var PageCurd = defineComponent({
1423
- props: _objectSpread2({}, pageCurdProps()),
1424
- setup: function setup(props) {
1425
- var router = useRouter();
1426
- var route = useRoute();
1427
-
1428
- var _useProModule = useProModule(),
1429
- dispatch = _useProModule.dispatch,
1430
- sendRequest = _useProModule.sendRequest;
1431
-
1432
- var _useProCurd = useProCurd(),
1433
- rowKey = _useProCurd.rowKey,
1434
- curdState = _useProCurd.curdState,
1435
- refreshList = _useProCurd.refreshList;
1436
-
1437
- var dealList = function dealList(subAction) {
1438
- if (subAction === CurdSubAction.PAGE) {
1439
- //其实就是个重置过程
1440
- dispatch({
1441
- type: "mode",
1442
- payload: undefined
1443
- });
1444
- dispatch({
1445
- type: "detailData",
1446
- payload: {}
1447
- });
1448
- dispatch({
1449
- type: "detailLoading",
1450
- payload: false
1451
- });
1452
- dispatch({
1453
- type: "addAction",
1454
- payload: undefined
1455
- });
1456
- }
1457
- };
1458
-
1459
- var dealDetail = function dealDetail(subAction, _ref) {
1460
- var record = _ref.record;
1461
-
1462
- if (subAction === CurdSubAction.EMIT) {
1463
- router.push({
1464
- path: "".concat(route.path, "/detail"),
1465
- query: pick(record, rowKey)
1466
- });
1467
- } else if (subAction === CurdSubAction.PAGE) {
1468
- dispatch({
1469
- type: "mode",
1470
- payload: CurdCurrentMode.DETAIL
1471
- });
1472
- sendRequest(CurdAction.DETAIL, route.query, rowKey);
1473
- }
1474
- };
1475
-
1476
- var dealAdd = function dealAdd(subAction) {
1477
- if (subAction === CurdSubAction.EMIT) {
1478
- router.push({
1479
- path: "".concat(route.path, "/add")
1480
- });
1481
- } else if (subAction === CurdSubAction.PAGE) {
1482
- dispatch({
1483
- type: "mode",
1484
- payload: CurdCurrentMode.ADD
1485
- });
1486
- dispatch({
1487
- type: "detailData",
1488
- payload: props.defaultAddRecord || {}
1489
- });
1490
- } else if (subAction === CurdSubAction.SUCCESS) {
1491
- if (curdState.addAction === CurdAddAction.CONTINUE) {
1492
- dispatch({
1493
- type: "detailData",
1494
- payload: props.defaultAddRecord || {}
1495
- });
1496
- } else {
1497
- props.routeBack ? props.routeBack(CurdAction.ADD) : router.go(-1);
1498
- }
1499
- }
1500
- };
1501
-
1502
- var dealEdit = function dealEdit(subAction, _ref2) {
1503
- var record = _ref2.record;
1504
-
1505
- if (subAction === CurdSubAction.EMIT) {
1506
- router.push({
1507
- path: "".concat(route.path, "/edit"),
1508
- query: pick(record, rowKey)
1509
- });
1510
- } else if (subAction === CurdSubAction.PAGE) {
1511
- dispatch({
1512
- type: "mode",
1513
- payload: CurdCurrentMode.EDIT
799
+ },
800
+ setup: (a, {
801
+ slots: t
802
+ }) => {
803
+ const {
804
+ getItemVNode: o,
805
+ curdState: r,
806
+ descColumns: l,
807
+ getSignColumns: f
808
+ } = se(), y = w(() => {
809
+ const p = a.signName ? f(a.signName) : l.value;
810
+ return O(p, (c) => {
811
+ var d;
812
+ let u;
813
+ const s = (d = a.renderItem) == null ? void 0 : d.call(a, c);
814
+ if (s)
815
+ return s;
816
+ const i = P(r.detailData, c.dataIndex);
817
+ return v(n, M({
818
+ key: c.dataIndex,
819
+ label: c.title
820
+ }, P(c.extra, "desc")), It(u = o(c, i)) ? u : {
821
+ default: () => [u]
1514
822
  });
1515
- sendRequest(CurdAction.DETAIL, route.query, rowKey);
1516
- } else if (subAction === CurdSubAction.SUCCESS) {
1517
- props.routeBack ? props.routeBack(CurdAction.EDIT) : router.go(-1);
1518
- }
1519
- };
1520
-
1521
- var dealDelete = function dealDelete(subAction) {
1522
- if (subAction === CurdSubAction.SUCCESS) {
1523
- //刷新列表
1524
- refreshList();
1525
- }
1526
- };
1527
-
1528
- useModuleEvent(function (_ref3) {
1529
- var type = _ref3.type,
1530
- payload = _ref3.payload,
1531
- source = _ref3.source;
1532
-
1533
- if (source) {
1534
- return;
1535
- }
1536
-
1537
- var action = type;
1538
- var subAction = payload === null || payload === void 0 ? void 0 : payload.type;
1539
- var record = payload === null || payload === void 0 ? void 0 : payload.record;
1540
-
1541
- if (action === RequestAction.Success) {
1542
- //覆盖
1543
- action = get(payload, ["requestOpts", "action"]);
1544
- subAction = CurdSubAction.SUCCESS;
1545
- }
1546
-
1547
- switch (action) {
1548
- case CurdAction.LIST:
1549
- dealList(subAction);
1550
- break;
1551
-
1552
- case CurdAction.DETAIL:
1553
- dealDetail(subAction, {
1554
- record: record
1555
- });
1556
- break;
1557
-
1558
- case CurdAction.ADD:
1559
- dealAdd(subAction);
1560
- break;
1561
-
1562
- case CurdAction.EDIT:
1563
- dealEdit(subAction, {
1564
- record: record
1565
- });
1566
- break;
1567
-
1568
- case CurdAction.DELETE:
1569
- dealDelete(subAction);
1570
- break;
1571
- }
823
+ });
824
+ });
825
+ return () => v(e, a, {
826
+ default: () => {
827
+ var p, c;
828
+ return [(p = t.start) == null ? void 0 : p.call(t), y.value, (c = t.default) == null ? void 0 : c.call(t)];
829
+ },
830
+ ...I(t, "default", "start")
1572
831
  });
1573
- return function () {
1574
- return null;
1575
- };
1576
832
  }
1577
- });
1578
- var ProPageCurd = defineComponent({
1579
- props: _objectSpread2(_objectSpread2({}, ProCurd.props), PageCurd.props),
1580
- setup: function setup(props, _ref4) {
1581
- var slots = _ref4.slots,
1582
- expose = _ref4.expose;
1583
- var curdRef = ref();
1584
- expose(createExpose(CurdMethods, curdRef));
1585
- var invalidKeys = keys(PageCurd.props);
1586
- return function () {
1587
- var _slots$default;
1588
-
1589
- return createVNode(ProCurd, mergeProps({
1590
- "ref": curdRef
1591
- }, omit(props, invalidKeys)), {
1592
- "default": function _default() {
1593
- return [createVNode(PageCurd, pick(props, invalidKeys), null), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
1594
- }
1595
- });
1596
- };
833
+ }), Ct = () => ({
834
+ signName: {
835
+ type: String
836
+ },
837
+ modelName: {
838
+ type: String,
839
+ default: "detailData"
840
+ },
841
+ operateBar: {
842
+ type: Boolean,
843
+ default: !0
844
+ },
845
+ showContinueAdd: {
846
+ type: Boolean,
847
+ default: !1
848
+ },
849
+ okText: {
850
+ type: String,
851
+ default: "\u786E\u5B9A"
852
+ },
853
+ okButtonProps: {
854
+ type: Object
855
+ },
856
+ continueText: {
857
+ type: String,
858
+ default: "\u786E\u5B9A\u5E76\u7EE7\u7EED"
859
+ },
860
+ continueButtonProps: {
861
+ type: Object
1597
862
  }
1598
- });
1599
-
1600
- function _isSlot(s) {
1601
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
1602
- }
1603
-
1604
- var createCurdDesc = function createCurdDesc(Descriptions, DescriptionsItem) {
1605
- return defineComponent({
1606
- props: _objectSpread2(_objectSpread2({}, Descriptions.props), {}, {
1607
- //重写Item content
1608
- renderItem: {
1609
- type: Function
1610
- },
1611
- //标记名称
1612
- signName: {
1613
- type: String
863
+ }), Vt = (e, n, a, t) => A({
864
+ inheritAttrs: !1,
865
+ props: {
866
+ ...e.props,
867
+ ...Ct()
868
+ },
869
+ setup: (o, {
870
+ slots: r,
871
+ attrs: l,
872
+ expose: f
873
+ }) => {
874
+ const {
875
+ elementMap: y,
876
+ formElementMap: p,
877
+ curdState: c,
878
+ formColumns: u,
879
+ getSignColumns: s,
880
+ sendCurdEvent: i
881
+ } = se(), d = U(), m = w(() => o.signName ? s(o.signName) : u.value), E = (b, C) => {
882
+ if (l.onFinish) {
883
+ l.onFinish(b, C);
884
+ return;
1614
885
  }
1615
- }),
1616
- setup: function setup(props, _ref) {
1617
- var slots = _ref.slots;
1618
-
1619
- var _useProCurd = useProCurd(),
1620
- getItemVNode = _useProCurd.getItemVNode,
1621
- curdState = _useProCurd.curdState,
1622
- descColumns = _useProCurd.descColumns,
1623
- getSignColumns = _useProCurd.getSignColumns;
1624
-
1625
- var descVNodes = computed(function () {
1626
- var columns = props.signName ? getSignColumns(props.signName) : descColumns.value;
1627
- return map(columns, function (item) {
1628
- var _slot;
1629
-
1630
- var _props$renderItem;
1631
-
1632
- var vn = (_props$renderItem = props.renderItem) === null || _props$renderItem === void 0 ? void 0 : _props$renderItem.call(props, item);
1633
-
1634
- if (vn) {
1635
- return vn;
1636
- }
1637
-
1638
- var value = get(curdState.detailData, item.dataIndex);
1639
- return createVNode(DescriptionsItem, mergeProps({
1640
- "key": item.dataIndex,
1641
- "label": item.title
1642
- }, get(item.extra, "desc")), _isSlot(_slot = getItemVNode(item, value)) ? _slot : {
1643
- "default": function _default() {
1644
- return [_slot];
1645
- }
1646
- });
1647
- });
886
+ c.mode === F.EDIT ? i({
887
+ action: g.EDIT,
888
+ type: D.EXECUTE,
889
+ values: b
890
+ }) : i({
891
+ action: g.ADD,
892
+ type: D.EXECUTE,
893
+ values: b
1648
894
  });
1649
- return function () {
1650
- var _slots$start, _slots$default;
1651
-
1652
- return createVNode(Descriptions, props, _objectSpread2({
1653
- "default": function _default() {
1654
- return [(_slots$start = slots.start) === null || _slots$start === void 0 ? void 0 : _slots$start.call(slots), descVNodes.value, (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
1655
- }
1656
- }, omit(slots, "default", "start")));
1657
- };
1658
- }
1659
- });
1660
- };
1661
-
1662
- var proCurdAddOrEditProps = function proCurdAddOrEditProps() {
1663
- return {
1664
- //标记名称
1665
- signName: {
1666
- type: String
1667
- },
1668
- //form model 绑定的curdState中的对象
1669
- modelName: {
1670
- type: String,
1671
- "default": "detailData"
1672
- },
1673
- //是否使用operate bar
1674
- operateBar: {
1675
- type: Boolean,
1676
- "default": true
1677
- },
1678
- //显示 确定并继续 按钮
1679
- showContinueAdd: {
1680
- type: Boolean,
1681
- "default": false
1682
- },
1683
- //
1684
- okText: {
1685
- type: String,
1686
- "default": "确定"
1687
- },
1688
- okButtonProps: {
1689
- type: Object
1690
- },
1691
- //
1692
- continueText: {
1693
- type: String,
1694
- "default": "确定并继续"
1695
- },
1696
- continueButtonProps: {
1697
- type: Object
1698
- }
1699
- };
1700
- };
1701
-
1702
- var createCurdForm = function createCurdForm(Form, Button, convertFormProps, formMethods) {
1703
- return defineComponent({
1704
- inheritAttrs: false,
1705
- props: _objectSpread2(_objectSpread2({}, Form.props), proCurdAddOrEditProps()),
1706
- setup: function setup(props, _ref) {
1707
- var slots = _ref.slots,
1708
- attrs = _ref.attrs,
1709
- expose = _ref.expose;
1710
-
1711
- var _useProCurd = useProCurd(),
1712
- elementMap = _useProCurd.elementMap,
1713
- formElementMap = _useProCurd.formElementMap,
1714
- curdState = _useProCurd.curdState,
1715
- formColumns = _useProCurd.formColumns,
1716
- getSignColumns = _useProCurd.getSignColumns,
1717
- sendCurdEvent = _useProCurd.sendCurdEvent;
1718
-
1719
- var formRef = ref();
1720
- var columns = computed(function () {
1721
- if (props.signName) {
1722
- return getSignColumns(props.signName);
895
+ }, S = () => {
896
+ var b;
897
+ c.addAction = ne.NORMAL, (b = d.value) == null || b.submit();
898
+ }, h = () => {
899
+ var b;
900
+ c.addAction = ne.CONTINUE, (b = d.value) == null || b.submit();
901
+ };
902
+ return f(J(t, d)), () => v(e, M({
903
+ ref: d
904
+ }, I(l, "onFinish"), o, {
905
+ elementMap: o.elementMap || y,
906
+ formElementMap: o.formElementMap || p,
907
+ columns: o.columns || m.value,
908
+ model: o.model || c[o.modelName],
909
+ readonly: c.mode === F.DETAIL,
910
+ onFinish: E
911
+ }, a == null ? void 0 : a(c)), {
912
+ default: () => {
913
+ var b, C, x, B, $;
914
+ return [(b = r.divide) == null ? void 0 : b.call(r), o.operateBar && v("div", {
915
+ class: "pro-curd-form-operate"
916
+ }, [(C = r.operateStart) == null ? void 0 : C.call(r), c.mode !== F.DETAIL && v(n, M({
917
+ onClick: S
918
+ }, o.okButtonProps, {
919
+ loading: c.operateLoading
920
+ }), {
921
+ default: () => [o.okText]
922
+ }), (x = r.operateCenter) == null ? void 0 : x.call(r), o.showContinueAdd && c.mode === F.ADD && v(n, M({
923
+ onClick: h
924
+ }, o.continueButtonProps, {
925
+ loading: c.operateLoading
926
+ }), {
927
+ default: () => [o.continueText]
928
+ }), (B = r.operateEnd) == null ? void 0 : B.call(r)]), ($ = r.default) == null ? void 0 : $.call(r)];
929
+ },
930
+ ...I(r, "default", "divide", "operateStart", "operateCenter", "operateEnd")
931
+ });
932
+ }
933
+ }), At = () => ({
934
+ extraInSearch: {
935
+ type: Boolean,
936
+ default: void 0
937
+ },
938
+ searchProps: {
939
+ type: Object
940
+ },
941
+ tableProps: {
942
+ type: Object
943
+ },
944
+ paginationProps: {
945
+ type: Object
946
+ },
947
+ showPagination: {
948
+ type: Boolean,
949
+ default: !0
950
+ },
951
+ pageState: {
952
+ type: Object
953
+ }
954
+ }), Xt = (e, n) => A({
955
+ props: {
956
+ ...At()
957
+ },
958
+ setup: (a, {
959
+ slots: t
960
+ }) => {
961
+ const {
962
+ elementMap: o,
963
+ formElementMap: r,
964
+ curdState: l,
965
+ searchColumns: f,
966
+ tableColumns: y,
967
+ sendCurdEvent: p,
968
+ operates: c
969
+ } = se(), u = a.pageState || K({
970
+ ...Pt
971
+ });
972
+ let s;
973
+ const i = () => {
974
+ p({
975
+ action: g.LIST,
976
+ type: D.EMIT,
977
+ values: {
978
+ ...s,
979
+ ...u
1723
980
  }
1724
-
1725
- return formColumns.value;
1726
981
  });
1727
-
1728
- var handleFinish = function handleFinish(values, originValues) {
1729
- if (attrs.onFinish) {
1730
- attrs.onFinish(values, originValues);
1731
- return;
1732
- }
1733
-
1734
- if (curdState.mode === CurdCurrentMode.EDIT) {
1735
- //edit
1736
- sendCurdEvent({
1737
- action: CurdAction.EDIT,
1738
- type: CurdSubAction.EXECUTE,
1739
- values: values
1740
- });
1741
- } else {
1742
- //add
1743
- sendCurdEvent({
1744
- action: CurdAction.ADD,
1745
- type: CurdSubAction.EXECUTE,
1746
- values: values
1747
- });
1748
- }
1749
- };
1750
-
1751
- var handleAdd = function handleAdd() {
1752
- var _formRef$value;
1753
-
1754
- curdState.addAction = CurdAddAction.NORMAL;
1755
- (_formRef$value = formRef.value) === null || _formRef$value === void 0 ? void 0 : _formRef$value.submit();
1756
- };
1757
-
1758
- var handleContinueAdd = function handleContinueAdd() {
1759
- var _formRef$value2;
1760
-
1761
- curdState.addAction = CurdAddAction.CONTINUE;
1762
- (_formRef$value2 = formRef.value) === null || _formRef$value2 === void 0 ? void 0 : _formRef$value2.submit();
982
+ }, d = (S) => {
983
+ s = S, u.page = 1, i();
984
+ }, m = O(z(c, (S) => {
985
+ const h = S.action;
986
+ return h === g.DETAIL || h === g.EDIT || h === g.DELETE || S.tableOperate;
987
+ }), (S) => {
988
+ const h = {
989
+ ...k(S, "label", "element", "disabled", "sort", "onClick"),
990
+ show: nt(S == null ? void 0 : S.show) ? !1 : S == null ? void 0 : S.show,
991
+ value: S.action
1763
992
  };
1764
-
1765
- expose(createExpose(formMethods, formRef));
1766
- return function () {
1767
- var _slots$divide, _slots$operateStart, _slots$operateCenter, _slots$operateEnd, _slots$default;
1768
-
1769
- return createVNode(Form, mergeProps({
1770
- "ref": formRef
1771
- }, omit(attrs, "onFinish"), props, {
1772
- "elementMap": props.elementMap || elementMap,
1773
- "formElementMap": props.formElementMap || formElementMap,
1774
- "columns": props.columns || columns.value,
1775
- "model": props.model || curdState[props.modelName],
1776
- "readonly": curdState.mode === CurdCurrentMode.DETAIL,
1777
- "onFinish": handleFinish
1778
- }, convertFormProps === null || convertFormProps === void 0 ? void 0 : convertFormProps(curdState)), _objectSpread2({
1779
- "default": function _default() {
1780
- return [(_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), props.operateBar && createVNode("div", {
1781
- "class": "pro-curd-form-operate"
1782
- }, [(_slots$operateStart = slots.operateStart) === null || _slots$operateStart === void 0 ? void 0 : _slots$operateStart.call(slots), curdState.mode !== CurdCurrentMode.DETAIL && createVNode(Button, mergeProps({
1783
- "onClick": handleAdd
1784
- }, props.okButtonProps, {
1785
- "loading": curdState.operateLoading
1786
- }), {
1787
- "default": function _default() {
1788
- return [props.okText];
1789
- }
1790
- }), (_slots$operateCenter = slots.operateCenter) === null || _slots$operateCenter === void 0 ? void 0 : _slots$operateCenter.call(slots), props.showContinueAdd && curdState.mode === CurdCurrentMode.ADD && createVNode(Button, mergeProps({
1791
- "onClick": handleContinueAdd
1792
- }, props.continueButtonProps, {
1793
- "loading": curdState.operateLoading
1794
- }), {
1795
- "default": function _default() {
1796
- return [props.continueText];
1797
- }
1798
- }), (_slots$operateEnd = slots.operateEnd) === null || _slots$operateEnd === void 0 ? void 0 : _slots$operateEnd.call(slots)]), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
1799
- }
1800
- }, omit(slots, "default", "divide", "operateStart", "operateCenter", "operateEnd")));
1801
- };
1802
- }
1803
- });
1804
- };
1805
-
1806
- var proCurdListProps = function proCurdListProps() {
1807
- return {
1808
- /**
1809
- * extra 是否放到SearchForm中
1810
- */
1811
- extraInSearch: {
1812
- type: Boolean,
1813
- "default": undefined
1814
- },
1815
- //search
1816
- searchProps: {
1817
- type: Object
1818
- },
1819
- //table
1820
- tableProps: {
1821
- type: Object
1822
- },
1823
- //pagination是否展示
1824
- paginationProps: {
1825
- type: Object
1826
- },
1827
- showPagination: {
1828
- type: Boolean,
1829
- "default": true
1830
- },
1831
- //pageState
1832
- pageState: {
1833
- type: Object
1834
- }
1835
- };
1836
- };
1837
-
1838
- var createCurdList = function createCurdList(SearchForm, Table) {
1839
- return defineComponent({
1840
- props: _objectSpread2({}, proCurdListProps()),
1841
- setup: function setup(props, _ref) {
1842
- var slots = _ref.slots;
1843
-
1844
- var _useProCurd = useProCurd(),
1845
- elementMap = _useProCurd.elementMap,
1846
- formElementMap = _useProCurd.formElementMap,
1847
- curdState = _useProCurd.curdState,
1848
- searchColumns = _useProCurd.searchColumns,
1849
- tableColumns = _useProCurd.tableColumns,
1850
- getOperate = _useProCurd.getOperate,
1851
- sendCurdEvent = _useProCurd.sendCurdEvent;
1852
- /******************* search pagination ********************/
1853
-
1854
-
1855
- var pageState = props.pageState || reactive(_objectSpread2({}, defaultPage));
1856
- var prevValues;
1857
-
1858
- var handleSearch = function handleSearch() {
1859
- sendCurdEvent({
1860
- action: CurdAction.LIST,
1861
- type: CurdSubAction.EMIT,
1862
- values: _objectSpread2(_objectSpread2({}, prevValues), pageState)
993
+ return h.onClick || (h.onClick = (b) => {
994
+ p({
995
+ action: S.action,
996
+ type: D.EMIT,
997
+ record: b
1863
998
  });
1864
- };
1865
-
1866
- var executeSearchWithResetPage = function executeSearchWithResetPage(values) {
1867
- prevValues = values;
1868
- pageState.page = 1;
1869
- handleSearch();
1870
- };
1871
- /******************* table ********************/
1872
-
1873
-
1874
- var createTableItem = function createTableItem(action) {
1875
- var operate = getOperate(action);
1876
-
1877
- var item = _objectSpread2(_objectSpread2({}, pick(operate, "label", "element", "disabled", "sort", "onClick")), {}, {
1878
- show: !isUndefined(operate === null || operate === void 0 ? void 0 : operate.show) ? operate === null || operate === void 0 ? void 0 : operate.show : false,
1879
- value: action
999
+ }), h;
1000
+ }), E = (S) => O(S, (h) => h.onClick ? h : {
1001
+ ...h,
1002
+ onClick: (b) => {
1003
+ p({
1004
+ action: "operate",
1005
+ type: h.value,
1006
+ record: b
1880
1007
  });
1881
-
1882
- if (!item.onClick) {
1883
- return _objectSpread2(_objectSpread2({}, item), {}, {
1884
- onClick: function onClick(record) {
1885
- //默认发送事件
1886
- sendCurdEvent({
1887
- action: action,
1888
- type: CurdSubAction.EMIT,
1889
- record: record
1890
- });
1891
- }
1892
- });
1893
- }
1894
-
1895
- return item;
1896
- }; //table操作栏 items
1897
-
1898
-
1899
- var tableOperateItems = [createTableItem(CurdAction.DETAIL), createTableItem(CurdAction.EDIT), createTableItem(CurdAction.DELETE)]; //新配置的operate item,添加默认发送事件方法
1900
-
1901
- var convertOperateItems = function convertOperateItems(list) {
1902
- return map(list, function (item) {
1903
- if (!item.onClick) {
1904
- return _objectSpread2(_objectSpread2({}, item), {}, {
1905
- onClick: function onClick(record) {
1906
- sendCurdEvent({
1907
- action: "operate",
1908
- type: item.value,
1909
- record: record
1910
- });
1911
- }
1912
- });
1913
- }
1914
-
1915
- return item;
1916
- });
1917
- };
1918
-
1919
- return function () {
1920
- var _curdState$listData, _slots$start, _props$searchProps, _slots$divide, _slots$divide2, _slots$footerStart, _slots$pagination, _curdState$listData2, _slots$footerEnd, _slots$end;
1921
-
1922
- var tableProps = props.tableProps;
1923
-
1924
- var rewriteTableProps = _objectSpread2(_objectSpread2({
1925
- elementMap: elementMap,
1926
- columns: tableColumns.value
1927
- }, omit(tableProps, "slots", "operate")), {}, {
1928
- operate: mergeWith({
1929
- items: tableOperateItems
1930
- }, tableProps === null || tableProps === void 0 ? void 0 : tableProps.operate, function (objValue, srcValue) {
1931
- if (isArray(objValue) && isArray(srcValue)) {
1932
- return concat(objValue, convertOperateItems(srcValue));
1933
- }
1934
- }),
1935
- paginationState: {
1936
- page: pageState.page,
1937
- pageSize: pageState.pageSize
1938
- },
1939
- loading: curdState.listLoading,
1940
- dataSource: (_curdState$listData = curdState.listData) === null || _curdState$listData === void 0 ? void 0 : _curdState$listData.dataSource
1941
- });
1942
-
1943
- var extra = slots.extra ? createVNode("div", {
1944
- "class": "pro-curd-list-extra"
1945
- }, [slots.extra()]) : null;
1946
- return createVNode(Fragment, null, [(_slots$start = slots.start) === null || _slots$start === void 0 ? void 0 : _slots$start.call(slots), slots.search ? slots.search({
1947
- executeSearchWithResetPage: executeSearchWithResetPage
1948
- }) : createVNode(SearchForm, mergeProps({
1949
- "formElementMap": formElementMap,
1950
- "columns": searchColumns.value
1951
- }, omit(props.searchProps, "slots"), {
1952
- "onFinish": executeSearchWithResetPage
1953
- }), _objectSpread2({
1954
- "default": function _default() {
1955
- return [props.extraInSearch && extra];
1956
- }
1957
- }, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table(rewriteTableProps) : createVNode(Table, rewriteTableProps, tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), props.showPagination && createVNode("div", {
1958
- "class": "pro-curd-list-footer"
1959
- }, [(_slots$footerStart = slots.footerStart) === null || _slots$footerStart === void 0 ? void 0 : _slots$footerStart.call(slots), (_slots$pagination = slots.pagination) === null || _slots$pagination === void 0 ? void 0 : _slots$pagination.call(slots, pageState, (_curdState$listData2 = curdState.listData) === null || _curdState$listData2 === void 0 ? void 0 : _curdState$listData2.total, handleSearch), (_slots$footerEnd = slots.footerEnd) === null || _slots$footerEnd === void 0 ? void 0 : _slots$footerEnd.call(slots)]), (_slots$end = slots.end) === null || _slots$end === void 0 ? void 0 : _slots$end.call(slots)]);
1960
- };
1961
- }
1962
- });
1963
- };
1964
-
1965
- /**
1966
- * ProFormList ctx
1967
- */
1968
-
1969
- var ProFormListKey = Symbol("pro-form-list");
1970
- var useProFormList = function useProFormList() {
1971
- return inject(ProFormListKey);
1972
- };
1973
- var provideProFormList = function provideProFormList(ctx) {
1974
- provide(ProFormListKey, ctx);
1975
- };
1976
- var FormListProvider = defineComponent({
1008
+ }
1009
+ });
1010
+ return () => {
1011
+ var C, x, B, $, T, L, G, R, j, V;
1012
+ const S = a.tableProps, h = {
1013
+ elementMap: o,
1014
+ columns: y.value,
1015
+ ...I(S, "slots", "operate"),
1016
+ operate: je({
1017
+ items: m
1018
+ }, S == null ? void 0 : S.operate, (de, Ce) => {
1019
+ if (q(de) && q(Ce))
1020
+ return rt(de, E(Ce));
1021
+ }),
1022
+ paginationState: {
1023
+ page: u.page,
1024
+ pageSize: u.pageSize
1025
+ },
1026
+ loading: l.listLoading,
1027
+ dataSource: (C = l.listData) == null ? void 0 : C.dataSource
1028
+ }, b = t.extra ? v("div", {
1029
+ class: "pro-curd-list-extra"
1030
+ }, [t.extra()]) : null;
1031
+ return v(ae, null, [(x = t.start) == null ? void 0 : x.call(t), t.search ? t.search({
1032
+ executeSearchWithResetPage: d
1033
+ }) : v(e, M({
1034
+ formElementMap: r,
1035
+ columns: f.value
1036
+ }, I(a.searchProps, "slots"), {
1037
+ onFinish: d
1038
+ }), {
1039
+ default: () => [a.extraInSearch && b],
1040
+ ...(B = a.searchProps) == null ? void 0 : B.slots
1041
+ }), ($ = t.divide) == null ? void 0 : $.call(t), !a.extraInSearch && b, t.table ? t.table(h) : v(n, h, S == null ? void 0 : S.slots), (T = t.divide2) == null ? void 0 : T.call(t), a.showPagination && v("div", {
1042
+ class: "pro-curd-list-footer"
1043
+ }, [(L = t.footerStart) == null ? void 0 : L.call(t), (R = t.pagination) == null ? void 0 : R.call(t, u, (G = l.listData) == null ? void 0 : G.total, i), (j = t.footerEnd) == null ? void 0 : j.call(t)]), (V = t.end) == null ? void 0 : V.call(t)]);
1044
+ };
1045
+ }
1046
+ }), Ge = Symbol("pro-form-list"), We = () => re(Ge), _e = (e) => {
1047
+ oe(Ge, e);
1048
+ }, Lt = A({
1977
1049
  props: {
1978
1050
  pathList: {
1979
1051
  type: Array
1980
1052
  }
1981
1053
  },
1982
- setup: function setup(props, _ref) {
1983
- var slots = _ref.slots;
1984
- provideProFormList({
1985
- pathList: props.pathList
1986
- });
1987
- return function () {
1988
- var _slots$default;
1989
-
1990
- return (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots);
1054
+ setup: (e, {
1055
+ slots: n
1056
+ }) => (_e({
1057
+ pathList: e.pathList
1058
+ }), () => {
1059
+ var a;
1060
+ return (a = n.default) == null ? void 0 : a.call(n);
1061
+ })
1062
+ }), zt = (e) => A({
1063
+ props: {
1064
+ ...e.props,
1065
+ rowKey: {
1066
+ type: String,
1067
+ default: "id"
1068
+ }
1069
+ },
1070
+ setup: (n, {
1071
+ slots: a
1072
+ }) => {
1073
+ const {
1074
+ formState: t,
1075
+ readonly: o
1076
+ } = Je(), r = We(), l = Xe(n.name), f = r != null && r.pathList ? [...r.pathList, ...l] : l, y = () => {
1077
+ let c = P(t, f);
1078
+ q(c) || (c = []), c.push({
1079
+ [n.rowKey]: new Date().valueOf()
1080
+ }), _(t, f, c);
1081
+ }, p = (c) => {
1082
+ const u = P(t, f);
1083
+ X(u) <= 0 || u.splice(c, 1);
1991
1084
  };
1085
+ return () => v(e, I(n, "rowKey"), {
1086
+ default: () => {
1087
+ var c;
1088
+ return [O(P(t, f), (u, s) => v(Lt, {
1089
+ key: u[n.rowKey] || s,
1090
+ pathList: [...f, s]
1091
+ }, {
1092
+ default: () => {
1093
+ var i, d, m;
1094
+ return [v("div", {
1095
+ class: "pro-form-list-item"
1096
+ }, [(i = a.default) == null ? void 0 : i.call(a), !o.value && v(ae, null, [v("div", {
1097
+ class: "pro-form-list-item-add",
1098
+ onClick: y
1099
+ }, [(d = a.itemAdd) == null ? void 0 : d.call(a)]), v("div", {
1100
+ class: "pro-form-list-item-minus",
1101
+ onClick: () => p(s)
1102
+ }, [(m = a.itemMinus) == null ? void 0 : m.call(a)])])])];
1103
+ }
1104
+ })), !o.value && v("div", {
1105
+ class: "pro-form-list-add",
1106
+ onClick: y
1107
+ }, [(c = a.add) == null ? void 0 : c.call(a)])];
1108
+ }
1109
+ });
1110
+ }
1111
+ }), He = Symbol("pro-form"), Je = () => re(He), Ot = (e) => {
1112
+ oe(He, e);
1113
+ }, Le = () => ({
1114
+ model: {
1115
+ type: Object
1116
+ },
1117
+ readonly: {
1118
+ type: Boolean,
1119
+ default: void 0
1120
+ },
1121
+ showState: {
1122
+ type: Object
1123
+ },
1124
+ showStateRules: {
1125
+ type: Object
1126
+ },
1127
+ readonlyState: {
1128
+ type: Object
1129
+ },
1130
+ readonlyStateRules: {
1131
+ type: Object
1132
+ },
1133
+ disableState: {
1134
+ type: Object
1135
+ },
1136
+ disableStateRules: {
1137
+ type: Object
1138
+ },
1139
+ columns: {
1140
+ type: Array
1141
+ },
1142
+ columnState: {
1143
+ type: Object
1144
+ },
1145
+ elementMap: {
1146
+ type: Object
1147
+ },
1148
+ formElementMap: {
1149
+ type: Object
1150
+ },
1151
+ needRules: {
1152
+ type: Boolean,
1153
+ default: !0
1154
+ },
1155
+ provideExtra: {
1156
+ type: Object
1157
+ }
1158
+ }), Gt = (e, n, a) => A({
1159
+ inheritAttrs: !1,
1160
+ props: {
1161
+ ...e.props,
1162
+ ...Le(),
1163
+ ...I(n.props, "items")
1164
+ },
1165
+ setup: (t, {
1166
+ slots: o,
1167
+ emit: r,
1168
+ expose: l,
1169
+ attrs: f
1170
+ }) => {
1171
+ const y = t.model || K({}), p = t.showState || K({}), c = t.readonlyState || K({}), u = t.disableState || K({});
1172
+ ce(() => {
1173
+ t.showStateRules && W(t.showStateRules, (h, b) => {
1174
+ p[b] = h(y);
1175
+ }), t.readonlyStateRules && W(t.readonlyStateRules, (h, b) => {
1176
+ c[b] = h(y);
1177
+ }), t.disableStateRules && W(t.disableStateRules, (h, b) => {
1178
+ u[b] = h(y);
1179
+ });
1180
+ }, y);
1181
+ const s = w(() => t.readonly), i = w(() => Ie(t.columns, t.columnState, (h) => Z(h))), d = (h) => {
1182
+ const b = vt(h, p, t.showStateRules);
1183
+ r("finish", b, h);
1184
+ }, m = U();
1185
+ l(J(a, m)), Ot({
1186
+ formState: y,
1187
+ showState: p,
1188
+ readonlyState: c,
1189
+ disableState: u,
1190
+ elementMap: t.elementMap,
1191
+ formElementMap: t.formElementMap,
1192
+ readonly: s,
1193
+ columns: i,
1194
+ formRef: m,
1195
+ ...t.provideExtra
1196
+ }), _e({});
1197
+ const E = N(Le()), S = N(I(n.props, "items"));
1198
+ return () => v(e, M({
1199
+ ref: m
1200
+ }, I(f, "onFinish"), I(t, ...E, ...S, "onFinish"), {
1201
+ model: y,
1202
+ onFinish: d
1203
+ }), {
1204
+ default: () => {
1205
+ var h, b;
1206
+ return [(h = o.start) == null ? void 0 : h.call(o), t.formElementMap && X(i.value) > 0 && v(ae, null, [t.row ? v(n, {
1207
+ row: t.row,
1208
+ col: t.col,
1209
+ items: O(i.value, (C) => ({
1210
+ rowKey: Z(C),
1211
+ vNode: ve(t.formElementMap, C, t.needRules),
1212
+ col: P(C, ["extra", "col"])
1213
+ }))
1214
+ }, null) : O(i.value, (C) => ve(t.formElementMap, C, t.needRules))]), (b = o.default) == null ? void 0 : b.call(o)];
1215
+ },
1216
+ ...I(o, "default")
1217
+ });
1992
1218
  }
1993
1219
  });
1994
-
1995
- var createFormList = function createFormList(FormItem) {
1996
- return defineComponent({
1997
- props: _objectSpread2(_objectSpread2({}, FormItem.props), {}, {
1998
- //每行默认id
1999
- rowKey: {
2000
- type: String,
2001
- "default": "id"
1220
+ let me;
1221
+ (function(e) {
1222
+ e.AUTO = "AUTO", e.MANUAL = "MANUAL";
1223
+ })(me || (me = {}));
1224
+ const Oe = () => ({
1225
+ model: {
1226
+ type: Object
1227
+ },
1228
+ initEmit: {
1229
+ type: Boolean,
1230
+ default: !0
1231
+ },
1232
+ searchMode: {
1233
+ type: String,
1234
+ default: me.AUTO
1235
+ },
1236
+ columns: {
1237
+ type: Array
1238
+ },
1239
+ debounceKeys: {
1240
+ type: Array
1241
+ },
1242
+ debounceTypes: {
1243
+ type: Array,
1244
+ default: ["text"]
1245
+ },
1246
+ debounceTime: {
1247
+ type: Number,
1248
+ default: 800
1249
+ }
1250
+ }), Wt = (e, n, a) => A({
1251
+ props: {
1252
+ ...e.props,
1253
+ ...n,
1254
+ ...Oe()
1255
+ },
1256
+ setup: (t, {
1257
+ slots: o,
1258
+ expose: r
1259
+ }) => {
1260
+ const l = t.model || K({}), f = new Set(t.debounceTypes), y = O(z(t.columns, (d) => {
1261
+ const m = qe(d);
1262
+ return f.has(m);
1263
+ }), (d) => Z(d)), p = U();
1264
+ r(J(a, p));
1265
+ const c = () => {
1266
+ var d;
1267
+ (d = p.value) == null || d.submit();
1268
+ }, u = at(() => {
1269
+ c();
1270
+ }, t.debounceTime);
1271
+ ce(() => {
1272
+ t.initEmit && c();
1273
+ }, []);
1274
+ const s = (d, m, E) => Pe(E, (S) => P(d, S) !== P(m, S));
1275
+ dt((d, m) => {
1276
+ if (t.searchMode !== me.AUTO)
1277
+ return;
1278
+ const E = X(t.debounceKeys) > 0 ? t.debounceKeys : y;
1279
+ if (X(E) > 0 && s(d, m, E)) {
1280
+ u();
1281
+ return;
2002
1282
  }
2003
- }),
2004
- setup: function setup(props, _ref2) {
2005
- var slots = _ref2.slots;
2006
-
2007
- var _useProForm = useProForm(),
2008
- formState = _useProForm.formState,
2009
- readonly = _useProForm.readonly;
2010
-
2011
- var formListCtx = useProFormList();
2012
- var nameList = convertPathToList(props.name);
2013
- var path = formListCtx !== null && formListCtx !== void 0 && formListCtx.pathList ? [].concat(_toConsumableArray(formListCtx.pathList), _toConsumableArray(nameList)) : nameList;
2014
-
2015
- var handleAdd = function handleAdd() {
2016
- var targetList = get(formState, path);
2017
-
2018
- if (!isArray(targetList)) {
2019
- targetList = [];
2020
- }
2021
-
2022
- targetList.push(_defineProperty({}, props.rowKey, new Date().valueOf()));
2023
- set(formState, path, targetList);
2024
- };
2025
-
2026
- var handleRemove = function handleRemove(index) {
2027
- var targetList = get(formState, path);
2028
-
2029
- if (size(targetList) <= 0) {
2030
- return;
2031
- }
2032
-
2033
- targetList.splice(index, 1);
2034
- };
2035
-
2036
- return function () {
2037
- var _slots$add;
2038
-
2039
- return createVNode(FormItem, omit(props, "rowKey"), {
2040
- "default": function _default() {
2041
- return [map(get(formState, path), function (item, index) {
2042
- var _slots$default2, _slots$itemAdd, _slots$itemMinus;
2043
-
2044
- return createVNode(FormListProvider, {
2045
- "key": item[props.rowKey] || index,
2046
- "pathList": [].concat(_toConsumableArray(path), [index])
2047
- }, {
2048
- "default": function _default() {
2049
- return [createVNode("div", {
2050
- "class": "pro-form-list-item"
2051
- }, [(_slots$default2 = slots["default"]) === null || _slots$default2 === void 0 ? void 0 : _slots$default2.call(slots), !readonly.value && createVNode(Fragment, null, [createVNode("div", {
2052
- "class": "pro-form-list-item-add",
2053
- "onClick": handleAdd
2054
- }, [(_slots$itemAdd = slots.itemAdd) === null || _slots$itemAdd === void 0 ? void 0 : _slots$itemAdd.call(slots)]), createVNode("div", {
2055
- "class": "pro-form-list-item-minus",
2056
- "onClick": function onClick() {
2057
- return handleRemove(index);
2058
- }
2059
- }, [(_slots$itemMinus = slots.itemMinus) === null || _slots$itemMinus === void 0 ? void 0 : _slots$itemMinus.call(slots)])])])];
2060
- }
2061
- });
2062
- }), !readonly.value && createVNode("div", {
2063
- "class": "pro-form-list-add",
2064
- "onClick": handleAdd
2065
- }, [(_slots$add = slots.add) === null || _slots$add === void 0 ? void 0 : _slots$add.call(slots)])];
2066
- }
2067
- });
2068
- };
2069
- }
2070
- });
2071
- };
2072
-
2073
- var ProFormKey = Symbol("pro-form");
2074
- var useProForm = function useProForm() {
2075
- return inject(ProFormKey);
2076
- };
2077
-
2078
- var provideProForm = function provideProForm(ctx) {
2079
- provide(ProFormKey, ctx);
2080
- };
2081
-
2082
- var proFormProps = function proFormProps() {
2083
- return {
2084
- /**
2085
- * 同 antd 或 element form中的model
2086
- */
2087
- model: {
2088
- type: Object
2089
- },
2090
-
2091
- /**
2092
- * 子组件是否只读样式
2093
- */
2094
- readonly: {
2095
- type: Boolean,
2096
- "default": undefined
2097
- },
2098
-
2099
- /**
2100
- * FormComponent 根据此项来确定组件是否显示
2101
- * rules 根据rules中方法生成showState对象
2102
- */
2103
- showState: {
2104
- type: Object
2105
- },
2106
- showStateRules: {
2107
- type: Object
2108
- },
2109
-
2110
- /**
2111
- * 是否只读
2112
- */
2113
- readonlyState: {
2114
- type: Object
2115
- },
2116
- readonlyStateRules: {
2117
- type: Object
2118
- },
2119
-
2120
- /**
2121
- * 是否disabled
2122
- */
2123
- disableState: {
2124
- type: Object
2125
- },
2126
- disableStateRules: {
2127
- type: Object
2128
- },
2129
-
2130
- /**
2131
- *
2132
- */
2133
- columns: {
2134
- type: Array
2135
- },
2136
- columnState: {
2137
- type: Object
2138
- },
2139
-
2140
- /**
2141
- * 展示控件集合,readonly模式下使用这些组件渲染
2142
- */
2143
- elementMap: {
2144
- type: Object
2145
- },
2146
-
2147
- /**
2148
- * 录入控件集合
2149
- */
2150
- formElementMap: {
2151
- type: Object
2152
- },
2153
-
2154
- /**
2155
- * 是否启用rules验证
2156
- */
2157
- needRules: {
2158
- type: Boolean,
2159
- "default": true
2160
- },
2161
-
2162
- /**
2163
- * provide传递
2164
- */
2165
- provideExtra: {
2166
- type: Object
2167
- }
2168
- };
2169
- };
2170
-
2171
- var createForm = function createForm(Form, Grid, formMethods) {
2172
- return defineComponent({
2173
- inheritAttrs: false,
2174
- props: _objectSpread2(_objectSpread2(_objectSpread2({}, Form.props), proFormProps()), omit(Grid.props, "items")),
2175
- setup: function setup(props, _ref) {
2176
- var slots = _ref.slots,
2177
- emit = _ref.emit,
2178
- expose = _ref.expose,
2179
- attrs = _ref.attrs;
2180
- var formState = props.model || reactive({}); //组件状态相关
2181
-
2182
- var showState = props.showState || reactive({});
2183
- var readonlyState = props.readonlyState || reactive({});
2184
- var disableState = props.disableState || reactive({}); //formState改变情况下,更新 showState,readonlyState,disableState状态
2185
-
2186
- useEffect(function () {
2187
- if (props.showStateRules) {
2188
- forEach(props.showStateRules, function (fn, key) {
2189
- showState[key] = fn(formState);
2190
- });
2191
- }
2192
-
2193
- if (props.readonlyStateRules) {
2194
- forEach(props.readonlyStateRules, function (fn, key) {
2195
- readonlyState[key] = fn(formState);
2196
- });
2197
- }
2198
-
2199
- if (props.disableStateRules) {
2200
- forEach(props.disableStateRules, function (fn, key) {
2201
- disableState[key] = fn(formState);
2202
- });
2203
- }
2204
- }, formState); //readonly
2205
-
2206
- var readonly = computed(function () {
2207
- return props.readonly;
2208
- }); //columns合并
2209
-
2210
- var columns = computed(function () {
2211
- return mergeStateToList(props.columns, props.columnState, function (item) {
2212
- return getColumnFormItemName(item);
2213
- });
2214
- });
2215
-
2216
- var handleFinish = function handleFinish(values) {
2217
- //删除不显示的值再触发事件
2218
- var showValues = getValidValues(values, showState, props.showStateRules);
2219
- emit("finish", showValues, values);
2220
- };
2221
-
2222
- var formRef = ref();
2223
- expose(createExpose(formMethods, formRef));
2224
- provideProForm(_objectSpread2({
2225
- formState: formState,
2226
- showState: showState,
2227
- readonlyState: readonlyState,
2228
- disableState: disableState,
2229
- //
2230
- elementMap: props.elementMap,
2231
- formElementMap: props.formElementMap,
2232
- //
2233
- readonly: readonly,
2234
- //
2235
- columns: columns,
2236
- //
2237
- formRef: formRef
2238
- }, props.provideExtra)); //为了不warning ...
2239
-
2240
- provideProFormList({});
2241
- var invalidKeys = keys(proFormProps());
2242
- var gridKeys = keys(omit(Grid.props, "items"));
2243
- return function () {
2244
- var _slots$start, _slots$default;
2245
-
2246
- return createVNode(Form, mergeProps({
2247
- "ref": formRef
2248
- }, omit(attrs, "onFinish"), omit.apply(void 0, [props].concat(_toConsumableArray(invalidKeys), _toConsumableArray(gridKeys), ["onFinish"])), {
2249
- "model": formState,
2250
- "onFinish": handleFinish
2251
- }), _objectSpread2({
2252
- "default": function _default() {
2253
- return [(_slots$start = slots.start) === null || _slots$start === void 0 ? void 0 : _slots$start.call(slots), props.formElementMap && size(columns.value) > 0 && createVNode(Fragment, null, [props.row ? createVNode(Grid, {
2254
- "row": props.row,
2255
- "col": props.col,
2256
- "items": map(columns.value, function (item) {
2257
- return {
2258
- rowKey: getColumnFormItemName(item),
2259
- vNode: getFormItemEl(props.formElementMap, item, props.needRules),
2260
- col: get(item, ["extra", "col"])
2261
- };
2262
- })
2263
- }, null) : map(columns.value, function (item) {
2264
- return getFormItemEl(props.formElementMap, item, props.needRules);
2265
- })]), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
2266
- }
2267
- }, omit(slots, "default")));
2268
- };
2269
- }
2270
- });
2271
- };
2272
-
2273
- var SearchMode;
2274
-
2275
- (function (SearchMode) {
2276
- SearchMode["AUTO"] = "AUTO";
2277
- SearchMode["MANUAL"] = "MANUAL";
2278
- })(SearchMode || (SearchMode = {}));
2279
-
2280
- var proSearchFormProps = function proSearchFormProps() {
2281
- return {
2282
- /**
2283
- * 需要监听的对象
2284
- */
2285
- model: {
2286
- type: Object
2287
- },
2288
-
2289
- /**
2290
- * 初始化触发 onFinish
2291
- */
2292
- initEmit: {
2293
- type: Boolean,
2294
- "default": true
2295
- },
2296
-
2297
- /**
2298
- * 模式 自动触发或者手动触发 onFinish
2299
- */
2300
- searchMode: {
2301
- type: String,
2302
- "default": SearchMode.AUTO
2303
- },
2304
-
2305
- /**
2306
- * 配置 同ProForm中的columns
2307
- * 可以根据column中valueType计算出默认的debounceKeys
2308
- */
2309
- columns: {
2310
- type: Array
2311
- },
2312
-
2313
- /**
2314
- * 需要debounce处理的字段
2315
- */
2316
- debounceKeys: {
2317
- type: Array
2318
- },
2319
- //默认 valueType 为 text 的控件会debounce处理
2320
- debounceTypes: {
2321
- type: Array,
2322
- "default": ["text"]
2323
- },
2324
- debounceTime: {
2325
- type: Number,
2326
- "default": 800
2327
- }
2328
- };
2329
- };
2330
-
2331
- /**
2332
- * 该组件只是个模式,最终返回null,不做任何渲染,应配合着ProForm的包装类一起使用
2333
- * 针对传入的model(监听对象)做相应的finish(回调)处理
2334
- */
2335
- var createSearchForm = function createSearchForm(Form, Props, formMethods) {
2336
- return defineComponent({
2337
- props: _objectSpread2(_objectSpread2(_objectSpread2({}, Form.props), Props), proSearchFormProps()),
2338
- setup: function setup(props, _ref) {
2339
- var slots = _ref.slots,
2340
- expose = _ref.expose;
2341
- var formState = props.model || reactive({});
2342
- var valueTypeSet = new Set(props.debounceTypes); //根据column valueType 算出默认需要debounce处理的属性集合
2343
-
2344
- var defaultDebounceKeys = map(filter$1(props.columns, function (column) {
2345
- var valueType = getColumnValueType(column); //默认input组件的触发事件需要debounce处理
2346
-
2347
- return valueTypeSet.has(valueType);
2348
- }), function (column) {
2349
- return getColumnFormItemName(column);
2350
- });
2351
- var formRef = ref();
2352
- expose(createExpose(formMethods, formRef));
2353
-
2354
- var handleFinish = function handleFinish() {
2355
- var _formRef$value;
2356
-
2357
- (_formRef$value = formRef.value) === null || _formRef$value === void 0 ? void 0 : _formRef$value.submit();
2358
- };
2359
-
2360
- var debounceFinish = debounce(function () {
2361
- handleFinish();
2362
- }, props.debounceTime); //初始化
2363
-
2364
- useEffect(function () {
2365
- if (props.initEmit) {
2366
- handleFinish();
2367
- }
2368
- }, []);
2369
-
2370
- var isDebounceDataChange = function isDebounceDataChange(state, prevState, debounceKeys) {
2371
- return some(debounceKeys, function (key) {
2372
- return get(state, key) !== get(prevState, key);
2373
- });
2374
- }; //监听
2375
-
2376
-
2377
- useWatch(function (state, prevState) {
2378
- if (props.searchMode !== SearchMode.AUTO) {
2379
- return;
2380
- } //如果改变的值中包括debounceKeys中注册的 延时触发
2381
-
2382
-
2383
- var debounceKeys = size(props.debounceKeys) > 0 ? props.debounceKeys : defaultDebounceKeys;
2384
-
2385
- if (size(debounceKeys) > 0 && isDebounceDataChange(state, prevState, debounceKeys)) {
2386
- debounceFinish();
2387
- return;
2388
- }
2389
-
2390
- handleFinish();
2391
- }, function () {
2392
- return clone(formState);
1283
+ c();
1284
+ }, () => ot(l));
1285
+ const i = N(I(Oe(), "columns"));
1286
+ return () => v(e, M({
1287
+ ref: p
1288
+ }, I(t, i), {
1289
+ model: l
1290
+ }), o);
1291
+ }
1292
+ }), we = () => ({
1293
+ readonly: {
1294
+ type: Boolean,
1295
+ default: void 0
1296
+ },
1297
+ fieldProps: {
1298
+ type: Object
1299
+ },
1300
+ showProps: {
1301
+ type: Object
1302
+ },
1303
+ slots: {
1304
+ type: Object
1305
+ }
1306
+ }), _t = (e, n) => ({
1307
+ InputComp: a,
1308
+ valueType: t,
1309
+ name: o
1310
+ }) => A({
1311
+ name: o,
1312
+ props: {
1313
+ ...e.props,
1314
+ ...we()
1315
+ },
1316
+ setup: (r, {
1317
+ slots: l
1318
+ }) => {
1319
+ const {
1320
+ formState: f,
1321
+ showState: y,
1322
+ readonlyState: p,
1323
+ disableState: c,
1324
+ readonly: u,
1325
+ elementMap: s
1326
+ } = Je(), i = We(), d = w(() => ye(r.readonly) ? r.readonly : ye(p[r.name]) ? p[r.name] : u.value), m = Xe(r.name), E = i != null && i.pathList ? [...i.pathList, ...m] : m, S = (b) => {
1327
+ _(f, E, b);
1328
+ }, h = N(we());
1329
+ return () => {
1330
+ const b = P(y, E);
1331
+ if (ye(b) && !b)
1332
+ return null;
1333
+ const C = P(f, E), x = P(s, t);
1334
+ return v(e, M(I(r, ...h, "name", "slots"), {
1335
+ name: E
1336
+ }), {
1337
+ default: () => [d.value ? v(ae, null, [x ? v(x, M({
1338
+ value: C
1339
+ }, r.fieldProps, {
1340
+ showProps: r.showProps
1341
+ }), l) : v("span", null, [C])]) : v(a, M(n(C, S, P(c, E)), r.fieldProps), l)],
1342
+ ...r.slots
2393
1343
  });
2394
- var invalidKeys = keys(omit(proSearchFormProps(), "columns"));
2395
- return function () {
2396
- return createVNode(Form, mergeProps({
2397
- "ref": formRef
2398
- }, omit(props, invalidKeys), {
2399
- "model": formState
2400
- }), slots);
2401
- };
2402
- }
2403
- });
2404
- };
2405
-
2406
- var proFormItemProps = function proFormItemProps() {
2407
- return {
2408
- readonly: {
2409
- type: Boolean,
2410
- "default": undefined
2411
- },
2412
- fieldProps: {
2413
- type: Object
2414
- },
2415
- showProps: {
2416
- type: Object
2417
- },
2418
- slots: {
2419
- type: Object
2420
- }
2421
- };
2422
- };
2423
-
2424
- var createFormItemCompFn = function createFormItemCompFn(FormItem, convertInputCompProps) {
2425
- return function (_ref) {
2426
- var InputComp = _ref.InputComp,
2427
- valueType = _ref.valueType,
2428
- name = _ref.name;
2429
- return defineComponent({
2430
- name: name,
2431
- props: _objectSpread2(_objectSpread2({}, FormItem.props), proFormItemProps()),
2432
- setup: function setup(props, _ref2) {
2433
- var slots = _ref2.slots;
2434
-
2435
- var _useProForm = useProForm(),
2436
- formState = _useProForm.formState,
2437
- showState = _useProForm.showState,
2438
- readonlyState = _useProForm.readonlyState,
2439
- disableState = _useProForm.disableState,
2440
- formReadonly = _useProForm.readonly,
2441
- elementMap = _useProForm.elementMap;
2442
-
2443
- var formListCtx = useProFormList(); //优先级 props.readonly > readonlyState > formContext.readonly
2444
-
2445
- var readonly = computed(function () {
2446
- if (isBoolean(props.readonly)) {
2447
- return props.readonly;
2448
- } else if (isBoolean(readonlyState[props.name])) {
2449
- return readonlyState[props.name];
2450
- }
2451
-
2452
- return formReadonly.value;
2453
- });
2454
- var nameList = convertPathToList(props.name);
2455
- var path = formListCtx !== null && formListCtx !== void 0 && formListCtx.pathList ? [].concat(_toConsumableArray(formListCtx.pathList), _toConsumableArray(nameList)) : nameList;
2456
-
2457
- var setValue = function setValue(v) {
2458
- set(formState, path, v);
2459
- };
2460
-
2461
- var invalidKeys = keys(proFormItemProps());
2462
- return function () {
2463
- var show = get(showState, path);
2464
-
2465
- if (isBoolean(show) && !show) {
2466
- return null;
2467
- }
2468
-
2469
- var value = get(formState, path); //valueType对应的展示组件
2470
-
2471
- var ShowComp = get(elementMap, valueType);
2472
- return createVNode(FormItem, mergeProps(omit.apply(void 0, [props].concat(_toConsumableArray(invalidKeys), ["name", "slots"])), {
2473
- "name": path
2474
- }), _objectSpread2({
2475
- "default": function _default() {
2476
- return [readonly.value ? createVNode(Fragment, null, [ShowComp ? createVNode(ShowComp, mergeProps({
2477
- "value": value
2478
- }, props.fieldProps, {
2479
- "showProps": props.showProps
2480
- }), slots) : createVNode("span", null, [value])]) : createVNode(InputComp, mergeProps(convertInputCompProps(value, setValue, get(disableState, path)), props.fieldProps), slots)];
2481
- }
2482
- }, props.slots));
2483
- };
1344
+ };
1345
+ }
1346
+ }), Qe = Symbol("pro-table"), Ht = () => re(Qe), wt = (e) => {
1347
+ oe(Qe, e);
1348
+ }, Me = () => ({
1349
+ operate: {
1350
+ type: Object
1351
+ },
1352
+ columnEmptyText: {
1353
+ type: String
1354
+ },
1355
+ column: {
1356
+ type: Object
1357
+ },
1358
+ columns: {
1359
+ type: Array
1360
+ },
1361
+ columnState: {
1362
+ type: Object
1363
+ },
1364
+ elementMap: {
1365
+ type: Object
1366
+ },
1367
+ serialNumber: {
1368
+ type: Boolean
1369
+ },
1370
+ paginationState: {
1371
+ type: Object
1372
+ },
1373
+ provideExtra: {
1374
+ type: Object
1375
+ }
1376
+ }), Jt = (e, n, a) => A({
1377
+ props: {
1378
+ ...e.props,
1379
+ ...n,
1380
+ ...Me()
1381
+ },
1382
+ setup: (t, {
1383
+ slots: o,
1384
+ expose: r
1385
+ }) => {
1386
+ const l = () => ({
1387
+ title: "\u5E8F\u53F7",
1388
+ dataIndex: "serialNumber",
1389
+ width: 80,
1390
+ ...t.column,
1391
+ customRender: ({
1392
+ index: u
1393
+ }) => {
1394
+ var s, i;
1395
+ return ((s = t.paginationState) == null ? void 0 : s.page) && ((i = t.paginationState) == null ? void 0 : i.pageSize) ? t.paginationState.pageSize * (t.paginationState.page - 1) + u + 1 : u + 1;
2484
1396
  }
2485
- });
2486
- };
2487
- };
2488
-
2489
- var ProTableKey = Symbol("pro-table");
2490
- var useProTable = function useProTable() {
2491
- return inject(ProTableKey);
2492
- };
2493
-
2494
- var provideProTable = function provideProTable(ctx) {
2495
- provide(ProTableKey, ctx);
2496
- };
2497
-
2498
- var proTableProps = function proTableProps() {
2499
- return {
2500
- //操作栏
2501
- operate: {
2502
- type: Object
2503
- },
2504
- //默认空字符串
2505
- columnEmptyText: {
2506
- type: String
2507
- },
2508
-
2509
- /**
2510
- * 公共column,会merge到columns item中
2511
- */
2512
- column: {
2513
- type: Object
2514
- },
2515
- //
2516
- columns: {
2517
- type: Array
2518
- },
2519
- columnState: {
2520
- type: Object
2521
- },
2522
-
2523
- /**
2524
- * 展示控件集合,readonly模式下使用这些组件渲染
2525
- */
2526
- elementMap: {
2527
- type: Object
2528
- },
2529
-
2530
- /**
2531
- * 序号
2532
- */
2533
- serialNumber: {
2534
- type: Boolean
2535
- },
2536
-
2537
- /**
2538
- * 分页
2539
- */
2540
- paginationState: {
2541
- type: Object
2542
- },
2543
-
2544
- /**
2545
- * provide传递
2546
- */
2547
- provideExtra: {
2548
- type: Object
2549
- }
2550
- };
2551
- };
2552
-
2553
- var createTable = function createTable(Table, Props, tableMethods) {
2554
- return defineComponent({
2555
- props: _objectSpread2(_objectSpread2(_objectSpread2({}, Table.props), Props), proTableProps()),
2556
- setup: function setup(props, _ref) {
2557
- var slots = _ref.slots,
2558
- expose = _ref.expose;
2559
-
2560
- var createNumberColumn = function createNumberColumn() {
2561
- return _objectSpread2(_objectSpread2({
2562
- title: "序号",
2563
- dataIndex: "serialNumber",
2564
- width: 80
2565
- }, props.column), {}, {
2566
- customRender: function customRender(_ref2) {
2567
- var _props$paginationStat, _props$paginationStat2;
2568
-
2569
- var index = _ref2.index;
2570
-
2571
- if ((_props$paginationStat = props.paginationState) !== null && _props$paginationStat !== void 0 && _props$paginationStat.page && (_props$paginationStat2 = props.paginationState) !== null && _props$paginationStat2 !== void 0 && _props$paginationStat2.pageSize) {
2572
- return props.paginationState.pageSize * (props.paginationState.page - 1) + index + 1;
1397
+ }), f = () => {
1398
+ const u = t.operate, s = O(u.items, (d) => ({
1399
+ ...d,
1400
+ ...P(u.itemState, d.value)
1401
+ })), i = Ne(s, (d) => d.sort);
1402
+ return {
1403
+ ...t.column,
1404
+ title: "\u64CD\u4F5C",
1405
+ dataIndex: "operate",
1406
+ fixed: "right",
1407
+ ...u.column,
1408
+ customRender: ({
1409
+ record: d
1410
+ }) => {
1411
+ const m = z(i, (E) => E.show && H(E.show) ? E.show(d) : E.show !== !1);
1412
+ return v("div", {
1413
+ class: "pro-table-operate"
1414
+ }, [O(m, (E) => H(E.element) ? E.element(d, E) : v("div", {
1415
+ class: "pro-table-operate-item",
1416
+ key: E.value,
1417
+ onClick: () => {
1418
+ var S;
1419
+ (S = E.onClick) == null || S.call(E, d);
2573
1420
  }
2574
-
2575
- return index + 1;
2576
- }
2577
- });
2578
- };
2579
-
2580
- var createOperateColumn = function createOperateColumn() {
2581
- var operate = props.operate; //将itemState补充的信息拼到item中
2582
-
2583
- var items = map(operate.items, function (i) {
2584
- return _objectSpread2(_objectSpread2({}, i), get(operate.itemState, i.value));
2585
- }); //排序
2586
-
2587
- var sortedItems = sortBy(items, function (item) {
2588
- return item.sort;
2589
- });
2590
- return _objectSpread2(_objectSpread2(_objectSpread2({}, props.column), {}, {
2591
- title: "操作",
2592
- dataIndex: "operate",
2593
- fixed: "right"
2594
- }, operate.column), {}, {
2595
- customRender: function customRender(_ref3) {
2596
- var record = _ref3.record;
2597
- var showItems = filter$1(sortedItems, function (item) {
2598
- if (item.show && isFunction(item.show)) {
2599
- return item.show(record);
2600
- }
2601
-
2602
- if (item.show === false) {
2603
- return false;
2604
- }
2605
-
2606
- return true;
2607
- });
2608
- return createVNode("div", {
2609
- "class": "pro-table-operate"
2610
- }, [map(showItems, function (item) {
2611
- //自定义
2612
- if (isFunction(item.element)) {
2613
- return item.element(record, item);
2614
- }
2615
-
2616
- return createVNode("div", {
2617
- "class": "pro-table-operate-item",
2618
- "key": item.value,
2619
- "onClick": function onClick() {
2620
- var _item$onClick;
2621
-
2622
- (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, record);
2623
- }
2624
- }, [item.label]);
2625
- })]);
2626
- }
2627
- });
1421
+ }, [E.label]))]);
1422
+ }
2628
1423
  };
2629
-
2630
- var columns = computed(function () {
2631
- var mergeColumns = mergeStateToList(props.columns, props.columnState, function (item) {
2632
- return item.dataIndex;
2633
- }); //根据valueType选择对应的展示组件
2634
-
2635
- var columns = map(mergeColumns, function (item) {
2636
- //merge公共item
2637
- var nextItem = _objectSpread2(_objectSpread2({}, props.column), item);
2638
-
2639
- if (!item.customRender) {
2640
- nextItem.customRender = function (_ref4) {
2641
- var text = _ref4.text;
2642
- var vn = getItemEl(props.elementMap, _objectSpread2(_objectSpread2({}, item), {}, {
2643
- showProps: _objectSpread2(_objectSpread2({}, item.showProps), {}, {
2644
- content: props.columnEmptyText
2645
- })
2646
- }), text); //如果找不到注册的组件,使用当前值 及 columnEmptyText
2647
-
2648
- return vn || text || props.columnEmptyText;
2649
- };
1424
+ }, y = w(() => {
1425
+ const u = Ie(t.columns, t.columnState, (i) => i.dataIndex), s = O(u, (i) => {
1426
+ const d = {
1427
+ ...t.column,
1428
+ ...i
1429
+ };
1430
+ return i.customRender || (d.customRender = ({
1431
+ text: m
1432
+ }) => Ke(t.elementMap, {
1433
+ ...i,
1434
+ showProps: {
1435
+ ...i.showProps,
1436
+ content: t.columnEmptyText
2650
1437
  }
2651
-
2652
- return nextItem;
2653
- }); //处理序号
2654
-
2655
- if (props.serialNumber) {
2656
- columns.unshift(createNumberColumn());
2657
- } //处理operate
2658
-
2659
-
2660
- if (props.operate && props.operate.items && some(props.operate.items, function (item) {
2661
- return item.show;
2662
- })) {
2663
- columns.push(createOperateColumn());
2664
- }
2665
-
2666
- return columns;
1438
+ }, m) || m || t.columnEmptyText), d;
2667
1439
  });
2668
- var tableRef = ref();
2669
- provideProTable(_objectSpread2({
2670
- columns: columns,
2671
- tableRef: tableRef
2672
- }, props.provideExtra));
2673
- expose(createExpose(tableMethods || [], tableRef));
2674
- var invalidKeys = keys(proTableProps());
2675
- return function () {
2676
- return createVNode(Table, mergeProps({
2677
- "ref": tableRef
2678
- }, omit(props, invalidKeys), {
2679
- "columns": columns.value
2680
- }), slots);
2681
- };
2682
- }
2683
- });
1440
+ return t.serialNumber && s.unshift(l()), t.operate && t.operate.items && Pe(t.operate.items, (i) => i.show) && s.push(f()), s;
1441
+ }), p = U();
1442
+ wt({
1443
+ columns: y,
1444
+ tableRef: p,
1445
+ ...t.provideExtra
1446
+ }), r(J(a || [], p));
1447
+ const c = N(Me());
1448
+ return () => v(e, M({
1449
+ ref: p
1450
+ }, I(t, c), {
1451
+ columns: y.value
1452
+ }), o);
1453
+ }
1454
+ });
1455
+ export {
1456
+ g as CurdAction,
1457
+ ne as CurdAddAction,
1458
+ F as CurdCurrentMode,
1459
+ ze as CurdMethods,
1460
+ D as CurdSubAction,
1461
+ le as ProCurd,
1462
+ Ut as ProModalCurd,
1463
+ pe as ProModule,
1464
+ Bt as ProPageCurd,
1465
+ te as RequestAction,
1466
+ me as SearchMode,
1467
+ Et as Wrapper,
1468
+ Xe as convertPathToList,
1469
+ $t as createCurdDesc,
1470
+ Vt as createCurdForm,
1471
+ Xt as createCurdList,
1472
+ J as createExpose,
1473
+ Gt as createForm,
1474
+ _t as createFormItemCompFn,
1475
+ zt as createFormList,
1476
+ kt as createGrid,
1477
+ Wt as createSearchForm,
1478
+ Jt as createTable,
1479
+ Pt as defaultPage,
1480
+ Z as getColumnFormItemName,
1481
+ qe as getColumnValueType,
1482
+ pt as getFirstPropName,
1483
+ ve as getFormItemEl,
1484
+ Ke as getItemEl,
1485
+ vt as getValidValues,
1486
+ Ie as mergeStateToList,
1487
+ bt as provideProCurd,
1488
+ _e as provideProFormList,
1489
+ St as provideProModule,
1490
+ ee as renderElement,
1491
+ Te as renderElements,
1492
+ yt as useComposeRequestActor,
1493
+ qt as useDoneRequestActor,
1494
+ Kt as useFailedRequestActor,
1495
+ De as useModuleEvent,
1496
+ se as useProCurd,
1497
+ Je as useProForm,
1498
+ We as useProFormList,
1499
+ ue as useProModule,
1500
+ Ht as useProTable
2684
1501
  };
2685
-
2686
- export { CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, ProCurd, ProModalCurd, ProModule, ProPageCurd, RequestAction, SearchMode, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };