包含多个会话的累积代码变更: - backend: AI 聊天服务、触发器调度、认证增强、WebSocket、调度器最小间隔 - admin-web: ETL 状态页、任务管理、调度配置、登录优化 - miniprogram: 看板页面、聊天集成、UI 组件、导航更新 - etl: DWS 新任务(finance_area_daily/board_cache)、连接器增强 - tenant-admin: 项目初始化 - db: 19 个迁移脚本(etl_feiqiu 11 + zqyy_app 8) - packages/shared: 枚举和工具函数更新 - tools: 数据库工具、报表生成、健康检查 - docs: PRD/架构/部署/合约文档更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
82 lines
2.4 KiB
Markdown
82 lines
2.4 KiB
Markdown
# P6→NS1/RNS1 缺失项 #9:备注输入框的字数限制和实时计数
|
||
|
||
## 简要结论
|
||
- 状态:⚠️ 部分解决
|
||
- 风险等级:🟠 中
|
||
- 已实现字数限制(maxlength=500),但缺少实时字数计数展示(如「128/500」)。
|
||
|
||
## 详细审查
|
||
|
||
### 审查范围
|
||
- `apps/miniprogram/miniprogram/components/note-modal/note-modal.wxml` — 备注弹窗模板
|
||
- `apps/miniprogram/miniprogram/components/note-modal/note-modal.ts` — 备注弹窗逻辑
|
||
- `apps/miniprogram/miniprogram/components/abandon-modal/abandon-modal.wxml` — 放弃弹窗(对比)
|
||
|
||
### 发现
|
||
|
||
**字数限制(已实现):**
|
||
|
||
note-modal 的 textarea 设置了 `maxlength="500"`:
|
||
```html
|
||
<textarea
|
||
class="note-textarea"
|
||
placeholder="请输入备注内容..."
|
||
maxlength="500"
|
||
...
|
||
/>
|
||
```
|
||
|
||
abandon-modal 的 textarea 设置了 `maxlength="200"`:
|
||
```html
|
||
<textarea
|
||
class="abandon-textarea"
|
||
placeholder="请输入放弃原因(必填)"
|
||
maxlength="200"
|
||
...
|
||
/>
|
||
```
|
||
|
||
**实时字数计数(未实现):**
|
||
|
||
两个弹窗均未显示当前输入字数和剩余字数。P6 定义了实时计数展示(如输入框右下角显示「128/500」),当前实现中:
|
||
- `note-modal.ts` 的 `onContentInput` 仅更新 `content` 值,未计算或展示字数
|
||
- WXML 中无字数计数的 `<text>` 元素
|
||
- WXSS 中无字数计数的样式定义
|
||
|
||
### 证据
|
||
|
||
note-modal.ts 中的输入处理(无字数计数):
|
||
```typescript
|
||
onContentInput(e: WechatMiniprogram.CustomEvent<{ value: string }>) {
|
||
this.setData({ content: e.detail.value })
|
||
}
|
||
```
|
||
|
||
note-modal.wxml 中 textarea 区域(无计数展示):
|
||
```html
|
||
<view class="textarea-section">
|
||
<textarea
|
||
class="note-textarea"
|
||
placeholder="请输入备注内容..."
|
||
value="{{content}}"
|
||
bindinput="onContentInput"
|
||
maxlength="500"
|
||
auto-height
|
||
...
|
||
/>
|
||
<!-- 此处缺少字数计数展示 -->
|
||
</view>
|
||
```
|
||
|
||
### 建议(如未完全解决)
|
||
1. 在 note-modal 的 textarea 下方添加字数计数:
|
||
```html
|
||
<text class="char-count">{{content.length}}/500</text>
|
||
```
|
||
2. 在 abandon-modal 的 textarea 下方添加字数计数:
|
||
```html
|
||
<text class="char-count">{{content.length}}/200</text>
|
||
```
|
||
3. 样式建议:右对齐、小字号(22rpx)、灰色(#a6a6a6),接近限制时变橙/红色
|
||
4. 可在 `onContentInput` 中添加接近限制的提示逻辑(如剩余 20 字时变色)
|