@opendesign-plus-test/components 0.0.1-rc.41 → 0.0.1-rc.43

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 (56) hide show
  1. package/dist/chunk-OElCookieNotice.cjs.js +1 -1
  2. package/dist/chunk-OElCookieNotice.es.js +111 -111
  3. package/dist/components/OHeaderSearch.vue.d.ts +6 -10
  4. package/dist/components/OSourceCode.vue.d.ts +4 -6
  5. package/dist/components/activity/OActivityApproval.vue.d.ts +6 -10
  6. package/dist/components/activity/OActivityForm.vue.d.ts +3 -5
  7. package/dist/components/activity/OMyActivityCalendar.vue.d.ts +18 -26
  8. package/dist/components/activity/index.d.ts +15 -23
  9. package/dist/components/activity/types.d.ts +8 -1
  10. package/dist/components/events/config.d.ts +5 -18
  11. package/dist/components/events/types.d.ts +4 -1
  12. package/dist/components/header/OHeaderMobile.vue.d.ts +18 -11
  13. package/dist/components/header/components/HeaderNavMobile.vue.d.ts +4 -1
  14. package/dist/components/header/index.d.ts +12 -5
  15. package/dist/components/header/types.d.ts +4 -0
  16. package/dist/components/meeting/OMeetingCalendar.vue.d.ts +10 -14
  17. package/dist/components/meeting/OMeetingForm.vue.d.ts +3 -5
  18. package/dist/components/meeting/OMeetingPlayback.vue.d.ts +45 -0
  19. package/dist/components/meeting/OMyMeetingCalendar.vue.d.ts +18 -26
  20. package/dist/components/meeting/components/OMeetingCalendarList.vue.d.ts +1 -1
  21. package/dist/components/meeting/components/OMeetingDetail.vue.d.ts +2 -1
  22. package/dist/components/meeting/index.d.ts +786 -0
  23. package/dist/components/meeting/types.d.ts +83 -18
  24. package/dist/components/meeting/utils.d.ts +1 -1
  25. package/dist/components.cjs.js +38 -38
  26. package/dist/components.css +1 -1
  27. package/dist/components.es.js +12466 -12392
  28. package/package.json +3 -3
  29. package/src/components/OSourceCode.vue +8 -10
  30. package/src/components/activity/OActivityApproval.vue +35 -34
  31. package/src/components/activity/OActivityForm.vue +4 -4
  32. package/src/components/activity/OMyActivityCalendar.vue +44 -27
  33. package/src/components/activity/types.ts +8 -1
  34. package/src/components/common/MoreText.vue +1 -1
  35. package/src/components/common/ThFilter.vue +7 -7
  36. package/src/components/element-plus/OElCookieNotice.vue +1 -1
  37. package/src/components/events/OEventsList.vue +45 -10
  38. package/src/components/events/config.ts +1 -1
  39. package/src/components/events/types.ts +4 -1
  40. package/src/components/header/OHeaderMobile.vue +8 -1
  41. package/src/components/header/components/HeaderContent.vue +7 -3
  42. package/src/components/header/components/HeaderNavMobile.vue +5 -2
  43. package/src/components/header/types.ts +4 -0
  44. package/src/components/meeting/OMeetingCalendar.vue +42 -48
  45. package/src/components/meeting/OMeetingForm.vue +75 -37
  46. package/src/components/meeting/OMeetingPlayback.vue +4 -4
  47. package/src/components/meeting/OMyMeetingCalendar.vue +33 -27
  48. package/src/components/meeting/OSigMeetingCalendar.vue +29 -26
  49. package/src/components/meeting/components/OMeetingCalendarList.vue +107 -88
  50. package/src/components/meeting/components/OMeetingCalendarSelector.vue +10 -6
  51. package/src/components/meeting/components/OMeetingDetail.vue +32 -16
  52. package/src/components/meeting/components/OMeetingPlaybackVideo.vue +7 -7
  53. package/src/components/meeting/components/OSigMeetingAside.vue +2 -3
  54. package/src/components/meeting/config.ts +1 -12
  55. package/src/components/meeting/types.ts +89 -18
  56. package/vite.config.ts +3 -2
