@opendesign-plus-test/components 0.0.1-rc.57 → 0.0.1-rc.58

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendesign-plus-test/components",
3
- "version": "0.0.1-rc.57",
3
+ "version": "0.0.1-rc.58",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -410,7 +410,7 @@ const confirmDelete = () => {
410
410
  }
411
411
  dialogLoading.value = true;
412
412
  props.deleteActivityRequest(currentRow.value?.id)
413
- .then((flag) => {
413
+ .then((flag: any) => {
414
414
  if (typeof flag === 'boolean' && !flag) {
415
415
  return;
416
416
  }
@@ -35,6 +35,7 @@ export interface NavItemT {
35
35
  withPicture: boolean; // 快捷链接是否显示缩略图
36
36
  children: ChildrenItemT[]; // 导航子项
37
37
  shortcut: ShortcutItemT[]; // 右侧快捷链接
38
+ tag?: string; // 标签
38
39
  }
39
40
 
40
41
  export interface CodeItemT {
@@ -19,7 +19,15 @@ import {
19
19
  } from '@opensig/opendesign';
20
20
  import IconHelp from '~icons/meeting/icon-help.svg';
21
21
  import IconTip from '~icons/meeting/icon-tip.svg';
22
- import { CycleSubItemT, MeetingFormPropsT, MeetingGroupType, MeetingPostT, OptionItemT, PlatformT } from './types';
22
+ import {
23
+ CycleSubItemT,
24
+ MeetingFormPropsT,
25
+ MeetingGroupType,
26
+ MeetingItemT,
27
+ MeetingPostT,
28
+ OptionItemT,
29
+ PlatformT,
30
+ } from './types';
23
31
  import dayjs from 'dayjs';
24
32
  import { findLabelFromOptions, formatDateNumber, getDateNumber } from './utils';
25
33
  import { EMAIL_REGEX, INTERVAL_DAY, INTERVAL_MONTH, INTERVAL_WEEK } from './config';
@@ -31,8 +39,6 @@ import { ValidatorResultT } from '@opensig/opendesign/lib/form/types';
31
39
  const { t, locale, cycleTypeOptions0, intervalWeekOptions, getPlatformLabel } = useMeetingConfig();
32
40
 
33
41
  const props = withDefaults(defineProps<MeetingFormPropsT>(), {
34
- isSub: false,
35
- isEdit: false,
36
42
  showBtns: true,
37
43
  groupType: MeetingGroupType.SIG,
38
44
  });
@@ -41,6 +47,8 @@ const message = useMessage(null);
41
47
  const cycleTypeOptions = cycleTypeOptions0;
42
48
  const weekOptions = intervalWeekOptions;
43
49
 
50
+ const isEdit = computed(() => Object.keys(props?.data || {}).length > 0);
51
+ const isSub = computed(() => !!props.subId);
44
52
  const intervalTypeMax = computed(() => {
45
53
  return findLabelFromOptions(form.value.cycle_type, cycleTypeOptions.value, 'max');
46
54
  });
@@ -202,7 +210,7 @@ const rules = computed<Record<string, RulesT[]>>(() => {
202
210
  email_list: [
203
211
  {
204
212
  validator: (value: any) => {
205
- if (props.isEdit) {
213
+ if (isEdit.value) {
206
214
  return {} as unknown as ValidatorResultT;
207
215
  }
208
216
  const str = value.replaceAll(' ', '').replaceAll(',', ';') || '';
@@ -287,7 +295,7 @@ const getPropData = () => {
287
295
  ...(is_cycle
288
296
  ? {
289
297
  date_range: [cycle_start_date, cycle_end_date],
290
- cycle_point: cycle_point?.map((v) => parseInt(v)) || [],
298
+ cycle_point: cycle_point?.map((v) => parseInt(v as unknown as string)) || [],
291
299
  cycle_interval: cycle_interval || 1,
292
300
  time: `${ cycle_start }-${ cycle_end }`,
293
301
  start: cycle_start,
@@ -301,13 +309,13 @@ watch(
301
309
  () => props.data,
302
310
  (data) => {
303
311
  if (data) {
304
- const propData = getPropData() as unknown as CycleSubItemT;
305
- const sub = propData?.cycle_sub?.find((v) => v.sub_id === (props.subId || propData.sub_id)) || {} as unknown as CycleSubItemT;
312
+ const propData = getPropData() as unknown as MeetingItemT;
313
+ const sub = propData?.cycle_sub?.find((v) => v.sub_id === (props.subId)) || {} as unknown as CycleSubItemT;
306
314
  const { mid, date, start, end, sub_id } = sub;
307
315
  Object.assign(
308
316
  form.value,
309
317
  propData,
310
- props.isSub
318
+ isSub.value
311
319
  ? {
312
320
  is_cycle: false,
313
321
  mid,
@@ -373,7 +381,7 @@ const changeIsCycle = () => {
373
381
 
374
382
  const { lePadV } = useScreen();
375
383
  const confirm = async () => {
376
- let type = props.isEdit ? t('meeting.editSuccess') : t('meeting.booSuccess');
384
+ let type = isEdit.value ? t('meeting.editSuccess') : t('meeting.booSuccess');
377
385
  try {
378
386
  loading.value = true;
379
387
  const valid = await formRef.value.validate();
@@ -431,8 +439,8 @@ const confirm = async () => {
431
439
  end,
432
440
  };
433
441
  }
434
- if (props.isEdit) {
435
- if (props.isSub) {
442
+ if (isEdit.value) {
443
+ if (isSub.value) {
436
444
  const { mid, sub_id } = form.value;
437
445
  const { date, start, end } = params;
438
446
  flag = await props?.editSubMeetingRequest(sub_id, {
@@ -482,7 +490,7 @@ onMounted(() => {
482
490
 
483
491
  const changeSig = (sig: any) => {
484
492
  const find = sigOptions.value.find((v) => v.value === sig);
485
- if (!props.isEdit) {
493
+ if (!isEdit.value) {
486
494
  form.value.etherpad = find?.etherpad || '';
487
495
  form.value.email_list = find?.email_list || '';
488
496
  }
@@ -90,7 +90,11 @@ const computedList = computed<any[]>(() => {
90
90
  dateRange = `${ formatDate(v.start_date) } ${ v.start }-${ formatDate(v.end_date) } ${ v.end }`;
91
91
  }
92
92
  } else {
93
- dateRange = `${ formatDate(v.start_date, 'YYYY/MM/DD') } ${ formatDate(v.end_date, 'YYYY/MM/DD') }`;
93
+ if (v.start_date === v.end_date) {
94
+ dateRange = formatDate(v.start_date, 'YYYY/MM/DD');
95
+ } else {
96
+ dateRange = `${ formatDate(v.start_date, 'YYYY/MM/DD') }-${ formatDate(v.end_date, 'YYYY/MM/DD') }`;
97
+ }
94
98
  }
95
99
 
96
100
  return {
@@ -88,8 +88,6 @@ export interface MeetingPostT {
88
88
 
89
89
  export interface MeetingFormPropsT {
90
90
  data?: MeetingItemT;
91
- isSub?: boolean;
92
- isEdit?: boolean;
93
91
  subId?: string;
94
92
  createMeetingRequest: any,
95
93
  editMeetingRequest: any;