@opendesign-plus-test/components 0.0.1-rc.33 → 0.0.1-rc.35

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 (30) hide show
  1. package/dist/chunk-OElCookieNotice.cjs.js +1 -1
  2. package/dist/chunk-OElCookieNotice.es.js +339 -150
  3. package/dist/components/activity/composables/useActivityConfig.d.ts +17 -0
  4. package/dist/components/activity/config.d.ts +0 -14
  5. package/dist/components/meeting/composables/useMeetingConfig.d.ts +14 -0
  6. package/dist/components/meeting/config.d.ts +1 -16
  7. package/dist/components/meeting/types.d.ts +1 -0
  8. package/dist/components/meeting/utils.d.ts +1 -15
  9. package/dist/components.cjs.js +40 -40
  10. package/dist/components.css +1 -1
  11. package/dist/components.es.js +11386 -11389
  12. package/package.json +3 -3
  13. package/src/components/activity/OActivityApproval.vue +47 -38
  14. package/src/components/activity/OActivityForm.vue +51 -50
  15. package/src/components/activity/OMyActivityCalendar.vue +46 -36
  16. package/src/components/activity/composables/useActivityConfig.ts +141 -0
  17. package/src/components/activity/config.ts +1 -130
  18. package/src/components/meeting/OMeetingCalendar.vue +7 -9
  19. package/src/components/meeting/OMeetingForm.vue +11 -18
  20. package/src/components/meeting/OMyMeetingCalendar.vue +4 -8
  21. package/src/components/meeting/OSigMeetingCalendar.vue +3 -5
  22. package/src/components/meeting/components/OMeetingCalendarList.vue +7 -6
  23. package/src/components/meeting/components/OMeetingDetail.vue +33 -28
  24. package/src/components/meeting/components/OSigMeetingAside.vue +3 -1
  25. package/src/components/meeting/composables/useMeetingConfig.ts +111 -0
  26. package/src/components/meeting/config.ts +58 -120
  27. package/src/components/meeting/types.ts +1 -0
  28. package/src/components/meeting/utils.ts +69 -122
  29. package/src/i18n/en.ts +97 -0
  30. package/src/i18n/zh.ts +92 -0
@@ -6,19 +6,17 @@ import IconTips from '~icons/components/icon-tips.svg';
6
6
  import OSigMeetingAside from './components/OSigMeetingAside.vue';
7
7
  import { CalendarDataType, MeetingItemT } from './types.ts';
8
8
  import { useScreen } from '@opendesign-plus/composables';
9
- import { MEETING_TABS } from './config.ts';
9
+ import { useMeetingConfig } from './composables/useMeetingConfig';
10
10
  import OMeetingCalendarList from '@/components/meeting/components/OMeetingCalendarList.vue';
11
- import { useI18n } from '@/i18n';
12
11
 
13
12
  const props = defineProps<{
14
- //sig name
15
13
  sigName: String;
16
14
  getMeetingListRequest: any;
17
15
  getDateListRequest: any;
18
16
  getEventsListRequest: any;
19
17
  dates: String[];
20
18
  }>();
21
- const { t } = useI18n();
19
+ const { t, meetingTabs } = useMeetingConfig();
22
20
  const { lePadV } = useScreen();
23
21
  const selectDate = ref<string>('');
24
22
 
