@peng_kai/kit 0.0.9 → 0.0.11
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/admin/components/scroll-nav/src/ScrollNav.vue +59 -59
- package/admin/components/text/index.ts +13 -13
- package/admin/components/text/src/Amount.vue +114 -114
- package/admin/components/text/src/Datetime.vue +44 -45
- package/admin/components/text/src/Duration.vue +26 -26
- package/admin/components/text/src/Hash.vue +40 -40
- package/admin/components/text/src/createTagGetter.ts +13 -13
- package/admin/filter/FilterDrawer.vue +96 -96
- package/admin/filter/FilterParam.vue +76 -76
- package/admin/filter/FilterReset.vue +2 -2
- package/admin/filter/index.ts +2 -1
- package/admin/filter/useFilterParams.ts +4 -3
- package/admin/filter/useFilterQuery.ts +31 -0
- package/admin/hooks/useMenu.ts +128 -132
- package/admin/hooks/usePage.ts +139 -138
- package/admin/hooks/usePageTab.ts +35 -35
- package/admin/layout/large/Breadcrumb.vue +70 -68
- package/admin/layout/large/Content.vue +24 -23
- package/admin/layout/large/Menu.vue +68 -73
- package/admin/layout/large/PageTab.vue +71 -70
- package/admin/styles/classCover.scss +108 -0
- package/admin/styles/globalCover.scss +43 -0
- package/admin/styles/index.scss +30 -0
- package/admin/unocss/index.ts +6 -0
- package/antd/components/InputNumberRange.vue +47 -47
- package/antd/hooks/useAntdDrawer.ts +73 -73
- package/antd/hooks/useAntdForm.ts +14 -5
- package/antd/hooks/useAntdTable.ts +70 -70
- package/antd/index.ts +1 -1
- package/components/infinite-query/index.ts +1 -1
- package/components/infinite-query/src/InfiniteQuery.vue +147 -147
- package/components/infinite-query/src/useCreateTrigger.ts +35 -35
- package/kitDependencies.ts +26 -6
- package/package.json +40 -40
- package/request/helpers.ts +32 -32
- package/request/type.d.ts +89 -89
- package/tsconfig.json +17 -17
- package/pnpm-lock.yaml +0 -598
|
@@ -1,73 +1,68 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { computed, ref, watch } from "vue";
|
|
3
|
-
import { Menu as AMenu } from "ant-design-vue";
|
|
4
|
-
import type { ItemType } from 'ant-design-vue'
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const router =
|
|
26
|
-
const { menus, getMenuPath } = useMenu()
|
|
27
|
-
const items = computed(() => menus.map(formatMenu))
|
|
28
|
-
const openKeys = ref<string[]>([])
|
|
29
|
-
const selectedKeys = ref<string[]>([])
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.ant-menu {
|
|
70
|
-
background-color: transparent;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
</style>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
import { Menu as AMenu } from "ant-design-vue";
|
|
4
|
+
import type { ItemType } from 'ant-design-vue'
|
|
5
|
+
import type { TMenu } from '../../hooks'
|
|
6
|
+
import { getDependencies } from "../../../kitDependencies";
|
|
7
|
+
|
|
8
|
+
function formatMenu(menu: TMenu): ItemType {
|
|
9
|
+
return {
|
|
10
|
+
key: menu.key,
|
|
11
|
+
title: menu.label,
|
|
12
|
+
label: menu.label,
|
|
13
|
+
icon: menu.icon ?? undefined,
|
|
14
|
+
onClick: (e) => {
|
|
15
|
+
(e as any).stopPropagation()
|
|
16
|
+
menu.trigger()
|
|
17
|
+
},
|
|
18
|
+
children: menu.children?.map(formatMenu),
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
const{ useRouter, useMenu } = getDependencies()
|
|
25
|
+
const router = useRouter()
|
|
26
|
+
const { menus, getMenuPath } = useMenu()
|
|
27
|
+
const items = computed(() => menus.map(formatMenu))
|
|
28
|
+
const openKeys = ref<string[]>([])
|
|
29
|
+
const selectedKeys = ref<string[]>([])
|
|
30
|
+
|
|
31
|
+
watch(
|
|
32
|
+
() => router?.currentRoute.value,
|
|
33
|
+
(route) => {
|
|
34
|
+
if (!route) return;
|
|
35
|
+
|
|
36
|
+
const menuPath = getMenuPath(route.name as string)
|
|
37
|
+
openKeys.value = menuPath.map(menu => menu.key)
|
|
38
|
+
selectedKeys.value = [openKeys.value.pop()!]
|
|
39
|
+
},
|
|
40
|
+
{ immediate: true },
|
|
41
|
+
)
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<AMenu
|
|
46
|
+
class="menu"
|
|
47
|
+
:items="items"
|
|
48
|
+
:openKeys="openKeys"
|
|
49
|
+
:selectedKeys="selectedKeys"
|
|
50
|
+
mode="inline"
|
|
51
|
+
:inlineIndent="14"
|
|
52
|
+
/>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<style lang="scss" scoped>
|
|
56
|
+
.menu {
|
|
57
|
+
border-inline-end: none !important;
|
|
58
|
+
|
|
59
|
+
&.ant-menu-inline-collapsed {
|
|
60
|
+
width: var(--app-siderbar-width);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&,
|
|
64
|
+
.ant-menu {
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { Tabs as ATabs, TabPane as ATabPane } from "ant-design-vue";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
|
|
18
|
-
@
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
:deep(.ant-tabs-tab
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
:deep(.ant-tabs-tab
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Tabs as ATabs, TabPane as ATabPane } from "ant-design-vue";
|
|
3
|
+
import { getDependencies } from "../../../kitDependencies";
|
|
4
|
+
|
|
5
|
+
const { usePageTab } = getDependencies()
|
|
6
|
+
const { activeTab, tabList, openTab, closeTab } = usePageTab()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<ATabs
|
|
11
|
+
class="app-page-tabs"
|
|
12
|
+
:activeKey="activeTab"
|
|
13
|
+
type="editable-card"
|
|
14
|
+
size="small"
|
|
15
|
+
:animated="false"
|
|
16
|
+
:hideAdd="true"
|
|
17
|
+
:tabBarGutter="4"
|
|
18
|
+
@tabClick="(openTab as any)"
|
|
19
|
+
@edit="(closeTab as any)"
|
|
20
|
+
>
|
|
21
|
+
<ATabPane v-for="tab of tabList" :key="tab.key" :tab="tab.title">
|
|
22
|
+
<template #closeIcon>
|
|
23
|
+
<i class="i-icon-park-outline:close" />
|
|
24
|
+
</template>
|
|
25
|
+
</ATabPane>
|
|
26
|
+
</ATabs>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<style scoped lang="scss">
|
|
30
|
+
.app-page-tabs {
|
|
31
|
+
:deep(.ant-tabs-nav) {
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:deep(.ant-tabs-nav::before) {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:deep(.ant-tabs-tab) {
|
|
40
|
+
--uno: 'border-rd-3px! text-14px p-[3px_1px_3px_8px]! select-none';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:deep(.ant-tabs-tab .ant-tabs-tab-btn) {
|
|
44
|
+
transform: translateX(8px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:deep(.ant-tabs-tab-active) {
|
|
48
|
+
--uno: 'border-[currentColor]!';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:deep(.ant-tabs-tab-remove) {
|
|
52
|
+
display: flex;
|
|
53
|
+
height: 100%;
|
|
54
|
+
align-items: center;
|
|
55
|
+
margin: 0;
|
|
56
|
+
opacity: 0;
|
|
57
|
+
transition: all 150ms;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:deep(.ant-tabs-tab:hover .ant-tabs-tab-btn),
|
|
61
|
+
:deep(.ant-tabs-tab-active .ant-tabs-tab-btn) {
|
|
62
|
+
transform: translateX(0);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:deep(.ant-tabs-tab:hover .ant-tabs-tab-remove),
|
|
66
|
+
:deep(.ant-tabs-tab-active .ant-tabs-tab-remove) {
|
|
67
|
+
margin-left: 0;
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
通过为 antd 组件添加 class 的方式覆盖其默认样式
|
|
3
|
+
格式:antd-cover__xxx
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// 表单气泡 help 提示
|
|
7
|
+
.ant-form.antd-cover__bubble-help-form {
|
|
8
|
+
.ant-form-show-help {
|
|
9
|
+
position: relative;
|
|
10
|
+
|
|
11
|
+
+ div {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
> div {
|
|
16
|
+
position: absolute;
|
|
17
|
+
z-index: 2;
|
|
18
|
+
top: 7px;
|
|
19
|
+
left: -10px;
|
|
20
|
+
max-width: 70%;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
padding: 6px 8px;
|
|
23
|
+
border-radius: 5px;
|
|
24
|
+
background-color: rgb(0 0 0 / 75%);
|
|
25
|
+
|
|
26
|
+
// box-shadow: 0 0 5px 0 rgb(0 0 0 / 50%);
|
|
27
|
+
color: #fff !important;
|
|
28
|
+
filter: drop-shadow(0 0 5px rgb(0 0 0 / 50%));
|
|
29
|
+
line-height: 1.4em;
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
|
|
32
|
+
// 气泡箭头
|
|
33
|
+
&::after {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: -7.7px;
|
|
36
|
+
left: 10px;
|
|
37
|
+
width: 16px;
|
|
38
|
+
height: 16px;
|
|
39
|
+
background-color: rgb(0 0 0 / 75%);
|
|
40
|
+
clip-path: path('M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z');
|
|
41
|
+
content: "";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ant-form-margin-offset {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 弹窗的基本款样式
|
|
52
|
+
.ant-modal-wrap.antd-cover__basic-modal {
|
|
53
|
+
--padding-size: 22px;
|
|
54
|
+
|
|
55
|
+
// --min-body-height: ;
|
|
56
|
+
// --max-body-height: ;
|
|
57
|
+
// --body-height: ;
|
|
58
|
+
|
|
59
|
+
.ant-modal-content {
|
|
60
|
+
padding: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ant-modal-header {
|
|
64
|
+
display: flex;
|
|
65
|
+
min-height: 56px;
|
|
66
|
+
align-items: center;
|
|
67
|
+
padding: 0 var(--padding-size);
|
|
68
|
+
border-bottom: 1px solid var(--antd-colorBorderSecondary);
|
|
69
|
+
margin: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ant-modal-body {
|
|
73
|
+
height: var(--body-height, auto);
|
|
74
|
+
min-height: var(--min-body-height, auto);
|
|
75
|
+
max-height: var(--max-body-height, auto);
|
|
76
|
+
padding: var(--padding-size);
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
|
|
79
|
+
&:empty {
|
|
80
|
+
height: var(--min-body-height, 150px);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ant-modal-footer {
|
|
85
|
+
display: flex;
|
|
86
|
+
min-height: 56px;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
padding: 0 var(--padding-size);
|
|
90
|
+
border-top: 1px solid var(--antd-colorBorderSecondary);
|
|
91
|
+
margin: 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 查询器基本样式
|
|
96
|
+
.ant-form.ant-form__filter {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-wrap: wrap;
|
|
99
|
+
--uno: 'gap-4 mb-4';
|
|
100
|
+
|
|
101
|
+
.ant-form-item {
|
|
102
|
+
margin-bottom: 0;
|
|
103
|
+
min-width: 220px;
|
|
104
|
+
width: 250px;
|
|
105
|
+
max-width: 280px;
|
|
106
|
+
flex: 1 1 auto;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
// table 组件头部圆角设为 0
|
|
3
|
+
.ant-table-wrapper {
|
|
4
|
+
.ant-table .ant-table-header,
|
|
5
|
+
table,
|
|
6
|
+
.ant-table-container table > thead > tr:first-child > *:first-child,
|
|
7
|
+
.ant-table-container table > thead > tr:first-child > *:last-child {
|
|
8
|
+
border-radius: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ant-pagination {
|
|
12
|
+
margin-bottom: 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// 隐藏在 sticky 模式下的滚动条
|
|
18
|
+
.ant-table-sticky-scroll {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 卡片
|
|
23
|
+
.ant-card .ant-card-actions > li > span {
|
|
24
|
+
cursor: inherit;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Tab 溢出出现下列框时
|
|
28
|
+
.ant-tabs-dropdown-menu-title-content {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 表格
|
|
35
|
+
.ant-table-wrapper {
|
|
36
|
+
.ant-table-row-expand-icon-collapsed::before {
|
|
37
|
+
height: 1.5px;
|
|
38
|
+
}
|
|
39
|
+
.ant-table-row-expand-icon-collapsed::after {
|
|
40
|
+
width: 1.5px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import './classCover.scss';
|
|
2
|
+
@import './globalCover.scss';
|
|
3
|
+
|
|
4
|
+
@media (pointer: fine) {
|
|
5
|
+
* {
|
|
6
|
+
scrollbar-color: rgb(0 0 0 / 50%) transparent;
|
|
7
|
+
scrollbar-width: thin;
|
|
8
|
+
|
|
9
|
+
/* overflow-y: overlay; */
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
::-webkit-scrollbar {
|
|
13
|
+
width: 6px;
|
|
14
|
+
height: 6px;
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::-webkit-scrollbar-thumb {
|
|
19
|
+
border-radius: 10px;
|
|
20
|
+
background-color: rgb(0 0 0 / 20%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
::-webkit-scrollbar-thumb:hover {
|
|
24
|
+
background-color: rgb(0 0 0 / 60%);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:root {
|
|
29
|
+
font-family: var(--antd-fontFamily);
|
|
30
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
import { Form, InputNumber as AInputNumber } from 'ant-design-vue'
|
|
4
|
-
|
|
5
|
-
const props = withDefaults(
|
|
6
|
-
defineProps<{
|
|
7
|
-
value: [number, number]
|
|
8
|
-
min?: number
|
|
9
|
-
max?: number
|
|
10
|
-
}>(),
|
|
11
|
-
{
|
|
12
|
-
min: Number.NEGATIVE_INFINITY,
|
|
13
|
-
max: Number.POSITIVE_INFINITY,
|
|
14
|
-
},
|
|
15
|
-
)
|
|
16
|
-
const emits = defineEmits<{
|
|
17
|
-
(e: 'update:value', value: [number, number]): void
|
|
18
|
-
}>()
|
|
19
|
-
|
|
20
|
-
const formItemContext = Form.useInjectFormItemContext()
|
|
21
|
-
const minValue = computed({
|
|
22
|
-
get() {
|
|
23
|
-
return props.value[0]
|
|
24
|
-
},
|
|
25
|
-
set(value) {
|
|
26
|
-
emits('update:value', [value, props.value[1]])
|
|
27
|
-
formItemContext.onFieldChange()
|
|
28
|
-
},
|
|
29
|
-
})
|
|
30
|
-
const maxValue = computed({
|
|
31
|
-
get() {
|
|
32
|
-
return props.value[1]
|
|
33
|
-
},
|
|
34
|
-
set(value) {
|
|
35
|
-
emits('update:value', [props.value[0], value])
|
|
36
|
-
formItemContext.onFieldChange()
|
|
37
|
-
},
|
|
38
|
-
})
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<template>
|
|
42
|
-
<div class="flex items-center">
|
|
43
|
-
<AInputNumber v-model:value="minValue" class="w-full" :min="props.min" :max="props.max" />
|
|
44
|
-
<span> ~ </span>
|
|
45
|
-
<AInputNumber v-model:value="maxValue" class="w-full" :min="props.min" :max="props.max" />
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { Form, InputNumber as AInputNumber } from 'ant-design-vue'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
value: [number, number]
|
|
8
|
+
min?: number
|
|
9
|
+
max?: number
|
|
10
|
+
}>(),
|
|
11
|
+
{
|
|
12
|
+
min: Number.NEGATIVE_INFINITY,
|
|
13
|
+
max: Number.POSITIVE_INFINITY,
|
|
14
|
+
},
|
|
15
|
+
)
|
|
16
|
+
const emits = defineEmits<{
|
|
17
|
+
(e: 'update:value', value: [number, number]): void
|
|
18
|
+
}>()
|
|
19
|
+
|
|
20
|
+
const formItemContext = Form.useInjectFormItemContext()
|
|
21
|
+
const minValue = computed({
|
|
22
|
+
get() {
|
|
23
|
+
return props.value[0]
|
|
24
|
+
},
|
|
25
|
+
set(value) {
|
|
26
|
+
emits('update:value', [value, props.value[1]])
|
|
27
|
+
formItemContext.onFieldChange()
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
const maxValue = computed({
|
|
31
|
+
get() {
|
|
32
|
+
return props.value[1]
|
|
33
|
+
},
|
|
34
|
+
set(value) {
|
|
35
|
+
emits('update:value', [props.value[0], value])
|
|
36
|
+
formItemContext.onFieldChange()
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="flex items-center">
|
|
43
|
+
<AInputNumber v-model:value="minValue" class="w-full" :min="props.min" :max="props.max" />
|
|
44
|
+
<span> ~ </span>
|
|
45
|
+
<AInputNumber v-model:value="maxValue" class="w-full" :min="props.min" :max="props.max" />
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|