@@ -17,6 +17,7 @@ import { useI18n } from '@/i18n';
17
17
 
18
18
  import { CITY_MAP, DEFAULT_COVER } from './config.ts';
19
19
  import { useScreen } from '@opendesign-plus/composables';
20
+ import dayjs from 'dayjs';
20
21
 
21
22
  const { t } = useI18n();
22
23
  const { lePadV } = useScreen();
@@ -84,12 +85,30 @@ const changeKeyword = () => {
84
85
  const list = computed(() => {
85
86
  return props.data
86
87
  .map((v: EventsCardItemT) => {
88
+ let startDate = v.startDate;
89
+ let endDate = v.endDate;
90
+ let dateStr = dayjs(v.date).format('YYYY/MM/DD');
91
+ if (startDate && endDate) {
92
+ const yearFirstDay = dayjs().format('YYYY-01-01');
93
+ if (compareDate(yearFirstDay, startDate)) {
94
+ startDate = yearFirstDay;
95
+ }
96
+ const yearLastDay = dayjs().format('YYYY-12-31');
97
+ if (compareDate(endDate, yearLastDay)) {
98
+ endDate = yearLastDay;
99
+ }
100
+ dateStr = `${ dayjs(startDate).format('YYYY/MM/DD') }-${ dayjs(endDate).format('MM/DD') }`;
101
+ }
87
102
  return {
88
103
  ...v,
89
- status: !compareDate(new Date(), v.date as string) ? EventsStatusT.ING : EventsStatusT.FINISH,
104
+ startDate,
105
+ endDate,
106
+ dateStr,
107
+ status: !compareDate(new Date(), v.date || v.endDate as string) ? EventsStatusT.ING : EventsStatusT.FINISH,
108
+
90
109
  };
91
110
  })
92
- .sort((a: EventsCardItemT, b: EventsCardItemT) => (compareDate(a.date as string, b.date as string) ? -1 : 1))
111
+ .sort((a: EventsCardItemT, b: EventsCardItemT) => (compareDate(a.date || a.endDate as string, b.date || b.endDate as string) ? -1 : 1))
93
112
  .map((v) => {
94
113
  const city = v.city?.replace('市', '')?.replace('中国', '')?.replaceAll(' ', '');
95
114
  let cover = null;
@@ -143,7 +162,7 @@ const list = computed(() => {
143
162
  </OTag>
144
163
  <div class="event-name">{{ item.name }}</div>
145
164
  <div class="event-desc">
146
- <div class="event-date">{{ item.date }}</div>
165
+ <div class="event-date">{{ item.dateStr }}</div>
147
166
  <ODivider direction="v" />
148
167
  <div class="event-location" v-if="item.city">{{ item.city }}</div>
149
168
  </div>
@@ -177,6 +196,9 @@ const list = computed(() => {
177
196
  padding: var(--o-gap-5) var(--o-gap-6);
178
197
  gap: var(--o-gap-3) var(--o-gap-2);
179
198
  @include text1;
199
+ @include respond-to('<=pad_v') {
200
+ padding: var(--o-gap-3) var(--o-gap-4);
201
+ }
180
202
 
181
203
  .filter-left {
182
204
  display: flex;
@@ -227,6 +249,7 @@ const list = computed(() => {
227
249
  margin-top: var(--o-gap-6);
228
250
  @include respond-to('<=pad_v') {
229
251
  grid-template-columns: repeat(1, 1fr);
252
+ container-type: inline-size;
230
253
  }
231
254
  @include respond-to('pad_v') {
232
255
  margin-top: var(--o-gap-4);
@@ -243,16 +266,19 @@ const list = computed(() => {
243
266
  @include respond-to('<=pad_v') {
244
267
  aspect-ratio: 1 / 0.4;
245
268
  }
269
+ @container (max-width: 300px) {
270
+ height: 140px;
271
+ width: 100%;
272
+ aspect-ratio: unset;
273
+ }
246
274
 
247
275
  .o-card-cover {
248
276
  padding: 0;
277
+ height: 100%;
249
278
  }
250
279
 
251
- .o-card-content {
252
- display: flex;
253
- flex-direction: column;
254
- align-items: center;
255
- justify-content: center;
280
+ .o-card-main {
281
+ padding: 0;
256
282
  position: absolute;
257
283
  overflow: hidden; // 防止内容溢出
258
284
  box-sizing: border-box; // 确保 padding 计入总尺寸
@@ -260,11 +286,20 @@ const list = computed(() => {
260
286
  top: 0;
261
287
  width: 100%;
262
288
  height: 100%;
289
+ }
290
+ .o-card-content {
291
+ position: absolute;
292
+ top: 0;
293
+ left: 0;
294
+ right: 0;
295
+ bottom: 0;
296
+ display: flex;
297
+ flex-direction: column;
298
+ align-items: center;
299
+ justify-content: center;
263
300
  color: var(--o-color-white);
264
301
  text-align: center;
265
- cursor: pointer;
266
302
  padding: var(--o-gap-6);
267
- z-index: 10;
268
303
 
269
304
  @include respond-to('pad_v') {
270
305
  margin-top: var(--o-gap-4);
@@ -17,7 +17,7 @@ export const EVENTS_ICON_MAP = {
17
17
  summit: IconSummit,
18
18
  };
19
19
 
20
- export const CITY_MAP = {
20
+ export const CITY_MAP: Record<string, string | string[]> = {
21
21
  上海: 'https://infrastructure-website.osinfra.cn/picture/city/shanghai.jpg',
22
22
  北京: 'https://infrastructure-website.osinfra.cn/picture/city/beijing.jpg',
23
23
  南京: 'https://infrastructure-website.osinfra.cn/picture/city/nanjing.jpg',
@@ -47,7 +47,10 @@ export interface StepItemT {
47
47
  // 活动列表
48
48
  export interface EventsCardItemT {
49
49
  name: string; // 事件名称
50
- date: string; // 事件日期
50
+ date?: string; // 事件日期
51
+ startDate?: string; // 事件开始日期
52
+ endDate?: string; // 事件结束日期
53
+ dateStr?: string; // 经处理后的展示时间
51
54
  city: string; // 事件城市
52
55
  cover?: string; // 卡片封面,如果不传递,组件内部通过date计算得出
53
56
  status?: EventsStatusT; // 事件状态,不传递,组件内部通过date计算得出
@@ -5,13 +5,14 @@ import { OIcon, OIconArrowLeft } from '@opensig/opendesign';
5
5
  import ContentWrapper from '../common/ContentWrapper.vue';
6
6
  import HeaderNavMobile from './components/HeaderNavMobile.vue';
7
7
 
8
- import { type NavT } from './types.ts';
8
+ import type { NavT, LangItemT } from './types.ts';
9
9
 
10
10
  import IconClose from '~icons/components/icon-close.svg';
11
11
  import IconMenu from '~icons/components/icon-header-menu.svg';
12
12
 
13
13
  export interface OHeaderT {
14
14
  (e: 'go-back'): void;
15
+ (e: 'lang-click', val: LangItemT): void;
15
16
  (e: 'go-home'): void;
16
17
  }
17
18
 
@@ -40,6 +41,11 @@ const mobileClick = () => {
40
41
  const handleClick = () => {
41
42
  menuPanel();
42
43
  };
44
+
45
+ const langClick = (val: LangItemT) => {
46
+ emit('lang-click', val);
47
+ menuPanel();
48
+ };
43
49
  </script>
44
50
 
45
51
  <template>
@@ -89,6 +95,7 @@ const handleClick = () => {
89
95
  :menu-show="menuShow"
90
96
  @handle-click="handleClick"
91
97
  @on-click="mobileClick"
98
+ @lang-click="langClick"
92
99
  >
93
100
  <template #tool>
94
101
  <slot name="tool"></slot>
@@ -33,8 +33,11 @@ const onMouseLeave = () => {
33
33
 
34
34
  const showDesc = ref(false);
35
35
  const descMouseenter = (e: MouseEvent) => {
36
- if (!e || !e.target) return;
37
- showDesc.value = e.target.clientHeight < e.target.scrollHeight;
36
+ if (!e || !e.target) {
37
+ return;
38
+ }
39
+ const target = e.target as HTMLElement;
40
+ showDesc.value = target!.clientHeight < target.scrollHeight;
38
41
  };
39
42
 
40
43
  const onClickNavHref = (item: any, sub: any) => {
@@ -95,7 +98,8 @@ const onClickShortcut = (item: any) => {
95
98
  <OTag v-if="subItem.tag" round="pill" color="danger" size="small" class="content-tag">{{ subItem.tag }}</OTag>
96
99
  </a>
97
100
  <div v-if="subItem.description" class="desc-container">
98
- <p class="item-desc" :title="showDesc ? subItem.description : null" @mouseenter="descMouseenter($event)">
101
+ <p class="item-desc" :title="showDesc ? subItem.description : undefined"
102
+ @mouseenter="descMouseenter($event)">
99
103
  {{ subItem.description }}
100
104
  </p>
101
105
  </div>
@@ -2,10 +2,11 @@
2
2
  import { ref, onMounted, watch } from 'vue';
3
3
  import { OIcon, OTag } from '@opensig/opendesign';
4
4
 
5
- import { type NavMobileItemT, NavType } from '../types.ts';
5
+ import { type NavMobileItemT, NavType, CodeItemT, LangItemT } from '../types.ts';
6
6
 
7
7
  export interface OHeaderEmitsT {
8
8
  (e: 'on-click'): void;
9
+ (e: 'lang-click', val: LangItemT): void;
9
10
  (e: 'handle-click', val: any): void;
10
11
  }
11
12
  const emit = defineEmits<OHeaderEmitsT>();
@@ -42,9 +43,11 @@ const onClick = (url: string, target?: string) => {
42
43
  emit('on-click');
43
44
  };
44
45
 
45
- const onClickNav = (val: any) => {
46
+ const onClickNav = (val: CodeItemT | LangItemT) => {
46
47
  if (navActive.value === NavType.CODE) {
47
48
  onClick(val.href, val?.target);
49
+ } else if (navActive.value === NavType.LANG) {
50
+ emit('lang-click', val);
48
51
  }
49
52
  };
50
53
 
@@ -11,6 +11,8 @@ export interface ChildrenItemT {
11
11
  description?: string; // 描述
12
12
  href?: string; // 链接
13
13
  tag?: tagT; // 标签
14
+ icon?: any;
15
+ target?: string;
14
16
  children?: ChildrenItemT[];
15
17
  }
16
18
 
@@ -22,6 +24,8 @@ export interface ShortcutItemT {
22
24
  tag?: tagT; // 标签
23
25
  remark?: string; // 时间
24
26
  type?: string; // 类型
27
+ target?: string;
28
+ icon?: string;
25
29
  }
26
30
 
27
31
  export interface NavItemT {
@@ -19,7 +19,14 @@ import IconSummit from '~icons/meeting/icon-summit.svg';
19
19
  import IconMeeting from '~icons/meeting/icon-meet.svg';
20
20
  import { Locales } from '@/i18n';
21
21
  import { useMeetingConfig } from './composables/useMeetingConfig';
22
- import { CalendarDataType, MeetingCalendarPropsT, MeetingGroupType } from './types.ts';
22
+ import {
23
+ CalendarDataType,
24
+ MeetingEventsItemT,
25
+ MeetingCalendarPropsT,
26
+ MeetingGroupType, MeetingItemT,
27
+ meetingTabT,
28
+ SummitItemT,
29
+ } from './types.ts';
23
30
  import { formatDate } from './utils.ts';
24
31
  import { useDebounceFn } from '@vueuse/core';
25
32
 
@@ -35,16 +42,16 @@ const { t, locale, meetingTabs, getConfig } = useMeetingConfig();
35
42
  const isEn = computed(() => locale.value === Locales.EN);
36
43
 
37
44
  const latestDay = ref<string>('');
38
- const dateList = ref([]);
39
- const summitData = ref([]);
40
- const summitDates = ref([]);
41
- const eventsData = ref([]);
42
- const eventsDates = ref([]);
45
+ const dateList = ref<string[]>([]);
46
+ const summitData = ref<SummitItemT[]>([]);
47
+ const summitDates = ref<string[]>([]);
48
+ const eventsData = ref<MeetingEventsItemT[]>([]);
49
+ const eventsDates = ref<string[]>([]);
43
50
  const allDates = ref<string[]>([]);
44
- const meetingData = ref([]);
51
+ const meetingData = ref<MeetingItemT[]>([]);
45
52
  const limitTime = '2021-01-01';
46
- const tabType = ref(CalendarDataType.ALL);
47
- const tabs = computed(() => {
53
+ const tabType = ref<CalendarDataType>(CalendarDataType.ALL);
54
+ const tabs = computed<meetingTabT[]>(() => {
48
55
  let list = meetingTabs.value;
49
56
  if (props.hiddenEvents) {
50
57
  list = list.filter((item) => item.value !== CalendarDataType.EVENTS);
@@ -68,24 +75,25 @@ const currentDay = ref('');
68
75
  const isAutoClick = ref(false);
69
76
  // sig组列表
70
77
  const group = ref('');
71
- const getSummitData = async (date) => {
78
+ const getSummitData = async (date: string) => {
72
79
  if (props.getSummitListRequest) {
73
80
  const list = await props.getSummitListRequest(date);
74
- summitData.value = (list || []).map(v => {
81
+ summitData.value = (list || []).map((v: SummitItemT) => {
75
82
  return {
76
-
77
83
  ...v,
78
84
  type: CalendarDataType.SUMMIT,
85
+ start_date_time: `${ formatDate(v.start_date) } ${ v.start }`,
86
+ end_date_time: `${ formatDate(v.end_date) } ${ v.end }`,
79
87
  };
80
88
  });
81
89
  } else {
82
90
  summitData.value = [];
83
91
  }
84
92
  };
85
- const getActivityData = async (date) => {
93
+ const getActivityData = async (date: string) => {
86
94
  if (props.getEventsListRequest) {
87
95
  const list = await props.getEventsListRequest(date);
88
- eventsData.value = (list || []).map(v => {
96
+ eventsData.value = (list || []).map((v: MeetingEventsItemT) => {
89
97
  return {
90
98
  ...v,
91
99
  type: CalendarDataType.EVENTS,
@@ -98,19 +106,19 @@ const getActivityData = async (date) => {
98
106
  }
99
107
  };
100
108
 
101
- const getDateList = async (date) => {
109
+ const getDateList = async (date: string) => {
102
110
  if (props.getDateListRequest) {
103
- props.getDateListRequest(date, group.value || '').then(res => {
111
+ props.getDateListRequest(date, group.value || '').then((res: string[]) => {
104
112
  dateList.value = res;
105
113
  });
106
114
  }
107
115
  if (props.getEventsDatesRequest) {
108
- props.getEventsDatesRequest(date).then(res => {
116
+ props.getEventsDatesRequest(date).then((res: string[]) => {
109
117
  eventsDates.value = res;
110
118
  });
111
119
  }
112
120
  if (props.getSummitDatesRequest) {
113
- props.getSummitDatesRequest(date).then(res => {
121
+ props.getSummitDatesRequest(date).then((res: string[]) => {
114
122
  summitDates.value = res;
115
123
  });
116
124
  }
@@ -124,12 +132,12 @@ const paramGetDaysData = async (params: { date: string; type: string }) => {
124
132
  return;
125
133
  }
126
134
  try {
127
- const res = await props.getMeetingListRequest(params.date, group.value, '');
135
+ const res: MeetingItemT[] = await props.getMeetingListRequest(params.date, group.value, '');
128
136
  meetingData.value = res.map((v) => {
129
137
  return {
130
138
  ...v,
131
139
  time: `${ v.start }-${ v.end }`,
132
- type: 'meeting',
140
+ type: CalendarDataType.MEETING,
133
141
  date: v.date || params.date,
134
142
  };
135
143
  }).sort((a: any, b: any) => {
@@ -146,7 +154,7 @@ const renderData = computed(() => {
146
154
  ...eventsData.value.filter(v => (!dayjs(v.start_date).isAfter(dayjs(currentDay.value)) && !dayjs(currentDay.value).isAfter(dayjs(v.end_date))) || v.dates?.includes(currentDay.value)),
147
155
  ...summitData.value.filter(v => v.dates?.includes(currentDay.value)),
148
156
  ].filter((v) => {
149
- if (tabType.value === 'all') {
157
+ if (tabType.value === CalendarDataType.ALL) {
150
158
  return true;
151
159
  }
152
160
  return v.type === tabType.value;
@@ -228,13 +236,17 @@ const watchChange = (element: HTMLElement) => {
228
236
  });
229
237
  };
230
238
 
231
- onMounted(() => {
239
+ const getCalendarHeight = async () => {
232
240
  // 设置右侧 日程列表高度
233
241
  const tbody = document.querySelector('.calendar-body .el-calendar__body') as HTMLElement;
234
242
  if (tbody) {
235
243
  watchChange(tbody);
236
244
  calendarHeight.value = `${ tbody.offsetHeight - 2 }px`;
237
245
  }
246
+ };
247
+
248
+ onMounted(() => {
249
+ getCalendarHeight();
238
250
  getDateData();
239
251
  });
240
252
 
@@ -374,8 +386,10 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
374
386
  </div>
375
387
 
376
388
  <div>
377
- <OScroller class="meeting-list" show-type="hover" size="small">
378
- <OMeetingCalendarList :list="renderData" :groupType="groupType">
389
+ <OScroller class="meeting-list" show-type="hover" size="small" :style="{
390
+ '--height': calendarHeight
391
+ }">
392
+ <OMeetingCalendarList :list="renderData as unknown as MeetingItemT[]" :groupType="groupType">
379
393
  <template #empty>
380
394
  <slot name="empty"></slot>
381
395
  </template>
@@ -401,20 +415,6 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
401
415
  width: 100%;
402
416
  }
403
417
 
404
- .calendar-header {
405
- display: flex;
406
- align-items: center;
407
- justify-content: flex-end;
408
- gap: var(--o-gap-5);
409
- margin-bottom: var(--o-gap-5);
410
- @include respond-to('<=pad_v') {
411
- flex-direction: column-reverse;
412
- justify-content: center;
413
- gap: var(--o-gap-2);
414
- margin-bottom: var(--o-gap-3);
415
- }
416
- }
417
-
418
418
  .calendar-body {
419
419
  display: flex;
420
420
  border-radius: var(--o-radius-xs);
@@ -751,12 +751,6 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
751
751
  }
752
752
  }
753
753
  }
754
-
755
- .prev, .next {
756
- .el-calendar-day {
757
- color: var(--o-color-info3);
758
- }
759
- }
760
754
  }
761
755
 
762
756
  .detail-list {
@@ -842,7 +836,6 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
842
836
  justify-content: center;
843
837
  align-items: flex-end;
844
838
  height: 60px;
845
- border-bottom: 1px solid var(--o-color-control4);
846
839
  }
847
840
 
848
841
  .o-tab {
@@ -878,19 +871,20 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
878
871
  .o-tab-nav-anchor {
879
872
  .o-tab-nav-anchor-line {
880
873
  width: 100%;
874
+ @include respond-to('<=pad_v') {
875
+ width: 16px;
876
+ }
881
877
  }
882
878
  }
883
879
  }
884
880
  }
885
881
 
886
882
  .meeting-list {
887
- height: v-bind('calendarHeight');
883
+ height: var(--height);
888
884
  @include respond-to('<=pad_v') {
889
885
  height: auto;
890
886
  }
891
887
  }
892
-
893
888
  }
894
-
895
889
  }
896
890
  </style>