@opendesign-plus/components 0.0.1-rc.2 → 0.0.1-rc.21

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.
Files changed (205) hide show
  1. package/dist/chunk-OElCookieNotice.cjs.js +1 -0
  2. package/dist/chunk-OElCookieNotice.es.js +839 -0
  3. package/dist/components/OBanner.vue.d.ts +10 -1
  4. package/dist/components/OCookieNotice.vue.d.ts +6 -5
  5. package/dist/components/OFooter.vue.d.ts +46 -0
  6. package/dist/components/OHeaderSearch.vue.d.ts +10 -14
  7. package/dist/components/OHeaderUser.vue.d.ts +40 -0
  8. package/dist/components/OSourceCode.vue.d.ts +18 -0
  9. package/dist/components/activity/OActivityApproval.vue.d.ts +273 -0
  10. package/dist/components/activity/OActivityForm.vue.d.ts +138 -0
  11. package/dist/components/activity/OMyActivityCalendar.vue.d.ts +570 -0
  12. package/dist/components/activity/composables/useActivityConfig.d.ts +17 -0
  13. package/dist/components/activity/config.d.ts +1 -0
  14. package/dist/components/activity/index.d.ts +615 -0
  15. package/dist/components/activity/types.d.ts +88 -0
  16. package/dist/components/element-plus/OElCookieNotice.vue.d.ts +34 -0
  17. package/dist/components/element-plus/index.d.ts +2 -0
  18. package/dist/components/events/OEventsApply.vue.d.ts +16 -0
  19. package/dist/components/events/OEventsCalendar.vue.d.ts +5 -0
  20. package/dist/components/events/OEventsList.vue.d.ts +26 -0
  21. package/dist/components/events/config.d.ts +14 -0
  22. package/dist/components/events/index.d.ts +78 -0
  23. package/dist/components/events/types.d.ts +69 -0
  24. package/dist/components/events/utils.d.ts +7 -0
  25. package/dist/components/header/OHeader.vue.d.ts +30 -0
  26. package/dist/components/header/OHeaderMobile.vue.d.ts +178 -0
  27. package/dist/components/header/components/HeaderContent.vue.d.ts +13 -0
  28. package/dist/components/header/components/HeaderNav.vue.d.ts +19 -0
  29. package/dist/components/header/components/HeaderNavMobile.vue.d.ts +36 -0
  30. package/dist/components/header/index.d.ts +152 -0
  31. package/dist/components/header/types.d.ts +84 -0
  32. package/dist/components/meeting/OMeetingCalendar.vue.d.ts +295 -0
  33. package/dist/components/meeting/OMeetingForm.vue.d.ts +143 -0
  34. package/dist/components/meeting/OMeetingPlayback.vue.d.ts +45 -0
  35. package/dist/components/meeting/OMyMeetingCalendar.vue.d.ts +578 -0
  36. package/dist/components/meeting/OSigMeetingCalendar.vue.d.ts +24 -0
  37. package/dist/components/meeting/components/OMeetingCalendarList.vue.d.ts +28 -0
  38. package/dist/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +664 -0
  39. package/dist/components/meeting/components/OMeetingDetail.vue.d.ts +13 -0
  40. package/dist/components/meeting/components/OMeetingPlaybackSubtitles.vue.d.ts +5 -0
  41. package/dist/components/meeting/components/OMeetingPlaybackVideo.vue.d.ts +17 -0
  42. package/dist/components/meeting/components/OSigMeetingAside.vue.d.ts +16 -0
  43. package/dist/components/meeting/composables/useMeetingConfig.d.ts +14 -0
  44. package/dist/components/meeting/config.d.ts +12 -0
  45. package/dist/components/meeting/index.d.ts +786 -0
  46. package/dist/components/meeting/types.d.ts +233 -0
  47. package/dist/components/meeting/utils.d.ts +8 -0
  48. package/dist/components.cjs.js +224 -1
  49. package/dist/components.css +1 -1
  50. package/dist/components.element.cjs.js +1 -0
  51. package/dist/components.element.es.js +4 -0
  52. package/dist/components.es.js +44417 -784
  53. package/dist/index.d.ts +9 -2
  54. package/docs/design.md +27 -27
  55. package/docs/design_banner.md +41 -41
  56. package/docs/design_section.md +27 -27
  57. package/package.json +13 -4
  58. package/scripts/generate-components-index.js +103 -80
  59. package/src/assets/events/svg-icons/icon-checked.svg +3 -0
  60. package/src/assets/events/svg-icons/icon-competition.svg +7 -0
  61. package/src/assets/events/svg-icons/icon-events.svg +4 -0
  62. package/src/assets/events/svg-icons/icon-release.svg +4 -0
  63. package/src/assets/events/svg-icons/icon-summit.svg +4 -0
  64. package/src/assets/meeting/svg-icons/icon-all.svg +3 -0
  65. package/src/assets/meeting/svg-icons/icon-backward.svg +4 -0
  66. package/src/assets/meeting/svg-icons/icon-calendar.svg +3 -0
  67. package/src/assets/meeting/svg-icons/icon-cancel.svg +4 -0
  68. package/src/assets/meeting/svg-icons/icon-captions.svg +4 -0
  69. package/src/assets/meeting/svg-icons/icon-close-captions.svg +6 -0
  70. package/src/assets/meeting/svg-icons/icon-close-fullscreen.svg +6 -0
  71. package/src/assets/meeting/svg-icons/icon-copy.svg +3 -0
  72. package/src/assets/meeting/svg-icons/icon-create.svg +5 -0
  73. package/src/assets/meeting/svg-icons/icon-delete.svg +7 -0
  74. package/src/assets/meeting/svg-icons/icon-empty.svg +31 -0
  75. package/src/assets/meeting/svg-icons/icon-empty_dark.svg +49 -0
  76. package/src/assets/meeting/svg-icons/icon-event.svg +3 -0
  77. package/src/assets/meeting/svg-icons/icon-export.svg +3 -0
  78. package/src/assets/meeting/svg-icons/icon-forward.svg +4 -0
  79. package/src/assets/meeting/svg-icons/icon-fullscreen.svg +6 -0
  80. package/src/assets/meeting/svg-icons/icon-help.svg +3 -0
  81. package/src/assets/meeting/svg-icons/icon-important.svg +4 -0
  82. package/src/assets/meeting/svg-icons/icon-info.svg +3 -0
  83. package/src/assets/meeting/svg-icons/icon-meet.svg +3 -0
  84. package/src/assets/meeting/svg-icons/icon-meeting-message.svg +5 -0
  85. package/src/assets/meeting/svg-icons/icon-meeting.svg +4 -0
  86. package/src/assets/meeting/svg-icons/icon-play.svg +5 -0
  87. package/src/assets/meeting/svg-icons/icon-playing-tip.svg +7 -0
  88. package/src/assets/meeting/svg-icons/icon-playing.svg +5 -0
  89. package/src/assets/meeting/svg-icons/icon-question.svg +4 -0
  90. package/src/assets/meeting/svg-icons/icon-sound.svg +5 -0
  91. package/src/assets/meeting/svg-icons/icon-speaker.svg +3 -0
  92. package/src/assets/meeting/svg-icons/icon-summit.svg +3 -0
  93. package/src/assets/meeting/svg-icons/icon-telligent.svg +3 -0
  94. package/src/assets/meeting/svg-icons/icon-tip.svg +3 -0
  95. package/src/assets/meeting/svg-icons/icon-todo.svg +4 -0
  96. package/src/assets/meeting/transparent.png +0 -0
  97. package/src/assets/svg-icons/icon-arrow-left.svg +3 -0
  98. package/src/assets/svg-icons/icon-avatar-line.svg +3 -0
  99. package/src/assets/svg-icons/icon-caret-left.svg +3 -0
  100. package/src/assets/svg-icons/icon-caret-right.svg +3 -0
  101. package/src/assets/svg-icons/icon-chevron-down.svg +3 -0
  102. package/src/assets/svg-icons/icon-chevron-right.svg +3 -3
  103. package/src/assets/svg-icons/icon-chevron-up.svg +3 -0
  104. package/src/assets/svg-icons/icon-close.svg +3 -3
  105. package/src/assets/svg-icons/icon-delete.svg +3 -3
  106. package/src/assets/svg-icons/icon-filter.svg +3 -0
  107. package/src/assets/svg-icons/icon-header-back.svg +3 -3
  108. package/src/assets/svg-icons/icon-header-delete.svg +3 -3
  109. package/src/assets/svg-icons/icon-header-menu.svg +3 -0
  110. package/src/assets/svg-icons/icon-header-person.svg +3 -0
  111. package/src/assets/svg-icons/icon-header-search.svg +4 -4
  112. package/src/assets/svg-icons/icon-loading.svg +4 -0
  113. package/src/assets/svg-icons/icon-locale.svg +3 -0
  114. package/src/assets/svg-icons/icon-log-off.svg +3 -0
  115. package/src/assets/svg-icons/icon-message.svg +3 -0
  116. package/src/assets/svg-icons/icon-moon.svg +3 -3
  117. package/src/assets/svg-icons/icon-outlink.svg +3 -0
  118. package/src/assets/svg-icons/icon-overview.svg +3 -0
  119. package/src/assets/svg-icons/icon-search.svg +3 -0
  120. package/src/assets/svg-icons/icon-setting.svg +3 -0
  121. package/src/assets/svg-icons/icon-sun.svg +3 -3
  122. package/src/assets/svg-icons/icon-tips.svg +3 -0
  123. package/src/components/OBanner.vue +398 -390
  124. package/src/components/OCookieNotice.vue +575 -424
  125. package/src/components/OFooter.vue +576 -0
  126. package/src/components/OHeaderSearch.vue +601 -601
  127. package/src/components/OHeaderUser.vue +237 -0
  128. package/src/components/OPlusConfigProvider.vue +32 -32
  129. package/src/components/OSection.vue +178 -178
  130. package/src/components/OSourceCode.vue +151 -0
  131. package/src/components/OThemeSwitcher.vue +108 -108
  132. package/src/components/activity/OActivityApproval.vue +864 -0
  133. package/src/components/activity/OActivityForm.vue +542 -0
  134. package/src/components/activity/OMyActivityCalendar.vue +1502 -0
  135. package/src/components/activity/composables/useActivityConfig.ts +141 -0
  136. package/src/components/activity/config.ts +1 -0
  137. package/src/components/activity/index.ts +24 -0
  138. package/src/components/activity/types.ts +95 -0
  139. package/src/components/common/AppAvatar.vue +83 -0
  140. package/src/components/common/ClientOnlyWrapper.ts +21 -21
  141. package/src/components/common/ContentWrapper.vue +85 -85
  142. package/src/components/common/MoreText.vue +124 -0
  143. package/src/components/common/ThFilter.vue +330 -0
  144. package/src/components/element-plus/OElCookieNotice.vue +603 -0
  145. package/src/components/element-plus/index.ts +3 -0
  146. package/src/components/events/OEventsApply.vue +418 -0
  147. package/src/components/events/OEventsCalendar.vue +598 -0
  148. package/src/components/events/OEventsList.vue +389 -0
  149. package/src/components/events/config.ts +35 -0
  150. package/src/components/events/index.ts +24 -0
  151. package/src/components/events/types.ts +83 -0
  152. package/src/components/events/utils.ts +9 -0
  153. package/src/components/header/OHeader.vue +157 -0
  154. package/src/components/header/OHeaderMobile.vue +184 -0
  155. package/src/components/header/components/HeaderContent.vue +1125 -0
  156. package/src/components/header/components/HeaderNav.vue +278 -0
  157. package/src/components/header/components/HeaderNavMobile.vue +380 -0
  158. package/src/components/header/index.ts +16 -0
  159. package/src/components/header/types.ts +95 -0
  160. package/src/components/meeting/OMeetingCalendar.vue +890 -0
  161. package/src/components/meeting/OMeetingForm.vue +1072 -0
  162. package/src/components/meeting/OMeetingPlayback.vue +439 -0
  163. package/src/components/meeting/OMyMeetingCalendar.vue +1508 -0
  164. package/src/components/meeting/OSigMeetingCalendar.vue +413 -0
  165. package/src/components/meeting/components/OMeetingCalendarList.vue +515 -0
  166. package/src/components/meeting/components/OMeetingCalendarSelector.vue +210 -0
  167. package/src/components/meeting/components/OMeetingDetail.vue +244 -0
  168. package/src/components/meeting/components/OMeetingPlaybackSubtitles.vue +611 -0
  169. package/src/components/meeting/components/OMeetingPlaybackVideo.vue +741 -0
  170. package/src/components/meeting/components/OSigMeetingAside.vue +199 -0
  171. package/src/components/meeting/composables/useMeetingConfig.ts +108 -0
  172. package/src/components/meeting/config.ts +48 -0
  173. package/src/components/meeting/index.ts +45 -0
  174. package/src/components/meeting/types.ts +266 -0
  175. package/src/components/meeting/utils.ts +70 -0
  176. package/src/draft/Banner.vue +265 -265
  177. package/src/draft/ButtonCards.vue +105 -105
  178. package/src/draft/Feature.vue +133 -133
  179. package/src/draft/Footer.vue +512 -512
  180. package/src/draft/HorizontalAnchor.vue +165 -165
  181. package/src/draft/ItemSwiper.vue +133 -133
  182. package/src/draft/Logo.vue +141 -141
  183. package/src/draft/LogoCard.vue +74 -74
  184. package/src/draft/LogoV2.vue +19 -19
  185. package/src/draft/MainCard.vue +38 -38
  186. package/src/draft/MultiCard.vue +94 -94
  187. package/src/draft/MultiIconCard.vue +73 -73
  188. package/src/draft/OInfoCard.vue +176 -176
  189. package/src/draft/Process.vue +81 -81
  190. package/src/draft/Section.vue +167 -167
  191. package/src/draft/SingleTabCard.vue +84 -84
  192. package/src/draft/SliderCard.vue +110 -110
  193. package/src/env.d.ts +16 -1
  194. package/src/i18n/en.ts +264 -20
  195. package/src/i18n/index.ts +56 -42
  196. package/src/i18n/zh.ts +253 -9
  197. package/src/index.ts +14 -3
  198. package/src/shared/provide.ts +6 -6
  199. package/src/shims-vue-dompurify-html.d.ts +17 -0
  200. package/src/vue.d.ts +9 -9
  201. package/tsconfig.json +37 -33
  202. package/vite.config.ts +119 -94
  203. package/dist/components/OCookieNoticeEl.vue.d.ts +0 -29
  204. package/dist/components.umd.js +0 -1
  205. package/src/components/OCookieNoticeEl.vue +0 -404
