@aplus-frontend/ui 0.4.24 → 0.4.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.vue.d.ts +1 -2
- package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
- package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
- package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
- package/es/src/ap-list/index.vue.d.ts +2 -4
- package/es/src/ap-table/ap-table.vue.d.ts +2 -4
- package/es/src/ap-table/ap-table.vue2.mjs +157 -154
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/es/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/es/src/ap-upload/components/Picture.vue.d.ts +2 -7
- package/es/src/business/ap-attachment/ApAttachment.mjs +31 -31
- package/es/src/business/ap-attachment/interface.d.ts +2 -2
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +6 -2
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +36 -32
- package/es/src/business/ap-batch-action-group/index.d.ts +16 -7
- package/es/src/business/ap-batch-action-group/interface.d.ts +5 -0
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- package/es/src/business/ap-expand-alert/index.d.ts +4 -6
- package/es/src/business/ap-select-layout/index.d.ts +2 -4
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/es/src/config-provider/config-provider.d.ts +0 -3
- package/es/src/config-provider/css-var.d.ts +0 -4
- package/es/src/config-provider/css-var.mjs +14 -22
- package/es/src/config-provider/index.d.ts +0 -15
- package/es/src/editable-table/form-item.vue.d.ts +2 -4
- package/es/src/editable-table/index.vue.d.ts +2 -4
- package/es/src/locale/lang/en.mjs +4 -2
- package/es/src/locale/lang/zh-cn.mjs +3 -2
- package/es/src/scroll-view/index.vue.d.ts +5 -5
- package/es/src/tests/wrapper.d.ts +4 -4
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +3 -4
- package/es/src/work-order-modal/work-order-modal.vue.mjs +24 -21
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -2
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
- package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
- package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
- package/lib/src/ap-list/index.vue.d.ts +2 -4
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/lib/src/ap-upload/components/Picture.vue.d.ts +2 -7
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/interface.d.ts +2 -2
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +6 -2
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +16 -7
- package/lib/src/business/ap-batch-action-group/interface.d.ts +5 -0
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- package/lib/src/business/ap-expand-alert/index.d.ts +4 -6
- package/lib/src/business/ap-select-layout/index.d.ts +2 -4
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/lib/src/config-provider/config-provider.d.ts +0 -3
- package/lib/src/config-provider/css-var.d.ts +0 -4
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/config-provider/index.d.ts +0 -15
- package/lib/src/editable-table/form-item.vue.d.ts +2 -4
- package/lib/src/editable-table/index.vue.d.ts +2 -4
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/scroll-view/index.vue.d.ts +5 -5
- package/lib/src/tests/wrapper.d.ts +4 -4
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +3 -4
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +3 -3
- package/theme/ap-scroll-bar/index.css +31 -0
- package/theme/ap-scroll-bar/index.less +39 -0
- package/theme/ap-table/ap-table.css +2 -2
- package/theme/ap-table/ap-table.less +5 -2
- package/theme/ap-table-modal/index.css +2 -2
- package/theme/index.css +2 -2
- package/index.ts +0 -19
|
@@ -2,7 +2,7 @@ import { EditableTableProps, EditableColumnType } from './interface';
|
|
|
2
2
|
import { NamePath, ValidateOptions } from '@aplus-frontend/antdv/es/form/interface';
|
|
3
3
|
import { Recordable } from '../type';
|
|
4
4
|
import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
|
|
5
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode
|
|
5
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
6
6
|
declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
7
7
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
8
8
|
readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -53,9 +53,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
|
|
|
53
53
|
}) => void;
|
|
54
54
|
};
|
|
55
55
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
56
|
-
}>) => VNode
|
|
57
|
-
[key: string]: any;
|
|
58
|
-
}> & {
|
|
56
|
+
}>) => VNode & {
|
|
59
57
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
60
58
|
};
|
|
61
59
|
export default _default;
|
|
@@ -104,13 +104,15 @@ const e = {
|
|
|
104
104
|
cancel: "Cancel",
|
|
105
105
|
ticketsTitle: "Ticket Title",
|
|
106
106
|
noEmpty: "No empty",
|
|
107
|
-
pleaseEntry: "please enter",
|
|
107
|
+
pleaseEntry: "please enter (Within 300 words)",
|
|
108
108
|
ticketsType: "Ticket Type",
|
|
109
109
|
ticketsDetail: "Ticket Detail",
|
|
110
110
|
ticketsLevel: "Priority",
|
|
111
111
|
operationSuccess: "operate successfully",
|
|
112
112
|
fileSizeMax: "Single file size limit",
|
|
113
|
-
fileCountMax: "Limit the number to {x} at a time"
|
|
113
|
+
fileCountMax: "Limit the number to {x} at a time",
|
|
114
|
+
fileLabel: "File Upload"
|
|
115
|
+
// 上传附件
|
|
114
116
|
},
|
|
115
117
|
apTableModal: {
|
|
116
118
|
titleSuffixOne: "You can add up to {maxCount},",
|
|
@@ -113,13 +113,14 @@ const e = {
|
|
|
113
113
|
cancel: "取消",
|
|
114
114
|
ticketsTitle: "工单标题",
|
|
115
115
|
noEmpty: "不可为空",
|
|
116
|
-
pleaseEntry: "
|
|
116
|
+
pleaseEntry: "请输入(300字以内)",
|
|
117
117
|
ticketsType: "工单类型",
|
|
118
118
|
ticketsDetail: "工单详情",
|
|
119
119
|
ticketsLevel: "优先级",
|
|
120
120
|
operationSuccess: "操作成功",
|
|
121
121
|
fileSizeMax: "单个文件大小限制",
|
|
122
|
-
fileCountMax: "单次数量限制 {x} 个"
|
|
122
|
+
fileCountMax: "单次数量限制 {x} 个",
|
|
123
|
+
fileLabel: "上传附件"
|
|
123
124
|
},
|
|
124
125
|
apTableModal: {
|
|
125
126
|
titleSuffixOne: "最多可添加{maxCount}个,",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScrollOptions, ScrollViewProps } from './interface';
|
|
2
|
-
import { ScrollBarDirection, InternalScrollBarProps
|
|
2
|
+
import { ScrollBarDirection, InternalScrollBarProps } from '../scroll-bar';
|
|
3
3
|
import { CreateComponentPublicInstanceWithMixins, Ref, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent, ComputedRef } from 'vue';
|
|
4
4
|
declare function scroll(x?: number, y?: number): void;
|
|
5
5
|
declare function scrollTo({ smooth, left, top }: ScrollOptions): void;
|
|
@@ -106,8 +106,8 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
|
|
|
106
106
|
onScroll?: ((percent: number) => void) | undefined;
|
|
107
107
|
disabled?: boolean | undefined;
|
|
108
108
|
trackSpeed?: number | undefined;
|
|
109
|
-
barColor?:
|
|
110
|
-
trackColor?:
|
|
109
|
+
barColor?: import("csstype").Property.BackgroundColor | undefined;
|
|
110
|
+
trackColor?: import("csstype").Property.BackgroundColor | undefined;
|
|
111
111
|
trackWidth?: number | undefined;
|
|
112
112
|
showTrack?: boolean | undefined;
|
|
113
113
|
onScrollStart?: ((percent: number) => void) | undefined;
|
|
@@ -118,8 +118,8 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
|
|
|
118
118
|
onScroll?: ((percent: number) => void) | undefined;
|
|
119
119
|
disabled?: boolean | undefined;
|
|
120
120
|
trackSpeed?: number | undefined;
|
|
121
|
-
barColor?:
|
|
122
|
-
trackColor?:
|
|
121
|
+
barColor?: import("csstype").Property.BackgroundColor | undefined;
|
|
122
|
+
trackColor?: import("csstype").Property.BackgroundColor | undefined;
|
|
123
123
|
trackWidth?: number | undefined;
|
|
124
124
|
showTrack?: boolean | undefined;
|
|
125
125
|
onScrollStart?: ((percent: number) => void) | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
2
|
export declare const Wrapper: DefineComponent<{
|
|
3
|
-
uiMode?:
|
|
4
|
-
lang?:
|
|
3
|
+
uiMode?: "admin" | "aplus" | undefined;
|
|
4
|
+
lang?: "en" | "zh-cn" | undefined;
|
|
5
5
|
}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
6
|
-
uiMode?:
|
|
7
|
-
lang?:
|
|
6
|
+
uiMode?: "admin" | "aplus" | undefined;
|
|
7
|
+
lang?: "en" | "zh-cn" | undefined;
|
|
8
8
|
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { WorkOrderModalProps } from './interfaces';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, GlobalComponents, GlobalDirectives, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
|
|
3
3
|
import { ButtonSize, SizeType } from '@aplus-frontend/antdv/es/button';
|
|
4
|
-
import { ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity, NamePath,
|
|
4
|
+
import { ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity, NamePath, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
5
5
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
6
6
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
7
7
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
8
8
|
import { Options } from '../../node_modules/scroll-into-view-if-needed';
|
|
9
9
|
import { Recordable } from '../type';
|
|
10
10
|
import { VueTypeDef, VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
11
|
-
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
12
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
13
12
|
import { ApFormProps, ApFormInternalInstance, WatchFunc } from '..';
|
|
14
13
|
import { OnCleanup } from '@vue/reactivity';
|
|
@@ -107,13 +106,13 @@ declare const _default: DefineComponent<WorkOrderModalProps, {}, {}, {}, {}, Com
|
|
|
107
106
|
readonly hideRequiredMark?: boolean | undefined;
|
|
108
107
|
readonly validateOnRuleChange?: boolean | undefined;
|
|
109
108
|
readonly scrollToFirstError?: boolean | Options<any> | undefined;
|
|
110
|
-
readonly onFieldsChange?: ((changedFields: FieldData[], allFields: FieldData[]) => void) | undefined;
|
|
109
|
+
readonly onFieldsChange?: ((changedFields: FieldData[], allFields: ** @type { typeof __VLS_ctx.formRef } */).FieldData[]) => void) | undefined;
|
|
111
110
|
readonly onFinish?: ((values: any) => void) | undefined;
|
|
112
111
|
readonly onFinishFailed?: ((errorInfo: ValidateErrorEntity<any>) => void) | undefined;
|
|
113
112
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
114
113
|
readonly initialValues?: Recordable | undefined;
|
|
115
114
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
116
|
-
readonly syncToUrl?:
|
|
115
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
117
116
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
118
117
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
119
118
|
$attrs: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as T, ref as g, computed as F, openBlock as E, createElementBlock as N, createVNode as t, unref as e, mergeProps as
|
|
2
|
-
import { message as
|
|
1
|
+
import { defineComponent as T, ref as g, computed as F, openBlock as E, createElementBlock as N, createVNode as t, unref as e, mergeProps as L, withCtx as n, h as P } from "vue";
|
|
2
|
+
import { message as q, Modal as I, Input as A, Textarea as V } from "@aplus-frontend/antdv";
|
|
3
3
|
import { ApForm as i } from "../ap-form/index.mjs";
|
|
4
4
|
import "./help-message.vue.mjs";
|
|
5
5
|
import "../ap-upload/index.mjs";
|
|
6
6
|
import { langMap as R, DictCode as w } from "./interfaces.mjs";
|
|
7
7
|
import "../config-provider/index.mjs";
|
|
8
8
|
import "../hooks/index.mjs";
|
|
9
|
-
import { useLocale as
|
|
9
|
+
import { useLocale as b } from "../config-provider/hooks/use-locale.mjs";
|
|
10
10
|
import { useNamespace as $ } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
11
|
import { useGlobalConfig as z } from "../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useControllableValue as D } from "../hooks/useControllableValue.mjs";
|
|
@@ -59,35 +59,35 @@ const pe = /* @__PURE__ */ T({
|
|
|
59
59
|
mousePosition: {}
|
|
60
60
|
},
|
|
61
61
|
emits: ["update:open", "modalClose"],
|
|
62
|
-
setup(
|
|
63
|
-
const { t: o } =
|
|
62
|
+
setup(v, { emit: x }) {
|
|
63
|
+
const { t: o } = b(), { b: C } = $("work-order-modal"), m = x, d = g(), l = g(!1), s = v, O = z("api"), { lang: h } = b(), _ = F(() => R[h.value] ?? "zh_CN"), { value: c, updateValue: M } = D(s, m, {
|
|
64
64
|
valuePropName: "open",
|
|
65
65
|
defaultValue: !0
|
|
66
|
-
}),
|
|
66
|
+
}), u = async (r) => {
|
|
67
67
|
var p, k;
|
|
68
|
-
const a = await ((k = (p =
|
|
68
|
+
const a = await ((k = (p = O.value) == null ? void 0 : p.select) == null ? void 0 : k.call(p, {
|
|
69
69
|
dictCode: r,
|
|
70
70
|
locale: _.value
|
|
71
71
|
}));
|
|
72
72
|
return a == null ? void 0 : a.map((y) => ({ label: y.itemText, value: y.itemValue }));
|
|
73
|
-
},
|
|
73
|
+
}, B = async () => {
|
|
74
74
|
var r;
|
|
75
75
|
if (!l.value)
|
|
76
76
|
try {
|
|
77
77
|
l.value = !0;
|
|
78
|
-
const a = await ((r =
|
|
79
|
-
await s.api(a), l.value = !1,
|
|
78
|
+
const a = await ((r = d.value) == null ? void 0 : r.validateFields());
|
|
79
|
+
await s.api(a), l.value = !1, q.success("操作成功"), f();
|
|
80
80
|
} catch {
|
|
81
81
|
l.value = !1;
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
}, f = () => {
|
|
85
|
-
|
|
85
|
+
M(!1), c.value = !1, setTimeout(() => {
|
|
86
86
|
console.log(c.value);
|
|
87
87
|
}, 500), m("modalClose");
|
|
88
88
|
};
|
|
89
89
|
return (r, a) => (E(), N("div", null, [
|
|
90
|
-
t(e(
|
|
90
|
+
t(e(I), L(s, {
|
|
91
91
|
width: 600,
|
|
92
92
|
centered: !0,
|
|
93
93
|
open: e(c),
|
|
@@ -99,14 +99,14 @@ const pe = /* @__PURE__ */ T({
|
|
|
99
99
|
"wrap-class-name": e(C)(),
|
|
100
100
|
closable: !0,
|
|
101
101
|
"confirm-loading": l.value,
|
|
102
|
-
onOk:
|
|
102
|
+
onOk: B,
|
|
103
103
|
onCancel: f
|
|
104
104
|
}), {
|
|
105
105
|
default: n(() => [
|
|
106
106
|
t(e(i), {
|
|
107
107
|
ref_key: "formRef",
|
|
108
|
-
ref:
|
|
109
|
-
colon:
|
|
108
|
+
ref: d,
|
|
109
|
+
colon: ""
|
|
110
110
|
}, {
|
|
111
111
|
default: n(() => [
|
|
112
112
|
t(e(i).FormItem, {
|
|
@@ -129,7 +129,7 @@ const pe = /* @__PURE__ */ T({
|
|
|
129
129
|
rules: [{ required: !0, message: e(o)("ap.workOrderModal.noEmpty") }],
|
|
130
130
|
field: {
|
|
131
131
|
placeholder: e(o)("ap.workOrderModal.pleaseEntry"),
|
|
132
|
-
request: () =>
|
|
132
|
+
request: () => u(e(w).TicketsType)
|
|
133
133
|
}
|
|
134
134
|
}, null, 8, ["label", "rules", "field"]),
|
|
135
135
|
t(e(i).FormItem, {
|
|
@@ -141,7 +141,7 @@ const pe = /* @__PURE__ */ T({
|
|
|
141
141
|
t(e(V), {
|
|
142
142
|
placeholder: e(o)("ap.workOrderModal.pleaseEntry"),
|
|
143
143
|
maxlength: 300,
|
|
144
|
-
"show-count": !
|
|
144
|
+
"show-count": !1
|
|
145
145
|
}, null, 8, ["placeholder"])
|
|
146
146
|
]),
|
|
147
147
|
_: 1
|
|
@@ -151,10 +151,13 @@ const pe = /* @__PURE__ */ T({
|
|
|
151
151
|
name: "ticketsLevel",
|
|
152
152
|
rules: [{ required: !0, message: e(o)("ap.workOrderModal.noEmpty") }],
|
|
153
153
|
field: {
|
|
154
|
-
request: () =>
|
|
154
|
+
request: () => u(e(w).TicketsLevel)
|
|
155
155
|
}
|
|
156
156
|
}, null, 8, ["label", "rules", "field"]),
|
|
157
|
-
t(e(i).FormItem, {
|
|
157
|
+
t(e(i).FormItem, {
|
|
158
|
+
name: "files",
|
|
159
|
+
label: e(o)("ap.workOrderModal.fileLabel")
|
|
160
|
+
}, {
|
|
158
161
|
default: n(() => [
|
|
159
162
|
t(e(K), {
|
|
160
163
|
"dir-name": "WorkOrder",
|
|
@@ -167,11 +170,11 @@ const pe = /* @__PURE__ */ T({
|
|
|
167
170
|
accept: ".txt,.doc,.docx,.rtf,.pdf,.jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.mp4,.avi,.wmv,.mov,.mkv,.xls,.xlsx,.csv,.ppt,.pptx",
|
|
168
171
|
"max-count": 10,
|
|
169
172
|
"max-size": 50,
|
|
170
|
-
"sub-title":
|
|
173
|
+
"sub-title": P(U)
|
|
171
174
|
}, null, 8, ["get-oss-access", "sub-title"])
|
|
172
175
|
]),
|
|
173
176
|
_: 1
|
|
174
|
-
})
|
|
177
|
+
}, 8, ["label"])
|
|
175
178
|
]),
|
|
176
179
|
_: 1
|
|
177
180
|
}, 512)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApFormProps, WatchFunc, ApFormInternalInstance } from './interface';
|
|
2
|
-
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign,
|
|
2
|
+
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
3
3
|
import { Recordable } from '../type';
|
|
4
4
|
import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent } from 'vue';
|
|
5
5
|
import { VueTypeDef, VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
@@ -7,7 +7,6 @@ import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
|
7
7
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
8
8
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
9
9
|
import { Options } from '../../node_modules/scroll-into-view-if-needed';
|
|
10
|
-
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
11
10
|
import { SizeType } from '@aplus-frontend/antdv/es/button';
|
|
12
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
13
12
|
declare function __VLS_template(): {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApFormDrawerFormProps, CustomizeResizeType } from '../interface';
|
|
2
2
|
import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, CSSProperties } from 'vue';
|
|
3
|
-
import { InternalNamePath, NamePath, ValidateOptions, ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity
|
|
3
|
+
import { InternalNamePath, NamePath, ValidateOptions, ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
4
4
|
import { ButtonSize, SizeType } from '@aplus-frontend/antdv/es/button';
|
|
5
5
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
6
6
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
@@ -8,7 +8,6 @@ import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
|
8
8
|
import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
9
9
|
import { Recordable } from '../../type';
|
|
10
10
|
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
11
|
-
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
12
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
13
12
|
import { ApFormProps, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
14
13
|
import { OnCleanup } from '@vue/reactivity';
|
|
@@ -118,7 +117,7 @@ declare function __VLS_template(): {
|
|
|
118
117
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
119
118
|
readonly initialValues?: Recordable | undefined;
|
|
120
119
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
121
|
-
readonly syncToUrl?:
|
|
120
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
122
121
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
123
122
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
124
123
|
$attrs: {
|
|
@@ -1060,7 +1059,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1060
1059
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
1061
1060
|
readonly initialValues?: Recordable | undefined;
|
|
1062
1061
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
1063
|
-
readonly syncToUrl?:
|
|
1062
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
1064
1063
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
1065
1064
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1066
1065
|
$attrs: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApFormModalFormProps } from '../interface';
|
|
2
2
|
import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, CSSProperties } from 'vue';
|
|
3
|
-
import { InternalNamePath, NamePath, ValidateOptions, ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity
|
|
3
|
+
import { InternalNamePath, NamePath, ValidateOptions, ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
4
4
|
import { Recordable } from '../../type';
|
|
5
5
|
import { ButtonSize, SizeType, ButtonType, ButtonShape } from '@aplus-frontend/antdv/es/button';
|
|
6
6
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
@@ -8,7 +8,6 @@ import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
|
8
8
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
9
9
|
import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
10
10
|
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
11
|
-
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
12
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
13
12
|
import { ApFormProps, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
14
13
|
import { OnCleanup } from '@vue/reactivity';
|
|
@@ -118,7 +117,7 @@ declare function __VLS_template(): {
|
|
|
118
117
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
119
118
|
readonly initialValues?: Recordable | undefined;
|
|
120
119
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
121
|
-
readonly syncToUrl?:
|
|
120
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
122
121
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
123
122
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
124
123
|
$attrs: {
|
|
@@ -1248,7 +1247,7 @@ declare const __VLS_component: DefineComponent<ApFormModalFormProps, {
|
|
|
1248
1247
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
1249
1248
|
readonly initialValues?: Recordable | undefined;
|
|
1250
1249
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
1251
|
-
readonly syncToUrl?:
|
|
1250
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
1252
1251
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
1253
1252
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1254
1253
|
$attrs: {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ApFormExpose, ApFormSearchFormProps } from '../interface';
|
|
2
2
|
import { ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, ComputedRef } from 'vue';
|
|
3
3
|
import { ButtonSize, SizeType } from '@aplus-frontend/antdv/es/button';
|
|
4
|
-
import { ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity, NamePath,
|
|
4
|
+
import { ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity, NamePath, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
5
5
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
6
6
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
7
7
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
8
8
|
import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
9
9
|
import { Recordable } from '../../type';
|
|
10
10
|
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
11
|
-
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
12
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
13
12
|
import { ApFormProps, ApFormInternalInstance, WatchFunc } from '..';
|
|
14
13
|
import { OnCleanup } from '@vue/reactivity';
|
|
@@ -116,7 +115,7 @@ declare function __VLS_template(): {
|
|
|
116
115
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
117
116
|
readonly initialValues?: Recordable | undefined;
|
|
118
117
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
119
|
-
readonly syncToUrl?:
|
|
118
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
120
119
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
121
120
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
122
121
|
$attrs: {
|
|
@@ -953,7 +952,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
953
952
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
954
953
|
readonly initialValues?: Recordable | undefined;
|
|
955
954
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
956
|
-
readonly syncToUrl?:
|
|
955
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
957
956
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
958
957
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
959
958
|
$attrs: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApListProps } from './interface';
|
|
2
2
|
import { Recordable } from '../type';
|
|
3
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, Ref, VNode
|
|
3
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, Ref, VNode } from 'vue';
|
|
4
4
|
import { ApFormSearchFormExpose } from '..';
|
|
5
5
|
declare const _default: <RecordType extends Recordable>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
6
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & ApListProps<RecordType> & Partial<{}>> & PublicProps;
|
|
@@ -41,9 +41,7 @@ declare const _default: <RecordType extends Recordable>(__VLS_props: NonNullable
|
|
|
41
41
|
}): any;
|
|
42
42
|
};
|
|
43
43
|
emit: {};
|
|
44
|
-
}>) => VNode
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
}> & {
|
|
44
|
+
}>) => VNode & {
|
|
47
45
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
48
46
|
};
|
|
49
47
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApColumnType, ApTableProps } from './interface';
|
|
2
2
|
import { ColumnsType, ColumnType } from '@aplus-frontend/antdv/es/table';
|
|
3
3
|
import { RowSelectionReturnType } from './hooks/use-table-row-selection';
|
|
4
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, ComputedRef, Ref, VNode
|
|
4
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, ComputedRef, Ref, VNode } from 'vue';
|
|
5
5
|
declare const _default: <RecordType>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
6
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & ApTableProps<RecordType> & Partial<{}>> & PublicProps;
|
|
7
7
|
expose(exposed: ShallowUnwrapRef<{
|
|
@@ -83,9 +83,7 @@ declare const _default: <RecordType>(__VLS_props: NonNullable<Awaited<typeof __V
|
|
|
83
83
|
}) => void;
|
|
84
84
|
};
|
|
85
85
|
emit: {};
|
|
86
|
-
}>) => VNode
|
|
87
|
-
[key: string]: any;
|
|
88
|
-
}> & {
|
|
86
|
+
}>) => VNode & {
|
|
89
87
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
90
88
|
};
|
|
91
89
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),A=require("@aplus-frontend/antdv"),ie=require("@aplus-frontend/antdv/es/theme/internal"),fe=require("../ap-form/index.js"),U=require("./constants.js");require("../config-provider/index.js");const pe=require("./hooks/use-table-paging-ng.js"),c=require("lodash-unified"),s=require("./utils.js"),me=require("./hooks/use-table-content-height.js"),ye=require("./hooks/use-table-row-selection.js"),ge=require("../utils/index.js");require("./components/setting/modal/index.vue.js");require("./components/paragraph-ellipsis/index.vue.js");const Se=require("./context.js");require("../scroll-bar/index.js");const be=require("./hooks/use-sticky-scroll.js"),he=require("../config-provider/css-var.js"),we=require("../config-provider/hooks/use-namespace.js"),ve=require("../config-provider/hooks/use-global-config.js"),Ce=require("./components/paragraph-ellipsis/index.vue2.js"),Re=require("./components/setting/modal/index.vue2.js"),xe=require("../scroll-bar/index.vue.js"),ke=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!1},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},rowSelection:{type:[Boolean,Object]},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},dataSource:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"},adaptive:{type:Boolean,default:!1},columnResizable:{type:Boolean,default:!1},settings:{type:[Boolean,Object],default:void 0}},setup(D,{expose:$}){const t=D;let x=0;const g=e.useSlots(),[,j]=ie.useToken(),{e:w,b:f,be:k,m:W}=we.useNamespace("ap-table"),T=ve.useGlobalConfig("valueTypeMap"),{height:H,contentRef:M}=me.default(),B=e.ref(),F=e.ref(),{isStickyMode:q,scrollBarRef:i}=be.useStickyScroll(B),v=e.ref(t.size),d=e.ref([]),z=e.ref([]);Se.useProvideApTable({columns:e.computed(()=>d.value),columnsBackup:e.computed(()=>z.value),size:e.computed(()=>v.value),updateColumns(r){d.value=r},updateSize(r){v.value=r},dataSource:e.computed(()=>e.unref(m).records)});const N=e.computed(()=>{var r,n,o;return x++,((o=(n=(r=t.columns)==null?void 0:r.filter(a=>!a.hideInSearch&&a.dataIndex&&(a.valueType||a.customRenderFormItem)&&!U.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:n.sort((a,u)=>{let l=s.getColumnOrder(a.order);return s.getColumnOrder(u.order)-l}))==null?void 0:o.map(a=>{const u=s.updateFormProps(a,s.getFieldProps(a.fieldProps,{})),l={...a,fieldProps:{label:a.title,name:a.dataIndex,...u||{},_signal:x},renderNode:void 0};return l.renderNode=s.getSearchFormItemRenderNode(l,e.unref(T)),l}))||[]}),G=e.computed(()=>s.recursionApColumns(e.unref(d),r=>{if(r.sorter===!0)return r.key||r.dataIndex}).filter(Boolean)),J=e.computed(()=>s.recursionApColumns(e.unref(d),r=>{if(r.filters&&!r.onFilter)return r.key||r.dataIndex}).filter(Boolean)),Q=e.computed(()=>c.isUndefined(t.dataSource)?m.records:t.dataSource),{rowSelection:S,selectedRows:b,...h}=ye.default({fixed:!0,...t.rowSelection===!0?{}:t.rowSelection,rowKey:t.rowKey,dataSource:Q}),{formRef:C,submit:P,reset:_,tableProps:V,refresh:X,data:m,setDataSource:Y,getColumnSFConfig:Z}=pe.useTablePaging({async request(r){var o,a;if(!S.value.preserveSelectedRowKeys&&c.isUndefined(t.dataSource)&&h.clearAll(),!c.isUndefined(t.dataSource))return{data:t.dataSource||[],total:t.dataSource.length||0};const n=await((o=t.request)==null?void 0:o.call(t,r));return(a=t.onLoad)==null||a.call(t,(n==null?void 0:n.data)||[]),{data:(n==null?void 0:n.data)||[],total:(n==null?void 0:n.total)||0}},filterFields:J,sortFields:G,defaultParams:t.params,defaultData:t.defaultData,manual:t.manual,formatParams:t.beforeSearchSubmit,pagination:t.pagination}),ee=()=>{var o;let r=((o=t.columns)==null?void 0:o.filter(a=>!a.hideInTable))||[];function n(a,u){return a.map(l=>({resizable:ge.isDef(l.resizable)?l.resizable:t.columnResizable,...c.omit(s.apColumnToColumn(l),["ellipsis"]),...Z(l),fixed:u?u.fixed:l.fixed,title:s.getTableTitle(l,k("table-header","title"),g.headerCell,e.unref(j).colorPrimary),customRender({value:p,...y}){var K,L;const I=s.getTableRenderType(l),ue=s.getTableRenderProps({...l,valueType:I},{value:p,...y}),de=s.getTableCellRenderNode(I,ue,y.record,e.unref(T)),O=((K=l.renderText)==null?void 0:K.call(l,{value:p,...y}))||p,ce=l.renderText?e.createVNode(e.Fragment,null,[(L=l.renderText)==null?void 0:L.call(l,{value:p,...y})]):de;let R=ne(l,O,ce);return l.customRender&&(R=l.customRender({value:p,...y,column:l,originalNode:R,originalText:O})),R},children:n(l.children||[],u||l)}))}return n(r)};e.watchEffect(()=>{const r=ee();d.value=r,z.value=r});const re=e.computed(()=>{var n,o;if(t.adaptive&&(m.total>0||((n=t.dataSource)==null?void 0:n.length)))return{y:e.unref(H),x:((o=t.scroll)==null?void 0:o.x)||"100%"};if(t.scroll)return t.scroll}),te=e.computed(()=>{var r;if(t.tableLayout)return t.tableLayout;if((r=t.columns)!=null&&r.some(n=>n.ellipsis))return"fixed"}),E=e.computed(()=>{var o;const r=e.unref(V),n=e.unref(S);return{...t,...r,rowSelection:t.rowSelection===!0||((o=t.rowSelection)==null?void 0:o.mode)==="internal"?{...n,preserveSelectedRowKeys:c.isUndefined(t.dataSource)?n.preserveSelectedRowKeys:!0}:s.falseToUndefined(t.rowSelection),loading:c.isUndefined(t.loading)?r.loading:t.loading,pagination:t.pagination===!1?!1:r.pagination,scroll:e.unref(re)}}),oe=e.computed(()=>{var r;return[f(),t.card?null:f("wrapper"),t.adaptive?f("adaptive"):null,q.value&&((r=i.value)!=null&&r.visible)?W(`sticky-${he.scrollbarSize===0?"absolute":"relative"}`):null].filter(Boolean)});function ne(r,n,o){return U.noRenderAsFormItemValueList.includes(r.valueType)?o:r.copyable||r.ellipsis?e.createVNode(Ce.default,{copyable:r.copyable,ellipsis:r.ellipsis?c.isBoolean(r.ellipsis)?{tooltip:o,rows:1}:{...r.ellipsis,tooltip:o}:!1,content:o},null):o}e.watch(()=>e.unref(m).loading,r=>{var n;(n=t.onLoadingChange)==null||n.call(t,r)}),e.watch(()=>t.dataSource,r=>{Y(r)},{immediate:!0});function ae(r){var n,o,a;(a=(o=(n=C.value)==null?void 0:n.apForm)==null?void 0:o.setFieldsValue)==null||a.call(o,r)}function le(r=!1){var o,a,u;const n=r?"getFieldsValueTransformed":"getFieldsValue";return(u=(a=(o=C.value)==null?void 0:o.apForm)==null?void 0:a[n])==null?void 0:u.call(a,!0)}function se(){return e.unref(d)}return $({submit:()=>P(),reset:()=>_(),refresh:()=>X(),setSearchFormValues:ae,getSearchFormValues:le,getShownColumns:se,dataSource:e.computed(()=>e.unref(m).records),rowSelection:{selectedRows:e.computed(()=>e.unref(b)),...h},scrollBar:{x:{getCurrentScroll:()=>{var r;return((r=i==null?void 0:i.value)==null?void 0:r.currentScroll)??0},scroll:r=>{var n,o;return(o=(n=i==null?void 0:i.value)==null?void 0:n.scroll)==null?void 0:o.call(n,r)}},y:void 0}}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableWrapperRef",ref:B,class:e.normalizeClass(oe.value)},[e.unref(c.isUndefined)(r.dataSource)&&r.searchForm!==!1&&N.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.card?e.unref(w)("search-wrapper"):null),style:e.normalizeStyle(r.searchFormWrapperStyle)},[e.createVNode(e.unref(fe.ApForm).SearchForm,e.mergeProps(r.searchForm||{},{ref_key:"formRef",ref:C,"custom-reset":"","submit-loading":e.unref(V).loading,onSubmit:e.unref(P),onReset:e.unref(_)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,o=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.renderNode.Comp),e.mergeProps({key:o.dataIndex,item:o,ref_for:!0},o.fieldProps||{},{span:o.span,"custom-render":o.renderNode.render}),null,16,["item","span","custom-render"]))),128))]),_:2},[g.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"contentRef",ref:M,class:e.normalizeClass([e.unref(w)("table-wrapper"),r.card?e.unref(w)("table-wrapper-card"):null]),style:e.normalizeStyle(r.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(f)("header-wrapper"))},[r.settings?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(f)("header"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(k)("header","title"))},[e.renderSlot(r.$slots,"title",e.mergeProps({selectedRows:e.unref(b),selectedRowKeys:e.unref(S).selectedRowKeys,shownColumns:d.value},h))],2),g.title?(e.openBlock(),e.createBlock(e.unref(A.Divider),{key:0,type:"vertical"})):e.createCommentVNode("",!0),e.createVNode(Re.default,{config:r.settings===!0?{}:r.settings},null,8,["config"])],2)):e.renderSlot(r.$slots,"title",e.mergeProps({key:1,selectedRows:e.unref(b),selectedRowKeys:e.unref(S).selectedRowKeys,shownColumns:d.value},h))],2),e.createVNode(e.unref(A.Table),e.mergeProps({ref_key:"antdTableRef",ref:F,class:e.unref(f)("table")},E.value,{size:v.value,"table-layout":te.value,columns:d.value,onResizeColumn:n[0]||(n[0]=(o,a)=>a.width=o)}),e.createSlots({summary:e.withCtx(()=>[e.renderSlot(r.$slots,"summary",{columns:d.value,records:E.value.dataSource,selectedRows:e.unref(b)})]),_:2},[e.unref(q)?{name:"bottomPaginationTop",fn:e.withCtx(()=>{var o,a;return[e.createVNode(e.unref(xe.default),{ref_key:"scrollBarRef",ref:i,"scroll-container":(a=(o=F.value)==null?void 0:o.table)==null?void 0:a.scrollBodyRef,direction:"horizontal"},null,8,["scroll-container"])]}),key:"0"}:void 0,e.renderList(e.unref(c.omit)(g,["title","searchFormExtra","headerCell","summary"]),(o,a)=>({name:a,fn:e.withCtx(u=>[e.renderSlot(r.$slots,a,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1040,["class","size","table-layout","columns"])],6)],2))}});exports.default=ke;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),U=require("@aplus-frontend/antdv"),me=require("@aplus-frontend/antdv/es/theme/internal"),ye=require("../ap-form/index.js"),$=require("./constants.js");require("../config-provider/index.js");const ge=require("./hooks/use-table-paging-ng.js"),c=require("lodash-unified"),s=require("./utils.js"),Se=require("./hooks/use-table-content-height.js"),be=require("./hooks/use-table-row-selection.js"),D=require("../utils/index.js");require("./components/setting/modal/index.vue.js");require("./components/paragraph-ellipsis/index.vue.js");const he=require("./context.js");require("../scroll-bar/index.js");const we=require("./hooks/use-sticky-scroll.js"),ve=require("../config-provider/hooks/use-namespace.js"),Ce=require("../config-provider/hooks/use-global-config.js"),Re=require("./components/paragraph-ellipsis/index.vue2.js"),xe=require("./components/setting/modal/index.vue2.js"),ke=require("../scroll-bar/index.vue.js"),Te=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!1},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},rowSelection:{type:[Boolean,Object]},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},dataSource:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"},adaptive:{type:Boolean,default:!1},columnResizable:{type:Boolean,default:!1},settings:{type:[Boolean,Object],default:void 0}},setup(j,{expose:W}){const t=j;let x=0;const g=e.useSlots(),[,H]=me.useToken(),{e:w,b:f,be:k,m:M,cssVar:G}=ve.useNamespace("ap-table"),T=Ce.useGlobalConfig("valueTypeMap"),{height:J,contentRef:Q}=Se.default(),B=e.ref(),F=e.ref(),{isStickyMode:z,scrollBarRef:i}=we.useStickyScroll(B),v=e.ref(t.size),d=e.ref([]),N=e.ref([]),q=D.getScrollbarSize();he.useProvideApTable({columns:e.computed(()=>d.value),columnsBackup:e.computed(()=>N.value),size:e.computed(()=>v.value),updateColumns(r){d.value=r},updateSize(r){v.value=r},dataSource:e.computed(()=>e.unref(m).records)});const P=e.computed(()=>{var r,n,o;return x++,((o=(n=(r=t.columns)==null?void 0:r.filter(a=>!a.hideInSearch&&a.dataIndex&&(a.valueType||a.customRenderFormItem)&&!$.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:n.sort((a,u)=>{let l=s.getColumnOrder(a.order);return s.getColumnOrder(u.order)-l}))==null?void 0:o.map(a=>{const u=s.updateFormProps(a,s.getFieldProps(a.fieldProps,{})),l={...a,fieldProps:{label:a.title,name:a.dataIndex,...u||{},_signal:x},renderNode:void 0};return l.renderNode=s.getSearchFormItemRenderNode(l,e.unref(T)),l}))||[]}),X=e.computed(()=>s.recursionApColumns(e.unref(d),r=>{if(r.sorter===!0)return r.key||r.dataIndex}).filter(Boolean)),Y=e.computed(()=>s.recursionApColumns(e.unref(d),r=>{if(r.filters&&!r.onFilter)return r.key||r.dataIndex}).filter(Boolean)),Z=e.computed(()=>c.isUndefined(t.dataSource)?m.records:t.dataSource),{rowSelection:S,selectedRows:b,...h}=be.default({fixed:!0,...t.rowSelection===!0?{}:t.rowSelection,rowKey:t.rowKey,dataSource:Z}),{formRef:C,submit:_,reset:V,tableProps:E,refresh:ee,data:m,setDataSource:re,getColumnSFConfig:te}=ge.useTablePaging({async request(r){var o,a;if(!S.value.preserveSelectedRowKeys&&c.isUndefined(t.dataSource)&&h.clearAll(),!c.isUndefined(t.dataSource))return{data:t.dataSource||[],total:t.dataSource.length||0};const n=await((o=t.request)==null?void 0:o.call(t,r));return(a=t.onLoad)==null||a.call(t,(n==null?void 0:n.data)||[]),{data:(n==null?void 0:n.data)||[],total:(n==null?void 0:n.total)||0}},filterFields:Y,sortFields:X,defaultParams:t.params,defaultData:t.defaultData,manual:t.manual,formatParams:t.beforeSearchSubmit,pagination:t.pagination}),oe=()=>{var o;let r=((o=t.columns)==null?void 0:o.filter(a=>!a.hideInTable))||[];function n(a,u){return a.map(l=>({resizable:D.isDef(l.resizable)?l.resizable:t.columnResizable,...c.omit(s.apColumnToColumn(l),["ellipsis"]),...te(l),fixed:u?u.fixed:l.fixed,title:s.getTableTitle(l,k("table-header","title"),g.headerCell,e.unref(H).colorPrimary),customRender({value:p,...y}){var L,A;const O=s.getTableRenderType(l),ie=s.getTableRenderProps({...l,valueType:O},{value:p,...y}),fe=s.getTableCellRenderNode(O,ie,y.record,e.unref(T)),K=((L=l.renderText)==null?void 0:L.call(l,{value:p,...y}))||p,pe=l.renderText?e.createVNode(e.Fragment,null,[(A=l.renderText)==null?void 0:A.call(l,{value:p,...y})]):fe;let R=se(l,K,pe);return l.customRender&&(R=l.customRender({value:p,...y,column:l,originalNode:R,originalText:K})),R},children:n(l.children||[],u||l)}))}return n(r)};e.watchEffect(()=>{const r=oe();d.value=r,N.value=r});const ne=e.computed(()=>{var n,o;if(t.adaptive&&(m.total>0||((n=t.dataSource)==null?void 0:n.length)))return{y:e.unref(J),x:((o=t.scroll)==null?void 0:o.x)||"100%"};if(t.scroll)return t.scroll}),ae=e.computed(()=>{var r;if(t.tableLayout)return t.tableLayout;if((r=t.columns)!=null&&r.some(n=>n.ellipsis))return"fixed"}),I=e.computed(()=>{var o;const r=e.unref(E),n=e.unref(S);return{...t,...r,rowSelection:t.rowSelection===!0||((o=t.rowSelection)==null?void 0:o.mode)==="internal"?{...n,preserveSelectedRowKeys:c.isUndefined(t.dataSource)?n.preserveSelectedRowKeys:!0}:s.falseToUndefined(t.rowSelection),loading:c.isUndefined(t.loading)?r.loading:t.loading,pagination:t.pagination===!1?!1:r.pagination,scroll:e.unref(ne)}}),le=e.computed(()=>{var r;return[f(),t.card?null:f("wrapper"),t.adaptive?f("adaptive"):null,z.value&&((r=i.value)!=null&&r.visible)?M(`sticky-${q===0?"absolute":"relative"}`):null].filter(Boolean)});function se(r,n,o){return $.noRenderAsFormItemValueList.includes(r.valueType)?o:r.copyable||r.ellipsis?e.createVNode(Re.default,{copyable:r.copyable,ellipsis:r.ellipsis?c.isBoolean(r.ellipsis)?{tooltip:o,rows:1}:{...r.ellipsis,tooltip:o}:!1,content:o},null):o}e.watch(()=>e.unref(m).loading,r=>{var n;(n=t.onLoadingChange)==null||n.call(t,r)}),e.watch(()=>t.dataSource,r=>{re(r)},{immediate:!0});function ue(r){var n,o,a;(a=(o=(n=C.value)==null?void 0:n.apForm)==null?void 0:o.setFieldsValue)==null||a.call(o,r)}function de(r=!1){var o,a,u;const n=r?"getFieldsValueTransformed":"getFieldsValue";return(u=(a=(o=C.value)==null?void 0:o.apForm)==null?void 0:a[n])==null?void 0:u.call(a,!0)}function ce(){return e.unref(d)}return W({submit:()=>_(),reset:()=>V(),refresh:()=>ee(),setSearchFormValues:ue,getSearchFormValues:de,getShownColumns:ce,dataSource:e.computed(()=>e.unref(m).records),rowSelection:{selectedRows:e.computed(()=>e.unref(b)),...h},scrollBar:{x:{getCurrentScroll:()=>{var r;return((r=i==null?void 0:i.value)==null?void 0:r.currentScroll)??0},scroll:r=>{var n,o;return(o=(n=i==null?void 0:i.value)==null?void 0:n.scroll)==null?void 0:o.call(n,r)}},y:void 0}}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableWrapperRef",ref:B,class:e.normalizeClass(le.value),style:e.normalizeStyle(e.unref(G)({"scroll-bar-width":`${e.unref(q)}px`}))},[e.unref(c.isUndefined)(r.dataSource)&&r.searchForm!==!1&&P.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.card?e.unref(w)("search-wrapper"):null),style:e.normalizeStyle(r.searchFormWrapperStyle)},[e.createVNode(e.unref(ye.ApForm).SearchForm,e.mergeProps(r.searchForm||{},{ref_key:"formRef",ref:C,"custom-reset":"","submit-loading":e.unref(E).loading,onSubmit:e.unref(_),onReset:e.unref(V)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,o=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.renderNode.Comp),e.mergeProps({key:o.dataIndex,item:o,ref_for:!0},o.fieldProps||{},{span:o.span,"custom-render":o.renderNode.render}),null,16,["item","span","custom-render"]))),128))]),_:2},[g.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"contentRef",ref:Q,class:e.normalizeClass([e.unref(w)("table-wrapper"),r.card?e.unref(w)("table-wrapper-card"):null]),style:e.normalizeStyle(r.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(f)("header-wrapper"))},[r.settings?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(f)("header"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(k)("header","title"))},[e.renderSlot(r.$slots,"title",e.mergeProps({selectedRows:e.unref(b),selectedRowKeys:e.unref(S).selectedRowKeys,shownColumns:d.value},h))],2),g.title?(e.openBlock(),e.createBlock(e.unref(U.Divider),{key:0,type:"vertical"})):e.createCommentVNode("",!0),e.createVNode(xe.default,{config:r.settings===!0?{}:r.settings},null,8,["config"])],2)):e.renderSlot(r.$slots,"title",e.mergeProps({key:1,selectedRows:e.unref(b),selectedRowKeys:e.unref(S).selectedRowKeys,shownColumns:d.value},h))],2),e.createVNode(e.unref(U.Table),e.mergeProps({ref_key:"antdTableRef",ref:F,class:e.unref(f)("table")},I.value,{size:v.value,"table-layout":ae.value,columns:d.value,onResizeColumn:n[0]||(n[0]=(o,a)=>a.width=o)}),e.createSlots({summary:e.withCtx(()=>[e.renderSlot(r.$slots,"summary",{columns:d.value,records:I.value.dataSource,selectedRows:e.unref(b)})]),_:2},[e.unref(z)?{name:"bottomPaginationTop",fn:e.withCtx(()=>{var o,a;return[e.createVNode(e.unref(ke.default),{ref_key:"scrollBarRef",ref:i,"scroll-container":(a=(o=F.value)==null?void 0:o.table)==null?void 0:a.scrollBodyRef,direction:"horizontal"},null,8,["scroll-container"])]}),key:"0"}:void 0,e.renderList(e.unref(c.omit)(g,["title","searchFormExtra","headerCell","summary"]),(o,a)=>({name:a,fn:e.withCtx(u=>[e.renderSlot(r.$slots,a,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1040,["class","size","table-layout","columns"])],6)],6))}});exports.default=Te;
|
|
@@ -4,18 +4,18 @@ export declare const useTableColumnState: (columnSetting: ApTableSettingType, pe
|
|
|
4
4
|
columnState: Ref<{
|
|
5
5
|
key: string | number;
|
|
6
6
|
show?: boolean | undefined;
|
|
7
|
-
fixed?:
|
|
7
|
+
fixed?: "left" | "right" | undefined;
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
label?: any;
|
|
10
|
-
children?: any[] | undefined;
|
|
10
|
+
children?: /*elided*/ any[] | undefined;
|
|
11
11
|
order?: number | undefined;
|
|
12
12
|
}[], ApColumnState[] | {
|
|
13
13
|
key: string | number;
|
|
14
14
|
show?: boolean | undefined;
|
|
15
|
-
fixed?:
|
|
15
|
+
fixed?: "left" | "right" | undefined;
|
|
16
16
|
disabled?: boolean | undefined;
|
|
17
17
|
label?: any;
|
|
18
|
-
children?: any[] | undefined;
|
|
18
|
+
children?: /*elided*/ any[] | undefined;
|
|
19
19
|
order?: number | undefined;
|
|
20
20
|
}[]>;
|
|
21
21
|
selectAll: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UploadFile, UploadChangeParam } from '@aplus-frontend/antdv';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, GlobalComponents, GlobalDirectives } from 'vue';
|
|
3
|
-
import { UploadType, UploadFile, FileType, HttpRequestHeader, ShowUploadListInterface,
|
|
3
|
+
import { UploadType, UploadFile, FileType, HttpRequestHeader, ShowUploadListInterface, UploadListType, UploadLocale, UploadListProgressProps, ItemRender } from '@aplus-frontend/antdv/es/upload/interface';
|
|
4
4
|
import { UploadRequestOption } from '@aplus-frontend/antdv/es/vc-upload/interface';
|
|
5
5
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
6
6
|
declare function setValue(val: (string | Record<string, any>)[]): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Oss } from '../hooks/useOss';
|
|
2
|
+
import { actionResponse } from '@aplus-frontend/oss';
|
|
2
3
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
4
|
declare function setValue(val?: (string | Record<string, any>)[]): void;
|
|
4
5
|
interface UploadFile extends File {
|
|
@@ -17,13 +18,7 @@ declare function __VLS_template(): {
|
|
|
17
18
|
pictureContext?(_: {
|
|
18
19
|
fileList: {
|
|
19
20
|
oss: {
|
|
20
|
-
pauseUpload: (() => Promise<
|
|
21
|
-
status: number;
|
|
22
|
-
previewUrl?: string;
|
|
23
|
-
saveUrl?: string;
|
|
24
|
-
originalFileName?: string;
|
|
25
|
-
message: string;
|
|
26
|
-
}>) | undefined;
|
|
21
|
+
pauseUpload: (() => Promise< actionResponse>) | undefined;
|
|
27
22
|
};
|
|
28
23
|
}[];
|
|
29
24
|
remove: typeof handleRemove;
|
|
@@ -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"),p=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const _=require("./constans.js"),f=require("../../ap-download/utils/getFileInfo.js"),k=require("../../ap-download/hooks/index.js"),G=require("lodash-unified"),g=require("@ant-design/icons-vue"),U=require("../../config-provider/hooks/use-namespace.js"),v=require("../../config-provider/hooks/use-global-config.js"),j=require("../../config-provider/hooks/use-locale.js"),z=e.defineComponent({name:"ApAttachment",props:_.ApAttachmentProps(),setup(t){const{b:F,e:l}=U.useNamespace("ap-attachment"),w=v.useGlobalConfig("uiMode"),y=v.useGlobalConfig("apUpload"),N=v.useGlobalConfig("downloadCenterTriggerConfig"),{lang:b,t:r}=j.useLocale(),o=e.ref(!1),c=e.ref(""),d=e.useSlots(),O=e.computed(()=>b.value==="zh-cn"?"zh_CN":"en_US"),u=e.computed(()=>t.attachmentList.length===1),h=e.computed(()=>t.needName?t.attachmentList.length>0&&t.needName&&t.needName.nameKey?t.attachmentList[0][t.needName.nameKey]:"":t.attachmentList.length>0?t.attachmentList[0].fileName:""),q=e.computed(()=>u.value?h.value:r("ap.apAttachment.downloadall")),L=e.computed(()=>t.color?t.color:w.value==="aplus"?"#0070FF":"#1890FF"),T=e.computed(()=>({width:u.value?"auto":"266px"})),V=e.computed(()=>({"--download-main-color":L.value,"--download-main-color-opacity":f.getHexWithOpacity(L.value,.6)})),x=e.computed(()=>{var a;return t.getOssAccess||((a=y.value)==null?void 0:a.getOssAccess)}),I=e.computed(()=>{const a=d.default?d.default()[0]:null;return a?e.cloneVNode(a,{style:{"font-size":"16px"}}):null}),m=async(a,i)=>{var n,C;if(!t.disabled){o.value=!0,i&&(c.value=i);try{const s=G.isArray(e.toRaw(a))?e.toRaw(a):[e.toRaw(a)];if((n=N.value)!=null&&n.trigger){const M=f.getFileInfo(t.needName,s).map(A=>({objectName:A.path,fileName:A.fileName}));(C=N.value)==null||C.trigger(M)}else await(await k.useOssInit(x.value,e.unref(O))).downloadFile(f.getFileInfo(t.needName,s))}catch(s){console.error(s)}finally{o.value=!1,c.value=""}}},P=a=>a&&a.length>0?e.createVNode("ul",{class:[l("file-list")],style:V.value},[a.map((i,n)=>e.createVNode("li",{key:n,class:[l("file-item")],onClick:()=>m(i,n+1)},[o.value&&c.value===n+1?e.createVNode("span",{class:[l("spin")]},[e.createVNode(g.LoadingOutlined,{spin:!0},null)]):null,i.fileName])),e.createVNode("li",{class:[l("down-load-all")],onClick:()=>m(t.attachmentList,"all")},[o.value&&c.value==="all"?e.createVNode("span",{class:[l("spin")]},[e.createVNode(g.LoadingOutlined,{spin:!0},null)]):null,r("ap.apAttachment.downloadall")])]):null;return()=>{var a;return((a=t.attachmentList)==null?void 0:a.length)>0&&e.createVNode("div",{class:[F()],style:[T.value,V.value]},[e.createVNode(p.Tooltip,{title:q.value,placement:t.textToolTipPlacement,color:t.toolTipBgColor},{default:()=>[e.createVNode("div",{class:[l("content")],onClick:()=>m(u.value?t.attachmentList[0]:t.attachmentList,"global")},[o.value&&c.value==="global"?e.createVNode("div",{class:[l("spin")]},[e.createVNode(g.LoadingOutlined,{spin:!0},null)]):null,d.default?e.createVNode("div",{class:[l("text-render")]},[I.value,e.createTextVNode(" ")]):null,e.createVNode("div",{class:[l("text-inner")]},[h.value])])]}),e.createVNode(p.Popover,{content:P(t.attachmentList),placement:t.fileMorePopoverPlacement,color:"#fff"},{default:()=>[!u.value&&e.createVNode("div",{class:[l("more")]},[r("ap.apAttachment.more")])]})])}}});exports.default=z;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ApDownLoadProps } from '../../ap-download/interface';
|
|
2
2
|
import { TooltipPlacement } from '@aplus-frontend/antdv/es/tooltip';
|
|
3
3
|
export type AttachmentItemProps = {
|
|
4
|
-
fileName
|
|
5
|
-
filePath
|
|
4
|
+
fileName?: string;
|
|
5
|
+
filePath?: string;
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
8
8
|
export type ApAttachmentProps = Required<{
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ApBatchActionGroupProps } from './interface';
|
|
2
|
-
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { TableColumnType } from '@aplus-frontend/antdv';
|
|
3
4
|
type __VLS_Props = ApBatchActionGroupProps;
|
|
4
|
-
declare const _default: DefineComponent<__VLS_Props, {
|
|
5
|
+
declare const _default: DefineComponent<__VLS_Props, {
|
|
6
|
+
columns: ComputedRef< TableColumnType<any>[]> | undefined;
|
|
7
|
+
dataSource: ComputedRef<any[]> | undefined;
|
|
8
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
5
9
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv");require("../../ap-button/index.js");require("./MenuItemGroup.vue.js");require("../../config-provider/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv");require("../../ap-button/index.js");require("./MenuItemGroup.vue.js");require("../../config-provider/index.js");const q=require("@ant-design/icons-vue"),C=require("@aplus-frontend/hooks"),k=require("../../ap-table/context.js"),B=require("../../config-provider/hooks/use-namespace.js"),N=require("../../config-provider/hooks/use-locale.js"),x=require("../../config-provider/hooks/use-global-config.js"),m=require("./MenuItemGroup.vue2.js"),L=require("../../ap-button/ap-button.vue.js"),A=e.defineComponent({__name:"ApBatchActionGroup",props:{selectedRows:{},buttonProps:{},menuList:{}},setup(v,{expose:b}){const{b:l}=B.useNamespace("ap-batch-action-group"),{t:f}=N.useLocale(),{columns:_,dataSource:y}=k.useInjectApTable(),t=v,h=x.useGlobalConfig("uiMode"),{hasPermission:w}=C.usePermission(),c=e.computed(()=>{var o;return((o=t==null?void 0:t.buttonProps)==null?void 0:o.dropdownType)||"default"}),n=e.computed(()=>{var o;return((o=t==null?void 0:t.buttonProps)==null?void 0:o.type)||"borderLink"}),d=e.computed(()=>{var o;return((o=t==null?void 0:t.buttonProps)==null?void 0:o.content)||f("ap.apApBatchActionGroup.batchOperation")}),g=e.computed(()=>(t==null?void 0:t.selectedRows)||[]),s=e.computed(()=>{var o;return((o=t==null?void 0:t.buttonProps)==null?void 0:o.disabled)??(Array.isArray(t.selectedRows)?g.value.length===0:!1)}),P=e.computed(()=>{const o={aplus:"#0070FF",admin:"#34b77c"};return n.value==="borderLink"?s.value?void 0:o[h.value]||o.aplus:void 0}),r=e.computed(()=>{var o;return((o=t==null?void 0:t.menuList)==null?void 0:o.filter(u=>{let a=u==null?void 0:u.ifShow;return!(u!=null&&u.ifShow)&&(u!=null&&u.auth)&&(a=()=>w(u.auth)),(a==null?void 0:a())??!0}))||[]});function i(){return t!=null&&t.buttonProps?{...t.buttonProps,type:n.value==="borderLink"?"default":n.value}:{}}return b({columns:_,dataSource:y}),(o,u)=>r.value.length&&c.value==="dropdown"?(e.openBlock(),e.createBlock(e.unref(p.DropdownButton),e.mergeProps({key:0,class:[e.unref(l)()]},{...o.$attrs,...i(),disabled:s.value}),{overlay:e.withCtx(()=>[e.createVNode(m.default,e.mergeProps({...t},{"menu-list":r.value}),null,16,["menu-list"])]),default:e.withCtx(()=>[e.createElementVNode("span",{style:e.normalizeStyle({color:P.value})},e.toDisplayString(d.value),5)]),_:1},16,["class"])):r.value.length&&c.value==="default"?(e.openBlock(),e.createBlock(e.unref(p.Dropdown),{key:1,class:e.normalizeClass([e.unref(l)()]),disabled:s.value},{overlay:e.withCtx(()=>[e.createVNode(m.default,e.mergeProps({...t},{"menu-list":r.value}),null,16,["menu-list"])]),default:e.withCtx(()=>[e.createVNode(e.unref(L.default),e.normalizeProps(e.guardReactiveProps({...o.$attrs,...i(),type:n.value})),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),e.createVNode(e.unref(q.DownOutlined))]),_:1},16)]),_:1},8,["class","disabled"])):e.createCommentVNode("",!0)}});exports.default=A;
|