@aplus-frontend/ui 7.7.3 → 7.7.5
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/group/index.vue.d.ts +1 -0
- package/es/src/ap-action/group/index.vue.mjs +28 -28
- package/es/src/ap-action/item-popconfirm/index.vue.d.ts +25 -1
- package/es/src/ap-button/ap-action-button.vue.d.ts +2 -1
- package/es/src/ap-button/ap-button.vue.d.ts +2 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +18 -8
- package/es/src/ap-field/number/index.vue.d.ts +20 -0
- package/es/src/ap-field/number/index.vue.mjs +24 -23
- package/es/src/ap-field/number/read.vue2.mjs +3 -2
- package/es/src/ap-field/radio/index.vue.mjs +24 -24
- package/es/src/ap-field/rate/index.vue.mjs +10 -10
- package/es/src/ap-field/select/index.vue.d.ts +12 -4
- package/es/src/ap-field/select/index.vue.mjs +74 -71
- package/es/src/ap-field/slider/index.vue.d.ts +4 -2
- package/es/src/ap-field/slider/index.vue.mjs +12 -12
- package/es/src/ap-field/switch/index.vue.mjs +20 -20
- package/es/src/ap-field/text/index.vue2.mjs +23 -23
- package/es/src/ap-field/text/password.vue.mjs +9 -9
- package/es/src/ap-field/text-area/index.vue.mjs +24 -20
- package/es/src/ap-field/tree-select/index.vue.d.ts +2 -0
- package/es/src/ap-field/tree-select/index.vue.mjs +17 -17
- package/es/src/ap-form/ap-form.vue2.mjs +64 -64
- package/es/src/ap-form/drawer-form/index.vue.mjs +41 -41
- package/es/src/ap-form/item/index.vue.mjs +64 -64
- package/es/src/ap-form/items/number/index.vue.d.ts +22 -0
- package/es/src/ap-form/items/number/index.vue.mjs +10 -10
- package/es/src/ap-form/items/radio/index.vue.mjs +3 -3
- package/es/src/ap-form/items/select/index.vue.d.ts +18 -6
- package/es/src/ap-form/items/select/index.vue.mjs +5 -5
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +6 -6
- package/es/src/ap-form/items/text/password.vue.mjs +7 -7
- package/es/src/ap-form/items/text-area/index.vue.mjs +5 -5
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -0
- package/es/src/ap-form/items/tree-select/index.vue.mjs +7 -7
- package/es/src/ap-form/modal-form/index.vue.d.ts +25 -1
- package/es/src/ap-form/search-form/components/popover-filter.vue.d.ts +19 -1
- package/es/src/ap-form/search-form/index.vue.mjs +63 -63
- package/es/src/ap-form/style/item.mjs +8 -7
- package/es/src/ap-list/index.vue.mjs +6 -6
- package/es/src/ap-table/constants.d.ts +23 -4
- package/es/src/business/ap-batch-action-group/index.d.ts +34 -4
- package/es/src/business/ap-descriptions/ap-descriptions.vue.d.ts +3 -10
- package/es/src/business/ap-descriptions/ap-descriptions.vue.mjs +58 -79
- package/es/src/business/ap-descriptions/interface.d.ts +2 -3
- package/es/src/business/ap-upload/apUpload.vue.d.ts +9 -0
- package/es/src/business/ap-upload/apUpload.vue.mjs +33 -29
- package/es/src/business/ap-upload/apUploadTypes.d.ts +4 -0
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +50 -49
- package/es/src/business/ap-upload/components/Picture.vue2.mjs +66 -65
- package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +95 -94
- package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
- package/es/src/business/ap-upload/hooks/useOss.mjs +26 -24
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/es/src/editable-table/form-item.vue.mjs +64 -64
- package/es/src/editable-table/index.vue.mjs +66 -66
- package/es/src/scroll-bar/index.vue.d.ts +7 -7
- package/es/src/scroll-bar/index.vue.mjs +21 -21
- package/es/src/scroll-bar/internal.vue.d.ts +4 -4
- package/es/src/scroll-bar/internal.vue.mjs +20 -20
- package/es/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/es/src/scroll-view/hooks/use-scroll-wrapper.mjs +13 -13
- package/es/src/scroll-view/index.vue.d.ts +25 -25
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-action/group/index.vue.d.ts +1 -0
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +25 -1
- package/lib/src/ap-button/ap-action-button.vue.d.ts +2 -1
- package/lib/src/ap-button/ap-button.vue.d.ts +2 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.d.ts +20 -0
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/number/read.vue2.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +12 -4
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +4 -2
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.d.ts +2 -0
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +22 -0
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.d.ts +18 -6
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -0
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +25 -1
- package/lib/src/ap-form/search-form/components/popover-filter.vue.d.ts +19 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/item.js +1 -1
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +23 -4
- package/lib/src/business/ap-batch-action-group/index.d.ts +34 -4
- package/lib/src/business/ap-descriptions/ap-descriptions.vue.d.ts +3 -10
- package/lib/src/business/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/business/ap-descriptions/interface.d.ts +2 -3
- package/lib/src/business/ap-upload/apUpload.vue.d.ts +9 -0
- package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/business/ap-upload/apUploadTypes.d.ts +4 -0
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
- package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/scroll-bar/index.vue.d.ts +7 -7
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/internal.vue.d.ts +4 -4
- package/lib/src/scroll-bar/internal.vue.js +1 -1
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.js +1 -1
- package/lib/src/scroll-view/index.vue.d.ts +25 -25
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as se, inject as o, ref as g, watch as re, computed as ie, createElementBlock as N, openBlock as h, normalizeClass as ce, unref as t, createElementVNode as r, createCommentVNode as E, toDisplayString as b, normalizeStyle as ue, createBlock as pe, withModifiers as de, createVNode as ve } from "vue";
|
|
2
2
|
import "../../../config-provider/index.mjs";
|
|
3
|
-
import { getName as
|
|
4
|
-
import { useOss as
|
|
5
|
-
import { fileMatchesAccept as
|
|
6
|
-
import { message as c, Progress as
|
|
7
|
-
import { DeleteOutlined as
|
|
3
|
+
import { getName as fe, getReturnData as $ } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as me, useOssInit as ge } from "../hooks/useOss.mjs";
|
|
5
|
+
import { fileMatchesAccept as he, getAcceptText as _e } from "../utils/accept.mjs";
|
|
6
|
+
import { message as c, Progress as ke } from "@aplus-frontend/antdv";
|
|
7
|
+
import { DeleteOutlined as ye } from "@ant-design/icons-vue";
|
|
8
8
|
import q from "../assets/single-file-icon.png.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { useToken as
|
|
11
|
-
import { useLocale as
|
|
9
|
+
import we from "../style/index.mjs";
|
|
10
|
+
import { useToken as Ue } from "../../../config-provider/hooks/use-token.mjs";
|
|
11
|
+
import { useLocale as De } from "../../../config-provider/hooks/use-locale.mjs";
|
|
12
12
|
import { useNamespace as Ce } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
-
const
|
|
13
|
+
const Fe = ["accept"], Se = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "state-un"
|
|
16
|
-
},
|
|
16
|
+
}, Ne = ["src"], Ee = { class: "state-un-title" }, be = { class: "state-un-subtitle" }, xe = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "state-ing"
|
|
19
|
-
}, ze = { class: "left" },
|
|
19
|
+
}, ze = { class: "left" }, Ae = ["src"], Re = { class: "center" }, Be = { class: "center-progress" }, Je = /* @__PURE__ */ se({
|
|
20
20
|
__name: "SingleFile",
|
|
21
|
-
setup(
|
|
22
|
-
const { t: s } =
|
|
23
|
-
|
|
21
|
+
setup(Me, { expose: j }) {
|
|
22
|
+
const { t: s } = De(), { b: x } = Ce("ap-upload-single-file"), G = we("ap-upload"), { put: W, client: z } = me(), H = o("dirName"), J = o("baseDirName"), _ = o("accept") || "*", k = o("maxSize") ?? 500, K = o("title") || s("ap.apUpload.clickOrDragUpload"), y = o("subTitle"), { token: A } = Ue(), i = o("value"), w = o("needName"), u = o("uploadingCount"), R = o("beforeUpload"), B = o("customRequest"), Q = o("getOssAccess"), X = o("maxSizeErrorMsg"), Y = o("acceptErrorMsg"), M = o("onRemove"), U = o("showUploadErrorMsg"), l = g(null);
|
|
23
|
+
re(
|
|
24
24
|
() => i?.value,
|
|
25
25
|
function(e) {
|
|
26
|
-
|
|
26
|
+
l.value === null && e && P(e);
|
|
27
27
|
},
|
|
28
28
|
{ immediate: !0 }
|
|
29
29
|
);
|
|
30
30
|
function P(e) {
|
|
31
31
|
e ? setTimeout(() => {
|
|
32
|
-
const
|
|
33
|
-
n.value = 3,
|
|
34
|
-
}) : (n.value = 1,
|
|
32
|
+
const a = fe(w, e);
|
|
33
|
+
n.value = 3, l.value = new File([e], a, {}), i.value = e;
|
|
34
|
+
}) : (n.value = 1, l.value = null, i.value = void 0);
|
|
35
35
|
}
|
|
36
36
|
j({ setValue: P });
|
|
37
|
-
const n = g(1), d = g(0), v = g(null), T =
|
|
38
|
-
function
|
|
37
|
+
const n = g(1), d = g(0), v = g(null), T = ie(() => l.value && i?.value);
|
|
38
|
+
function Z() {
|
|
39
39
|
n.value === 1 && v.value?.click();
|
|
40
40
|
}
|
|
41
41
|
function O(e) {
|
|
42
42
|
e.preventDefault(), e.stopPropagation();
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ee(e) {
|
|
45
45
|
e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ae(e) {
|
|
48
48
|
L(e);
|
|
49
49
|
}
|
|
50
50
|
function te(e) {
|
|
51
51
|
if (e.preventDefault(), e.stopPropagation(), n.value !== 1)
|
|
52
52
|
return;
|
|
53
|
-
var
|
|
53
|
+
var a = e.dataTransfer, f = [], V = 0, I = a.files.length;
|
|
54
54
|
function p() {
|
|
55
|
-
V === I - 1 &&
|
|
55
|
+
V === I - 1 && ae(f), V++;
|
|
56
56
|
}
|
|
57
|
-
if (
|
|
58
|
-
for (var
|
|
59
|
-
var
|
|
60
|
-
if (
|
|
61
|
-
var
|
|
62
|
-
f.push(
|
|
57
|
+
if (a.items !== void 0)
|
|
58
|
+
for (var D = 0; D < a.items.length; D++) {
|
|
59
|
+
var C = a.items[D];
|
|
60
|
+
if (C.kind === "file" && C.webkitGetAsEntry().isFile) {
|
|
61
|
+
var ne = C.getAsFile();
|
|
62
|
+
f.push(ne), p();
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
else
|
|
66
66
|
for (let S = 0; S < I; S++) {
|
|
67
|
-
var m =
|
|
67
|
+
var m = a.files[S];
|
|
68
68
|
if (m.type)
|
|
69
69
|
f.push(m), p();
|
|
70
70
|
else
|
|
@@ -88,41 +88,41 @@ const De = ["accept"], Fe = {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
async function
|
|
92
|
-
const
|
|
93
|
-
await L(
|
|
91
|
+
async function oe(e) {
|
|
92
|
+
const a = e.target;
|
|
93
|
+
await L(a?.files), v.value && (v.value.value = "");
|
|
94
94
|
}
|
|
95
95
|
async function L(e) {
|
|
96
96
|
if (e?.length) {
|
|
97
97
|
if (e[0].size > k * 1024 * 1024) {
|
|
98
98
|
c.warning(
|
|
99
|
-
|
|
99
|
+
X || s("ap.apUpload.maxUploadFileSize", {
|
|
100
100
|
maxSize: k
|
|
101
101
|
})
|
|
102
102
|
);
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
if (!
|
|
105
|
+
if (!he(e[0], _)) {
|
|
106
106
|
c.warning(
|
|
107
|
-
|
|
107
|
+
Y || s("ap.apUpload.fileFormatNotSupported")
|
|
108
108
|
);
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
if (typeof R == "function" && await R(e[0]) === !1)
|
|
112
112
|
return;
|
|
113
|
-
if (
|
|
113
|
+
if (l.value = e[0], n.value = 2, d.value = 0, u.value++, typeof B == "function") {
|
|
114
114
|
B({
|
|
115
|
-
onProgress: (
|
|
116
|
-
d.value =
|
|
115
|
+
onProgress: (a) => {
|
|
116
|
+
d.value = a;
|
|
117
117
|
},
|
|
118
|
-
onError: (
|
|
119
|
-
U && c.warning(
|
|
118
|
+
onError: (a) => {
|
|
119
|
+
U && c.warning(a || s("ap.apUpload.networkAnomaly")), n.value = 1, l.value = null, u.value--;
|
|
120
120
|
},
|
|
121
|
-
onSuccess: (
|
|
121
|
+
onSuccess: (a) => {
|
|
122
122
|
i.value = $(
|
|
123
123
|
w,
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
a,
|
|
125
|
+
l.value.name
|
|
126
126
|
), n.value = 3, u.value--;
|
|
127
127
|
},
|
|
128
128
|
file: e[0]
|
|
@@ -130,43 +130,44 @@ const De = ["accept"], Fe = {
|
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
try {
|
|
133
|
-
await
|
|
134
|
-
file:
|
|
133
|
+
await ge(Q), W({
|
|
134
|
+
file: l.value,
|
|
135
135
|
dirName: H,
|
|
136
|
-
oss:
|
|
137
|
-
successCallBack(
|
|
136
|
+
oss: z,
|
|
137
|
+
successCallBack(a) {
|
|
138
138
|
i.value = $(
|
|
139
139
|
w,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
a,
|
|
141
|
+
l.value.name
|
|
142
142
|
), n.value = 3, u.value--;
|
|
143
143
|
},
|
|
144
|
-
errorCallBack(
|
|
145
|
-
U && c.warning(
|
|
144
|
+
errorCallBack(a) {
|
|
145
|
+
U && c.warning(a || s("ap.apUpload.networkAnomaly")), n.value = 1, l.value = null, u.value--;
|
|
146
146
|
},
|
|
147
|
-
progressCallBack(
|
|
148
|
-
d.value =
|
|
149
|
-
}
|
|
147
|
+
progressCallBack(a) {
|
|
148
|
+
d.value = a;
|
|
149
|
+
},
|
|
150
|
+
baseDirName: J
|
|
150
151
|
});
|
|
151
|
-
} catch (
|
|
152
|
+
} catch (a) {
|
|
152
153
|
U && c.warning(
|
|
153
|
-
typeof
|
|
154
|
-
), n.value = 1,
|
|
154
|
+
typeof a?.message == "string" ? a.message : s("ap.apUpload.networkAnomaly")
|
|
155
|
+
), n.value = 1, l.value = null, u.value--;
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
-
M && M?.(
|
|
159
|
+
function le() {
|
|
160
|
+
M && M?.(l.value), l.value && !i?.value && z.pauseUpload(), n.value = 1, l.value = null, i.value = void 0;
|
|
160
161
|
}
|
|
161
|
-
return (e,
|
|
162
|
-
class:
|
|
163
|
-
[
|
|
164
|
-
[
|
|
165
|
-
[
|
|
162
|
+
return (e, a) => (h(), N("div", {
|
|
163
|
+
class: ce({
|
|
164
|
+
[t(x)()]: !0,
|
|
165
|
+
[t(x)("un")]: n.value === 1,
|
|
166
|
+
[t(G) ?? ""]: !0
|
|
166
167
|
}),
|
|
167
|
-
onClick:
|
|
168
|
+
onClick: Z,
|
|
168
169
|
onDragenter: O,
|
|
169
|
-
onDragover:
|
|
170
|
+
onDragover: ee,
|
|
170
171
|
onDragleave: O,
|
|
171
172
|
onDrop: te
|
|
172
173
|
}, [
|
|
@@ -175,53 +176,53 @@ const De = ["accept"], Fe = {
|
|
|
175
176
|
ref: v,
|
|
176
177
|
style: { display: "none" },
|
|
177
178
|
type: "file",
|
|
178
|
-
accept:
|
|
179
|
-
onChange:
|
|
180
|
-
}, null, 40,
|
|
181
|
-
n.value === 1 ? (h(),
|
|
179
|
+
accept: t(_),
|
|
180
|
+
onChange: oe
|
|
181
|
+
}, null, 40, Fe),
|
|
182
|
+
n.value === 1 ? (h(), N("div", Se, [
|
|
182
183
|
r("img", {
|
|
183
184
|
class: "state-un-icon",
|
|
184
|
-
src:
|
|
185
|
-
}, null, 8,
|
|
186
|
-
r("div", Ee,
|
|
187
|
-
r("div",
|
|
188
|
-
|
|
189
|
-
)},${
|
|
190
|
-
maxSize:
|
|
185
|
+
src: t(q)
|
|
186
|
+
}, null, 8, Ne),
|
|
187
|
+
r("div", Ee, b(t(K)), 1),
|
|
188
|
+
r("div", be, b(typeof t(y) == "string" && t(y).length > 0 ? t(y) : `${t(s)("ap.apUpload.supportExtension")}:${t(_e)(
|
|
189
|
+
t(_)
|
|
190
|
+
)},${t(s)("ap.apUpload.maxWarnUploadFileSize", {
|
|
191
|
+
maxSize: t(k)
|
|
191
192
|
})}`), 1)
|
|
192
|
-
])) :
|
|
193
|
-
[2, 3].includes(n.value) ? (h(),
|
|
193
|
+
])) : E("", !0),
|
|
194
|
+
[2, 3].includes(n.value) ? (h(), N("div", xe, [
|
|
194
195
|
r("div", ze, [
|
|
195
|
-
r("img", { src:
|
|
196
|
+
r("img", { src: t(q) }, null, 8, Ae)
|
|
196
197
|
]),
|
|
197
|
-
r("div",
|
|
198
|
+
r("div", Re, [
|
|
198
199
|
r("div", {
|
|
199
200
|
class: "center-title",
|
|
200
|
-
style:
|
|
201
|
+
style: ue({
|
|
201
202
|
color: T.value ? "#0070FF" : "#182948"
|
|
202
203
|
})
|
|
203
|
-
},
|
|
204
|
-
r("div",
|
|
205
|
-
T.value ?
|
|
204
|
+
}, b(l.value?.name), 5),
|
|
205
|
+
r("div", Be, [
|
|
206
|
+
T.value ? E("", !0) : (h(), pe(t(ke), {
|
|
206
207
|
key: 0,
|
|
207
208
|
percent: d.value,
|
|
208
209
|
size: 4,
|
|
209
210
|
"show-info": !1,
|
|
210
|
-
"trail-color":
|
|
211
|
-
"stroke-color":
|
|
211
|
+
"trail-color": t(A).borderColorBase,
|
|
212
|
+
"stroke-color": t(A).colorPrimary
|
|
212
213
|
}, null, 8, ["percent", "trail-color", "stroke-color"]))
|
|
213
214
|
])
|
|
214
215
|
]),
|
|
215
216
|
r("div", {
|
|
216
217
|
class: "right",
|
|
217
|
-
onClick:
|
|
218
|
+
onClick: de(le, ["stop"])
|
|
218
219
|
}, [
|
|
219
|
-
|
|
220
|
+
ve(t(ye))
|
|
220
221
|
])
|
|
221
|
-
])) :
|
|
222
|
+
])) : E("", !0)
|
|
222
223
|
], 34));
|
|
223
224
|
}
|
|
224
225
|
});
|
|
225
226
|
export {
|
|
226
|
-
|
|
227
|
+
Je as default
|
|
227
228
|
};
|
|
@@ -4,13 +4,14 @@ import { Ref } from 'vue';
|
|
|
4
4
|
export type { Oss } from '@aplus-frontend/oss';
|
|
5
5
|
export type GetOssAccess = () => Promise<accessCreate>;
|
|
6
6
|
export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
|
|
7
|
-
declare function put({ file, dirName, oss, successCallBack, errorCallBack, progressCallBack }: {
|
|
7
|
+
declare function put({ file, dirName, oss, successCallBack, errorCallBack, progressCallBack, baseDirName }: {
|
|
8
8
|
file: File;
|
|
9
9
|
dirName: string;
|
|
10
10
|
oss: Oss;
|
|
11
11
|
successCallBack: (saveUrl: string, previewUrl: string) => void;
|
|
12
12
|
errorCallBack: (msg: string) => void;
|
|
13
13
|
progressCallBack: (p: number) => void;
|
|
14
|
+
baseDirName?: string;
|
|
14
15
|
}): Promise<void>;
|
|
15
16
|
export declare function useOss(): {
|
|
16
17
|
client: Oss;
|
|
@@ -1,80 +1,82 @@
|
|
|
1
|
-
import { client as i, createOssInstance as
|
|
2
|
-
let
|
|
3
|
-
function
|
|
4
|
-
|
|
1
|
+
import { client as i, createOssInstance as w } from "@aplus-frontend/oss";
|
|
2
|
+
let n, l;
|
|
3
|
+
function U(e, s) {
|
|
4
|
+
n = e, l = s;
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const g = {
|
|
7
7
|
"zh-cn": "zh_CN",
|
|
8
8
|
en: "en_US"
|
|
9
9
|
};
|
|
10
10
|
function p() {
|
|
11
|
-
return
|
|
11
|
+
return g[l.value] ?? "zh_CN";
|
|
12
12
|
}
|
|
13
|
-
async function
|
|
13
|
+
async function d({
|
|
14
14
|
file: e,
|
|
15
15
|
dirName: s,
|
|
16
|
-
oss:
|
|
16
|
+
oss: t,
|
|
17
17
|
successCallBack: c,
|
|
18
18
|
errorCallBack: o,
|
|
19
|
-
progressCallBack: u
|
|
19
|
+
progressCallBack: u,
|
|
20
|
+
baseDirName: f = "Frontend-Upload"
|
|
20
21
|
}) {
|
|
21
22
|
if (!s) {
|
|
22
23
|
o("required dirName");
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
try {
|
|
26
|
-
const a = await
|
|
27
|
+
const a = await t.put({
|
|
27
28
|
fileName: e.name,
|
|
28
29
|
dirName: s,
|
|
29
30
|
data: e,
|
|
30
31
|
progressCallBack: (r) => {
|
|
31
32
|
u(r);
|
|
32
|
-
}
|
|
33
|
+
},
|
|
34
|
+
baseDirName: f
|
|
33
35
|
});
|
|
34
36
|
if (a.status === 204)
|
|
35
37
|
return;
|
|
36
38
|
if (a.status === 200) {
|
|
37
|
-
const { saveUrl: r, previewUrl:
|
|
38
|
-
c(r,
|
|
39
|
+
const { saveUrl: r, previewUrl: m } = a;
|
|
40
|
+
c(r, m);
|
|
39
41
|
} else
|
|
40
|
-
o(a?.message ||
|
|
42
|
+
o(a?.message || n("ap.apUpload.networkAnomaly"));
|
|
41
43
|
} catch (a) {
|
|
42
44
|
o(a);
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
function O() {
|
|
46
|
-
return { client: i, put:
|
|
48
|
+
return { client: i, put: d };
|
|
47
49
|
}
|
|
48
50
|
async function h(e) {
|
|
49
51
|
if (!e)
|
|
50
|
-
throw new Error(`${
|
|
52
|
+
throw new Error(`${n("ap.apUpload.pleasePass")}getOssAccess`);
|
|
51
53
|
return await i.initOssClient({
|
|
52
54
|
getOssAccess: e,
|
|
53
55
|
locale: p(),
|
|
54
56
|
onFailure: (s) => {
|
|
55
57
|
throw new Error(
|
|
56
|
-
typeof s?.message == "string" ? s.message :
|
|
58
|
+
typeof s?.message == "string" ? s.message : n("ap.apUpload.FailedToObtainOssTemporaryPermissions")
|
|
57
59
|
);
|
|
58
60
|
}
|
|
59
61
|
}), O();
|
|
60
62
|
}
|
|
61
|
-
async function
|
|
63
|
+
async function F(e) {
|
|
62
64
|
if (!e)
|
|
63
|
-
throw new Error(`${
|
|
64
|
-
const s =
|
|
65
|
+
throw new Error(`${n("ap.apUpload.pleasePass")}getOssAccess`);
|
|
66
|
+
const s = w();
|
|
65
67
|
return await s.initOssClient({
|
|
66
68
|
getOssAccess: e,
|
|
67
69
|
locale: p(),
|
|
68
|
-
onFailure: (
|
|
70
|
+
onFailure: (t) => {
|
|
69
71
|
throw new Error(
|
|
70
|
-
typeof
|
|
72
|
+
typeof t?.message == "string" ? t.message : n("ap.apUpload.FailedToObtainOssTemporaryPermissions")
|
|
71
73
|
);
|
|
72
74
|
}
|
|
73
75
|
}), s;
|
|
74
76
|
}
|
|
75
77
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
F as getOssInstance,
|
|
79
|
+
U as injectLocaleToOss,
|
|
78
80
|
O as useOss,
|
|
79
81
|
h as useOssInit
|
|
80
82
|
};
|
|
@@ -139,7 +139,7 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
139
139
|
allowClear: boolean;
|
|
140
140
|
}> & Omit<Readonly< ApFieldTextProps> & Readonly<{
|
|
141
141
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
142
|
-
}>, "blur" | "focus" | "input" | "select" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")
|
|
142
|
+
}>, "blur" | "focus" | "input" | "select" | "setSelectionRange" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")> & ShallowUnwrapRef<{
|
|
143
143
|
focus: (options?: InputFocusOptions) => void;
|
|
144
144
|
blur: () => void;
|
|
145
145
|
input: any;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isUndefined as
|
|
1
|
+
import { defineComponent as z, ref as A, unref as s, useSlots as K, toRef as O, watch as G, nextTick as W, shallowRef as H, createBlock as U, openBlock as $, mergeProps as p, withCtx as c, createVNode as q, createSlots as J, renderList as Q, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
|
|
2
|
+
import { Table as M } from "@aplus-frontend/antdv";
|
|
3
|
+
import { ApForm as h } from "../ap-form/index.mjs";
|
|
4
|
+
import { isUndefined as ee, isNumber as d, cloneDeep as te, isArray as ae, omit as b } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as oe } from "../ap-form/context.mjs";
|
|
7
7
|
import "../utils/index.mjs";
|
|
8
|
-
import
|
|
9
|
-
import { scrollToRowIndex as
|
|
10
|
-
import { getModelValue as
|
|
11
|
-
import { useDevWarning as
|
|
12
|
-
import
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import { useGlobalConfig as
|
|
15
|
-
import { isDef as
|
|
16
|
-
const
|
|
8
|
+
import ne from "./hooks/use-get-columns.mjs";
|
|
9
|
+
import { scrollToRowIndex as le } from "./utils.mjs";
|
|
10
|
+
import { getModelValue as se } from "../ap-form/utils/get.mjs";
|
|
11
|
+
import { useDevWarning as re } from "../utils/warning.mjs";
|
|
12
|
+
import ie from "./style/index.mjs";
|
|
13
|
+
import { useNamespace as ue } from "../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
|
|
15
|
+
import { isDef as g } from "../utils/is.mjs";
|
|
16
|
+
const ve = /* @__PURE__ */ z({
|
|
17
17
|
name: "EditableTableFormItem",
|
|
18
18
|
__name: "form-item",
|
|
19
19
|
props: {
|
|
@@ -114,26 +114,26 @@ const Te = /* @__PURE__ */ A({
|
|
|
114
114
|
default: () => ({})
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
-
setup(
|
|
118
|
-
expose:
|
|
117
|
+
setup(w, {
|
|
118
|
+
expose: x
|
|
119
119
|
}) {
|
|
120
|
-
const o =
|
|
121
|
-
|
|
120
|
+
const o = w;
|
|
121
|
+
re("EditableTableFormItem")(!1, "breaking", "EditableTableFormItem has been EOL, Please use EditableAgGridFormItem(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
|
|
122
122
|
const {
|
|
123
123
|
internalInstance: i,
|
|
124
|
-
model:
|
|
125
|
-
} =
|
|
126
|
-
G(() =>
|
|
124
|
+
model: y
|
|
125
|
+
} = oe(), u = A(se(s(y), o.name) || []), C = K(), R = O(o, "name"), F = h.useWatch(R);
|
|
126
|
+
G(() => F.value, async (e) => {
|
|
127
127
|
await W(), u.value = e, o.onChange?.(e);
|
|
128
128
|
}, {
|
|
129
129
|
deep: !0
|
|
130
130
|
});
|
|
131
131
|
const {
|
|
132
|
-
b:
|
|
133
|
-
} =
|
|
134
|
-
function
|
|
132
|
+
b: B
|
|
133
|
+
} = ue("editable-table"), I = ie("editable-table"), m = H(), T = fe("valueTypeMap"), v = ne(o, T);
|
|
134
|
+
function D(e, n) {
|
|
135
135
|
const l = s(u)?.length || 0;
|
|
136
|
-
if (
|
|
136
|
+
if (g(o.maxLength) && l >= o.maxLength)
|
|
137
137
|
return;
|
|
138
138
|
const t = {
|
|
139
139
|
...e || {}
|
|
@@ -143,41 +143,41 @@ const Te = /* @__PURE__ */ A({
|
|
|
143
143
|
a[r] = [t];
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
ee(n) ? a[r].push(t) : a[r].splice(n, 0, t);
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
const l = s(u)?.length || 0, t =
|
|
151
|
-
if (
|
|
149
|
+
function E(e, n = "suffix") {
|
|
150
|
+
const l = s(u)?.length || 0, t = d(e) ? e : e.length;
|
|
151
|
+
if (g(o.maxLength) && l + t > o.maxLength)
|
|
152
152
|
return;
|
|
153
|
-
const a =
|
|
154
|
-
i?.setFieldValue(o.name, a, !0, (r,
|
|
155
|
-
if (!r[
|
|
156
|
-
r[
|
|
153
|
+
const a = d(e) ? new Array(e).fill(0).map(() => ({})) : te(e);
|
|
154
|
+
i?.setFieldValue(o.name, a, !0, (r, f) => {
|
|
155
|
+
if (!r[f]) {
|
|
156
|
+
r[f] = [...a];
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
n === "suffix" ? r[
|
|
159
|
+
n === "suffix" ? r[f].push(...a) : r[f].unshift(...a);
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const n = new Set(
|
|
162
|
+
function S(e) {
|
|
163
|
+
const n = new Set(d(e) ? [e] : e);
|
|
164
164
|
i?.setFieldValue(o.name, void 0, !0, (l, t) => {
|
|
165
165
|
l[t] = l[t].filter((a, r) => !n.has(r));
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const n = new Set(
|
|
168
|
+
function L(e) {
|
|
169
|
+
const n = new Set(ae(e) ? e : [e]);
|
|
170
170
|
n.size !== 0 && i?.setFieldValue?.(o.name, void 0, !0, (l, t) => {
|
|
171
171
|
l[t] = l[t].filter((a) => !n.has(a[o.rowKey]));
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function V() {
|
|
175
175
|
return s(u);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function k(e) {
|
|
178
178
|
return s(u)?.[e];
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function N(e, n, l = !0) {
|
|
181
181
|
i?.setFieldValue(o.name, void 0, !0, (t, a) => {
|
|
182
182
|
!t[a] || !t[a][e] || (t[a][e] = {
|
|
183
183
|
...l ? t[a][e] : {},
|
|
@@ -185,47 +185,47 @@ const Te = /* @__PURE__ */ A({
|
|
|
185
185
|
});
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function _(e) {
|
|
189
189
|
i?.setFieldValue(o.name, e);
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function P(e, n) {
|
|
192
192
|
const l = e === "end" ? u.value.length - 1 : e;
|
|
193
|
-
|
|
193
|
+
le(l, m.value?.$el, n);
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function j() {
|
|
196
196
|
i?.setFieldValue?.(o.name, []);
|
|
197
197
|
}
|
|
198
|
-
return
|
|
199
|
-
add:
|
|
200
|
-
remove:
|
|
201
|
-
getRowData:
|
|
202
|
-
getRowsData:
|
|
203
|
-
setRowData:
|
|
204
|
-
addMultiple:
|
|
205
|
-
scrollTo:
|
|
206
|
-
setTableData:
|
|
207
|
-
clear:
|
|
208
|
-
removeByKey:
|
|
209
|
-
}), (e, n) => (
|
|
198
|
+
return x({
|
|
199
|
+
add: D,
|
|
200
|
+
remove: S,
|
|
201
|
+
getRowData: k,
|
|
202
|
+
getRowsData: V,
|
|
203
|
+
setRowData: N,
|
|
204
|
+
addMultiple: E,
|
|
205
|
+
scrollTo: P,
|
|
206
|
+
setTableData: _,
|
|
207
|
+
clear: j,
|
|
208
|
+
removeByKey: L
|
|
209
|
+
}), (e, n) => ($(), U(s(h).FormItem, p(e.formItem, {
|
|
210
210
|
name: e.name,
|
|
211
211
|
label: e.label
|
|
212
212
|
}), {
|
|
213
|
-
default:
|
|
213
|
+
default: c(() => [q(s(M), p(s(b)(o, ["name", "maxLength", "onChange"]), {
|
|
214
214
|
ref_key: "tableRef",
|
|
215
215
|
ref: m,
|
|
216
|
-
class: [s(
|
|
217
|
-
columns: s(
|
|
216
|
+
class: [s(B)(), s(I)],
|
|
217
|
+
columns: s(v),
|
|
218
218
|
"data-source": u.value
|
|
219
|
-
}),
|
|
219
|
+
}), J({
|
|
220
220
|
_: 2
|
|
221
|
-
}, [
|
|
221
|
+
}, [Q(s(b)(C, ["headerCell"]), (l, t) => ({
|
|
222
222
|
name: t,
|
|
223
|
-
fn:
|
|
223
|
+
fn: c((a) => [X(e.$slots, t, Y(Z(a || {})))])
|
|
224
224
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
225
225
|
_: 3
|
|
226
226
|
}, 16, ["name", "label"]));
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
229
|
export {
|
|
230
|
-
|
|
230
|
+
ve as default
|
|
231
231
|
};
|