@aplus-frontend/ui 0.5.0-beta.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-action/item-popconfirm/index.vue.d.ts +13 -0
- package/es/src/ap-form/hooks/use-watch.d.ts +4 -1
- package/es/src/ap-form/hooks/use-watch.mjs +31 -29
- package/es/src/ap-form/index.mjs +1 -1
- package/es/src/ap-form/search-form/index.vue.mjs +14 -15
- package/es/src/ap-grid/constants.d.ts +4 -4
- package/es/src/ap-grid/constants.mjs +8 -8
- package/es/src/ap-grid/index.vue.mjs +228 -188
- package/es/src/ap-grid/interface.d.ts +0 -1
- package/es/src/ap-grid/utils/table.mjs +12 -12
- 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/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +13 -13
- package/es/src/business/ap-ladder/ApLadder.vue.d.ts +13 -0
- package/es/src/business/ap-ladder/index.d.ts +39 -0
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +36 -38
- package/es/src/business/ap-table-modal/index.d.ts +3 -3
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -1
- package/es/src/config-provider/config-provider.mjs +23 -23
- package/es/src/utils/config-provider-preset.d.ts +41 -0
- package/es/src/utils/config-provider-preset.mjs +24 -15
- package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +13 -0
- package/lib/src/ap-form/hooks/use-watch.d.ts +4 -1
- package/lib/src/ap-form/hooks/use-watch.js +1 -1
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-grid/constants.d.ts +4 -4
- package/lib/src/ap-grid/constants.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +0 -1
- package/lib/src/ap-grid/utils/table.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/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
- package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +13 -0
- package/lib/src/business/ap-ladder/index.d.ts +39 -0
- package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
- package/lib/src/business/ap-table-modal/index.d.ts +3 -3
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/utils/config-provider-preset.d.ts +41 -0
- package/lib/src/utils/config-provider-preset.js +1 -1
- package/package.json +6 -6
- package/theme/ap-grid/index.css +32 -0
- package/theme/ap-grid/index.less +42 -0
- package/theme/index.css +32 -0
|
@@ -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
|
}
|
|
@@ -4,29 +4,29 @@ import "../../config-provider/index.mjs";
|
|
|
4
4
|
import { ApAttachmentProps as W } from "./constans.mjs";
|
|
5
5
|
import { getHexWithOpacity as q, getFileInfo as w } from "../../ap-download/utils/getFileInfo.mjs";
|
|
6
6
|
import { useOssInit as D } from "../../ap-download/hooks/index.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { debounce as E, isArray as J } from "lodash-unified";
|
|
8
8
|
import { LoadingOutlined as g } from "@ant-design/icons-vue";
|
|
9
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as Q } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
10
|
import { useGlobalConfig as h } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
-
import { useLocale as
|
|
12
|
-
const
|
|
11
|
+
import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
const se = /* @__PURE__ */ _({
|
|
13
13
|
name: "ApAttachment",
|
|
14
14
|
props: W(),
|
|
15
15
|
setup(e) {
|
|
16
16
|
const {
|
|
17
|
-
b
|
|
17
|
+
b,
|
|
18
18
|
e: a
|
|
19
|
-
} =
|
|
19
|
+
} = Q("ap-attachment"), O = h("uiMode"), T = h("apUpload"), N = h("downloadCenterTriggerConfig"), {
|
|
20
20
|
lang: x,
|
|
21
21
|
t: m
|
|
22
|
-
} =
|
|
22
|
+
} = X(), i = F(!1), c = F(""), d = j(), P = n(() => x.value === "zh-cn" ? "zh_CN" : "en_US"), u = n(() => e.attachmentList.length === 1), p = n(() => e.needName ? e.attachmentList.length > 0 && e.needName && e.needName.nameKey ? e.attachmentList[0][e.needName.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), k = n(() => u.value ? p.value : m("ap.apAttachment.downloadall")), A = n(() => e.color ? e.color : O.value === "aplus" ? "#0070FF" : "#1890FF"), S = n(() => ({
|
|
23
23
|
width: u.value ? "auto" : "266px"
|
|
24
24
|
})), L = n(() => ({
|
|
25
25
|
"--download-main-color": A.value,
|
|
26
26
|
"--download-main-color-opacity": q(A.value, 0.6)
|
|
27
27
|
})), V = n(() => {
|
|
28
28
|
var t;
|
|
29
|
-
return e.getOssAccess || ((t =
|
|
29
|
+
return e.getOssAccess || ((t = T.value) == null ? void 0 : t.getOssAccess);
|
|
30
30
|
}), z = n(() => {
|
|
31
31
|
const t = d.default ? d.default()[0] : null;
|
|
32
32
|
return t ? K(t, {
|
|
@@ -34,12 +34,12 @@ const ce = /* @__PURE__ */ _({
|
|
|
34
34
|
"font-size": "16px"
|
|
35
35
|
}
|
|
36
36
|
}) : null;
|
|
37
|
-
}), f = async (t, s) => {
|
|
37
|
+
}), f = E(async (t, s) => {
|
|
38
38
|
var o, C;
|
|
39
39
|
if (!e.disabled) {
|
|
40
40
|
i.value = !0, s && (c.value = s);
|
|
41
41
|
try {
|
|
42
|
-
const r =
|
|
42
|
+
const r = J(v(t)) ? v(t) : [v(t)];
|
|
43
43
|
if ((o = N.value) != null && o.trigger) {
|
|
44
44
|
const U = w(e.needName, r).map((y) => ({
|
|
45
45
|
objectName: y.path,
|
|
@@ -54,7 +54,7 @@ const ce = /* @__PURE__ */ _({
|
|
|
54
54
|
i.value = !1, c.value = "";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
}, I = (t) => t && t.length > 0 ? l("ul", {
|
|
57
|
+
}, 500), I = (t) => t && t.length > 0 ? l("ul", {
|
|
58
58
|
class: [a("file-list")],
|
|
59
59
|
style: L.value
|
|
60
60
|
}, [t.map((s, o) => l("li", {
|
|
@@ -76,7 +76,7 @@ const ce = /* @__PURE__ */ _({
|
|
|
76
76
|
return () => {
|
|
77
77
|
var t;
|
|
78
78
|
return ((t = e.attachmentList) == null ? void 0 : t.length) > 0 && l("div", {
|
|
79
|
-
class: [
|
|
79
|
+
class: [b()],
|
|
80
80
|
style: [S.value, L.value]
|
|
81
81
|
}, [l(H, {
|
|
82
82
|
title: k.value,
|
|
@@ -108,5 +108,5 @@ const ce = /* @__PURE__ */ _({
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
export {
|
|
111
|
-
|
|
111
|
+
se as default
|
|
112
112
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as _, ref as
|
|
1
|
+
import { defineComponent as _, ref as v, createBlock as a, openBlock as s, unref as u, withCtx as d, createElementBlock as h, Fragment as t, renderList as y, mergeProps as k, createElementVNode as w, withDirectives as g, createVNode as C, vShow as b, resolveDynamicComponent as L, h as M } from "vue";
|
|
2
2
|
import { LoadingOutlined as B } from "@ant-design/icons-vue";
|
|
3
3
|
import { Menu as R, MenuItem as x } from "@aplus-frontend/antdv";
|
|
4
4
|
const D = { style: { display: "flex", "align-items": "center" } }, P = /* @__PURE__ */ _({
|
|
@@ -9,31 +9,31 @@ const D = { style: { display: "flex", "align-items": "center" } }, P = /* @__PUR
|
|
|
9
9
|
menuList: {}
|
|
10
10
|
},
|
|
11
11
|
setup(f) {
|
|
12
|
-
const
|
|
13
|
-
async function p(
|
|
14
|
-
var
|
|
15
|
-
const n = (
|
|
12
|
+
const l = f, r = v({});
|
|
13
|
+
async function p(o, c) {
|
|
14
|
+
var e;
|
|
15
|
+
const n = (o == null ? void 0 : o.id) || c;
|
|
16
16
|
r.value[n] = !0;
|
|
17
17
|
try {
|
|
18
|
-
await ((
|
|
18
|
+
await ((e = o == null ? void 0 : o.onClick) == null ? void 0 : e.call(o, { selectedRows: l == null ? void 0 : l.selectedRows }));
|
|
19
19
|
} finally {
|
|
20
|
-
r.value[n] =
|
|
20
|
+
r.value[n] = void 0;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
return (
|
|
23
|
+
return (o, c) => (s(), a(u(R), null, {
|
|
24
24
|
default: d(() => [
|
|
25
|
-
(s(!0),
|
|
26
|
-
key: (n == null ? void 0 : n.id) ||
|
|
25
|
+
(s(!0), h(t, null, y(l.menuList, (n, e) => (s(), a(u(x), k({
|
|
26
|
+
key: (n == null ? void 0 : n.id) || e,
|
|
27
27
|
ref_for: !0
|
|
28
28
|
}, {
|
|
29
29
|
...n,
|
|
30
|
-
onClick: () => p(n,
|
|
31
|
-
disabled: r.value[(n == null ? void 0 : n.id) ||
|
|
30
|
+
onClick: () => p(n, e),
|
|
31
|
+
disabled: r.value[(n == null ? void 0 : n.id) || e] ?? (n == null ? void 0 : n.disabled) ?? !1
|
|
32
32
|
}), {
|
|
33
33
|
default: d(() => [
|
|
34
34
|
w("div", D, [
|
|
35
35
|
g(C(u(B), { style: { "margin-right": "10px" } }, null, 512), [
|
|
36
|
-
[b, r.value[(n == null ? void 0 : n.id) ||
|
|
36
|
+
[b, r.value[(n == null ? void 0 : n.id) || e]]
|
|
37
37
|
]),
|
|
38
38
|
(s(), a(L(M(t, [n == null ? void 0 : n.content]))))
|
|
39
39
|
])
|
|
@@ -81,6 +81,19 @@ declare const __VLS_component: DefineComponent<ApLadderProps, {}, {}, {}, {}, Co
|
|
|
81
81
|
'onUpdate:visible': PropType<(vis: boolean) => void>;
|
|
82
82
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
83
83
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
84
|
+
mask: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
88
|
+
maskStyle: {
|
|
89
|
+
type: PropType<CSSProperties>;
|
|
90
|
+
default: CSSProperties;
|
|
91
|
+
};
|
|
92
|
+
maskTransitionName: StringConstructor;
|
|
93
|
+
maskClosable: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
default: boolean;
|
|
96
|
+
};
|
|
84
97
|
}>>, "title" | "placement" | "color" | "mouseEnterDelay" | "trigger" | "getPopupContainer" | "align" | "overlayStyle" | "overlayInnerStyle" | "overlayClassName" | "mouseLeaveDelay" | "arrowPointAtCenter" | "arrow" | "autoAdjustOverflow" | "destroyTooltipOnHide">>;
|
|
85
98
|
major: string;
|
|
86
99
|
minor: string;
|