Skip to content

feat: ✨ DatetimePicker 支持time和date-time类型下配置选择到秒#1117

Merged
Moonofweisheng merged 2 commits into
masterfrom
feat/datetime-picker-support-second
Jun 17, 2025
Merged

feat: ✨ DatetimePicker 支持time和date-time类型下配置选择到秒#1117
Moonofweisheng merged 2 commits into
masterfrom
feat/datetime-picker-support-second

Conversation

@Moonofweisheng

@Moonofweisheng Moonofweisheng commented Jun 17, 2025

Copy link
Copy Markdown
Owner

🤔 这个 PR 的性质是?(至少选择一个)

  • 日常 bug 修复
  • 新特性提交
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • CI/CD 改进
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 代码重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

#844

💡 需求背景和解决方案

添加对秒的支持

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

  • 新功能

    • 日期时间选择器和日期时间选择视图组件新增支持“秒”选择,可通过属性启用,并可设置秒的范围。
    • 文档和示例同步更新,展示如何启用秒选择及其格式变化。
    • 中英文语言包新增“带秒”相关文案。
    • 示例页面新增带秒选择的日期和时间选择器演示。
  • 样式

    • 优化选择器列的横向内边距,使其更紧凑。
  • 测试

    • 增加对“秒”相关功能的单元测试,覆盖属性、范围、格式化等场景。
    • 移除上传组件中关于媒体文件选择的测试用例。

@netlify

netlify Bot commented Jun 17, 2025

Copy link
Copy Markdown

Deploy Preview for wot-design-uni ready!

Name Link
🔨 Latest commit 9bbd54b
🔍 Latest deploy log https://app.netlify.com/projects/wot-design-uni/deploys/6850ff861a389200071c7e29
😎 Deploy Preview https://deploy-preview-1117--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jun 17, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wot-design-uni ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 17, 2025 5:40am

@coderabbitai

coderabbitai Bot commented Jun 17, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

本次变更为日期时间选择器(wd-datetime-pickerwd-datetime-picker-view)组件新增了对“秒”选择的支持。涉及组件文档、类型定义、实现逻辑、演示页面、国际化资源及测试用例的同步更新,涵盖了秒的展示、取值、边界、格式化及相关属性的文档说明和测试覆盖。

Changes

文件/分组 变更摘要
docs/component/datetime-picker*.md, docs/en-US/component/datetime-picker*.md 文档补充:新增 use-second 属性用法说明、示例代码、属性表更新,涵盖 time/datetime 类型支持秒的展示与取值格式。
src/locale/en-US.json, src/locale/zh-CN.json 国际化:新增“日期选择(带秒)”“时间选择(带秒)”相关文案。
src/subPages/datetimePicker/Index.vue, src/subPages/datetimePickerView/Index.vue 演示页面:新增带秒的日期/时间选择器演示及对应的响应式数据。
src/uni_modules/wot-design-uni/components/common/abstracts/variable.scss 样式变量:新增小号侧边距变量,picker 列横向内边距由 15px 调整为 6px。
src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.ts 类型定义:移除 getPickerValue,新增 useSecondminSecondmaxSecond 属性及注释,扩展列类型支持 second。
src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/util.ts 新增 getPickerValue 工具函数,支持根据类型和输入值解析出包含秒的数组。
src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/wd-datetime-picker-view.vue 组件实现:核心逻辑支持秒的选择、边界、值修正、UI 列渲染、事件处理,暴露方法调整。
src/uni_modules/wot-design-uni/components/wd-datetime-picker/types.ts 类型定义:移除 useDefaultSlot/useLabelSlot,新增 useSecondminSecondmaxSecond 属性及注释。
src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue 组件实现:支持秒的相关属性传递、边界校验、格式化输出等。
tests/components/wd-datetime-picker-view.test.ts, tests/components/wd-datetime-picker.test.ts 单元测试:新增多组关于 useSecond 及相关属性、格式化、边界、校验等的测试用例。
tests/composables/useUpload.test.ts 移除媒体文件选择相关测试用例。

Sequence Diagram(s)

