@aplus-frontend/ui 0.1.26 → 0.1.28
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-download/ap-download.vue.d.ts +12 -4
- package/es/src/ap-download/ap-download.vue.mjs +72 -37
- package/es/src/ap-download/interface.d.ts +5 -12
- package/es/src/ap-download/style/ap-download.css +6 -0
- package/es/src/ap-field/select/index.vue.mjs +65 -63
- package/es/src/ap-table/ap-table.vue.mjs +231 -183
- package/es/src/ap-table/components/interface.d.ts +33 -1
- package/es/src/ap-table/components/setting/images/icon_carst_down.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/images/icon_fill_right.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +152 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +96 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +140 -0
- package/es/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/es/src/ap-table/components/setting/sorter/context.mjs +20 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +199 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +75 -0
- package/es/src/ap-table/components/setting/utils.d.ts +17 -0
- package/es/src/ap-table/components/setting/utils.mjs +48 -0
- package/es/src/ap-table/components/style/setting/modal.css +39 -0
- package/es/src/ap-table/components/style/setting/select-group.css +7 -0
- package/es/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/es/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/es/src/ap-table/components/style/setting/sorter.css +26 -0
- package/es/src/ap-table/constants.d.ts +31 -8
- package/es/src/ap-table/constants.mjs +41 -53
- package/es/src/ap-table/context.d.ts +31 -0
- package/es/src/ap-table/context.mjs +20 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +46 -0
- package/es/src/ap-table/hooks/use-table-content-height.mjs +19 -19
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +87 -82
- package/es/src/ap-table/interface.d.ts +51 -1
- package/es/src/ap-table/style/ap-table.css +29 -1
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/ap-table/utils.mjs +82 -82
- package/es/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/es/src/business/ap-attachment/ApAttachment.mjs +89 -66
- package/es/src/business/ap-attachment/interface.d.ts +1 -1
- package/es/src/business/ap-attachment/style.css +6 -0
- package/es/src/business/ap-input-radio/interface.d.ts +1 -1
- package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/es/src/business/index.d.ts +1 -3
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/locale/lang/en.mjs +14 -0
- package/es/src/locale/lang/zh-cn.mjs +14 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +6 -0
- package/es/src/theme/ap-download/ap-download.css +6 -0
- package/es/src/theme/ap-table/ap-table.css +29 -1
- package/es/src/theme/ap-table/setting/modal.css +39 -0
- package/es/src/theme/ap-table/setting/select-group.css +7 -0
- package/es/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/es/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/es/src/theme/ap-table/setting/sorter.css +26 -0
- package/es/src/theme/css-var/index.mjs +22 -12
- package/lib/src/ap-download/ap-download.vue.d.ts +12 -4
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +5 -12
- package/lib/src/ap-download/style/ap-download.css +6 -0
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/interface.d.ts +33 -1
- package/lib/src/ap-table/components/setting/images/icon_carst_down.svg.js +1 -0
- package/lib/src/ap-table/components/setting/images/icon_fill_right.svg.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/lib/src/ap-table/components/setting/sorter/context.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/utils.d.ts +17 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -0
- package/lib/src/ap-table/components/style/setting/modal.css +39 -0
- package/lib/src/ap-table/components/style/setting/select-group.css +7 -0
- package/lib/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/lib/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/lib/src/ap-table/components/style/setting/sorter.css +26 -0
- package/lib/src/ap-table/constants.d.ts +31 -8
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/context.d.ts +31 -0
- package/lib/src/ap-table/context.js +1 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -0
- package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +51 -1
- package/lib/src/ap-table/style/ap-table.css +29 -1
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/interface.d.ts +1 -1
- package/lib/src/business/ap-attachment/style.css +6 -0
- package/lib/src/business/ap-input-radio/interface.d.ts +1 -1
- package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/lib/src/business/index.d.ts +1 -3
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-attachment/ap-attachment.css +6 -0
- package/lib/src/theme/ap-download/ap-download.css +6 -0
- package/lib/src/theme/ap-table/ap-table.css +29 -1
- package/lib/src/theme/ap-table/setting/modal.css +39 -0
- package/lib/src/theme/ap-table/setting/select-group.css +7 -0
- package/lib/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/lib/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/lib/src/theme/ap-table/setting/sorter.css +26 -0
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +3 -2
|
@@ -8423,7 +8423,7 @@ export declare function updateFormProps(item: ApColumnType<any, any>, fieldProps
|
|
|
8423
8423
|
* @returns
|
|
8424
8424
|
*/
|
|
8425
8425
|
export declare function objectToString(value: any): any;
|
|
8426
|
-
export declare function getTableTitle(column: ApColumnType<any>, slot?: (props: {
|
|
8426
|
+
export declare function getTableTitle(column: ApColumnType<any>, titleNodeClassName: string, slot?: (props: {
|
|
8427
8427
|
title: any;
|
|
8428
8428
|
column: ApColumnType<any>;
|
|
8429
8429
|
}) => any, tooltipColor?: string): number | boolean | void | VNodeArrayChildren | import("vue/jsx-runtime").JSX.Element | ((props: ColumnTitleProps<any>) => VNodeArrayChildren | VueNode) | null;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { isObject as
|
|
3
|
-
import { apTableRenderItemMap as
|
|
4
|
-
import { isType as
|
|
1
|
+
import { isVNode as T, createVNode as u, mergeProps as f, cloneVNode as b, Fragment as y } from "vue";
|
|
2
|
+
import { isObject as c, isArray as p, isUndefined as g, isFunction as h, omit as j, isBoolean as F, isString as a } from "lodash-unified";
|
|
3
|
+
import { apTableRenderItemMap as O, apTableFormItemMap as E } from "./constants.mjs";
|
|
4
|
+
import { isType as x } from "@fruits-chain/utils";
|
|
5
5
|
import "../ap-form/index.mjs";
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { QuestionCircleOutlined as
|
|
6
|
+
import { Tooltip as N } from "ant-design-vue";
|
|
7
|
+
import { QuestionCircleOutlined as S } from "@ant-design/icons-vue";
|
|
8
8
|
import I from "../ap-form/ap-form-item.vue.mjs";
|
|
9
9
|
function v(t) {
|
|
10
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
10
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !T(t);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
let
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
}) :
|
|
12
|
+
const P = (t, e, n) => {
|
|
13
|
+
let r = {};
|
|
14
|
+
return c(t) ? Object.keys(t).forEach((o) => {
|
|
15
|
+
c(t[o]) ? r[o] = P(t[o], e[o], n) : r[o] = n(t[o], e);
|
|
16
|
+
}) : r = n(t, e), r;
|
|
17
17
|
}, J = (t, e) => {
|
|
18
18
|
switch (t) {
|
|
19
19
|
case "dayjs":
|
|
@@ -21,12 +21,12 @@ const C = (t, e, n) => {
|
|
|
21
21
|
case "dayjsRange":
|
|
22
22
|
return e.map((n) => n.valueOf());
|
|
23
23
|
case "dayjsDayRange": {
|
|
24
|
-
const [n,
|
|
25
|
-
return [n.startOf("day").valueOf(),
|
|
24
|
+
const [n, r] = e;
|
|
25
|
+
return [n.startOf("day").valueOf(), r.endOf("day").valueOf()];
|
|
26
26
|
}
|
|
27
27
|
case "multiple":
|
|
28
28
|
case "multipleNumber":
|
|
29
|
-
return
|
|
29
|
+
return p(e) ? e : [e];
|
|
30
30
|
case "boolean":
|
|
31
31
|
return e;
|
|
32
32
|
case "object":
|
|
@@ -36,93 +36,93 @@ const C = (t, e, n) => {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
function L(t) {
|
|
39
|
-
return
|
|
39
|
+
return p(t) ? t.join(".") : t;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function V(t) {
|
|
42
42
|
const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
|
|
43
43
|
return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
const e = [], n =
|
|
47
|
-
return n.forEach((
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
if (typeof
|
|
45
|
+
const w = (t) => V(t) === "map" ? t : new Map(Object.entries(t || {})), d = (t) => {
|
|
46
|
+
const e = [], n = w(t);
|
|
47
|
+
return n.forEach((r, o) => {
|
|
48
|
+
const i = n.get(o) || n.get(`${o}`);
|
|
49
|
+
if (i) {
|
|
50
|
+
if (typeof i == "object" && (i != null && i.text)) {
|
|
51
51
|
e.push({
|
|
52
|
-
text:
|
|
53
|
-
value:
|
|
54
|
-
label:
|
|
55
|
-
disabled:
|
|
52
|
+
text: i == null ? void 0 : i.text,
|
|
53
|
+
value: o,
|
|
54
|
+
label: i == null ? void 0 : i.text,
|
|
55
|
+
disabled: i.disabled
|
|
56
56
|
});
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
e.push({
|
|
60
|
-
text:
|
|
61
|
-
label:
|
|
62
|
-
value:
|
|
60
|
+
text: i,
|
|
61
|
+
label: i,
|
|
62
|
+
value: o
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}), e;
|
|
66
|
-
}, Q = (t) =>
|
|
66
|
+
}, Q = (t) => g(t) || t < 0 ? 0 : t, U = (t, e, n) => {
|
|
67
67
|
if (n)
|
|
68
68
|
return n;
|
|
69
|
-
const
|
|
69
|
+
const r = ["select", "date"], o = ["text", "textArea", "number"];
|
|
70
70
|
if (e === "dateRange")
|
|
71
71
|
return [t("ap.common.chooseText"), t("ap.common.chooseText")];
|
|
72
|
-
if (
|
|
72
|
+
if (r.includes(e))
|
|
73
73
|
return t("ap.common.chooseText");
|
|
74
|
-
if (
|
|
74
|
+
if (o.includes(e))
|
|
75
75
|
return t("ap.common.inputText");
|
|
76
76
|
};
|
|
77
|
-
function
|
|
78
|
-
return !t || !
|
|
77
|
+
function A(t, e) {
|
|
78
|
+
return !t || !h(t) ? t : t(e);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function W(t) {
|
|
81
81
|
let e = t.valueType || "text";
|
|
82
82
|
return t.valueEnum && (e = "status"), e;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function z(t, e, n, r) {
|
|
85
85
|
var s;
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
return u(
|
|
86
|
+
const o = O[t];
|
|
87
|
+
if (o)
|
|
88
|
+
return u(o, f(e, {
|
|
89
89
|
mode: "read"
|
|
90
90
|
}), null);
|
|
91
|
-
const
|
|
92
|
-
return ((s =
|
|
91
|
+
const i = r == null ? void 0 : r[t];
|
|
92
|
+
return ((s = i == null ? void 0 : i.render) == null ? void 0 : s.call(i, e.value, n, e)) || e.value;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function G(t, e) {
|
|
95
95
|
if (t.customRenderFormItem)
|
|
96
96
|
return () => {
|
|
97
|
-
const
|
|
98
|
-
return
|
|
97
|
+
const o = t.customRenderFormItem(t);
|
|
98
|
+
return b(o, {
|
|
99
99
|
...t.fieldProps,
|
|
100
100
|
span: t.span,
|
|
101
|
-
...
|
|
101
|
+
...o.props || {}
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
|
-
const n =
|
|
104
|
+
const n = E[t.valueType];
|
|
105
105
|
if (n)
|
|
106
106
|
return n;
|
|
107
|
-
const
|
|
107
|
+
const r = e == null ? void 0 : e[t.valueType];
|
|
108
108
|
return () => {
|
|
109
|
-
var
|
|
110
|
-
const
|
|
111
|
-
return
|
|
109
|
+
var i;
|
|
110
|
+
const o = (i = r == null ? void 0 : r.renderFormItem) == null ? void 0 : i.call(r, t.fieldProps.field);
|
|
111
|
+
return o ? u(I, f(t.fieldProps, {
|
|
112
112
|
span: t.span
|
|
113
|
-
}), v(
|
|
114
|
-
default: () => [
|
|
113
|
+
}), v(o) ? o : {
|
|
114
|
+
default: () => [o]
|
|
115
115
|
}) : null;
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
const n =
|
|
118
|
+
function K(t, e) {
|
|
119
|
+
const n = A(t.fieldProps, e), r = (n == null ? void 0 : n.field) || n || {}, o = t.valueType === "switch", i = t.valueType === "index", s = o ? {
|
|
120
120
|
checked: e.value
|
|
121
121
|
} : {
|
|
122
|
-
value:
|
|
122
|
+
value: i ? e.index + 1 : e.value
|
|
123
123
|
};
|
|
124
|
-
return t.valueEnum && (
|
|
125
|
-
...
|
|
124
|
+
return t.valueEnum && (r.valueEnum = t.valueEnum), {
|
|
125
|
+
...j(r, ["request"]),
|
|
126
126
|
...s
|
|
127
127
|
};
|
|
128
128
|
}
|
|
@@ -130,18 +130,18 @@ function X(t) {
|
|
|
130
130
|
const e = {
|
|
131
131
|
...t
|
|
132
132
|
};
|
|
133
|
-
return
|
|
133
|
+
return F(t.filters) && t.filters && t.valueEnum && (e.filters = d(t.valueEnum)), e;
|
|
134
134
|
}
|
|
135
135
|
function Y(t, e) {
|
|
136
|
-
var
|
|
136
|
+
var r;
|
|
137
137
|
const n = e || {};
|
|
138
|
-
return t.valueEnum && !((
|
|
138
|
+
return t.valueEnum && !((r = n.field) != null && r.options) && (n.field = {
|
|
139
139
|
...n.field,
|
|
140
|
-
options:
|
|
140
|
+
options: d(t.valueEnum)
|
|
141
141
|
}), n;
|
|
142
142
|
}
|
|
143
143
|
function Z(t) {
|
|
144
|
-
if (!
|
|
144
|
+
if (!x("Object")(t))
|
|
145
145
|
return t;
|
|
146
146
|
try {
|
|
147
147
|
return JSON.stringify(t);
|
|
@@ -149,50 +149,50 @@ function Z(t) {
|
|
|
149
149
|
return t;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
function k(t, e, n) {
|
|
153
|
-
const o =
|
|
152
|
+
function k(t, e, n, r) {
|
|
153
|
+
const o = n == null ? void 0 : n({
|
|
154
154
|
title: t.title,
|
|
155
155
|
column: t
|
|
156
156
|
});
|
|
157
157
|
if (o && (o.length > 1 || o[0].children && o[0].children !== "v-if"))
|
|
158
158
|
return o;
|
|
159
|
-
const
|
|
160
|
-
|
|
159
|
+
const s = a(t.title) ? u("span", {
|
|
160
|
+
class: e,
|
|
161
161
|
title: t.title
|
|
162
|
-
}, [t.title]) : t.title,
|
|
162
|
+
}, [t.title]) : t.title, l = t.tooltip ? a(t.tooltip) ? u(y, null, [t.tooltip]) : t.tooltip(t) : null, m = u("span", {
|
|
163
163
|
style: {
|
|
164
164
|
display: "inline-flex",
|
|
165
165
|
alignItems: "center"
|
|
166
166
|
}
|
|
167
|
-
}, [
|
|
168
|
-
title:
|
|
167
|
+
}, [s, u(N, {
|
|
168
|
+
title: l,
|
|
169
169
|
placement: "bottom"
|
|
170
170
|
}, {
|
|
171
|
-
default: () => [u(
|
|
171
|
+
default: () => [u(S, {
|
|
172
172
|
style: {
|
|
173
173
|
padding: "4px",
|
|
174
|
-
color:
|
|
174
|
+
color: r,
|
|
175
175
|
verticalAlign: "middle"
|
|
176
176
|
}
|
|
177
177
|
}, null)]
|
|
178
178
|
})]);
|
|
179
|
-
return
|
|
179
|
+
return l ? m : s;
|
|
180
180
|
}
|
|
181
181
|
export {
|
|
182
182
|
X as apColumnToColumn,
|
|
183
183
|
L as dataIndexToStr,
|
|
184
|
-
|
|
184
|
+
P as formatParamsValueType,
|
|
185
185
|
Q as getColumnOrder,
|
|
186
|
-
|
|
186
|
+
A as getFieldProps,
|
|
187
187
|
U as getPlaceholder,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
G as getSearchFormItemRenderNode,
|
|
189
|
+
z as getTableCellRenderNode,
|
|
190
|
+
K as getTableRenderProps,
|
|
191
|
+
W as getTableRenderType,
|
|
192
192
|
k as getTableTitle,
|
|
193
|
-
|
|
193
|
+
w as objectToMap,
|
|
194
194
|
Z as objectToString,
|
|
195
195
|
J as parseFieldValue,
|
|
196
196
|
Y as updateFormProps,
|
|
197
|
-
|
|
197
|
+
d as valueEnumToArray
|
|
198
198
|
};
|
|
@@ -42,7 +42,7 @@ declare const _default: DefineComponent<{
|
|
|
42
42
|
toolTipBgColor: {
|
|
43
43
|
type: StringConstructor;
|
|
44
44
|
};
|
|
45
|
-
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
45
|
+
}, () => false | import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
46
46
|
attachmentList: {
|
|
47
47
|
type: PropType<Array<AttachmentItemProps>>;
|
|
48
48
|
default: never[];
|
|
@@ -1,82 +1,105 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Tooltip as
|
|
1
|
+
import { defineComponent as S, ref as A, useSlots as V, computed as o, cloneVNode as z, unref as I, toRaw as f, createVNode as l, createTextVNode as M } from "vue";
|
|
2
|
+
import { Tooltip as U, Popover as _ } from "ant-design-vue";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { ApAttachmentProps as
|
|
5
|
-
import { getHexWithOpacity as
|
|
4
|
+
import { ApAttachmentProps as B } from "./constans.mjs";
|
|
5
|
+
import { getHexWithOpacity as G, getFileInfo as H } from "../../ap-download/utils/getFileInfo.mjs";
|
|
6
6
|
import "./style.css";
|
|
7
|
-
import { useOssInit as
|
|
8
|
-
import { isArray as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
7
|
+
import { useOssInit as R } from "../../ap-download/hooks/index.mjs";
|
|
8
|
+
import { isArray as W } from "lodash-unified";
|
|
9
|
+
import { LoadingOutlined as v } from "@ant-design/icons-vue";
|
|
10
|
+
import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useGlobalConfig as y } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useLocale as q } from "../../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
const at = /* @__PURE__ */ S({
|
|
13
14
|
name: "ApAttachment",
|
|
14
|
-
props:
|
|
15
|
+
props: B(),
|
|
15
16
|
setup(t) {
|
|
16
17
|
const {
|
|
17
|
-
b:
|
|
18
|
-
e:
|
|
19
|
-
} =
|
|
20
|
-
lang:
|
|
21
|
-
t:
|
|
22
|
-
} =
|
|
23
|
-
width:
|
|
24
|
-
})),
|
|
25
|
-
"--download-main-color":
|
|
26
|
-
"--download-main-color-opacity":
|
|
27
|
-
})),
|
|
18
|
+
b: L,
|
|
19
|
+
e: a
|
|
20
|
+
} = j("ap-attachment"), w = y("uiMode"), C = y("apUpload"), {
|
|
21
|
+
lang: F,
|
|
22
|
+
t: r
|
|
23
|
+
} = q(), c = A(!1), s = A(""), m = V(), N = o(() => F.value === "zh-cn" ? "zh_CN" : "en_US"), u = o(() => t.attachmentList.length === 1), p = o(() => t.attachmentList.length > 0 ? t.attachmentList[0].fileName : ""), O = o(() => u.value ? p.value : r("ap.apAttachment.downloadall")), h = o(() => t.color ? t.color : w.value === "aplus" ? "#0070FF" : "#1890FF"), T = o(() => ({
|
|
24
|
+
width: u.value ? "auto" : "266px"
|
|
25
|
+
})), g = o(() => ({
|
|
26
|
+
"--download-main-color": h.value,
|
|
27
|
+
"--download-main-color-opacity": G(h.value, 0.6)
|
|
28
|
+
})), b = o(() => {
|
|
28
29
|
var e;
|
|
29
|
-
return t.getOssAccess || ((e =
|
|
30
|
-
}),
|
|
31
|
-
const e =
|
|
32
|
-
return e ?
|
|
30
|
+
return t.getOssAccess || ((e = C.value) == null ? void 0 : e.getOssAccess);
|
|
31
|
+
}), x = o(() => {
|
|
32
|
+
const e = m.default ? m.default()[0] : null;
|
|
33
|
+
return e ? z(e, {
|
|
33
34
|
style: {
|
|
34
35
|
"font-size": "16px"
|
|
35
36
|
}
|
|
36
37
|
}) : null;
|
|
37
|
-
}),
|
|
38
|
+
}), d = async (e, i) => {
|
|
38
39
|
if (!t.disabled) {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
c.value = !0, i && (s.value = i);
|
|
41
|
+
try {
|
|
42
|
+
const n = await R(b.value, I(N)), k = W(f(e)) ? f(e) : [f(e)];
|
|
43
|
+
await n.downloadFile(H(t.needName, k));
|
|
44
|
+
} catch (n) {
|
|
45
|
+
console.error(n);
|
|
46
|
+
} finally {
|
|
47
|
+
c.value = !1, s.value = "";
|
|
48
|
+
}
|
|
41
49
|
}
|
|
42
|
-
},
|
|
43
|
-
class: [
|
|
44
|
-
style:
|
|
45
|
-
}, [e.map((
|
|
46
|
-
key:
|
|
47
|
-
class: [
|
|
48
|
-
onClick: () =>
|
|
49
|
-
}, [c.
|
|
50
|
-
class: [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class: [
|
|
55
|
-
|
|
56
|
-
}, [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
50
|
+
}, P = (e) => e && e.length > 0 ? l("ul", {
|
|
51
|
+
class: [a("file-list")],
|
|
52
|
+
style: g.value
|
|
53
|
+
}, [e.map((i, n) => l("li", {
|
|
54
|
+
key: n,
|
|
55
|
+
class: [a("file-item")],
|
|
56
|
+
onClick: () => d(i, n + 1)
|
|
57
|
+
}, [c.value && s.value === n + 1 ? l("span", {
|
|
58
|
+
class: [a("spin")]
|
|
59
|
+
}, [l(v, {
|
|
60
|
+
spin: !0
|
|
61
|
+
}, null)]) : null, i.fileName])), l("li", {
|
|
62
|
+
class: [a("down-load-all")],
|
|
63
|
+
onClick: () => d(t.attachmentList, "all")
|
|
64
|
+
}, [c.value && s.value === "all" ? l("span", {
|
|
65
|
+
class: [a("spin")]
|
|
66
|
+
}, [l(v, {
|
|
67
|
+
spin: !0
|
|
68
|
+
}, null)]) : null, r("ap.apAttachment.downloadall")])]) : null;
|
|
69
|
+
return () => {
|
|
70
|
+
var e;
|
|
71
|
+
return ((e = t.attachmentList) == null ? void 0 : e.length) > 0 && l("div", {
|
|
72
|
+
class: [L()],
|
|
73
|
+
style: [T.value, g.value]
|
|
74
|
+
}, [l(U, {
|
|
75
|
+
title: O.value,
|
|
76
|
+
placement: t.textToolTipPlacement,
|
|
77
|
+
color: t.toolTipBgColor
|
|
78
|
+
}, {
|
|
79
|
+
default: () => [l("div", {
|
|
80
|
+
class: [a("content")],
|
|
81
|
+
onClick: () => d(u.value ? t.attachmentList[0] : t.attachmentList, "global")
|
|
82
|
+
}, [c.value && s.value === "global" ? l("div", {
|
|
83
|
+
class: [a("spin")]
|
|
84
|
+
}, [l(v, {
|
|
85
|
+
spin: !0
|
|
86
|
+
}, null)]) : null, m.default ? l("div", {
|
|
87
|
+
class: [a("text-render")]
|
|
88
|
+
}, [x.value, M(" ")]) : null, l("div", {
|
|
89
|
+
class: [a("text-inner")]
|
|
90
|
+
}, [p.value])])]
|
|
91
|
+
}), l(_, {
|
|
92
|
+
content: P(t.attachmentList),
|
|
93
|
+
placement: t.fileMorePopoverPlacement,
|
|
94
|
+
color: "#fff"
|
|
95
|
+
}, {
|
|
96
|
+
default: () => [!u.value && l("div", {
|
|
97
|
+
class: [a("more")]
|
|
98
|
+
}, [r("ap.apAttachment.more")])]
|
|
99
|
+
})]);
|
|
100
|
+
};
|
|
78
101
|
}
|
|
79
102
|
});
|
|
80
103
|
export {
|
|
81
|
-
|
|
104
|
+
at as default
|
|
82
105
|
};
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
.aplus-ap-attachment__text-render:hover {
|
|
14
14
|
color: var(--download-main-color-opacity);
|
|
15
15
|
}
|
|
16
|
+
.aplus-ap-attachment__spin {
|
|
17
|
+
float: left;
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
}
|
|
16
20
|
.aplus-ap-attachment__text-inner {
|
|
17
21
|
max-width: 190px;
|
|
18
22
|
display: inline-block;
|
|
@@ -39,6 +43,8 @@
|
|
|
39
43
|
max-width: 312px;
|
|
40
44
|
display: flex;
|
|
41
45
|
flex-direction: column;
|
|
46
|
+
margin: 0;
|
|
47
|
+
padding: 0;
|
|
42
48
|
}
|
|
43
49
|
.aplus-ap-attachment__file-item {
|
|
44
50
|
flex: 1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputNumberProps } from 'ant-design-vue/es/input-number';
|
|
2
2
|
type ApInputProps = Pick<InputNumberProps, 'disabled' | 'stringMode' | 'precision' | 'max' | 'min' | 'step' | 'bordered' | 'autofocus' | 'decimalSeparator' | 'controls' | 'formatter' | 'onInput' | 'onChange' | 'onPressEnter' | 'onStep' | 'onBlur' | 'onFocus'>;
|
|
3
3
|
export type ApInputValType = {
|
|
4
|
-
value
|
|
4
|
+
value?: {
|
|
5
5
|
inputVal: string | number;
|
|
6
6
|
radioVal: string | number;
|
|
7
7
|
};
|
|
@@ -38,11 +38,11 @@ export declare function usePageListApTable(props?: UsePageListApTable): [ApTable
|
|
|
38
38
|
dataSource: any;
|
|
39
39
|
rowSelection?: {
|
|
40
40
|
select: (item: any) => void;
|
|
41
|
+
selectAll: () => void;
|
|
42
|
+
unSelectAll: () => void;
|
|
41
43
|
selectedRows: any[];
|
|
42
44
|
unSelect: (item: any) => void;
|
|
43
45
|
isSelected: (item: any) => boolean;
|
|
44
|
-
selectAll: () => void;
|
|
45
|
-
unSelectAll: () => void;
|
|
46
46
|
clearAll: () => void;
|
|
47
47
|
toggleSelect: (item: any) => void;
|
|
48
48
|
} | undefined;
|
|
@@ -1110,7 +1110,6 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1110
1110
|
inputVal: string | number;
|
|
1111
1111
|
radioVal: string | number;
|
|
1112
1112
|
}>;
|
|
1113
|
-
required: true;
|
|
1114
1113
|
};
|
|
1115
1114
|
disabled: {
|
|
1116
1115
|
type: PropType<boolean>;
|
|
@@ -1194,7 +1193,6 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1194
1193
|
inputVal: string | number;
|
|
1195
1194
|
radioVal: string | number;
|
|
1196
1195
|
}>;
|
|
1197
|
-
required: true;
|
|
1198
1196
|
};
|
|
1199
1197
|
disabled: {
|
|
1200
1198
|
type: PropType<boolean>;
|
|
@@ -2748,7 +2746,7 @@ export declare const ApAttachment: DefineComponent<{
|
|
|
2748
2746
|
toolTipBgColor: {
|
|
2749
2747
|
type: StringConstructor;
|
|
2750
2748
|
};
|
|
2751
|
-
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
2749
|
+
}, () => false | import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
2752
2750
|
attachmentList: {
|
|
2753
2751
|
type: PropType<Array< AttachmentItemProps>>;
|
|
2754
2752
|
default: never[];
|
|
@@ -85,6 +85,20 @@ const e = {
|
|
|
85
85
|
totalLeftSuffix: "items",
|
|
86
86
|
totalRightPrefix: "Page",
|
|
87
87
|
totalRightSuffix: ""
|
|
88
|
+
},
|
|
89
|
+
setting: {
|
|
90
|
+
title: "Custom Table",
|
|
91
|
+
selectAll: "Select All",
|
|
92
|
+
unSelectAll: "Deselect All",
|
|
93
|
+
selectAllTip: "Please select the columns to display in the table.",
|
|
94
|
+
sizeSmall: "Small",
|
|
95
|
+
sizeNormal: "Normal",
|
|
96
|
+
selectCount: "Selected fields ({count})",
|
|
97
|
+
reset: "Reset",
|
|
98
|
+
fixToLeft: "Fixed on the left",
|
|
99
|
+
fixToRight: "Fixed on the right",
|
|
100
|
+
unFixed: "Not fixed",
|
|
101
|
+
delete: "Delete"
|
|
88
102
|
}
|
|
89
103
|
},
|
|
90
104
|
apUpload: {
|
|
@@ -85,6 +85,20 @@ const e = {
|
|
|
85
85
|
totalLeftSuffix: "条记录",
|
|
86
86
|
totalRightPrefix: "第",
|
|
87
87
|
totalRightSuffix: "页"
|
|
88
|
+
},
|
|
89
|
+
setting: {
|
|
90
|
+
title: "自定义表格",
|
|
91
|
+
selectAll: "全选",
|
|
92
|
+
unSelectAll: "取消全选",
|
|
93
|
+
selectAllTip: "请选择需要展示在表格的字段",
|
|
94
|
+
sizeSmall: "紧凑",
|
|
95
|
+
sizeNormal: "正常",
|
|
96
|
+
selectCount: "已选字段({count})",
|
|
97
|
+
reset: "重置",
|
|
98
|
+
fixToLeft: "固定在左侧",
|
|
99
|
+
fixToRight: "固定在右侧",
|
|
100
|
+
unFixed: "不固定",
|
|
101
|
+
delete: "删除"
|
|
88
102
|
}
|
|
89
103
|
},
|
|
90
104
|
apUpload: {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
.aplus-ap-attachment__text-render:hover {
|
|
14
14
|
color: var(--download-main-color-opacity);
|
|
15
15
|
}
|
|
16
|
+
.aplus-ap-attachment__spin {
|
|
17
|
+
float: left;
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
}
|
|
16
20
|
.aplus-ap-attachment__text-inner {
|
|
17
21
|
max-width: 190px;
|
|
18
22
|
display: inline-block;
|
|
@@ -39,6 +43,8 @@
|
|
|
39
43
|
max-width: 312px;
|
|
40
44
|
display: flex;
|
|
41
45
|
flex-direction: column;
|
|
46
|
+
margin: 0;
|
|
47
|
+
padding: 0;
|
|
42
48
|
}
|
|
43
49
|
.aplus-ap-attachment__file-item {
|
|
44
50
|
flex: 1;
|
|
@@ -9,11 +9,17 @@
|
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
}
|
|
12
|
+
.aplus-ap-download-inner-wrapper .spin {
|
|
13
|
+
margin-right: 5px;
|
|
14
|
+
}
|
|
12
15
|
.aplus-ap-download-inner-wrapper .icon {
|
|
13
16
|
position: relative;
|
|
14
17
|
font-size: 18px;
|
|
15
18
|
margin-right: 5px;
|
|
16
19
|
}
|
|
20
|
+
.aplus-ap-download-inner-wrapper .text {
|
|
21
|
+
color: var(--download-main-color);
|
|
22
|
+
}
|
|
17
23
|
.aplus-ap-download-inner-wrapper:hover {
|
|
18
24
|
color: var(--download-main-color-opacity);
|
|
19
25
|
}
|