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