From d7c1f85370014357e0a8e18e7100fea98485e8b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Tue, 29 Oct 2024 19:07:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(ywq):=20=E6=96=B0=E5=A2=9E=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E7=AD=BE=E5=90=8D=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加授权签名订单列表 API 接口和相关数据模型 - 实现授权签名订单列表页面组件 - 在授权关系页面添加跳转到订单列表的功能 - 更新路由配置,支持新的订单列表页面 --- .../ets/utils/{TimeHelper.ets => TimeHelper.ts} | 15 ++++++++++++--- src/main/ets/view/SafeView.ets | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) rename src/main/ets/utils/{TimeHelper.ets => TimeHelper.ts} (70%) diff --git a/src/main/ets/utils/TimeHelper.ets b/src/main/ets/utils/TimeHelper.ts similarity index 70% rename from src/main/ets/utils/TimeHelper.ets rename to src/main/ets/utils/TimeHelper.ts index 0a053dd..e0d7373 100644 --- a/src/main/ets/utils/TimeHelper.ets +++ b/src/main/ets/utils/TimeHelper.ts @@ -12,6 +12,7 @@ * D(大写D) 一年中的天数(年份为大写Y起作用) DD-362 * S(大写S) 毫秒 SSS-043 */ + export class TimeHelper { /** * 获取当前时间戳 @@ -26,7 +27,15 @@ export class TimeHelper { * @param formats 时间格式 * 'yyyy年MM月dd日' */ - static getTimeString(formats: string) { - + static formatDate(date: Date, format: string) { + const replacements: { [key: string]: string } = { + YYYY: date.getFullYear().toString(), + MM: String(date.getMonth() + 1).padStart(2, "0"), + DD: String(date.getDate()).padStart(2, "0"), + HH: String(date.getHours()).padStart(2, "0"), + mm: String(date.getMinutes()).padStart(2, "0"), + ss: String(date.getSeconds()).padStart(2, "0") + }; + return format.replace(/YYYY|MM|DD|HH|mm|ss/g, matched => replacements[matched]); } -} \ No newline at end of file +} diff --git a/src/main/ets/view/SafeView.ets b/src/main/ets/view/SafeView.ets index aa800ef..0554aed 100644 --- a/src/main/ets/view/SafeView.ets +++ b/src/main/ets/view/SafeView.ets @@ -98,7 +98,7 @@ export struct SafeView { overflow: TextOverflow.Ellipsis }) .constraintSize({ - maxWidth: 120 + maxWidth: 200 }) Row() {