@opendesign-plus-test/components 0.0.1-rc.28 → 0.0.1-rc.30
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 +74 -64
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +3 -9
- package/dist/components/meeting/OMeetingForm.vue.d.ts +2 -1
- package/dist/components/meeting/OMyMeetingCalendar.vue.d.ts +5 -1
- package/dist/components/meeting/components/OMeetingCalendarList.vue.d.ts +2 -1
- package/dist/components/meeting/types.d.ts +16 -0
- package/dist/components.cjs.js +39 -39
- package/dist/components.css +1 -1
- package/dist/components.es.js +7577 -7521
- package/package.json +1 -1
- package/src/components/activity/OActivityApproval.vue +3 -2
- package/src/components/activity/OActivityForm.vue +1 -1
- package/src/components/activity/OMyActivityCalendar.vue +7 -10
- package/src/components/activity/config.ts +2 -2
- package/src/components/meeting/OMeetingCalendar.vue +47 -26
- package/src/components/meeting/OMeetingForm.vue +142 -133
- package/src/components/meeting/OMyMeetingCalendar.vue +11 -10
- package/src/components/meeting/components/OMeetingCalendarList.vue +75 -41
- package/src/components/meeting/components/OMeetingDetail.vue +3 -3
- package/src/components/meeting/types.ts +18 -1
- package/src/i18n/en.ts +5 -0
- package/src/i18n/zh.ts +5 -0
package/package.json
CHANGED
|
@@ -168,7 +168,7 @@ const cancel = () => {
|
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
const confirmCancel = async () => {
|
|
171
|
-
if (
|
|
171
|
+
if (props.deleteActivityRequest && props.cancelActivityRequest) {
|
|
172
172
|
try {
|
|
173
173
|
loading.value = true;
|
|
174
174
|
if (cancelStatus.value === 1) {
|
|
@@ -181,7 +181,8 @@ const confirmCancel = async () => {
|
|
|
181
181
|
message.success({
|
|
182
182
|
content: `“${ currentRow.value?.title }”活动${ cancelText.value }成功`,
|
|
183
183
|
});
|
|
184
|
-
} catch {
|
|
184
|
+
} catch (err) {
|
|
185
|
+
console.log(err);
|
|
185
186
|
loading.value = false;
|
|
186
187
|
cancelVisible.value = false;
|
|
187
188
|
message.danger({
|
|
@@ -183,7 +183,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
183
183
|
}],
|
|
184
184
|
email_list: [{
|
|
185
185
|
validator: (value: string) => {
|
|
186
|
-
const str = value.replaceAll(' ', '') || '';
|
|
186
|
+
const str = value.replaceAll(' ', '').replaceAll(',', ';') || '';
|
|
187
187
|
if (str.length) {
|
|
188
188
|
if (str.length > 1020) {
|
|
189
189
|
return {
|
|
@@ -866,22 +866,23 @@ const deleteActions = computed<DialogActionT[]>(() => {
|
|
|
866
866
|
.el-calendar__body {
|
|
867
867
|
.el-calendar-table {
|
|
868
868
|
width: 100%;
|
|
869
|
-
tr {
|
|
870
|
-
background-color: color-mix(in srgb, var(--o-color-control2-light), transparent 60%) !important;
|
|
871
|
-
}
|
|
872
869
|
|
|
873
870
|
th {
|
|
874
871
|
text-align: center;
|
|
875
|
-
background-color: color-mix(in srgb, var(--o-color-control2-light), transparent 60%) !important;
|
|
876
872
|
border: none;
|
|
873
|
+
--o-color-control3-light: transparent;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
tr {
|
|
877
|
+
--o-color-fill2: transparent;
|
|
877
878
|
}
|
|
878
879
|
|
|
879
880
|
td {
|
|
880
|
-
background-color: color-mix(in srgb, var(--o-color-control2-light), transparent 60%) !important;
|
|
881
881
|
border: none;
|
|
882
882
|
text-align: center;
|
|
883
883
|
transition: none;
|
|
884
884
|
padding: 0;
|
|
885
|
+
background-color: transparent !important;
|
|
885
886
|
|
|
886
887
|
.el-calendar-day {
|
|
887
888
|
padding: 0;
|
|
@@ -1251,7 +1252,6 @@ const deleteActions = computed<DialogActionT[]>(() => {
|
|
|
1251
1252
|
align-items: flex-start;
|
|
1252
1253
|
gap: var(--o-gap-3);
|
|
1253
1254
|
width: 100%;
|
|
1254
|
-
margin-bottom: var(--o-gap-2);
|
|
1255
1255
|
@include respond-to('phone') {
|
|
1256
1256
|
flex-grow: 1;
|
|
1257
1257
|
width: 100%;
|
|
@@ -1359,6 +1359,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
|
|
|
1359
1359
|
align-items: center;
|
|
1360
1360
|
padding-left: calc(var(--o-gap-3) + var(--icon-size));
|
|
1361
1361
|
gap: var(--o-gap-4);
|
|
1362
|
+
margin-top: var(--o-gap-2);
|
|
1362
1363
|
width: 100%;
|
|
1363
1364
|
|
|
1364
1365
|
.o-link {
|
|
@@ -1369,10 +1370,6 @@ const deleteActions = computed<DialogActionT[]>(() => {
|
|
|
1369
1370
|
--link-color-active: var(--o-color-primary3);
|
|
1370
1371
|
}
|
|
1371
1372
|
|
|
1372
|
-
.o-link + .o-link {
|
|
1373
|
-
margin-left: var(--o-gap-section-6);
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
1373
|
.o-icon {
|
|
1377
1374
|
font-size: 16px;
|
|
1378
1375
|
}
|
|
@@ -102,14 +102,14 @@ export const approvalStatusMap = new Map([
|
|
|
102
102
|
[
|
|
103
103
|
'rejected',
|
|
104
104
|
{
|
|
105
|
-
label: '
|
|
105
|
+
label: '已驳回',
|
|
106
106
|
value: 'rejected',
|
|
107
107
|
},
|
|
108
108
|
],
|
|
109
109
|
[
|
|
110
110
|
'approved',
|
|
111
111
|
{
|
|
112
|
-
label: '
|
|
112
|
+
label: '已通过',
|
|
113
113
|
value: 'approved',
|
|
114
114
|
},
|
|
115
115
|
],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, nextTick, onMounted, ref, watch } from 'vue';
|
|
3
3
|
import {
|
|
4
|
-
isClient,
|
|
4
|
+
isClient,
|
|
5
5
|
OIcon,
|
|
6
6
|
OIconChevronLeft,
|
|
7
7
|
OIconChevronRight,
|
|
@@ -12,41 +12,34 @@ import {
|
|
|
12
12
|
OTabPane,
|
|
13
13
|
} from '@opensig/opendesign';
|
|
14
14
|
import dayjs from 'dayjs';
|
|
15
|
-
import { ElCalendar
|
|
15
|
+
import { ElCalendar } from 'element-plus';
|
|
16
16
|
import OMeetingCalendarList from './components/OMeetingCalendarList.vue';
|
|
17
|
-
import elZh from 'element-plus/es/locale/lang/zh-cn';
|
|
18
|
-
import elEn from 'element-plus/es/locale/lang/en';
|
|
19
17
|
import IconEvent from '~icons/meeting/icon-event.svg';
|
|
20
18
|
import IconSummit from '~icons/meeting/icon-summit.svg';
|
|
21
19
|
import IconMeeting from '~icons/meeting/icon-meet.svg';
|
|
22
20
|
import { Locales, useI18n } from '@/i18n';
|
|
23
21
|
import { MEETING_TABS } from './config';
|
|
24
|
-
import { CalendarDataType, GroupItemT } from './types.ts';
|
|
22
|
+
import { CalendarDataType, GroupItemT, MeetingCalendarPropsT, MeetingGroupType } from './types.ts';
|
|
25
23
|
import { formatDate, getConfig } from './utils.ts';
|
|
26
24
|
|
|
27
|
-
const props = withDefaults(defineProps<{
|
|
28
|
-
getDateListRequest: any;
|
|
29
|
-
getMeetingListRequest: any;
|
|
30
|
-
getSummitListRequest: any;
|
|
31
|
-
getEventsListRequest: any;
|
|
32
|
-
hiddenEvents?: boolean;
|
|
33
|
-
hiddenSummit?: boolean;
|
|
34
|
-
}>(), {
|
|
25
|
+
const props = withDefaults(defineProps<MeetingCalendarPropsT>(), {
|
|
35
26
|
getSummitListRequest: async () => [],
|
|
36
27
|
getEventsListRequest: async () => [],
|
|
37
28
|
hiddenEvents: false,
|
|
38
29
|
hiddenSummit: false,
|
|
30
|
+
groupType: MeetingGroupType.SIG,
|
|
39
31
|
});
|
|
40
32
|
|
|
41
33
|
const { t, locale } = useI18n();
|
|
42
34
|
const isEn = computed(() => locale.value === Locales.EN);
|
|
43
|
-
const isZh = computed(() => locale.value === Locales.ZH);
|
|
44
35
|
|
|
45
36
|
// -------------------- 获取存在会议的日期列表 --------------------
|
|
46
37
|
const latestDay = ref<string>(''); // 截止当天最新的活动日期
|
|
47
38
|
const dateList = ref([]);
|
|
48
39
|
const summitData = ref([]);
|
|
40
|
+
const summitDates = ref([]);
|
|
49
41
|
const eventsData = ref([]);
|
|
42
|
+
const eventsDates = ref([]);
|
|
50
43
|
const allDates = ref<string[]>([]);
|
|
51
44
|
const meetingData = ref([]);
|
|
52
45
|
// 日历展示时间限制
|
|
@@ -97,6 +90,8 @@ const getActivityData = async (date) => {
|
|
|
97
90
|
return {
|
|
98
91
|
...v,
|
|
99
92
|
type: 'activity',
|
|
93
|
+
start_date_time: `${ formatDate(v.start_date) } ${ v.start }`,
|
|
94
|
+
end_date_time: `${ formatDate(v.end_date) } ${ v.end }`,
|
|
100
95
|
};
|
|
101
96
|
});
|
|
102
97
|
} else {
|
|
@@ -106,9 +101,19 @@ const getActivityData = async (date) => {
|
|
|
106
101
|
|
|
107
102
|
const getDateList = async (date) => {
|
|
108
103
|
if (props.getDateListRequest) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
props.getDateListRequest(date).then(res => {
|
|
105
|
+
dateList.value = res;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (props.getEventsDatesRequest) {
|
|
109
|
+
props.getEventsDatesRequest(date).then(res => {
|
|
110
|
+
eventsDates.value = res;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (props.getSummitDatesRequest) {
|
|
114
|
+
props.getSummitDatesRequest(date).then(res => {
|
|
115
|
+
summitDates.value = res;
|
|
116
|
+
});
|
|
112
117
|
}
|
|
113
118
|
};
|
|
114
119
|
|
|
@@ -141,12 +146,11 @@ const paramGetDaysData = async (params: { date: string; type: string }) => {
|
|
|
141
146
|
}
|
|
142
147
|
};
|
|
143
148
|
|
|
144
|
-
|
|
145
149
|
const renderData = computed(() => {
|
|
146
150
|
return [
|
|
147
151
|
...meetingData.value.filter((v) => !sig.value || v.group_name === sig.value),
|
|
148
|
-
...eventsData.value.filter(v => v.dates
|
|
149
|
-
...summitData.value.filter(v => v.dates
|
|
152
|
+
...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)),
|
|
153
|
+
...summitData.value.filter(v => v.dates?.includes(currentDay.value)),
|
|
150
154
|
].filter((v) => {
|
|
151
155
|
if (tabType.value === 'all') {
|
|
152
156
|
return true;
|
|
@@ -161,7 +165,7 @@ const getDateData = async (day?: string) => {
|
|
|
161
165
|
getActivityData(date);
|
|
162
166
|
getDateList(date);
|
|
163
167
|
|
|
164
|
-
allDates.value = [...new Set([...dateList.value, ...
|
|
168
|
+
allDates.value = [...new Set([...dateList.value, ...summitDates.value, ...eventsDates.value])]
|
|
165
169
|
.flat()
|
|
166
170
|
.sort((a: string, b: string) => dayjs(a).isAfter(dayjs(b)) ? 1 : -1);
|
|
167
171
|
if (!day) {
|
|
@@ -263,6 +267,19 @@ const formatYearMonth = (date: string) => {
|
|
|
263
267
|
return date;
|
|
264
268
|
}
|
|
265
269
|
};
|
|
270
|
+
// 根据类型校验日历日期是否可选
|
|
271
|
+
const checkSelectedDay = (type: CalendarDataType, date: string) => {
|
|
272
|
+
if (type === CalendarDataType.MEETING) {
|
|
273
|
+
return ([CalendarDataType.ALL, CalendarDataType.MEETING].includes(tabType.value) && dateList.value.includes(date));
|
|
274
|
+
}
|
|
275
|
+
if (type === CalendarDataType.SUMMIT) {
|
|
276
|
+
return ([CalendarDataType.ALL, CalendarDataType.SUMMIT].includes(tabType.value) && summitDates.value.includes(date));
|
|
277
|
+
}
|
|
278
|
+
if (type === CalendarDataType.EVENTS) {
|
|
279
|
+
return ([CalendarDataType.ALL, CalendarDataType.EVENTS].includes(tabType.value) && eventsDates.value.includes(date));
|
|
280
|
+
}
|
|
281
|
+
return false;
|
|
282
|
+
};
|
|
266
283
|
</script>
|
|
267
284
|
<template>
|
|
268
285
|
<div class="o-meeting-calendar">
|
|
@@ -279,7 +296,11 @@ const formatYearMonth = (date: string) => {
|
|
|
279
296
|
<OIconChevronRight />
|
|
280
297
|
</OIcon>
|
|
281
298
|
</div>
|
|
282
|
-
<OSelect
|
|
299
|
+
<OSelect
|
|
300
|
+
v-model="sig"
|
|
301
|
+
:placeholder="groupType === MeetingGroupType.GROUP ? t('meeting.allGroups') : t('meeting.allSigs')"
|
|
302
|
+
clearable
|
|
303
|
+
>
|
|
283
304
|
<OOption v-for="t in sigOptions" :value="t.group_name" :key="t.group_name">{{ t.group_name }}</OOption>
|
|
284
305
|
</OSelect>
|
|
285
306
|
</div>
|
|
@@ -303,7 +324,7 @@ const formatYearMonth = (date: string) => {
|
|
|
303
324
|
zIndex: getConfig(CalendarDataType.MEETING, 'zIndex'),
|
|
304
325
|
backgroundColor: getConfig(CalendarDataType.MEETING, 'color')
|
|
305
326
|
}"
|
|
306
|
-
v-if="(
|
|
327
|
+
v-if="checkSelectedDay(CalendarDataType.MEETING, data.day)">
|
|
307
328
|
<IconMeeting />
|
|
308
329
|
</OIcon>
|
|
309
330
|
<OIcon
|
|
@@ -312,7 +333,7 @@ const formatYearMonth = (date: string) => {
|
|
|
312
333
|
zIndex: getConfig(CalendarDataType.EVENTS, 'zIndex'),
|
|
313
334
|
backgroundColor: getConfig(CalendarDataType.EVENTS, 'color')
|
|
314
335
|
}"
|
|
315
|
-
v-if="(
|
|
336
|
+
v-if="checkSelectedDay(CalendarDataType.EVENTS, data.day)">
|
|
316
337
|
<IconEvent />
|
|
317
338
|
</OIcon>
|
|
318
339
|
<OIcon
|
|
@@ -321,7 +342,7 @@ const formatYearMonth = (date: string) => {
|
|
|
321
342
|
zIndex: getConfig(CalendarDataType.SUMMIT, 'zIndex'),
|
|
322
343
|
backgroundColor: getConfig(CalendarDataType.SUMMIT, 'color')
|
|
323
344
|
}"
|
|
324
|
-
v-if="(
|
|
345
|
+
v-if="checkSelectedDay(CalendarDataType.SUMMIT, data.day)">
|
|
325
346
|
<IconSummit />
|
|
326
347
|
</OIcon>
|
|
327
348
|
</div>
|
|
@@ -354,7 +375,7 @@ const formatYearMonth = (date: string) => {
|
|
|
354
375
|
|
|
355
376
|
<div>
|
|
356
377
|
<OScroller class="meeting-list" show-type="hover" size="small">
|
|
357
|
-
<OMeetingCalendarList :list="renderData">
|
|
378
|
+
<OMeetingCalendarList :list="renderData" :groupType="groupType">
|
|
358
379
|
<template #empty>
|
|
359
380
|
<slot name="empty"></slot>
|
|
360
381
|
</template>
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
OForm,
|
|
7
7
|
OFormItem,
|
|
8
8
|
OIcon,
|
|
9
|
+
OIconTime,
|
|
9
10
|
OInput,
|
|
10
11
|
OOption,
|
|
11
12
|
OPopover,
|
|
@@ -14,19 +15,18 @@ import {
|
|
|
14
15
|
OSelect,
|
|
15
16
|
OSwitch,
|
|
16
17
|
OTextarea,
|
|
17
|
-
OIconTime,
|
|
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, MeetingPostT, OptionItemT } from './types';
|
|
22
|
+
import { MeetingFormPropsT, MeetingGroupType, MeetingPostT, OptionItemT } from './types';
|
|
23
23
|
import dayjs from 'dayjs';
|
|
24
24
|
import { findLabelFromOptions, formatDateNumber, getDateNumber, getPlatformLabel } from './utils';
|
|
25
25
|
import {
|
|
26
|
+
CYCLE_TYPE_OPTIONS0,
|
|
26
27
|
EMAIL_REGEX,
|
|
27
28
|
INTERVAL_DAY,
|
|
28
29
|
INTERVAL_MONTH,
|
|
29
|
-
CYCLE_TYPE_OPTIONS0,
|
|
30
30
|
INTERVAL_WEEK,
|
|
31
31
|
INTERVAL_WEEK_OPTIONS,
|
|
32
32
|
} from './config';
|
|
@@ -40,8 +40,9 @@ const props = withDefaults(defineProps<MeetingFormPropsT>(), {
|
|
|
40
40
|
isSub: false,
|
|
41
41
|
isEdit: false,
|
|
42
42
|
showBtns: true,
|
|
43
|
+
groupType: MeetingGroupType.SIG,
|
|
43
44
|
});
|
|
44
|
-
const message = useMessage();
|
|
45
|
+
const message = useMessage(null);
|
|
45
46
|
|
|
46
47
|
const cycleTypeOptions = ref(CYCLE_TYPE_OPTIONS0);
|
|
47
48
|
|
|
@@ -72,161 +73,166 @@ const form = ref<MeetingPostT>(Object.assign({}, initForm) as unknown as Meeting
|
|
|
72
73
|
const formRef = ref(null); // 表单实例
|
|
73
74
|
const loading = ref(false); // 提交状态
|
|
74
75
|
// 表单校验规则
|
|
75
|
-
const rules =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
agenda: [
|
|
90
|
-
{
|
|
91
|
-
validator: (value: string) => {
|
|
92
|
-
if (value.length > 4096) {
|
|
93
|
-
return {
|
|
94
|
-
type: 'danger',
|
|
95
|
-
message: t('meeting.meetingAgendaTooLong'),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
group_name: [{ required: true, message: t('meeting.selectSig') }],
|
|
102
|
-
etherpad: [{ required: true, message: t('meeting.enterEtherpad') }],
|
|
103
|
-
date: [{ required: true, message: t('meeting.selectDate') }],
|
|
104
|
-
time: [
|
|
105
|
-
{
|
|
106
|
-
validator: (value: string) => {
|
|
107
|
-
const { is_cycle, cycle_type, cycle_interval, cycle_point, date, date_range } = form.value;
|
|
108
|
-
if (is_cycle) {
|
|
109
|
-
const msg = {
|
|
110
|
-
type: 'danger',
|
|
111
|
-
message: t('meeting.finishMeetingConfig'),
|
|
112
|
-
};
|
|
113
|
-
if (cycle_type === INTERVAL_DAY) {
|
|
114
|
-
if (!cycle_interval) return msg;
|
|
115
|
-
}
|
|
116
|
-
if (cycle_type === INTERVAL_WEEK) {
|
|
117
|
-
if (!cycle_interval || !cycle_point?.length) return msg;
|
|
118
|
-
}
|
|
119
|
-
if (cycle_type === INTERVAL_MONTH) {
|
|
120
|
-
if (!cycle_interval || !cycle_point?.length) return msg;
|
|
76
|
+
const rules = computed(() => {
|
|
77
|
+
return {
|
|
78
|
+
topic: [
|
|
79
|
+
{ required: true, message: t('meeting.enterMeetingName') },
|
|
80
|
+
{
|
|
81
|
+
validator: (value: string) => {
|
|
82
|
+
if (value.length > 128) {
|
|
83
|
+
return {
|
|
84
|
+
type: 'danger',
|
|
85
|
+
message: t('meeting.meetingNameTooLong'),
|
|
86
|
+
};
|
|
121
87
|
}
|
|
122
|
-
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
agenda: [
|
|
92
|
+
{
|
|
93
|
+
validator: (value: string) => {
|
|
94
|
+
if (value.length > 4096) {
|
|
123
95
|
return {
|
|
124
96
|
type: 'danger',
|
|
125
|
-
message: t('meeting.
|
|
97
|
+
message: t('meeting.meetingAgendaTooLong'),
|
|
126
98
|
};
|
|
127
99
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
group_name: [{
|
|
104
|
+
required: true,
|
|
105
|
+
message: props.groupType === MeetingGroupType.GROUP ? t('meeting.selectGroup') : t('meeting.selectSig'),
|
|
106
|
+
}],
|
|
107
|
+
etherpad: [{ required: true, message: t('meeting.enterEtherpad') }],
|
|
108
|
+
date: [{ required: true, message: t('meeting.selectDate') }],
|
|
109
|
+
time: [
|
|
110
|
+
{
|
|
111
|
+
validator: (value: string) => {
|
|
112
|
+
const { is_cycle, cycle_type, cycle_interval, cycle_point, date, date_range } = form.value;
|
|
113
|
+
if (is_cycle) {
|
|
114
|
+
const msg = {
|
|
115
|
+
type: 'danger',
|
|
116
|
+
message: t('meeting.finishMeetingConfig'),
|
|
117
|
+
};
|
|
118
|
+
if (cycle_type === INTERVAL_DAY) {
|
|
119
|
+
if (!cycle_interval) return msg;
|
|
120
|
+
}
|
|
121
|
+
if (cycle_type === INTERVAL_WEEK) {
|
|
122
|
+
if (!cycle_interval || !cycle_point?.length) return msg;
|
|
136
123
|
}
|
|
137
|
-
if (
|
|
124
|
+
if (cycle_type === INTERVAL_MONTH) {
|
|
125
|
+
if (!cycle_interval || !cycle_point?.length) return msg;
|
|
126
|
+
}
|
|
127
|
+
if (!date_range?.length) {
|
|
138
128
|
return {
|
|
139
129
|
type: 'danger',
|
|
140
|
-
message:
|
|
130
|
+
message: t('meeting.selectMeetingDate'),
|
|
141
131
|
};
|
|
142
132
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
133
|
+
const NONE_MSG = t('meeting.invalidMeetingDuration');
|
|
134
|
+
let start = date_range[0];
|
|
135
|
+
const end = date_range[1];
|
|
136
|
+
if (cycle_type === INTERVAL_WEEK) {
|
|
137
|
+
const weeks = new Set();
|
|
138
|
+
while (!dayjs(start).isAfter(dayjs(end))) {
|
|
139
|
+
weeks.add(dayjs(start).day());
|
|
140
|
+
start = dayjs(start).add(1, 'day');
|
|
141
|
+
}
|
|
142
|
+
if (cycle_point.every((point) => !weeks.has(point))) {
|
|
143
|
+
return {
|
|
144
|
+
type: 'danger',
|
|
145
|
+
message: NONE_MSG,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
149
148
|
}
|
|
150
|
-
if (
|
|
149
|
+
if (cycle_type === INTERVAL_MONTH) {
|
|
150
|
+
const days = new Set();
|
|
151
|
+
while (!dayjs(start).isAfter(dayjs(end))) {
|
|
152
|
+
days.add(dayjs(start).date());
|
|
153
|
+
start = dayjs(start).add(1, 'day');
|
|
154
|
+
}
|
|
155
|
+
if (cycle_point.every((point) => !days.has(point))) {
|
|
156
|
+
return {
|
|
157
|
+
type: 'danger',
|
|
158
|
+
message: NONE_MSG,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
if (!date) {
|
|
151
164
|
return {
|
|
152
165
|
type: 'danger',
|
|
153
|
-
message:
|
|
166
|
+
message: t('meeting.selectMeetingDate'),
|
|
154
167
|
};
|
|
155
168
|
}
|
|
156
169
|
}
|
|
157
|
-
|
|
158
|
-
if (!date) {
|
|
159
|
-
return {
|
|
160
|
-
type: 'danger',
|
|
161
|
-
message: t('meeting.selectMeetingDate'),
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (!value?.trim()?.length) {
|
|
166
|
-
return {
|
|
167
|
-
type: 'danger',
|
|
168
|
-
message: t('meeting.selectMeetingTime'),
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
const arr = value.split('-').map((v) => v.split(':').map(Number));
|
|
172
|
-
if (arr[0][0] > arr[1][0] || (arr[0][0] === arr[1][0] && arr[0][1] >= arr[1][1])) {
|
|
173
|
-
return {
|
|
174
|
-
type: 'danger',
|
|
175
|
-
message: t('meeting.endTimeAfterStartTime'),
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
if (!form.value.is_cycle && form.value.date && form.value.start) {
|
|
179
|
-
const start = dayjs(`${ form.value.date } ${ form.value.start }`);
|
|
180
|
-
if (new Date(start).getTime() < new Date().getTime()) {
|
|
170
|
+
if (!value?.trim()?.length) {
|
|
181
171
|
return {
|
|
182
172
|
type: 'danger',
|
|
183
|
-
message: t('meeting.
|
|
173
|
+
message: t('meeting.selectMeetingTime'),
|
|
184
174
|
};
|
|
185
175
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
triggers: ['blur', 'change'],
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
platform: [{ required: true, message: t('meeting.selectPlatform') }],
|
|
192
|
-
email_list: [
|
|
193
|
-
{
|
|
194
|
-
validator: (value: string) => {
|
|
195
|
-
if (props.isEdit) {
|
|
196
|
-
return {};
|
|
197
|
-
}
|
|
198
|
-
const str = value.replaceAll(' ', '') || '';
|
|
199
|
-
if (str.length) {
|
|
200
|
-
if (str.length > 1020) {
|
|
176
|
+
const arr = value.split('-').map((v) => v.split(':').map(Number));
|
|
177
|
+
if (arr[0][0] > arr[1][0] || (arr[0][0] === arr[1][0] && arr[0][1] >= arr[1][1])) {
|
|
201
178
|
return {
|
|
202
179
|
type: 'danger',
|
|
203
|
-
message: t('meeting.
|
|
180
|
+
message: t('meeting.endTimeAfterStartTime'),
|
|
204
181
|
};
|
|
205
182
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
183
|
+
if (!form.value.is_cycle && form.value.date && form.value.start) {
|
|
184
|
+
const start = dayjs(`${ form.value.date } ${ form.value.start }`);
|
|
185
|
+
if (new Date(start).getTime() < new Date().getTime()) {
|
|
186
|
+
return {
|
|
187
|
+
type: 'danger',
|
|
188
|
+
message: t('meeting.startTimeBeforeEndTime'),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
212
191
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
192
|
+
},
|
|
193
|
+
triggers: ['blur', 'change'],
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
platform: [{ required: true, message: t('meeting.selectPlatform') }],
|
|
197
|
+
email_list: [
|
|
198
|
+
{
|
|
199
|
+
validator: (value: string) => {
|
|
200
|
+
if (props.isEdit) {
|
|
201
|
+
return {};
|
|
218
202
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
203
|
+
const str = value.replaceAll(' ', '').replaceAll(',', ';') || '';
|
|
204
|
+
if (str.length) {
|
|
205
|
+
if (str.length > 1020) {
|
|
206
|
+
return {
|
|
207
|
+
type: 'danger',
|
|
208
|
+
message: t('meeting.emailTooLong'),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const list = str.split(';') || [];
|
|
212
|
+
if (list.some((v) => !EMAIL_REGEX.test(v))) {
|
|
213
|
+
return {
|
|
214
|
+
type: 'danger',
|
|
215
|
+
message: t('meeting.emailInvalid'),
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
if (list.some((v) => v.length > 50)) {
|
|
219
|
+
return {
|
|
220
|
+
type: 'danger',
|
|
221
|
+
message: t('meeting.singleEmailTooLong'),
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (list.length > 20) {
|
|
225
|
+
return {
|
|
226
|
+
type: 'danger',
|
|
227
|
+
message: t('meeting.emailCountTooLong'),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
224
230
|
}
|
|
225
|
-
}
|
|
231
|
+
},
|
|
232
|
+
triggers: ['blur', 'change'],
|
|
226
233
|
},
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
],
|
|
234
|
+
],
|
|
235
|
+
};
|
|
230
236
|
});
|
|
231
237
|
|
|
232
238
|
const sigOptions = ref<OptionItemT[]>([]); // sig组选项列表
|
|
@@ -459,10 +465,13 @@ defineExpose({
|
|
|
459
465
|
style="width: 100%"
|
|
460
466
|
v-model="form.topic" />
|
|
461
467
|
</OFormItem>
|
|
462
|
-
<OFormItem
|
|
468
|
+
<OFormItem
|
|
469
|
+
:rules="rules.group_name"
|
|
470
|
+
:label="groupType === MeetingGroupType.GROUP ? t('meeting.meetingGroup'):t('meeting.meetingSig')"
|
|
471
|
+
field="group_name">
|
|
463
472
|
<OSelect
|
|
464
473
|
:disabled="isEdit"
|
|
465
|
-
:placeholder="t('meeting.selectSig')"
|
|
474
|
+
:placeholder="groupType === MeetingGroupType.GROUP ? t('meeting.selectGroup') : t('meeting.selectSig')"
|
|
466
475
|
size="large"
|
|
467
476
|
style="width: 100%"
|
|
468
477
|
v-model="form.group_name"
|