@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
|
@@ -16,6 +16,30 @@ export interface ApLadderLabelValue {
|
|
|
16
16
|
* 值
|
|
17
17
|
*/
|
|
18
18
|
value: string | number | undefined | null;
|
|
19
|
+
/**
|
|
20
|
+
* 是否采用原始值
|
|
21
|
+
*/
|
|
22
|
+
rawValue?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 精度 默认2位小数
|
|
25
|
+
*/
|
|
26
|
+
precision?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 千分位展示
|
|
29
|
+
*/
|
|
30
|
+
thousand?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 千分位分隔符
|
|
33
|
+
*/
|
|
34
|
+
thousandSeparator?: string;
|
|
35
|
+
/**
|
|
36
|
+
* 货币单位
|
|
37
|
+
*/
|
|
38
|
+
currency?: CurrencyCode;
|
|
39
|
+
/**
|
|
40
|
+
* 百分比展示
|
|
41
|
+
*/
|
|
42
|
+
percent?: boolean;
|
|
19
43
|
/**
|
|
20
44
|
* 自定义单位
|
|
21
45
|
*/
|
|
@@ -90,3 +114,21 @@ export interface ApLadderProps {
|
|
|
90
114
|
export interface ApLadderSlots {
|
|
91
115
|
title?: VNode;
|
|
92
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* 国际货币代码-映射-语言
|
|
119
|
+
*/
|
|
120
|
+
export interface CurrencyCodeInLocale {
|
|
121
|
+
[string: string]: Intl.LocalesArgument;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 国际货币代码
|
|
125
|
+
* - `CNY` 人民币
|
|
126
|
+
* - `USD` 美元
|
|
127
|
+
* - `EUR` 欧元
|
|
128
|
+
* - `GBP` 英镑
|
|
129
|
+
*/
|
|
130
|
+
export type CurrencyCode = 'CNY' | 'USD' | 'EUR' | 'GBP';
|
|
131
|
+
/**
|
|
132
|
+
* 国际货币代码-映射-语言
|
|
133
|
+
*/
|
|
134
|
+
export declare const locales: CurrencyCodeInLocale;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApTableProps } from '../../';
|
|
2
|
+
import { UseTableRefreshOption } from './useTableRefresh';
|
|
2
3
|
import { Recordable } from '../../type';
|
|
3
4
|
export interface UsePageListApTable extends ApTableProps {
|
|
4
5
|
/** 是否显示默认的行选择配置
|
|
@@ -15,6 +16,10 @@ export interface UsePageListApTable extends ApTableProps {
|
|
|
15
16
|
clearSelectionOnRequest?: boolean;
|
|
16
17
|
/** 用于覆盖默认的class */
|
|
17
18
|
class?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 表格刷新相关
|
|
21
|
+
*/
|
|
22
|
+
tableRefresh?: boolean | Omit<UseTableRefreshOption, 'apTableRef'>;
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
25
|
* 集成了列表页面的ApTable的默认配置
|
|
@@ -41,6 +46,6 @@ export declare function usePageListApTable(props?: UsePageListApTable): [ApTable
|
|
|
41
46
|
clearAll: () => void;
|
|
42
47
|
toggleSelect: (item: any) => void;
|
|
43
48
|
} | undefined;
|
|
44
|
-
} | null;
|
|
49
|
+
} | null | undefined;
|
|
45
50
|
clearSelection: () => void;
|
|
46
51
|
}];
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { merge as m } from "lodash-unified";
|
|
2
|
-
import { ref as
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ref as b } from "vue";
|
|
3
|
+
import { useTableRefresh as d } from "./useTableRefresh.mjs";
|
|
4
|
+
function h(a) {
|
|
5
|
+
return a === !0 ? {} : a === !1 ? {
|
|
6
|
+
refreshBefore: () => !1
|
|
7
|
+
} : a;
|
|
8
|
+
}
|
|
9
|
+
function F(a) {
|
|
10
|
+
const r = b(null), {
|
|
5
11
|
isShowRowSelection: c = !0,
|
|
6
12
|
clearSelectionOnRequest: u = !0,
|
|
7
13
|
transformSearchFormValues: o,
|
|
8
|
-
api:
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
api: s,
|
|
15
|
+
tableRefresh: i = !1,
|
|
16
|
+
...f
|
|
17
|
+
} = a || {}, n = () => {
|
|
11
18
|
var e, t;
|
|
12
19
|
(t = (e = r.value) == null ? void 0 : e.rowSelection) == null || t.clearAll();
|
|
13
20
|
};
|
|
14
|
-
return
|
|
21
|
+
return d({
|
|
22
|
+
...h(i),
|
|
23
|
+
apTableRef: r
|
|
24
|
+
}), [m(
|
|
15
25
|
{
|
|
16
26
|
// scroll,tableLayout,columnResizable设置表格可拖动
|
|
17
27
|
scroll: { x: "100%", y: "100%" },
|
|
@@ -19,17 +29,17 @@ function y(n) {
|
|
|
19
29
|
columnResizable: !0,
|
|
20
30
|
// 表格header吸顶效果
|
|
21
31
|
class: "ap-table--sticky",
|
|
22
|
-
request:
|
|
32
|
+
request: s ? async (e) => {
|
|
23
33
|
const t = o ? o(e) : e;
|
|
24
34
|
try {
|
|
25
|
-
if (!
|
|
26
|
-
const { records:
|
|
27
|
-
return u &&
|
|
28
|
-
data:
|
|
35
|
+
if (!s) throw new Error("api is not defined");
|
|
36
|
+
const { records: l, total: p } = await s(t);
|
|
37
|
+
return u && n(), {
|
|
38
|
+
data: l,
|
|
29
39
|
total: p
|
|
30
40
|
};
|
|
31
|
-
} catch (
|
|
32
|
-
return console.error(
|
|
41
|
+
} catch (l) {
|
|
42
|
+
return console.error(l), {
|
|
33
43
|
data: [],
|
|
34
44
|
total: 0
|
|
35
45
|
};
|
|
@@ -44,7 +54,7 @@ function y(n) {
|
|
|
44
54
|
r.value = e;
|
|
45
55
|
}
|
|
46
56
|
},
|
|
47
|
-
|
|
57
|
+
f
|
|
48
58
|
), {
|
|
49
59
|
reload: () => {
|
|
50
60
|
var e;
|
|
@@ -60,9 +70,9 @@ function y(n) {
|
|
|
60
70
|
return o ? o(e) : e;
|
|
61
71
|
},
|
|
62
72
|
getApTableInstance: () => r.value,
|
|
63
|
-
clearSelection:
|
|
73
|
+
clearSelection: n
|
|
64
74
|
}];
|
|
65
75
|
}
|
|
66
76
|
export {
|
|
67
|
-
|
|
77
|
+
F as usePageListApTable
|
|
68
78
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { ApTableExpose } from '
|
|
3
|
-
interface UseTableRefreshOption {
|
|
2
|
+
import { ApTableExpose } from '../../';
|
|
3
|
+
export interface UseTableRefreshOption {
|
|
4
4
|
/**
|
|
5
5
|
* apTable实例
|
|
6
6
|
*/
|
|
7
|
-
apTableRef?: Ref<ApTableExpose | undefined>;
|
|
7
|
+
apTableRef?: Ref<ApTableExpose | undefined | null>;
|
|
8
8
|
/**
|
|
9
9
|
* 刷新类型,reset:重置,submit:提交
|
|
10
10
|
*/
|
|
@@ -15,4 +15,3 @@ interface UseTableRefreshOption {
|
|
|
15
15
|
refreshBefore?: () => boolean;
|
|
16
16
|
}
|
|
17
17
|
export declare function useTableRefresh(option?: UseTableRefreshOption): void;
|
|
18
|
-
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { onMounted as c, nextTick as l, onActivated as T } from "vue";
|
|
2
|
+
function m(e) {
|
|
3
3
|
const a = (["reset", "submit", void 0].includes(e == null ? void 0 : e.refreskType) ? e == null ? void 0 : e.refreskType : "submit") ?? "submit", r = (e == null ? void 0 : e.refreshBefore) ?? (() => !0);
|
|
4
4
|
let s = !0;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (s) {
|
|
5
|
+
c(() => {
|
|
6
|
+
l(() => {
|
|
8
7
|
s = !1;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
});
|
|
9
|
+
}), T(() => {
|
|
10
|
+
var u, f;
|
|
11
|
+
s || r != null && r() && ((f = (u = e == null ? void 0 : e.apTableRef) == null ? void 0 : u.value) == null || f[a]());
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
m as useTableRefresh
|
|
16
16
|
};
|
|
@@ -3,7 +3,7 @@ import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOpt
|
|
|
3
3
|
import { TooltipPlacement, AdjustOverflow } from 'ant-design-vue/es/tooltip';
|
|
4
4
|
import { VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
5
5
|
import { LiteralUnion, Key } from 'ant-design-vue/es/_util/type';
|
|
6
|
-
import { ApStatusProps, ApStatusGroupItemProps, ApSelectItem, ApLabelGroupItemProps, ApBatchActionGroupMenuProps } from '.';
|
|
6
|
+
import { ApStatusProps, ApStatusGroupItemProps, ApSelectItem, ApLabelGroupItemProps, ApBatchActionGroupMenuProps, ApLadderLabelValue } from '.';
|
|
7
7
|
import { ValueType } from 'ant-design-vue/es/input-number/src/utils/MiniDecimal';
|
|
8
8
|
import { ApInputRadioOptions } from './ap-input-radio';
|
|
9
9
|
import { KeyboardEventHandler, MouseEventHandler, FocusEventHandler } from 'ant-design-vue/es/_util/EventInterface';
|
|
@@ -17,7 +17,7 @@ import { accessCreate } from '@aplus-frontend/oss';
|
|
|
17
17
|
import { TriggerType } from 'ant-design-vue/es/tooltip/abstractTooltipProps';
|
|
18
18
|
import { PresetColorType } from 'ant-design-vue/es/_util/colors';
|
|
19
19
|
import { AlignType, BuildInPlacements } from 'ant-design-vue/es/vc-trigger/interface';
|
|
20
|
-
import {
|
|
20
|
+
import { ApLadderSlots } from './ap-ladder/interface';
|
|
21
21
|
import { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
|
|
22
22
|
export * from './hooks/index';
|
|
23
23
|
export type { ApTitleProps } from './title/interface';
|
|
@@ -27,7 +27,7 @@ export type { ApStatusProps, ApStatusGroupProps, ApStatusGroupItemProps } from '
|
|
|
27
27
|
export type { ApSelectItem, ApSelectLayoutProps } from './ap-select-layout/interface';
|
|
28
28
|
export type { ApInputRadioProps, ApInputValType } from './ap-input-radio/interface';
|
|
29
29
|
export type { ApExportGroupProps } from './ap-export-group/interface';
|
|
30
|
-
export type { ApLadderProps } from './ap-ladder/interface';
|
|
30
|
+
export type { ApLadderProps, ApLadderLabelValue, CurrencyCode, TooltipNeedProps } from './ap-ladder/interface';
|
|
31
31
|
export * from './ap-batch-action-group/interface';
|
|
32
32
|
export type { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
|
|
33
33
|
export declare const ApTitle: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),F=require("ant-design-vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),F=require("ant-design-vue"),D=require("ant-design-vue/es/theme/internal"),u=require("lodash-unified"),T=require("./constant.js"),z=require("@ant-design/icons-vue");require("../config-provider/index.js");const A=require("./context.js");require("./style/ap-form-item.css");const O=require("@fruits-chain/utils"),R=require("../config-provider/hooks/use-namespace.js"),j=["title"],E=e.defineComponent({name:"ApFormItem",__name:"ap-form-item",props:{htmlFor:{},prefixCls:{},label:{},help:{},extra:{},labelCol:{},wrapperCol:{},hasFeedback:{type:Boolean,default:!1},colon:{type:Boolean,default:void 0},labelAlign:{},prop:{},name:{},rules:{},autoLink:{type:Boolean,default:!0},required:{type:Boolean,default:void 0},validateFirst:{type:Boolean,default:void 0},validateStatus:{},validateTrigger:{},messageVariables:{},hidden:{type:Boolean},noStyle:{type:Boolean},tooltip:{},span:{},order:{},offset:{},push:{},pull:{},xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},flex:{},bordered:{type:Boolean,default:!1},valuePropName:{default:"value"},initialValue:{},_signal:{}},setup(g,{expose:B}){var y,b;const t=g,l=e.useSlots(),{model:i,updateModel:s,internalInstance:d}=A.useInjectForm(),{m:f,b:C}=R.useNamespace("ap-form-item"),c=e.ref(!1),r=e.ref(),[,V]=D.useToken();e.onMounted(async()=>{let o=u.isFunction(t.initialValue)?t.initialValue():t.initialValue;O.isPromise(o)&&(o=await o),d==null||d.registerField({name:t.name,initialValue:u.cloneDeep(o)})});const m=e.computed(()=>t.name?u.isArray(t.name)?t.name.reduce((o,n)=>o==null?void 0:o[n],e.unref(i)):i==null?void 0:i.value[t.name]:null),p=e.ref((b=(y=l.default)==null?void 0:y.call(l))==null?void 0:b[0]);e.watch(()=>{var o;return(o=l.default)==null?void 0:o.call(l)},o=>{p.value=o==null?void 0:o[0]});function k(o){s==null||s(t.name,o)}function q(){c.value=!0}function N(){c.value=!1}const v=e.computed(()=>{var n,a;if(!t.name)return(n=l.default())==null?void 0:n[0];const o=e.unref(p);return o?e.cloneVNode(o,{[t.valuePropName]:e.unref(m),[`onUpdate:${t.valuePropName}`]:k,bordered:t.bordered?!1:(a=o==null?void 0:o.props)==null?void 0:a.bordered,onFocus:q,onBlur:N}):null});function P(){var o;(o=r.value)==null||o.onFieldBlur()}function S(){var o;(o=r.value)==null||o.onFieldChange()}function w(){var o;(o=r.value)==null||o.clearValidate()}function x(){var o;(o=r.value)==null||o.resetField()}function _(){return e.unref(m)}return B({onFieldBlur:P,onFieldChange:S,clearValidate:w,resetField:x,getFieldValue:_}),(o,n)=>(e.openBlock(),e.createBlock(e.unref(F.Form).Item,e.mergeProps({ref_key:"formItemRef",ref:r},e.unref(u.omit)(t,[...e.unref(T.apFormItemColPropKeys),"tooltip","label"]),{class:{[e.unref(f)("bordered")]:o.bordered,[e.unref(f)("focused")]:o.bordered&&c.value,[e.unref(C)()]:!0},colon:o.bordered?!1:t.colon}),e.createSlots({default:e.withCtx(()=>[v.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(v.value),{key:0})):e.createCommentVNode("",!0)]),_:2},[t.tooltip?{name:"tooltip",fn:e.withCtx(({class:a})=>[e.createElementVNode("span",{class:e.normalizeClass(a)},[e.createVNode(e.unref(F.Tooltip),{title:t.tooltip},{default:e.withCtx(()=>[e.createVNode(e.unref(z.QuestionCircleOutlined),{style:e.normalizeStyle({color:e.unref(V).colorPrimary})},null,8,["style"])]),_:1},8,["title"])],2)]),key:"0"}:void 0,o.label?{name:"label",fn:e.withCtx(()=>[e.createElementVNode("span",{title:o.label,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},e.toDisplayString(o.label),9,j)]),key:"1"}:void 0,e.renderList(e.unref(u.omit)(l,"default"),(a,h)=>({name:h,fn:e.withCtx(I=>[e.renderSlot(o.$slots,h,e.normalizeProps(e.guardReactiveProps(I||{})))])}))]),1040,["class","colon"]))}});exports.default=E;
|
|
@@ -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 f=require("../utils/returnData.js"),q=require("../hooks/useOss.js"),c=require("ant-design-vue"),R=require("@ant-design/icons-vue"),T=require("../utils/accept.js");require("../styles/multiple-file.css");const I=require("../../config-provider/hooks/use-locale.js"),P=require("../../config-provider/hooks/use-namespace.js"),O={class:"multiple-file-context"},z={key:0},M={key:1},V=e.defineComponent({__name:"MultipleFile",setup($){const{t:o}=I.useLocale(),{b:y}=P.useNamespace("ap-upload-multiple-file"),{put:U}=q.useOss(),A=e.inject("theme"),B=e.inject("dirName"),x=e.inject("accept")||"*",w=e.inject("maxSize")??500,E=e.inject("title")||o("ap.apUpload.uploadFile"),v=e.inject("subTitle"),i=e.inject("maxCount")??10,p=e.inject("uploadingCount"),C=e.inject("beforeUpload"),_=e.inject("customRequest"),F=e.inject("getOssAccess"),s=e.inject("value"),g=[],d=e.inject("needName"),l=e.ref(null);e.watch(()=>s==null?void 0:s.value,function(t){var n,a;!((a=(n=l==null?void 0:l.value)==null?void 0:n.fileList)!=null&&a.length)&&t&&e.nextTick(()=>{const r=t.map(u=>{const j=f.getPath(d,u),L=f.getName(d,u),k=new File([u],L,{});return k.response=j,k.uid=j,k});if(i&&r.length>i){c.message.warning(o("ap.apUpload.fileInitializationException",{maxCount:i}));return}r.forEach(u=>{m.push(u),g.push({uid:u.uid,path:u.response})}),l.value.fileList=r})},{immediate:!0});let m=[],N;function h(t){setTimeout(()=>{const n=l.value.fileList.findIndex(a=>a.uid===t.uid);n>=0&&l.value.fileList.splice(n,1)})}function S(t){if(i&&i>1&&m.length>=i)return clearTimeout(N),N=setTimeout(()=>{c.message.warning(o("ap.apUpload.maxUploadFiles",{maxCount:i}))}),h(t),!1;if(typeof C=="function"){if(C(t)===!1)return h(t),!1}else{if(t.size>w*1024*1024)return c.message.warning(o("ap.apUpload.maxUploadFileSize",{maxSize:w})),h(t),!1;if(!T.fileMatchesAccept(t,x))return c.message.warning(o("ap.apUpload.fileFormatNotSupported")),h(t),!1}i&&i===1&&(m=[],s.value=void 0),m.push(t)}async function b(t){if(p.value++,typeof _=="function"){_({onProgress:n=>{setTimeout(()=>{t.onProgress({percent:n})})},onError:n=>{c.message.warning(n||o("ap.apUpload.networkAnomaly")),setTimeout(()=>{t.onError({name:n,message:n})}),p.value--},onSuccess:n=>{setTimeout(()=>{t.onSuccess(n)}),s.value?s.value.push(f.getReturnData(d,n,t.file.name)):s.value=[f.getReturnData(d,n,t.file.name)],g.push({uid:t.file.uid,path:n}),p.value--},file:t.file});return}try{const n=await q.getOssInstance(F);t.file.oss=n,U({file:t.file,dirName:B,oss:n,successCallBack(a){t.onSuccess(a),s.value?s.value.push(f.getReturnData(d,a,t.file.name)):s.value=[f.getReturnData(d,a,t.file.name)],g.push({uid:t.file.uid,path:a}),p.value--},errorCallBack(a){c.message.warning(a||o("ap.apUpload.networkAnomaly")),t.onError({name:a,message:a}),p.value--},progressCallBack(a){t.onProgress({percent:a})}})}catch(n){c.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")}),p.value--}}function D(t){var a;if(t.response){if(Array.isArray(s.value)){const r=g.findIndex(u=>u.uid===t.uid);r>=0&&(s==null||s.value.splice(r,1),g.splice(r,1)),s.value.length===0&&(s.value=void 0)}}else(a=t==null?void 0:t.oss)==null||a.pauseUpload();const n=m.findIndex(r=>r.uid===t.uid);return m.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(A)==="admin"})},[e.createVNode(e.unref(c.Upload),{ref_key:"uploadRef",ref:l,accept:e.unref(x),multiple:"",maxCount:e.unref(i),progress:{strokeWidth:3,showInfo:!1,strokeColor:"#0070FF"},beforeUpload:S,customRequest:b,onRemove:D},{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(e.unref(c.Button),{class:"file-btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(R.UploadOutlined)),e.createTextVNode(" "+e.toDisplayString(e.unref(E)),1)]),_:1}),e.createElementVNode("div",{class:"sub-title",onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[typeof e.unref(v)=="string"?(e.openBlock(),e.createElementBlock("div",z,e.toDisplayString(e.unref(v)||`${e.unref(o)("ap.apUpload.supportExtension")}:${e.unref(T.getAcceptText)(e.unref(x))}`),1)):e.unref(v)?(e.openBlock(),e.createElementBlock("div",M,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v))))])):e.createCommentVNode("",!0)])])]),_:1},8,["accept","maxCount"])],2))}});exports.default=V;
|
|
@@ -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"),
|
|
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"),U=require("@ant-design/icons-vue"),_=require("../hooks/useOss.js"),S=require("../utils/accept.js"),l=require("ant-design-vue");require("../styles/picture.css");const $=require("../../config-provider/hooks/use-locale.js"),T=require("../../config-provider/hooks/use-namespace.js"),M=["accept"],L={class:"picture-context"},G={class:"picture-item-box"},H=["src"],J={class:"picture-item-shadow"},K=["onClick"],Q={key:0,class:"picture-item-uploading"},W={class:"picture-title"},X={key:0},Y={key:1},Z=e.defineComponent({__name:"Picture",setup(F){const{t:u}=$.useLocale(),{b:y}=T.useNamespace("ap-upload-picture"),{put:j}=_.useOss(),q=e.inject("theme"),D=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){var s;if(!((s=o==null?void 0:o.value)!=null&&s.length)&&t){const a=[];for(let n of t){const c=m.getPath(f,n),d=m.getName(f,n),B=await _.getOssInstance(C),z=await B.getSignatureUrl(c),O={...new File([n],d,{}),uid:`${new Date().getTime()}-${Math.random()}`,thumbUrl:z,status:"success",percent:100,path:c};a.push(O),B.destroy()}if(r&&a.length>r){l.message.warning(u("ap.apUpload.fileInitializationException",{maxCount:r}));return}a.forEach(n=>{o.value.push(n),g.push({uid:n.uid,path:n.path})})}},{immediate:!0});function V(){var t;(t=h.value)==null||t.click()}function P(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++)b(t[s]);h.value&&(h.value.value="")}let E;function b(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)||!S.fileMatchesAccept(t,v))return l.message.warning(u("ap.apUpload.pictureFormatNotSupported")),!1}const s=new FileReader;s.readAsDataURL(t),s.onload=function(){const a={...t,uid:`${new Date().getTime()}-${Math.random()}`,thumbUrl:this.result,status:"uploading",percent:0};A(a,t)},s.onerror=function(){l.message.warning(u("ap.apUpload.imageParsingFailed"))}}async function A(t,s){if(p.value++,typeof N=="function"){N({onProgress:a=>{const n=o.value.find(c=>c.uid===t.uid);n&&(n.percent=a)},onError:a=>{l.message.warning(a||u("ap.apUpload.networkAnomaly"));const n=o.value.findIndex(c=>c.uid===t.uid);n>-1&&o.value.splice(n,1),p.value--},onSuccess:a=>{const n=o.value.find(c=>c.uid===t.uid);n&&(n.status="success",n.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--},file:s});return}try{const a=await _.getOssInstance(C);t.oss=a,o.value.push(t),j({file:s,dirName:D,oss:a,successCallBack(n){const c=o.value.find(d=>d.uid===t.uid);c&&(c.status="success",c.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--},errorCallBack(n){l.message.warning(n||u("ap.apUpload.networkAnomaly"));const c=o.value.findIndex(d=>d.uid===t.uid);c>-1&&o.value.splice(c,1),p.value--},progressCallBack(n){const c=o.value.find(d=>d.uid===t.uid);c&&(c.percent=n)}})}catch(a){l.message.warning(typeof(a==null?void 0:a.message)=="string"?a.message:u("ap.apUpload.networkAnomaly"));const n=o.value.findIndex(c=>c.uid===t.uid);n>-1&&o.value.splice(n,1),p.value--}}function I(t){var a;if(t.path){if(Array.isArray(i.value)){const n=g.findIndex(c=>c.uid===t.uid);n>=0&&(i==null||i.value.splice(n,1),g.splice(n,1)),i.value.length===0&&(i.value=void 0)}}else(a=t==null?void 0:t.oss)==null||a.pauseUpload();const s=o.value.findIndex(n=>n.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(q)==="admin"})},[e.createElementVNode("input",{style:{display:"none"},type:"file",ref_key:"fileRef",ref:h,accept:e.unref(v),onChange:P},null,40,M),e.createElementVNode("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),a=>(e.openBlock(),e.createElementBlock("div",{class:"picture-item",key:a.uid},[e.createElementVNode("div",G,[e.createElementVNode("img",{src:a.thumbUrl,alt:""},null,8,H),e.withDirectives(e.createElementVNode("div",J,[e.createElementVNode("div",{class:"picture-item-close",onClick:n=>I(a)},[e.createVNode(e.unref(U.CloseOutlined))],8,K),a.status==="uploading"?(e.openBlock(),e.createElementBlock("div",Q,[e.createVNode(e.unref(l.Progress),{percent:a.percent,strokeColor:"#ffffff",trailColor:"rgba(255, 255, 255, 0.3)",size:4,showInfo:!1},null,8,["percent"])])):e.createCommentVNode("",!0)],512),[[e.vShow,a.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:V},[e.createVNode(e.unref(U.PlusOutlined)),e.createElementVNode("div",null,e.toDisplayString(e.unref(u)("ap.apUpload.update")),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",W,[e.unref(x)?(e.openBlock(),e.createElementBlock("div",X,e.toDisplayString(e.unref(x)),1)):(e.openBlock(),e.createElementBlock("div",Y,e.toDisplayString(`${e.unref(u)("ap.apUpload.supportExtension")}:${e.unref(S.getAcceptText)(e.unref(v))},${e.unref(u)("ap.apUpload.maxUploadPictureSize",{maxSize:e.unref(k)})}`),1))])],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 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);
|
|
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){if(o.value===null&&t){const n=w.getName(D,t);l.value=3,o.value=new File([t],n,{})}},{immediate:!0});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 +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"),B=require("ant-design-vue");require("../../config-provider/index.js");const N=require("./interface.js");require("./style.css");const _=require("../../config-provider/hooks/use-namespace.js"),D=require("../../config-provider/hooks/use-global-config.js"),P={key:1},j={key:0},w={key:1},$={key:0},F=["onClick"],M={key:0},q={key:1},O={key:0},L={key:1},A=e.defineComponent({name:"ApLadder",__name:"ApLadder",props:{major:{default:""},minor:{default:""},majorColor:{default:""},minorColor:{default:""},layout:{default:"vertical"},tooltip:{type:Boolean,default:!0},labelValues:{default:()=>[]},tooltipProps:{default:()=>({title:void 0,align:{},arrowPointAtCenter:!1,arrow:!0,autoAdjustOverflow:!0,color:"",destroyTooltipOnHide:!1,getPopupContainer:()=>document.body,mouseEnterDelay:.1,mouseLeaveDelay:.1,overlayClassName:"",overlayStyle:{},overlayInnerStyle:{},placement:"top",trigger:"hover"})}},setup(C){const u=e.useSlots(),l=C,{b:S,e:r,m:g}=_.useNamespace("ap-ladder"),E=D.useGlobalConfig("uiMode","aplus"),p=`ap-ladder-${Math.floor(Math.random()*1e7)}`,h=r("ellipsis"),s=e.ref(!1),b=e.computed(()=>l.labelValues.length===0),v=e.computed(()=>l.labelValues.length>0),m=e.computed(()=>l.majorColor?{color:`${l.majorColor}`}:{}),d=e.computed(()=>l.minorColor?{color:`${l.minorColor}`}:{}),c=t=>t==null||typeof t=="string"&&t.trim()==="",a=(t,n={})=>{const o={rawValue:n.rawValue,precision:n.precision===void 0?2:n.precision,thousand:n.thousand,thousandSeparator:n.thousandSeparator||",",currency:n.currency,percent:n.percent};return c(t)?"--":o.rawValue?t:typeof t=="number"?o.percent?`${t.toFixed(o.precision)}%`:o.currency?t.toLocaleString(N.locales[o.currency],{style:"currency",currency:o.currency}):o.thousand?t.toFixed(o.precision).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${o.thousandSeparator}`):t.toFixed(o.precision):t},V=()=>{const t=document.getElementById(p);if(!t)return;const n=t.querySelectorAll(`.${h}`);new ResizeObserver(i=>{i.forEach(k=>{k.target===t&&(s.value=!1,n.forEach(f=>{f.clientWidth<f.scrollWidth&&(s.value=!0)}))})}).observe(t),s.value=!1,n.forEach(i=>{i.clientWidth<i.scrollWidth&&(s.value=!0)})},y=e.computed(()=>u.title?!0:l.tooltip&&e.unref(s)),z=t=>{t&&window.open(t,"_blank")};return e.onMounted(()=>{V()}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{id:p,class:e.normalizeClass([e.unref(S)(),`${e.unref(g)(e.unref(E))}`])},[b.value?(e.openBlock(),e.createBlock(e.unref(B.Tooltip),e.normalizeProps(e.mergeProps({key:0},{...l.tooltipProps})),e.createSlots({default:e.withCtx(()=>[!c(t.major)||!c(t.minor)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.layout==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r)("major"),e.unref(r)("ellipsis")]),style:e.normalizeStyle(m.value)},e.toDisplayString(a(t.major)),7),e.createElementVNode("div",{class:e.normalizeClass([e.unref(r)("minor"),e.unref(r)("ellipsis")]),style:e.normalizeStyle(d.value)},e.toDisplayString(a(t.minor)),7)],64)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(r)("ellipsis"))},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(r)("major")]),style:e.normalizeStyle(m.value)},e.toDisplayString(a(t.major)),7),e.createElementVNode("span",{class:e.normalizeClass([e.unref(r)("minor")]),style:e.normalizeStyle(d.value)},e.toDisplayString(a(t.minor)),7)],2))],64)):(e.openBlock(),e.createElementBlock("div",P,e.toDisplayString("--")))]),_:2},[y.value?{name:"title",fn:e.withCtx(()=>[u.title?e.renderSlot(t.$slots,"title",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.tooltipProps.title?(e.openBlock(),e.createElementBlock("div",j,e.toDisplayString(l.tooltipProps.title),1)):(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",null,e.toDisplayString(a(t.major)),1),e.createElementVNode("div",null,e.toDisplayString(a(t.minor)),1)]))],64))]),key:"0"}:void 0]),1040)):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createBlock(e.unref(B.Tooltip),e.normalizeProps(e.mergeProps({key:1},{...l.tooltipProps})),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelValues,(o,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:e.normalizeClass([e.unref(r)("ellipsis")])},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("label")),style:e.normalizeStyle(o.labelColor?{color:o.labelColor}:void 0)},[e.createTextVNode(e.toDisplayString(o.label),1),o.label?(e.openBlock(),e.createElementBlock("span",$,":")):e.createCommentVNode("",!0)],6),c(o.link)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(r)("value")),style:e.normalizeStyle(o.valueColor?{color:o.valueColor}:void 0)},e.toDisplayString(a(o.value,{...o})),7)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r)("link")),style:e.normalizeStyle(o.linkColor?{color:o.linkColor}:void 0),onClick:k=>z(o.link)},e.toDisplayString(a(o.value,{...o})),15,F)),o.unit?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(r)("unit")),style:e.normalizeStyle(o.unitColor?{color:o.unitColor}:void 0)},e.toDisplayString(o.unit),7)):e.createCommentVNode("",!0)],2))),128))]),_:2},[y.value?{name:"title",fn:e.withCtx(()=>[u.title?e.renderSlot(t.$slots,"title",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.tooltipProps.title?(e.openBlock(),e.createElementBlock("div",M,e.toDisplayString(l.tooltipProps.title),1)):(e.openBlock(),e.createElementBlock("div",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelValues,(o,i)=>(e.openBlock(),e.createElementBlock("div",{key:i},[o.label?(e.openBlock(),e.createElementBlock("span",O,e.toDisplayString(o.label),1)):e.createCommentVNode("",!0),o.label?(e.openBlock(),e.createElementBlock("span",L,":")):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a(o.value,{...o})),1)]))),128))]))],64))]),key:"0"}:void 0]),1040)):e.createCommentVNode("",!0)],2))}});exports.default=A;
|
|
@@ -16,6 +16,30 @@ export interface ApLadderLabelValue {
|
|
|
16
16
|
* 值
|
|
17
17
|
*/
|
|
18
18
|
value: string | number | undefined | null;
|
|
19
|
+
/**
|
|
20
|
+
* 是否采用原始值
|
|
21
|
+
*/
|
|
22
|
+
rawValue?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 精度 默认2位小数
|
|
25
|
+
*/
|
|
26
|
+
precision?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 千分位展示
|
|
29
|
+
*/
|
|
30
|
+
thousand?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 千分位分隔符
|
|
33
|
+
*/
|
|
34
|
+
thousandSeparator?: string;
|
|
35
|
+
/**
|
|
36
|
+
* 货币单位
|
|
37
|
+
*/
|
|
38
|
+
currency?: CurrencyCode;
|
|
39
|
+
/**
|
|
40
|
+
* 百分比展示
|
|
41
|
+
*/
|
|
42
|
+
percent?: boolean;
|
|
19
43
|
/**
|
|
20
44
|
* 自定义单位
|
|
21
45
|
*/
|
|
@@ -90,3 +114,21 @@ export interface ApLadderProps {
|
|
|
90
114
|
export interface ApLadderSlots {
|
|
91
115
|
title?: VNode;
|
|
92
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* 国际货币代码-映射-语言
|
|
119
|
+
*/
|
|
120
|
+
export interface CurrencyCodeInLocale {
|
|
121
|
+
[string: string]: Intl.LocalesArgument;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 国际货币代码
|
|
125
|
+
* - `CNY` 人民币
|
|
126
|
+
* - `USD` 美元
|
|
127
|
+
* - `EUR` 欧元
|
|
128
|
+
* - `GBP` 英镑
|
|
129
|
+
*/
|
|
130
|
+
export type CurrencyCode = 'CNY' | 'USD' | 'EUR' | 'GBP';
|
|
131
|
+
/**
|
|
132
|
+
* 国际货币代码-映射-语言
|
|
133
|
+
*/
|
|
134
|
+
export declare const locales: CurrencyCodeInLocale;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={USD:"en-US",CNY:"zh-CN",EUR:"de-DE",GBP:"en-GB"};exports.locales=e;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApTableProps } from '../../';
|
|
2
|
+
import { UseTableRefreshOption } from './useTableRefresh';
|
|
2
3
|
import { Recordable } from '../../type';
|
|
3
4
|
export interface UsePageListApTable extends ApTableProps {
|
|
4
5
|
/** 是否显示默认的行选择配置
|
|
@@ -15,6 +16,10 @@ export interface UsePageListApTable extends ApTableProps {
|
|
|
15
16
|
clearSelectionOnRequest?: boolean;
|
|
16
17
|
/** 用于覆盖默认的class */
|
|
17
18
|
class?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 表格刷新相关
|
|
21
|
+
*/
|
|
22
|
+
tableRefresh?: boolean | Omit<UseTableRefreshOption, 'apTableRef'>;
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
25
|
* 集成了列表页面的ApTable的默认配置
|
|
@@ -41,6 +46,6 @@ export declare function usePageListApTable(props?: UsePageListApTable): [ApTable
|
|
|
41
46
|
clearAll: () => void;
|
|
42
47
|
toggleSelect: (item: any) => void;
|
|
43
48
|
} | undefined;
|
|
44
|
-
} | null;
|
|
49
|
+
} | null | undefined;
|
|
45
50
|
clearSelection: () => void;
|
|
46
51
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-unified"),h=require("vue"),m=require("./useTableRefresh.js");function S(a){return a===!0?{}:a===!1?{refreshBefore:()=>!1}:a}function v(a){const r=h.ref(null),{isShowRowSelection:c=!0,clearSelectionOnRequest:u=!0,transformSearchFormValues:s,api:o,tableRefresh:i=!1,...f}=a||{},n=()=>{var e,t;(t=(e=r.value)==null?void 0:e.rowSelection)==null||t.clearAll()};m.useTableRefresh({...S(i),apTableRef:r});const b=async e=>{const t=s?s(e):e;try{if(!o)throw new Error("api is not defined");const{records:l,total:d}=await o(t);return u&&n(),{data:l,total:d}}catch(l){return console.error(l),{data:[],total:0}}};return[p.merge({scroll:{x:"100%",y:"100%"},tableLayout:"fixed",columnResizable:!0,class:"ap-table--sticky",request:o?b:void 0,rowSelection:c?{mode:"internal",fixed:"left",columnWidth:50}:void 0,ref(e){r.value=e}},f),{reload:()=>{var e;(e=r.value)==null||e.submit()},reset:()=>{var e;(e=r.value)==null||e.reset()},getSearchFormValues:()=>{var t;const e=((t=r.value)==null?void 0:t.getSearchFormValues())||{};return s?s(e):e},getApTableInstance:()=>r.value,clearSelection:n}]}exports.usePageListApTable=v;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { ApTableExpose } from '
|
|
3
|
-
interface UseTableRefreshOption {
|
|
2
|
+
import { ApTableExpose } from '../../';
|
|
3
|
+
export interface UseTableRefreshOption {
|
|
4
4
|
/**
|
|
5
5
|
* apTable实例
|
|
6
6
|
*/
|
|
7
|
-
apTableRef?: Ref<ApTableExpose | undefined>;
|
|
7
|
+
apTableRef?: Ref<ApTableExpose | undefined | null>;
|
|
8
8
|
/**
|
|
9
9
|
* 刷新类型,reset:重置,submit:提交
|
|
10
10
|
*/
|
|
@@ -15,4 +15,3 @@ interface UseTableRefreshOption {
|
|
|
15
15
|
refreshBefore?: () => boolean;
|
|
16
16
|
}
|
|
17
17
|
export declare function useTableRefresh(option?: UseTableRefreshOption): void;
|
|
18
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue");function c(e){const a=(["reset","submit",void 0].includes(e==null?void 0:e.refreskType)?e==null?void 0:e.refreskType:"submit")??"submit",r=(e==null?void 0:e.refreshBefore)??(()=>!0);let u=!0;s.onMounted(()=>{s.nextTick(()=>{u=!1})}),s.onActivated(()=>{var f,l;u||r!=null&&r()&&((l=(f=e==null?void 0:e.apTableRef)==null?void 0:f.value)==null||l[a]())})}exports.useTableRefresh=c;
|
|
@@ -3,7 +3,7 @@ import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOpt
|
|
|
3
3
|
import { TooltipPlacement, AdjustOverflow } from 'ant-design-vue/es/tooltip';
|
|
4
4
|
import { VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
5
5
|
import { LiteralUnion, Key } from 'ant-design-vue/es/_util/type';
|
|
6
|
-
import { ApStatusProps, ApStatusGroupItemProps, ApSelectItem, ApLabelGroupItemProps, ApBatchActionGroupMenuProps } from '.';
|
|
6
|
+
import { ApStatusProps, ApStatusGroupItemProps, ApSelectItem, ApLabelGroupItemProps, ApBatchActionGroupMenuProps, ApLadderLabelValue } from '.';
|
|
7
7
|
import { ValueType } from 'ant-design-vue/es/input-number/src/utils/MiniDecimal';
|
|
8
8
|
import { ApInputRadioOptions } from './ap-input-radio';
|
|
9
9
|
import { KeyboardEventHandler, MouseEventHandler, FocusEventHandler } from 'ant-design-vue/es/_util/EventInterface';
|
|
@@ -17,7 +17,7 @@ import { accessCreate } from '@aplus-frontend/oss';
|
|
|
17
17
|
import { TriggerType } from 'ant-design-vue/es/tooltip/abstractTooltipProps';
|
|
18
18
|
import { PresetColorType } from 'ant-design-vue/es/_util/colors';
|
|
19
19
|
import { AlignType, BuildInPlacements } from 'ant-design-vue/es/vc-trigger/interface';
|
|
20
|
-
import {
|
|
20
|
+
import { ApLadderSlots } from './ap-ladder/interface';
|
|
21
21
|
import { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
|
|
22
22
|
export * from './hooks/index';
|
|
23
23
|
export type { ApTitleProps } from './title/interface';
|
|
@@ -27,7 +27,7 @@ export type { ApStatusProps, ApStatusGroupProps, ApStatusGroupItemProps } from '
|
|
|
27
27
|
export type { ApSelectItem, ApSelectLayoutProps } from './ap-select-layout/interface';
|
|
28
28
|
export type { ApInputRadioProps, ApInputValType } from './ap-input-radio/interface';
|
|
29
29
|
export type { ApExportGroupProps } from './ap-export-group/interface';
|
|
30
|
-
export type { ApLadderProps } from './ap-ladder/interface';
|
|
30
|
+
export type { ApLadderProps, ApLadderLabelValue, CurrencyCode, TooltipNeedProps } from './ap-ladder/interface';
|
|
31
31
|
export * from './ap-batch-action-group/interface';
|
|
32
32
|
export type { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
|
|
33
33
|
export declare const ApTitle: {
|