@opendesign-plus-test/components 0.0.1-rc.42 → 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.
- package/dist/chunk-OElCookieNotice.cjs.js +1 -1
- package/dist/chunk-OElCookieNotice.es.js +111 -111
- package/dist/components/OHeaderSearch.vue.d.ts +6 -10
- package/dist/components/OSourceCode.vue.d.ts +4 -6
- package/dist/components/activity/OActivityApproval.vue.d.ts +6 -10
- package/dist/components/activity/OActivityForm.vue.d.ts +3 -5
- package/dist/components/activity/OMyActivityCalendar.vue.d.ts +16 -24
- package/dist/components/activity/index.d.ts +14 -22
- package/dist/components/activity/types.d.ts +8 -1
- package/dist/components/events/config.d.ts +5 -18
- package/dist/components/events/types.d.ts +4 -1
- package/dist/components/header/OHeaderMobile.vue.d.ts +18 -11
- package/dist/components/header/components/HeaderNavMobile.vue.d.ts +4 -1
- package/dist/components/header/index.d.ts +12 -5
- package/dist/components/header/types.d.ts +4 -0
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +8 -12
- package/dist/components/meeting/OMeetingForm.vue.d.ts +3 -5
- package/dist/components/meeting/OMeetingPlayback.vue.d.ts +45 -0
- package/dist/components/meeting/OMyMeetingCalendar.vue.d.ts +16 -24
- package/dist/components/meeting/components/OMeetingCalendarList.vue.d.ts +1 -1
- package/dist/components/meeting/index.d.ts +786 -0
- package/dist/components/meeting/types.d.ts +82 -17
- package/dist/components/meeting/utils.d.ts +1 -1
- package/dist/components.cjs.js +38 -38
- package/dist/components.css +1 -1
- package/dist/components.es.js +6726 -6656
- package/package.json +2 -2
- package/src/components/OSourceCode.vue +8 -10
- package/src/components/activity/OActivityApproval.vue +28 -28
- package/src/components/activity/OActivityForm.vue +3 -3
- package/src/components/activity/OMyActivityCalendar.vue +40 -24
- package/src/components/activity/types.ts +8 -1
- package/src/components/common/MoreText.vue +1 -1
- package/src/components/common/ThFilter.vue +7 -7
- package/src/components/element-plus/OElCookieNotice.vue +1 -1
- package/src/components/events/OEventsList.vue +37 -10
- package/src/components/events/config.ts +1 -1
- package/src/components/events/types.ts +4 -1
- package/src/components/header/OHeaderMobile.vue +8 -1
- package/src/components/header/components/HeaderContent.vue +7 -3
- package/src/components/header/components/HeaderNavMobile.vue +5 -2
- package/src/components/header/types.ts +4 -0
- package/src/components/meeting/OMeetingCalendar.vue +39 -27
- package/src/components/meeting/OMeetingForm.vue +54 -35
- package/src/components/meeting/OMeetingPlayback.vue +4 -4
- package/src/components/meeting/OMyMeetingCalendar.vue +31 -20
- package/src/components/meeting/OSigMeetingCalendar.vue +29 -26
- package/src/components/meeting/components/OMeetingCalendarList.vue +22 -17
- package/src/components/meeting/components/OMeetingCalendarSelector.vue +10 -6
- package/src/components/meeting/components/OMeetingDetail.vue +30 -16
- package/src/components/meeting/components/OMeetingPlaybackVideo.vue +7 -7
- package/src/components/meeting/components/OSigMeetingAside.vue +2 -3
- package/src/components/meeting/types.ts +88 -17
- package/vite.config.ts +3 -2
|
@@ -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 {
|
|
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)
|
|
37
|
-
|
|
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 :
|
|
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:
|
|
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 {
|
|
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:
|
|
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 ===
|
|
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
|
-
|
|
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
|
-
|
|
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>
|
|
@@ -866,13 +880,11 @@ const checkSelectedDay = (type: CalendarDataType, date: string) => {
|
|
|
866
880
|
}
|
|
867
881
|
|
|
868
882
|
.meeting-list {
|
|
869
|
-
height:
|
|
883
|
+
height: var(--height);
|
|
870
884
|
@include respond-to('<=pad_v') {
|
|
871
885
|
height: auto;
|
|
872
886
|
}
|
|
873
887
|
}
|
|
874
|
-
|
|
875
888
|
}
|
|
876
|
-
|
|
877
889
|
}
|
|
878
890
|
</style>
|
|
@@ -14,18 +14,19 @@ import {
|
|
|
14
14
|
ORadioGroup,
|
|
15
15
|
OSelect,
|
|
16
16
|
OSwitch,
|
|
17
|
-
OTextarea,
|
|
17
|
+
OTextarea, RulesT,
|
|
18
18
|
useMessage,
|
|
19
19
|
} from '@opensig/opendesign';
|
|
20
20
|
import IconHelp from '~icons/meeting/icon-help.svg';
|
|
21
21
|
import IconTip from '~icons/meeting/icon-tip.svg';
|
|
22
|
-
import { MeetingFormPropsT, MeetingGroupType, MeetingPostT, OptionItemT } from './types';
|
|
22
|
+
import { CycleSubItemT, MeetingFormPropsT, MeetingGroupType, MeetingPostT, OptionItemT, PlatformT } from './types';
|
|
23
23
|
import dayjs from 'dayjs';
|
|
24
24
|
import { findLabelFromOptions, formatDateNumber, getDateNumber } from './utils';
|
|
25
25
|
import { EMAIL_REGEX, INTERVAL_DAY, INTERVAL_MONTH, INTERVAL_WEEK } from './config';
|
|
26
26
|
import OMeetingCalendarSelector from './components/OMeetingCalendarSelector.vue';
|
|
27
27
|
import { useScreen } from '@opendesign-plus/composables';
|
|
28
28
|
import { useMeetingConfig } from './composables/useMeetingConfig';
|
|
29
|
+
import { ValidatorResultT } from '@opensig/opendesign/lib/form/types';
|
|
29
30
|
|
|
30
31
|
const { t, locale, cycleTypeOptions0, intervalWeekOptions, getPlatformLabel } = useMeetingConfig();
|
|
31
32
|
|
|
@@ -43,11 +44,11 @@ const weekOptions = intervalWeekOptions;
|
|
|
43
44
|
const intervalTypeMax = computed(() => {
|
|
44
45
|
return findLabelFromOptions(form.value.cycle_type, cycleTypeOptions.value, 'max');
|
|
45
46
|
});
|
|
46
|
-
const initForm = {
|
|
47
|
+
const initForm: MeetingPostT = {
|
|
47
48
|
is_record: false,
|
|
48
49
|
agenda: '',
|
|
49
50
|
email_list: '',
|
|
50
|
-
platform: '',
|
|
51
|
+
platform: 'WELINK',
|
|
51
52
|
topic: '',
|
|
52
53
|
group_name: '',
|
|
53
54
|
etherpad: '',
|
|
@@ -62,10 +63,10 @@ const initForm = {
|
|
|
62
63
|
cycle_point: [],
|
|
63
64
|
};
|
|
64
65
|
const form = ref<MeetingPostT>(Object.assign({}, initForm) as unknown as MeetingPostT); // 表单数据
|
|
65
|
-
const formRef = ref(null); // 表单实例
|
|
66
|
+
const formRef = ref<any>(null); // 表单实例
|
|
66
67
|
const loading = ref(false); // 提交状态
|
|
67
68
|
// 表单校验规则
|
|
68
|
-
const rules = computed(() => {
|
|
69
|
+
const rules = computed<Record<string, RulesT[]>>(() => {
|
|
69
70
|
return {
|
|
70
71
|
topic: [
|
|
71
72
|
{ required: true, message: t('meeting.enterMeetingName') },
|
|
@@ -98,23 +99,36 @@ const rules = computed(() => {
|
|
|
98
99
|
}],
|
|
99
100
|
etherpad: [{ required: true, message: t('meeting.enterEtherpad') }],
|
|
100
101
|
date: [{ required: true, message: t('meeting.selectDate') }],
|
|
102
|
+
platform: [{ required: true, message: t('meeting.selectPlatform') }],
|
|
101
103
|
time: [
|
|
102
104
|
{
|
|
103
|
-
validator: (value:
|
|
105
|
+
validator: (value: any) => {
|
|
104
106
|
const { is_cycle, cycle_type, cycle_interval, cycle_point, date, date_range } = form.value;
|
|
105
107
|
if (is_cycle) {
|
|
106
|
-
const msg =
|
|
107
|
-
type: 'danger',
|
|
108
|
-
message: t('meeting.finishMeetingConfig'),
|
|
109
|
-
};
|
|
108
|
+
const msg = t('meeting.finishMeetingConfig');
|
|
110
109
|
if (cycle_type === INTERVAL_DAY) {
|
|
111
|
-
if (!cycle_interval)
|
|
110
|
+
if (!cycle_interval) {
|
|
111
|
+
return {
|
|
112
|
+
type: 'danger',
|
|
113
|
+
message: msg,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
112
116
|
}
|
|
113
117
|
if (cycle_type === INTERVAL_WEEK) {
|
|
114
|
-
if (!cycle_interval || !cycle_point?.length)
|
|
118
|
+
if (!cycle_interval || !cycle_point?.length) {
|
|
119
|
+
return {
|
|
120
|
+
type: 'danger',
|
|
121
|
+
message: msg,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
115
124
|
}
|
|
116
125
|
if (cycle_type === INTERVAL_MONTH) {
|
|
117
|
-
if (!cycle_interval || !cycle_point?.length)
|
|
126
|
+
if (!cycle_interval || !cycle_point?.length) {
|
|
127
|
+
return {
|
|
128
|
+
type: 'danger',
|
|
129
|
+
message: msg,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
118
132
|
}
|
|
119
133
|
if (!date_range?.length) {
|
|
120
134
|
return {
|
|
@@ -129,7 +143,7 @@ const rules = computed(() => {
|
|
|
129
143
|
const weeks = new Set();
|
|
130
144
|
while (!dayjs(start).isAfter(dayjs(end))) {
|
|
131
145
|
weeks.add(dayjs(start).day());
|
|
132
|
-
start = dayjs(start).add(1, 'day');
|
|
146
|
+
start = dayjs(start).add(1, 'day').format('YYYY-MM-DD');
|
|
133
147
|
}
|
|
134
148
|
if (cycle_point.every((point) => !weeks.has(point))) {
|
|
135
149
|
return {
|
|
@@ -142,7 +156,7 @@ const rules = computed(() => {
|
|
|
142
156
|
const days = new Set();
|
|
143
157
|
while (!dayjs(start).isAfter(dayjs(end))) {
|
|
144
158
|
days.add(dayjs(start).date());
|
|
145
|
-
start = dayjs(start).add(1, 'day');
|
|
159
|
+
start = dayjs(start).add(1, 'day').format('YYYY-MM-DD');
|
|
146
160
|
}
|
|
147
161
|
if (cycle_point.every((point) => !days.has(point))) {
|
|
148
162
|
return {
|
|
@@ -165,7 +179,7 @@ const rules = computed(() => {
|
|
|
165
179
|
message: t('meeting.selectMeetingTime'),
|
|
166
180
|
};
|
|
167
181
|
}
|
|
168
|
-
const arr = value.split('-').map((v) => v.split(':').map(Number));
|
|
182
|
+
const arr = value.split('-').map((v: string) => v.split(':').map(Number));
|
|
169
183
|
if (arr[0][0] > arr[1][0] || (arr[0][0] === arr[1][0] && arr[0][1] >= arr[1][1])) {
|
|
170
184
|
return {
|
|
171
185
|
type: 'danger',
|
|
@@ -173,8 +187,8 @@ const rules = computed(() => {
|
|
|
173
187
|
};
|
|
174
188
|
}
|
|
175
189
|
if (!form.value.is_cycle && form.value.date && form.value.start) {
|
|
176
|
-
const start =
|
|
177
|
-
if (
|
|
190
|
+
const start = `${ form.value.date } ${ form.value.start }`;
|
|
191
|
+
if (dayjs(start).isBefore(dayjs())) {
|
|
178
192
|
return {
|
|
179
193
|
type: 'danger',
|
|
180
194
|
message: t('meeting.startTimeBeforeEndTime'),
|
|
@@ -185,12 +199,11 @@ const rules = computed(() => {
|
|
|
185
199
|
triggers: ['blur', 'change'],
|
|
186
200
|
},
|
|
187
201
|
],
|
|
188
|
-
platform: [{ required: true, message: t('meeting.selectPlatform') }],
|
|
189
202
|
email_list: [
|
|
190
203
|
{
|
|
191
|
-
validator: (value:
|
|
204
|
+
validator: (value: any) => {
|
|
192
205
|
if (props.isEdit) {
|
|
193
|
-
return {};
|
|
206
|
+
return {} as unknown as ValidatorResultT;
|
|
194
207
|
}
|
|
195
208
|
const str = value.replaceAll(' ', '').replaceAll(',', ';') || '';
|
|
196
209
|
if (str.length) {
|
|
@@ -200,7 +213,7 @@ const rules = computed(() => {
|
|
|
200
213
|
message: t('meeting.emailTooLong'),
|
|
201
214
|
};
|
|
202
215
|
}
|
|
203
|
-
const list = str.split(';') || [];
|
|
216
|
+
const list: string[] = str.split(';') || [];
|
|
204
217
|
if (list.some((v) => !EMAIL_REGEX.test(v))) {
|
|
205
218
|
return {
|
|
206
219
|
type: 'danger',
|
|
@@ -233,7 +246,7 @@ const getSigOptions = async () => {
|
|
|
233
246
|
return;
|
|
234
247
|
}
|
|
235
248
|
const res = await props.getGroupsRequest();
|
|
236
|
-
sigOptions.value = res.map((v) => ({ label: v.group_name, value: v.group_name
|
|
249
|
+
sigOptions.value = res.map((v: OptionItemT) => ({ ...v, label: v.group_name, value: v.group_name }));
|
|
237
250
|
if (props.data) {
|
|
238
251
|
changeSig(form.value.group_name);
|
|
239
252
|
}
|
|
@@ -245,9 +258,9 @@ const getPlatformOptions = async () => {
|
|
|
245
258
|
return;
|
|
246
259
|
}
|
|
247
260
|
const res = await props.getPlatformsRequest();
|
|
248
|
-
typeOptions.value = res.map((v) => ({ label: getPlatformLabel(v), value: v }));
|
|
261
|
+
typeOptions.value = res.map((v: string) => ({ label: getPlatformLabel(v), value: v }));
|
|
249
262
|
if (!props.data) {
|
|
250
|
-
form.value.platform = typeOptions.value[0].value;
|
|
263
|
+
form.value.platform = typeOptions.value[0].value as unknown as PlatformT;
|
|
251
264
|
}
|
|
252
265
|
};
|
|
253
266
|
|
|
@@ -256,7 +269,7 @@ watch(
|
|
|
256
269
|
() => props.data,
|
|
257
270
|
(data) => {
|
|
258
271
|
if (data) {
|
|
259
|
-
const sub = data?.cycle_sub?.find((v) => v.sub_id === props.subId) || {};
|
|
272
|
+
const sub = data?.cycle_sub?.find((v) => v.sub_id === props.subId) || {} as unknown as CycleSubItemT;
|
|
260
273
|
const { mid, date, start, end, sub_id } = sub;
|
|
261
274
|
Object.assign(
|
|
262
275
|
form.value,
|
|
@@ -311,8 +324,8 @@ watch(
|
|
|
311
324
|
);
|
|
312
325
|
const cancel = () => {
|
|
313
326
|
form.value = Object.assign({}, initForm);
|
|
314
|
-
formRef.value
|
|
315
|
-
formRef.value
|
|
327
|
+
formRef.value?.clearValidate?.();
|
|
328
|
+
formRef.value?.resetFields?.();
|
|
316
329
|
emits('cancel');
|
|
317
330
|
};
|
|
318
331
|
|
|
@@ -331,7 +344,7 @@ const confirm = async () => {
|
|
|
331
344
|
try {
|
|
332
345
|
loading.value = true;
|
|
333
346
|
const valid = await formRef.value.validate();
|
|
334
|
-
if (valid.some((v) => !!v)) {
|
|
347
|
+
if (!valid || valid.some((v: any) => !!v)) {
|
|
335
348
|
return;
|
|
336
349
|
}
|
|
337
350
|
const {
|
|
@@ -359,7 +372,7 @@ const confirm = async () => {
|
|
|
359
372
|
group_name,
|
|
360
373
|
platform,
|
|
361
374
|
is_cycle,
|
|
362
|
-
} as MeetingPostT;
|
|
375
|
+
} as MeetingPostT as unknown as any;
|
|
363
376
|
if (is_cycle) {
|
|
364
377
|
params = {
|
|
365
378
|
...params,
|
|
@@ -396,8 +409,14 @@ const confirm = async () => {
|
|
|
396
409
|
is_notify: true,
|
|
397
410
|
});
|
|
398
411
|
} else {
|
|
399
|
-
const {
|
|
400
|
-
|
|
412
|
+
const {
|
|
413
|
+
email_list: _email_list,
|
|
414
|
+
platform: _platform,
|
|
415
|
+
group_name: _group_name,
|
|
416
|
+
etherpad: _etherpad,
|
|
417
|
+
...data
|
|
418
|
+
} = params;
|
|
419
|
+
await props?.editMeetingRequest(props.data?.id as unknown as number, {
|
|
401
420
|
...data,
|
|
402
421
|
is_notify: true,
|
|
403
422
|
});
|
|
@@ -423,14 +442,14 @@ onMounted(() => {
|
|
|
423
442
|
getPlatformOptions();
|
|
424
443
|
});
|
|
425
444
|
|
|
426
|
-
const changeSig = (sig) => {
|
|
445
|
+
const changeSig = (sig: any) => {
|
|
427
446
|
const find = sigOptions.value.find((v) => v.value === sig);
|
|
428
447
|
if (!props.isEdit) {
|
|
429
448
|
form.value.etherpad = find?.etherpad || '';
|
|
430
449
|
form.value.email_list = find?.email_list || '';
|
|
431
450
|
}
|
|
432
451
|
};
|
|
433
|
-
const disabledDate = (date) => {
|
|
452
|
+
const disabledDate = (date: Date) => {
|
|
434
453
|
return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
|
|
435
454
|
};
|
|
436
455
|
const changeTime = () => {
|
|
@@ -93,8 +93,8 @@ const getSubjectList = async (url: string) => {
|
|
|
93
93
|
subjectList.value = (json || []).map((z: SubjectItemT) => {
|
|
94
94
|
return {
|
|
95
95
|
...z,
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
startTimeNumber: transformTime(z.startTime),
|
|
97
|
+
endTimeNumber: transformTime(z.endTime),
|
|
98
98
|
};
|
|
99
99
|
});
|
|
100
100
|
};
|
|
@@ -244,8 +244,8 @@ onUnmounted(() => {
|
|
|
244
244
|
:data-start="sub.startTime"
|
|
245
245
|
:data-end="sub.endTime"
|
|
246
246
|
:style="{
|
|
247
|
-
'--start': (sub.
|
|
248
|
-
'--end': (sub.
|
|
247
|
+
'--start': (sub.startTimeNumber < 0 ? 0 : sub.startTimeNumber) / playerDuration,
|
|
248
|
+
'--end': (sub.endTimeNumber > playerDuration ? playerDuration : sub.endTimeNumber) / playerDuration,
|
|
249
249
|
background: getProgressColor(idx),
|
|
250
250
|
}"
|
|
251
251
|
></div>
|