@opendesign-plus/components 0.0.1-rc.10
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 +833 -0
- package/dist/components/OBanner.vue.d.ts +11 -0
- package/dist/components/OCookieNotice.vue.d.ts +17 -0
- package/dist/components/OFooter.vue.d.ts +46 -0
- package/dist/components/OHeaderSearch.vue.d.ts +692 -0
- package/dist/components/OHeaderUser.vue.d.ts +38 -0
- package/dist/components/OPlusConfigProvider.vue.d.ts +23 -0
- package/dist/components/OSection.vue.d.ts +37 -0
- package/dist/components/OSourceCode.vue.d.ts +20 -0
- package/dist/components/OThemeSwitcher.vue.d.ts +28 -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/config.d.ts +15 -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 +24 -0
- package/dist/components/header/OHeaderMoblie.vue.d.ts +33 -0
- package/dist/components/header/components/HeaderContent.vue.d.ts +6 -0
- package/dist/components/header/components/HeaderNav.vue.d.ts +7 -0
- package/dist/components/header/components/HeaderNavMoblie.vue.d.ts +17 -0
- package/dist/components/header/components/HeaderUbmcNav.vue.d.ts +2 -0
- package/dist/components/header/index.d.ts +22 -0
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +298 -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 +12 -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/config.d.ts +27 -0
- package/dist/components/meeting/types.d.ts +166 -0
- package/dist/components/meeting/utils.d.ts +22 -0
- package/dist/components.cjs.js +224 -0
- package/dist/components.css +1 -0
- package/dist/components.element.cjs.js +1 -0
- package/dist/components.element.es.js +4 -0
- package/dist/components.es.js +45054 -0
- package/dist/index.d.ts +19 -0
- package/docs/design.md +27 -0
- package/docs/design_banner.md +41 -0
- package/docs/design_section.md +27 -0
- package/package.json +56 -0
- package/scripts/generate-components-index.js +104 -0
- 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 -0
- package/src/assets/svg-icons/icon-chevron-up.svg +3 -0
- package/src/assets/svg-icons/icon-close.svg +3 -0
- package/src/assets/svg-icons/icon-delete.svg +3 -0
- package/src/assets/svg-icons/icon-filter.svg +3 -0
- package/src/assets/svg-icons/icon-header-back.svg +3 -0
- package/src/assets/svg-icons/icon-header-delete.svg +3 -0
- 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 -0
- 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 -0
- 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 -0
- package/src/assets/svg-icons/icon-tips.svg +3 -0
- package/src/components/OBanner.vue +398 -0
- package/src/components/OCookieNotice.vue +575 -0
- package/src/components/OFooter.vue +576 -0
- package/src/components/OHeaderSearch.vue +601 -0
- package/src/components/OHeaderUser.vue +237 -0
- package/src/components/OPlusConfigProvider.vue +32 -0
- package/src/components/OSection.vue +178 -0
- package/src/components/OSourceCode.vue +153 -0
- package/src/components/OThemeSwitcher.vue +108 -0
- package/src/components/activity/OActivityApproval.vue +871 -0
- package/src/components/activity/OActivityForm.vue +548 -0
- package/src/components/activity/OMyActivityCalendar.vue +1501 -0
- package/src/components/activity/config.ts +141 -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 -0
- package/src/components/common/ContentWrapper.vue +85 -0
- 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 +419 -0
- package/src/components/events/OEventsCalendar.vue +588 -0
- package/src/components/events/OEventsList.vue +354 -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 +175 -0
- package/src/components/header/OHeaderMoblie.vue +152 -0
- package/src/components/header/components/HeaderContent.vue +942 -0
- package/src/components/header/components/HeaderNav.vue +280 -0
- package/src/components/header/components/HeaderNavMoblie.vue +346 -0
- package/src/components/header/components/HeaderUbmcNav.vue +540 -0
- package/src/components/header/index.ts +16 -0
- package/src/components/meeting/OMeetingCalendar.vue +900 -0
- package/src/components/meeting/OMeetingForm.vue +1041 -0
- package/src/components/meeting/OMeetingPlayback.vue +439 -0
- package/src/components/meeting/OMyMeetingCalendar.vue +1502 -0
- package/src/components/meeting/OSigMeetingCalendar.vue +411 -0
- package/src/components/meeting/components/OMeetingCalendarList.vue +505 -0
- package/src/components/meeting/components/OMeetingCalendarSelector.vue +206 -0
- package/src/components/meeting/components/OMeetingDetail.vue +227 -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 +197 -0
- package/src/components/meeting/config.ts +121 -0
- package/src/components/meeting/index.ts +45 -0
- package/src/components/meeting/types.ts +193 -0
- package/src/components/meeting/utils.ts +123 -0
- package/src/draft/Banner.vue +265 -0
- package/src/draft/ButtonCards.vue +106 -0
- package/src/draft/Feature.vue +134 -0
- package/src/draft/Footer.vue +512 -0
- package/src/draft/HorizontalAnchor.vue +165 -0
- package/src/draft/ItemSwiper.vue +133 -0
- package/src/draft/Logo.vue +141 -0
- package/src/draft/LogoCard.vue +75 -0
- package/src/draft/LogoV2.vue +19 -0
- package/src/draft/MainCard.vue +38 -0
- package/src/draft/MultiCard.vue +95 -0
- package/src/draft/MultiIconCard.vue +74 -0
- package/src/draft/OInfoCard.vue +176 -0
- package/src/draft/Process.vue +81 -0
- package/src/draft/Section.vue +167 -0
- package/src/draft/SingleTabCard.vue +85 -0
- package/src/draft/SliderCard.vue +110 -0
- package/src/env.d.ts +16 -0
- package/src/i18n/en.ts +261 -0
- package/src/i18n/index.ts +56 -0
- package/src/i18n/zh.ts +250 -0
- package/src/index.ts +45 -0
- package/src/shared/provide.ts +6 -0
- package/src/shims-vue-dompurify-html.d.ts +17 -0
- package/src/vue.d.ts +10 -0
- package/tsconfig.json +37 -0
- package/vite.config.ts +118 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { useI18n } from '@/i18n';
|
|
2
|
+
|
|
3
|
+
export const getActicityTypeMap = () => {
|
|
4
|
+
const { t } = useI18n();
|
|
5
|
+
return new Map([
|
|
6
|
+
[
|
|
7
|
+
1,
|
|
8
|
+
{
|
|
9
|
+
label: t('meeting.offline'),
|
|
10
|
+
value: 1,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
2,
|
|
15
|
+
{
|
|
16
|
+
label: t('meeting.online'),
|
|
17
|
+
value: 2,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
3,
|
|
22
|
+
{
|
|
23
|
+
label: t('meeting.onlineOffline'),
|
|
24
|
+
value: 3,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
]);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const WEBSITE_REGEXP = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w ./?%&=-]*)?$/;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
export const getStatusMap = () => {
|
|
34
|
+
const { t } = useI18n();
|
|
35
|
+
return new Map([
|
|
36
|
+
[
|
|
37
|
+
1,
|
|
38
|
+
{
|
|
39
|
+
id: 'draft',
|
|
40
|
+
label: t('meeting.statusDraft'),
|
|
41
|
+
text: t('meeting.statusDraft'),
|
|
42
|
+
value: 1,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
2,
|
|
47
|
+
{
|
|
48
|
+
id: 'under-review',
|
|
49
|
+
label: t('meeting.statusUnderReview'),
|
|
50
|
+
text: t('meeting.statusPending'),
|
|
51
|
+
value: 2,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
3,
|
|
56
|
+
{
|
|
57
|
+
id: 'registration',
|
|
58
|
+
label: t('meeting.statusRegistering'),
|
|
59
|
+
text: t('meeting.statusApproved'),
|
|
60
|
+
value: 3,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
4,
|
|
65
|
+
{
|
|
66
|
+
id: 'in-progress',
|
|
67
|
+
label: t('meeting.statusInProgress'),
|
|
68
|
+
text: t('meeting.statusApproved'),
|
|
69
|
+
value: 4,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
5,
|
|
74
|
+
{
|
|
75
|
+
id: 'ended',
|
|
76
|
+
label: t('meeting.statusEnded'),
|
|
77
|
+
text: t('meeting.statusEnded'),
|
|
78
|
+
value: 5,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
6,
|
|
83
|
+
{
|
|
84
|
+
id: 'modified',
|
|
85
|
+
label: t('meeting.statusModified'),
|
|
86
|
+
text: t('meeting.statusModified'),
|
|
87
|
+
value: 6,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
7,
|
|
92
|
+
{
|
|
93
|
+
id: 'reject',
|
|
94
|
+
label: t('meeting.statusRejected'),
|
|
95
|
+
text: t('meeting.statusRejected'),
|
|
96
|
+
value: 7,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
]);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const getApprovalStatusMap = () => {
|
|
103
|
+
const { t } = useI18n();
|
|
104
|
+
return new Map([
|
|
105
|
+
[
|
|
106
|
+
'all',
|
|
107
|
+
{
|
|
108
|
+
label: t('common.all'),
|
|
109
|
+
value: 'all',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
'rejected',
|
|
114
|
+
{
|
|
115
|
+
label: t('meeting.statusRejected'),
|
|
116
|
+
value: 'rejected',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
'approved',
|
|
121
|
+
{
|
|
122
|
+
label: t('meeting.statusApproved'),
|
|
123
|
+
value: 'approved',
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
'publish',
|
|
128
|
+
{
|
|
129
|
+
label: t('meeting.statusPending'),
|
|
130
|
+
value: 'publish',
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
'cancel',
|
|
135
|
+
{
|
|
136
|
+
label: t('meeting.statusCanceled'),
|
|
137
|
+
value: 'cancel',
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
]);
|
|
141
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _OActivityForm from './OActivityForm.vue';
|
|
2
|
+
import _OActivityApproval from './OActivityApproval.vue';
|
|
3
|
+
import _OMyActivityCalendar from './OMyActivityCalendar.vue';
|
|
4
|
+
import type { App } from 'vue';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const OActivityForm = Object.assign(_OActivityForm, {
|
|
8
|
+
install(app: App) {
|
|
9
|
+
app.component('OActivityForm', _OActivityForm);
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
const OActivityApproval = Object.assign(_OActivityApproval, {
|
|
13
|
+
install(app: App) {
|
|
14
|
+
app.component('OActivityApproval', _OActivityApproval);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
const OMyActivityCalendar = Object.assign(_OMyActivityCalendar, {
|
|
18
|
+
install(app: App) {
|
|
19
|
+
app.component('OMyActivityCalendar', _OMyActivityCalendar);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export { OActivityForm, OActivityApproval, OMyActivityCalendar };
|
|
24
|
+
export * from './types';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// 活动新增、修改
|
|
2
|
+
export interface ParamsItemT {
|
|
3
|
+
id?: number; // 活动id
|
|
4
|
+
title: string; // 活动名称
|
|
5
|
+
start_date: string; // 活动起始日期
|
|
6
|
+
end_date: string; // 活动结束日期
|
|
7
|
+
register_end_date: string; // 报名截止时间
|
|
8
|
+
activity_type: string | number; // 活动类型
|
|
9
|
+
synopsis: string; // 活动简介
|
|
10
|
+
register_url: string; // 报名网址
|
|
11
|
+
content_url: string; // 活动详情网址
|
|
12
|
+
address: string; // 活动地址
|
|
13
|
+
start: string; // 活动开始时间
|
|
14
|
+
end: string; // 活动结束时间
|
|
15
|
+
schedules?: string;
|
|
16
|
+
is_publish: string; // 是否发布 true-发布审核 false-发布为草稿
|
|
17
|
+
update_activity_id?: string;
|
|
18
|
+
email_list?: string; // 邮件列表
|
|
19
|
+
organizer?: string; // 主办方
|
|
20
|
+
approver: string; // 审批人
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ActivityFormPropsT {
|
|
24
|
+
data?: ParamsItemT;
|
|
25
|
+
creatActivity: any;
|
|
26
|
+
editActivity: any;
|
|
27
|
+
admins: string[];
|
|
28
|
+
organizers: {
|
|
29
|
+
id: number;
|
|
30
|
+
name: string;
|
|
31
|
+
}[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface TypeOptionT {
|
|
35
|
+
label: string;
|
|
36
|
+
value: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ActivityItemT {
|
|
40
|
+
activity_mode: number;
|
|
41
|
+
activity_type: number;
|
|
42
|
+
address: string;
|
|
43
|
+
approver: string;
|
|
44
|
+
approve_record: object;
|
|
45
|
+
start_date: string;
|
|
46
|
+
end: string;
|
|
47
|
+
end_date: string;
|
|
48
|
+
id: number;
|
|
49
|
+
is_delete: number; // 1-已取消 0-正常
|
|
50
|
+
live_address: string;
|
|
51
|
+
register_end_date: string;
|
|
52
|
+
register_url: string;
|
|
53
|
+
start: string;
|
|
54
|
+
status: number; // 1-草稿 2-审核中 3-报名中 4-进行中 5-已结束 6-已修改 7-驳回
|
|
55
|
+
synopsis: string;
|
|
56
|
+
title: string;
|
|
57
|
+
update_activity_id: number;
|
|
58
|
+
user: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ReviewParamsT {
|
|
62
|
+
page: number;
|
|
63
|
+
size: number;
|
|
64
|
+
status: string;
|
|
65
|
+
activity_mode?: string;
|
|
66
|
+
is_delete?: number;
|
|
67
|
+
search: string;
|
|
68
|
+
sponsor: string;
|
|
69
|
+
order_by: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ActivityTablePropsT {
|
|
73
|
+
getTableDataRequest: any;
|
|
74
|
+
applicantList: string[];
|
|
75
|
+
cancelActivityRequest: any;
|
|
76
|
+
deleteActivityRequest: any;
|
|
77
|
+
approveActivityRequest: any;
|
|
78
|
+
rejectActivityRequest: any;
|
|
79
|
+
getActivityDetailRequest: any;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface MyActivityCalendarPropsT {
|
|
83
|
+
getListRequest: any;
|
|
84
|
+
revokeActivityRequest: any;
|
|
85
|
+
deleteActivityRequest: any;
|
|
86
|
+
editActivityRequest: any;
|
|
87
|
+
getActivityDetailRequest: any;
|
|
88
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, type PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
// 头像
|
|
6
|
+
avatar: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: '',
|
|
9
|
+
},
|
|
10
|
+
// 用户名
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: '',
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
// mini: 16 small: 24, medium: 40, large: 64
|
|
17
|
+
size: {
|
|
18
|
+
type: String as PropType<'mini' | 'small' | 'medium' | 'large'>,
|
|
19
|
+
default: 'medium',
|
|
20
|
+
},
|
|
21
|
+
// 大小尺寸自定义,单位px
|
|
22
|
+
customSize: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0,
|
|
25
|
+
},
|
|
26
|
+
// round--圆形 square--方形
|
|
27
|
+
variant: {
|
|
28
|
+
type: String as PropType<'round' | 'square'>,
|
|
29
|
+
default: 'round',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const bgColorArr = ['#058EF0', '#FA7305', '#03B5A5'];
|
|
34
|
+
|
|
35
|
+
const avatarText = computed(() => props.name?.charAt(0).toUpperCase());
|
|
36
|
+
const getAvatarStyle = computed(() => {
|
|
37
|
+
const avatarStyle = {
|
|
38
|
+
'background-color': '',
|
|
39
|
+
width: '32px',
|
|
40
|
+
height: '32px',
|
|
41
|
+
'font-size': '20px',
|
|
42
|
+
};
|
|
43
|
+
avatarStyle['background-color'] = props.name ? bgColorArr[props.name?.length % bgColorArr.length] : 'transparent';
|
|
44
|
+
let sizeNum = 0;
|
|
45
|
+
if (props.customSize) {
|
|
46
|
+
sizeNum = Number(props.customSize);
|
|
47
|
+
} else {
|
|
48
|
+
const sizeToNum = {
|
|
49
|
+
mini: 16,
|
|
50
|
+
small: 24,
|
|
51
|
+
medium: 40,
|
|
52
|
+
large: 64,
|
|
53
|
+
};
|
|
54
|
+
sizeNum = sizeToNum[props.size];
|
|
55
|
+
}
|
|
56
|
+
avatarStyle.height = `${sizeNum}px`;
|
|
57
|
+
avatarStyle.width = `${sizeNum}px`;
|
|
58
|
+
avatarStyle['font-size'] = `${sizeNum / 2}px`;
|
|
59
|
+
return avatarStyle;
|
|
60
|
+
});
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<img v-if="avatar && !avatar.includes('gitcode')" :src="avatar" class="img-avatar" :class="variant" :style="getAvatarStyle" alt="" />
|
|
65
|
+
<div v-else class="word-avatar" :class="variant" :style="getAvatarStyle">
|
|
66
|
+
{{ avatarText }}
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<style lang="scss" scoped>
|
|
71
|
+
.img-avatar {
|
|
72
|
+
background-color: transparent !important;
|
|
73
|
+
}
|
|
74
|
+
.word-avatar {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
color: var(--o-color-info1-inverse);
|
|
79
|
+
}
|
|
80
|
+
.round {
|
|
81
|
+
border-radius: 50%;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent, onMounted, ref, h, resolveComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
const fallback = (slots: any) => {
|
|
4
|
+
const show = ref(false);
|
|
5
|
+
|
|
6
|
+
onMounted(() => {
|
|
7
|
+
show.value = true;
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
return () => (show.value && slots.default ? slots.default() : null);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
setup(_, { slots }) {
|
|
15
|
+
const BuiltIn = resolveComponent('ClientOnly');
|
|
16
|
+
if (BuiltIn && typeof BuiltIn !== 'string') {
|
|
17
|
+
return () => h(BuiltIn, null, { default: () => slots.default ? slots.default() : null });
|
|
18
|
+
}
|
|
19
|
+
return fallback(slots);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { isBoolean, isString, isUndefined } from '@opensig/opendesign';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
|
|
5
|
+
const DEFAULT = Symbol('default');
|
|
6
|
+
|
|
7
|
+
interface ContentWrapperPropsT {
|
|
8
|
+
verticalPadding?: boolean | string | Array<string>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<ContentWrapperPropsT>(), {
|
|
12
|
+
verticalPadding: undefined,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const paddingTop = computed(() => {
|
|
16
|
+
if (!props.verticalPadding) {
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (isBoolean(props.verticalPadding)) {
|
|
21
|
+
return DEFAULT;
|
|
22
|
+
} else if (isString(props.verticalPadding)) {
|
|
23
|
+
return props.verticalPadding;
|
|
24
|
+
} else {
|
|
25
|
+
return props.verticalPadding[0];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const paddingBottom = computed(() => {
|
|
30
|
+
if (!props.verticalPadding) {
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (isBoolean(props.verticalPadding)) {
|
|
35
|
+
return DEFAULT;
|
|
36
|
+
} else if (isString(props.verticalPadding)) {
|
|
37
|
+
return props.verticalPadding;
|
|
38
|
+
} else {
|
|
39
|
+
return !isUndefined(props.verticalPadding[1]) ? props.verticalPadding[1] : props.verticalPadding[0];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<div
|
|
46
|
+
class="content-wrapper"
|
|
47
|
+
:style="{
|
|
48
|
+
'--content-wrapper-vertical-paddingTop': paddingTop === DEFAULT ? undefined : paddingTop,
|
|
49
|
+
'--content-wrapper-vertical-paddingBottom': paddingBottom === DEFAULT ? undefined : paddingBottom,
|
|
50
|
+
}"
|
|
51
|
+
>
|
|
52
|
+
<slot></slot>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
.content-wrapper {
|
|
58
|
+
--layout-content-max-width: 1544px;
|
|
59
|
+
--layout-content-padding: 64px;
|
|
60
|
+
--layout-header-height: 80px;
|
|
61
|
+
|
|
62
|
+
@include respond-to('<=laptop') {
|
|
63
|
+
--layout-content-max-width: 100%;
|
|
64
|
+
--layout-content-padding: 40px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@include respond-to('<=pad') {
|
|
68
|
+
--layout-content-padding: 32px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@include respond-to('phone') {
|
|
72
|
+
--layout-content-padding: 24px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
max-width: var(--layout-content-max-width);
|
|
76
|
+
padding-left: var(--layout-content-padding);
|
|
77
|
+
padding-right: var(--layout-content-padding);
|
|
78
|
+
margin: 0 auto;
|
|
79
|
+
|
|
80
|
+
--content-wrapper-vertical-paddingTop: 72px;
|
|
81
|
+
--content-wrapper-vertical-paddingBottom: 72px;
|
|
82
|
+
padding-top: var(--content-wrapper-vertical-paddingTop);
|
|
83
|
+
padding-bottom: var(--content-wrapper-vertical-paddingBottom);
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { OIcon, OIconChevronDown, OIconChevronUp } from '@opensig/opendesign';
|
|
3
|
+
import { nextTick, onMounted, ref, watch } from 'vue';
|
|
4
|
+
import { useI18n } from '@/i18n';
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<{
|
|
8
|
+
text?: string;
|
|
9
|
+
link?: boolean;
|
|
10
|
+
lines?: number;
|
|
11
|
+
show: boolean;
|
|
12
|
+
}>(),
|
|
13
|
+
{
|
|
14
|
+
text: '',
|
|
15
|
+
link: false,
|
|
16
|
+
lines: 3,
|
|
17
|
+
show: false,
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const { t } = useI18n();
|
|
22
|
+
|
|
23
|
+
const expanded = ref(false); // 是否展开
|
|
24
|
+
const showBtn = ref(false); // 受否显示展开按钮
|
|
25
|
+
const offsetHeight = ref(0); // 内容高度
|
|
26
|
+
const contentRef = ref(null); // 内容节点
|
|
27
|
+
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
determineHeight();
|
|
30
|
+
});
|
|
31
|
+
watch([() => props.text, () => props.show], () => {
|
|
32
|
+
determineHeight();
|
|
33
|
+
});
|
|
34
|
+
const determineHeight = () => {
|
|
35
|
+
nextTick(() => {
|
|
36
|
+
const ele = contentRef.value;
|
|
37
|
+
if (ele) {
|
|
38
|
+
const range = document.createRange();
|
|
39
|
+
range.setStart(ele, 0);
|
|
40
|
+
range.setEnd(ele, ele.childNodes.length);
|
|
41
|
+
showBtn.value = range.getBoundingClientRect().height > ele.offsetHeight + 10 || ele.scrollHeight > ele.offsetHeight + 10;
|
|
42
|
+
offsetHeight.value = range.getBoundingClientRect().height || ele.scrollHeight;
|
|
43
|
+
} else {
|
|
44
|
+
showBtn.value = false;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const clickText = () => {
|
|
50
|
+
if (props.link) {
|
|
51
|
+
window.open(props.text)
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<div class="more-text-wrapper">
|
|
58
|
+
<div
|
|
59
|
+
:class="['more-text-content', link && 'is-link']"
|
|
60
|
+
ref="contentRef"
|
|
61
|
+
:style="{
|
|
62
|
+
'max-height': expanded ? offsetHeight + 'px' : '66px',
|
|
63
|
+
'-webkit-line-clamp': expanded ? 'initial' : lines,
|
|
64
|
+
}"
|
|
65
|
+
@click="clickText"
|
|
66
|
+
>
|
|
67
|
+
{{ text }}
|
|
68
|
+
</div>
|
|
69
|
+
<div class="more-text-btn" v-if="showBtn" @click="expanded = !expanded">
|
|
70
|
+
<div v-if="!expanded">
|
|
71
|
+
<span>{{ t('common.expand') }}</span>
|
|
72
|
+
<OIcon>
|
|
73
|
+
<OIconChevronDown />
|
|
74
|
+
</OIcon>
|
|
75
|
+
</div>
|
|
76
|
+
<div v-else>
|
|
77
|
+
<span>{{ t('common.collapse') }}</span>
|
|
78
|
+
<OIcon>
|
|
79
|
+
<OIconChevronUp />
|
|
80
|
+
</OIcon>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<style lang="scss" scoped>
|
|
87
|
+
.more-text-wrapper {
|
|
88
|
+
.more-text-content {
|
|
89
|
+
line-height: 22px;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
text-overflow: ellipsis;
|
|
92
|
+
display: -webkit-box;
|
|
93
|
+
-webkit-box-orient: vertical;
|
|
94
|
+
white-space: pre-wrap;
|
|
95
|
+
word-break: break-all;
|
|
96
|
+
transition: height 0.1s;
|
|
97
|
+
|
|
98
|
+
&.is-link {
|
|
99
|
+
color: var(--o-color-primary1);
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
@include hover {
|
|
102
|
+
color: var(--o-color-primary2);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.more-text-btn {
|
|
108
|
+
color: var(--o-color-primary1);
|
|
109
|
+
@include hover {
|
|
110
|
+
color: var(--o-color-primary2);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
& > div {
|
|
114
|
+
height: 22px;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
column-gap: 4px;
|
|
119
|
+
justify-content: flex-end;
|
|
120
|
+
@include tip1;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</style>
|