@aplus-frontend/ui 0.1.23 → 0.1.24
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/index.mjs +66 -63
- package/es/src/ap-download/ap-download.vue.d.ts +0 -3
- package/es/src/ap-download/ap-download.vue.mjs +10 -10
- package/es/src/ap-field/number/index.vue.mjs +20 -19
- package/es/src/ap-form/ap-form-item.vue.mjs +27 -25
- package/es/src/ap-form/ap-form.vue.d.ts +1 -1
- package/es/src/ap-form/ap-form.vue2.mjs +18 -18
- package/es/src/ap-form/interface.d.ts +2 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/es/src/ap-form/search-form/index.vue.d.ts +2 -2
- package/es/src/ap-table/utils.mjs +1 -1
- package/es/src/business/ap-attachment/ApAttachment.d.ts +97 -0
- package/es/src/business/ap-attachment/ApAttachment.mjs +82 -0
- package/es/src/business/ap-attachment/constans.d.ts +44 -0
- package/es/src/business/ap-attachment/constans.mjs +42 -0
- package/es/src/business/ap-attachment/index.d.ts +3 -0
- package/es/src/business/ap-attachment/interface.d.ts +13 -0
- package/es/src/business/ap-attachment/style.css +62 -0
- package/es/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +25 -22
- package/es/src/business/ap-input-radio/interface.d.ts +8 -2
- package/es/src/business/hooks/index.d.ts +1 -0
- package/es/src/business/hooks/index.mjs +4 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +29 -0
- package/es/src/business/hooks/usePageListApTable.mjs +67 -0
- package/es/src/business/index.d.ts +123 -3
- package/es/src/business/index.mjs +29 -26
- package/es/src/editable-table/form-item.vue.mjs +80 -77
- package/es/src/editable-table/hooks/use-get-columns.mjs +30 -30
- package/es/src/editable-table/interface.d.ts +2 -2
- package/es/src/index.mjs +204 -201
- package/es/src/locale/lang/en.mjs +4 -0
- package/es/src/locale/lang/zh-cn.mjs +4 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +62 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-download/ap-download.vue.d.ts +0 -3
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +2 -2
- package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/lib/src/ap-form/search-form/index.vue.d.ts +2 -2
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +97 -0
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -0
- package/lib/src/business/ap-attachment/constans.d.ts +44 -0
- package/lib/src/business/ap-attachment/constans.js +1 -0
- package/lib/src/business/ap-attachment/index.d.ts +3 -0
- package/lib/src/business/ap-attachment/interface.d.ts +13 -0
- package/lib/src/business/ap-attachment/style.css +62 -0
- package/lib/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
- package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
- package/lib/src/business/ap-input-radio/interface.d.ts +8 -2
- package/lib/src/business/hooks/index.d.ts +1 -0
- package/lib/src/business/hooks/index.js +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +29 -0
- package/lib/src/business/hooks/usePageListApTable.js +1 -0
- package/lib/src/business/index.d.ts +123 -3
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/interface.d.ts +2 -2
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-attachment/ap-attachment.css +62 -0
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as A, ref as E, reactive as N, nextTick as O, toRaw as m, computed as j, openBlock as S, createBlock as W, unref as C, mergeProps as q, withCtx as z, renderSlot as D } from "vue";
|
|
2
2
|
import { Form as L } from "ant-design-vue";
|
|
3
3
|
import { useProvideForm as P } from "./context.mjs";
|
|
4
|
-
import { isArray as
|
|
4
|
+
import { isArray as p, cloneDeep as V, omit as K } from "lodash-unified";
|
|
5
5
|
import { INTERNAL_FORM_INSTANCE_MARK as $ } from "./constant.mjs";
|
|
6
|
-
import { isDef as
|
|
6
|
+
import { isDef as h } from "../utils/index.mjs";
|
|
7
7
|
const Y = /* @__PURE__ */ A({
|
|
8
8
|
__name: "ap-form",
|
|
9
9
|
props: {
|
|
@@ -34,26 +34,26 @@ const Y = /* @__PURE__ */ A({
|
|
|
34
34
|
},
|
|
35
35
|
setup(_, { expose: R }) {
|
|
36
36
|
const i = _;
|
|
37
|
-
function
|
|
37
|
+
function f(e, t, l = !0) {
|
|
38
38
|
var y;
|
|
39
|
-
if (
|
|
39
|
+
if (p(e)) {
|
|
40
40
|
let n = o;
|
|
41
41
|
for (let u = 0; u < e.length - 1; u++)
|
|
42
42
|
e[u] in n || (n[e[u]] = {}), n = n[e[u]];
|
|
43
43
|
n[e[e.length - 1]] = t;
|
|
44
44
|
} else
|
|
45
45
|
o[e] = t;
|
|
46
|
-
let r =
|
|
46
|
+
let r = p(e) ? e[0] : e;
|
|
47
47
|
l && ((y = i.onValuesChange) == null || y.call(i, { [r]: o[r] }, o)), d();
|
|
48
48
|
}
|
|
49
49
|
const a = E();
|
|
50
|
-
let
|
|
50
|
+
let c = i.initialValues ? V(i.initialValues) : {};
|
|
51
51
|
const o = N(i.initialValues || {});
|
|
52
52
|
let s = [];
|
|
53
53
|
const B = async () => {
|
|
54
54
|
var e;
|
|
55
55
|
(e = a.value) == null || e.resetFields(), await O(() => {
|
|
56
|
-
Object.keys(o).forEach((t) => delete o[t]), Object.assign(o, V(
|
|
56
|
+
Object.keys(o).forEach((t) => delete o[t]), Object.assign(o, V(c)), d();
|
|
57
57
|
});
|
|
58
58
|
}, I = (e) => {
|
|
59
59
|
var t;
|
|
@@ -73,22 +73,22 @@ const Y = /* @__PURE__ */ A({
|
|
|
73
73
|
}, w = (e) => {
|
|
74
74
|
Object.assign(o, e), d();
|
|
75
75
|
}, F = (e, t) => {
|
|
76
|
-
|
|
76
|
+
f(e, t), d();
|
|
77
77
|
};
|
|
78
|
-
function
|
|
78
|
+
function g(e, t) {
|
|
79
79
|
return t || e(m(o)), s.push(e), () => {
|
|
80
80
|
s = s.filter((l) => l !== e);
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
function v({ initialValue: e, name: t }) {
|
|
84
|
-
if (
|
|
85
|
-
if (
|
|
86
|
-
let l =
|
|
84
|
+
if (h(e) && h(t))
|
|
85
|
+
if (f(t, e, !1), p(t)) {
|
|
86
|
+
let l = c;
|
|
87
87
|
for (let r = 0; r < t.length - 1; r++)
|
|
88
|
-
|
|
88
|
+
h(l[t[r]]) || (l[t[r]] = {}), l = l[t[r]];
|
|
89
89
|
l[t[t.length - 1]] = e;
|
|
90
90
|
} else
|
|
91
|
-
|
|
91
|
+
c[t] = e;
|
|
92
92
|
}
|
|
93
93
|
function x(e) {
|
|
94
94
|
if (e !== $) {
|
|
@@ -97,7 +97,7 @@ const Y = /* @__PURE__ */ A({
|
|
|
97
97
|
}
|
|
98
98
|
return {
|
|
99
99
|
registerField: v,
|
|
100
|
-
registerWatch:
|
|
100
|
+
registerWatch: g
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
function d() {
|
|
@@ -110,9 +110,9 @@ const Y = /* @__PURE__ */ A({
|
|
|
110
110
|
}
|
|
111
111
|
return P({
|
|
112
112
|
model: j(() => o),
|
|
113
|
-
updateModel:
|
|
113
|
+
updateModel: f,
|
|
114
114
|
internalInstance: {
|
|
115
|
-
registerWatch:
|
|
115
|
+
registerWatch: g,
|
|
116
116
|
registerField: v,
|
|
117
117
|
setFieldValue: F
|
|
118
118
|
}
|
|
@@ -125,7 +125,7 @@ const Y = /* @__PURE__ */ A({
|
|
|
125
125
|
scrollToField: k,
|
|
126
126
|
setFieldsValue: w,
|
|
127
127
|
setFieldValue: F,
|
|
128
|
-
registerWatch:
|
|
128
|
+
registerWatch: g,
|
|
129
129
|
getInternalInstance: x
|
|
130
130
|
}), (e, t) => (S(), W(C(L), q({
|
|
131
131
|
ref_key: "formRef",
|
|
@@ -11,7 +11,7 @@ export type ApFormItemProps = FormItemProps & Partial<ApFormColProps> & {
|
|
|
11
11
|
bordered?: boolean;
|
|
12
12
|
valuePropName?: string;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* 表单项的默认值(只生效一次),支持传入异步函数
|
|
15
15
|
*/
|
|
16
16
|
initialValue?: any;
|
|
17
17
|
/**
|
|
@@ -35,7 +35,7 @@ export type ApFormProps = Omit<FormProps, 'model'> & {
|
|
|
35
35
|
export type WatchFunc = (values?: Recordable) => void;
|
|
36
36
|
export type ApFormExpose<ModelType = any> = {
|
|
37
37
|
setFieldsValue: (fields: Partial<ModelType>) => void;
|
|
38
|
-
setFieldValue: (
|
|
38
|
+
setFieldValue: (name: NamePath, value: any) => void;
|
|
39
39
|
resetFields: () => Promise<void>;
|
|
40
40
|
clearValidate: (name?: NamePath) => void;
|
|
41
41
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<ModelType>> | undefined;
|
|
@@ -440,7 +440,7 @@ declare function __VLS_template(): {
|
|
|
440
440
|
}> | undefined;
|
|
441
441
|
scrollToField: (name: NamePath, options?: {}) => void;
|
|
442
442
|
setFieldsValue: (values: Record<string, any>) => void;
|
|
443
|
-
setFieldValue: (
|
|
443
|
+
setFieldValue: (name: NamePath, newValue: any) => void;
|
|
444
444
|
registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
|
|
445
445
|
getInternalInstance: (mark: string) => {
|
|
446
446
|
registerField: ({ initialValue, name }: RegistedFieldType) => void;
|
|
@@ -632,7 +632,7 @@ declare function __VLS_template(): {
|
|
|
632
632
|
}> | undefined;
|
|
633
633
|
scrollToField: (name: NamePath, options?: {}) => void;
|
|
634
634
|
setFieldsValue: (values: Record<string, any>) => void;
|
|
635
|
-
setFieldValue: (
|
|
635
|
+
setFieldValue: (name: NamePath, newValue: any) => void;
|
|
636
636
|
registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
|
|
637
637
|
getInternalInstance: (mark: string) => {
|
|
638
638
|
registerField: ({ initialValue, name }: RegistedFieldType) => void;
|
|
@@ -435,7 +435,7 @@ declare function __VLS_template(): {
|
|
|
435
435
|
}> | undefined;
|
|
436
436
|
scrollToField: (name: NamePath, options?: {}) => void;
|
|
437
437
|
setFieldsValue: (values: Record<string, any>) => void;
|
|
438
|
-
setFieldValue: (
|
|
438
|
+
setFieldValue: (name: NamePath, newValue: any) => void;
|
|
439
439
|
registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
|
|
440
440
|
getInternalInstance: (mark: string) => {
|
|
441
441
|
registerField: ({ initialValue, name }: RegistedFieldType) => void;
|
|
@@ -627,7 +627,7 @@ declare function __VLS_template(): {
|
|
|
627
627
|
}> | undefined;
|
|
628
628
|
scrollToField: (name: NamePath, options?: {}) => void;
|
|
629
629
|
setFieldsValue: (values: Record<string, any>) => void;
|
|
630
|
-
setFieldValue: (
|
|
630
|
+
setFieldValue: (name: NamePath, newValue: any) => void;
|
|
631
631
|
registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
|
|
632
632
|
getInternalInstance: (mark: string) => {
|
|
633
633
|
registerField: ({ initialValue, name }: RegistedFieldType) => void;
|
|
@@ -154,7 +154,7 @@ function k(t, e, n) {
|
|
|
154
154
|
title: t.title,
|
|
155
155
|
column: t
|
|
156
156
|
});
|
|
157
|
-
if (o && (o.length > 1 || o[0].children !== "v-if"))
|
|
157
|
+
if (o && (o.length > 1 || o[0].children && o[0].children !== "v-if"))
|
|
158
158
|
return o;
|
|
159
159
|
const r = c(t.title) ? u("span", {
|
|
160
160
|
style: E,
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { AttachmentItemProps, ApAttachmentProps } from './interface';
|
|
2
|
+
import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
|
|
3
|
+
import { TooltipPlacement } from 'ant-design-vue/es/tooltip';
|
|
4
|
+
declare const _default: DefineComponent<{
|
|
5
|
+
attachmentList: {
|
|
6
|
+
type: PropType<Array<AttachmentItemProps>>;
|
|
7
|
+
default: never[];
|
|
8
|
+
required: boolean;
|
|
9
|
+
};
|
|
10
|
+
textToolTipPlacement: {
|
|
11
|
+
type: PropType< ApAttachmentProps["textToolTipPlacement"]>;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
fileMorePopoverPlacement: {
|
|
15
|
+
type: PropType< ApAttachmentProps["fileMorePopoverPlacement"]>;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
color: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
};
|
|
21
|
+
size: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
needName: {
|
|
26
|
+
type: PropType<{
|
|
27
|
+
nameKey?: string;
|
|
28
|
+
pathKey?: string;
|
|
29
|
+
}>;
|
|
30
|
+
default: () => {
|
|
31
|
+
nameKey: string;
|
|
32
|
+
pathKey: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
getOssAccess: {
|
|
36
|
+
type: PropType< ApAttachmentProps["getOssAccess"]>;
|
|
37
|
+
};
|
|
38
|
+
disabled: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
toolTipBgColor: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
};
|
|
45
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
46
|
+
attachmentList: {
|
|
47
|
+
type: PropType<Array<AttachmentItemProps>>;
|
|
48
|
+
default: never[];
|
|
49
|
+
required: boolean;
|
|
50
|
+
};
|
|
51
|
+
textToolTipPlacement: {
|
|
52
|
+
type: PropType< ApAttachmentProps["textToolTipPlacement"]>;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
fileMorePopoverPlacement: {
|
|
56
|
+
type: PropType< ApAttachmentProps["fileMorePopoverPlacement"]>;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
color: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
};
|
|
62
|
+
size: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
needName: {
|
|
67
|
+
type: PropType<{
|
|
68
|
+
nameKey?: string;
|
|
69
|
+
pathKey?: string;
|
|
70
|
+
}>;
|
|
71
|
+
default: () => {
|
|
72
|
+
nameKey: string;
|
|
73
|
+
pathKey: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
getOssAccess: {
|
|
77
|
+
type: PropType< ApAttachmentProps["getOssAccess"]>;
|
|
78
|
+
};
|
|
79
|
+
disabled: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: boolean;
|
|
82
|
+
};
|
|
83
|
+
toolTipBgColor: {
|
|
84
|
+
type: StringConstructor;
|
|
85
|
+
};
|
|
86
|
+
}>>, {
|
|
87
|
+
size: string;
|
|
88
|
+
disabled: boolean;
|
|
89
|
+
needName: {
|
|
90
|
+
nameKey?: string;
|
|
91
|
+
pathKey?: string;
|
|
92
|
+
};
|
|
93
|
+
textToolTipPlacement: TooltipPlacement;
|
|
94
|
+
attachmentList: AttachmentItemProps[];
|
|
95
|
+
fileMorePopoverPlacement: TooltipPlacement;
|
|
96
|
+
}, {}>;
|
|
97
|
+
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as O, useSlots as T, computed as a, cloneVNode as P, unref as k, toRaw as u, createVNode as o, createTextVNode as S } from "vue";
|
|
2
|
+
import { Tooltip as V, Popover as b } from "ant-design-vue";
|
|
3
|
+
import "../../config-provider/index.mjs";
|
|
4
|
+
import { ApAttachmentProps as z } from "./constans.mjs";
|
|
5
|
+
import { getHexWithOpacity as I, getFileInfo as M } from "../../ap-download/utils/getFileInfo.mjs";
|
|
6
|
+
import "./style.css";
|
|
7
|
+
import { useOssInit as U } from "../../ap-download/hooks/index.mjs";
|
|
8
|
+
import { isArray as _ } from "lodash-unified";
|
|
9
|
+
import { useNamespace as B } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useGlobalConfig as h } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
const Y = /* @__PURE__ */ O({
|
|
13
|
+
name: "ApAttachment",
|
|
14
|
+
props: z(),
|
|
15
|
+
setup(t) {
|
|
16
|
+
const {
|
|
17
|
+
b: p,
|
|
18
|
+
e: l
|
|
19
|
+
} = B("ap-attachment"), A = h("uiMode"), g = h("apUpload"), {
|
|
20
|
+
lang: w,
|
|
21
|
+
t: i
|
|
22
|
+
} = G(), s = T(), C = a(() => w.value === "zh-cn" ? "zh_CN" : "en_US"), n = a(() => t.attachmentList.length === 1), d = a(() => t.attachmentList.length > 0 ? t.attachmentList[0].fileName : ""), N = a(() => n.value ? d.value : i("ap.apAttachment.downloadall")), f = a(() => t.color ? t.color : A.value === "aplus" ? "#0070FF" : "#1890FF"), y = a(() => ({
|
|
23
|
+
width: n.value ? "auto" : "266px"
|
|
24
|
+
})), v = a(() => ({
|
|
25
|
+
"--download-main-color": f.value,
|
|
26
|
+
"--download-main-color-opacity": I(f.value, 0.6)
|
|
27
|
+
})), F = a(() => {
|
|
28
|
+
var e;
|
|
29
|
+
return t.getOssAccess || ((e = g.value) == null ? void 0 : e.getOssAccess);
|
|
30
|
+
}), L = a(() => {
|
|
31
|
+
const e = s.default ? s.default()[0] : null;
|
|
32
|
+
return e ? P(e, {
|
|
33
|
+
style: {
|
|
34
|
+
"font-size": "16px"
|
|
35
|
+
}
|
|
36
|
+
}) : null;
|
|
37
|
+
}), r = async (e) => {
|
|
38
|
+
if (!t.disabled) {
|
|
39
|
+
const c = await U(F.value, k(C)), m = _(u(e)) ? u(e) : [u(e)];
|
|
40
|
+
await c.downloadFile(M(t.needName, m));
|
|
41
|
+
}
|
|
42
|
+
}, x = (e) => e && e.length > 0 ? o("ul", {
|
|
43
|
+
class: [l("file-list")],
|
|
44
|
+
style: v.value
|
|
45
|
+
}, [e.map((c, m) => o("li", {
|
|
46
|
+
key: m,
|
|
47
|
+
class: [l("file-item")],
|
|
48
|
+
onClick: () => r(c)
|
|
49
|
+
}, [c.fileName])), o("li", {
|
|
50
|
+
class: [l("down-load-all")],
|
|
51
|
+
onClick: () => r(t.attachmentList)
|
|
52
|
+
}, [i("ap.apAttachment.downloadall")])]) : null;
|
|
53
|
+
return () => o("div", {
|
|
54
|
+
class: [p()],
|
|
55
|
+
style: [y.value, v.value]
|
|
56
|
+
}, [o(V, {
|
|
57
|
+
title: N.value,
|
|
58
|
+
placement: t.textToolTipPlacement,
|
|
59
|
+
color: t.toolTipBgColor
|
|
60
|
+
}, {
|
|
61
|
+
default: () => [o("div", {
|
|
62
|
+
class: [l("content")],
|
|
63
|
+
onClick: () => r(n.value ? t.attachmentList[0] : t.attachmentList)
|
|
64
|
+
}, [s.default ? o("div", {
|
|
65
|
+
class: [l("text-render")]
|
|
66
|
+
}, [L.value, S(" ")]) : null, o("div", {
|
|
67
|
+
class: [l("text-inner")]
|
|
68
|
+
}, [d.value])])]
|
|
69
|
+
}), o(b, {
|
|
70
|
+
content: x(t.attachmentList),
|
|
71
|
+
placement: t.fileMorePopoverPlacement,
|
|
72
|
+
color: "#fff"
|
|
73
|
+
}, {
|
|
74
|
+
default: () => [!n.value && o("div", {
|
|
75
|
+
class: [l("more")]
|
|
76
|
+
}, [i("ap.apAttachment.more")])]
|
|
77
|
+
})]);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
Y as default
|
|
82
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ApAttachmentProps as _ApAttachmentProps, AttachmentItemProps } from './interface';
|
|
3
|
+
export declare const ApAttachmentProps: () => {
|
|
4
|
+
attachmentList: {
|
|
5
|
+
type: PropType<Array<AttachmentItemProps>>;
|
|
6
|
+
default: never[];
|
|
7
|
+
required: boolean;
|
|
8
|
+
};
|
|
9
|
+
textToolTipPlacement: {
|
|
10
|
+
type: PropType<_ApAttachmentProps["textToolTipPlacement"]>;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
fileMorePopoverPlacement: {
|
|
14
|
+
type: PropType<_ApAttachmentProps["fileMorePopoverPlacement"]>;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
color: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
};
|
|
20
|
+
size: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
needName: {
|
|
25
|
+
type: PropType<{
|
|
26
|
+
nameKey?: string;
|
|
27
|
+
pathKey?: string;
|
|
28
|
+
}>;
|
|
29
|
+
default: () => {
|
|
30
|
+
nameKey: string;
|
|
31
|
+
pathKey: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
getOssAccess: {
|
|
35
|
+
type: PropType<_ApAttachmentProps["getOssAccess"]>;
|
|
36
|
+
};
|
|
37
|
+
disabled: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
toolTipBgColor: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const e = () => ({
|
|
2
|
+
attachmentList: {
|
|
3
|
+
type: Array,
|
|
4
|
+
default: [],
|
|
5
|
+
required: !0
|
|
6
|
+
},
|
|
7
|
+
textToolTipPlacement: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "topLeft"
|
|
10
|
+
},
|
|
11
|
+
fileMorePopoverPlacement: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "bottom"
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "middle"
|
|
21
|
+
},
|
|
22
|
+
needName: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => ({
|
|
25
|
+
nameKey: "fileName",
|
|
26
|
+
pathKey: "filePath"
|
|
27
|
+
})
|
|
28
|
+
},
|
|
29
|
+
getOssAccess: {
|
|
30
|
+
type: Function
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
toolTipBgColor: {
|
|
37
|
+
type: String
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
e as ApAttachmentProps
|
|
42
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApDownLoadProps } from '../../ap-download/interface';
|
|
2
|
+
import { TooltipPlacement } from 'ant-design-vue/es/Tooltip';
|
|
3
|
+
export type AttachmentItemProps = {
|
|
4
|
+
fileName: string;
|
|
5
|
+
filePath: string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
export type ApAttachmentProps = Required<{
|
|
9
|
+
attachmentList: Array<AttachmentItemProps> | [];
|
|
10
|
+
textToolTipPlacement?: TooltipPlacement;
|
|
11
|
+
fileMorePopoverPlacement?: TooltipPlacement;
|
|
12
|
+
toolTipBgColor?: string;
|
|
13
|
+
} & Pick<ApDownLoadProps, 'color' | 'size' | 'needName' | 'disabled'>> & Pick<ApDownLoadProps, 'getOssAccess'>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.aplus-ap-attachment {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
}
|
|
5
|
+
.aplus-ap-attachment__content {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
.aplus-ap-attachment__text-render {
|
|
10
|
+
color: var(--download-main-color);
|
|
11
|
+
margin-right: 5px;
|
|
12
|
+
}
|
|
13
|
+
.aplus-ap-attachment__text-render:hover {
|
|
14
|
+
color: var(--download-main-color-opacity);
|
|
15
|
+
}
|
|
16
|
+
.aplus-ap-attachment__text-inner {
|
|
17
|
+
max-width: 190px;
|
|
18
|
+
display: inline-block;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
color: var(--download-main-color);
|
|
25
|
+
}
|
|
26
|
+
.aplus-ap-attachment__text-inner:hover {
|
|
27
|
+
color: var(--download-main-color-opacity);
|
|
28
|
+
}
|
|
29
|
+
.aplus-ap-attachment__more {
|
|
30
|
+
display: inline-block;
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
color: var(--download-main-color);
|
|
34
|
+
}
|
|
35
|
+
.aplus-ap-attachment__more:hover {
|
|
36
|
+
color: var(--download-main-color-opacity);
|
|
37
|
+
}
|
|
38
|
+
.aplus-ap-attachment__file-list {
|
|
39
|
+
max-width: 312px;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
}
|
|
43
|
+
.aplus-ap-attachment__file-item {
|
|
44
|
+
flex: 1;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
margin-bottom: 16px;
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
color: #000;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
.aplus-ap-attachment__file-item:hover {
|
|
52
|
+
color: var(--download-main-color);
|
|
53
|
+
}
|
|
54
|
+
.aplus-ap-attachment__down-load-all {
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
color: var(--download-main-color);
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
.aplus-ap-attachment__down-load-all:hover {
|
|
61
|
+
color: var(--download-main-color-opacity);
|
|
62
|
+
}
|
|
@@ -6,12 +6,14 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOpti
|
|
|
6
6
|
stringMode: boolean;
|
|
7
7
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8
8
|
"update:value": (...args: any[]) => void;
|
|
9
|
+
InputRadioChange: (...args: any[]) => void;
|
|
9
10
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApInputRadioProps>, {
|
|
10
11
|
bordered: boolean;
|
|
11
12
|
controls: boolean;
|
|
12
13
|
stringMode: boolean;
|
|
13
14
|
}>>> & {
|
|
14
15
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
onInputRadioChange?: ((...args: never) => any) | undefined;
|
|
15
17
|
}, {
|
|
16
18
|
bordered: boolean;
|
|
17
19
|
stringMode: boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as g, openBlock as C, createElementBlock as h, normalizeClass as I, unref as t, createVNode as l, mergeProps as B } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { Form as
|
|
3
|
+
import { Form as R, InputNumber as b, RadioGroup as _ } from "ant-design-vue";
|
|
4
4
|
import { omit as x } from "lodash-unified";
|
|
5
5
|
import "./style.css";
|
|
6
6
|
import { useNamespace as y } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
-
const G = /* @__PURE__ */
|
|
7
|
+
const G = /* @__PURE__ */ g({
|
|
8
8
|
name: "ApInputRadio",
|
|
9
|
+
inheritAttrs: !1,
|
|
9
10
|
__name: "ApInputRadio",
|
|
10
11
|
props: {
|
|
11
12
|
disabled: { type: Boolean },
|
|
@@ -26,32 +27,34 @@ const G = /* @__PURE__ */ f({
|
|
|
26
27
|
onBlur: {},
|
|
27
28
|
onFocus: {},
|
|
28
29
|
value: {},
|
|
29
|
-
options: {}
|
|
30
|
+
options: {},
|
|
31
|
+
onInputRadioChange: {}
|
|
30
32
|
},
|
|
31
|
-
emits: ["update:value"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
n({ inputval: o });
|
|
33
|
+
emits: ["update:value", "InputRadioChange"],
|
|
34
|
+
setup(i, { emit: s }) {
|
|
35
|
+
const m = R.useInjectFormItemContext(), e = i, { b: c, e: d } = y("ap-input-radio"), a = s, r = (o) => {
|
|
36
|
+
let n = { ...e.value, ...o };
|
|
37
|
+
a("update:value", n), a("InputRadioChange", n), m.onFieldChange();
|
|
37
38
|
}, v = (o) => {
|
|
38
|
-
|
|
39
|
+
r({ inputval: o });
|
|
40
|
+
}, f = (o) => {
|
|
41
|
+
r({ radioVal: o.target.value });
|
|
39
42
|
};
|
|
40
|
-
return (o,
|
|
41
|
-
var
|
|
42
|
-
return
|
|
43
|
-
class:
|
|
43
|
+
return (o, n) => {
|
|
44
|
+
var u, p;
|
|
45
|
+
return C(), h("div", {
|
|
46
|
+
class: I([t(c)()])
|
|
44
47
|
}, [
|
|
45
|
-
|
|
46
|
-
class: t(
|
|
48
|
+
l(t(b), B({
|
|
49
|
+
class: t(d)("input-number")
|
|
47
50
|
}, t(x)(e, ["value", "options"]), {
|
|
48
|
-
value: e.value ? (
|
|
49
|
-
onChange:
|
|
51
|
+
value: e.value ? (u = e.value) == null ? void 0 : u.inputval : "",
|
|
52
|
+
onChange: v
|
|
50
53
|
}), null, 16, ["class", "value"]),
|
|
51
|
-
|
|
52
|
-
value: e.value ? (
|
|
54
|
+
l(t(_), {
|
|
55
|
+
value: e.value ? (p = e.value) == null ? void 0 : p.radioVal : "",
|
|
53
56
|
options: e.options,
|
|
54
|
-
onChange:
|
|
57
|
+
onChange: f
|
|
55
58
|
}, null, 8, ["value", "options"])
|
|
56
59
|
], 2);
|
|
57
60
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { InputNumberProps } from 'ant-design-vue/es/input-number';
|
|
2
2
|
type ApInputProps = Pick<InputNumberProps, 'disabled' | 'stringMode' | 'precision' | 'max' | 'min' | 'step' | 'bordered' | 'autofocus' | 'decimalSeparator' | 'controls' | 'formatter' | 'onInput' | 'onChange' | 'onPressEnter' | 'onStep' | 'onBlur' | 'onFocus'>;
|
|
3
|
-
type ApInputValyeName = 'inputval' | 'radioVal';
|
|
4
3
|
export type ApInputValType = {
|
|
5
|
-
value
|
|
4
|
+
value: {
|
|
5
|
+
inputval: string | number;
|
|
6
|
+
radioVal: string | number;
|
|
7
|
+
};
|
|
6
8
|
};
|
|
7
9
|
export type ApInputRadioOptions = Array<{
|
|
8
10
|
value: string | number;
|
|
@@ -10,5 +12,9 @@ export type ApInputRadioOptions = Array<{
|
|
|
10
12
|
}>;
|
|
11
13
|
export type ApInputRadioProps = ApInputProps & ApInputValType & {
|
|
12
14
|
options: ApInputRadioOptions;
|
|
15
|
+
onInputRadioChange: (value: {
|
|
16
|
+
inputval: string | number;
|
|
17
|
+
radioVal: string | number;
|
|
18
|
+
}) => void;
|
|
13
19
|
};
|
|
14
20
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './usePageListApTable';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ApTableProps } from '../../';
|
|
2
|
+
import { Recordable } from '../../type';
|
|
3
|
+
export interface UsePageListApTable extends ApTableProps {
|
|
4
|
+
/** 是否显示默认的行选择配置
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
7
|
+
isShowRowSelection?: boolean;
|
|
8
|
+
/** 转化ApTable查询参数 */
|
|
9
|
+
transformSearchFormValues?: (values: any) => any;
|
|
10
|
+
/** ApTable数据接口 */
|
|
11
|
+
api?(record: any): Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 集成了列表页面的ApTable的默认配置
|
|
15
|
+
* 表格header吸顶效果,表格可拖动,表格行选择
|
|
16
|
+
* @version 1.0.0
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePageListApTable(props?: UsePageListApTable): [ApTableProps, {
|
|
19
|
+
reload: () => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
getSearchFormValues: () => any;
|
|
22
|
+
getApTableInstance: () => {
|
|
23
|
+
reset: () => void;
|
|
24
|
+
submit: () => void;
|
|
25
|
+
dataSource: any;
|
|
26
|
+
setSearchFormValues: (fields: Partial< Recordable>) => void;
|
|
27
|
+
getSearchFormValues: () => Partial< Recordable>;
|
|
28
|
+
} | null;
|
|
29
|
+
}];
|