@@ -257,7 +255,7 @@ onMounted(() => {
257
255
  </OPopover>
258
256
  </div>
259
257
  <OTab v-model="tabType" @change="selectTab" :line="false">
260
- <OTabPane v-for="item in MEETING_TABS.slice(0, -1)" :key="item.value" :value="item.value">
258
+ <OTabPane v-for="item in meetingTabs.slice(0, -1)" :key="item.value" :value="item.value">
261
259
  <template #nav>
262
260
  <OIcon>
263
261
  <component :is="item.icon" />
@@ -11,11 +11,12 @@ import IconEvent from '~icons/meeting/icon-event.svg';
11
11
  import IconSummit from '~icons/meeting/icon-summit.svg';
12
12
  import IconMeeting from '~icons/meeting/icon-meet.svg';
13
13
  import IconChevronRight from '~icons/components/icon-chevron-right.svg';
14
- import { CYCLE_TYPE_OPTIONS, INTERVAL_DAY, INTERVAL_MONTH, INTERVAL_WEEK } from '../config.ts';
14
+ import { INTERVAL_DAY, INTERVAL_MONTH, INTERVAL_WEEK } from '../config.ts';
15
+ import { formatDate } from '../utils.ts';
16
+ import { useMeetingConfig } from '../composables/useMeetingConfig';
17
+ import { useActivityConfig } from '@/components/activity/composables/useActivityConfig';
15
18
 
16
- import { formatDate, getConfig, getPointStr } from '../utils.ts';
17
- import { useI18n } from '@/i18n';
18
- import { acticityTypeMap } from '@/components/activity/config.ts';
19
+ const { activityTypeMap } = useActivityConfig();
19
20
 
20
21
  const props = withDefaults(defineProps<{
21
22
  list: MeetingItemT[];
@@ -23,7 +24,7 @@ const props = withDefaults(defineProps<{
23
24
  }>(), {
24
25
  list: () => [],
25
26
  });
26
- const { t, locale } = useI18n();
27
+ const { t, locale, getConfig, getPointStr } = useMeetingConfig();
27
28
  const detailRefs = ref([]);
28
29
  const message = useMessage();
29
30
  const copyInfo = async (idx) => {
@@ -86,7 +87,7 @@ const computedList = computed(() => {
86
87
  const type = v.type;
87
88
  let dateRange = '';
88
89
  if (['activity'].includes(type)) {
89
- let activity_type = acticityTypeMap.get(v.activity_type)?.label;
90
+ let activity_type = activityTypeMap.value.get(v.activity_type)?.label;
90
91
  if (v.end_date === v.start_date) {
91
92
  return {
92
93
  ...v,
@@ -1,18 +1,18 @@
1
1
  <script setup lang="ts">
2
2
  import { OLink } from '@opensig/opendesign';
3
3
  import { computed, ref } from 'vue';
4
- import { CalendarDataType, MeetingItemT } from '@/components/meeting/types.ts';
4
+ import { CalendarDataType, MeetingItemT } from '../types.ts';
5
5
  import MoreText from '@/components/common/MoreText.vue';
6
- import { Locales, useI18n } from '@/i18n';
7
- import { formatDate, getPlatformLabel } from '@/components/meeting/utils.ts';
6
+ import { formatDate } from '@/components/meeting/utils.ts';
7
+ import { useMeetingConfig } from '../composables/useMeetingConfig';
8
8
 
9
9
  const props = defineProps<{
10
10
  data: MeetingItemT;
11
11
  from?: string;
12
12
  show: boolean;
13
13
  }>();
14
- const { t, locale } = useI18n();
15
- const isZh = computed(() => locale.value === Locales.ZH);
14
+ const { t, getPlatformLabel } = useMeetingConfig();
15
+
16
16
  // 会议详情配置
17
17
  const infoList = computed(() =>
18
18
  [
@@ -28,28 +28,33 @@ const infoList = computed(() =>
28
28
  );
29
29
 
30
30
 
31
- const activityInfoList = computed(() =>
32
- [
33
- { label: '起始日期', key: 'start_date_time' },
34
- { label: '结束日期', key: 'end_date_time' },
35
- { label: '报名截止时间', key: 'register_end_date' },
36
- { label: '活动地点', key: 'address' },
37
- { label: '活动详情地址', key: 'content_url', isLink: true },
38
- { label: '活动审批人', key: 'approver' },
39
- { label: '审核备注', key: 'approve_record', isRecord: true },
40
- ].slice(0, props.from === 'home' ? 4 : 7),
41
- );
42
- const activityInfoApprovalList = computed(() => [
43
- { label: '活动类型', key: 'activity_type', isType: true },
44
- { label: '活动地点', key: 'address' },
45
- { label: '起始日期', key: 'start_date_time' },
46
- { label: '结束日期', key: 'end_date_time' },
47
- { label: '报名截止时间', key: 'register_end_date' },
48
- { label: '报名网址', key: 'register_url', isLink: true },
49
- { label: '活动详情地址', key: 'content_url', isLink: true },
50
- { label: '活动审批人', key: 'approver' },
51
- { label: '审核备注', key: 'approve_record', isRecord: true },
52
- ]);
31
+ const activityInfoList = computed(() => {
32
+ const isLive = props.data.live_url?.length > 0;
33
+ return [
34
+ { label: t('meeting.activityDetail2'), key: 'agenda', ellipsis: true },
35
+ { label: t('meeting.startDate'), key: 'start_date_time' },
36
+ { label: t('meeting.endDate'), key: 'end_date_time' },
37
+ { label: t('meeting.registrationDeadline'), key: 'register_end_date' },
38
+ { label: isLive ? t('meeting.livePlatform') : t('meeting.activityAddress'), key: 'address' },
39
+ { label: t('meeting.activityDetailUrl'), key: 'content_url', isLink: true },
40
+ { label: t('meeting.activityApprover'), key: 'approver' },
41
+ { label: t('meeting.reviewNotesLabel'), key: 'approve_record', isRecord: true },
42
+ ].slice(0, props.from === 'home' ? 5 : 8);
43
+ });
44
+ const activityInfoApprovalList = computed(() => {
45
+ const isLive = props.data.live_url?.length > 0;
46
+ return [
47
+ { label: t('meeting.activityType'), key: 'activity_type', isType: true },
48
+ { label: isLive ? t('meeting.livePlatform') : t('meeting.activityAddress'), key: 'address' },
49
+ { label: t('meeting.startDate'), key: 'start_date_time' },
50
+ { label: t('meeting.endDate'), key: 'end_date_time' },
51
+ { label: t('meeting.registrationDeadline'), key: 'register_end_date' },
52
+ { label: t('meeting.registrationUrl'), key: 'register_url', isLink: true },
53
+ { label: t('meeting.activityDetailUrl'), key: 'content_url', isLink: true },
54
+ { label: t('meeting.activityApprover'), key: 'approver' },
55
+ { label: t('meeting.reviewNotesLabel'), key: 'approve_record', isRecord: true },
56
+ ];
57
+ });
53
58
 
54
59
  const columns = computed(() => {
55
60
  if (props.data.type === CalendarDataType.ACTIVITY || props.data.type === CalendarDataType.EVENTS) {
@@ -116,7 +121,7 @@ defineExpose({ copyInfo });
116
121
  <p v-for="re in data[info.key]" :key="re.create_time" class="value">
117
122
  {{ re.reason }}&nbsp;&nbsp;
118
123
  {{ formatDate(re.create_time, 'YYYY/MM/DD HH:mm:ss') }}
119
- 审核{{ re.action === 1 ? '通过' : '驳回' }}
124
+ {{ re.action === 1 ? t('meeting.approveReview') : t('meeting.rejectReview') }}
120
125
  </p>
121
126
  </div>
122
127
  </template>
@@ -1,9 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { OIcon, OIconArrowLeft, OIconArrowRight } from '@opensig/opendesign';
3
3
  import IconMeetinging from '~icons/meeting/icon-meet.svg';
4
- import { getConfig } from '@/components/meeting/utils.ts';
4
+ import { useMeetingConfig } from '@/components/meeting/composables/useMeetingConfig';
5
5
  import { CalendarDataType } from '@/components/meeting';
6
6
 
7
+ const { getConfig } = useMeetingConfig();
8
+
7
9
  const props = defineProps<{
8
10
  data: any[];
9
11
  current: number;
@@ -0,0 +1,111 @@
1
+ import { computed } from 'vue';
2
+ import dayjs from 'dayjs';
3
+ import { useI18n } from '@/i18n';
4
+ import IconAll from '~icons/meeting/icon-all.svg';
5
+ import IconEvent from '~icons/meeting/icon-event.svg';
6
+ import IconMeeting from '~icons/meeting/icon-meet.svg';
7
+ import IconSummit from '~icons/meeting/icon-summit.svg';
8
+ import { CalendarDataType, meetingTabT, OptionItemT } from '../types';
9
+ import { INTERVAL_DAY, INTERVAL_MONTH, INTERVAL_WEEK, TYPE_COLOR_MAP } from '../config';
10
+
11
+ export const useMeetingConfig = () => {
12
+ const { t, locale } = useI18n();
13
+
14
+ const meetingTabs = computed<meetingTabT[]>(() => [
15
+ { label: t('meeting.meetingTypeAll'), value: CalendarDataType.ALL, icon: IconAll },
16
+ { label: t('meeting.meetingTypeMeet'), value: CalendarDataType.MEETING, icon: IconMeeting, color: TYPE_COLOR_MAP.meeting, zIndex: 3 },
17
+ { label: t('meeting.meetingTypeEvents'), value: CalendarDataType.EVENTS, icon: IconEvent, color: TYPE_COLOR_MAP.events, zIndex: 2 },
18
+ { label: t('meeting.meetingTypeSummit'), value: CalendarDataType.SUMMIT, icon: IconSummit, color: TYPE_COLOR_MAP.summit, zIndex: 1 },
19
+ ]);
20
+
21
+ const cycleTypeOptions0 = computed<OptionItemT[]>(() => [
22
+ { label: t('meeting.day0'), value: INTERVAL_DAY, max: 7 },
23
+ { label: t('meeting.week0'), value: INTERVAL_WEEK, max: 2 },
24
+ { label: t('meeting.month0'), value: INTERVAL_MONTH, max: 1 },
25
+ ]);
26
+
27
+ const cycleTypeOptions = computed<OptionItemT[]>(() => [
28
+ { label: t('meeting.day'), value: INTERVAL_DAY, max: 7 },
29
+ { label: t('meeting.week'), value: INTERVAL_WEEK, max: 2 },
30
+ { label: t('meeting.month'), value: INTERVAL_MONTH, max: 1 },
31
+ ]);
32
+
33
+ const weekDay = computed(() => [
34
+ t('meeting.sunday'),
35
+ t('meeting.monday'),
36
+ t('meeting.tuesday'),
37
+ t('meeting.wednesday'),
38
+ t('meeting.thursday'),
39
+ t('meeting.friday'),
40
+ t('meeting.saturday'),
41
+ ]);
42
+
43
+ const intervalWeekOptions = computed(() => {
44
+ const list: OptionItemT[] = [];
45
+ for (let i = 1; i <= 7; i++) {
46
+ const idx = i % 7;
47
+ list.push({ value: idx, label: weekDay.value[idx] });
48
+ }
49
+ return list;
50
+ });
51
+
52
+ const getPointStr = (cycleType: number, points: number[]) => {
53
+ if (cycleType === INTERVAL_WEEK) {
54
+ return points
55
+ .sort((a, b) => {
56
+ const aIdx = intervalWeekOptions.value.findIndex((v) => v.value === a);
57
+ const bIdx = intervalWeekOptions.value.findIndex((v) => v.value === b);
58
+ return aIdx - bIdx;
59
+ })
60
+ .map((point: number) => {
61
+ const opt = intervalWeekOptions.value.find((v) => v.value === point);
62
+ return opt?.label || String(point);
63
+ })
64
+ .join(t('meeting.cycleSplit'));
65
+ }
66
+ if (cycleType === INTERVAL_MONTH) {
67
+ return points.join(t('meeting.cycleSplit'));
68
+ }
69
+ return '';
70
+ };
71
+
72
+ const getConfig = (val: CalendarDataType, key: keyof meetingTabT): string => {
73
+ let value = val;
74
+ if (val === CalendarDataType.ACTIVITY) {
75
+ value = CalendarDataType.EVENTS;
76
+ }
77
+ const find: meetingTabT | undefined = meetingTabs.value.find(v => v.value === value);
78
+ return find?.[key] || '';
79
+ };
80
+
81
+ const getPlatformLabel = (platform: string) => {
82
+ switch (platform) {
83
+ case 'WELINK':
84
+ return 'WeLink';
85
+ case 'ZOOM':
86
+ return 'Zoom';
87
+ case 'TENCENT':
88
+ return locale.value === 'zh' ? '腾讯会议' : 'Tencent';
89
+ default:
90
+ return platform;
91
+ }
92
+ };
93
+
94
+ const getWeekFromDate = (date: string | Date) => {
95
+ return weekDay.value[dayjs(date).day()];
96
+ };
97
+
98
+ return {
99
+ t,
100
+ locale,
101
+ meetingTabs,
102
+ cycleTypeOptions0,
103
+ cycleTypeOptions,
104
+ weekDay,
105
+ intervalWeekOptions,
106
+ getPointStr,
107
+ getConfig,
108
+ getPlatformLabel,
109
+ getWeekFromDate,
110
+ };
111
+ };
@@ -1,121 +1,59 @@
1
- import IconAll from '~icons/meeting/icon-all.svg';
2
- import IconEvent from '~icons/meeting/icon-event.svg';
3
- import IconMeeting from '~icons/meeting/icon-meet.svg';
4
- import IconSummit from '~icons/meeting/icon-summit.svg';
5
- import { useI18n } from '@/i18n';
6
- import { CalendarDataType, meetingTabT } from './types.ts';
7
-
8
- const { t } = useI18n();
9
-
10
- const getMeetingColor = () => {
11
- if (typeof document !== 'undefined') {
12
- const deepBlue = getComputedStyle(document.documentElement)
13
- .getPropertyValue('--o-deep-blue-6')?.trim();
14
- if (deepBlue) {
15
- return 'rgba(var(--o-deep-blue-6))';
16
- }
17
- }
18
- return 'var(--o-color-primary1)';
19
- };
20
-
21
- export const TYPE_COLOR_MAP = {
22
- summit: 'rgba(var(--o-orange-6))',
23
- events: 'rgba(var(--o-cyan-6))',
24
- meeting: getMeetingColor(),
1
+ import { CalendarDataType, meetingTabT } from './types.ts';
2
+ import IconAll from '~icons/meeting/icon-all.svg';
3
+ import IconEvent from '~icons/meeting/icon-event.svg';
4
+ import IconMeeting from '~icons/meeting/icon-meet.svg';
5
+ import IconSummit from '~icons/meeting/icon-summit.svg';
6
+
7
+ const getMeetingColor = () => {
8
+ if (typeof document !== 'undefined') {
9
+ const deepBlue = getComputedStyle(document.documentElement)
10
+ .getPropertyValue('--o-deep-blue-6')?.trim();
11
+ if (deepBlue) {
12
+ return 'rgba(var(--o-deep-blue-6))';
13
+ }
14
+ }
15
+ return 'var(--o-color-primary1)';
25
16
  };
26
- export const MEETING_TABS: meetingTabT[] = [
27
- {
28
- label: t('meeting.meetingTypeAll'),
29
- value: CalendarDataType.ALL,
30
- icon: IconAll,
31
- },
32
- {
33
- label: t('meeting.meetingTypeMeet'),
34
- value: CalendarDataType.MEETING,
35
- icon: IconMeeting,
36
- color: TYPE_COLOR_MAP.meeting,
37
- zIndex: 3,
38
- },
39
- {
40
- label: t('meeting.meetingTypeEvents'),
41
- value: CalendarDataType.EVENTS,
42
- icon: IconEvent,
43
- color: TYPE_COLOR_MAP.events,
44
- zIndex: 2,
45
- },
46
- {
47
- label: t('meeting.meetingTypeSummit'),
48
- value: CalendarDataType.SUMMIT,
49
- icon: IconSummit,
50
- color: TYPE_COLOR_MAP.summit,
51
- zIndex: 1,
52
- },
53
- ];
54
-
55
-
56
- export const INTERVAL_DAY = 0;
57
- export const INTERVAL_WEEK = 1;
58
- export const INTERVAL_MONTH = 2;
59
-
60
- export const CYCLE_TYPE_OPTIONS0 = [
61
- {
62
- label: t('meeting.day0'),
63
- value: INTERVAL_DAY,
64
- max: 7,
65
- },
66
- {
67
- label: t('meeting.week0'),
68
- value: INTERVAL_WEEK,
69
- max: 2,
70
- },
71
- {
72
- label: t('meeting.month0'),
73
- value: INTERVAL_MONTH,
74
- max: 1,
75
- },
76
- ];
77
- export const CYCLE_TYPE_OPTIONS = [
78
- {
79
- label: t('meeting.day'),
80
- value: INTERVAL_DAY,
81
- max: 7,
82
- },
83
- {
84
- label: t('meeting.week'),
85
- value: INTERVAL_WEEK,
86
- max: 2,
87
- },
88
- {
89
- label: t('meeting.month'),
90
- value: INTERVAL_MONTH,
91
- max: 1,
92
- },
93
- ];
94
- export const WEEKDAY = [
95
- t('meeting.sunday'),
96
- t('meeting.monday'),
97
- t('meeting.tuesday'),
98
- t('meeting.wednesday'),
99
- t('meeting.thursday'),
100
- t('meeting.friday'),
101
- t('meeting.saturday'),
102
- ];
103
-
104
- const getWeekOptions = () => {
105
- const list = [];
106
- for (let i = 1; i <= 7; i++) {
107
- const idx = i % 7;
108
- list.push({
109
- value: idx,
110
- label: WEEKDAY[idx],
111
- });
112
- }
113
- return list;
114
- };
115
-
116
- export const INTERVAL_WEEK_OPTIONS = getWeekOptions();
117
-
118
-
119
- export const EMAIL_REGEX = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
120
-
121
- export const PROGRESS_COLORS = ['var(--o-color-primary1)', 'var(--o-color-warning1)', 'var(--o-color-success1)'];
17
+
18
+ export const TYPE_COLOR_MAP = {
19
+ summit: 'rgba(var(--o-orange-6))',
20
+ events: 'rgba(var(--o-cyan-6))',
21
+ meeting: getMeetingColor(),
22
+ };
23
+
24
+ export const INTERVAL_DAY = 0;
25
+ export const INTERVAL_WEEK = 1;
26
+ export const INTERVAL_MONTH = 2;
27
+
28
+ export const EMAIL_REGEX = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
29
+
30
+ export const PROGRESS_COLORS = ['var(--o-color-primary1)', 'var(--o-color-warning1)', 'var(--o-color-success1)'];
31
+
32
+ export const getMeetingTabs = (t: (key: string) => string): meetingTabT[] => [
33
+ {
34
+ label: t('meeting.meetingTypeAll'),
35
+ value: CalendarDataType.ALL,
36
+ icon: IconAll,
37
+ },
38
+ {
39
+ label: t('meeting.meetingTypeMeet'),
40
+ value: CalendarDataType.MEETING,
41
+ icon: IconMeeting,
42
+ color: TYPE_COLOR_MAP.meeting,
43
+ zIndex: 3,
44
+ },
45
+ {
46
+ label: t('meeting.meetingTypeEvents'),
47
+ value: CalendarDataType.EVENTS,
48
+ icon: IconEvent,
49
+ color: TYPE_COLOR_MAP.events,
50
+ zIndex: 2,
51
+ },
52
+ {
53
+ label: t('meeting.meetingTypeSummit'),
54
+ value: CalendarDataType.SUMMIT,
55
+ icon: IconSummit,
56
+ color: TYPE_COLOR_MAP.summit,
57
+ zIndex: 1,
58
+ },
59
+ ];
@@ -109,6 +109,7 @@ export interface MeetingItemT extends MeetingPostT {
109
109
  update_time: string;
110
110
  time: string; // 处理一下时间范围
111
111
  cycle_sub: any[];
112
+ live_url?: string;
112
113
  }
113
114
 
114
115
  export interface PageParamsT {