@aplus-frontend/ui 0.2.3 → 0.2.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-upload/apUpload.vue.d.ts +6 -0
- package/es/src/ap-upload/apUpload.vue.mjs +41 -38
- package/es/src/ap-upload/apUploadTypes.d.ts +12 -0
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +87 -85
- package/es/src/ap-upload/components/Picture.vue2.mjs +91 -89
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +74 -72
- package/es/src/business/ap-summary/ap-summary.vue.d.ts +3 -0
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +26 -22
- package/es/src/business/ap-summary/index.d.ts +19 -0
- package/es/src/business/ap-summary/interface.d.ts +1 -0
- package/es/src/business/ap-summary/utils.mjs +12 -12
- package/lib/src/ap-upload/apUpload.vue.d.ts +6 -0
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/ap-upload/apUploadTypes.d.ts +12 -0
- 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-summary/ap-summary.vue.d.ts +3 -0
- package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
- package/lib/src/business/ap-summary/index.d.ts +19 -0
- package/lib/src/business/ap-summary/interface.d.ts +1 -0
- package/lib/src/business/ap-summary/utils.js +1 -1
- package/package.json +5 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isNil as
|
|
3
|
-
import { TableSummaryRow as B, TableSummaryCell as
|
|
4
|
-
import { flattenColumns as
|
|
1
|
+
import { defineComponent as S, computed as g, openBlock as o, createBlock as u, unref as r, normalizeClass as i, withCtx as c, createElementBlock as T, Fragment as _, renderList as C, normalizeStyle as b, createTextVNode as L, toDisplayString as N } from "vue";
|
|
2
|
+
import { isNil as w, get as z } from "lodash-unified";
|
|
3
|
+
import { TableSummaryRow as B, TableSummaryCell as A } from "@aplus-frontend/antdv";
|
|
4
|
+
import { flattenColumns as D, formatDataIndex as F } from "./utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { isNumeric as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
const J = /* @__PURE__ */
|
|
6
|
+
import { isNumeric as I, toThousand as v, toFixed as E } from "@aplus-frontend/utils";
|
|
7
|
+
import { useNamespace as P } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
const J = /* @__PURE__ */ S({
|
|
9
9
|
name: "ApSummary",
|
|
10
10
|
__name: "ap-summary",
|
|
11
11
|
props: {
|
|
@@ -17,16 +17,19 @@ const J = /* @__PURE__ */ k({
|
|
|
17
17
|
hasSelect: {
|
|
18
18
|
type: Boolean,
|
|
19
19
|
default: !0
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
default: "middle"
|
|
20
23
|
}
|
|
21
24
|
},
|
|
22
25
|
setup(p) {
|
|
23
|
-
const s = p,
|
|
26
|
+
const s = p, d = (e) => e === 0, f = (e, n) => {
|
|
24
27
|
var l;
|
|
25
|
-
if (!e || !
|
|
28
|
+
if (!e || !I(e) || n.valueType !== "number")
|
|
26
29
|
return e;
|
|
27
|
-
const t = (l =
|
|
28
|
-
return (
|
|
29
|
-
},
|
|
30
|
+
const t = (l = n.fieldProps) == null ? void 0 : l.field, a = (t == null ? void 0 : t.precision) || 0;
|
|
31
|
+
return (w(t == null ? void 0 : t.thousands) ? !0 : t == null ? void 0 : t.thousands) ? v(e, a) : E(e, a);
|
|
32
|
+
}, y = g(() => {
|
|
30
33
|
let e = [];
|
|
31
34
|
s.hasSelect && e.push({
|
|
32
35
|
key: "select",
|
|
@@ -34,29 +37,30 @@ const J = /* @__PURE__ */ k({
|
|
|
34
37
|
align: "left",
|
|
35
38
|
value: ""
|
|
36
39
|
});
|
|
37
|
-
const t =
|
|
40
|
+
const t = D(s.columns).map((a, m) => ({
|
|
38
41
|
key: a.key,
|
|
39
42
|
rowSpan: 1,
|
|
40
43
|
align: a.align,
|
|
41
|
-
value:
|
|
44
|
+
value: d(m) ? s.summaryTitle : f(z(s.data, F(a.dataIndex || a.key)), a)
|
|
42
45
|
}));
|
|
43
46
|
return e.concat(t);
|
|
44
47
|
}), {
|
|
45
48
|
b: h,
|
|
46
|
-
e: x
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
e: x,
|
|
50
|
+
em: k
|
|
51
|
+
} = P("ap-summary");
|
|
52
|
+
return (e, n) => (o(), u(r(B), {
|
|
53
|
+
class: i(r(h)())
|
|
50
54
|
}, {
|
|
51
|
-
default: c(() => [(o(!0),
|
|
52
|
-
class: i(
|
|
55
|
+
default: c(() => [(o(!0), T(_, null, C(y.value, (t, a) => (o(), u(r(A), {
|
|
56
|
+
class: i(`${s.size === "small" ? r(k)("item", "small") : r(x)("item")}`),
|
|
53
57
|
key: t.key,
|
|
54
58
|
index: a,
|
|
55
|
-
style:
|
|
59
|
+
style: b({
|
|
56
60
|
textAlign: t.align
|
|
57
61
|
})
|
|
58
62
|
}, {
|
|
59
|
-
default: c(() => [
|
|
63
|
+
default: c(() => [L(N(t.value), 1)]),
|
|
60
64
|
_: 2
|
|
61
65
|
}, 1032, ["class", "index", "style"]))), 128))]),
|
|
62
66
|
_: 1
|
|
@@ -4,6 +4,10 @@ export * from './interface';
|
|
|
4
4
|
export * from './utils';
|
|
5
5
|
declare const ApSummary: {
|
|
6
6
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
7
|
+
size: {
|
|
8
|
+
type: PropType<"small" | "middle">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
7
11
|
data: {
|
|
8
12
|
type: PropType<ValueType>;
|
|
9
13
|
};
|
|
@@ -20,6 +24,10 @@ declare const ApSummary: {
|
|
|
20
24
|
default: boolean;
|
|
21
25
|
};
|
|
22
26
|
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
27
|
+
size: {
|
|
28
|
+
type: PropType<"small" | "middle">;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
23
31
|
data: {
|
|
24
32
|
type: PropType<ValueType>;
|
|
25
33
|
};
|
|
@@ -36,6 +44,7 @@ declare const ApSummary: {
|
|
|
36
44
|
default: boolean;
|
|
37
45
|
};
|
|
38
46
|
}>>, {
|
|
47
|
+
size: "middle" | "small";
|
|
39
48
|
summaryTitle: string;
|
|
40
49
|
hasSelect: boolean;
|
|
41
50
|
}, true, {}, {}, {
|
|
@@ -46,6 +55,10 @@ declare const ApSummary: {
|
|
|
46
55
|
M: {};
|
|
47
56
|
Defaults: {};
|
|
48
57
|
}, Readonly< ExtractPropTypes<{
|
|
58
|
+
size: {
|
|
59
|
+
type: PropType<"small" | "middle">;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
49
62
|
data: {
|
|
50
63
|
type: PropType<ValueType>;
|
|
51
64
|
};
|
|
@@ -62,6 +75,7 @@ declare const ApSummary: {
|
|
|
62
75
|
default: boolean;
|
|
63
76
|
};
|
|
64
77
|
}>>, {}, {}, {}, {}, {
|
|
78
|
+
size: "middle" | "small";
|
|
65
79
|
summaryTitle: string;
|
|
66
80
|
hasSelect: boolean;
|
|
67
81
|
}>;
|
|
@@ -69,6 +83,10 @@ declare const ApSummary: {
|
|
|
69
83
|
__isTeleport?: never;
|
|
70
84
|
__isSuspense?: never;
|
|
71
85
|
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
86
|
+
size: {
|
|
87
|
+
type: PropType<"small" | "middle">;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
72
90
|
data: {
|
|
73
91
|
type: PropType<ValueType>;
|
|
74
92
|
};
|
|
@@ -85,6 +103,7 @@ declare const ApSummary: {
|
|
|
85
103
|
default: boolean;
|
|
86
104
|
};
|
|
87
105
|
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
106
|
+
size: "middle" | "small";
|
|
88
107
|
summaryTitle: string;
|
|
89
108
|
hasSelect: boolean;
|
|
90
109
|
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { flatten as k, uniqBy as j, isNil as I, get as
|
|
1
|
+
import { flatten as k, uniqBy as j, isNil as I, get as y, set as R } from "lodash-unified";
|
|
2
2
|
import { toThousand as V, toFixed as S, addNumber as T } from "@aplus-frontend/utils";
|
|
3
3
|
const b = (t) => {
|
|
4
4
|
var e, d;
|
|
5
5
|
return t != null && t.children && ((e = t == null ? void 0 : t.children) == null ? void 0 : e.length) > 0 ? k((d = t.children) == null ? void 0 : d.map((n) => b(n))) : [t];
|
|
6
6
|
}, q = (t) => k(
|
|
7
7
|
t == null ? void 0 : t.map((e) => b(e))
|
|
8
|
-
),
|
|
8
|
+
), c = (t) => Object.prototype.toString.call(t) === "[object Array]" ? t.map((e) => String(e)).join(".") : t ?? "", D = (t, e, d) => d ? V(t, e) : S(t, e);
|
|
9
9
|
function E(t) {
|
|
10
|
-
var
|
|
10
|
+
var h;
|
|
11
11
|
const { records: e, columns: d, configList: n, exclude: i } = t;
|
|
12
|
-
if (e.length === 0)
|
|
12
|
+
if (!e || (e == null ? void 0 : e.length) === 0)
|
|
13
13
|
return {};
|
|
14
|
-
const
|
|
15
|
-
let a = (
|
|
14
|
+
const f = q(d);
|
|
15
|
+
let a = (h = f == null ? void 0 : f.filter((r) => r.valueType === "number")) == null ? void 0 : h.map((r) => ({
|
|
16
16
|
key: r.key || "",
|
|
17
17
|
dataIndex: r.dataIndex
|
|
18
18
|
}));
|
|
@@ -20,17 +20,17 @@ function E(t) {
|
|
|
20
20
|
(r) => !i.includes(r.key)
|
|
21
21
|
));
|
|
22
22
|
const x = {};
|
|
23
|
-
return e.reduce((r,
|
|
24
|
-
var
|
|
25
|
-
if (!I(
|
|
26
|
-
const
|
|
27
|
-
R(r,
|
|
23
|
+
return e == null ? void 0 : e.reduce((r, p) => (a.forEach((o) => {
|
|
24
|
+
var s;
|
|
25
|
+
if (!I(y(p, c(o.dataIndex || o.key)))) {
|
|
26
|
+
const u = o.dataIndex || o.key, g = y(r, c(u)) || 0, l = y(p, c(u)) || 0, N = (s = T(g, l)) == null ? void 0 : s.toNumber();
|
|
27
|
+
R(r, u, +N);
|
|
28
28
|
}
|
|
29
29
|
}), r), x);
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
32
32
|
E as computedRecords,
|
|
33
33
|
q as flattenColumns,
|
|
34
|
-
|
|
34
|
+
c as formatDataIndex,
|
|
35
35
|
D as formatNumber
|
|
36
36
|
};
|
|
@@ -53,6 +53,9 @@ declare const __VLS_component: DefineComponent<{
|
|
|
53
53
|
type: PropType<GetOssAccess>;
|
|
54
54
|
};
|
|
55
55
|
onChange: FunctionConstructor;
|
|
56
|
+
maxSizeErrorMsg: StringConstructor;
|
|
57
|
+
maxCountErrorMsg: StringConstructor;
|
|
58
|
+
acceptErrorMsg: StringConstructor;
|
|
56
59
|
}, {
|
|
57
60
|
done: ComputedRef<boolean>;
|
|
58
61
|
clear: typeof clear;
|
|
@@ -101,6 +104,9 @@ declare const __VLS_component: DefineComponent<{
|
|
|
101
104
|
type: PropType<GetOssAccess>;
|
|
102
105
|
};
|
|
103
106
|
onChange: FunctionConstructor;
|
|
107
|
+
maxSizeErrorMsg: StringConstructor;
|
|
108
|
+
maxCountErrorMsg: StringConstructor;
|
|
109
|
+
acceptErrorMsg: StringConstructor;
|
|
104
110
|
}>> & {
|
|
105
111
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
106
112
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../config-provider/index.js");require("./components/SingleFile.vue.js");require("./components/MultipleFile.vue.js");require("./components/Picture.vue.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../config-provider/index.js");require("./components/SingleFile.vue.js");require("./components/MultipleFile.vue.js");require("./components/Picture.vue.js");const E=require("./utils/accept.js"),j=require("./hooks/useOss.js"),z=require("@aplus-frontend/antdv"),h=require("../config-provider/hooks/use-locale.js"),A=require("../config-provider/hooks/use-namespace.js"),U=require("./components/SingleFile.vue2.js"),k=require("./components/MultipleFile.vue2.js"),T=require("./components/Picture.vue2.js"),v=require("../config-provider/hooks/use-global-config.js"),B=e.defineComponent({name:"AplusFileUpload",__name:"apUpload",props:{dirName:{type:String},type:{type:String,default:"singleFile"},value:{type:[String,Object,Array],default:void 0},needName:{type:[Boolean,Object]},accept:{type:String},maxSize:{type:Number},title:{type:String,default:""},subTitle:{type:[String,Object],default:""},maxCount:{type:Number},beforeUpload:{type:Function},customRequest:{type:Function},getOssAccess:{type:Function},onChange:Function,maxSizeErrorMsg:String,maxCountErrorMsg:String,acceptErrorMsg:String},emits:["update:value"],setup(_,{expose:f,emit:y}){var p,d,m,g;const{t:i,lang:C}=h.useLocale();E.injectLocaleToAccept(i),j.injectLocaleToOss(i,C);const{b:S}=A.useNamespace("ap-upload"),n=e.ref(null),t=_,b=y,q={singleFile:U.default,multipleFile:k.default,picture:T.default},a=z.Form.useInjectFormItemContext(),M=e.computed({get(){return t.value},set(r){var o;b("update:value",r),a==null||a.onFieldChange(),(o=t.onChange)==null||o.call(t,r)}}),x=v.useGlobalConfig("uiMode"),s=v.useGlobalConfig("apUpload");e.provide("theme",x.value),e.provide("value",M),e.provide("dirName",t.dirName??((p=s.value)==null?void 0:p.dirName)),e.provide("needName",t.needName??((d=s.value)==null?void 0:d.needName)??!1),e.provide("accept",t.accept??((m=s.value)==null?void 0:m.accept)??""),e.provide("maxSize",t.maxSize),e.provide("title",t.title),e.provide("subTitle",t.subTitle),e.provide("maxCount",t.maxCount),e.provide("beforeUpload",t.beforeUpload),e.provide("customRequest",t.customRequest),e.provide("getOssAccess",t.getOssAccess??((g=s.value)==null?void 0:g.getOssAccess)),e.provide("maxSizeErrorMsg",t.maxSizeErrorMsg),e.provide("maxCountErrorMsg",t.maxCountErrorMsg),e.provide("acceptErrorMsg",t.acceptErrorMsg);const F=e.computed(()=>c.value===0),c=e.ref(0);e.provide("uploadingCount",c);function N(){l(void 0)}function l(r){var o,u;(u=(o=n==null?void 0:n.value)==null?void 0:o.setValue)==null||u.call(o,r)}return f({done:F,clear:N,setValue:l}),(r,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(S)())},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(q[t.type]),e.mergeProps(r.$attrs,{ref_key:"uploadRef",ref:n}),e.createSlots({_:2},[e.renderList(Object.keys(r.$slots),u=>({name:u,fn:e.withCtx(O=>[e.renderSlot(r.$slots,u,e.normalizeProps(e.guardReactiveProps(O||{})))])}))]),1040))],2))}});exports.default=B;
|
|
@@ -45,6 +45,18 @@ export type FileUploadProps = {
|
|
|
45
45
|
* 默认为name,path
|
|
46
46
|
*/
|
|
47
47
|
needName?: NeedNameModel;
|
|
48
|
+
/**
|
|
49
|
+
* 超出文件大小错误提示
|
|
50
|
+
*/
|
|
51
|
+
maxSizeErrorMsg?: string;
|
|
52
|
+
/**
|
|
53
|
+
* 超出文件数量错误提示
|
|
54
|
+
*/
|
|
55
|
+
maxCountErrorMsg?: string;
|
|
56
|
+
/**
|
|
57
|
+
* 文件类型错误提示
|
|
58
|
+
*/
|
|
59
|
+
acceptErrorMsg?: string;
|
|
48
60
|
};
|
|
49
61
|
export type SingleFileProps = FileUploadProps & {
|
|
50
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const v=require("../utils/returnData.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const v=require("../utils/returnData.js"),N=require("../hooks/useOss.js"),i=require("@aplus-frontend/antdv"),O=require("@ant-design/icons-vue"),U=require("../utils/accept.js"),R=require("../../config-provider/hooks/use-locale.js"),D=require("../../config-provider/hooks/use-namespace.js"),V={class:"multiple-file-context"},$={key:0},W={key:1},G=e.defineComponent({__name:"MultipleFile",setup(H,{expose:S}){const{t:o}=R.useLocale(),{b:y}=D.useNamespace("ap-upload-multiple-file"),{put:T}=N.useOss(),q=e.inject("theme"),A=e.inject("dirName"),x=e.inject("accept")||"*",w=e.inject("maxSize")??500,B=e.inject("title")||o("ap.apUpload.uploadFile"),m=e.inject("subTitle"),r=e.inject("maxCount")??10,d=e.inject("uploadingCount"),C=e.inject("beforeUpload"),E=e.inject("customRequest"),F=e.inject("getOssAccess"),M=e.inject("maxSizeErrorMsg"),b=e.inject("maxCountErrorMsg"),L=e.inject("acceptErrorMsg"),a=e.inject("value"),l=[],f=e.inject("needName"),c=e.ref(null);e.watch(()=>a==null?void 0:a.value,function(t){var n,s;!((s=(n=c==null?void 0:c.value)==null?void 0:n.fileList)!=null&&s.length)&&t&&j(t)},{immediate:!0});function j(t){if(!t){p=[],c.value.fileList=[],a.value=void 0,l.splice(0,l.length);return}e.nextTick(()=>{const n=t.map(s=>{const u=v.getPath(f,s),h=v.getName(f,s),k=new File([s],h,{});return k.response=u,k.uid=u,k});if(r&&n.length>r){i.message.warning(o("ap.apUpload.fileInitializationException",{maxCount:r}));return}n.forEach(s=>{p.push(s),l.push({uid:s.uid,path:s.response})}),c.value.fileList=n,a.value=t})}S({setValue:j});let p=[],_;function g(t){setTimeout(()=>{const n=c.value.fileList.findIndex(s=>s.uid===t.uid);n>=0&&c.value.fileList.splice(n,1)})}function z(t){if(r&&r>1&&p.length>=r)return clearTimeout(_),_=setTimeout(()=>{i.message.warning(b||o("ap.apUpload.maxUploadFiles",{maxCount:r}))}),g(t),!1;if(typeof C=="function"){if(C(t)===!1)return g(t),!1}else{if(t.size>w*1024*1024)return i.message.warning(M||o("ap.apUpload.maxUploadFileSize",{maxSize:w})),g(t),!1;if(!U.fileMatchesAccept(t,x))return i.message.warning(L||o("ap.apUpload.fileFormatNotSupported")),g(t),!1}r&&r===1&&(p=[],a.value=void 0),p.push(t)}async function I(t){if(d.value++,typeof E=="function"){E({onProgress:n=>{setTimeout(()=>{t.onProgress({percent:n})})},onError:n=>{i.message.warning(n||o("ap.apUpload.networkAnomaly")),setTimeout(()=>{t.onError({name:n,message:n})}),d.value--},onSuccess:n=>{setTimeout(()=>{t.onSuccess(n)}),a.value=[...a.value||[],v.getReturnData(f,n,t.file.name)],l.push({uid:t.file.uid,path:n}),d.value--},file:t.file});return}try{const n=await N.getOssInstance(F);t.file.oss=n,T({file:t.file,dirName:A,oss:n,successCallBack(s){t.onSuccess(s),a.value=[...a.value||[],v.getReturnData(f,s,t.file.name)],l.push({uid:t.file.uid,path:s}),d.value--},errorCallBack(s){i.message.warning(s||o("ap.apUpload.networkAnomaly")),t.onError({name:s,message:s}),d.value--},progressCallBack(s){t.onProgress({percent:s})}})}catch(n){i.message.warning(typeof(n==null?void 0:n.message)=="string"?n.message:o("ap.apUpload.networkAnomaly")),t.onError({name:(n==null?void 0:n.message)||o("ap.apUpload.networkAnomaly"),message:(n==null?void 0:n.message)||o("ap.apUpload.networkAnomaly")}),d.value--}}function P(t){var s;if(t.response){if(Array.isArray(a.value)){const u=l.findIndex(h=>h.uid===t.uid);u>=0&&(a==null||a.value.splice(u,1),l.splice(u,1)),a.value.length===0&&(a.value=void 0)}}else(s=t==null?void 0:t.oss)==null||s.pauseUpload();const n=p.findIndex(u=>u.uid===t.uid);return p.splice(n,1),Promise.resolve(!0)}return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({[e.unref(y)()]:!0,[e.unref(y)("admin")]:e.unref(q)==="admin"})},[e.createVNode(e.unref(i.Upload),{ref_key:"uploadRef",ref:c,accept:e.unref(x),multiple:"",maxCount:e.unref(r),progress:{strokeWidth:3,showInfo:!1,strokeColor:"#0070FF"},beforeUpload:z,customRequest:I,onRemove:P},{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createVNode(e.unref(i.Button),{class:"file-btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.UploadOutlined)),e.createTextVNode(" "+e.toDisplayString(e.unref(B)),1)]),_:1}),e.createElementVNode("div",{class:"sub-title",onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[typeof e.unref(m)=="string"?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(e.unref(m)||`${e.unref(o)("ap.apUpload.supportExtension")}:${e.unref(U.getAcceptText)(e.unref(x))}`),1)):e.unref(m)?(e.openBlock(),e.createElementBlock("div",W,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(m))))])):e.createCommentVNode("",!0)])])]),_:1},8,["accept","maxCount"])],2))}});exports.default=G;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const v=require("../utils/returnData.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const v=require("../utils/returnData.js"),B=require("@ant-design/icons-vue"),x=require("../hooks/useOss.js"),j=require("../utils/accept.js"),l=require("@aplus-frontend/antdv"),G=require("lodash-unified"),H=require("../../config-provider/hooks/use-locale.js"),J=require("../../config-provider/hooks/use-namespace.js"),K=["accept"],Q={class:"picture-context"},W={class:"picture-item-box"},X=["src"],Y={class:"picture-item-shadow"},Z=["onClick"],F={key:0,class:"picture-item-uploading"},ee={class:"picture-title"},te={key:0},ne={key:1},ae=e.defineComponent({__name:"Picture",setup(se,{expose:q}){const{t:i}=H.useLocale(),{b:y}=J.useNamespace("ap-upload-picture"),{put:V}=x.useOss(),P=e.inject("theme"),b=e.inject("dirName"),h=e.inject("accept")||"image/*",k=e.inject("maxSize")??5,_=e.inject("title"),u=e.inject("maxCount")??10,f=e.inject("uploadingCount"),w=e.inject("beforeUpload"),E=e.inject("customRequest"),C=e.inject("getOssAccess"),z=e.inject("maxSizeErrorMsg"),A=e.inject("maxCountErrorMsg"),I=e.inject("acceptErrorMsg"),m=e.ref(null),r=e.inject("value"),g=e.inject("needName");let o=e.ref([]);const p=[];e.watch(()=>r==null?void 0:r.value,async function(t){var s;!((s=o==null?void 0:o.value)!=null&&s.length)&&t&&N(t)},{immediate:!0});function N(t){if(!t){r.value=void 0,p.splice(0,p.length),o.value=[];return}e.nextTick(async()=>{const s=[];for(let n of t){const a=v.getPath(g,n),c=v.getName(g,n),d=await x.getOssInstance(C),T=await d.getSignatureUrl(a),L={...typeof n=="string"?{}:n,...new File([n],c,{}),uid:`${new Date().getTime()}-${Math.random()}`,thumbUrl:T,status:"success",percent:100,path:a};s.push(L),d.destroy()}if(u&&s.length>u){l.message.warning(i("ap.apUpload.fileInitializationException",{maxCount:u}));return}s.forEach(n=>{o.value.push(n),p.push({uid:n.uid,path:n.path})}),r.value=t})}q({setValue:N});function M(){var t;(t=m.value)==null||t.click()}function D(t){const s=t.target;R(s==null?void 0:s.files)}function R(t){if(t!=null&&t.length)for(let s=0;s<t.length;s++)$(t[s]);m.value&&(m.value.value="")}let U;function $(t){if(u&&u>1&&o.value.length>=u)return clearTimeout(U),U=setTimeout(()=>{l.message.warning(A||i("ap.apUpload.maxUploadPicture",{maxCount:u}))}),!1;if(typeof w=="function"){if(w(t)===!1)return!1}else{if(t.size>k*1024*1024)return l.message.warning(z||i("ap.apUpload.maxUploadFileSize",{maxSize:k})),!1;if(!/image\/\w+/.test(t.type)||!j.fileMatchesAccept(t,h))return l.message.warning(I||i("ap.apUpload.pictureFormatNotSupported")),!1}const s=new FileReader;s.readAsDataURL(t),s.onload=function(){const n={...t,uid:`${new Date().getTime()}-${Math.random()}`,thumbUrl:this.result,status:"uploading",percent:0};O(n,t)},s.onerror=function(){l.message.warning(i("ap.apUpload.imageParsingFailed"))}}async function O(t,s){if(f.value++,typeof E=="function"){E({onProgress:n=>{const a=o.value.find(c=>c.uid===t.uid);a&&(a.percent=n)},onError:n=>{l.message.warning(n||i("ap.apUpload.networkAnomaly"));const a=o.value.findIndex(c=>c.uid===t.uid);a>-1&&o.value.splice(a,1),f.value--},onSuccess:n=>{const a=o.value.find(c=>c.uid===t.uid);a&&(a.status="success",a.path=n),r.value=[...r.value||[],v.getReturnData(g,n,s.name)],p.push({uid:t.uid,path:n}),f.value--},file:s});return}try{const n=await x.getOssInstance(C);t.oss=n,o.value.push(t),V({file:s,dirName:b,oss:n,successCallBack(a){const c=o.value.find(d=>d.uid===t.uid);c&&(c.status="success",c.path=a),r.value=[...r.value||[],v.getReturnData(g,a,s.name)],p.push({uid:t.uid,path:a}),f.value--},errorCallBack(a){l.message.warning(a||i("ap.apUpload.networkAnomaly"));const c=o.value.findIndex(d=>d.uid===t.uid);c>-1&&o.value.splice(c,1),f.value--},progressCallBack(a){const c=o.value.find(d=>d.uid===t.uid);c&&(c.percent=a)}})}catch(n){l.message.warning(typeof(n==null?void 0:n.message)=="string"?n.message:i("ap.apUpload.networkAnomaly"));const a=o.value.findIndex(c=>c.uid===t.uid);a>-1&&o.value.splice(a,1),f.value--}}function S(t){var n;if(t.path&&r){if(Array.isArray(r.value)){const a=p.findIndex(c=>c.uid===t.uid);a>=0&&(r.value=r==null?void 0:r.value.toSpliced(a,1),p.splice(a,1)),r.value.length===0&&(r.value=void 0)}}else(n=t==null?void 0:t.oss)==null||n.pauseUpload();const s=o.value.findIndex(a=>a.uid===t.uid);return o.value.splice(s,1),Promise.resolve(!0)}return(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({[e.unref(y)()]:!0,[e.unref(y)("admin")]:e.unref(P)==="admin"})},[e.createElementVNode("input",{style:{display:"none"},type:"file",ref_key:"fileRef",ref:m,accept:e.unref(h),onChange:D},null,40,K),e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"pictureContext",{fileList:e.unref(o).map(n=>{var a;return{...e.unref(G.omit)(n,"oss"),oss:{pauseUpload:(a=n==null?void 0:n.oss)==null?void 0:a.pauseUpload}}}),remove:S},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),n=>(e.openBlock(),e.createElementBlock("div",{key:n.uid,class:"picture-item"},[e.createElementVNode("div",W,[e.createElementVNode("img",{src:n.thumbUrl,alt:""},null,8,X),e.withDirectives(e.createElementVNode("div",Y,[e.createElementVNode("div",{class:"picture-item-close",onClick:a=>S(n)},[e.createVNode(e.unref(B.CloseOutlined))],8,Z),n.status==="uploading"?(e.openBlock(),e.createElementBlock("div",F,[e.createVNode(e.unref(l.Progress),{percent:n.percent,strokeColor:"#ffffff",trailColor:"rgba(255, 255, 255, 0.3)",size:4,showInfo:!1},null,8,["percent"])])):e.createCommentVNode("",!0)],512),[[e.vShow,n.status==="uploading"]])])]))),128))]),e.unref(u)===void 0||e.unref(o).length<e.unref(u)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"picture-upload",onClick:M},[e.createVNode(e.unref(B.PlusOutlined)),e.createElementVNode("div",null,e.toDisplayString(e.unref(i)("ap.apUpload.update")),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ee,[e.unref(_)?(e.openBlock(),e.createElementBlock("div",te,e.toDisplayString(e.unref(_)),1)):(e.openBlock(),e.createElementBlock("div",ne,e.toDisplayString(`${e.unref(i)("ap.apUpload.supportExtension")}:${e.unref(j.getAcceptText)(e.unref(h))},${e.unref(i)("ap.apUpload.maxUploadPictureSize",{maxSize:e.unref(k)})}`),1))])],2))}});exports.default=ae;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const w=require("../utils/returnData.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const w=require("../utils/returnData.js"),b=require("../hooks/useOss.js"),V=require("../utils/accept.js"),s=require("@aplus-frontend/antdv"),Y=require("@ant-design/icons-vue"),M=require("../assets/single-file-icon.png.js"),Z=require("../../config-provider/hooks/use-locale.js"),ee=require("../../config-provider/hooks/use-namespace.js"),te=["accept"],ne={key:0,class:"state-un"},ae=["src"],oe={class:"state-un-title"},re={class:"state-un-subtitle"},le={key:1,class:"state-ing"},se={class:"left"},ce=["src"],ue={class:"center"},ie={class:"center-progress"},pe=e.defineComponent({__name:"SingleFile",setup(de,{expose:O}){const{t:l}=Z.useLocale(),{b:m}=ee.useNamespace("ap-upload-single-file"),{put:P,client:F}=b.useOss(),g=e.inject("theme"),T=e.inject("dirName"),h=e.inject("accept")||"*",_=e.inject("maxSize")??500,L=e.inject("title")||l("ap.apUpload.clickOrDragUpload"),k=e.inject("subTitle"),a=e.inject("value"),y=e.inject("needName"),u=e.inject("uploadingCount"),S=e.inject("beforeUpload"),U=e.inject("customRequest"),R=e.inject("getOssAccess"),I=e.inject("maxSizeErrorMsg"),$=e.inject("acceptErrorMsg"),o=e.ref(null);e.watch(()=>a==null?void 0:a.value,function(t){o.value===null&&t&&j(t)},{immediate:!0});function j(t){t?setTimeout(()=>{const n=w.getName(y,t);r.value=3,o.value=new File([t],n,{}),a.value=t}):(r.value=1,o.value=null,a.value=void 0)}O({setValue:j});const r=e.ref(1),d=e.ref(0),f=e.ref(null),B=e.computed(()=>o.value&&(a==null?void 0:a.value));function G(){var t;r.value===1&&((t=f.value)==null||t.click())}function q(t){t.preventDefault(),t.stopPropagation()}function W(t){t.dataTransfer.dropEffect="copy",t.preventDefault(),t.stopPropagation()}function H(t){x(t)}function J(t){if(t.preventDefault(),t.stopPropagation(),r.value!==1)return;var n=t.dataTransfer,c=[],z=0,A=n.files.length;function i(){z===A-1&&H(c),z++}if(n.items!==void 0)for(var D=0;D<n.items.length;D++){var E=n.items[D];if(E.kind==="file"&&E.webkitGetAsEntry().isFile){var X=E.getAsFile();c.push(X),i()}}else for(let C=0;C<A;C++){var v=n.files[C];if(v.type)c.push(v),i();else try{var N=new FileReader;N.readAsDataURL(v.slice(0,3)),N.addEventListener("load",function(p){console.warn(p,"load"),c.push(v),i()},!1),N.addEventListener("error",function(p){console.warn(p,"error"),s.message.warning(l("ap.apUpload.foldersNotSupported")),i()},!1)}catch(p){console.warn(p),s.message.warning(l("ap.apUpload.foldersNotSupported")),i()}}}function K(t){const n=t.target;x(n==null?void 0:n.files),f.value&&(f.value.value="")}async function x(t){if(t!=null&&t.length){if(typeof S=="function"){if(S(t[0])===!1)return}else{if(t[0].size>_*1024*1024){s.message.warning(I||l("ap.apUpload.maxUploadFileSize",{maxSize:_}));return}if(!V.fileMatchesAccept(t[0],h)){s.message.warning($||l("ap.apUpload.fileFormatNotSupported"));return}}if(o.value=t[0],r.value=2,d.value=0,u.value++,typeof U=="function"){U({onProgress:n=>{d.value=n},onError:n=>{s.message.warning(n||l("ap.apUpload.networkAnomaly")),r.value=1,o.value=null,u.value--},onSuccess:n=>{a.value=w.getReturnData(y,n,o.value.name),r.value=3,u.value--},file:t[0]});return}try{await b.useOssInit(R),P({file:o.value,dirName:T,oss:F,successCallBack(n){a.value=w.getReturnData(y,n,o.value.name),r.value=3,u.value--},errorCallBack(n){s.message.warning(n||l("ap.apUpload.networkAnomaly")),r.value=1,o.value=null,u.value--},progressCallBack(n){d.value=n}})}catch(n){s.message.warning(typeof(n==null?void 0:n.message)=="string"?n.message:l("ap.apUpload.networkAnomaly")),r.value=1,o.value=null,u.value--}}}function Q(){o.value&&!(a!=null&&a.value)&&F.pauseUpload(),r.value=1,o.value=null,a.value=void 0}return(t,n)=>{var c;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({[e.unref(m)()]:!0,[e.unref(m)("admin")]:e.unref(g)==="admin",[e.unref(m)("un")]:r.value===1}),onClick:G,onDragenter:q,onDragover:W,onDragleave:q,onDrop:J},[e.createElementVNode("input",{style:{display:"none"},type:"file",ref_key:"fileRef",ref:f,accept:e.unref(h),onChange:K},null,40,te),r.value===1?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("img",{class:"state-un-icon",src:e.unref(M.default)},null,8,ae),e.createElementVNode("div",oe,e.toDisplayString(e.unref(L)),1),e.createElementVNode("div",re,e.toDisplayString(typeof e.unref(k)=="string"&&e.unref(k).length>0?e.unref(k):`${e.unref(l)("ap.apUpload.supportExtension")}:${e.unref(V.getAcceptText)(e.unref(h))},${e.unref(l)("ap.apUpload.maxWarnUploadFileSize",{maxSize:e.unref(_)})}`),1)])):e.createCommentVNode("",!0),[2,3].includes(r.value)?(e.openBlock(),e.createElementBlock("div",le,[e.createElementVNode("div",se,[e.createElementVNode("img",{src:e.unref(M.default)},null,8,ce)]),e.createElementVNode("div",ue,[e.createElementVNode("div",{class:"center-title",style:e.normalizeStyle({color:B.value?"#0070FF":"#182948"})},e.toDisplayString((c=o.value)==null?void 0:c.name),5),e.createElementVNode("div",ie,[B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(s.Progress),{key:0,percent:d.value,size:4,showInfo:!1,trailColor:e.unref(g)==="admin"?"#D9D9D9":"#DEE4ED",strokeColor:e.unref(g)==="admin"?"#34B77C":"#0070FF"},null,8,["percent","trailColor","strokeColor"]))])]),e.createElementVNode("div",{class:"right",onClick:e.withModifiers(Q,["stop"])},[e.createVNode(e.unref(Y.DeleteOutlined))])])):e.createCommentVNode("",!0)],34)}}});exports.default=pe;
|
|
@@ -3,10 +3,13 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes,
|
|
|
3
3
|
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApSummaryProps>, {
|
|
4
4
|
summaryTitle: string;
|
|
5
5
|
hasSelect: boolean;
|
|
6
|
+
size: string;
|
|
6
7
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApSummaryProps>, {
|
|
7
8
|
summaryTitle: string;
|
|
8
9
|
hasSelect: boolean;
|
|
10
|
+
size: string;
|
|
9
11
|
}>>>, {
|
|
12
|
+
size: "middle" | "small";
|
|
10
13
|
summaryTitle: string;
|
|
11
14
|
hasSelect: boolean;
|
|
12
15
|
}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("lodash-unified"),c=require("@aplus-frontend/antdv"),m=require("./utils.js");require("../../config-provider/index.js");const u=require("@aplus-frontend/utils"),g=require("../../config-provider/hooks/use-namespace.js"),x=e.defineComponent({name:"ApSummary",__name:"ap-summary",props:{data:{},columns:{},summaryTitle:{default:"合计"},hasSelect:{type:Boolean,default:!0},size:{default:"middle"}},setup(d){const n=d,p=s=>s===0,y=(s,r)=>{var l;if(!s||!u.isNumeric(s)||r.valueType!=="number")return s;const t=(l=r.fieldProps)==null?void 0:l.field,a=(t==null?void 0:t.precision)||0;return(i.isNil(t==null?void 0:t.thousands)?!0:t==null?void 0:t.thousands)?u.toThousand(s,a):u.toFixed(s,a)},f=e.computed(()=>{let s=[];n.hasSelect&&s.push({key:"select",rowSpan:1,align:"left",value:""});const t=m.flattenColumns(n.columns).map((a,o)=>({key:a.key,rowSpan:1,align:a.align,value:p(o)?n.summaryTitle:y(i.get(n.data,m.formatDataIndex(a.dataIndex||a.key)),a)}));return s.concat(t)}),{b:h,e:k,em:S}=g.useNamespace("ap-summary");return(s,r)=>(e.openBlock(),e.createBlock(e.unref(c.TableSummaryRow),{class:e.normalizeClass(e.unref(h)())},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(t,a)=>(e.openBlock(),e.createBlock(e.unref(c.TableSummaryCell),{class:e.normalizeClass(`${n.size==="small"?e.unref(S)("item","small"):e.unref(k)("item")}`),key:t.key,index:a,style:e.normalizeStyle({textAlign:t.align})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value),1)]),_:2},1032,["class","index","style"]))),128))]),_:1},8,["class"]))}});exports.default=x;
|
|
@@ -4,6 +4,10 @@ export * from './interface';
|
|
|
4
4
|
export * from './utils';
|
|
5
5
|
declare const ApSummary: {
|
|
6
6
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
7
|
+
size: {
|
|
8
|
+
type: PropType<"small" | "middle">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
7
11
|
data: {
|
|
8
12
|
type: PropType<ValueType>;
|
|
9
13
|
};
|
|
@@ -20,6 +24,10 @@ declare const ApSummary: {
|
|
|
20
24
|
default: boolean;
|
|
21
25
|
};
|
|
22
26
|
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
27
|
+
size: {
|
|
28
|
+
type: PropType<"small" | "middle">;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
23
31
|
data: {
|
|
24
32
|
type: PropType<ValueType>;
|
|
25
33
|
};
|
|
@@ -36,6 +44,7 @@ declare const ApSummary: {
|
|
|
36
44
|
default: boolean;
|
|
37
45
|
};
|
|
38
46
|
}>>, {
|
|
47
|
+
size: "middle" | "small";
|
|
39
48
|
summaryTitle: string;
|
|
40
49
|
hasSelect: boolean;
|
|
41
50
|
}, true, {}, {}, {
|
|
@@ -46,6 +55,10 @@ declare const ApSummary: {
|
|
|
46
55
|
M: {};
|
|
47
56
|
Defaults: {};
|
|
48
57
|
}, Readonly< ExtractPropTypes<{
|
|
58
|
+
size: {
|
|
59
|
+
type: PropType<"small" | "middle">;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
49
62
|
data: {
|
|
50
63
|
type: PropType<ValueType>;
|
|
51
64
|
};
|
|
@@ -62,6 +75,7 @@ declare const ApSummary: {
|
|
|
62
75
|
default: boolean;
|
|
63
76
|
};
|
|
64
77
|
}>>, {}, {}, {}, {}, {
|
|
78
|
+
size: "middle" | "small";
|
|
65
79
|
summaryTitle: string;
|
|
66
80
|
hasSelect: boolean;
|
|
67
81
|
}>;
|
|
@@ -69,6 +83,10 @@ declare const ApSummary: {
|
|
|
69
83
|
__isTeleport?: never;
|
|
70
84
|
__isSuspense?: never;
|
|
71
85
|
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
86
|
+
size: {
|
|
87
|
+
type: PropType<"small" | "middle">;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
72
90
|
data: {
|
|
73
91
|
type: PropType<ValueType>;
|
|
74
92
|
};
|
|
@@ -85,6 +103,7 @@ declare const ApSummary: {
|
|
|
85
103
|
default: boolean;
|
|
86
104
|
};
|
|
87
105
|
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
106
|
+
size: "middle" | "small";
|
|
88
107
|
summaryTitle: string;
|
|
89
108
|
hasSelect: boolean;
|
|
90
109
|
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("lodash-unified"),y=require("@aplus-frontend/utils"),g=t=>{var e,o;return t!=null&&t.children&&((e=t==null?void 0:t.children)==null?void 0:e.length)>0?n.flatten((o=t.children)==null?void 0:o.map(a=>g(a))):[t]},p=t=>n.flatten(t==null?void 0:t.map(e=>g(e))),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("lodash-unified"),y=require("@aplus-frontend/utils"),g=t=>{var e,o;return t!=null&&t.children&&((e=t==null?void 0:t.children)==null?void 0:e.length)>0?n.flatten((o=t.children)==null?void 0:o.map(a=>g(a))):[t]},p=t=>n.flatten(t==null?void 0:t.map(e=>g(e))),u=t=>Object.prototype.toString.call(t)==="[object Array]"?t.map(e=>String(e)).join("."):t??"",I=(t,e,o)=>o?y.toThousand(t,e):y.toFixed(t,e);function R(t){var l;const{records:e,columns:o,configList:a,exclude:f}=t;if(!e||(e==null?void 0:e.length)===0)return{};const s=p(o);let d=(l=s==null?void 0:s.filter(r=>r.valueType==="number"))==null?void 0:l.map(r=>({key:r.key||"",dataIndex:r.dataIndex}));a&&(a==null?void 0:a.length)>0&&(d=n.uniqBy(d==null?void 0:d.concat(a),"key")),f&&f.length>0&&(d=d.filter(r=>!f.includes(r.key)));const k={};return e==null?void 0:e.reduce((r,h)=>(d.forEach(i=>{var b;if(!n.isNil(n.get(h,u(i.dataIndex||i.key)))){const c=i.dataIndex||i.key,x=n.get(r,u(c))||0,N=n.get(h,u(c))||0,j=(b=y.addNumber(x,N))==null?void 0:b.toNumber();n.set(r,c,+j)}}),r),k)}exports.computedRecords=R;exports.flattenColumns=p;exports.formatDataIndex=u;exports.formatNumber=I;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"sideEffects": [
|
|
41
|
-
"**/*.css"
|
|
41
|
+
"**/*.css",
|
|
42
|
+
"**/style/*.js"
|
|
42
43
|
],
|
|
43
44
|
"author": "",
|
|
44
45
|
"license": "MIT",
|
|
@@ -62,14 +63,14 @@
|
|
|
62
63
|
"sortablejs": "^1.15.2",
|
|
63
64
|
"vuedraggable": "^4.1.0",
|
|
64
65
|
"@aplus-frontend/hooks": "1.0.7",
|
|
65
|
-
"@aplus-frontend/utils": "1.0.
|
|
66
|
+
"@aplus-frontend/utils": "1.0.42"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
69
|
"@aplus-frontend/icon": "^1.0.21",
|
|
69
70
|
"@aplus-frontend/oss": "^1.1.2",
|
|
70
71
|
"vue": "3.4.38",
|
|
71
72
|
"@aplus-frontend/antdv": "^1.0.2",
|
|
72
|
-
"@aplus-frontend/ui-theme": "1.0.
|
|
73
|
+
"@aplus-frontend/ui-theme": "1.0.8"
|
|
73
74
|
},
|
|
74
75
|
"scripts": {
|
|
75
76
|
"pub:cb": "pnpm publish --access public",
|