@aplus-frontend/ui 0.4.34 → 0.4.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-form/search-form/index.vue.mjs +14 -15
- package/es/src/ap-modal/enums/modalMessage.d.ts +6 -0
- package/es/src/ap-modal/enums/modalMessage.mjs +4 -0
- package/es/src/ap-modal/index.d.ts +2 -1
- package/es/src/ap-modal/index.mjs +2 -0
- package/es/src/ap-modal/interface.d.ts +126 -1
- package/es/src/ap-modal/utils/createModalStream.d.ts +2 -0
- package/es/src/ap-modal/utils/createModalStream.mjs +99 -0
- package/es/src/ap-modal/utils/index.d.ts +1 -0
- package/es/src/ap-modal/utils/index.mjs +4 -2
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +4 -7
- package/es/src/ap-table/utils.d.ts +1 -4
- package/es/src/ap-table/utils.mjs +43 -41
- package/es/src/business/ap-attachment/ApAttachment.mjs +13 -13
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-modal/enums/modalMessage.d.ts +6 -0
- package/lib/src/ap-modal/enums/modalMessage.js +1 -0
- package/lib/src/ap-modal/index.d.ts +2 -1
- package/lib/src/ap-modal/index.js +1 -1
- package/lib/src/ap-modal/interface.d.ts +126 -1
- package/lib/src/ap-modal/utils/createModalStream.d.ts +2 -0
- package/lib/src/ap-modal/utils/createModalStream.js +1 -0
- package/lib/src/ap-modal/utils/index.d.ts +1 -0
- package/lib/src/ap-modal/utils/index.js +1 -1
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +1 -1
- package/lib/src/ap-table/utils.d.ts +1 -4
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/package.json +4 -4
- package/theme/ap-grid/index.css +302 -0
- package/theme/ap-grid/index.less +65 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode as se, defineComponent as ie, useSlots as
|
|
1
|
+
import { isVNode as se, defineComponent as ie, useSlots as ue, ref as ce, unref as o, shallowRef as M, computed as S, watch as D, cloneVNode as pe, createVNode as a, Fragment as F, createBlock as C, openBlock as m, mergeProps as de, withCtx as E, resolveDynamicComponent as b, createElementBlock as fe, renderList as me } from "vue";
|
|
2
2
|
import { Col as B, Flex as $, Space as he, Button as v, Row as xe } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../item/index.vue2.mjs";
|
|
@@ -108,8 +108,8 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
108
108
|
emit: H
|
|
109
109
|
}) {
|
|
110
110
|
var I;
|
|
111
|
-
const
|
|
112
|
-
value:
|
|
111
|
+
const u = ue(), n = h, G = H, {
|
|
112
|
+
value: c,
|
|
113
113
|
updateValue: J
|
|
114
114
|
} = Fe(n, G, {
|
|
115
115
|
valuePropName: "collapse",
|
|
@@ -118,9 +118,9 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
118
118
|
b: K
|
|
119
119
|
} = Be("ap-form-search-form"), Q = Re("uiMode"), {
|
|
120
120
|
t: w
|
|
121
|
-
} = Ae(), g =
|
|
121
|
+
} = Ae(), g = ce();
|
|
122
122
|
function X() {
|
|
123
|
-
J(!o(
|
|
123
|
+
J(!o(c));
|
|
124
124
|
}
|
|
125
125
|
function Y() {
|
|
126
126
|
var e, t;
|
|
@@ -131,12 +131,12 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
131
131
|
n.customReset || (t = (e = g.value) == null ? void 0 : e.resetFields) == null || t.call(e), W(n.onReset);
|
|
132
132
|
}
|
|
133
133
|
let N = [];
|
|
134
|
-
const R = M(L(
|
|
135
|
-
D(() =>
|
|
134
|
+
const R = M(L(u.default())), d = M((I = u.extra) == null ? void 0 : I.call(u)), k = S(() => Math.floor(r / n.countPerRow));
|
|
135
|
+
D(() => u.default(), (e) => {
|
|
136
136
|
N = R.value, R.value = Se(N, L(e));
|
|
137
137
|
}), D(() => {
|
|
138
138
|
var e;
|
|
139
|
-
return (e =
|
|
139
|
+
return (e = u.extra) == null ? void 0 : e.call(u);
|
|
140
140
|
}, (e) => {
|
|
141
141
|
d.value = e;
|
|
142
142
|
});
|
|
@@ -158,9 +158,8 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
158
158
|
let V = 0, j = 0;
|
|
159
159
|
const le = s.map((p, f) => {
|
|
160
160
|
const x = p.props, y = x.span || l;
|
|
161
|
-
if (V += y, !n.forceExpand && o(
|
|
161
|
+
if (V += y, !n.forceExpand && o(c) && V > O) {
|
|
162
162
|
t.push(pe(p, {
|
|
163
|
-
class: "ant-form-item-hidden",
|
|
164
163
|
hidden: !0
|
|
165
164
|
}));
|
|
166
165
|
return;
|
|
@@ -187,7 +186,7 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
187
186
|
}, {
|
|
188
187
|
default: () => [a(q, null, {
|
|
189
188
|
default: () => [a($, {
|
|
190
|
-
justify: !o(
|
|
189
|
+
justify: !o(c) && t.lastRowOnlyIncludeActionAndExtra && !(o(d) && n.extraInAction) ? "flex-end" : "space-between"
|
|
191
190
|
}, {
|
|
192
191
|
default: () => [a(he, null, {
|
|
193
192
|
default: () => [a(v, {
|
|
@@ -205,19 +204,19 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
205
204
|
onClick: X,
|
|
206
205
|
icon: a(ye, {
|
|
207
206
|
style: Q.value === "aplus" ? "color:#B8C3D1" : "color:#BFBFBF",
|
|
208
|
-
rotate: o(
|
|
207
|
+
rotate: o(c) ? 90 : -90
|
|
209
208
|
}, null)
|
|
210
209
|
}, null) : null]
|
|
211
210
|
}), n.extraInAction ? o(d) : null]
|
|
212
211
|
})]
|
|
213
212
|
})]
|
|
214
213
|
}), l = !n.extraInAction && o(d) ? a(B, {
|
|
215
|
-
span: o(
|
|
214
|
+
span: o(c) ? t.actualExtraSpan : t.defaultExtraSpan,
|
|
216
215
|
key: "extraNode"
|
|
217
216
|
}, {
|
|
218
217
|
default: () => [a(q, null, {
|
|
219
218
|
default: () => [a($, {
|
|
220
|
-
justify: !o(
|
|
219
|
+
justify: !o(c) && (t.defaultExtraSpan === r || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
|
|
221
220
|
}, be(e = o(d)) ? e : {
|
|
222
221
|
default: () => [e]
|
|
223
222
|
})]
|
|
@@ -225,7 +224,7 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
225
224
|
}) : null, i = a(B, {
|
|
226
225
|
span: t.defaultExtraSpan
|
|
227
226
|
}, null);
|
|
228
|
-
return !o(
|
|
227
|
+
return !o(c) && t.lastRowOnlyIncludeActionAndExtra ? a(F, null, [l || i, s]) : a(F, null, [s, l]);
|
|
229
228
|
});
|
|
230
229
|
return z({
|
|
231
230
|
apForm: S(() => o(g))
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Modal as _Modal } from '@aplus-frontend/antdv';
|
|
2
|
-
import { CreateModalFunc } from './interface';
|
|
2
|
+
import { CreateModalFunc, CreateModalStreamFunc } from './interface';
|
|
3
3
|
export * from './interface';
|
|
4
4
|
type ApModalMixedProps = typeof _Modal & {
|
|
5
5
|
createModal: CreateModalFunc;
|
|
6
|
+
createModalStream: CreateModalStreamFunc;
|
|
6
7
|
};
|
|
7
8
|
declare const ApModal: ApModalMixedProps;
|
|
8
9
|
export { ApModal };
|
|
@@ -2,8 +2,10 @@ import { Modal as r } from "@aplus-frontend/antdv";
|
|
|
2
2
|
import "./utils/index.mjs";
|
|
3
3
|
import "./interface.mjs";
|
|
4
4
|
import { createModal as a } from "./utils/createModal.mjs";
|
|
5
|
+
import { createModalStream as t } from "./utils/createModalStream.mjs";
|
|
5
6
|
const o = r;
|
|
6
7
|
o.createModal = a;
|
|
8
|
+
o.createModalStream = t;
|
|
7
9
|
o.name = "ApModal";
|
|
8
10
|
export {
|
|
9
11
|
o as ApModal
|
|
@@ -1,16 +1,141 @@
|
|
|
1
|
-
import { ModalProps } from '@aplus-frontend/antdv';
|
|
1
|
+
import { ModalProps, ModalFuncProps } from '@aplus-frontend/antdv';
|
|
2
|
+
import { ModalFunc } from '@aplus-frontend/antdv/lib/modal/confirm';
|
|
2
3
|
export type CreateModalFuncProps<ContentRecord = any> = Omit<ModalProps, 'open' | 'onUpdate:open' | 'destroyOnClose' | 'onCancel' | 'onOk' | 'getContainer' | 'icon'> & Partial<{
|
|
4
|
+
/**
|
|
5
|
+
* 点击取消回调
|
|
6
|
+
* @param params content组件内使用defineExpose导出的对象
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
3
9
|
onCancel: (params: ContentRecord) => any | Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* 点击确定回调
|
|
12
|
+
* @param params content组件内使用defineExpose导出的对象
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
4
15
|
onOk: (params: ContentRecord) => any | Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* 指定弹框挂载的 HTML 节点
|
|
18
|
+
*/
|
|
5
19
|
getContainer: HTMLElement;
|
|
20
|
+
/**
|
|
21
|
+
* 内容
|
|
22
|
+
*/
|
|
6
23
|
content: any;
|
|
24
|
+
/**
|
|
25
|
+
* 关闭时是否销毁弹框
|
|
26
|
+
*/
|
|
7
27
|
destroyOnClose: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 自适应高度
|
|
30
|
+
*/
|
|
8
31
|
wrapperOffset: boolean | number;
|
|
9
32
|
}>;
|
|
10
33
|
export type CreateModalFuncReturn = {
|
|
34
|
+
/**
|
|
35
|
+
* 销毁弹框
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
11
38
|
destroy: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* 更新弹框 props 属性
|
|
41
|
+
* @param newConfig
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
12
44
|
update: (newConfig: CreateModalFuncProps) => void;
|
|
45
|
+
/**
|
|
46
|
+
* 打开弹框
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
13
49
|
open: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* 关闭弹框,不销毁
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
14
54
|
close: () => void;
|
|
15
55
|
};
|
|
16
56
|
export type CreateModalFunc = (props: CreateModalFuncProps) => CreateModalFuncReturn;
|
|
57
|
+
export type ModalStreamNextFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (option: {
|
|
58
|
+
/**
|
|
59
|
+
* 下一步弹框的id
|
|
60
|
+
*/
|
|
61
|
+
modalId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* 下一步弹框传递的参数
|
|
64
|
+
*/
|
|
65
|
+
params?: any;
|
|
66
|
+
/**
|
|
67
|
+
* 本次弹框关闭前的回调,createModal默认关闭弹框,其他弹框类型默认销毁弹框,调用弹框实例的open方法可以不关闭弹框
|
|
68
|
+
*/
|
|
69
|
+
handleCurrentModal?: (
|
|
70
|
+
/**
|
|
71
|
+
* 本次弹框的实例方法
|
|
72
|
+
*/
|
|
73
|
+
modalExample: ModalStreamTypeExample[ModalType]) => any | Promise<any>;
|
|
74
|
+
}) => any | Promise<any>;
|
|
75
|
+
export type ModalStreamType = {
|
|
76
|
+
createModal: CreateModalStream<'createModal'>;
|
|
77
|
+
info: ModalFuncStream<'info'>;
|
|
78
|
+
success: ModalFuncStream<'success'>;
|
|
79
|
+
error: ModalFuncStream<'error'>;
|
|
80
|
+
warning: ModalFuncStream<'warning'>;
|
|
81
|
+
confirm: ModalFuncStream<'confirm'>;
|
|
82
|
+
};
|
|
83
|
+
export type ModalStreamFuncReturn = ReturnType<ModalFunc> & {
|
|
84
|
+
open: () => void;
|
|
85
|
+
};
|
|
86
|
+
export type ModalStreamTypeExample = {
|
|
87
|
+
createModal: CreateModalFuncReturn;
|
|
88
|
+
info: ModalStreamFuncReturn;
|
|
89
|
+
success: ModalStreamFuncReturn;
|
|
90
|
+
error: ModalStreamFuncReturn;
|
|
91
|
+
warning: ModalStreamFuncReturn;
|
|
92
|
+
confirm: ModalStreamFuncReturn;
|
|
93
|
+
};
|
|
94
|
+
export type ModalFuncStream<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = Omit<ModalFuncProps, 'onOk' | 'onCancel'> & {
|
|
95
|
+
/**
|
|
96
|
+
* 点击确定回调
|
|
97
|
+
* @param next 下一步
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
onOk?: (next: ModalStreamNextFunc<ModalType>) => any | Promise<any>;
|
|
101
|
+
/**
|
|
102
|
+
* 点击取消回调
|
|
103
|
+
* @param next 下一步
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
onCancel?: (next: ModalStreamNextFunc<ModalType>) => any | Promise<any>;
|
|
107
|
+
};
|
|
108
|
+
export type CreateModalStream<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = Omit<CreateModalFuncProps, 'destroyOnClose' | 'onOk' | 'onCancel'> & {
|
|
109
|
+
/**
|
|
110
|
+
* 点击确定回调
|
|
111
|
+
* * @param params content组件内使用defineExpose导出的对象
|
|
112
|
+
* @param next 下一步
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
onOk?: (params: any, next: ModalStreamNextFunc<ModalType>) => any | Promise<any>;
|
|
116
|
+
/**
|
|
117
|
+
* 点击取消回调
|
|
118
|
+
* * @param params content组件内使用defineExpose导出的对象
|
|
119
|
+
* @param next 下一步
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
onCancel?: (params: any, next: ModalStreamNextFunc<ModalType>) => any | Promise<any>;
|
|
123
|
+
};
|
|
124
|
+
export type ModalStreamTypeKey = keyof ModalStreamType;
|
|
125
|
+
export type CreateModalStreamProps<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = ModalType extends ModalStreamTypeKey ? {
|
|
126
|
+
/**
|
|
127
|
+
* 弹框id
|
|
128
|
+
*/
|
|
129
|
+
modalId: string;
|
|
130
|
+
/**
|
|
131
|
+
* 弹框类型
|
|
132
|
+
*/
|
|
133
|
+
modalType?: ModalType;
|
|
134
|
+
/**
|
|
135
|
+
* 弹框属性
|
|
136
|
+
* @param params 上一步弹框传递的参数
|
|
137
|
+
* @returns
|
|
138
|
+
*/
|
|
139
|
+
props: (params: any) => Promise<ModalStreamType[ModalType]>;
|
|
140
|
+
} : never;
|
|
141
|
+
export type CreateModalStreamFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (streamList: CreateModalStreamProps<ModalType>[], firstModalId?: string) => void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { isValid as L } from "@aplus-frontend/utils";
|
|
2
|
+
import { createModal as P } from "./createModal.mjs";
|
|
3
|
+
import { Modal as V } from "@aplus-frontend/antdv";
|
|
4
|
+
import { ModalMessage as S } from "../enums/modalMessage.mjs";
|
|
5
|
+
const G = (_, F) => {
|
|
6
|
+
var O;
|
|
7
|
+
const l = F ?? (Array.isArray(_) ? (O = _[0]) == null ? void 0 : O.modalId : void 0), d = /* @__PURE__ */ new Map();
|
|
8
|
+
let T, u, E = 1e3;
|
|
9
|
+
const y = async ({
|
|
10
|
+
modalId: a,
|
|
11
|
+
params: o,
|
|
12
|
+
handleCurrentModal: t
|
|
13
|
+
}) => {
|
|
14
|
+
T = o;
|
|
15
|
+
const w = _.find((n) => n.modalId === a);
|
|
16
|
+
let s = !1;
|
|
17
|
+
if (u) {
|
|
18
|
+
const n = d.get(u), i = {
|
|
19
|
+
...n,
|
|
20
|
+
destroy: () => {
|
|
21
|
+
var f;
|
|
22
|
+
(f = n == null ? void 0 : n.destroy) == null || f.call(n), d.delete(u);
|
|
23
|
+
},
|
|
24
|
+
open: () => {
|
|
25
|
+
s = !0;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
await (t == null ? void 0 : t(i));
|
|
29
|
+
}
|
|
30
|
+
return w && setTimeout(() => {
|
|
31
|
+
k(w);
|
|
32
|
+
}), s;
|
|
33
|
+
}, I = () => {
|
|
34
|
+
var a;
|
|
35
|
+
for (const [o, t] of d)
|
|
36
|
+
(a = t == null ? void 0 : t.destroy) == null || a.call(t);
|
|
37
|
+
}, k = async (a) => {
|
|
38
|
+
var g, A, C, z;
|
|
39
|
+
const {
|
|
40
|
+
modalId: o,
|
|
41
|
+
modalType: t = "createModal",
|
|
42
|
+
props: w
|
|
43
|
+
} = a;
|
|
44
|
+
u = o;
|
|
45
|
+
const s = d.get(o), n = await (w == null ? void 0 : w(T));
|
|
46
|
+
E = Math.max((n == null ? void 0 : n.zIndex) ?? 0, E), E += 1;
|
|
47
|
+
let i, f = !1;
|
|
48
|
+
if (t === "createModal") {
|
|
49
|
+
const e = n, m = async (r) => (f = !0, await y(r));
|
|
50
|
+
i = {
|
|
51
|
+
...e,
|
|
52
|
+
destroyOnClose: !1,
|
|
53
|
+
zIndex: E,
|
|
54
|
+
onOk: async (r) => {
|
|
55
|
+
var N;
|
|
56
|
+
const c = await ((N = e == null ? void 0 : e.onOk) == null ? void 0 : N.call(e, r, m));
|
|
57
|
+
if (f || I(), c)
|
|
58
|
+
throw new Error(S.NOT_NEED_CLOSE);
|
|
59
|
+
},
|
|
60
|
+
onCancel: async (r) => {
|
|
61
|
+
var N;
|
|
62
|
+
const c = await ((N = e == null ? void 0 : e.onCancel) == null ? void 0 : N.call(e, r, m));
|
|
63
|
+
if (f || I(), c)
|
|
64
|
+
throw new Error(S.NOT_NEED_CLOSE);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
} else {
|
|
68
|
+
const e = n, m = async (r) => (f = !0, await y(r));
|
|
69
|
+
i = {
|
|
70
|
+
...e,
|
|
71
|
+
zIndex: E,
|
|
72
|
+
onOk: async () => {
|
|
73
|
+
var c;
|
|
74
|
+
const r = await ((c = e == null ? void 0 : e.onOk) == null ? void 0 : c.call(e, m));
|
|
75
|
+
if (f || I(), r)
|
|
76
|
+
throw new Error(S.NOT_NEED_CLOSE);
|
|
77
|
+
},
|
|
78
|
+
onCancel: async () => {
|
|
79
|
+
var c;
|
|
80
|
+
const r = await ((c = e == null ? void 0 : e.onCancel) == null ? void 0 : c.call(e, m));
|
|
81
|
+
if (f || I(), r)
|
|
82
|
+
throw new Error(S.NOT_NEED_CLOSE);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (s) {
|
|
87
|
+
s == null || s.update(i), (g = s == null ? void 0 : s.open) == null || g.call(s);
|
|
88
|
+
return;
|
|
89
|
+
} else if (t === "createModal") {
|
|
90
|
+
const e = P(i);
|
|
91
|
+
(A = e == null ? void 0 : e.open) == null || A.call(e), d.set(o, e);
|
|
92
|
+
} else
|
|
93
|
+
(z = (C = V) == null ? void 0 : C[t]) == null || z.call(C, i);
|
|
94
|
+
}, D = _.find((a) => L(l) && a.modalId === l);
|
|
95
|
+
D !== void 0 && k(D);
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
G as createModalStream
|
|
99
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as n, createBlock as o, openBlock as t, resolveDynamicComponent as r } from "vue";
|
|
2
|
+
const s = /* @__PURE__ */ n({
|
|
3
3
|
name: "ApTableDynamicComponent",
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "index",
|
|
@@ -7,12 +7,9 @@ const u = /* @__PURE__ */ t({
|
|
|
7
7
|
customRender: { type: Function }
|
|
8
8
|
},
|
|
9
9
|
setup(p) {
|
|
10
|
-
return (e,
|
|
11
|
-
(n(), a(c(e.customRender(e.$attrs)))),
|
|
12
|
-
s(" " + m(console.log(e.$attrs)), 1)
|
|
13
|
-
], 64));
|
|
10
|
+
return (e, a) => (t(), o(r(e.customRender(e.$attrs))));
|
|
14
11
|
}
|
|
15
12
|
});
|
|
16
13
|
export {
|
|
17
|
-
|
|
14
|
+
s as default
|
|
18
15
|
};
|
|
@@ -1010,10 +1010,7 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
|
|
|
1010
1010
|
};
|
|
1011
1011
|
parser: {
|
|
1012
1012
|
type: PropType<(displayValue: string) => ValueType>;
|
|
1013
|
-
default: (displayValue: string) =>
|
|
1014
|
-
* 通常情况下,表格渲染是不需要请求网络数据的,因此这里删掉request,
|
|
1015
|
-
* 如果需要做映射,可以在外部发起一次网络请求,然后使用valueEnum设置匹配枚举。
|
|
1016
|
-
*/).ValueType;
|
|
1013
|
+
default: (displayValue: string) => ValueType;
|
|
1017
1014
|
};
|
|
1018
1015
|
formatter: {
|
|
1019
1016
|
type: PropType<(value: ValueType, info: {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { isVNode as E, createVNode as l, mergeProps as y, cloneVNode as j, Fragment as O } from "vue";
|
|
2
|
-
import { isObject as a, isArray as c, isUndefined as g, isFunction as T, omit as C, isBoolean as F, isString as N, isEqual as S, sortBy as p, isPlainObject as
|
|
2
|
+
import { isObject as a, isArray as c, isUndefined as g, isFunction as T, omit as C, isBoolean as F, isString as N, isEqual as S, sortBy as p, isPlainObject as d, every as I, isEmpty as v } from "lodash-unified";
|
|
3
3
|
import { apTableRenderItemMap as V, apTableFormItemMap as P } from "./constants.mjs";
|
|
4
4
|
import { isType as _ } from "@fruits-chain/utils";
|
|
5
5
|
import "../ap-form/index.mjs";
|
|
6
6
|
import { Tooltip as w } from "@aplus-frontend/antdv";
|
|
7
7
|
import { QuestionCircleOutlined as x } from "@ant-design/icons-vue";
|
|
8
8
|
import "./components/dynamic-component/index.vue.mjs";
|
|
9
|
-
import
|
|
9
|
+
import m from "./components/dynamic-component/index.vue2.mjs";
|
|
10
10
|
import A from "../ap-form/item/index.vue.mjs";
|
|
11
11
|
function R(t) {
|
|
12
12
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
|
|
13
13
|
}
|
|
14
14
|
const q = (t, e, n) => {
|
|
15
|
-
let
|
|
15
|
+
let o = {};
|
|
16
16
|
return a(t) ? Object.keys(t).forEach((i) => {
|
|
17
|
-
a(t[i]) ?
|
|
18
|
-
}) :
|
|
17
|
+
a(t[i]) ? o[i] = q(t[i], e[i], n) : o[i] = n(t[i], e);
|
|
18
|
+
}) : o = n(t, e), o;
|
|
19
19
|
}, k = (t, e) => {
|
|
20
20
|
switch (t) {
|
|
21
21
|
case "dayjs":
|
|
@@ -23,8 +23,8 @@ const q = (t, e, n) => {
|
|
|
23
23
|
case "dayjsRange":
|
|
24
24
|
return e.map((n) => n.valueOf());
|
|
25
25
|
case "dayjsDayRange": {
|
|
26
|
-
const [n,
|
|
27
|
-
return [n.startOf("day").valueOf(),
|
|
26
|
+
const [n, o] = e;
|
|
27
|
+
return [n.startOf("day").valueOf(), o.endOf("day").valueOf()];
|
|
28
28
|
}
|
|
29
29
|
case "multiple":
|
|
30
30
|
case "multipleNumber":
|
|
@@ -46,21 +46,21 @@ function W(t) {
|
|
|
46
46
|
}
|
|
47
47
|
const $ = (t) => W(t) === "map" ? t : new Map(Object.entries(t || {})), b = (t) => {
|
|
48
48
|
const e = [], n = $(t);
|
|
49
|
-
return n.forEach((
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
if (typeof
|
|
49
|
+
return n.forEach((o, i) => {
|
|
50
|
+
const r = n.get(i) || n.get(`${i}`);
|
|
51
|
+
if (r) {
|
|
52
|
+
if (typeof r == "object" && (r != null && r.text)) {
|
|
53
53
|
e.push({
|
|
54
|
-
text:
|
|
54
|
+
text: r == null ? void 0 : r.text,
|
|
55
55
|
value: i,
|
|
56
|
-
label:
|
|
57
|
-
disabled:
|
|
56
|
+
label: r == null ? void 0 : r.text,
|
|
57
|
+
disabled: r.disabled
|
|
58
58
|
});
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
e.push({
|
|
62
|
-
text:
|
|
63
|
-
label:
|
|
62
|
+
text: r,
|
|
63
|
+
label: r,
|
|
64
64
|
value: i
|
|
65
65
|
});
|
|
66
66
|
}
|
|
@@ -73,20 +73,20 @@ function tt(t) {
|
|
|
73
73
|
let e = t.valueType || "text";
|
|
74
74
|
return t.valueEnum && (e = "status"), e;
|
|
75
75
|
}
|
|
76
|
-
function et(t, e, n,
|
|
76
|
+
function et(t, e, n, o) {
|
|
77
77
|
var s;
|
|
78
78
|
const i = V[t];
|
|
79
79
|
if (i)
|
|
80
80
|
return l(i, y(e, {
|
|
81
81
|
mode: "read"
|
|
82
82
|
}), null);
|
|
83
|
-
const
|
|
84
|
-
return ((s =
|
|
83
|
+
const r = o == null ? void 0 : o[t];
|
|
84
|
+
return ((s = r == null ? void 0 : r.render) == null ? void 0 : s.call(r, e.value, n, e)) || e.value;
|
|
85
85
|
}
|
|
86
86
|
function nt(t, e) {
|
|
87
87
|
if (t.customRenderFormItem)
|
|
88
88
|
return {
|
|
89
|
-
Comp:
|
|
89
|
+
Comp: m,
|
|
90
90
|
render: function(s) {
|
|
91
91
|
const u = s.item.customRenderFormItem(s.item);
|
|
92
92
|
return j(u, {
|
|
@@ -104,29 +104,31 @@ function nt(t, e) {
|
|
|
104
104
|
return {
|
|
105
105
|
Comp: n
|
|
106
106
|
};
|
|
107
|
-
const
|
|
108
|
-
function i(
|
|
107
|
+
const o = e == null ? void 0 : e[t.valueType];
|
|
108
|
+
function i(r) {
|
|
109
109
|
var u;
|
|
110
|
-
const s = (u =
|
|
111
|
-
return s ? l(A, y(
|
|
110
|
+
const s = (u = o == null ? void 0 : o.renderFormItem) == null ? void 0 : u.call(o, r.item.fieldProps.field);
|
|
111
|
+
return s ? l(A, y(r.item.fieldProps, {
|
|
112
|
+
hidden: r.hidden,
|
|
113
|
+
class: r.class,
|
|
112
114
|
span: t.span
|
|
113
115
|
}), R(s) ? s : {
|
|
114
116
|
default: () => [s]
|
|
115
117
|
}) : null;
|
|
116
118
|
}
|
|
117
119
|
return {
|
|
118
|
-
Comp:
|
|
120
|
+
Comp: m,
|
|
119
121
|
render: i
|
|
120
122
|
};
|
|
121
123
|
}
|
|
122
124
|
function rt(t, e) {
|
|
123
|
-
const n = B(t.fieldProps, e),
|
|
125
|
+
const n = B(t.fieldProps, e), o = (n == null ? void 0 : n.field) || n || {}, i = t.valueType === "switch", r = t.valueType === "index", s = i ? {
|
|
124
126
|
checked: e.value
|
|
125
127
|
} : {
|
|
126
|
-
value:
|
|
128
|
+
value: r ? e.index + 1 : e.value
|
|
127
129
|
};
|
|
128
|
-
return t.valueEnum && (
|
|
129
|
-
...C(
|
|
130
|
+
return t.valueEnum && (o.valueEnum = t.valueEnum), {
|
|
131
|
+
...C(o, ["request"]),
|
|
130
132
|
...s
|
|
131
133
|
};
|
|
132
134
|
}
|
|
@@ -137,9 +139,9 @@ function ot(t) {
|
|
|
137
139
|
return F(t.filters) && t.filters && t.valueEnum && (e.filters = b(t.valueEnum)), e;
|
|
138
140
|
}
|
|
139
141
|
function it(t, e) {
|
|
140
|
-
var
|
|
142
|
+
var o;
|
|
141
143
|
const n = e || {};
|
|
142
|
-
return t.valueEnum && !((
|
|
144
|
+
return t.valueEnum && !((o = n.field) != null && o.options) && (n.field = {
|
|
143
145
|
...n.field,
|
|
144
146
|
options: b(t.valueEnum)
|
|
145
147
|
}), n;
|
|
@@ -153,12 +155,12 @@ function st(t) {
|
|
|
153
155
|
return t;
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
|
-
function ut(t, e, n,
|
|
158
|
+
function ut(t, e, n, o) {
|
|
157
159
|
const i = n == null ? void 0 : n({
|
|
158
160
|
title: t.title,
|
|
159
161
|
column: t
|
|
160
|
-
}),
|
|
161
|
-
if (i &&
|
|
162
|
+
}), r = (i == null ? void 0 : i.filter((h) => h.type !== Symbol.for("v-cmt"))) || [];
|
|
163
|
+
if (i && r.length > 0)
|
|
162
164
|
return i;
|
|
163
165
|
const u = N(t.title) ? l("span", {
|
|
164
166
|
class: e,
|
|
@@ -177,7 +179,7 @@ function ut(t, e, n, r) {
|
|
|
177
179
|
default: () => [l(x, {
|
|
178
180
|
style: {
|
|
179
181
|
padding: "4px",
|
|
180
|
-
color:
|
|
182
|
+
color: o,
|
|
181
183
|
verticalAlign: "middle"
|
|
182
184
|
}
|
|
183
185
|
}, null)]
|
|
@@ -185,18 +187,18 @@ function ut(t, e, n, r) {
|
|
|
185
187
|
}
|
|
186
188
|
function lt(t, e) {
|
|
187
189
|
const n = [];
|
|
188
|
-
function
|
|
189
|
-
var
|
|
190
|
+
function o(i) {
|
|
191
|
+
var r;
|
|
190
192
|
for (const s of i)
|
|
191
|
-
(
|
|
193
|
+
(r = s.children) != null && r.length ? o(s.children) : n.push(e(s));
|
|
192
194
|
}
|
|
193
|
-
return
|
|
195
|
+
return o(t), n;
|
|
194
196
|
}
|
|
195
197
|
function ct(t, e) {
|
|
196
198
|
if (c(t) && c(e))
|
|
197
199
|
return S(p(t), p(e));
|
|
198
|
-
if (
|
|
199
|
-
const n = (
|
|
200
|
+
if (d(t) && d(e)) {
|
|
201
|
+
const n = (o) => I(o, (i) => i == null) || v(o);
|
|
200
202
|
if (n(t) && n(e))
|
|
201
203
|
return !0;
|
|
202
204
|
}
|