@aplus-frontend/ui 0.1.22 → 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/ap-table.vue.mjs +202 -198
- package/es/src/ap-table/interface.d.ts +1 -1
- package/es/src/ap-table/style/ap-table.css +3 -0
- 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/ap-label/ApLabel.mjs +8 -7
- 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 +64 -56
- package/es/src/editable-table/interface.d.ts +4 -4
- package/es/src/editable-table/utils.mjs +17 -17
- 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/es/src/theme/ap-table/ap-table.css +3 -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/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +1 -1
- package/lib/src/ap-table/style/ap-table.css +3 -0
- 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/ap-label/ApLabel.js +1 -1
- 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 +4 -4
- package/lib/src/editable-table/utils.js +1 -1
- 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/lib/src/theme/ap-table/ap-table.css +3 -0
- package/package.json +2 -2
|
@@ -50,6 +50,9 @@
|
|
|
50
50
|
.aplus-ap-table-table tr > th.ant-table-cell {
|
|
51
51
|
background-color: var(--ap-table-header-bg, #F2F6F9);
|
|
52
52
|
}
|
|
53
|
+
.aplus-ap-table-table tr > th.ant-table-cell::before {
|
|
54
|
+
background-color: #D8DDE5 !important;
|
|
55
|
+
}
|
|
53
56
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
54
57
|
padding: 12px 16px;
|
|
55
58
|
}
|
|
@@ -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 {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Tooltip as
|
|
1
|
+
import { defineComponent as a, useSlots as r, computed as m, createVNode as e, mergeProps as d } from "vue";
|
|
2
|
+
import { Tooltip as p, Badge as f } from "ant-design-vue";
|
|
3
3
|
import { IconApAdLineAnnotation as A, IconApAdFillWarn as y, IconApAdFillExecution as v, IconApAdFillSuccessful as b } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import { ApLabelProps as g } from "./constans.mjs";
|
|
6
6
|
import { omit as T } from "lodash-unified";
|
|
7
7
|
import "./style.css";
|
|
8
8
|
import { useNamespace as x } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
-
const B = /* @__PURE__ */
|
|
9
|
+
const B = /* @__PURE__ */ a({
|
|
10
10
|
name: "ApLabel",
|
|
11
11
|
props: g(),
|
|
12
12
|
setup(l) {
|
|
@@ -17,8 +17,9 @@ const B = /* @__PURE__ */ c({
|
|
|
17
17
|
color: l.iconColor,
|
|
18
18
|
"font-size": l.iconSize + "px",
|
|
19
19
|
"margin-left": "4px",
|
|
20
|
-
display: "inline-flex"
|
|
21
|
-
|
|
20
|
+
display: "inline-flex",
|
|
21
|
+
cursor: "pointer"
|
|
22
|
+
})), c = (u, t) => u ? e(p, {
|
|
22
23
|
title: u,
|
|
23
24
|
placement: t.placement || "top",
|
|
24
25
|
color: t.toolTipBgColor
|
|
@@ -37,9 +38,9 @@ const B = /* @__PURE__ */ c({
|
|
|
37
38
|
class: [s()]
|
|
38
39
|
}, [e("div", {
|
|
39
40
|
class: [i("content")]
|
|
40
|
-
}, [e(
|
|
41
|
+
}, [e(f, d(T(l, ["helpMessage", "placement", "iconColor"]), {
|
|
41
42
|
status: l.status ? l.status : "default"
|
|
42
|
-
}), null), o.default ? o.default() :
|
|
43
|
+
}), null), o.default ? o.default() : c(l.helpMessage, l)]), o.custom ? e("div", {
|
|
43
44
|
class: [i("custom")]
|
|
44
45
|
}, [o.custom()]) : null]) : null]);
|
|
45
46
|
}
|
|
@@ -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
|
+
}];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import "../../index.mjs";
|
|
2
|
+
import { merge as p } from "lodash-unified";
|
|
3
|
+
import { ref as m } from "vue";
|
|
4
|
+
import { useGlobalConfig as d } from "../../config-provider/hooks/use-global-config.mjs";
|
|
5
|
+
function A(l) {
|
|
6
|
+
const t = m(null), n = d("uiMode", "aplus");
|
|
7
|
+
console.log("mode", n.value);
|
|
8
|
+
const {
|
|
9
|
+
isShowRowSelection: c = !0,
|
|
10
|
+
transformSearchFormValues: o,
|
|
11
|
+
api: a,
|
|
12
|
+
...u
|
|
13
|
+
} = l || {};
|
|
14
|
+
return [p(
|
|
15
|
+
{
|
|
16
|
+
// scroll,tableLayout,columnResizable设置表格可拖动
|
|
17
|
+
scroll: { x: "100%", y: "100%" },
|
|
18
|
+
tableLayout: "fixed",
|
|
19
|
+
columnResizable: !0,
|
|
20
|
+
// 表格header吸顶效果
|
|
21
|
+
class: "ap-table--sticky",
|
|
22
|
+
request: a ? async (e) => {
|
|
23
|
+
const r = o ? o(e) : e;
|
|
24
|
+
try {
|
|
25
|
+
if (!a) throw new Error("api is not defined");
|
|
26
|
+
const { records: s, total: i } = await a(r);
|
|
27
|
+
return {
|
|
28
|
+
data: s,
|
|
29
|
+
total: i
|
|
30
|
+
};
|
|
31
|
+
} catch (s) {
|
|
32
|
+
return console.error(s), {
|
|
33
|
+
data: [],
|
|
34
|
+
total: 0
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
} : void 0,
|
|
38
|
+
rowSelection: c ? {
|
|
39
|
+
mode: "internal",
|
|
40
|
+
fixed: "left",
|
|
41
|
+
columnWidth: 50
|
|
42
|
+
} : void 0,
|
|
43
|
+
ref(e) {
|
|
44
|
+
t.value = e;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
u
|
|
48
|
+
), {
|
|
49
|
+
reload: () => {
|
|
50
|
+
var e;
|
|
51
|
+
(e = t.value) == null || e.submit();
|
|
52
|
+
},
|
|
53
|
+
reset: () => {
|
|
54
|
+
var e;
|
|
55
|
+
(e = t.value) == null || e.reset();
|
|
56
|
+
},
|
|
57
|
+
getSearchFormValues: () => {
|
|
58
|
+
var r;
|
|
59
|
+
const e = ((r = t.value) == null ? void 0 : r.getSearchFormValues()) || {};
|
|
60
|
+
return o ? o(e) : e;
|
|
61
|
+
},
|
|
62
|
+
getApTableInstance: () => t.value
|
|
63
|
+
}];
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
A as usePageListApTable
|
|
67
|
+
};
|