@opendesign-plus/components 0.0.1-rc.2 → 0.0.1-rc.20
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/dist/chunk-OElCookieNotice.cjs.js +1 -0
- package/dist/chunk-OElCookieNotice.es.js +839 -0
- package/dist/components/OBanner.vue.d.ts +10 -1
- package/dist/components/OCookieNotice.vue.d.ts +6 -5
- package/dist/components/OFooter.vue.d.ts +46 -0
- package/dist/components/OHeaderSearch.vue.d.ts +4 -4
- package/dist/components/OHeaderUser.vue.d.ts +40 -0
- package/dist/components/OSourceCode.vue.d.ts +20 -0
- package/dist/components/activity/OActivityApproval.vue.d.ts +277 -0
- package/dist/components/activity/OActivityForm.vue.d.ts +140 -0
- package/dist/components/activity/OMyActivityCalendar.vue.d.ts +578 -0
- package/dist/components/activity/composables/useActivityConfig.d.ts +17 -0
- package/dist/components/activity/config.d.ts +1 -0
- package/dist/components/activity/index.d.ts +623 -0
- package/dist/components/activity/types.d.ts +81 -0
- package/dist/components/element-plus/OElCookieNotice.vue.d.ts +34 -0
- package/dist/components/element-plus/index.d.ts +2 -0
- package/dist/components/events/OEventsApply.vue.d.ts +16 -0
- package/dist/components/events/OEventsCalendar.vue.d.ts +5 -0
- package/dist/components/events/OEventsList.vue.d.ts +26 -0
- package/dist/components/events/config.d.ts +27 -0
- package/dist/components/events/index.d.ts +78 -0
- package/dist/components/events/types.d.ts +66 -0
- package/dist/components/events/utils.d.ts +7 -0
- package/dist/components/header/OHeader.vue.d.ts +30 -0
- package/dist/components/header/OHeaderMobile.vue.d.ts +171 -0
- package/dist/components/header/components/HeaderContent.vue.d.ts +13 -0
- package/dist/components/header/components/HeaderNav.vue.d.ts +19 -0
- package/dist/components/header/components/HeaderNavMobile.vue.d.ts +33 -0
- package/dist/components/header/index.d.ts +145 -0
- package/dist/components/header/types.d.ts +80 -0
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +299 -0
- package/dist/components/meeting/OMeetingForm.vue.d.ts +145 -0
- package/dist/components/meeting/OMyMeetingCalendar.vue.d.ts +586 -0
- package/dist/components/meeting/OSigMeetingCalendar.vue.d.ts +24 -0
- package/dist/components/meeting/components/OMeetingCalendarList.vue.d.ts +28 -0
- package/dist/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +664 -0
- package/dist/components/meeting/components/OMeetingDetail.vue.d.ts +13 -0
- package/dist/components/meeting/components/OMeetingPlaybackSubtitles.vue.d.ts +5 -0
- package/dist/components/meeting/components/OMeetingPlaybackVideo.vue.d.ts +17 -0
- package/dist/components/meeting/components/OSigMeetingAside.vue.d.ts +16 -0
- package/dist/components/meeting/composables/useMeetingConfig.d.ts +14 -0
- package/dist/components/meeting/config.d.ts +12 -0
- package/dist/components/meeting/types.d.ts +168 -0
- package/dist/components/meeting/utils.d.ts +8 -0
- package/dist/components.cjs.js +224 -1
- package/dist/components.css +1 -1
- package/dist/components.element.cjs.js +1 -0
- package/dist/components.element.es.js +4 -0
- package/dist/components.es.js +44348 -785
- package/dist/index.d.ts +9 -2
- package/docs/design.md +27 -27
- package/docs/design_banner.md +41 -41
- package/docs/design_section.md +27 -27
- package/package.json +12 -3
- package/scripts/generate-components-index.js +103 -80
- package/src/assets/events/svg-icons/icon-checked.svg +3 -0
- package/src/assets/events/svg-icons/icon-competition.svg +7 -0
- package/src/assets/events/svg-icons/icon-events.svg +4 -0
- package/src/assets/events/svg-icons/icon-release.svg +4 -0
- package/src/assets/events/svg-icons/icon-summit.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-all.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-backward.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-calendar.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-cancel.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-captions.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-close-captions.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-close-fullscreen.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-copy.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-create.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-delete.svg +7 -0
- package/src/assets/meeting/svg-icons/icon-empty.svg +31 -0
- package/src/assets/meeting/svg-icons/icon-empty_dark.svg +49 -0
- package/src/assets/meeting/svg-icons/icon-event.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-export.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-forward.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-fullscreen.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-help.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-important.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-info.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-meet.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-meeting-message.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-meeting.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-play.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-playing-tip.svg +7 -0
- package/src/assets/meeting/svg-icons/icon-playing.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-question.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-sound.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-speaker.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-summit.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-telligent.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-tip.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-todo.svg +4 -0
- package/src/assets/meeting/transparent.png +0 -0
- package/src/assets/svg-icons/icon-arrow-left.svg +3 -0
- package/src/assets/svg-icons/icon-avatar-line.svg +3 -0
- package/src/assets/svg-icons/icon-caret-left.svg +3 -0
- package/src/assets/svg-icons/icon-caret-right.svg +3 -0
- package/src/assets/svg-icons/icon-chevron-down.svg +3 -0
- package/src/assets/svg-icons/icon-chevron-right.svg +3 -3
- package/src/assets/svg-icons/icon-chevron-up.svg +3 -0
- package/src/assets/svg-icons/icon-close.svg +3 -3
- package/src/assets/svg-icons/icon-delete.svg +3 -3
- package/src/assets/svg-icons/icon-filter.svg +3 -0
- package/src/assets/svg-icons/icon-header-back.svg +3 -3
- package/src/assets/svg-icons/icon-header-delete.svg +3 -3
- package/src/assets/svg-icons/icon-header-menu.svg +3 -0
- package/src/assets/svg-icons/icon-header-person.svg +3 -0
- package/src/assets/svg-icons/icon-header-search.svg +4 -4
- package/src/assets/svg-icons/icon-loading.svg +4 -0
- package/src/assets/svg-icons/icon-locale.svg +3 -0
- package/src/assets/svg-icons/icon-log-off.svg +3 -0
- package/src/assets/svg-icons/icon-message.svg +3 -0
- package/src/assets/svg-icons/icon-moon.svg +3 -3
- package/src/assets/svg-icons/icon-outlink.svg +3 -0
- package/src/assets/svg-icons/icon-overview.svg +3 -0
- package/src/assets/svg-icons/icon-search.svg +3 -0
- package/src/assets/svg-icons/icon-setting.svg +3 -0
- package/src/assets/svg-icons/icon-sun.svg +3 -3
- package/src/assets/svg-icons/icon-tips.svg +3 -0
- package/src/components/OBanner.vue +398 -390
- package/src/components/OCookieNotice.vue +575 -424
- package/src/components/OFooter.vue +576 -0
- package/src/components/OHeaderSearch.vue +601 -601
- package/src/components/OHeaderUser.vue +237 -0
- package/src/components/OPlusConfigProvider.vue +32 -32
- package/src/components/OSection.vue +178 -178
- package/src/components/OSourceCode.vue +153 -0
- package/src/components/OThemeSwitcher.vue +108 -108
- package/src/components/activity/OActivityApproval.vue +864 -0
- package/src/components/activity/OActivityForm.vue +542 -0
- package/src/components/activity/OMyActivityCalendar.vue +1486 -0
- package/src/components/activity/composables/useActivityConfig.ts +141 -0
- package/src/components/activity/config.ts +1 -0
- package/src/components/activity/index.ts +24 -0
- package/src/components/activity/types.ts +88 -0
- package/src/components/common/AppAvatar.vue +83 -0
- package/src/components/common/ClientOnlyWrapper.ts +21 -21
- package/src/components/common/ContentWrapper.vue +85 -85
- package/src/components/common/MoreText.vue +124 -0
- package/src/components/common/ThFilter.vue +330 -0
- package/src/components/element-plus/OElCookieNotice.vue +603 -0
- package/src/components/element-plus/index.ts +3 -0
- package/src/components/events/OEventsApply.vue +418 -0
- package/src/components/events/OEventsCalendar.vue +598 -0
- package/src/components/events/OEventsList.vue +362 -0
- package/src/components/events/config.ts +35 -0
- package/src/components/events/index.ts +24 -0
- package/src/components/events/types.ts +80 -0
- package/src/components/events/utils.ts +9 -0
- package/src/components/header/OHeader.vue +157 -0
- package/src/components/header/OHeaderMobile.vue +177 -0
- package/src/components/header/components/HeaderContent.vue +1121 -0
- package/src/components/header/components/HeaderNav.vue +278 -0
- package/src/components/header/components/HeaderNavMobile.vue +377 -0
- package/src/components/header/index.ts +16 -0
- package/src/components/header/types.ts +91 -0
- package/src/components/meeting/OMeetingCalendar.vue +878 -0
- package/src/components/meeting/OMeetingForm.vue +1053 -0
- package/src/components/meeting/OMeetingPlayback.vue +439 -0
- package/src/components/meeting/OMyMeetingCalendar.vue +1497 -0
- package/src/components/meeting/OSigMeetingCalendar.vue +410 -0
- package/src/components/meeting/components/OMeetingCalendarList.vue +510 -0
- package/src/components/meeting/components/OMeetingCalendarSelector.vue +206 -0
- package/src/components/meeting/components/OMeetingDetail.vue +229 -0
- package/src/components/meeting/components/OMeetingPlaybackSubtitles.vue +611 -0
- package/src/components/meeting/components/OMeetingPlaybackVideo.vue +741 -0
- package/src/components/meeting/components/OSigMeetingAside.vue +200 -0
- package/src/components/meeting/composables/useMeetingConfig.ts +108 -0
- package/src/components/meeting/config.ts +48 -0
- package/src/components/meeting/index.ts +45 -0
- package/src/components/meeting/types.ts +195 -0
- package/src/components/meeting/utils.ts +70 -0
- package/src/draft/Banner.vue +265 -265
- package/src/draft/ButtonCards.vue +105 -105
- package/src/draft/Feature.vue +133 -133
- package/src/draft/Footer.vue +512 -512
- package/src/draft/HorizontalAnchor.vue +165 -165
- package/src/draft/ItemSwiper.vue +133 -133
- package/src/draft/Logo.vue +141 -141
- package/src/draft/LogoCard.vue +74 -74
- package/src/draft/LogoV2.vue +19 -19
- package/src/draft/MainCard.vue +38 -38
- package/src/draft/MultiCard.vue +94 -94
- package/src/draft/MultiIconCard.vue +73 -73
- package/src/draft/OInfoCard.vue +176 -176
- package/src/draft/Process.vue +81 -81
- package/src/draft/Section.vue +167 -167
- package/src/draft/SingleTabCard.vue +84 -84
- package/src/draft/SliderCard.vue +110 -110
- package/src/env.d.ts +16 -1
- package/src/i18n/en.ts +264 -20
- package/src/i18n/index.ts +56 -42
- package/src/i18n/zh.ts +253 -9
- package/src/index.ts +14 -3
- package/src/shared/provide.ts +6 -6
- package/src/shims-vue-dompurify-html.d.ts +17 -0
- package/src/vue.d.ts +9 -9
- package/tsconfig.json +37 -33
- package/vite.config.ts +118 -94
- package/dist/components/OCookieNoticeEl.vue.d.ts +0 -29
- package/dist/components.umd.js +0 -1
- package/src/components/OCookieNoticeEl.vue +0 -404
package/src/draft/MultiCard.vue
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { OCard, OButton, OScroller } from '@opensig/opendesign';
|
|
4
|
-
import { useScreen } from '@/composables/useScreen';
|
|
5
|
-
|
|
6
|
-
const { lePadV } = useScreen();
|
|
7
|
-
|
|
8
|
-
interface CardT {
|
|
9
|
-
title: string;
|
|
10
|
-
content: string;
|
|
11
|
-
cover: string;
|
|
12
|
-
buttons?: { text: string; href?: string }[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const props = defineProps({
|
|
16
|
-
cards: {
|
|
17
|
-
type: Array as () => CardT[],
|
|
18
|
-
default: () => [],
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const cardCount = computed(() => props.cards.length);
|
|
23
|
-
const cardWidth = computed(() => {
|
|
24
|
-
if (lePadV.value) {
|
|
25
|
-
if (cardCount.value <= 2) {
|
|
26
|
-
return `calc((100% - var(--card-gap) * 1) / 2)`;
|
|
27
|
-
}
|
|
28
|
-
return `calc((100% - var(--card-gap) * 2) / 3)`;
|
|
29
|
-
} else {
|
|
30
|
-
if (cardCount.value <= 4) {
|
|
31
|
-
return `calc((100% - var(--card-gap) * ${cardCount.value - 1}) / ${cardCount.value})`;
|
|
32
|
-
}
|
|
33
|
-
return `calc((100% - var(--card-gap) * 3) / 4)`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
const coverRatio = computed(() => {
|
|
38
|
-
return cardCount.value === 2 ? 3 : 16 / 9;
|
|
39
|
-
});
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<template>
|
|
43
|
-
<div class="multi-card-wrapper">
|
|
44
|
-
<OScroller class="pane" size="small" :show-type="lePadV ? 'never' : 'always'" disabled-y>
|
|
45
|
-
<template v-for="card in cards" :key="card.title">
|
|
46
|
-
<OCard :title="card.title" :detail="card.content" :cover="card.cover"
|
|
47
|
-
:cover-ratio="lePadV ? undefined : coverRatio" :layout="'v'" class="multi-card-item"
|
|
48
|
-
:style="{ width: cardWidth }">
|
|
49
|
-
<template #footer>
|
|
50
|
-
<div class="buttons">
|
|
51
|
-
<OButton v-for="(button, btnIndex) in card.buttons" :key="btnIndex" :href="button.href"
|
|
52
|
-
color="primary" round="pill" variant="outline" class="button">{{ button.text }}
|
|
53
|
-
</OButton>
|
|
54
|
-
</div>
|
|
55
|
-
</template>
|
|
56
|
-
</OCard>
|
|
57
|
-
</template>
|
|
58
|
-
</OScroller>
|
|
59
|
-
</div>
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<style lang="scss" scoped>
|
|
63
|
-
.multi-card-wrapper {
|
|
64
|
-
width: 100%;
|
|
65
|
-
--card-gap: var(--o3-gap-5);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.pane {
|
|
69
|
-
white-space: nowrap;
|
|
70
|
-
|
|
71
|
-
:deep(.o-scrollbar) {
|
|
72
|
-
--scrollbar-x-bottom: calc(-1 * var(--o3-gap-5) - 4px)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.multi-card-item {
|
|
77
|
-
display: inline-flex;
|
|
78
|
-
margin-right: var(--card-gap);
|
|
79
|
-
|
|
80
|
-
&:last-child {
|
|
81
|
-
margin-right: 0;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@include respond-to('<=pad_v') {
|
|
85
|
-
:deep(.o-card-cover-img) {
|
|
86
|
-
height: 120px;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.buttons {
|
|
92
|
-
display: flex;
|
|
93
|
-
gap: 8px;
|
|
94
|
-
}
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { OCard, OButton, OScroller } from '@opensig/opendesign';
|
|
4
|
+
import { useScreen } from '@/composables/useScreen';
|
|
5
|
+
|
|
6
|
+
const { lePadV } = useScreen();
|
|
7
|
+
|
|
8
|
+
interface CardT {
|
|
9
|
+
title: string;
|
|
10
|
+
content: string;
|
|
11
|
+
cover: string;
|
|
12
|
+
buttons?: { text: string; href?: string }[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
cards: {
|
|
17
|
+
type: Array as () => CardT[],
|
|
18
|
+
default: () => [],
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const cardCount = computed(() => props.cards.length);
|
|
23
|
+
const cardWidth = computed(() => {
|
|
24
|
+
if (lePadV.value) {
|
|
25
|
+
if (cardCount.value <= 2) {
|
|
26
|
+
return `calc((100% - var(--card-gap) * 1) / 2)`;
|
|
27
|
+
}
|
|
28
|
+
return `calc((100% - var(--card-gap) * 2) / 3)`;
|
|
29
|
+
} else {
|
|
30
|
+
if (cardCount.value <= 4) {
|
|
31
|
+
return `calc((100% - var(--card-gap) * ${cardCount.value - 1}) / ${cardCount.value})`;
|
|
32
|
+
}
|
|
33
|
+
return `calc((100% - var(--card-gap) * 3) / 4)`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
});
|
|
37
|
+
const coverRatio = computed(() => {
|
|
38
|
+
return cardCount.value === 2 ? 3 : 16 / 9;
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<div class="multi-card-wrapper">
|
|
44
|
+
<OScroller class="pane" size="small" :show-type="lePadV ? 'never' : 'always'" disabled-y>
|
|
45
|
+
<template v-for="card in cards" :key="card.title">
|
|
46
|
+
<OCard :title="card.title" :detail="card.content" :cover="card.cover"
|
|
47
|
+
:cover-ratio="lePadV ? undefined : coverRatio" :layout="'v'" class="multi-card-item"
|
|
48
|
+
:style="{ width: cardWidth }">
|
|
49
|
+
<template #footer>
|
|
50
|
+
<div class="buttons">
|
|
51
|
+
<OButton v-for="(button, btnIndex) in card.buttons" :key="btnIndex" :href="button.href"
|
|
52
|
+
color="primary" round="pill" variant="outline" class="button">{{ button.text }}
|
|
53
|
+
</OButton>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
</OCard>
|
|
57
|
+
</template>
|
|
58
|
+
</OScroller>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<style lang="scss" scoped>
|
|
63
|
+
.multi-card-wrapper {
|
|
64
|
+
width: 100%;
|
|
65
|
+
--card-gap: var(--o3-gap-5);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.pane {
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
|
|
71
|
+
:deep(.o-scrollbar) {
|
|
72
|
+
--scrollbar-x-bottom: calc(-1 * var(--o3-gap-5) - 4px)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.multi-card-item {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
margin-right: var(--card-gap);
|
|
79
|
+
|
|
80
|
+
&:last-child {
|
|
81
|
+
margin-right: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@include respond-to('<=pad_v') {
|
|
85
|
+
:deep(.o-card-cover-img) {
|
|
86
|
+
height: 120px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.buttons {
|
|
92
|
+
display: flex;
|
|
93
|
+
gap: 8px;
|
|
94
|
+
}
|
|
95
95
|
</style>
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { OCard, type CardPropsT } from '@opensig/opendesign';
|
|
4
|
-
import { useScreen } from '@/composables/useScreen.ts';
|
|
5
|
-
|
|
6
|
-
const { isPadV, isPhone } = useScreen();
|
|
7
|
-
|
|
8
|
-
export type IconCardT = Pick<CardPropsT, 'title' | 'detail' | 'icon'>;
|
|
9
|
-
|
|
10
|
-
const props = withDefaults(defineProps<{
|
|
11
|
-
/*卡片各自的配置*/
|
|
12
|
-
cards: IconCardT[];
|
|
13
|
-
/*布局*/
|
|
14
|
-
layout?: CardPropsT['layout'];
|
|
15
|
-
/*所有卡片的配置,优先级低于cards*/
|
|
16
|
-
cardProps?: Omit<CardPropsT, 'layout'>;
|
|
17
|
-
}>(), {
|
|
18
|
-
layout: 'v',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const gridTemplateColumns = computed(() => {
|
|
22
|
-
if (isPhone.value) {
|
|
23
|
-
return '1fr';
|
|
24
|
-
}
|
|
25
|
-
if (isPadV.value) {
|
|
26
|
-
switch (props.cards.length) {
|
|
27
|
-
case 1:
|
|
28
|
-
return '1fr';
|
|
29
|
-
default:
|
|
30
|
-
return '1fr 1fr';
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
switch (props.cards.length) {
|
|
34
|
-
case 1:
|
|
35
|
-
return '1fr';
|
|
36
|
-
case 2:
|
|
37
|
-
return '1fr 1fr';
|
|
38
|
-
default:
|
|
39
|
-
return '1fr 1fr 1fr';
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<template>
|
|
45
|
-
<div v-if="props.cards?.length" class="multi-card-wrapper">
|
|
46
|
-
<OCard
|
|
47
|
-
v-for="(card, index) in cards"
|
|
48
|
-
:key="index"
|
|
49
|
-
class="multi-icon-card-item"
|
|
50
|
-
v-bind="{
|
|
51
|
-
...props.cardProps,
|
|
52
|
-
layout: props.layout,
|
|
53
|
-
...card
|
|
54
|
-
}"
|
|
55
|
-
/>
|
|
56
|
-
</div>
|
|
57
|
-
</template>
|
|
58
|
-
|
|
59
|
-
<style lang="scss" scoped>
|
|
60
|
-
.multi-card-wrapper {
|
|
61
|
-
display: grid;
|
|
62
|
-
gap: var(--o3-gap-5) var(--o3-gap-6);
|
|
63
|
-
grid-template-columns: v-bind(gridTemplateColumns);
|
|
64
|
-
}
|
|
65
|
-
.o-card {
|
|
66
|
-
--card-content-color: var(--o-color-info3);
|
|
67
|
-
@include respond-to("phone") {
|
|
68
|
-
--card-header-text-size: 16px;
|
|
69
|
-
--card-header-text-height: 24px;
|
|
70
|
-
--card-content-text-size: 14px;
|
|
71
|
-
--card-content-text-height: 22px;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { OCard, type CardPropsT } from '@opensig/opendesign';
|
|
4
|
+
import { useScreen } from '@/composables/useScreen.ts';
|
|
5
|
+
|
|
6
|
+
const { isPadV, isPhone } = useScreen();
|
|
7
|
+
|
|
8
|
+
export type IconCardT = Pick<CardPropsT, 'title' | 'detail' | 'icon'>;
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<{
|
|
11
|
+
/*卡片各自的配置*/
|
|
12
|
+
cards: IconCardT[];
|
|
13
|
+
/*布局*/
|
|
14
|
+
layout?: CardPropsT['layout'];
|
|
15
|
+
/*所有卡片的配置,优先级低于cards*/
|
|
16
|
+
cardProps?: Omit<CardPropsT, 'layout'>;
|
|
17
|
+
}>(), {
|
|
18
|
+
layout: 'v',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const gridTemplateColumns = computed(() => {
|
|
22
|
+
if (isPhone.value) {
|
|
23
|
+
return '1fr';
|
|
24
|
+
}
|
|
25
|
+
if (isPadV.value) {
|
|
26
|
+
switch (props.cards.length) {
|
|
27
|
+
case 1:
|
|
28
|
+
return '1fr';
|
|
29
|
+
default:
|
|
30
|
+
return '1fr 1fr';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
switch (props.cards.length) {
|
|
34
|
+
case 1:
|
|
35
|
+
return '1fr';
|
|
36
|
+
case 2:
|
|
37
|
+
return '1fr 1fr';
|
|
38
|
+
default:
|
|
39
|
+
return '1fr 1fr 1fr';
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<div v-if="props.cards?.length" class="multi-card-wrapper">
|
|
46
|
+
<OCard
|
|
47
|
+
v-for="(card, index) in cards"
|
|
48
|
+
:key="index"
|
|
49
|
+
class="multi-icon-card-item"
|
|
50
|
+
v-bind="{
|
|
51
|
+
...props.cardProps,
|
|
52
|
+
layout: props.layout,
|
|
53
|
+
...card
|
|
54
|
+
}"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<style lang="scss" scoped>
|
|
60
|
+
.multi-card-wrapper {
|
|
61
|
+
display: grid;
|
|
62
|
+
gap: var(--o3-gap-5) var(--o3-gap-6);
|
|
63
|
+
grid-template-columns: v-bind(gridTemplateColumns);
|
|
64
|
+
}
|
|
65
|
+
.o-card {
|
|
66
|
+
--card-content-color: var(--o-color-info3);
|
|
67
|
+
@include respond-to("phone") {
|
|
68
|
+
--card-header-text-size: 16px;
|
|
69
|
+
--card-header-text-height: 24px;
|
|
70
|
+
--card-content-text-size: 14px;
|
|
71
|
+
--card-content-text-height: 22px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
74
|
</style>
|