@aplus-frontend/ui 0.1.25 → 0.1.26
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/ap-form-item.vue.mjs +26 -26
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +91 -89
- package/es/src/ap-upload/components/Picture.vue2.mjs +114 -112
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +10 -7
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +114 -84
- package/es/src/business/ap-ladder/interface.d.ts +42 -0
- package/es/src/business/ap-ladder/interface.mjs +10 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +6 -1
- package/es/src/business/hooks/usePageListApTable.mjs +27 -17
- package/es/src/business/hooks/useTableRefresh.d.ts +3 -4
- package/es/src/business/hooks/useTableRefresh.mjs +9 -9
- package/es/src/business/index.d.ts +3 -3
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/interface.d.ts +42 -0
- package/lib/src/business/ap-ladder/interface.js +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +6 -1
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/business/hooks/useTableRefresh.d.ts +3 -4
- package/lib/src/business/hooks/useTableRefresh.js +1 -1
- package/lib/src/business/index.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as $, useSlots as j, ref as f, onMounted as q, computed as B, unref as l, watch as E, cloneVNode as K, openBlock as g, createBlock as
|
|
1
|
+
import { defineComponent as $, useSlots as j, ref as f, onMounted as q, computed as B, unref as l, watch as E, cloneVNode as K, openBlock as g, createBlock as V, mergeProps as Q, createSlots as U, withCtx as i, resolveDynamicComponent as G, createCommentVNode as H, createElementVNode as C, normalizeClass as J, createVNode as k, normalizeStyle as M, toDisplayString as W, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as ee } from "vue";
|
|
2
2
|
import { Form as oe, Tooltip as le } from "ant-design-vue";
|
|
3
3
|
import { useToken as te } from "ant-design-vue/es/theme/internal";
|
|
4
|
-
import { isFunction as ae,
|
|
5
|
-
import { apFormItemColPropKeys as
|
|
6
|
-
import { QuestionCircleOutlined as
|
|
4
|
+
import { isFunction as ae, cloneDeep as re, isArray as ne, omit as N } from "lodash-unified";
|
|
5
|
+
import { apFormItemColPropKeys as ie } from "./constant.mjs";
|
|
6
|
+
import { QuestionCircleOutlined as ue } from "@ant-design/icons-vue";
|
|
7
7
|
import "../config-provider/index.mjs";
|
|
8
|
-
import { useInjectForm as
|
|
8
|
+
import { useInjectForm as se } from "./context.mjs";
|
|
9
9
|
import "./style/ap-form-item.css";
|
|
10
|
-
import { isPromise as
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
const
|
|
10
|
+
import { isPromise as de } from "@fruits-chain/utils";
|
|
11
|
+
import { useNamespace as me } from "../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
const fe = ["title"], ke = /* @__PURE__ */ $({
|
|
13
13
|
name: "ApFormItem",
|
|
14
14
|
__name: "ap-form-item",
|
|
15
15
|
props: {
|
|
@@ -54,15 +54,15 @@ const me = ["title"], Ve = /* @__PURE__ */ $({
|
|
|
54
54
|
},
|
|
55
55
|
setup(P, { expose: S }) {
|
|
56
56
|
var b, F;
|
|
57
|
-
const o = P, t = j(), { model: u, updateModel: s, internalInstance: d } =
|
|
57
|
+
const o = P, t = j(), { model: u, updateModel: s, internalInstance: d } = se(), { m: p, b: w } = me("ap-form-item"), m = f(!1), a = f(), [, x] = te();
|
|
58
58
|
q(async () => {
|
|
59
59
|
let e = ae(o.initialValue) ? o.initialValue() : o.initialValue;
|
|
60
|
-
|
|
60
|
+
de(e) && (e = await e), d == null || d.registerField({
|
|
61
61
|
name: o.name,
|
|
62
|
-
initialValue: e
|
|
62
|
+
initialValue: re(e)
|
|
63
63
|
});
|
|
64
64
|
});
|
|
65
|
-
const c = B(() => o.name ?
|
|
65
|
+
const c = B(() => o.name ? ne(o.name) ? o.name.reduce((e, r) => e == null ? void 0 : e[r], l(u)) : u == null ? void 0 : u.value[o.name] : null), v = f((F = (b = t.default) == null ? void 0 : b.call(t)) == null ? void 0 : F[0]);
|
|
66
66
|
E(
|
|
67
67
|
() => {
|
|
68
68
|
var e;
|
|
@@ -98,15 +98,15 @@ const me = ["title"], Ve = /* @__PURE__ */ $({
|
|
|
98
98
|
var e;
|
|
99
99
|
(e = a.value) == null || e.onFieldBlur();
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function D() {
|
|
102
102
|
var e;
|
|
103
103
|
(e = a.value) == null || e.onFieldChange();
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function R() {
|
|
106
106
|
var e;
|
|
107
107
|
(e = a.value) == null || e.clearValidate();
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function T() {
|
|
110
110
|
var e;
|
|
111
111
|
(e = a.value) == null || e.resetField();
|
|
112
112
|
}
|
|
@@ -115,14 +115,14 @@ const me = ["title"], Ve = /* @__PURE__ */ $({
|
|
|
115
115
|
}
|
|
116
116
|
return S({
|
|
117
117
|
onFieldBlur: A,
|
|
118
|
-
onFieldChange:
|
|
119
|
-
clearValidate:
|
|
120
|
-
resetField:
|
|
118
|
+
onFieldChange: D,
|
|
119
|
+
clearValidate: R,
|
|
120
|
+
resetField: T,
|
|
121
121
|
getFieldValue: L
|
|
122
|
-
}), (e, r) => (g(),
|
|
122
|
+
}), (e, r) => (g(), V(l(oe).Item, Q({
|
|
123
123
|
ref_key: "formItemRef",
|
|
124
124
|
ref: a
|
|
125
|
-
}, l(N)(o, [...l(
|
|
125
|
+
}, l(N)(o, [...l(ie), "tooltip", "label"]), {
|
|
126
126
|
class: {
|
|
127
127
|
[l(p)("bordered")]: e.bordered,
|
|
128
128
|
[l(p)("focused")]: e.bordered && m.value,
|
|
@@ -131,21 +131,21 @@ const me = ["title"], Ve = /* @__PURE__ */ $({
|
|
|
131
131
|
colon: e.bordered ? !1 : o.colon
|
|
132
132
|
}), U({
|
|
133
133
|
default: i(() => [
|
|
134
|
-
y.value ? (g(),
|
|
134
|
+
y.value ? (g(), V(G(y.value), { key: 0 })) : H("", !0)
|
|
135
135
|
]),
|
|
136
136
|
_: 2
|
|
137
137
|
}, [
|
|
138
138
|
o.tooltip ? {
|
|
139
139
|
name: "tooltip",
|
|
140
140
|
fn: i(({ class: n }) => [
|
|
141
|
-
|
|
141
|
+
C("span", {
|
|
142
142
|
class: J(n)
|
|
143
143
|
}, [
|
|
144
144
|
k(l(le), {
|
|
145
145
|
title: o.tooltip
|
|
146
146
|
}, {
|
|
147
147
|
default: i(() => [
|
|
148
|
-
k(l(
|
|
148
|
+
k(l(ue), {
|
|
149
149
|
style: M({ color: l(x).colorPrimary })
|
|
150
150
|
}, null, 8, ["style"])
|
|
151
151
|
]),
|
|
@@ -158,14 +158,14 @@ const me = ["title"], Ve = /* @__PURE__ */ $({
|
|
|
158
158
|
e.label ? {
|
|
159
159
|
name: "label",
|
|
160
160
|
fn: i(() => [
|
|
161
|
-
|
|
161
|
+
C("span", {
|
|
162
162
|
title: e.label,
|
|
163
163
|
style: {
|
|
164
164
|
whiteSpace: "nowrap",
|
|
165
165
|
overflow: "hidden",
|
|
166
166
|
textOverflow: "ellipsis"
|
|
167
167
|
}
|
|
168
|
-
}, W(e.label), 9,
|
|
168
|
+
}, W(e.label), 9, fe)
|
|
169
169
|
]),
|
|
170
170
|
key: "1"
|
|
171
171
|
} : void 0,
|
|
@@ -179,5 +179,5 @@ const me = ["title"], Ve = /* @__PURE__ */ $({
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
export {
|
|
182
|
-
|
|
182
|
+
ke as default
|
|
183
183
|
};
|
|
@@ -1,81 +1,83 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as $, inject as n, ref as j, watch as W, nextTick as G, openBlock as x, createElementBlock as C, normalizeClass as H, unref as s, createVNode as _, withCtx as b, createElementVNode as L, createTextVNode as J, toDisplayString as S, withModifiers as K, createBlock as Q, resolveDynamicComponent as V, createCommentVNode as X } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as
|
|
4
|
-
import { useOss as
|
|
5
|
-
import { message as
|
|
6
|
-
import { UploadOutlined as
|
|
7
|
-
import { fileMatchesAccept as
|
|
3
|
+
import { getPath as Y, getName as Z, getReturnData as y } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as ee, getOssInstance as te } from "../hooks/useOss.mjs";
|
|
5
|
+
import { message as c, Upload as oe, Button as ae } from "ant-design-vue";
|
|
6
|
+
import { UploadOutlined as se } from "@ant-design/icons-vue";
|
|
7
|
+
import { fileMatchesAccept as ne, getAcceptText as ie } from "../utils/accept.mjs";
|
|
8
8
|
import "../styles/multiple-file.css";
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
const
|
|
9
|
+
import { useLocale as re } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 }, _e = /* @__PURE__ */ $({
|
|
12
12
|
__name: "MultipleFile",
|
|
13
|
-
setup(
|
|
14
|
-
const { t: i } =
|
|
15
|
-
|
|
13
|
+
setup(me) {
|
|
14
|
+
const { t: i } = re(), { b: U } = le("ap-upload-multiple-file"), { put: B } = ee(), I = n("theme"), P = n("dirName"), w = n("accept") || "*", A = n("maxSize") ?? 500, z = n("title") || i("ap.apUpload.uploadFile"), h = n("subTitle"), r = n("maxCount") ?? 10, m = n("uploadingCount"), F = n("beforeUpload"), N = n("customRequest"), R = n("getOssAccess"), a = n("value"), g = [], d = n("needName"), p = j(null);
|
|
15
|
+
W(
|
|
16
16
|
() => a == null ? void 0 : a.value,
|
|
17
17
|
function(e) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
var t, o;
|
|
19
|
+
!((o = (t = p == null ? void 0 : p.value) == null ? void 0 : t.fileList) != null && o.length) && e && G(() => {
|
|
20
|
+
const l = e.map((u) => {
|
|
21
|
+
const E = Y(d, u), M = Z(d, u), k = new File(
|
|
22
|
+
[u],
|
|
23
|
+
M,
|
|
23
24
|
{}
|
|
24
25
|
);
|
|
25
|
-
return k.response =
|
|
26
|
+
return k.response = E, k.uid = E, k;
|
|
26
27
|
});
|
|
27
|
-
if (
|
|
28
|
-
|
|
28
|
+
if (r && l.length > r) {
|
|
29
|
+
c.warning(
|
|
29
30
|
i("ap.apUpload.fileInitializationException", {
|
|
30
|
-
maxCount:
|
|
31
|
+
maxCount: r
|
|
31
32
|
})
|
|
32
33
|
);
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
uid:
|
|
38
|
-
path:
|
|
36
|
+
l.forEach((u) => {
|
|
37
|
+
f.push(u), g.push({
|
|
38
|
+
uid: u.uid,
|
|
39
|
+
path: u.response
|
|
39
40
|
});
|
|
40
|
-
}),
|
|
41
|
+
}), p.value.fileList = l;
|
|
41
42
|
});
|
|
42
|
-
}
|
|
43
|
+
},
|
|
44
|
+
{ immediate: !0 }
|
|
43
45
|
);
|
|
44
|
-
let
|
|
45
|
-
function
|
|
46
|
+
let f = [], T;
|
|
47
|
+
function v(e) {
|
|
46
48
|
setTimeout(() => {
|
|
47
|
-
const t =
|
|
49
|
+
const t = p.value.fileList.findIndex(
|
|
48
50
|
(o) => o.uid === e.uid
|
|
49
51
|
);
|
|
50
|
-
t >= 0 &&
|
|
52
|
+
t >= 0 && p.value.fileList.splice(t, 1);
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
|
-
function
|
|
54
|
-
if (
|
|
55
|
+
function O(e) {
|
|
56
|
+
if (r && r > 1 && f.length >= r)
|
|
55
57
|
return clearTimeout(T), T = setTimeout(() => {
|
|
56
|
-
|
|
58
|
+
c.warning(
|
|
57
59
|
i("ap.apUpload.maxUploadFiles", {
|
|
58
|
-
maxCount:
|
|
60
|
+
maxCount: r
|
|
59
61
|
})
|
|
60
62
|
);
|
|
61
|
-
}),
|
|
63
|
+
}), v(e), !1;
|
|
62
64
|
if (typeof F == "function") {
|
|
63
65
|
if (F(e) === !1)
|
|
64
|
-
return
|
|
66
|
+
return v(e), !1;
|
|
65
67
|
} else {
|
|
66
68
|
if (e.size > A * 1024 * 1024)
|
|
67
|
-
return
|
|
69
|
+
return c.warning(
|
|
68
70
|
i("ap.apUpload.maxUploadFileSize", {
|
|
69
71
|
maxSize: A
|
|
70
72
|
})
|
|
71
|
-
),
|
|
72
|
-
if (!
|
|
73
|
-
return
|
|
73
|
+
), v(e), !1;
|
|
74
|
+
if (!ne(e, w))
|
|
75
|
+
return c.warning(i("ap.apUpload.fileFormatNotSupported")), v(e), !1;
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
r && r === 1 && (f = [], a.value = void 0), f.push(e);
|
|
76
78
|
}
|
|
77
|
-
async function
|
|
78
|
-
if (
|
|
79
|
+
async function q(e) {
|
|
80
|
+
if (m.value++, typeof N == "function") {
|
|
79
81
|
N({
|
|
80
82
|
onProgress: (t) => {
|
|
81
83
|
setTimeout(() => {
|
|
@@ -85,50 +87,50 @@ const le = { class: "multiple-file-context" }, re = { key: 0 }, pe = { key: 1 },
|
|
|
85
87
|
});
|
|
86
88
|
},
|
|
87
89
|
onError: (t) => {
|
|
88
|
-
|
|
90
|
+
c.warning(t || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
89
91
|
e.onError({
|
|
90
92
|
name: t,
|
|
91
93
|
message: t
|
|
92
94
|
});
|
|
93
|
-
}),
|
|
95
|
+
}), m.value--;
|
|
94
96
|
},
|
|
95
97
|
onSuccess: (t) => {
|
|
96
98
|
setTimeout(() => {
|
|
97
99
|
e.onSuccess(t);
|
|
98
100
|
}), a.value ? a.value.push(
|
|
99
|
-
|
|
101
|
+
y(d, t, e.file.name)
|
|
100
102
|
) : a.value = [
|
|
101
|
-
|
|
102
|
-
],
|
|
103
|
+
y(d, t, e.file.name)
|
|
104
|
+
], g.push({
|
|
103
105
|
uid: e.file.uid,
|
|
104
106
|
path: t
|
|
105
|
-
}),
|
|
107
|
+
}), m.value--;
|
|
106
108
|
},
|
|
107
109
|
file: e.file
|
|
108
110
|
});
|
|
109
111
|
return;
|
|
110
112
|
}
|
|
111
113
|
try {
|
|
112
|
-
const t = await
|
|
113
|
-
e.file.oss = t,
|
|
114
|
+
const t = await te(R);
|
|
115
|
+
e.file.oss = t, B({
|
|
114
116
|
file: e.file,
|
|
115
|
-
dirName:
|
|
117
|
+
dirName: P,
|
|
116
118
|
oss: t,
|
|
117
119
|
successCallBack(o) {
|
|
118
120
|
e.onSuccess(o), a.value ? a.value.push(
|
|
119
|
-
|
|
121
|
+
y(d, o, e.file.name)
|
|
120
122
|
) : a.value = [
|
|
121
|
-
|
|
122
|
-
],
|
|
123
|
+
y(d, o, e.file.name)
|
|
124
|
+
], g.push({
|
|
123
125
|
uid: e.file.uid,
|
|
124
126
|
path: o
|
|
125
|
-
}),
|
|
127
|
+
}), m.value--;
|
|
126
128
|
},
|
|
127
129
|
errorCallBack(o) {
|
|
128
|
-
|
|
130
|
+
c.warning(o || i("ap.apUpload.networkAnomaly")), e.onError({
|
|
129
131
|
name: o,
|
|
130
132
|
message: o
|
|
131
|
-
}),
|
|
133
|
+
}), m.value--;
|
|
132
134
|
},
|
|
133
135
|
progressCallBack(o) {
|
|
134
136
|
e.onProgress({
|
|
@@ -137,66 +139,66 @@ const le = { class: "multiple-file-context" }, re = { key: 0 }, pe = { key: 1 },
|
|
|
137
139
|
}
|
|
138
140
|
});
|
|
139
141
|
} catch (t) {
|
|
140
|
-
|
|
142
|
+
c.warning(
|
|
141
143
|
typeof (t == null ? void 0 : t.message) == "string" ? t.message : i("ap.apUpload.networkAnomaly")
|
|
142
144
|
), e.onError({
|
|
143
145
|
name: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly"),
|
|
144
146
|
message: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly")
|
|
145
|
-
}),
|
|
147
|
+
}), m.value--;
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
|
-
function
|
|
150
|
+
function D(e) {
|
|
149
151
|
var o;
|
|
150
152
|
if (e.response) {
|
|
151
153
|
if (Array.isArray(a.value)) {
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
+
const l = g.findIndex((u) => u.uid === e.uid);
|
|
155
|
+
l >= 0 && (a == null || a.value.splice(l, 1), g.splice(l, 1)), a.value.length === 0 && (a.value = void 0);
|
|
154
156
|
}
|
|
155
157
|
} else
|
|
156
158
|
(o = e == null ? void 0 : e.oss) == null || o.pauseUpload();
|
|
157
|
-
const t =
|
|
158
|
-
(
|
|
159
|
+
const t = f.findIndex(
|
|
160
|
+
(l) => l.uid === e.uid
|
|
159
161
|
);
|
|
160
|
-
return
|
|
162
|
+
return f.splice(t, 1), Promise.resolve(!0);
|
|
161
163
|
}
|
|
162
|
-
return (e, t) => (
|
|
163
|
-
class:
|
|
164
|
+
return (e, t) => (x(), C("div", {
|
|
165
|
+
class: H({
|
|
164
166
|
[s(U)()]: !0,
|
|
165
|
-
[s(U)("admin")]: s(
|
|
167
|
+
[s(U)("admin")]: s(I) === "admin"
|
|
166
168
|
})
|
|
167
169
|
}, [
|
|
168
|
-
_(s(
|
|
170
|
+
_(s(oe), {
|
|
169
171
|
ref_key: "uploadRef",
|
|
170
|
-
ref:
|
|
171
|
-
accept: s(
|
|
172
|
+
ref: p,
|
|
173
|
+
accept: s(w),
|
|
172
174
|
multiple: "",
|
|
173
|
-
maxCount: s(
|
|
175
|
+
maxCount: s(r),
|
|
174
176
|
progress: {
|
|
175
177
|
strokeWidth: 3,
|
|
176
178
|
showInfo: !1,
|
|
177
179
|
strokeColor: "#0070FF"
|
|
178
180
|
},
|
|
179
|
-
beforeUpload:
|
|
180
|
-
customRequest:
|
|
181
|
-
onRemove:
|
|
181
|
+
beforeUpload: O,
|
|
182
|
+
customRequest: q,
|
|
183
|
+
onRemove: D
|
|
182
184
|
}, {
|
|
183
|
-
default:
|
|
184
|
-
|
|
185
|
-
_(s(
|
|
186
|
-
default:
|
|
187
|
-
_(s(
|
|
188
|
-
|
|
185
|
+
default: b(() => [
|
|
186
|
+
L("div", ue, [
|
|
187
|
+
_(s(ae), { class: "file-btn" }, {
|
|
188
|
+
default: b(() => [
|
|
189
|
+
_(s(se)),
|
|
190
|
+
J(" " + S(s(z)), 1)
|
|
189
191
|
]),
|
|
190
192
|
_: 1
|
|
191
193
|
}),
|
|
192
|
-
|
|
194
|
+
L("div", {
|
|
193
195
|
class: "sub-title",
|
|
194
|
-
onClick: t[0] || (t[0] =
|
|
196
|
+
onClick: t[0] || (t[0] = K(() => {
|
|
195
197
|
}, ["stop"]))
|
|
196
198
|
}, [
|
|
197
|
-
typeof s(
|
|
198
|
-
(
|
|
199
|
-
])) :
|
|
199
|
+
typeof s(h) == "string" ? (x(), C("div", pe, S(s(h) || `${s(i)("ap.apUpload.supportExtension")}:${s(ie)(s(w))}`), 1)) : s(h) ? (x(), C("div", ce, [
|
|
200
|
+
(x(), Q(V(s(h))))
|
|
201
|
+
])) : X("", !0)
|
|
200
202
|
])
|
|
201
203
|
])
|
|
202
204
|
]),
|
|
@@ -206,5 +208,5 @@ const le = { class: "multiple-file-context" }, re = { key: 0 }, pe = { key: 1 },
|
|
|
206
208
|
}
|
|
207
209
|
});
|
|
208
210
|
export {
|
|
209
|
-
|
|
211
|
+
_e as default
|
|
210
212
|
};
|