sequenceDiagram
    participant 用户
    participant DatetimePicker
    participant DatetimePickerView

    用户->>DatetimePicker: 传入 useSecond, minSecond, maxSecond
    DatetimePicker->>DatetimePickerView: 传递 useSecond, minSecond, maxSecond
    DatetimePickerView->>DatetimePickerView: 渲染秒列(如 useSecond 为 true)
    用户->>DatetimePickerView: 选择时分秒
    DatetimePickerView->>DatetimePicker: 回传包含秒的值
    DatetimePicker->>用户: 格式化后展示带秒的时间/日期
Loading

Poem

兔子点点小秒针,
时间选择更精深。
秒的世界新开启,
格式边界皆细腻。
文档测试皆齐全,
代码如风耳边吟。
秒秒如诗,功能更新! ⏰🐰


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e75f5cb and 9bbd54b.

📒 Files selected for processing (2)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.ts (2 hunks)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker/types.ts (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov-commenter

codecov-commenter commented Jun 17, 2025

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 93.84615% with 8 lines in your changes missing coverage. Please review.

Project coverage is 84.60%. Comparing base (875e072) to head (9bbd54b).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...mponents/wd-datetime-picker/wd-datetime-picker.vue 73.33% 8 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1117      +/-   ##
==========================================
- Coverage   84.94%   84.60%   -0.35%     
==========================================
  Files         215      216       +1     
  Lines       17191    17257      +66     
  Branches     2718     2641      -77     
==========================================
- Hits        14603    14600       -3     
- Misses       2588     2657      +69     
Flag Coverage Δ
h5 84.60% <93.84%> (-0.35%) ⬇️
wd-action-sheet 90.26% <ø> (ø)
wd-backtop 77.12% <ø> (ø)
wd-badge 100.00% <ø> (ø)
wd-button 96.63% <ø> (ø)
wd-calendar 76.79% <ø> (ø)
wd-calendar-view 65.06% <ø> (ø)
wd-card 100.00% <ø> (ø)
wd-cell 88.63% <ø> (ø)
wd-cell-group 91.89% <ø> (ø)
wd-checkbox 80.99% <ø> (ø)
wd-checkbox-group 88.83% <ø> (ø)
wd-circle 95.65% <ø> (ø)
wd-col-picker 79.75% <ø> (ø)
wd-collapse 89.20% <ø> (-0.71%) ⬇️
wd-config-provider 70.31% <ø> (ø)
wd-count-down 94.50% <ø> (ø)
wd-count-to 83.93% <ø> (ø)
wd-curtain 78.57% <ø> (ø)
wd-datetime-picker 72.90% <81.53%> (+0.10%) ⬆️
wd-datetime-picker-view 72.19% <83.50%> (-0.18%) ⬇️
wd-divider 100.00% <ø> (ø)
wd-drop-menu 85.55% <ø> (ø)
wd-fab 58.49% <ø> (ø)
wd-floating-panel 70.32% <ø> (ø)
wd-form 79.11% <79.23%> (-0.06%) ⬇️
wd-gap 100.00% <ø> (ø)
wd-grid 82.12% <ø> (+0.63%) ⬆️
wd-grid-item 80.79% <ø> (ø)
wd-icon 100.00% <ø> (ø)
wd-img 100.00% <ø> (ø)
wd-img-cropper 85.48% <ø> (ø)
wd-index-anchor 80.32% <ø> (ø)
wd-index-bar 93.10% <ø> (ø)
wd-input ?
wd-input-number 74.48% <ø> (ø)
wd-keyboard 89.76% <ø> (ø)
wd-layout 92.22% <ø> (ø)
wd-loading 100.00% <ø> (ø)
wd-loadmore 94.84% <ø> (ø)
wd-message-box 83.55% <ø> (ø)
wd-navbar 85.61% <ø> (ø)
wd-navbar-capsule 81.69% <ø> (ø)
wd-notice-bar 72.99% <ø> (ø)
wd-notify 83.19% <ø> (ø)
wd-number-keyboard 84.79% <ø> (ø)
wd-overlay 88.73% <ø> (ø)
wd-pagination 81.56% <ø> (ø)
wd-password-input 97.72% <ø> (ø)
wd-picker 81.40% <ø> (ø)
wd-picker-view 66.84% <ø> (ø)
wd-popover 73.88% <ø> (ø)
wd-popup 83.91% <ø> (ø)
wd-progress 61.92% <ø> (ø)
wd-radio 93.75% <ø> (ø)
wd-radio-group ?
wd-rate 89.28% <ø> (ø)
wd-resize 79.83% <ø> (ø)
wd-search 72.17% <ø> (ø)
wd-segmented 96.52% <ø> (ø)
wd-select-picker 75.91% <ø> (ø)
wd-sidebar 59.37% <ø> (ø)
wd-signature 58.62% <ø> (ø)
wd-skeleton 98.14% <ø> (ø)
wd-slider 73.62% <ø> (ø)
wd-sort-button 84.54% <ø> (ø)
wd-status-tip 81.81% <ø> (ø)
wd-step 94.68% <ø> (ø)
wd-steps 86.25% <ø> (ø)
wd-sticky 81.07% <ø> (ø)
wd-sticky-box 53.66% <ø> (ø)
wd-swipe-action 53.64% <ø> (ø)
wd-swiper 66.44% <ø> (ø)
wd-swiper-nav 100.00% <ø> (ø)
wd-switch 100.00% <ø> (ø)
wd-tabbar 89.21% <ø> (ø)
wd-table 90.76% <ø> (ø)
wd-tabs ?
wd-tag 85.78% <ø> (ø)
wd-text 100.00% <ø> (ø)
wd-textarea 81.53% <ø> (ø)
wd-toast 84.61% <ø> (ø)
wd-tooltip 74.71% <ø> (ø)
wd-transition 80.97% <ø> (ø)
wd-upload 52.18% <ø> (ø)
wd-video-preview 93.23% <ø> (ø)
wd-watermark 64.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (16)
src/subPages/datetimePickerView/Index.vue (3)

8-10: 缺少 @change 事件导致示例行为不一致

之前的示例均绑定了 @change 便于演示实时反馈,新的秒级日期时间示例未绑定,可能导致交互示例不统一。建议保持一致:

- <wd-datetime-picker-view v-model="value8" use-second />
+ <wd-datetime-picker-view v-model="value8" use-second @change="onChange1" />

28-30: 同上:time 类型秒级示例亦建议补充事件

- <wd-datetime-picker-view type="time" v-model="value9" use-second @change="onChange4" />
+ <wd-datetime-picker-view type="time" v-model="value9" use-second @change="onChange4" />

保持模板风格一致。


55-57: 未使用的响应式变量可能触发 linter 警告

value8value9 仅在模板双向绑定,若未来删除对应组件而遗漏变量,会留下未使用代码。可考虑通过 defineExpose 或注释说明其用途,减少误删风险。

src/subPages/datetimePicker/Index.vue (2)

7-8: 缺少 confirm 处理,示例回调不一致

多数示例均显式绑定 @confirm,而此处省略,阅读者容易误以为无需处理。

- <wd-datetime-picker :label="$t('ri-qi-xuan-ze-dai-miao')" use-second v-model="value18" />
+ <wd-datetime-picker :label="$t('ri-qi-xuan-ze-dai-miao')" use-second v-model="value18"
+   @confirm="handleConfirm1" />

12-13: time 秒级示例同样建议补全 confirm

- <wd-datetime-picker :label="$t('shi-jian-xuan-ze-dai-miao')" v-model="value19" type="time" use-second />
+ <wd-datetime-picker :label="$t('shi-jian-xuan-ze-dai-miao')" v-model="value19" type="time" use-second
+   @confirm="handleConfirm4" />
src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/util.ts (2)

12-18: parseInt 未指定 radix 可能产生隐患

虽然现代浏览器默认十进制,但最佳实践仍建议显式传入基数:

- values.push(parseInt(pair[0]), parseInt(pair[1]))
+ values.push(parseInt(pair[0], 10), parseInt(pair[1], 10))
...
- values.push(parseInt(pair[2]))
+ values.push(parseInt(pair[2], 10))

可避免旧环境或静态检查工具误报。


9-27: 时间字符串格式假设过于宽松

time 分支仅按 : 分割并直接 new Date(value),若传入非法时间字符串(如 24:61)不会被显式拒绝。考虑增加格式/范围校验或在调用方约束。

docs/en-US/component/datetime-picker-view.md (2)

68-77: 示例变量命名容易与上方示例冲突
前面已有 const value / value4 的定义,这里继续复用 value 可能导致读者误以为同一变量被不同格式赋值。
建议在秒级示例中使用独立变量名(如 valueWithSecond),以避免歧义。

-const value = ref<string>('11:12:30')
+const valueWithSecond = ref<string>('11:12:30')

80-88: timestamp 描述略显模糊
文档中多处直接使用 “timestamp” 字样。为避免开发者误判毫秒/秒精度,建议明确说明为 13-位毫秒时间戳

docs/component/datetime-picker-view.md (2)

67-76: 示例变量命名重复
与此前示例变量 value/value4 重名,阅读体验不佳。建议改为 valueWithSecond 等更具语义的新变量名。


78-88: “时间戳” 精度说明缺失
请明确说明此处为 13 位毫秒级时间戳,避免与 10 位秒级混淆。

docs/en-US/component/datetime-picker.md (2)

81-90: 变量名重复 & 语义增强
同类文档中已多次出现 value,此处可改为 valueWithSecond,提高可读性并避免冲突。


92-101: timestamp 精度应进一步说明
建议在文字说明中补充 “13-digit millisecond timestamp”。

docs/component/datetime-picker.md (2)

81-90: 变量命名重复
建议改为 valueWithSecond,避免与上方示例混淆。


92-101: 应标明毫秒级时间戳
为清晰起见,建议注明 “13 位毫秒时间戳”。

src/uni_modules/wot-design-uni/components/wd-datetime-picker/types.ts (1)

80-88: valueKey / labelKey 未配合类型收窄
虽然新增了 key 配置,但下方相关类型仍使用 Record<string, any>[],未与此两项联动收窄类型,导致 IDE 无法感知自定义 key。可考虑暴露范型或在内部进行映射。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6026137 and e75f5cb.

📒 Files selected for processing (17)
  • docs/component/datetime-picker-view.md (2 hunks)
  • docs/component/datetime-picker.md (2 hunks)
  • docs/en-US/component/datetime-picker-view.md (2 hunks)
  • docs/en-US/component/datetime-picker.md (2 hunks)
  • src/locale/en-US.json (2 hunks)
  • src/locale/zh-CN.json (2 hunks)
  • src/subPages/datetimePicker/Index.vue (3 hunks)
  • src/subPages/datetimePickerView/Index.vue (3 hunks)
  • src/uni_modules/wot-design-uni/components/common/abstracts/variable.scss (2 hunks)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.ts (2 hunks)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/util.ts (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/wd-datetime-picker-view.vue (15 hunks)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker/types.ts (2 hunks)
  • src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue (8 hunks)
  • tests/components/wd-datetime-picker-view.test.ts (2 hunks)
  • tests/components/wd-datetime-picker.test.ts (1 hunks)
  • tests/composables/useUpload.test.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • tests/composables/useUpload.test.ts
🧰 Additional context used
🧬 Code Graph Analysis (2)
tests/components/wd-datetime-picker-view.test.ts (1)
src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.ts (2)
  • DatetimePickerViewFormatter (100-100)
  • DatetimePickerViewFilter (98-98)
src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/util.ts (1)
src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.ts (1)
  • DateTimeType (4-4)
🪛 LanguageTool
docs/en-US/component/datetime-picker-view.md

[grammar] ~81-~81: Is an article like ‘a’ or ‘an’ missing?
Context: ...r, minute and second, the binding value is timestamp. ```html <wd-datetime-picker...

(BE_NN)

docs/en-US/component/datetime-picker.md

[grammar] ~94-~94: Is an article like ‘a’ or ‘an’ missing?
Context: ...r, minute and second, the binding value is timestamp. ```html <wd-datetime-picker...

(BE_NN)

⏰ Context from checks skipped due to timeout of 90000ms (24)
  • GitHub Check: Test Components (wd-swiper)
  • GitHub Check: Test Components (wd-img)
  • GitHub Check: Test Components (wd-input-number)
  • GitHub Check: Test Components (wd-config-provider)
  • GitHub Check: Test Components (wd-navbar-capsule)
  • GitHub Check: Test Components (wd-sticky)
  • GitHub Check: Test Components (wd-cell)
  • GitHub Check: Test Components (wd-notice-bar)
  • GitHub Check: Test Components (wd-skeleton)
  • GitHub Check: Test Components (wd-grid-item)
  • GitHub Check: Test Components (wd-form)
  • GitHub Check: Test Components (wd-segmented)
  • GitHub Check: Test Components (wd-tabbar)
  • GitHub Check: Test Components (wd-input)
  • GitHub Check: Test Components (wd-keyboard)
  • GitHub Check: Test Components (wd-signature)
  • GitHub Check: Test Components (wd-card)
  • GitHub Check: Test Components (wd-radio)
  • GitHub Check: Test Components (wd-textarea)
  • GitHub Check: Test Components (wd-cell-group)
  • GitHub Check: Redirect rules - wot-design-uni
  • GitHub Check: Header rules - wot-design-uni
  • GitHub Check: Pages changed - wot-design-uni
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (38)
src/uni_modules/wot-design-uni/components/common/abstracts/variable.scss (2)

87-87: 已添加小尺寸侧边距变量符合预期。
新增 $-size-side-padding-small 用于秒级选择器列的紧凑布局,命名和注释清晰。


442-442: 使用小侧边距变量更新选择器列内间距。
$-picker-column-padding 默认值改为 0 $-size-side-padding-small 显示合理,可确保新增秒列与现有列间距一致紧凑。

src/locale/zh-CN.json (2)

973-973: 新增“日期选择(带秒)”本地化条目。
JSON 格式正确,键名与组件属性命名一致,符合双语文案规范。


1040-1040: 新增“时间选择(带秒)”本地化条目。
格式与其他时间选择条目保持一致,文案明晰易懂。

src/locale/en-US.json (1)

973-973: 确认中英文语言包键值保持同步

新增的 "ri-qi-xuan-ze-dai-miao""shi-jian-xuan-ze-dai-miao" 仅在 en-US.json 中出现,请核对 zh-CN.json 等其它语言包是否也已补充对应条目,避免运行时回退到 key。

Also applies to: 1040-1040

src/subPages/datetimePicker/Index.vue (1)

87-88: 新增数据模型未参与任何业务逻辑

value18value19 仅用于 v-model,若无对应 confirm/change 逻辑,控制台无法观察值变化,示例价值有限。确认是否需要添加日志或交互。

tests/components/wd-datetime-picker-view.test.ts (1)

321-424: 测试用例覆盖完善,赞!
新增秒级相关测试完整验证 props 与 formatter/filter 场景,为新功能提供了可靠安全网。

docs/en-US/component/datetime-picker-view.md (1)

156-156: 占位符版本号需替换
$LOWEST_VERSION$ 仅为占位标记,正式发布前请替换为实际版本号,否则会出现在官网文档。

docs/component/datetime-picker-view.md (1)

156-156: 最低版本占位符未替换
$LOWEST_VERSION$ 需在发布前改成真实版本号。

docs/en-US/component/datetime-picker.md (1)

315-315: 占位符 $LOWEST_VERSION$ 未处理
请在合并前替换为真实版本号,否则最终文档将显示占位文本。

docs/component/datetime-picker.md (1)

320-320: 最低版本号占位符需替换
$LOWEST_VERSION$ 应在发布前改成具体版本号。

src/uni_modules/wot-design-uni/components/wd-datetime-picker/types.ts (1)

79-79: 默认高度与文档不一致
此处 columnsHeight 默认值为 217,而文档写的是 231。请确认哪个才是预期值,并保持代码与文档一致。

tests/components/wd-datetime-picker.test.ts (7)

672-689: 测试用例实现正确

时间类型下的秒显示测试逻辑清晰,正确验证了 useSecond 属性的功能。


691-709: 日期时间类型测试完善

正确测试了日期时间类型下启用秒选择的功能。


710-729: 时间范围限制测试合理

正确验证了时间类型下 minSecondmaxSecond 的边界限制功能。


730-749: 日期时间范围限制测试完善

测试逻辑与时间类型保持一致,覆盖了日期时间类型的秒范围限制。


751-773: 自定义显示格式测试正确

测试验证了启用秒选择时自定义格式化函数的调用,实现合理。


774-793: 范围选择测试完善

正确测试了日期时间范围选择模式下包含秒的时间戳数组。


795-814: 表单验证集成测试合理

测试覆盖了 useSecond 与表单验证属性的集成使用场景。

src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue (5)

104-106: 秒相关属性正确传递

正确地将 useSecondminSecondmaxSecond 属性传递给了两个日期时间选择器视图组件。

Also applies to: 134-136


176-176: 导入路径修正合理

getPickerValue 从类型文件移动到工具文件是更好的代码组织方式。


343-373: 日期时间类型秒边界处理正确

handleBoundaryValue 函数中对日期时间类型的秒边界检查逻辑实现正确,条件判断充分。


407-417: 时间类型秒边界处理完善

时间类型下的秒边界检查逻辑简洁明了,正确处理了小时和分钟相等时的秒边界判断。


748-773: 显示格式化更新合理

根据 useSecond 属性动态调整显示格式,时间和日期时间类型都正确包含了秒的显示。

src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.ts (3)

24-31: 添加有用的属性注释

valueKeylabelKey 添加 JSDoc 注释提高了代码可读性。


72-83: 秒相关属性定义完善

新增的 useSecondminSecondmaxSecond 属性定义合理,注释清晰,默认值设置恰当。


91-91: 列类型扩展正确

'second' 添加到 DatetimePickerViewColumnType 类型定义中,支持秒列的类型标识。

src/uni_modules/wot-design-uni/components/wd-datetime-picker-view/wd-datetime-picker-view.vue (11)

2-16: 模板结构优化合理

移除不必要的包装元素简化了组件结构,提升了性能。


31-33: 导入路径调整正确

类型导入重新组织,getPickerValue 从新的工具文件导入。


159-161: 监听器更新完整

正确添加了对 minSecondmaxSeconduseSecond 属性的监听。


259-265: 时间类型秒范围处理正确

在时间类型下,当 useSecond 为 true 时正确添加了秒的范围配置。


294-299: 日期时间类型秒范围处理完善

在日期时间类型下,条件判断正确,仅在启用秒选择时添加秒范围。


319-332: 时间值修正逻辑完善

correctValue 函数正确处理了启用秒时的时间格式,包括默认值和范围限制。


354-374: 边界计算包含秒处理

getBoundary 函数正确更新以包含秒的边界计算,逻辑完整。


414-424: 时间类型内部值更新正确

updateInnerValue 中时间类型的秒处理逻辑清晰,根据 useSecond 动态构建时间字符串。


450-453: 日期时间类型秒处理完善

在日期时间类型下正确处理了秒值的解析和设置。


481-484: 列变更时秒处理正确

columnChange 函数中正确处理了秒的联动更新。


523-530: 导出方法优化合理

defineExpose 仅导出必要的方法,移除了属性展开,提高了组件封装性。

@github-actions

Copy link
Copy Markdown

组件测试摘要 (H5 平台)

测试时间: Tue Jun 17 05:35:01 UTC 2025

测试结果

组件 状态 覆盖率
wd-action-sheet ✅ 通过 90.04%
wd-backtop ✅ 通过 77.12%
wd-badge ✅ 通过 100%
wd-button ✅ 通过 96.63%
wd-calendar ✅ 通过 76.77%
wd-calendar-view ✅ 通过 65.06%
wd-card ✅ 通过 100%
wd-cell ✅ 通过 88.63%
wd-cell-group ✅ 通过 91.89%
wd-checkbox ✅ 通过 80.99%
wd-checkbox-group ✅ 通过 88.83%
wd-circle ✅ 通过 95.65%
wd-col-picker ✅ 通过 79.65%
wd-collapse ✅ 通过 89.2%
wd-config-provider ✅ 通过 70.31%
wd-count-down ✅ 通过 94.5%
wd-count-to ✅ 通过 83.93%
wd-curtain ✅ 通过 78.29%
wd-datetime-picker ✅ 通过 72.68%
wd-datetime-picker-view ✅ 通过 72.19%
wd-divider ✅ 通过 100%
wd-drop-menu ✅ 通过 85.4%
wd-fab ✅ 通过 58.49%
wd-floating-panel ✅ 通过 70.32%
wd-form ✅ 通过 79.1%
wd-gap ✅ 通过 100%
wd-grid ✅ 通过 81.91%
wd-grid-item ✅ 通过 80.79%
wd-icon ✅ 通过 100%
wd-img ✅ 通过 100%
wd-img-cropper ✅ 通过 85.48%
wd-index-anchor ✅ 通过 80.32%
wd-index-bar ✅ 通过 93.1%
wd-input ✅ 通过 92.42%
wd-input-number ✅ 通过 73.8%
wd-keyboard ✅ 通过 89.61%
wd-layout ✅ 通过 92.22%
wd-loading ✅ 通过 100%
wd-loadmore ✅ 通过 94.84%
wd-message-box ✅ 通过 83.46%
wd-navbar ✅ 通过 85.61%
wd-navbar-capsule ✅ 通过 81.69%
wd-notice-bar ✅ 通过 72.99%
wd-notify ✅ 通过 83.19%
wd-number-keyboard ✅ 通过 84.61%
wd-overlay ✅ 通过 87.32%
wd-pagination ✅ 通过 81.56%
wd-password-input ✅ 通过 97.72%
wd-picker ✅ 通过 81.32%
wd-picker-view ✅ 通过 66.57%
wd-popover ✅ 通过 73.88%
wd-popup ✅ 通过 83.47%
wd-progress ✅ 通过 61.42%
wd-radio ✅ 通过 93.75%
wd-radio-group ✅ 通过 91.44%
wd-rate ✅ 通过 89.28%
wd-resize ✅ 通过 79.83%
wd-search ✅ 通过 72.17%
wd-segmented ✅ 通过 96.52%
wd-select-picker ✅ 通过 75.91%
wd-sidebar ✅ 通过 59.37%
wd-signature ✅ 通过 58.62%
wd-skeleton ✅ 通过 98.14%
wd-slider ✅ 通过 73.62%
wd-sort-button ✅ 通过 84.54%
wd-status-tip ✅ 通过 81.81%
wd-step ✅ 通过 94.37%
wd-steps ✅ 通过 86.25%
wd-sticky ✅ 通过 81.07%
wd-sticky-box ✅ 通过 53.66%
wd-swipe-action ✅ 通过 53.31%
wd-swiper ✅ 通过 66.44%
wd-swiper-nav ✅ 通过 100%
wd-switch ✅ 通过 100%
wd-tabbar ✅ 通过 88.94%
wd-table ✅ 通过 90.58%
wd-tabs ✅ 通过 92.74%
wd-tag ✅ 通过 85.78%
wd-text ✅ 通过 100%
wd-textarea ✅ 通过 81.53%
wd-toast ✅ 通过 84.46%
wd-tooltip ✅ 通过 74.71%
wd-transition ✅ 通过 80.97%
wd-upload ✅ 通过 52.18%
wd-video-preview ✅ 通过 93.23%
wd-watermark ✅ 通过 64.64%

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying wot-design-uni with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9bbd54b
Status:⚡️  Build in progress...

View logs

@Moonofweisheng
Moonofweisheng merged commit f2e8fda into master Jun 17, 2025
7 of 10 checks passed
@Moonofweisheng
Moonofweisheng deleted the feat/datetime-picker-support-second branch June 17, 2025 05:39
@github-actions

Copy link
Copy Markdown

组件测试摘要 (H5 平台)

测试时间: Tue Jun 17 05:44:56 UTC 2025

测试结果

组件 状态 覆盖率
wd-action-sheet ✅ 通过 90.04%
wd-backtop ✅ 通过 77.12%
wd-badge ✅ 通过 100%
wd-button ✅ 通过 96.63%
wd-calendar ✅ 通过 76.77%
wd-calendar-view ✅ 通过 65.06%
wd-card ✅ 通过 100%
wd-cell ✅ 通过 88.63%
wd-cell-group ✅ 通过 91.89%
wd-checkbox ✅ 通过 80.99%
wd-checkbox-group ✅ 通过 88.83%
wd-circle ✅ 通过 95.65%
wd-col-picker ✅ 通过 79.65%
wd-collapse ✅ 通过 89.2%
wd-config-provider ✅ 通过 70.31%
wd-count-down ✅ 通过 94.5%
wd-count-to ✅ 通过 83.93%
wd-curtain ✅ 通过 78.29%
wd-datetime-picker ✅ 通过 72.68%
wd-datetime-picker-view ✅ 通过 72.19%
wd-divider ✅ 通过 100%
wd-drop-menu ✅ 通过 85.4%
wd-fab ✅ 通过 58.49%
wd-floating-panel ✅ 通过 70.32%
wd-form ✅ 通过 79.1%
wd-gap ✅ 通过 100%
wd-grid ✅ 通过 81.91%
wd-grid-item ✅ 通过 80.79%
wd-icon ✅ 通过 100%
wd-img ✅ 通过 100%
wd-img-cropper ✅ 通过 85.48%
wd-index-anchor ✅ 通过 80.32%
wd-index-bar ✅ 通过 93.1%
wd-input ✅ 通过 92.42%
wd-input-number ✅ 通过 73.8%
wd-keyboard ✅ 通过 89.61%
wd-layout ✅ 通过 92.22%
wd-loading ✅ 通过 100%
wd-loadmore ✅ 通过 94.84%
wd-message-box ✅ 通过 83.46%
wd-navbar ✅ 通过 85.61%
wd-navbar-capsule ✅ 通过 81.69%
wd-notice-bar ✅ 通过 72.99%
wd-notify ✅ 通过 83.19%
wd-number-keyboard ✅ 通过 84.61%
wd-overlay ✅ 通过 87.32%
wd-pagination ✅ 通过 81.56%
wd-password-input ✅ 通过 97.72%
wd-picker ✅ 通过 81.32%
wd-picker-view ✅ 通过 66.57%
wd-popover ✅ 通过 73.88%
wd-popup ✅ 通过 83.47%
wd-progress ✅ 通过 61.42%
wd-radio ✅ 通过 93.75%
wd-radio-group ✅ 通过 91.44%
wd-rate ✅ 通过 89.28%
wd-resize ✅ 通过 79.83%
wd-search ✅ 通过 72.17%
wd-segmented ✅ 通过 96.52%
wd-select-picker ✅ 通过 75.91%
wd-sidebar ✅ 通过 59.37%
wd-signature ✅ 通过 58.62%
wd-skeleton ✅ 通过 98.14%
wd-slider ✅ 通过 73.62%
wd-sort-button ✅ 通过 84.54%
wd-status-tip ✅ 通过 81.81%
wd-step ✅ 通过 94.37%
wd-steps ✅ 通过 86.25%
wd-sticky ✅ 通过 81.07%
wd-sticky-box ✅ 通过 53.66%
wd-swipe-action ✅ 通过 53.31%
wd-swiper ✅ 通过 66.44%
wd-swiper-nav ✅ 通过 100%
wd-switch ✅ 通过 100%
wd-tabbar ✅ 通过 88.94%
wd-table ✅ 通过 90.58%
wd-tag ✅ 通过 85.78%
wd-text ✅ 通过 100%
wd-textarea ✅ 通过 81.53%
wd-toast ✅ 通过 84.46%
wd-tooltip ✅ 通过 74.71%
wd-transition ✅ 通过 80.97%
wd-upload ✅ 通过 52.18%
wd-video-preview ✅ 通过 93.23%
wd-watermark ✅ 通过 64.64%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants