@aplus-frontend/ui 0.0.28 → 0.0.29
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/hooks/index.mjs +4 -3
- package/es/src/ap-download/interface.d.ts +2 -2
- package/es/src/ap-field/date/helper.mjs +5 -5
- package/es/src/ap-field/date-range/index.vue.mjs +15 -15
- package/es/src/ap-form/ap-form-list.vue.mjs +29 -21
- package/es/src/ap-form/ap-form.vue2.mjs +77 -77
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/search-form/index.vue.mjs +123 -99
- package/es/src/ap-table/hooks/use-table-paging.mjs +23 -21
- package/es/src/ap-upload/apUpload.vue.d.ts +3 -11
- package/es/src/ap-upload/apUpload.vue.mjs +42 -36
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +115 -102
- package/es/src/ap-upload/components/Picture.vue2.mjs +121 -111
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +120 -109
- package/es/src/ap-upload/hooks/useOss.d.ts +9 -4
- package/es/src/ap-upload/hooks/useOss.mjs +52 -34
- package/es/src/ap-upload/utils/accept.d.ts +3 -0
- package/es/src/ap-upload/utils/accept.mjs +35 -30
- package/es/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
- package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +7 -6
- package/es/src/business/ap-status/interface.d.ts +4 -1
- package/es/src/business/index.d.ts +41 -8
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +10 -1
- package/es/src/config-provider/config-provider.mjs +9 -8
- package/es/src/config-provider/constants.d.ts +10 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/locale/lang/en.mjs +24 -0
- package/es/src/locale/lang/zh-cn.mjs +24 -0
- package/es/src/work-order-modal/createWorkOrder.d.ts +3 -1
- package/es/src/work-order-modal/interfaces.d.ts +3 -1
- package/es/src/work-order-modal/work-order-modal.vue.mjs +7 -7
- package/lib/src/ap-download/hooks/index.js +1 -1
- package/lib/src/ap-download/interface.d.ts +2 -2
- package/lib/src/ap-field/date/helper.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-list.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +3 -11
- package/lib/src/ap-upload/apUpload.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/ap-upload/hooks/useOss.d.ts +9 -4
- package/lib/src/ap-upload/hooks/useOss.js +1 -1
- package/lib/src/ap-upload/utils/accept.d.ts +3 -0
- package/lib/src/ap-upload/utils/accept.js +1 -1
- package/lib/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
- package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
- package/lib/src/business/ap-status/interface.d.ts +4 -1
- package/lib/src/business/index.d.ts +41 -8
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +10 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +10 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/work-order-modal/createWorkOrder.d.ts +3 -1
- package/lib/src/work-order-modal/interfaces.d.ts +3 -1
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),C=require("../utils.js"),I=require("lodash-unified");require("../../config-provider/index.js");const K=require("../../config-provider/hooks/use-locale.js"),N=({manual:O=!1,defaultCurrent:j=1,defaultPageSize:F=10,request:$,defaultParams:x={},defaultData:D=[],formatParams:S,paramsValueTypeMap:T,resetFieldsIgnores:P,filterFields:L=[],sortFields:M=[]})=>{let m=0,f={};const R=e=>S?S(e):e,i=t.ref(),c=t.ref(j),g=t.ref(F),{t:b}=K.useLocale(),o=t.ref({total:0,records:D,loading:!1}),z=async e=>{var n;const a=R(e),r=Date.now();m=r,o.value.loading=!0;try{const s=await $({...x,...a});m===r&&(o.value.total=s.total||((n=s.data)==null?void 0:n.length)||0,o.value.records=[...s.data||[]])}catch{m===r&&(o.value.records=[],o.value.total=0)}finally{o.value.loading=!1}},q=e=>{const a={};return Object.entries(e).forEach(([r,n])=>{if(a[r]=n,T&&n){const s=T[r];s&&(a[r]=C.parseFieldValue(s,n))}}),a},A=e=>{var n,s,d,p,h,l,u;const a=((s=(n=i.value)==null?void 0:n.apForm)==null?void 0:s.getFieldsValue())||{},r={};Object.entries(a).forEach(([y,H])=>{P&&P.indexOf(y)>-1&&(r[y]=H)}),(p=(d=i.value)==null?void 0:d.apForm)==null||p.resetFields(),(u=(l=(h=i.value)==null?void 0:h.apForm)==null?void 0:l.setFieldsValue)==null||u.call(l,r),t.nextTick(()=>{e==null||e()})},v=e=>{f=e;const a=q(e);z(a)},B=e=>{v({...f,...e})},V=()=>{var a,r;const e=((r=(a=i.value)==null?void 0:a.apForm)==null?void 0:r.getFieldsValue(!0))||{};c.value=1,v({...e,current:1,pageSize:f.pageSize||F})},E=()=>{A(V)},J=()=>{v(f)},Q=e=>{const a=t.unref(o).total-e,r=Math.ceil(a/t.unref(g)),n=t.unref(c)>r?r:t.unref(c);B({current:n>0?n:1})},w=(e,a,r)=>{var h,l;const n=((l=(h=i.value)==null?void 0:h.apForm)==null?void 0:l.getFieldsValue(!0))||{};c.value=e.current,g.value=e.pageSize;const s=I.isArray(r)?[...r]:[r],d={};for(const u of s)M.includes(u.field)&&(d[C.dataIndexToStr(u.field)]=u.order);const p={};for(const u of Object.keys(a))L.includes(u)&&(p[u]=a[u]);v({...n,filter:p,sort:d,current:e.current,pageSize:e.pageSize})};t.onMounted(()=>{var a,r;const e=((r=(a=i.value)==null?void 0:a.apForm)==null?void 0:r.getFieldsValue(!0))||{};if(f={current:t.unref(c),pageSize:t.unref(g),...e},!O){const n=q(f);z(n)}});const U=t.computed(()=>t.unref(o).total===0?"-":`${t.unref(c.value)}/${Math.ceil(t.unref(o).total/t.unref(g))}`),G=t.computed(()=>({loading:t.unref(o).loading,pagination:{current:t.unref(c),pageSize:t.unref(g),total:t.unref(o).total,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`${b("ap.apTable.pagination.totalLeft",{total:e})} ${b("ap.apTable.pagination.totalRight",{page:t.unref(U)})}`},onChange:w,dataSource:t.unref(o).records}));return{formRef:i,submit:V,reset:E,refresh:J,refreshByDelete:Q,data:o,current:c,pageSize:g,handleTableChange:w,tableProps:G}};exports.useTablePaging=N;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PropType, VNode, DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ExtractPropTypes, RendererNode, RendererElement } from 'vue';
|
|
2
2
|
import { FileUploadType, BeforeUpload, CustomRequest } from './apUploadTypes';
|
|
3
|
+
import { accessCreate } from '@aplus-frontend/oss';
|
|
3
4
|
|
|
4
5
|
declare function clear(): void;
|
|
5
6
|
declare const _default: DefineComponent<{
|
|
6
7
|
dirName: {
|
|
7
8
|
type: StringConstructor;
|
|
8
|
-
default: string;
|
|
9
9
|
};
|
|
10
10
|
type: {
|
|
11
11
|
type: PropType<FileUploadType>;
|
|
@@ -17,11 +17,9 @@ declare const _default: DefineComponent<{
|
|
|
17
17
|
};
|
|
18
18
|
needName: {
|
|
19
19
|
type: (BooleanConstructor | ObjectConstructor)[];
|
|
20
|
-
default: boolean;
|
|
21
20
|
};
|
|
22
21
|
accept: {
|
|
23
22
|
type: StringConstructor;
|
|
24
|
-
default: string;
|
|
25
23
|
};
|
|
26
24
|
maxSize: {
|
|
27
25
|
type: NumberConstructor;
|
|
@@ -44,7 +42,7 @@ declare const _default: DefineComponent<{
|
|
|
44
42
|
type: PropType<CustomRequest>;
|
|
45
43
|
};
|
|
46
44
|
getOssAccess: {
|
|
47
|
-
type:
|
|
45
|
+
type: PropType<() => Promise< accessCreate>>;
|
|
48
46
|
};
|
|
49
47
|
}, {
|
|
50
48
|
done: ComputedRef<boolean>;
|
|
@@ -54,7 +52,6 @@ declare const _default: DefineComponent<{
|
|
|
54
52
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
55
53
|
dirName: {
|
|
56
54
|
type: StringConstructor;
|
|
57
|
-
default: string;
|
|
58
55
|
};
|
|
59
56
|
type: {
|
|
60
57
|
type: PropType<FileUploadType>;
|
|
@@ -66,11 +63,9 @@ declare const _default: DefineComponent<{
|
|
|
66
63
|
};
|
|
67
64
|
needName: {
|
|
68
65
|
type: (BooleanConstructor | ObjectConstructor)[];
|
|
69
|
-
default: boolean;
|
|
70
66
|
};
|
|
71
67
|
accept: {
|
|
72
68
|
type: StringConstructor;
|
|
73
|
-
default: string;
|
|
74
69
|
};
|
|
75
70
|
maxSize: {
|
|
76
71
|
type: NumberConstructor;
|
|
@@ -93,7 +88,7 @@ declare const _default: DefineComponent<{
|
|
|
93
88
|
type: PropType<CustomRequest>;
|
|
94
89
|
};
|
|
95
90
|
getOssAccess: {
|
|
96
|
-
type:
|
|
91
|
+
type: PropType<() => Promise< accessCreate>>;
|
|
97
92
|
};
|
|
98
93
|
}>> & {
|
|
99
94
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -101,11 +96,8 @@ declare const _default: DefineComponent<{
|
|
|
101
96
|
type: FileUploadType;
|
|
102
97
|
title: string;
|
|
103
98
|
value: string | unknown[] | Record<string, any>;
|
|
104
|
-
accept: string;
|
|
105
|
-
dirName: string;
|
|
106
99
|
subTitle: string | VNode< RendererNode, RendererElement, {
|
|
107
100
|
[key: string]: any;
|
|
108
101
|
}>;
|
|
109
|
-
needName: boolean | Record<string, any>;
|
|
110
102
|
}, {}>;
|
|
111
103
|
export default _default;
|
|
@@ -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");require("./styles/upload.css");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");require("./styles/upload.css");const S=require("./utils/accept.js"),O=require("./hooks/useOss.js"),F=require("../config-provider/hooks/use-locale.js"),x=require("../config-provider/hooks/use-namespace.js"),A=require("./components/SingleFile.vue2.js"),T=require("./components/MultipleFile.vue2.js"),U=require("./components/Picture.vue2.js"),p=require("../config-provider/hooks/use-global-config.js"),j=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}},emits:["update:value"],setup(d,{expose:m,emit:v}){var i,l,n,c;const{t:a,lang:_}=F.useLocale();S.injectLocaleToAccept(a),O.injectLocaleToOss(a,_);const{b:g}=x.useNamespace("ap-upload"),t=d,f=v,y={singleFile:A.default,multipleFile:T.default,picture:U.default},b=e.computed({get(){return t.value},set(r){f("update:value",r)}}),q=p.useGlobalConfig("uiMode"),o=p.useGlobalConfig("apUpload");e.provide("theme",q.value),e.provide("value",b),e.provide("dirName",t.dirName??((i=o.value)==null?void 0:i.dirName)),e.provide("needName",t.needName??((l=o.value)==null?void 0:l.needName)??!1),e.provide("accept",t.accept??((n=o.value)==null?void 0:n.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??((c=o.value)==null?void 0:c.getOssAccess));const C=e.computed(()=>s.value===0),s=e.ref(0);e.provide("uploadingCount",s);const u=e.ref(!0);function N(){u.value=!1,setTimeout(()=>{u.value=!0})}return m({done:C,clear:N}),(r,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(g)())},[u.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(y[t.type]),e.normalizeProps(e.mergeProps({key:0},r.$attrs)),null,16)):e.createCommentVNode("",!0)],2))}});exports.default=j;
|
|
@@ -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 d=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 d=require("../utils/returnData.js"),j=require("../hooks/useOss.js"),i=require("ant-design-vue"),b=require("@ant-design/icons-vue"),q=require("../utils/accept.js");require("../styles/multiple-file.css");const D=require("../../config-provider/hooks/use-locale.js"),L=require("../../config-provider/hooks/use-namespace.js"),I={class:"multiple-file-context"},P={key:0},O={key:1},z=e.defineComponent({__name:"MultipleFile",setup(M){const{t:o}=D.useLocale(),{b:y}=L.useNamespace("ap-upload-multiple-file"),{put:T}=j.useOss(),U=e.inject("theme"),A=e.inject("dirName"),h=e.inject("accept")||"*",w=e.inject("maxSize")??500,B=e.inject("title")||o("ap.apUpload.uploadFile"),g=e.inject("subTitle"),r=e.inject("maxCount")??10,c=e.inject("uploadingCount"),C=e.inject("beforeUpload"),_=e.inject("customRequest"),E=e.inject("getOssAccess"),s=e.inject("value"),m=[],l=e.inject("needName"),f=e.ref(null);e.watch(()=>s==null?void 0:s.value,function(t){!f.value.fileList.length&&t&&e.nextTick(()=>{const n=t.map(a=>{const u=d.getPath(l,a),x=d.getName(l,a),k=new File([a],x,{});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(a=>{p.push(a),m.push({uid:a.uid,path:a.response})}),f.value.fileList=n})});let p=[],N;function v(t){setTimeout(()=>{const n=f.value.fileList.findIndex(a=>a.uid===t.uid);n>=0&&f.value.fileList.splice(n,1)})}function F(t){if(r&&r>1&&p.length>=r)return clearTimeout(N),N=setTimeout(()=>{i.message.warning(o("ap.apUpload.maxUploadFiles",{maxCount:r}))}),v(t),!1;if(typeof C=="function"){if(C(t)===!1)return v(t),!1}else{if(t.size>w*1024*1024)return i.message.warning(o("ap.apUpload.maxUploadFileSize",{maxSize:w})),v(t),!1;if(!q.fileMatchesAccept(t,h))return i.message.warning(o("ap.apUpload.fileFormatNotSupported")),v(t),!1}r&&r===1&&(p=[],s.value=void 0),p.push(t)}async function R(t){if(c.value++,typeof _=="function"){_({onProgress:n=>{setTimeout(()=>{t.onProgress({percent:n})})},onError:n=>{i.message.warning(n||o("ap.apUpload.networkAnomaly")),setTimeout(()=>{t.onError({name:n,message:n})}),c.value--},onSuccess:n=>{setTimeout(()=>{t.onSuccess(n)}),s.value?s.value.push(d.getReturnData(l,n,t.file.name)):s.value=[d.getReturnData(l,n,t.file.name)],m.push({uid:t.file.uid,path:n}),c.value--},file:t.file});return}try{const n=await j.getOssInstance(E);t.file.oss=n,T({file:t.file,dirName:A,oss:n,successCallBack(a){t.onSuccess(a),s.value?s.value.push(d.getReturnData(l,a,t.file.name)):s.value=[d.getReturnData(l,a,t.file.name)],m.push({uid:t.file.uid,path:a}),c.value--},errorCallBack(a){i.message.warning(a||o("ap.apUpload.networkAnomaly")),t.onError({name:a,message:a}),c.value--},progressCallBack(a){t.onProgress({percent:a})}})}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")}),c.value--}}function S(t){var a;if(t.response){if(Array.isArray(s.value)){const u=m.findIndex(x=>x.uid===t.uid);u>=0&&(s==null||s.value.splice(u,1),m.splice(u,1)),s.value.length===0&&(s.value=void 0)}}else(a=t==null?void 0:t.oss)==null||a.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(U)==="admin"})},[e.createVNode(e.unref(i.Upload),{ref_key:"uploadRef",ref:f,accept:e.unref(h),multiple:"",maxCount:e.unref(r),progress:{strokeWidth:3,showInfo:!1,strokeColor:"#0070FF"},beforeUpload:F,customRequest:R,onRemove:S},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.createVNode(e.unref(i.Button),{class:"file-btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(b.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(g)=="string"?(e.openBlock(),e.createElementBlock("div",P,e.toDisplayString(e.unref(g)||`${e.unref(o)("ap.apUpload.supportExtension")}:${e.unref(q.getAcceptText)(e.unref(h))}`),1)):e.unref(g)?(e.openBlock(),e.createElementBlock("div",O,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g))))])):e.createCommentVNode("",!0)])])]),_:1},8,["accept","maxCount"])],2))}});exports.default=z;
|
|
@@ -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 m=require("../utils/returnData.js"),B=require("@ant-design/icons-vue"),_=require("../hooks/useOss.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const m=require("../utils/returnData.js"),B=require("@ant-design/icons-vue"),_=require("../hooks/useOss.js"),U=require("../utils/accept.js"),l=require("ant-design-vue");require("../styles/picture.css");const O=require("../../config-provider/hooks/use-locale.js"),$=require("../../config-provider/hooks/use-namespace.js"),T=["accept"],L={class:"picture-context"},M={class:"picture-item-box"},G=["src"],H={class:"picture-item-shadow"},J=["onClick"],K={key:0,class:"picture-item-uploading"},Q={class:"picture-title"},W={key:0},X={key:1},Y=e.defineComponent({__name:"Picture",setup(Z){const{t:u}=O.useLocale(),{b:y}=$.useNamespace("ap-upload-picture"),{put:S}=_.useOss(),j=e.inject("theme"),q=e.inject("dirName"),v=e.inject("accept")||"image/*",k=e.inject("maxSize")??5,x=e.inject("title"),r=e.inject("maxCount")??10,p=e.inject("uploadingCount"),w=e.inject("beforeUpload"),N=e.inject("customRequest"),C=e.inject("getOssAccess"),h=e.ref(null),i=e.inject("value"),f=e.inject("needName");let o=e.ref([]);const g=[];e.watch(()=>i==null?void 0:i.value,async function(t){if(!o.value.length&&t){const s=[];for(let n of t){const a=m.getPath(f,n),c=m.getName(f,n),d=await _.getOssInstance(C),I=await d.getSignatureUrl(a),z={...new File([n],c,{}),uid:`${new Date().getTime()}-${Math.random()}`,thumbUrl:I,status:"success",percent:100,path:a};s.push(z),d.destroy()}if(r&&s.length>r){l.message.warning(u("ap.apUpload.fileInitializationException",{maxCount:r}));return}s.forEach(n=>{o.value.push(n),g.push({uid:n.uid,path:n.path})})}});function D(){var t;(t=h.value)==null||t.click()}function V(t){const s=t.target;P(s==null?void 0:s.files)}function P(t){if(t!=null&&t.length)for(let s=0;s<t.length;s++)R(t[s]);h.value&&(h.value.value="")}let E;function R(t){if(r&&r>1&&o.value.length>=r)return clearTimeout(E),E=setTimeout(()=>{l.message.warning(u("ap.apUpload.maxUploadPicture",{maxCount:r}))}),!1;if(typeof w=="function"){if(w(t)===!1)return!1}else{if(t.size>k*1024*1024)return l.message.warning(u("ap.apUpload.maxUploadFileSize",{maxSize:k})),!1;if(!/image\/\w+/.test(t.type)||!U.fileMatchesAccept(t,v))return l.message.warning(u("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};b(n,t)},s.onerror=function(){l.message.warning(u("ap.apUpload.imageParsingFailed"))}}async function b(t,s){if(p.value++,typeof N=="function"){N({onProgress:n=>{const a=o.value.find(c=>c.uid===t.uid);a&&(a.percent=n)},onError:n=>{l.message.warning(n||u("ap.apUpload.networkAnomaly"));const a=o.value.findIndex(c=>c.uid===t.uid);a>-1&&o.value.splice(a,1),p.value--},onSuccess:n=>{const a=o.value.find(c=>c.uid===t.uid);a&&(a.status="success",a.path=n),i.value?i.value.push(m.getReturnData(f,n,s.name)):i.value=[m.getReturnData(f,n,s.name)],g.push({uid:t.uid,path:n}),p.value--},file:s});return}try{const n=await _.getOssInstance(C);t.oss=n,o.value.push(t),S({file:s,dirName:q,oss:n,successCallBack(a){const c=o.value.find(d=>d.uid===t.uid);c&&(c.status="success",c.path=a),i.value?i.value.push(m.getReturnData(f,a,s.name)):i.value=[m.getReturnData(f,a,s.name)],g.push({uid:t.uid,path:a}),p.value--},errorCallBack(a){l.message.warning(a||u("ap.apUpload.networkAnomaly"));const c=o.value.findIndex(d=>d.uid===t.uid);c>-1&&o.value.splice(c,1),p.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:u("ap.apUpload.networkAnomaly"));const a=o.value.findIndex(c=>c.uid===t.uid);a>-1&&o.value.splice(a,1),p.value--}}function A(t){var n;if(t.path){if(Array.isArray(i.value)){const a=g.findIndex(c=>c.uid===t.uid);a>=0&&(i==null||i.value.splice(a,1),g.splice(a,1)),i.value.length===0&&(i.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(j)==="admin"})},[e.createElementVNode("input",{style:{display:"none"},type:"file",ref_key:"fileRef",ref:h,accept:e.unref(v),onChange:V},null,40,T),e.createElementVNode("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),n=>(e.openBlock(),e.createElementBlock("div",{class:"picture-item",key:n.uid},[e.createElementVNode("div",M,[e.createElementVNode("img",{src:n.thumbUrl,alt:""},null,8,G),e.withDirectives(e.createElementVNode("div",H,[e.createElementVNode("div",{class:"picture-item-close",onClick:a=>A(n)},[e.createVNode(e.unref(B.CloseOutlined))],8,J),n.status==="uploading"?(e.openBlock(),e.createElementBlock("div",K,[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(r)===void 0||e.unref(o).length<e.unref(r)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"picture-upload",onClick:D},[e.createVNode(e.unref(B.PlusOutlined)),e.createElementVNode("div",null,e.toDisplayString(e.unref(u)("ap.apUpload.update")),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Q,[e.unref(x)?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(e.unref(x)),1)):(e.openBlock(),e.createElementBlock("div",X,e.toDisplayString(`${e.unref(u)("ap.apUpload.supportExtension")}:${e.unref(U.getAcceptText)(e.unref(v))},${e.unref(u)("ap.apUpload.maxUploadPictureSize",{maxSize:e.unref(k)})}`),1))])],2))}});exports.default=Y;
|
|
@@ -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
|
|
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"),z=require("../hooks/useOss.js"),x=require("../utils/accept.js"),s=require("ant-design-vue"),J=require("@ant-design/icons-vue"),O=require("../assets/single-file-icon.png.js");require("../styles/single-file.css");const K=require("../../config-provider/hooks/use-locale.js"),Q=require("../../config-provider/hooks/use-namespace.js"),X=["accept"],Y={key:0,class:"state-un"},Z=["src"],ee={class:"state-un-title"},te={class:"state-un-subtitle"},ne={key:1,class:"state-ing"},ae={class:"left"},oe=["src"],le={class:"center"},re={class:"center-progress"},se=e.defineComponent({__name:"SingleFile",setup(ce){const{t:r}=K.useLocale(),{b:m}=Q.useNamespace("ap-upload-single-file"),{put:V,client:F}=z.useOss(),g=e.inject("theme"),P=e.inject("dirName"),h=e.inject("accept")||"*",_=e.inject("maxSize")??500,L=e.inject("title")||r("ap.apUpload.clickOrDragUpload"),k=e.inject("subTitle"),a=e.inject("value"),D=e.inject("needName"),u=e.inject("uploadingCount"),S=e.inject("beforeUpload"),U=e.inject("customRequest"),R=e.inject("getOssAccess"),o=e.ref(null);e.watch(()=>a==null?void 0:a.value,function(t){const n=w.getName(D,t);o.value===null&&t&&(l.value=3,o.value=new File([t],n,{}))});const l=e.ref(1),d=e.ref(0),f=e.ref(null),j=e.computed(()=>o.value&&(a==null?void 0:a.value));function T(){var t;l.value===1&&((t=f.value)==null||t.click())}function q(t){t.preventDefault(),t.stopPropagation()}function I(t){t.dataTransfer.dropEffect="copy",t.preventDefault(),t.stopPropagation()}function M(t){B(t)}function $(t){if(t.preventDefault(),t.stopPropagation(),l.value!==1)return;var n=t.dataTransfer,c=[],A=0,b=n.files.length;function i(){A===b-1&&M(c),A++}if(n.items!==void 0)for(var y=0;y<n.items.length;y++){var N=n.items[y];if(N.kind==="file"&&N.webkitGetAsEntry().isFile){var H=N.getAsFile();c.push(H),i()}}else for(let E=0;E<b;E++){var v=n.files[E];if(v.type)c.push(v),i();else try{var C=new FileReader;C.readAsDataURL(v.slice(0,3)),C.addEventListener("load",function(p){console.warn(p,"load"),c.push(v),i()},!1),C.addEventListener("error",function(p){console.warn(p,"error"),s.message.warning(r("ap.apUpload.foldersNotSupported")),i()},!1)}catch(p){console.warn(p),s.message.warning(r("ap.apUpload.foldersNotSupported")),i()}}}function G(t){const n=t.target;B(n==null?void 0:n.files),f.value&&(f.value.value="")}async function B(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(r("ap.apUpload.maxUploadFileSize",{maxSize:_}));return}if(!x.fileMatchesAccept(t[0],h)){s.message.warning(r("ap.apUpload.fileFormatNotSupported"));return}}if(o.value=t[0],l.value=2,d.value=0,a.value="",u.value++,typeof U=="function"){U({onProgress:n=>{d.value=n},onError:n=>{s.message.warning(n||r("ap.apUpload.networkAnomaly")),l.value=1,o.value=null,u.value--},onSuccess:n=>{a.value=w.getReturnData(D,n,o.value.name),l.value=3,u.value--},file:t[0]});return}try{await z.useOssInit(R),V({file:o.value,dirName:P,oss:F,successCallBack(n){a.value=w.getReturnData(D,n,o.value.name),l.value=3,u.value--},errorCallBack(n){s.message.warning(n||r("ap.apUpload.networkAnomaly")),l.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:r("ap.apUpload.networkAnomaly")),l.value=1,o.value=null,u.value--}}}function W(){o.value&&!(a!=null&&a.value)&&F.pauseUpload(),l.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")]:l.value===1}),onClick:T,onDragenter:q,onDragover:I,onDragleave:q,onDrop:$},[e.createElementVNode("input",{style:{display:"none"},type:"file",ref_key:"fileRef",ref:f,accept:e.unref(h),onChange:G},null,40,X),l.value===1?(e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("img",{class:"state-un-icon",src:e.unref(O.default)},null,8,Z),e.createElementVNode("div",ee,e.toDisplayString(e.unref(L)),1),e.createElementVNode("div",te,e.toDisplayString(typeof e.unref(k)=="string"&&e.unref(k).length>0?e.unref(k):`${e.unref(r)("ap.apUpload.supportExtension")}:${e.unref(x.getAcceptText)(e.unref(h))},${e.unref(r)("ap.apUpload.maxWarnUploadFileSize",{maxSize:e.unref(_)})}`),1)])):e.createCommentVNode("",!0),[2,3].includes(l.value)?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",ae,[e.createElementVNode("img",{src:e.unref(O.default)},null,8,oe)]),e.createElementVNode("div",le,[e.createElementVNode("div",{class:"center-title",style:e.normalizeStyle({color:j.value?"#0070FF":"#182948"})},e.toDisplayString((c=o.value)==null?void 0:c.name),5),e.createElementVNode("div",re,[j.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(W,["stop"])},[e.createVNode(e.unref(J.DeleteOutlined))])])):e.createCommentVNode("",!0)],34)}}});exports.default=se;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { Oss } from '@aplus-frontend/oss';
|
|
1
|
+
import { client, Oss } from '@aplus-frontend/oss';
|
|
2
|
+
import { Translator } from '../../config-provider';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
|
|
2
5
|
export type { Oss } from '@aplus-frontend/oss';
|
|
6
|
+
export type GetOssAccess = Parameters<typeof client.initOssClient>[0]['getOssAccess'];
|
|
7
|
+
export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
|
|
3
8
|
declare function put({ file, dirName, oss, successCallBack, errorCallBack, progressCallBack }: {
|
|
4
9
|
file: File;
|
|
5
10
|
dirName: string;
|
|
6
|
-
oss:
|
|
11
|
+
oss: Oss;
|
|
7
12
|
successCallBack: (saveUrl: string, previewUrl: string) => void;
|
|
8
13
|
errorCallBack: (msg: string) => void;
|
|
9
14
|
progressCallBack: (p: number) => void;
|
|
@@ -12,8 +17,8 @@ export declare function useOss(): {
|
|
|
12
17
|
client: Oss;
|
|
13
18
|
put: typeof put;
|
|
14
19
|
};
|
|
15
|
-
export declare function useOssInit(getOssAccess:
|
|
20
|
+
export declare function useOssInit(getOssAccess: GetOssAccess): Promise<{
|
|
16
21
|
client: Oss;
|
|
17
22
|
put: typeof put;
|
|
18
23
|
}>;
|
|
19
|
-
export declare function getOssInstance(getOssAccess:
|
|
24
|
+
export declare function getOssInstance(getOssAccess: Parameters<typeof client.initOssClient>[0]['getOssAccess']): Promise<Oss>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@aplus-frontend/oss");let a,l;function f(e,s){a=e,l=s}const m={"zh-cn":"zh_CN",en:"en_US"};function p(){return m[l.value]??"zh_CN"}async function w({file:e,dirName:s,oss:n,successCallBack:u,errorCallBack:o,progressCallBack:O}){if(!s){o("required dirName");return}try{const t=await n.put({fileName:e.name,dirName:s,data:e,progressCallBack:i=>{O(i)}});if(t.status===204)return;if(t.status===200){const{saveUrl:i,previewUrl:g}=t;u(i,g)}else o((t==null?void 0:t.message)||a("ap.apUpload.networkAnomaly"))}catch(t){o(t)}}function r(){return{client:c.client,put:w}}async function d(e){if(!e)throw new Error(`${a("ap.apUpload.pleasePass")}getOssAccess`);return await c.client.initOssClient({getOssAccess:e,locale:p(),onFailure:s=>{throw new Error(typeof(s==null?void 0:s.message)=="string"?s.message:a("ap.apUpload.FailedToObtainOssTemporaryPermissions"))}}),r()}async function y(e){if(!e)throw new Error(`${a("ap.apUpload.pleasePass")}getOssAccess`);const s=c.createOssInstance();return await s.initOssClient({getOssAccess:e,locale:p(),onFailure:n=>{throw new Error(typeof(n==null?void 0:n.message)=="string"?n.message:a("ap.apUpload.FailedToObtainOssTemporaryPermissions"))}}),s}exports.getOssInstance=y;exports.injectLocaleToOss=f;exports.useOss=r;exports.useOssInit=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("mime");let a;function f(t){a=t}function y(t,i){var p,c,o,l;const e=i.split(",").map(n=>n.trim());for(const n of e){if(n==="*")return!0;if(n.endsWith("/*")){const[s]=n.split("/"),[u]=t.type.split("/");if(s===u)return!0}else if(/^\./.test(n)){if(t.type===r.getType(n))return!0;const s=(p=t.name)==null?void 0:p.lastIndexOf(".");if(s>-1&&((c=t.name)==null?void 0:c.slice(s))===n)return!0}else{if(t.type===n)return!0;const s=(o=t.name)==null?void 0:o.lastIndexOf(".");if(s>-1&&[...r.getAllExtensions(n)||[]].map(d=>`.${d}`).includes((l=t.name)==null?void 0:l.slice(s)))return!0}}return!1}function m(t){const i={image:a("ap.apUpload.pictureType"),video:a("ap.apUpload.videoType"),audio:a("ap.apUpload.audioType"),application:a("ap.apUpload.documentType"),"*":a("ap.apUpload.allTypes")};return t.split(",").map(e=>e.trim()).map(e=>{if(e==="*")return i[e];if(e.endsWith("/*")){const[p]=e.split("/");return i[p]||p}else return/^\./.test(e)?e:[...r.getAllExtensions(e)||[]].map(p=>`.${p}`).join(",")||e}).join(",")}exports.fileMatchesAccept=y;exports.getAcceptText=m;exports.injectLocaleToAccept=f;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { ApStatusGroupProps,
|
|
1
|
+
import { ApStatusGroupProps, ApStatusProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
3
|
|
|
4
4
|
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApStatusGroupProps>, {
|
|
5
5
|
currentValue: number;
|
|
6
6
|
padding: number;
|
|
7
7
|
statusList: null;
|
|
8
|
+
show: boolean;
|
|
8
9
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApStatusGroupProps>, {
|
|
9
10
|
currentValue: number;
|
|
10
11
|
padding: number;
|
|
11
12
|
statusList: null;
|
|
13
|
+
show: boolean;
|
|
12
14
|
}>>>, {
|
|
13
15
|
padding: number;
|
|
16
|
+
show: boolean;
|
|
14
17
|
currentValue: string | number;
|
|
15
|
-
statusList:
|
|
18
|
+
statusList: Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
19
|
+
value: string | number;
|
|
20
|
+
}>[] | null;
|
|
16
21
|
}, {}>;
|
|
17
22
|
export default _default;
|
|
18
23
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -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("./ApStatus.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("./ApStatus.vue.js");const n=require("../../config-provider/hooks/use-namespace.js"),o=require("./ApStatus.vue2.js"),p=e.defineComponent({name:"ApStatusGroup",__name:"ApStatusGroup",props:{padding:{default:8},currentValue:{default:0},statusList:{default:null},style:{},show:{type:Boolean,default:!0}},setup(r){const t=r,a=e.computed(()=>({"padding-left":t.padding+"px","padding-right":t.padding+"px",...t.style})),{b:s}=n.useNamespace("ap-status-group");return(l,c)=>t.statusList?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(s)()]),style:e.normalizeStyle(a.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.statusList,u=>(e.openBlock(),e.createBlock(o.default,{key:u.value,show:u.value===l.currentValue,color:u.color,text:u.text,padding:t.padding},null,8,["show","color","text","padding"]))),128))],6)):e.createCommentVNode("",!0)}});exports.default=p;
|
|
@@ -5,12 +5,15 @@ export type ApStatusProps = {
|
|
|
5
5
|
show?: boolean;
|
|
6
6
|
style?: object;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type ApStatusGroupItemUnion = Pick<ApStatusProps, 'text' | 'color'> & {
|
|
9
9
|
value: number | string;
|
|
10
10
|
};
|
|
11
|
+
export type ApStatusGroupItemProps = Required<ApStatusGroupItemUnion>;
|
|
11
12
|
export type ApStatusGroupProps = {
|
|
12
13
|
padding: number;
|
|
13
14
|
currentValue: number | string;
|
|
14
15
|
statusList: ApStatusGroupItemProps[] | null;
|
|
15
16
|
style?: object;
|
|
17
|
+
show?: boolean;
|
|
16
18
|
};
|
|
19
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, Plugin, CSSProperties } from 'vue';
|
|
2
2
|
import { LiteralUnion } from 'ant-design-vue/es/_util/type';
|
|
3
3
|
import { TooltipPlacement } from 'ant-design-vue/es/tooltip';
|
|
4
|
-
import {
|
|
4
|
+
import { ApStatusProps } from './ap-status/interface';
|
|
5
5
|
export type { ApTitleProps } from './title/interface';
|
|
6
6
|
export type { ApExpandAlertProps } from './expandAlert/interface';
|
|
7
7
|
export type { ApLabelProps } from './ap-label/interface';
|
|
@@ -711,13 +711,19 @@ export declare const ApStatusGroup: {
|
|
|
711
711
|
required: true;
|
|
712
712
|
default: number;
|
|
713
713
|
};
|
|
714
|
+
show: {
|
|
715
|
+
type: PropType<boolean>;
|
|
716
|
+
default: boolean;
|
|
717
|
+
};
|
|
714
718
|
currentValue: {
|
|
715
719
|
type: PropType<string | number>;
|
|
716
720
|
required: true;
|
|
717
721
|
default: number;
|
|
718
722
|
};
|
|
719
723
|
statusList: {
|
|
720
|
-
type: PropType<
|
|
724
|
+
type: PropType<Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
725
|
+
value: string | number;
|
|
726
|
+
}>[] | null>;
|
|
721
727
|
required: true;
|
|
722
728
|
default: null;
|
|
723
729
|
};
|
|
@@ -730,20 +736,29 @@ export declare const ApStatusGroup: {
|
|
|
730
736
|
required: true;
|
|
731
737
|
default: number;
|
|
732
738
|
};
|
|
739
|
+
show: {
|
|
740
|
+
type: PropType<boolean>;
|
|
741
|
+
default: boolean;
|
|
742
|
+
};
|
|
733
743
|
currentValue: {
|
|
734
744
|
type: PropType<string | number>;
|
|
735
745
|
required: true;
|
|
736
746
|
default: number;
|
|
737
747
|
};
|
|
738
748
|
statusList: {
|
|
739
|
-
type: PropType<
|
|
749
|
+
type: PropType<Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
750
|
+
value: string | number;
|
|
751
|
+
}>[] | null>;
|
|
740
752
|
required: true;
|
|
741
753
|
default: null;
|
|
742
754
|
};
|
|
743
755
|
}>>, {
|
|
744
756
|
padding: number;
|
|
757
|
+
show: boolean;
|
|
745
758
|
currentValue: string | number;
|
|
746
|
-
statusList:
|
|
759
|
+
statusList: Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
760
|
+
value: string | number;
|
|
761
|
+
}>[] | null;
|
|
747
762
|
}, true, {}, {}, {
|
|
748
763
|
P: {};
|
|
749
764
|
B: {};
|
|
@@ -760,20 +775,29 @@ export declare const ApStatusGroup: {
|
|
|
760
775
|
required: true;
|
|
761
776
|
default: number;
|
|
762
777
|
};
|
|
778
|
+
show: {
|
|
779
|
+
type: PropType<boolean>;
|
|
780
|
+
default: boolean;
|
|
781
|
+
};
|
|
763
782
|
currentValue: {
|
|
764
783
|
type: PropType<string | number>;
|
|
765
784
|
required: true;
|
|
766
785
|
default: number;
|
|
767
786
|
};
|
|
768
787
|
statusList: {
|
|
769
|
-
type: PropType<
|
|
788
|
+
type: PropType<Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
789
|
+
value: string | number;
|
|
790
|
+
}>[] | null>;
|
|
770
791
|
required: true;
|
|
771
792
|
default: null;
|
|
772
793
|
};
|
|
773
794
|
}>>, {}, {}, {}, {}, {
|
|
774
795
|
padding: number;
|
|
796
|
+
show: boolean;
|
|
775
797
|
currentValue: string | number;
|
|
776
|
-
statusList:
|
|
798
|
+
statusList: Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
799
|
+
value: string | number;
|
|
800
|
+
}>[] | null;
|
|
777
801
|
}>;
|
|
778
802
|
__isFragment?: undefined;
|
|
779
803
|
__isTeleport?: undefined;
|
|
@@ -787,20 +811,29 @@ export declare const ApStatusGroup: {
|
|
|
787
811
|
required: true;
|
|
788
812
|
default: number;
|
|
789
813
|
};
|
|
814
|
+
show: {
|
|
815
|
+
type: PropType<boolean>;
|
|
816
|
+
default: boolean;
|
|
817
|
+
};
|
|
790
818
|
currentValue: {
|
|
791
819
|
type: PropType<string | number>;
|
|
792
820
|
required: true;
|
|
793
821
|
default: number;
|
|
794
822
|
};
|
|
795
823
|
statusList: {
|
|
796
|
-
type: PropType<
|
|
824
|
+
type: PropType<Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
825
|
+
value: string | number;
|
|
826
|
+
}>[] | null>;
|
|
797
827
|
required: true;
|
|
798
828
|
default: null;
|
|
799
829
|
};
|
|
800
830
|
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
801
831
|
padding: number;
|
|
832
|
+
show: boolean;
|
|
802
833
|
currentValue: string | number;
|
|
803
|
-
statusList:
|
|
834
|
+
statusList: Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
835
|
+
value: string | number;
|
|
836
|
+
}>[] | null;
|
|
804
837
|
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & Plugin<any[]> & (new (...args: any[]) => {
|
|
805
838
|
$props: {
|
|
806
839
|
onClick?: (() => void) | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import { LocaleType } from '../locale/interface';
|
|
3
|
-
import { ApiType, ScrollbarGlobalConfig, TableDefaultConfig } from './constants';
|
|
3
|
+
import { ApiType, ScrollbarGlobalConfig, TableDefaultConfig, ApUploadConfig } from './constants';
|
|
4
4
|
import { default as __DTS_DEFAULT_0__ } from 'ant-design-vue/es/config-provider/renderEmpty';
|
|
5
5
|
import { TransformCellTextProps } from 'ant-design-vue/es/table/interface';
|
|
6
6
|
import { CSPConfig, SizeType, ThemeConfig } from 'ant-design-vue/es/config-provider/context';
|
|
@@ -148,5 +148,9 @@ export declare const configProviderProps: () => {
|
|
|
148
148
|
type: PropType<"aplus" | "admin">;
|
|
149
149
|
default: string;
|
|
150
150
|
};
|
|
151
|
+
apUpload: {
|
|
152
|
+
type: PropType<ApUploadConfig>;
|
|
153
|
+
default: () => {};
|
|
154
|
+
};
|
|
151
155
|
};
|
|
152
156
|
export type ConfigProviderProps = Partial<ExtractPropTypes<ReturnType<typeof configProviderProps>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ant-design-vue/es/config-provider/context"),t=()=>({aplusLocale:{type:Object},namespace:{type:String,default:"aplus"},api:{type:Object,default:()=>({})},table:{type:Object},scrollbar:{type:Object,default:()=>({native:!1})},uiMode:{type:String,default:"aplus"},...e.configProviderProps()});exports.configProviderProps=t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ant-design-vue/es/config-provider/context"),t=()=>({aplusLocale:{type:Object},namespace:{type:String,default:"aplus"},api:{type:Object,default:()=>({})},table:{type:Object},scrollbar:{type:Object,default:()=>({native:!1})},uiMode:{type:String,default:"aplus"},apUpload:{type:Object,default:()=>({})},...e.configProviderProps()});exports.configProviderProps=t;
|
|
@@ -8,7 +8,7 @@ import { ValidateMessages } from 'ant-design-vue/es/form/interface';
|
|
|
8
8
|
import { RequiredMark } from 'ant-design-vue/es/form/Form';
|
|
9
9
|
import { ThemeConfig } from 'ant-design-vue/es/config-provider/context';
|
|
10
10
|
import { LocaleType } from '..';
|
|
11
|
-
import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig } from './constants';
|
|
11
|
+
import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig } from './constants';
|
|
12
12
|
export declare const ConfigProvider: DefineComponent<{
|
|
13
13
|
iconPrefixCls: StringConstructor;
|
|
14
14
|
getTargetContainer: {
|
|
@@ -146,6 +146,10 @@ export declare const ConfigProvider: DefineComponent<{
|
|
|
146
146
|
type: PropType<"aplus" | "admin">;
|
|
147
147
|
default: string;
|
|
148
148
|
};
|
|
149
|
+
apUpload: {
|
|
150
|
+
type: PropType<ApUploadConfig>;
|
|
151
|
+
default: () => {};
|
|
152
|
+
};
|
|
149
153
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
150
154
|
iconPrefixCls: StringConstructor;
|
|
151
155
|
getTargetContainer: {
|
|
@@ -283,6 +287,10 @@ export declare const ConfigProvider: DefineComponent<{
|
|
|
283
287
|
type: PropType<"aplus" | "admin">;
|
|
284
288
|
default: string;
|
|
285
289
|
};
|
|
290
|
+
apUpload: {
|
|
291
|
+
type: PropType<ApUploadConfig>;
|
|
292
|
+
default: () => {};
|
|
293
|
+
};
|
|
286
294
|
}>>, {
|
|
287
295
|
theme: ThemeConfig;
|
|
288
296
|
direction: "ltr" | "rtl";
|
|
@@ -319,5 +327,6 @@ export declare const ConfigProvider: DefineComponent<{
|
|
|
319
327
|
api: ApiType;
|
|
320
328
|
scrollbar: ScrollbarGlobalConfig;
|
|
321
329
|
uiMode: "aplus" | "admin";
|
|
330
|
+
apUpload: ApUploadConfig;
|
|
322
331
|
}, {}>;
|
|
323
332
|
export type ConfigProviderInstance = InstanceType<typeof ConfigProvider>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),a=require("ant-design-vue"),l=require("./hooks/use-global-config.js"),c=require("./config-provider-props.js"),u=require("./constants.js"),d=require("../utils/config-provider-preset.js");function s(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!o.isVNode(e)}const f=o.defineComponent({name:"AplusConfigProvider",props:c.configProviderProps(),setup(e,{slots:n}){const i=o.computed(()=>({namespace:e.namespace,aplusLocale:e.aplusLocale,api:e.api,table:{...u.tableDefaultConfig,...e.table||{}},scrollbar:e.scrollbar,uiMode:e.uiMode,apUpload:e.apUpload})),t=l.provideGlobalConfig(i);return()=>{let r;return o.createVNode(a.ConfigProvider,d.mergeAntdProvideConfig(e),s(r=o.renderSlot(n,"default",{config:t==null?void 0:t.value}))?r:{default:()=>[r]})}}});exports.ConfigProvider=f;
|
|
@@ -3,6 +3,7 @@ import { InjectionKey, Ref } from 'vue';
|
|
|
3
3
|
import { SizeType, SorterResult } from '../pro-table/types/table';
|
|
4
4
|
import { Fn } from '../type';
|
|
5
5
|
import { CommonOptionItem, ApiSelectOption } from '../pro-form/components/interface';
|
|
6
|
+
import { client } from '@aplus-frontend/oss';
|
|
6
7
|
|
|
7
8
|
export type ConfigProviderContext = Partial<ConfigProviderProps>;
|
|
8
9
|
export declare const configProviderContextKey: InjectionKey<Ref<ConfigProviderContext>>;
|
|
@@ -29,4 +30,13 @@ export type ApiType = {
|
|
|
29
30
|
radioGroup?: (args?: any) => Promise<CommonOptionItem[]>;
|
|
30
31
|
select?: (args?: any) => Promise<ApiSelectOption[]>;
|
|
31
32
|
};
|
|
33
|
+
export type ApUploadConfig = {
|
|
34
|
+
dirName?: string;
|
|
35
|
+
getOssAccess?: Parameters<typeof client.initOssClient>[0]['getOssAccess'];
|
|
36
|
+
needName?: boolean | {
|
|
37
|
+
pathKey?: string;
|
|
38
|
+
nameKey?: string;
|
|
39
|
+
};
|
|
40
|
+
accept?: string;
|
|
41
|
+
};
|
|
32
42
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MaybeRef } from '@aplus-frontend/utils';
|
|
2
2
|
import { App, Ref, ComputedRef, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
-
import { ConfigProviderContext, ApiType, TableDefaultConfig, ScrollbarGlobalConfig } from '../constants';
|
|
3
|
+
import { ConfigProviderContext, ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig } from '../constants';
|
|
4
4
|
import { default as __DTS_DEFAULT_0__ } from 'ant-design-vue/es/config-provider/renderEmpty';
|
|
5
5
|
import { TransformCellTextProps } from 'ant-design-vue/es/table/interface';
|
|
6
6
|
import { CSPConfig } from 'ant-design-vue/es/config-provider';
|
|
@@ -151,4 +151,8 @@ export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContex
|
|
|
151
151
|
type: PropType<"aplus" | "admin">;
|
|
152
152
|
default: string;
|
|
153
153
|
};
|
|
154
|
+
apUpload: {
|
|
155
|
+
type: PropType<ApUploadConfig>;
|
|
156
|
+
default: () => {};
|
|
157
|
+
};
|
|
154
158
|
}>>>> | undefined;
|