@@ -0,0 +1,141 @@
1
+ import { computed } from 'vue';
2
+ import { useI18n } from '@/i18n';
3
+
4
+ export const useActivityConfig = () => {
5
+ const { t } = useI18n();
6
+
7
+ const activityTypeMap = computed(() => new Map([
8
+ [
9
+ 1,
10
+ {
11
+ label: t('meeting.offline'),
12
+ value: 1,
13
+ },
14
+ ],
15
+ [
16
+ 2,
17
+ {
18
+ label: t('meeting.online'),
19
+ value: 2,
20
+ },
21
+ ],
22
+ [
23
+ 3,
24
+ {
25
+ label: t('meeting.onlineOffline'),
26
+ value: 3,
27
+ },
28
+ ],
29
+ ]));
30
+
31
+ const statusMap = computed(() => new Map([
32
+ [
33
+ 1,
34
+ {
35
+ id: 'draft',
36
+ label: t('meeting.statusDraft'),
37
+ text: t('meeting.statusDraft'),
38
+ value: 1,
39
+ },
40
+ ],
41
+ [
42
+ 2,
43
+ {
44
+ id: 'under-review',
45
+ label: t('meeting.statusUnderReview'),
46
+ text: t('meeting.statusPending'),
47
+ value: 2,
48
+ },
49
+ ],
50
+ [
51
+ 3,
52
+ {
53
+ id: 'registration',
54
+ label: t('meeting.statusRegistering'),
55
+ text: t('meeting.statusApproved'),
56
+ value: 3,
57
+ },
58
+ ],
59
+ [
60
+ 4,
61
+ {
62
+ id: 'in-progress',
63
+ label: t('meeting.statusInProgress'),
64
+ text: t('meeting.statusApproved'),
65
+ value: 4,
66
+ },
67
+ ],
68
+ [
69
+ 5,
70
+ {
71
+ id: 'ended',
72
+ label: t('meeting.statusEnded'),
73
+ text: t('meeting.statusEnded'),
74
+ value: 5,
75
+ },
76
+ ],
77
+ [
78
+ 6,
79
+ {
80
+ id: 'modified',
81
+ label: t('meeting.statusModified'),
82
+ text: t('meeting.statusModified'),
83
+ value: 6,
84
+ },
85
+ ],
86
+ [
87
+ 7,
88
+ {
89
+ id: 'reject',
90
+ label: t('meeting.statusRejected'),
91
+ text: t('meeting.statusRejected'),
92
+ value: 7,
93
+ },
94
+ ],
95
+ ]));
96
+
97
+ const approvalStatusMap = computed(() => new Map([
98
+ [
99
+ 'all',
100
+ {
101
+ label: t('common.all'),
102
+ value: 'all',
103
+ },
104
+ ],
105
+ [
106
+ 'rejected',
107
+ {
108
+ label: t('meeting.statusRejected'),
109
+ value: 'rejected',
110
+ },
111
+ ],
112
+ [
113
+ 'approved',
114
+ {
115
+ label: t('meeting.statusApproved'),
116
+ value: 'approved',
117
+ },
118
+ ],
119
+ [
120
+ 'publish',
121
+ {
122
+ label: t('meeting.statusPending'),
123
+ value: 'publish',
124
+ },
125
+ ],
126
+ [
127
+ 'cancel',
128
+ {
129
+ label: t('meeting.statusCanceled'),
130
+ value: 'cancel',
131
+ },
132
+ ],
133
+ ]));
134
+
135
+ return {
136
+ t,
137
+ activityTypeMap,
138
+ statusMap,
139
+ approvalStatusMap,
140
+ };
141
+ };
@@ -0,0 +1 @@
1
+ export const WEBSITE_REGEXP = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w ./?%&=-]*)?$/;
@@ -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,95 @@
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 | number;
18
+ email_list?: string; // 邮件列表
19
+ organizer?: string; // 主办方
20
+ approver: string; // 审批人
21
+ status?: number; // 状态
22
+ }
23
+
24
+ export interface ActivityFormPropsT {
25
+ data?: ParamsItemT;
26
+ creatActivity: any;
27
+ editActivity: any;
28
+ admins: string[];
29
+ organizers: {
30
+ id: number;
31
+ name: string;
32
+ }[];
33
+ }
34
+
35
+ export interface TypeOptionT {
36
+ label: string;
37
+ value: number;
38
+ }
39
+
40
+ export interface ActivityItemT {
41
+ activity_mode: number;
42
+ activity_type: number;
43
+ address: string;
44
+ approver: string;
45
+ approve_record: object;
46
+ start_date: string;
47
+ end: string;
48
+ end_date: string;
49
+ id: number;
50
+ is_delete: number; // 1-已取消 0-正常
51
+ live_address: string;
52
+ register_end_date: string;
53
+ register_url: string;
54
+ content_url: string;
55
+ start: string;
56
+ status: number; // 1-草稿 2-审核中 3-报名中 4-进行中 5-已结束 6-已修改 7-驳回
57
+ synopsis: string;
58
+ title: string;
59
+ update_activity_id: number;
60
+ user: string;
61
+ sponsor: string; // 创建人
62
+ create_time: string; // 创建时间
63
+ isExpired?: number; // 计算属性表示是否过期
64
+ sub_id?: string;
65
+ dateRange?: string; // 计算属性
66
+ }
67
+
68
+ export interface ReviewParamsT {
69
+ page: number;
70
+ size: number;
71
+ status: string;
72
+ activity_mode?: string;
73
+ is_delete?: number;
74
+ search: string;
75
+ sponsor: string;
76
+ order_by: string;
77
+ }
78
+
79
+ export interface ActivityTablePropsT {
80
+ getTableDataRequest: any;
81
+ applicantList: string[];
82
+ cancelActivityRequest: any;
83
+ deleteActivityRequest: any;
84
+ approveActivityRequest: any;
85
+ rejectActivityRequest: any;
86
+ getActivityDetailRequest: any;
87
+ }
88
+
89
+ export interface MyActivityCalendarPropsT {
90
+ getListRequest: any;
91
+ revokeActivityRequest: any;
92
+ deleteActivityRequest: any;
93
+ editActivityRequest: any;
94
+ getActivityDetailRequest: any;
95
+ }
@@ -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>
@@ -1,21 +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
- });
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
+ });
@@ -1,85 +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>
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<any>(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>