@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.
- package/dist/chunk-OElCookieNotice.cjs.js +1 -1
- package/dist/chunk-OElCookieNotice.es.js +339 -150
- package/dist/components/activity/composables/useActivityConfig.d.ts +17 -0
- package/dist/components/activity/config.d.ts +0 -14
- package/dist/components/meeting/composables/useMeetingConfig.d.ts +14 -0
- package/dist/components/meeting/config.d.ts +1 -16
- package/dist/components/meeting/types.d.ts +1 -0
- package/dist/components/meeting/utils.d.ts +1 -15
- package/dist/components.cjs.js +40 -40
- package/dist/components.css +1 -1
- package/dist/components.es.js +11386 -11389
- package/package.json +3 -3
- package/src/components/activity/OActivityApproval.vue +47 -38
- package/src/components/activity/OActivityForm.vue +51 -50
- package/src/components/activity/OMyActivityCalendar.vue +46 -36
- package/src/components/activity/composables/useActivityConfig.ts +141 -0
- package/src/components/activity/config.ts +1 -130
- package/src/components/meeting/OMeetingCalendar.vue +7 -9
- package/src/components/meeting/OMeetingForm.vue +11 -18
- package/src/components/meeting/OMyMeetingCalendar.vue +4 -8
- package/src/components/meeting/OSigMeetingCalendar.vue +3 -5
- package/src/components/meeting/components/OMeetingCalendarList.vue +7 -6
- package/src/components/meeting/components/OMeetingDetail.vue +33 -28
- package/src/components/meeting/components/OSigMeetingAside.vue +3 -1
- package/src/components/meeting/composables/useMeetingConfig.ts +111 -0
- package/src/components/meeting/config.ts +58 -120
- package/src/components/meeting/types.ts +1 -0
- package/src/components/meeting/utils.ts +69 -122
- package/src/i18n/en.ts +97 -0
- package/src/i18n/zh.ts +92 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendesign-plus-test/components",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"dayjs": "^1.11.13",
|
|
33
33
|
"video.js": "^8.23.7",
|
|
34
34
|
"vue-dompurify-html": "^3.1.2",
|
|
35
|
-
"@opendesign-plus/
|
|
36
|
-
"@opendesign-plus/
|
|
35
|
+
"@opendesign-plus/styles": "0.0.1-rc.2",
|
|
36
|
+
"@opendesign-plus/composables": "0.0.1-rc.6"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@vitejs/plugin-vue": "^5.1.0",
|
|
@@ -15,9 +15,14 @@ import {
|
|
|
15
15
|
import { useScreen } from '@opendesign-plus/composables';
|
|
16
16
|
import { onMounted, watch, ref, reactive, computed } from 'vue';
|
|
17
17
|
import { ActivityItemT, ActivityTablePropsT, ReviewParamsT, TypeOptionT } from './types';
|
|
18
|
-
import {
|
|
18
|
+
import { useActivityConfig } from './composables/useActivityConfig';
|
|
19
19
|
import ThFilter from '../common/ThFilter.vue';
|
|
20
20
|
import OMeetingDetail from '@/components/meeting/components/OMeetingDetail.vue';
|
|
21
|
+
import { useI18n } from '@/i18n';
|
|
22
|
+
|
|
23
|
+
const { t, locale } = useI18n();
|
|
24
|
+
const isZh = computed(() => locale.value === 'zh');
|
|
25
|
+
const { approvalStatusMap, statusMap } = useActivityConfig();
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
const message = useMessage(null);
|
|
@@ -52,7 +57,7 @@ const sortTime = () => {
|
|
|
52
57
|
const statusValue = ref();
|
|
53
58
|
const statusOptions = computed<TypeOptionT[]>(() => {
|
|
54
59
|
let list: TypeOptionT[] | { label: string; value: string; }[] = [];
|
|
55
|
-
approvalStatusMap.forEach((item) => {
|
|
60
|
+
approvalStatusMap.value.forEach((item) => {
|
|
56
61
|
list.push(item);
|
|
57
62
|
});
|
|
58
63
|
return list.slice(1);
|
|
@@ -75,7 +80,7 @@ const COUNT_PER_PAGE = [10, 20, 30, 40];
|
|
|
75
80
|
const getData = async () => {
|
|
76
81
|
const { page, size, status, sponsor, order_by, search, is_delete } = params;
|
|
77
82
|
let paramsData = { page, size, sponsor, order_by, search } as ReviewParamsT;
|
|
78
|
-
if (status !== 'all') {
|
|
83
|
+
if (status !== 'all' && status !== '') {
|
|
79
84
|
paramsData.is_delete = is_delete;
|
|
80
85
|
}
|
|
81
86
|
if (status === 'cancel') {
|
|
@@ -128,14 +133,14 @@ const reviewVisible = ref(false);
|
|
|
128
133
|
|
|
129
134
|
// 表单校验规则
|
|
130
135
|
const rules = ref({
|
|
131
|
-
reason: [{ required: true, message: '
|
|
136
|
+
reason: [{ required: true, message: t('meeting.enterReviewNotes') }],
|
|
132
137
|
});
|
|
133
138
|
|
|
134
139
|
const confirm = async () => {
|
|
135
140
|
if (!props.approveActivityRequest || !props.rejectActivityRequest) {
|
|
136
141
|
return;
|
|
137
142
|
}
|
|
138
|
-
const msg = reviewStatus.value === 1 ? '
|
|
143
|
+
const msg = reviewStatus.value === 1 ? t('meeting.approveReview') : t('meeting.rejectReview');
|
|
139
144
|
try {
|
|
140
145
|
loading.value = true;
|
|
141
146
|
const valid = await formRef.value?.validate();
|
|
@@ -151,13 +156,13 @@ const confirm = async () => {
|
|
|
151
156
|
getData();
|
|
152
157
|
cancel();
|
|
153
158
|
message.success({
|
|
154
|
-
content:
|
|
159
|
+
content: t('meeting.reviewSuccess', [currentRow.value?.title]),
|
|
155
160
|
});
|
|
156
161
|
} catch {
|
|
157
162
|
reviewVisible.value = false;
|
|
158
163
|
loading.value = false;
|
|
159
164
|
message.danger({
|
|
160
|
-
content:
|
|
165
|
+
content: t('meeting.reviewFail', [currentRow.value?.title]),
|
|
161
166
|
});
|
|
162
167
|
}
|
|
163
168
|
};
|
|
@@ -180,14 +185,13 @@ const confirmCancel = async () => {
|
|
|
180
185
|
getData();
|
|
181
186
|
cancel();
|
|
182
187
|
message.success({
|
|
183
|
-
content:
|
|
188
|
+
content: t('meeting.activityActionSuccess', [currentRow.value?.title, cancelText.value]),
|
|
184
189
|
});
|
|
185
190
|
} catch (err) {
|
|
186
|
-
console.log(err);
|
|
187
191
|
loading.value = false;
|
|
188
192
|
cancelVisible.value = false;
|
|
189
193
|
message.danger({
|
|
190
|
-
content:
|
|
194
|
+
content: t('meeting.activityActionFail', [currentRow.value?.title, cancelText.value]),
|
|
191
195
|
});
|
|
192
196
|
}
|
|
193
197
|
}
|
|
@@ -200,28 +204,28 @@ const cancelText = ref('');
|
|
|
200
204
|
const cancelStatus = ref(0);
|
|
201
205
|
|
|
202
206
|
const deleteItem = (row: ActivityItemT) => {
|
|
203
|
-
cancelTitle.value = '
|
|
204
|
-
cancelText.value = '
|
|
207
|
+
cancelTitle.value = t('meeting.deleteActivity');
|
|
208
|
+
cancelText.value = t('meeting.deleteActivity').toLowerCase();
|
|
205
209
|
currentRow.value = row;
|
|
206
210
|
cancelStatus.value = 0;
|
|
207
211
|
cancelVisible.value = true;
|
|
208
212
|
};
|
|
209
213
|
const cancelItem = (row: ActivityItemT) => {
|
|
210
|
-
cancelTitle.value = '
|
|
211
|
-
cancelText.value = '
|
|
214
|
+
cancelTitle.value = t('meeting.cancelActivity');
|
|
215
|
+
cancelText.value = t('common.cancel').toLowerCase();
|
|
212
216
|
currentRow.value = row;
|
|
213
217
|
cancelStatus.value = 1;
|
|
214
218
|
cancelVisible.value = true;
|
|
215
219
|
};
|
|
216
220
|
const passItem = (row: ActivityItemT) => {
|
|
217
221
|
currentRow.value = row;
|
|
218
|
-
digTitle.value = '
|
|
222
|
+
digTitle.value = t('meeting.approveReview');
|
|
219
223
|
reviewStatus.value = 1;
|
|
220
224
|
reviewVisible.value = true;
|
|
221
225
|
};
|
|
222
226
|
const rejectItem = (row: ActivityItemT) => {
|
|
223
227
|
currentRow.value = row;
|
|
224
|
-
digTitle.value = '
|
|
228
|
+
digTitle.value = t('meeting.rejectReview');
|
|
225
229
|
reviewStatus.value = 0;
|
|
226
230
|
reviewVisible.value = true;
|
|
227
231
|
};
|
|
@@ -298,7 +302,7 @@ const cancelActions = computed<DialogActionT[]>(() => {
|
|
|
298
302
|
variant: lePadV.value ? 'text' : 'solid',
|
|
299
303
|
round: 'pill',
|
|
300
304
|
size: 'large',
|
|
301
|
-
label: '
|
|
305
|
+
label: t('meeting.confirmBtn'),
|
|
302
306
|
onClick: () => {
|
|
303
307
|
confirmCancel();
|
|
304
308
|
},
|
|
@@ -308,7 +312,7 @@ const cancelActions = computed<DialogActionT[]>(() => {
|
|
|
308
312
|
variant: lePadV.value ? 'text' : 'outline',
|
|
309
313
|
round: 'pill',
|
|
310
314
|
size: 'large',
|
|
311
|
-
label: '
|
|
315
|
+
label: t('meeting.cancelBtn'),
|
|
312
316
|
onClick: () => {
|
|
313
317
|
cancel();
|
|
314
318
|
},
|
|
@@ -322,7 +326,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
322
326
|
variant: lePadV.value ? 'text' : 'solid',
|
|
323
327
|
round: 'pill',
|
|
324
328
|
size: 'large',
|
|
325
|
-
label: '
|
|
329
|
+
label: t('meeting.confirmBtn'),
|
|
326
330
|
onClick: () => {
|
|
327
331
|
confirm();
|
|
328
332
|
},
|
|
@@ -332,7 +336,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
332
336
|
variant: lePadV.value ? 'text' : 'outline',
|
|
333
337
|
round: 'pill',
|
|
334
338
|
size: 'large',
|
|
335
|
-
label: '
|
|
339
|
+
label: t('meeting.cancelBtn'),
|
|
336
340
|
onClick: () => {
|
|
337
341
|
cancel();
|
|
338
342
|
},
|
|
@@ -351,7 +355,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
351
355
|
</div>
|
|
352
356
|
</template>
|
|
353
357
|
</ElTableColumn>
|
|
354
|
-
<ElTableColumn label="
|
|
358
|
+
<ElTableColumn :label="t('meeting.activityName')" prop="title" />
|
|
355
359
|
<ElTableColumn prop="sponsor">
|
|
356
360
|
<template #header>
|
|
357
361
|
<ThFilter
|
|
@@ -364,14 +368,14 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
364
368
|
<template #empty>
|
|
365
369
|
<slot name="filter-empty"></slot>
|
|
366
370
|
</template>
|
|
367
|
-
|
|
371
|
+
{{ t('meeting.applicant') }}
|
|
368
372
|
</ThFilter>
|
|
369
373
|
</template>
|
|
370
374
|
</ElTableColumn>
|
|
371
375
|
<ElTableColumn prop="create_time">
|
|
372
376
|
<template #header>
|
|
373
377
|
<div class="sort-time" @click="sortTime">
|
|
374
|
-
<span
|
|
378
|
+
<span>{{ t('meeting.submissionTime') }}</span>
|
|
375
379
|
<div class="sort-btn">
|
|
376
380
|
<div class="sort-asc sort-item" :class="{ active: order_by === 'asc' }"></div>
|
|
377
381
|
<div class="sort-desc sort-item" :class="{ active: order_by === 'desc' }"></div>
|
|
@@ -392,7 +396,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
392
396
|
<template #empty>
|
|
393
397
|
<slot name="filter-empty"></slot>
|
|
394
398
|
</template>
|
|
395
|
-
|
|
399
|
+
{{ t('meeting.status') }}
|
|
396
400
|
</ThFilter>
|
|
397
401
|
</template>
|
|
398
402
|
<template #default="scope">
|
|
@@ -406,30 +410,30 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
406
410
|
statusMap.get(scope.row.status)?.text
|
|
407
411
|
}}
|
|
408
412
|
</OTag>
|
|
409
|
-
<OTag v-else color="primary" variant="outline" class="tag-cancel"
|
|
413
|
+
<OTag v-else color="primary" variant="outline" class="tag-cancel">{{ t('meeting.statusCanceled') }}</OTag>
|
|
410
414
|
</template>
|
|
411
415
|
</ElTableColumn>
|
|
412
|
-
<ElTableColumn label="
|
|
416
|
+
<ElTableColumn :label="t('meeting.action')">
|
|
413
417
|
<template #default="scope">
|
|
414
418
|
<div class="activity-btn">
|
|
415
419
|
<OLink
|
|
416
420
|
v-if="scope.row.status === 7 || scope.row.is_delete"
|
|
417
421
|
color="danger"
|
|
418
422
|
@click="deleteItem(scope.row)">
|
|
419
|
-
|
|
423
|
+
{{ t('meeting.deleteActivity') }}
|
|
420
424
|
</OLink>
|
|
421
425
|
<OLink
|
|
422
426
|
v-if="(scope.row.status === 3 || scope.row.status === 4) && scope.row.is_delete !== 1"
|
|
423
427
|
color="danger"
|
|
424
428
|
@click="cancelItem(scope.row)"
|
|
425
429
|
>
|
|
426
|
-
|
|
430
|
+
{{ t('meeting.cancelActivity') }}
|
|
427
431
|
</OLink>
|
|
428
432
|
<OLink v-if="scope.row.status === 2" color="primary" @click="passItem(scope.row)">
|
|
429
|
-
|
|
433
|
+
{{ t('meeting.approve') }}
|
|
430
434
|
</OLink>
|
|
431
435
|
<OLink v-if="scope.row.status === 2" color="primary" @click="rejectItem(scope.row)">
|
|
432
|
-
|
|
436
|
+
{{ t('meeting.reject') }}
|
|
433
437
|
</OLink>
|
|
434
438
|
</div>
|
|
435
439
|
</template>
|
|
@@ -458,7 +462,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
458
462
|
statusMap.get(act.status)?.text
|
|
459
463
|
}}
|
|
460
464
|
</OTag>
|
|
461
|
-
<OTag v-else color="primary" variant="outline" class="tag-cancel"
|
|
465
|
+
<OTag v-else color="primary" variant="outline" class="tag-cancel">{{ t('meeting.statusCanceled') }}</OTag>
|
|
462
466
|
</div>
|
|
463
467
|
<OCollapseItem :value="act.id">
|
|
464
468
|
<template #title>
|
|
@@ -473,7 +477,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
473
477
|
variant="text"
|
|
474
478
|
@click.stop="deleteItem(act)"
|
|
475
479
|
>
|
|
476
|
-
|
|
480
|
+
{{ t('meeting.deleteActivity') }}
|
|
477
481
|
</OLink>
|
|
478
482
|
<OLink
|
|
479
483
|
v-if="(act.status === 3 || act.status === 4) && act.is_delete !== 1"
|
|
@@ -481,7 +485,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
481
485
|
variant="text"
|
|
482
486
|
@click.stop="cancelItem(act)"
|
|
483
487
|
>
|
|
484
|
-
|
|
488
|
+
{{ t('meeting.cancelActivity') }}
|
|
485
489
|
</OLink>
|
|
486
490
|
<OLink
|
|
487
491
|
v-if="act.status === 2"
|
|
@@ -489,7 +493,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
489
493
|
variant="text"
|
|
490
494
|
@click.stop="passItem(act)"
|
|
491
495
|
>
|
|
492
|
-
|
|
496
|
+
{{ t('meeting.approve') }}
|
|
493
497
|
</OLink>
|
|
494
498
|
<OLink
|
|
495
499
|
v-if="act.status === 2"
|
|
@@ -497,7 +501,7 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
497
501
|
variant="text"
|
|
498
502
|
@click.stop="rejectItem(act)"
|
|
499
503
|
>
|
|
500
|
-
|
|
504
|
+
{{ t('meeting.reject') }}
|
|
501
505
|
</OLink>
|
|
502
506
|
</div>
|
|
503
507
|
</template>
|
|
@@ -535,10 +539,14 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
535
539
|
<template #header>{{ digTitle }}</template>
|
|
536
540
|
<div class="dialog-content">
|
|
537
541
|
<OForm :model="form" ref="formRef" has-required layout="v" class="form-wrapper">
|
|
538
|
-
<OFormItem
|
|
542
|
+
<OFormItem
|
|
543
|
+
:rules="rules.reason"
|
|
544
|
+
:label="`${t('meeting.reviewNotesLabel')}${isZh ? ':' : ': '}`"
|
|
545
|
+
field="reason"
|
|
546
|
+
>
|
|
539
547
|
<OTextarea
|
|
540
548
|
size="large"
|
|
541
|
-
placeholder="
|
|
549
|
+
:placeholder="t('meeting.enterReviewNotes')"
|
|
542
550
|
:rows="4"
|
|
543
551
|
resize="none"
|
|
544
552
|
:max-length="1000"
|
|
@@ -558,7 +566,8 @@ const reviewActions = computed<DialogActionT[]>(() => {
|
|
|
558
566
|
>
|
|
559
567
|
<template #header>{{ cancelTitle }}</template>
|
|
560
568
|
<div class="dialog-content">
|
|
561
|
-
|
|
569
|
+
{{ cancelStatus === 1 ? t('meeting.confirmCancelActivity', [currentRow?.title]) : t('meeting.confirmDeleteActivity', [currentRow?.title])
|
|
570
|
+
}}
|
|
562
571
|
</div>
|
|
563
572
|
</ODialog>
|
|
564
573
|
</div>
|
|
@@ -15,9 +15,10 @@ import { computed, ref, watch } from 'vue';
|
|
|
15
15
|
import { ActivityFormPropsT, ParamsItemT } from './types';
|
|
16
16
|
import { useScreen } from '@opendesign-plus/composables';
|
|
17
17
|
import { dayjs, ElDatePicker } from 'element-plus';
|
|
18
|
-
import {
|
|
18
|
+
import { WEBSITE_REGEXP } from './config';
|
|
19
19
|
import { EMAIL_REGEX } from '@/components/meeting/config.ts';
|
|
20
20
|
import { useI18n } from '@/i18n';
|
|
21
|
+
import { useActivityConfig } from './composables/useActivityConfig';
|
|
21
22
|
|
|
22
23
|
const emits = defineEmits(['confirm', 'close']);
|
|
23
24
|
|
|
@@ -25,6 +26,7 @@ const message = useMessage(null);
|
|
|
25
26
|
const { lePadV } = useScreen();
|
|
26
27
|
const { t } = useI18n();
|
|
27
28
|
const $t = t;
|
|
29
|
+
const { activityTypeMap } = useActivityConfig();
|
|
28
30
|
|
|
29
31
|
interface TypeOptionT {
|
|
30
32
|
label: string;
|
|
@@ -58,22 +60,22 @@ const loading = ref(false); // 提交状态
|
|
|
58
60
|
// 表单校验规则
|
|
59
61
|
const rules = ref<Record<string, RulesT[]>>({
|
|
60
62
|
title: [
|
|
61
|
-
{ required: true, message: '
|
|
63
|
+
{ required: true, message: t('meeting.enterActivityName') },
|
|
62
64
|
{
|
|
63
65
|
validator: (value: string) => {
|
|
64
66
|
if (value.length > 50) {
|
|
65
67
|
return {
|
|
66
68
|
type: 'danger',
|
|
67
|
-
message: '
|
|
69
|
+
message: t('meeting.activityNameMaxLength'),
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
73
|
},
|
|
72
74
|
],
|
|
73
|
-
activity_type: [{ required: true, message: '
|
|
74
|
-
organizer: [{ required: true, message: '
|
|
75
|
+
activity_type: [{ required: true, message: t('meeting.selectActivityType') }],
|
|
76
|
+
organizer: [{ required: true, message: t('meeting.selectActivityOrganizer') }],
|
|
75
77
|
start_date: [
|
|
76
|
-
{ required: true, message: '
|
|
78
|
+
{ required: true, message: t('meeting.selectActivityTime') },
|
|
77
79
|
{
|
|
78
80
|
validator: () => {
|
|
79
81
|
const { start_date, end_date } = form.value;
|
|
@@ -82,7 +84,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
82
84
|
if (!start_date || !end_date) {
|
|
83
85
|
return {
|
|
84
86
|
type: 'danger',
|
|
85
|
-
message: '
|
|
87
|
+
message: t('meeting.selectActivityDate'),
|
|
86
88
|
};
|
|
87
89
|
}
|
|
88
90
|
|
|
@@ -91,14 +93,14 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
91
93
|
if (startArr[0] < 8 || startArr[0] > 21 || endArr[0] < 8 || endArr[0] > 21) {
|
|
92
94
|
return {
|
|
93
95
|
type: 'danger',
|
|
94
|
-
message: '
|
|
96
|
+
message: t('meeting.activityTimeRange'),
|
|
95
97
|
};
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
if (dayjs(start_date).valueOf() > dayjs(end_date).valueOf()) {
|
|
99
101
|
return {
|
|
100
102
|
type: 'danger',
|
|
101
|
-
message: '
|
|
103
|
+
message: t('meeting.endDateAfterStartDate'),
|
|
102
104
|
};
|
|
103
105
|
}
|
|
104
106
|
|
|
@@ -117,7 +119,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
117
119
|
if (register_end_date && dayjs(`${ end_date } ${ end }`).valueOf() < dayjs(register_end_date).valueOf()) {
|
|
118
120
|
return {
|
|
119
121
|
type: 'danger',
|
|
120
|
-
message: '
|
|
122
|
+
message: t('meeting.registerDeadlineBeforeEnd'),
|
|
121
123
|
};
|
|
122
124
|
}
|
|
123
125
|
},
|
|
@@ -125,13 +127,13 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
125
127
|
},
|
|
126
128
|
],
|
|
127
129
|
address: [
|
|
128
|
-
{ required: true, message: '
|
|
130
|
+
{ required: true, message: t('meeting.enterActivityAddress') },
|
|
129
131
|
{
|
|
130
132
|
validator: (value: string) => {
|
|
131
133
|
if (value.length > 255) {
|
|
132
134
|
return {
|
|
133
135
|
type: 'danger',
|
|
134
|
-
message: '
|
|
136
|
+
message: t('meeting.activityAddressMaxLength'),
|
|
135
137
|
};
|
|
136
138
|
}
|
|
137
139
|
},
|
|
@@ -146,7 +148,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
146
148
|
if (list.some((v) => !WEBSITE_REGEXP.test(v))) {
|
|
147
149
|
return {
|
|
148
150
|
type: 'danger',
|
|
149
|
-
message: '
|
|
151
|
+
message: t('meeting.invalidRegistrationUrl'),
|
|
150
152
|
};
|
|
151
153
|
}
|
|
152
154
|
}
|
|
@@ -163,7 +165,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
163
165
|
if (list.some((v) => !WEBSITE_REGEXP.test(v))) {
|
|
164
166
|
return {
|
|
165
167
|
type: 'danger',
|
|
166
|
-
message: '
|
|
168
|
+
message: t('meeting.invalidActivityDetailUrl'),
|
|
167
169
|
};
|
|
168
170
|
}
|
|
169
171
|
}
|
|
@@ -176,7 +178,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
176
178
|
if (value.length > 1000) {
|
|
177
179
|
return {
|
|
178
180
|
type: 'danger',
|
|
179
|
-
message: '
|
|
181
|
+
message: t('meeting.activityContentMaxLength'),
|
|
180
182
|
};
|
|
181
183
|
}
|
|
182
184
|
},
|
|
@@ -214,7 +216,7 @@ const rules = ref<Record<string, RulesT[]>>({
|
|
|
214
216
|
},
|
|
215
217
|
triggers: ['blur', 'change'],
|
|
216
218
|
}],
|
|
217
|
-
approver: [{ required: true, message: '
|
|
219
|
+
approver: [{ required: true, message: t('meeting.selectActivityApprover') }],
|
|
218
220
|
});
|
|
219
221
|
|
|
220
222
|
|
|
@@ -225,7 +227,7 @@ const approverList = computed(() => {
|
|
|
225
227
|
|
|
226
228
|
const typeValue = ref<string>('');
|
|
227
229
|
const typeOptions = ref<TypeOptionT[]>([]); // 活动类型
|
|
228
|
-
|
|
230
|
+
activityTypeMap.value.forEach((item) => {
|
|
229
231
|
typeOptions.value.push(item);
|
|
230
232
|
});
|
|
231
233
|
const changeType = (val: SelectValueT) => {
|
|
@@ -278,7 +280,7 @@ watch(
|
|
|
278
280
|
organizer,
|
|
279
281
|
} as ParamsItemT;
|
|
280
282
|
form.value = { ...params };
|
|
281
|
-
typeValue.value =
|
|
283
|
+
typeValue.value = activityTypeMap.value.get(val.activity_type)?.label;
|
|
282
284
|
form.value.start_date = `${ form.value.start_date } ${ form.value.start }`;
|
|
283
285
|
form.value.end_date = `${ form.value.end_date } ${ form.value.end }`;
|
|
284
286
|
}
|
|
@@ -287,7 +289,7 @@ watch(
|
|
|
287
289
|
);
|
|
288
290
|
|
|
289
291
|
const confirm = async (val: boolean) => {
|
|
290
|
-
let type = isEdit.value ? '
|
|
292
|
+
let type = isEdit.value ? t('meeting.modifyActivity') : val ? t('meeting.create') : t('meeting.saveDraft');
|
|
291
293
|
try {
|
|
292
294
|
const valid = await formRef.value?.validate();
|
|
293
295
|
if (valid.some((v) => !!v)) {
|
|
@@ -303,9 +305,8 @@ const confirm = async (val: boolean) => {
|
|
|
303
305
|
} else {
|
|
304
306
|
await props.creatActivity?.(form.value);
|
|
305
307
|
}
|
|
306
|
-
const msg = `“${ form.value.title }”活动${ type }成功`;
|
|
307
308
|
message.success({
|
|
308
|
-
content:
|
|
309
|
+
content: t('meeting.activityActionSuccess', [form.value.title, type.toLowerCase]),
|
|
309
310
|
});
|
|
310
311
|
close();
|
|
311
312
|
emits('confirm');
|
|
@@ -313,9 +314,8 @@ const confirm = async (val: boolean) => {
|
|
|
313
314
|
loading.value = false;
|
|
314
315
|
form.value.start_date = `${ form.value.start_date } ${ form.value.start }`;
|
|
315
316
|
form.value.end_date = `${ form.value.end_date } ${ form.value.end }`;
|
|
316
|
-
const msg = `“${ form.value.title }”活动${ type }失败`;
|
|
317
317
|
message.danger({
|
|
318
|
-
content:
|
|
318
|
+
content: t('meeting.activityActionFail', [form.value.title, type.toLowerCase]),
|
|
319
319
|
});
|
|
320
320
|
} finally {
|
|
321
321
|
loading.value = false;
|
|
@@ -342,35 +342,35 @@ defineExpose({
|
|
|
342
342
|
:layout="lePadV ? 'v' : 'h'"
|
|
343
343
|
class="form-wrapper"
|
|
344
344
|
>
|
|
345
|
-
<OFormItem :rules="rules.title" label="
|
|
346
|
-
<OInput size="large" placeholder="
|
|
345
|
+
<OFormItem :rules="rules.title" :label="t('meeting.activityName')" field="title">
|
|
346
|
+
<OInput size="large" :placeholder="t('meeting.enterActivityName')" v-model="form.title" />
|
|
347
347
|
</OFormItem>
|
|
348
|
-
<OFormItem :rules="rules.organizer" label="
|
|
349
|
-
<OSelect placeholder="
|
|
348
|
+
<OFormItem :rules="rules.organizer" :label="t('meeting.activityOrganizer')" field="organizer">
|
|
349
|
+
<OSelect :placeholder="t('meeting.selectActivityOrganizer')" size="large" v-model="form.organizer">
|
|
350
350
|
<OOption v-for="t in organizers" :key="t.name" :value="t.name">{{ t.name }}</OOption>
|
|
351
351
|
</OSelect>
|
|
352
352
|
</OFormItem>
|
|
353
|
-
<OFormItem :rules="rules.activity_type" label="
|
|
354
|
-
<OSelect placeholder="
|
|
353
|
+
<OFormItem :rules="rules.activity_type" :label="t('meeting.activityType')" field="activity_type">
|
|
354
|
+
<OSelect :placeholder="t('meeting.selectActivityType')" size="large" v-model="typeValue" @change="changeType">
|
|
355
355
|
<OOption v-for="t in typeOptions" :key="t.value" :value="t.label">{{ t.label }}</OOption>
|
|
356
356
|
</OSelect>
|
|
357
357
|
</OFormItem>
|
|
358
358
|
<OFormItem
|
|
359
359
|
v-if="form.activity_type === 1 || form.activity_type === 3"
|
|
360
360
|
:rules="rules.address"
|
|
361
|
-
label="
|
|
361
|
+
:label="t('meeting.activityAddress')"
|
|
362
362
|
field="address"
|
|
363
363
|
>
|
|
364
|
-
<OInput size="large" placeholder="
|
|
364
|
+
<OInput size="large" :placeholder="t('meeting.enterActivityAddress')" v-model="form.address" />
|
|
365
365
|
</OFormItem>
|
|
366
|
-
<OFormItem :rules="rules.start_date" label="
|
|
366
|
+
<OFormItem :rules="rules.start_date" :label="t('meeting.activityTime')" field="start_date" required>
|
|
367
367
|
<div class="time-config">
|
|
368
|
-
<OFormItem label="
|
|
368
|
+
<OFormItem :label="t('meeting.startDate')" field="start_date">
|
|
369
369
|
<ElDatePicker
|
|
370
370
|
size="large"
|
|
371
371
|
v-model="form.start_date"
|
|
372
372
|
type="datetime"
|
|
373
|
-
placeholder="
|
|
373
|
+
:placeholder="t('meeting.selectDate')"
|
|
374
374
|
format="YYYY/MM/DD HH:mm"
|
|
375
375
|
value-format="YYYY-MM-DD HH:mm"
|
|
376
376
|
:disabled-date="disabledDate"
|
|
@@ -378,12 +378,12 @@ defineExpose({
|
|
|
378
378
|
class="date-activity"
|
|
379
379
|
/>
|
|
380
380
|
</OFormItem>
|
|
381
|
-
<OFormItem label="
|
|
381
|
+
<OFormItem :label="t('meeting.endDate')" field="end_date">
|
|
382
382
|
<ElDatePicker
|
|
383
383
|
size="large"
|
|
384
384
|
v-model="form.end_date"
|
|
385
385
|
type="datetime"
|
|
386
|
-
placeholder="
|
|
386
|
+
:placeholder="t('meeting.selectDate')"
|
|
387
387
|
format="YYYY/MM/DD HH:mm"
|
|
388
388
|
value-format="YYYY-MM-DD HH:mm"
|
|
389
389
|
:disabled-date="disabledDate"
|
|
@@ -393,28 +393,28 @@ defineExpose({
|
|
|
393
393
|
</OFormItem>
|
|
394
394
|
</div>
|
|
395
395
|
</OFormItem>
|
|
396
|
-
<OFormItem :rules="rules.register_end_date" label="
|
|
396
|
+
<OFormItem :rules="rules.register_end_date" :label="t('meeting.registrationDeadline')" field="register_end_date">
|
|
397
397
|
<ElDatePicker
|
|
398
398
|
size="large"
|
|
399
399
|
v-model="form.register_end_date"
|
|
400
400
|
type="datetime"
|
|
401
|
-
placeholder="
|
|
401
|
+
:placeholder="t('meeting.selectActivityDeadline')"
|
|
402
402
|
format="YYYY/MM/DD HH:mm"
|
|
403
403
|
value-format="YYYY-MM-DD HH:mm"
|
|
404
404
|
:clearable="false"
|
|
405
405
|
class="date-activity"
|
|
406
406
|
/>
|
|
407
407
|
</OFormItem>
|
|
408
|
-
<OFormItem :rules="rules.register_url" label="
|
|
409
|
-
<OInput size="large" placeholder="
|
|
408
|
+
<OFormItem :rules="rules.register_url" :label="t('meeting.registrationUrl')" field="register_url">
|
|
409
|
+
<OInput size="large" :placeholder="t('meeting.enterActivityRegistrationUrl')" v-model="form.register_url" />
|
|
410
410
|
</OFormItem>
|
|
411
|
-
<OFormItem :rules="rules.content_url" label="
|
|
412
|
-
<OInput size="large" placeholder="
|
|
411
|
+
<OFormItem :rules="rules.content_url" :label="t('meeting.activityDetailUrl')" field="content_url">
|
|
412
|
+
<OInput size="large" :placeholder="t('meeting.enterActivityDetailUrl')" v-model="form.content_url" />
|
|
413
413
|
</OFormItem>
|
|
414
|
-
<OFormItem :rules="rules.synopsis" label="
|
|
415
|
-
<OTextarea size="large" placeholder="
|
|
414
|
+
<OFormItem :rules="rules.synopsis" :label="t('meeting.activityContent')" field="synopsis">
|
|
415
|
+
<OTextarea size="large" :placeholder="t('meeting.enterActivityContent')" v-model="form.synopsis" />
|
|
416
416
|
</OFormItem>
|
|
417
|
-
<OFormItem field="email_list" :rules="rules.email_list" label="
|
|
417
|
+
<OFormItem field="email_list" :rules="rules.email_list" :label="t('meeting.email')">
|
|
418
418
|
<OTextarea
|
|
419
419
|
:disabled="isEdit"
|
|
420
420
|
size="large"
|
|
@@ -422,15 +422,15 @@ defineExpose({
|
|
|
422
422
|
:rows="4"
|
|
423
423
|
v-model="form.email_list" />
|
|
424
424
|
</OFormItem>
|
|
425
|
-
<OFormItem :rules="rules.approver" label="
|
|
426
|
-
<OSelect placeholder="
|
|
425
|
+
<OFormItem :rules="rules.approver" :label="t('meeting.activityApprover')" field="approver">
|
|
426
|
+
<OSelect :placeholder="t('meeting.selectActivityApprover')" size="large" v-model="form.approver">
|
|
427
427
|
<OOption v-for="t in approverList" :key="t" :value="t">{{ t }}</OOption>
|
|
428
428
|
</OSelect>
|
|
429
429
|
</OFormItem>
|
|
430
430
|
</OForm>
|
|
431
431
|
<div class="form-btns">
|
|
432
432
|
<OButton color="primary" variant="solid" size="large" round="pill" @click="confirm(true)" :loading="loading">
|
|
433
|
-
{{ isEdit ? '
|
|
433
|
+
{{ isEdit ? t('common.save') : t('meeting.create') }}
|
|
434
434
|
</OButton>
|
|
435
435
|
<OButton
|
|
436
436
|
v-if="!isEdit"
|
|
@@ -441,9 +441,10 @@ defineExpose({
|
|
|
441
441
|
@click="confirm(false)"
|
|
442
442
|
:loading="loading"
|
|
443
443
|
>
|
|
444
|
-
|
|
444
|
+
{{ t('meeting.saveDraft') }}
|
|
445
|
+
</OButton>
|
|
446
|
+
<OButton color="primary" variant="outline" size="large" round="pill" @click="close">{{ t('meeting.cancelBtn') }}
|
|
445
447
|
</OButton>
|
|
446
|
-
<OButton color="primary" variant="outline" size="large" round="pill" @click="close">取消</OButton>
|
|
447
448
|
</div>
|
|
448
449
|
</div>
|
|
449
450
|
</template>
|