Skip to content

Commit

Permalink
fix: 修复日期时间选择器的属性配置联动
Browse files Browse the repository at this point in the history
  • Loading branch information
YufJi committed Mar 18, 2024
1 parent 7a92fa8 commit 8ed27db
Showing 1 changed file with 69 additions and 39 deletions.
108 changes: 69 additions & 39 deletions src/datetime-picker/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ namespace nasl.ui {
title: 'undefined',
description: '打开'
})
open(): any {}
open(): any { }
@Method({
title: 'undefined',
description: '关闭'
})
close(): any {}
close(): any { }
}
export class VanDatetimePickerOptions extends ViewComponentOptions {
@Prop({
Expand Down Expand Up @@ -52,19 +52,26 @@ namespace nasl.ui {
setter: {
concept: "EnumSelectSetter",
options: [{
title: '日期'
title: '日期',
if: _ => _.type === 'date'
}, {
title: '周'
title: '周',
if: _ => _.type === 'date'
}, {
title: '月份'
title: '月份',
if: _ => _.type === 'date'
}, {
title: '季度'
title: '季度',
if: _ => _.type === 'date'
}, {
title: '年份'
title: '年份',
if: _ => _.type === 'date'
}, {
title: '分'
title: '分',
if: _ => _.type !== 'date'
}, {
title: '秒'
title: '秒',
if: _ => _.type !== 'date'
}]
},
onChange: [{
Expand All @@ -77,54 +84,77 @@ namespace nasl.ui {
setter: {
concept: "EnumSelectSetter",
options: [{
title: '中国(2023年7月26日)'
title: '中国(2023年7月26日)',
if: _ => _.type === 'date' && _.unit === 'date'
}, {
title: 'ISO(2023-07-26)'
title: 'ISO(2023-07-26)',
if: _ => _.type === 'date' && _.unit === 'date'
}, {
title: 'US(7/26/2023)'
title: 'US(7/26/2023)',
if: _ => _.type === 'date' && _.unit === 'date'
}, {
title: 'EU(26/7/2023)'
title: 'EU(26/7/2023)',
if: _ => _.type === 'date' && _.unit === 'date'
}, {
title: '2023-28周'
title: '2023-28周',
if: _ => _.type === 'date' && _.unit === 'week'
}, {
title: '2023年第28周'
title: '2023年第28周',
if: _ => _.type === 'date' && _.unit === 'week'
}, {
title: '2023-W28'
title: '2023-W28',
if: _ => _.type === 'date' && _.unit === 'week'
}, {
title: '中国(2023年7月)'
title: '中国(2023年7月)',
if: _ => _.type === 'date' && _.unit === 'month'
}, {
title: 'ISO(2023-07)'
title: 'ISO(2023-07)',
if: _ => _.type === 'date' && _.unit === 'month'
}, {
title: 'US/EU(7/2023)'
title: 'US/EU(7/2023)',
if: _ => _.type === 'date' && _.unit === 'month'
}, {
title: '2023年第3季度'
title: '2023年第3季度',
if: _ => _.type === 'date' && _.unit === 'quarter'
}, {
title: '2023年Q3'
title: '2023年Q3',
if: _ => _.type === 'date' && _.unit === 'quarter'
}, {
title: '2023-Q3'
title: '2023-Q3',
if: _ => _.type === 'date' && _.unit === 'quarter'
}, {
title: '中国(2023年)'
title: '中国(2023年)',
if: _ => _.type === 'date' && _.unit === 'year'
}, {
title: 'ISO(2023)'
title: 'ISO(2023)',
if: _ => _.type === 'date' && _.unit === 'year'
}, {
title: '12:09:09'
title: '12:09:09',
if: _ => _.type === 'time' && _.unit === 'second'
}, {
title: '12时09分09秒'
title: '12时09分09秒',
if: _ => _.type === 'time' && _.unit === 'second'
}, {
title: '12:09'
title: '12:09',
if: _ => _.type === 'time' && _.unit === 'minute'
}, {
title: '12时09分'
title: '12时09分',
if: _ => _.type === 'time' && _.unit === 'minute'
}, {
title: '2023-07-26 12:09:09'
title: '2023-07-26 12:09:09',
if: _ => _.type === 'datetime' && _.unit === 'second'
}, {
title: '2023年7月26日 12时09分09秒'
title: '2023年7月26日 12时09分09秒',
if: _ => _.type === 'datetime' && _.unit === 'second'
}, {
title: '2023-07-26 12:09'
title: '2023-07-26 12:09',
if: _ => _.type === 'datetime' && _.unit === 'minute'
}, {
title: '2023年7月26日 12时09分'
title: '2023年7月26日 12时09分',
if: _ => _.type === 'datetime' && _.unit === 'minute'
}]
},
if: _ => _.advancedFormat.enable === false
if: _ => !_.advancedFormat.enable
})
showFormatter: 'YYYY年M月D日' | 'YYYY-MM-DD' | 'M/D/YYYY' | 'D/M/YYYY' | 'GGGG-W周' | 'GGGG年第W周' | 'GGGG-WWWW' | 'YYYY年M月' | 'YYYY-MM' | 'M/YYYY' | 'YYYY年第Q季度' | 'YYYY年QQ' | 'YYYY-QQ' | 'YYYY年' | 'YYYY' | 'HH:mm:ss' | 'HH时mm分ss秒' | 'HH:mm' | 'HH时mm分' | 'YYYY-MM-DD HH:mm:ss' | 'YYYY年M月D日 HH时mm分ss秒' | 'YYYY-MM-DD HH:mm HH:mm' | 'YYYY年M月D日 HH时mm分';
@Prop({
Expand All @@ -135,9 +165,9 @@ namespace nasl.ui {
enable: nasl.core.Boolean;
value: nasl.core.String;
} = {
enable: false,
value: ''
};
enable: false,
value: ''
};
@Prop({
title: '区间选择',
description: '是否支持区间选择',
Expand Down Expand Up @@ -237,7 +267,7 @@ namespace nasl.ui {
setter: {
concept: "EnumSelectSetter",
options: [{
title: 'yyyy/MM/dd HH:mm:ss'
title: 'YYYY/MM/dd HH:mm:ss'
}, {
title: 'Unix 时间戳'
}, {
Expand Down Expand Up @@ -315,12 +345,12 @@ namespace nasl.ui {
title: '确认',
description: '点击完成按钮时触发的事件'
})
onConfirm: (event: nasl.core.String) => any ;
onConfirm: (event: nasl.core.String) => any;
@Event({
title: '取消',
description: '点击完成取消时触发的事件'
})
onCancel: (event: any) => any ;
onCancel: (event: any) => any;

@Slot({
title: '',
Expand Down

0 comments on commit 8ed27db

Please sign in to comment.