@opendesign-plus-test/components 0.0.1-rc.32 → 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,16 +516,16 @@ 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>
512
523
  </span>
513
524
  </div>
514
525
  <div class="left-calendar">
515
- <ElCalendar ref="calendarRef">
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>
@@ -621,9 +632,10 @@ const deleteActions = computed<DialogActionT[]>(() => {
621
632
  </div>
622
633
  </div>
623
634
  </div>
624
- <div class="item-header-right" v-if="!row.is_delete && [3,4,5,6].includes(row.status)">
635
+ <div class="item-header-right"
636
+ v-if="row.content_url && !row.is_delete && [3,4,5,6].includes(row.status)">
625
637
  <OLink v-if="row.content_url" :href="row.content_url" target="_blank" rel="noopener noreferrer">
626
- 活动详情
638
+ {{ t('meeting.activityDetail') }}
627
639
  <template #suffix>
628
640
  <OIcon>
629
641
  <OIconChevronRight></OIconChevronRight>
@@ -632,15 +644,16 @@ const deleteActions = computed<DialogActionT[]>(() => {
632
644
  </OLink>
633
645
  <OLink
634
646
  v-if="
647
+ row.register_url && (
635
648
  row.status === 3 ||
636
649
  row.status === 4 ||
637
- (row.status === 2 && row.update_activity_id && new Date(row.register_end_date).getTime() > new Date().getTime())
650
+ (row.status === 2 && row.update_activity_id && new Date(row.register_end_date).getTime() > new Date().getTime()))
638
651
  "
639
652
  :href="row.register_url"
640
653
  target="_blank"
641
654
  rel="noopener noreferrer"
642
655
  >
643
- 我要报名
656
+ {{ t('meeting.registerNow') }}
644
657
  <template #suffix>
645
658
  <OIcon>
646
659
  <OIconChevronRight></OIconChevronRight>
@@ -664,25 +677,25 @@ const deleteActions = computed<DialogActionT[]>(() => {
664
677
  variant="text"
665
678
  @click="handleRevokeItem(row)"
666
679
  >
667
- 撤销审核
680
+ {{ t('meeting.withdrawReview') }}
668
681
  </OButton>
669
682
  <OButton
670
683
  v-if="row.status === 1 || row.status === 3 || row.status === 4 || row.status === 7"
671
684
  variant="text" @click="handleEditItem(row)"
672
685
  >
673
- 修改活动
686
+ {{ t('meeting.modifyActivity') }}
674
687
  </OButton>
675
688
  <OButton
676
689
  v-if="row.status === 1 || row.status === 7" variant="text"
677
690
  @click="handleDeleteItem(row)"
678
691
  >
679
- 删除活动
692
+ {{ t('meeting.deleteActivity') }}
680
693
  </OButton>
681
694
  <OButton
682
695
  v-if="row.status === 1 || row.status === 7" variant="text"
683
696
  @click="handleSubmitReviewItem(row)"
684
697
  >
685
- 提交审核
698
+ {{ t('meeting.submitReview') }}
686
699
  </OButton>
687
700
  </div>
688
701
  </div>
@@ -690,12 +703,12 @@ const deleteActions = computed<DialogActionT[]>(() => {
690
703
  <div class="height-placeholder"></div>
691
704
  </div>
692
705
  <template v-if="idx === activityList.length - 1">
693
- <div class="load-text" v-if="bottomReached">加载中···</div>
706
+ <div class="load-text" v-if="bottomReached">{{ t('meeting.loading') }}</div>
694
707
  <div class="list-month-change next-month" @click="changeMonth('next-month')">
695
708
  <OIcon>
696
709
  <OIconArrowRight />
697
710
  </OIcon>
698
- <span>下个月</span>
711
+ <span>{{ t('meeting.nextMonth') }}</span>
699
712
  </div>
700
713
  </template>
701
714
  </template>
@@ -707,17 +720,17 @@ const deleteActions = computed<DialogActionT[]>(() => {
707
720
  </div>
708
721
  </div>
709
722
  </div>
710
- <!-- 撤销审核弹窗 -->
723
+ <!-- 撤销审核弹窗 -->
711
724
  <ODialog v-model:visible="revokeVisible" main-class="handle-dialog-active" :actions="revokeActions">
712
- <template #header>撤销审核</template>
713
- <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>
714
727
  </ODialog>
715
728
  <!-- 删除活动弹窗 -->
716
729
  <ODialog v-model:visible="deleteVisible" main-class="handle-dialog-active" :actions="deleteActions">
717
- <template #header>删除活动</template>
718
- <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>
719
732
  </ODialog>
720
- </template>
733
+ </template>
721
734
 
722
735
  <style lang="scss">
723
736
 
@@ -759,6 +772,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
759
772
  gap: var(--o-gap-3);
760
773
  --phone-padding-top: calc(var(--o-gap-5) + var(--o-gap-3) + var(--o-gap-3));
761
774
  }
775
+
762
776
  .o-loading {
763
777
  .o-layer-mask {
764
778
  background-color: transparent;
@@ -836,6 +850,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
836
850
  @include respond-to('phone') {
837
851
  display: none;
838
852
  }
853
+
839
854
  .el-calendar {
840
855
  min-height: 460px;
841
856
  height: calc(100% - 54px);
@@ -1006,6 +1021,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
1006
1021
  .o-scroller {
1007
1022
  .o-scrollbar-rail {
1008
1023
  right: -16px;
1024
+ height: 100%;
1009
1025
  }
1010
1026
  }
1011
1027
 
@@ -1173,13 +1189,6 @@ const deleteActions = computed<DialogActionT[]>(() => {
1173
1189
  display: flex;
1174
1190
  flex-direction: column;
1175
1191
 
1176
- .o-collapse-item {
1177
- &.last-item {
1178
- .o-collapse-item-header {
1179
- border-bottom: none;
1180
- }
1181
- }
1182
- }
1183
1192
  .o-collapse-item-expanded + .o-collapse-item-expanded {
1184
1193
  margin-top: var(--o-gap-4);
1185
1194
  }
@@ -1233,6 +1242,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
1233
1242
  display: flex;
1234
1243
  align-items: center;
1235
1244
  gap: var(--o-gap-4);
1245
+ position: relative;
1236
1246
 
1237
1247
  .o-collapse-item-icon {
1238
1248
  position: relative;
@@ -1257,6 +1267,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
1257
1267
  flex-direction: column;
1258
1268
  align-items: flex-start;
1259
1269
  justify-content: space-between;
1270
+ margin-bottom: 0;
1260
1271
 
1261
1272
  .item-header-left {
1262
1273
  display: flex;
@@ -1310,6 +1321,7 @@ const deleteActions = computed<DialogActionT[]>(() => {
1310
1321
  max-width: 100%;
1311
1322
  @include text-truncate(1);
1312
1323
  }
1324
+
1313
1325
  .o-tag {
1314
1326
  margin-left: 8px;
1315
1327
  --tag-radius: 4px;
@@ -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
+ };
@@ -67,6 +67,7 @@ const calendar = ref();
67
67
  const calendarHeight = ref<string>('407px');
68
68
  const isLimit = ref(false);
69
69
  const currentDay = ref('');
70
+ const isAutoClick = ref(false);
70
71
  // sig组列表
71
72
  const sig = ref('');
72
73
  const sigOptions = ref<GroupItemT[]>([]);
@@ -162,6 +163,7 @@ const renderData = computed(() => {
162
163
 
163
164
  const getDateData = async (day?: string) => {
164
165
  const date = dayjs(day).format('YYYY-MM-DD');
166
+ currentDay.value = date;
165
167
  getSummitData(date);
166
168
  getActivityData(date);
167
169
  getDateList(date);
@@ -184,7 +186,6 @@ const getDateData = async (day?: string) => {
184
186
  date: date,
185
187
  type: tabType.value,
186
188
  });
187
- currentDay.value = date;
188
189
  };
189
190
 
190
191
  watch([() => tabType.value, () => tabs.value], () => {
@@ -202,6 +203,10 @@ function selectTab() {
202
203
  }
203
204
 
204
205
  const changeMeetingDay = useDebounceFn((day: string, event?: Event) => {
206
+ if (isAutoClick.value) {
207
+ isAutoClick.value = false;
208
+ return;
209
+ }
205
210
  if (new Date(day).getTime() / 1000 < 1610380800) {
206
211
  event?.stopPropagation();
207
212
  return;
@@ -217,7 +222,7 @@ const selectDate = (val: string, date: string) => {
217
222
  }
218
223
  isLimit.value = false;
219
224
  calendar.value.selectDate(val);
220
- changeMeetingDay(calendar.value.selectedDay);
225
+ changeMeetingDay(formatDate(calendar.value.selectedDay));
221
226
  };
222
227
 
223
228
  const removeLeadingZero = (str: string) => {
@@ -249,10 +254,11 @@ onMounted(() => {
249
254
  const stopWatchData = watch(
250
255
  () => allDates.value.length,
251
256
  () => {
252
- if (isClient) {
257
+ if (isClient && !currentDay.value) {
253
258
  nextTick(() => {
254
259
  const activeBoxes = document.querySelector('.is-today .out-box') as HTMLElement;
255
260
  if (activeBoxes) {
261
+ isAutoClick.value = true;
256
262
  activeBoxes.click();
257
263
  stopWatchData();
258
264
  }