@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.
@@ -26,9 +26,20 @@ import IconEvent from '~icons/meeting/icon-event.svg';
26
26
  import type { ActivityItemT, MyActivityCalendarPropsT, ParamsItemT } from './types';
27
27
  import { useScreen } from '@opendesign-plus/composables';
28
28
  import { formatDate, getDateNumber } from '../meeting/utils';
29
- import { statusMap, acticityTypeMap } from './config';
29
+ import { getStatusMap, getActicityTypeMap } from './config';
30
30
  import { PageParamsT } from '../meeting/types';
31
31
  import OMeetingDetail from '@/components/meeting/components/OMeetingDetail.vue';
32
+ import { useI18n, Locales } from '@/i18n';
33
+
34
+ const { t, locale } = useI18n();
35
+ const isZh = computed(() => locale.value === Locales.ZH);
36
+ const statusMap = getStatusMap();
37
+ const acticityTypeMap = getActicityTypeMap();
38
+
39
+ const formatMonthYear = (date: string | Date) => {
40
+ const d = dayjs(date || new Date());
41
+ return isZh.value ? d.format('YYYY MM月') : d.format('MMMM YYYY');
42
+ };
32
43
 
33
44
  const message = useMessage(null);
34
45
  const { isPhone } = useScreen();
@@ -302,19 +313,19 @@ const confirm = () => {
302
313
  return;
303
314
  }
304
315
  dialogLoading.value = true;
305
- props.revokeActivityRequest(currentRow.value?.id)
316
+ props.revokeActivityRequest(currentRow.value?.id)
306
317
  .then(() => {
307
318
  message.success({
308
- content: `“${ currentRow.value.title }”活动撤销审核成功`,
319
+ content: t('meeting.revokeActivitySuccess', [currentRow.value.title]),
309
320
  });
310
321
  reloadAll.value = true;
311
322
  getList();
312
323
  })
313
324
  .catch(() => {
314
325
  message.danger({
315
- content: `“${ currentRow.value.title }”活动撤销审核失败`,
326
+ content: t('meeting.revokeActivityFail', [currentRow.value.title]),
316
327
  });
317
- })
328
+ })
318
329
  .finally(() => {
319
330
  revokeVisible.value = false;
320
331
  dialogLoading.value = false;
@@ -362,21 +373,21 @@ const handleSubmitReviewItem = (val: ActivityItemT) => {
362
373
  approver,
363
374
  is_publish: 'true',
364
375
  } as ParamsItemT;
365
- props.editActivityRequest(val.id, params)
376
+ props.editActivityRequest(val.id, params)
366
377
  .then(() => {
367
378
  message.success({
368
- content: `“${ val.title }”活动提交审核成功`,
379
+ content: t('meeting.submitReviewSuccess', [val.title]),
369
380
  });
370
381
  reloadAll.value = true;
371
382
  getList();
372
383
  })
373
384
  .catch(() => {
374
385
  message.danger({
375
- content: `“${ val.title }”活动提交审核失败`,
386
+ content: t('meeting.submitReviewFail', [val.title]),
376
387
  });
377
388
  });
378
389
  };
379
- // 删除活动
390
+ // 删除活动
380
391
  const deleteVisible = ref(false);
381
392
  const handleDeleteItem = (val: ActivityItemT) => {
382
393
  currentRow.value = val;
@@ -387,24 +398,24 @@ const confirmDelete = () => {
387
398
  return;
388
399
  }
389
400
  dialogLoading.value = true;
390
- props.deleteActivityRequest(currentRow.value?.id)
401
+ props.deleteActivityRequest(currentRow.value?.id)
391
402
  .then(() => {
392
403
  message.success({
393
- content: `“${ currentRow.value.title }”活动删除成功`,
404
+ content: t('meeting.deleteActivitySuccess', [currentRow.value.title]),
394
405
  });
395
406
  reloadAll.value = true;
396
407
  getList();
397
408
  })
398
409
  .catch(() => {
399
410
  message.danger({
400
- content: `“${ currentRow.value.title }”活动删除失败`,
411
+ content: t('meeting.deleteActivityFail', [currentRow.value.title]),
401
412
  });
402
413
  })
403
414
  .finally(() => {
404
415
  deleteVisible.value = false;
405
416
  dialogLoading.value = false;
406
417
  });
407
- };
418
+ };
408
419
  const cancelDelete = () => {
409
420
  deleteVisible.value = false;
410
421
  };
@@ -459,7 +470,7 @@ const revokeActions = computed<DialogActionT[]>(() => {
459
470
  variant: 'outline',
460
471
  round: 'pill',
461
472
  size: 'large',
462
- label: '确定',
473
+ label: t('meeting.confirmBtn'),
463
474
  onClick: () => {
464
475
  confirm();
465
476
  },
@@ -469,7 +480,7 @@ const revokeActions = computed<DialogActionT[]>(() => {
469
480
  variant: 'solid',
470
481
  round: 'pill',
471
482
  size: 'large',
472
- label: '取消',
483
+ label: t('meeting.cancelBtn'),
473
484
  onClick: () => {
474
485
  cancel();
475
486
  },
@@ -483,7 +494,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
483
494
  variant: 'outline',
484
495
  round: 'pill',
485
496
  size: 'large',
486
- label: '确定',
497
+ label: t('meeting.confirmBtn'),
487
498
  onClick: () => {
488
499
  confirmDelete();
489
500
  },
@@ -493,7 +504,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
493
504
  variant: 'solid',
494
505
  round: 'pill',
495
506
  size: 'large',
496
- label: '取消',
507
+ label: t('meeting.cancelBtn'),
497
508
  onClick: () => {
498
509
  cancelDelete();
499
510
  },
@@ -505,7 +516,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
505
516
  <div class="o-my-activity-calendar">
506
517
  <div class="activity-list">
507
518
  <div v-if="isPhone" class="list-calendar-mb">
508
- <span>{{ (selectedDate ? dayjs(new Date(selectedDate)) : dayjs()).format('YYYY MM月') }}</span>
519
+ <span>{{ formatMonthYear(selectedDate) }}</span>
509
520
  <span>
510
521
  <OIcon @click="changeMonth('prev-month')"><OIconChevronLeft /></OIcon>
511
522
  <OIcon @click="changeMonth('next-month')"><OIconChevronRight /></OIcon>
@@ -514,7 +525,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
514
525
  <div class="left-calendar">
515
526
  <ElCalendar ref="calendarRef" v-model="selectedDate">
516
527
  <template #header>
517
- <span>{{ (selectedDate ? dayjs(new Date(selectedDate)) : dayjs()).format('YYYY MM月') }}</span>
528
+ <span>{{ formatMonthYear(selectedDate) }}</span>
518
529
  <div>
519
530
  <OIcon @click="changeMonth('prev-month')">
520
531
  <OIconChevronLeft />
@@ -558,7 +569,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
558
569
  <OIcon>
559
570
  <OIconArrowLeft />
560
571
  </OIcon>
561
- <span>上个月</span>
572
+ <span>{{ t('meeting.preMonth') }}</span>
562
573
  </div>
563
574
  <div class="act-item" :class="idx === activityList.length - 1 && 'last-item'">
564
575
  <div
@@ -610,7 +621,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
610
621
  variant="outline"
611
622
  :class="[`tag-${row.is_delete ? 'delete' : statusMap.get(row.status)?.id}`]">
612
623
  {{
613
- row.is_delete === 1 ? '已取消' : statusMap.get(row.status)?.text
624
+ row.is_delete === 1 ? t('meeting.statusCanceled') : statusMap.get(row.status)?.text
614
625
  }}
615
626
  </OTag>
616
627
  </div>
@@ -624,7 +635,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
624
635
  <div class="item-header-right"
625
636
  v-if="row.content_url && !row.is_delete && [3,4,5,6].includes(row.status)">
626
637
  <OLink v-if="row.content_url" :href="row.content_url" target="_blank" rel="noopener noreferrer">
627
- 活动详情
638
+ {{ t('meeting.activityDetail') }}
628
639
  <template #suffix>
629
640
  <OIcon>
630
641
  <OIconChevronRight></OIconChevronRight>
@@ -642,7 +653,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
642
653
  target="_blank"
643
654
  rel="noopener noreferrer"
644
655
  >
645
- 我要报名
656
+ {{ t('meeting.registerNow') }}
646
657
  <template #suffix>
647
658
  <OIcon>
648
659
  <OIconChevronRight></OIconChevronRight>
@@ -666,25 +677,25 @@ const deleteActions = computed<DialogActionT[]>(() => {
666
677
  variant="text"
667
678
  @click="handleRevokeItem(row)"
668
679
  >
669
- 撤销审核
680
+ {{ t('meeting.withdrawReview') }}
670
681
  </OButton>
671
682
  <OButton
672
683
  v-if="row.status === 1 || row.status === 3 || row.status === 4 || row.status === 7"
673
684
  variant="text" @click="handleEditItem(row)"
674
685
  >
675
- 修改活动
686
+ {{ t('meeting.modifyActivity') }}
676
687
  </OButton>
677
688
  <OButton
678
689
  v-if="row.status === 1 || row.status === 7" variant="text"
679
690
  @click="handleDeleteItem(row)"
680
691
  >
681
- 删除活动
692
+ {{ t('meeting.deleteActivity') }}
682
693
  </OButton>
683
694
  <OButton
684
695
  v-if="row.status === 1 || row.status === 7" variant="text"
685
696
  @click="handleSubmitReviewItem(row)"
686
697
  >
687
- 提交审核
698
+ {{ t('meeting.submitReview') }}
688
699
  </OButton>
689
700
  </div>
690
701
  </div>
@@ -692,12 +703,12 @@ const deleteActions = computed<DialogActionT[]>(() => {
692
703
  <div class="height-placeholder"></div>
693
704
  </div>
694
705
  <template v-if="idx === activityList.length - 1">
695
- <div class="load-text" v-if="bottomReached">加载中···</div>
706
+ <div class="load-text" v-if="bottomReached">{{ t('meeting.loading') }}</div>
696
707
  <div class="list-month-change next-month" @click="changeMonth('next-month')">
697
708
  <OIcon>
698
709
  <OIconArrowRight />
699
710
  </OIcon>
700
- <span>下个月</span>
711
+ <span>{{ t('meeting.nextMonth') }}</span>
701
712
  </div>
702
713
  </template>
703
714
  </template>
@@ -709,17 +720,17 @@ const deleteActions = computed<DialogActionT[]>(() => {
709
720
  </div>
710
721
  </div>
711
722
  </div>
712
- <!-- 撤销审核弹窗 -->
723
+ <!-- 撤销审核弹窗 -->
713
724
  <ODialog v-model:visible="revokeVisible" main-class="handle-dialog-active" :actions="revokeActions">
714
- <template #header>撤销审核</template>
715
- <div class="dialog-content">是否确认要撤销“{{ currentRow.title }}”活动?撤销审核后活动将变成草稿状态。</div>
725
+ <template #header>{{ t('meeting.withdrawReview') }}</template>
726
+ <div class="dialog-content">{{ t('meeting.confirmRevokeActivity', [currentRow.title]) }}</div>
716
727
  </ODialog>
717
728
  <!-- 删除活动弹窗 -->
718
729
  <ODialog v-model:visible="deleteVisible" main-class="handle-dialog-active" :actions="deleteActions">
719
- <template #header>删除活动</template>
720
- <div class="dialog-content">是否确认删除“{{ currentRow.title }}”活动?删除后记录将不再我的个人中心呈现。</div>
730
+ <template #header>{{ t('meeting.deleteActivity') }}</template>
731
+ <div class="dialog-content">{{ t('meeting.confirmDeleteActivity', [currentRow.title]) }}</div>
721
732
  </ODialog>
722
- </template>
733
+ </template>
723
734
 
724
735
  <style lang="scss">
725
736
 
@@ -1,130 +1,141 @@
1
- export const acticityTypeMap = new Map([
2
- [
3
- 1,
4
- {
5
- label: '线下',
6
- value: 1,
7
- },
8
- ],
9
- [
10
- 2,
11
- {
12
- label: '线上',
13
- value: 2,
14
- },
15
- ],
16
- [
17
- 3,
18
- {
19
- label: '线上与线下',
20
- value: 3,
21
- },
22
- ],
23
- ]);
1
+ import { useI18n } from '@/i18n';
2
+
3
+ export const getActicityTypeMap = () => {
4
+ const { t } = useI18n();
5
+ return new Map([
6
+ [
7
+ 1,
8
+ {
9
+ label: t('meeting.offline'),
10
+ value: 1,
11
+ },
12
+ ],
13
+ [
14
+ 2,
15
+ {
16
+ label: t('meeting.online'),
17
+ value: 2,
18
+ },
19
+ ],
20
+ [
21
+ 3,
22
+ {
23
+ label: t('meeting.onlineOffline'),
24
+ value: 3,
25
+ },
26
+ ],
27
+ ]);
28
+ };
24
29
 
25
30
  export const WEBSITE_REGEXP = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w ./?%&=-]*)?$/;
26
31
 
27
32
 
28
- export const statusMap = new Map([
29
- [
30
- 1,
31
- {
32
- id: 'draft',
33
- label: '草稿',
34
- text: '草稿',
35
- value: 1,
36
- },
37
- ],
38
- [
39
- 2,
40
- {
41
- id: 'under-review',
42
- label: '审核中',
43
- text: '未审核',
44
- value: 2,
45
- },
46
- ],
47
- [
48
- 3,
49
- {
50
- id: 'registration',
51
- label: '报名中',
52
- text: '审核通过',
53
- value: 3,
54
- },
55
- ],
56
- [
57
- 4,
58
- {
59
- id: 'in-progress',
60
- label: '进行中',
61
- text: '审核通过',
62
- value: 4,
63
- },
64
- ],
65
- [
66
- 5,
67
- {
68
- id: 'ended',
69
- label: '已结束',
70
- text: '已结束',
71
- value: 5,
72
- },
73
- ],
74
- [
75
- 6,
76
- {
77
- id: 'modified',
78
- label: '已修改',
79
- text: '已修改',
80
- value: 6,
81
- },
82
- ],
83
- [
84
- 7,
85
- {
86
- id: 'reject',
87
- label: '已驳回',
88
- text: '已驳回',
89
- value: 7,
90
- },
91
- ],
92
- ]);
33
+ export const getStatusMap = () => {
34
+ const { t } = useI18n();
35
+ return new Map([
36
+ [
37
+ 1,
38
+ {
39
+ id: 'draft',
40
+ label: t('meeting.statusDraft'),
41
+ text: t('meeting.statusDraft'),
42
+ value: 1,
43
+ },
44
+ ],
45
+ [
46
+ 2,
47
+ {
48
+ id: 'under-review',
49
+ label: t('meeting.statusUnderReview'),
50
+ text: t('meeting.statusPending'),
51
+ value: 2,
52
+ },
53
+ ],
54
+ [
55
+ 3,
56
+ {
57
+ id: 'registration',
58
+ label: t('meeting.statusRegistering'),
59
+ text: t('meeting.statusApproved'),
60
+ value: 3,
61
+ },
62
+ ],
63
+ [
64
+ 4,
65
+ {
66
+ id: 'in-progress',
67
+ label: t('meeting.statusInProgress'),
68
+ text: t('meeting.statusApproved'),
69
+ value: 4,
70
+ },
71
+ ],
72
+ [
73
+ 5,
74
+ {
75
+ id: 'ended',
76
+ label: t('meeting.statusEnded'),
77
+ text: t('meeting.statusEnded'),
78
+ value: 5,
79
+ },
80
+ ],
81
+ [
82
+ 6,
83
+ {
84
+ id: 'modified',
85
+ label: t('meeting.statusModified'),
86
+ text: t('meeting.statusModified'),
87
+ value: 6,
88
+ },
89
+ ],
90
+ [
91
+ 7,
92
+ {
93
+ id: 'reject',
94
+ label: t('meeting.statusRejected'),
95
+ text: t('meeting.statusRejected'),
96
+ value: 7,
97
+ },
98
+ ],
99
+ ]);
100
+ };
93
101
 
94
- export const approvalStatusMap = new Map([
95
- [
96
- 'all',
97
- {
98
- label: '全部',
99
- value: 'all',
100
- },
101
- ],
102
- [
103
- 'rejected',
104
- {
105
- label: '已驳回',
106
- value: 'rejected',
107
- },
108
- ],
109
- [
110
- 'approved',
111
- {
112
- label: '已通过',
113
- value: 'approved',
114
- },
115
- ],
116
- [
117
- 'publish',
118
- {
119
- label: '未审核',
120
- value: 'publish',
121
- },
122
- ],
123
- [
124
- 'cancel',
125
- {
126
- label: '已取消',
127
- value: 'cancel',
128
- },
129
- ],
130
- ]);
102
+ export const getApprovalStatusMap = () => {
103
+ const { t } = useI18n();
104
+ return new Map([
105
+ [
106
+ 'all',
107
+ {
108
+ label: t('common.all'),
109
+ value: 'all',
110
+ },
111
+ ],
112
+ [
113
+ 'rejected',
114
+ {
115
+ label: t('meeting.statusRejected'),
116
+ value: 'rejected',
117
+ },
118
+ ],
119
+ [
120
+ 'approved',
121
+ {
122
+ label: t('meeting.statusApproved'),
123
+ value: 'approved',
124
+ },
125
+ ],
126
+ [
127
+ 'publish',
128
+ {
129
+ label: t('meeting.statusPending'),
130
+ value: 'publish',
131
+ },
132
+ ],
133
+ [
134
+ 'cancel',
135
+ {
136
+ label: t('meeting.statusCanceled'),
137
+ value: 'cancel',
138
+ },
139
+ ],
140
+ ]);
141
+ };
@@ -15,7 +15,9 @@ import { CYCLE_TYPE_OPTIONS, INTERVAL_DAY, INTERVAL_MONTH, INTERVAL_WEEK } from
15
15
 
16
16
  import { formatDate, getConfig, getPointStr } from '../utils.ts';
17
17
  import { useI18n } from '@/i18n';
18
- import { acticityTypeMap } from '@/components/activity/config.ts';
18
+ import { getActicityTypeMap } from '@/components/activity/config.ts';
19
+
20
+ const acticityTypeMap = getActicityTypeMap();
19
21
 
20
22
  const props = withDefaults(defineProps<{
21
23
  list: MeetingItemT[];
@@ -28,28 +28,32 @@ const infoList = computed(() =>
28
28
  );
29
29
 
30
30
 
31
- const activityInfoList = computed(() =>
32
- [
33
- { label: '起始日期', key: 'start_date_time' },
34
- { label: '结束日期', key: 'end_date_time' },
35
- { label: '报名截止时间', key: 'register_end_date' },
36
- { label: '活动地点', key: 'address' },
37
- { label: '活动详情地址', key: 'content_url', isLink: true },
38
- { label: '活动审批人', key: 'approver' },
39
- { label: '审核备注', key: 'approve_record', isRecord: true },
40
- ].slice(0, props.from === 'home' ? 4 : 7),
41
- );
42
- const activityInfoApprovalList = computed(() => [
43
- { label: '活动类型', key: 'activity_type', isType: true },
44
- { label: '活动地点', key: 'address' },
45
- { label: '起始日期', key: 'start_date_time' },
46
- { label: '结束日期', key: 'end_date_time' },
47
- { label: '报名截止时间', key: 'register_end_date' },
48
- { label: '报名网址', key: 'register_url', isLink: true },
49
- { label: '活动详情地址', key: 'content_url', isLink: true },
50
- { label: '活动审批人', key: 'approver' },
51
- { label: '审核备注', key: 'approve_record', isRecord: true },
52
- ]);
31
+ const activityInfoList = computed(() => {
32
+ const isLive = props.data.activity_type === 2 || props.data.activity_type === '线上';
33
+ return [
34
+ { label: t('meeting.startDate'), key: 'start_date_time' },
35
+ { label: t('meeting.endDate'), key: 'end_date_time' },
36
+ { label: t('meeting.registrationDeadline'), key: 'register_end_date' },
37
+ { label: isLive ? t('meeting.livePlatform') : t('meeting.activityAddress'), key: 'address' },
38
+ { label: t('meeting.activityDetailUrl'), key: 'content_url', isLink: true },
39
+ { label: t('meeting.activityApprover'), key: 'approver' },
40
+ { label: t('meeting.reviewNotesLabel'), key: 'approve_record', isRecord: true },
41
+ ].slice(0, props.from === 'home' ? 4 : 7);
42
+ });
43
+ const activityInfoApprovalList = computed(() => {
44
+ const isLive = props.data.activity_type === 2 || props.data.activity_type === '线上';
45
+ return [
46
+ { label: t('meeting.activityType'), key: 'activity_type', isType: true },
47
+ { label: isLive ? t('meeting.livePlatform') : t('meeting.activityAddress'), key: 'address' },
48
+ { label: t('meeting.startDate'), key: 'start_date_time' },
49
+ { label: t('meeting.endDate'), key: 'end_date_time' },
50
+ { label: t('meeting.registrationDeadline'), key: 'register_end_date' },
51
+ { label: t('meeting.registrationUrl'), key: 'register_url', isLink: true },
52
+ { label: t('meeting.activityDetailUrl'), key: 'content_url', isLink: true },
53
+ { label: t('meeting.activityApprover'), key: 'approver' },
54
+ { label: t('meeting.reviewNotesLabel'), key: 'approve_record', isRecord: true },
55
+ ];
56
+ });
53
57
 
54
58
  const columns = computed(() => {
55
59
  if (props.data.type === CalendarDataType.ACTIVITY || props.data.type === CalendarDataType.EVENTS) {
@@ -116,7 +120,7 @@ defineExpose({ copyInfo });
116
120
  <p v-for="re in data[info.key]" :key="re.create_time" class="value">
117
121
  {{ re.reason }}&nbsp;&nbsp;
118
122
  {{ formatDate(re.create_time, 'YYYY/MM/DD HH:mm:ss') }}
119
- 审核{{ re.action === 1 ? '通过' : '驳回' }}
123
+ {{ re.action === 1 ? t('meeting.approveReview') : t('meeting.rejectReview') }}
120
124
  </p>
121
125
  </div>
122
126
  </template>