feat(schedule):优化日程编辑与展示功能- 新建日程时默认时间设置为当前时间加6分钟

- 增加日程保存前的时间校验逻辑,防止过去时间及临界时间创建- 日程列表项增加滑动删除功能
- 限制日程备注输入长度不超过100字符
- 调整文件目录结构,将反馈和日程相关页面移至modules目录下
- 更新路由引用路径以适配新的文件位置
-修复Sentry异常信息记录不准确的问题
- SwipeView组件支持更多自定义边距和圆角配置
这个提交包含在:
徐勤民 2025-11-17 17:05:51 +08:00
父节点 4e3c66dfef
当前提交 1517d982e0

查看文件

@ -3,7 +3,13 @@ import { SZYXLocalStorageHelper, ToolsHelper } from '../../../../Index'
@Component @Component
export struct SwipeView { export struct SwipeView {
private _scroller: Scroller = new Scroller() private _scroller: Scroller = new Scroller()
@State h: Length = 40 @State h: number = 40
marginBottom: number = 0
marginTop: number = 0
brtLeft: number = 0
brtRight: number = 0
brbLeft: number = 0
brbRight: number = 0
@State downX: number = 0 @State downX: number = 0
onItemClick?: () => void onItemClick?: () => void
onDelete?: () => void onDelete?: () => void
@ -23,6 +29,16 @@ export struct SwipeView {
doNothingBuilder() { doNothingBuilder() {
} }
toNumber(len?: Length): number {
if (typeof len === "number") {
return len;
}
if (typeof len === "string") {
return Number(len);
}
return 70
}
@BuilderParam customBuilderParam: () => void = this.doNothingBuilder @BuilderParam customBuilderParam: () => void = this.doNothingBuilder
// @BuilderParam btnBuilder: () => void = this.doNothingBuilder // @BuilderParam btnBuilder: () => void = this.doNothingBuilder
@ -45,9 +61,15 @@ export struct SwipeView {
.backgroundColor('red') .backgroundColor('red')
.width(70) .width(70)
.fontColor('white') .fontColor('white')
.height(this.h) .height(this.h - this.marginBottom - this.marginTop)
.textAlign(TextAlign.Center) .textAlign(TextAlign.Center)
.fontSize(16) .fontSize(16)
.borderRadius({
topLeft: this.brtLeft,
topRight: this.brtRight,
bottomLeft: this.brbLeft,
bottomRight: this.brbRight
})
.onClick(() => { .onClick(() => {
// SZYXLocalStorageHelper.storage.setOrCreate('XBasicSwipeClick', this.ids) // SZYXLocalStorageHelper.storage.setOrCreate('XBasicSwipeClick', this.ids)
this._scroller.scrollTo({ this._scroller.scrollTo({
@ -56,14 +78,8 @@ export struct SwipeView {
}) })
this.onDelete && this.onDelete() this.onDelete && this.onDelete()
}) })
// if (this.btnBuilder === this.doNothingBuilder) {
// Text('删除')
// }
// if (this.btnBuilder !== this.doNothingBuilder) {
// this.btnBuilder()
// }
}.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => { }.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => {
this.h = newValue.height ?? 40 this.h = this.toNumber(newValue.height) ?? 40
}).alignItems(VerticalAlign.Center) }).alignItems(VerticalAlign.Center)
}.width('100%').scrollable(ScrollDirection.Horizontal).scrollBar(BarState.Off) }.width('100%').scrollable(ScrollDirection.Horizontal).scrollBar(BarState.Off)