@agile-team/wl-skills-kit 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -63
- package/README.md +15 -148
- package/bin/wl-skills.js +2 -100
- package/files/.github/guides/README.md +13 -13
- package/files/.github/guides/architecture.md +555 -576
- package/files/.github/guides/usage.md +176 -176
- package/files/.github/reports/README.md +65 -65
- package/files/.github/reports/SYS_DICT_INFO.md +50 -50
- package/files/.github/reports/SYS_MENU_INFO.md +247 -247
- package/files/.github/reports/SYS_PERMISSION_INFO.md +20 -20
- package/files/.github/reports//347/273/204/344/273/266/346/217/220/345/217/226/345/273/272/350/256/256.md +33 -33
- package/files/.github/reports//350/247/204/350/214/203/345/256/241/346/237/245/346/212/245/345/221/212.md +44 -44
- package/files/.github/skills/_compat/README.md +108 -108
- package/files/.github/skills/_compat/headers/agents.txt +8 -8
- package/files/.github/skills/_compat/headers/claude-code.txt +7 -7
- package/files/.github/skills/_compat/headers/cline.txt +7 -7
- package/files/.github/skills/_compat/headers/cursor-mdc.txt +16 -16
- package/files/.github/skills/_compat/headers/cursor-rules.txt +7 -7
- package/files/.github/skills/_compat/headers/github-copilot.txt +1 -1
- package/files/.github/skills/_compat/headers/kiro.txt +10 -10
- package/files/.github/skills/_compat/headers/trae.txt +11 -11
- package/files/.github/skills/_compat/headers/windsurf.txt +7 -7
- package/files/.github/skills/_registry.md +81 -81
- package/files/.github/skills/core/api-contract/SKILL.md +344 -344
- package/files/.github/skills/core/api-contract/USAGE.md +110 -110
- package/files/.github/skills/core/convention-audit/SKILL.md +189 -189
- package/files/.github/skills/core/convention-audit/USAGE.md +99 -99
- package/files/.github/skills/core/page-codegen/SKILL.md +973 -973
- package/files/.github/skills/core/page-codegen/USAGE.md +102 -102
- package/files/.github/skills/core/page-codegen/templates/_index.md +46 -46
- package/files/.github/skills/core/page-codegen/templates/domains/_CONTRIBUTING.md +107 -107
- package/files/.github/skills/core/page-codegen/templates/domains/produce/TPL-OPERATION-STATION.md +442 -442
- package/files/.github/skills/core/page-codegen/templates/domains/sale/README.md +26 -26
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-CHANGE-HISTORY.md +276 -276
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-DETAIL-TABS.md +1145 -1145
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-DRIVEN.md +124 -124
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-FORM-ROUTE.md +436 -436
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-LIST.md +191 -191
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-MASTER-DETAIL.md +148 -148
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-RECORD-FORM.md +376 -376
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-TREE-LIST.md +186 -186
- package/files/.github/skills/core/prototype-scan/SKILL.md +498 -498
- package/files/.github/skills/core/prototype-scan/USAGE.md +95 -95
- package/files/.github/skills/core/template-extract/SKILL.md +139 -139
- package/files/.github/skills/core/template-extract/USAGE.md +93 -93
- package/files/.github/skills/domain/README.md +51 -51
- package/files/.github/skills/sync/menu-sync/SKILL.md +263 -263
- package/files/.github/skills/sync/menu-sync/USAGE.md +104 -104
- package/files/.github/skills/sync/menu-sync/env/env.local.json +7 -7
- package/files/.github/skills/sync/menu-sync/env/guide.md +99 -99
- package/files/.github/skills/sync/permission-sync/SKILL.draft.md +91 -91
- package/files/.github/standards/01-toolchain.md +57 -57
- package/files/.github/standards/02-code-structure.md +111 -111
- package/files/.github/standards/03-comments.md +53 -53
- package/files/.github/standards/04-coding-basics.md +33 -33
- package/files/.github/standards/05-logging.md +38 -38
- package/files/.github/standards/06-security.md +44 -44
- package/files/.github/standards/07-config.md +52 -52
- package/files/.github/standards/08-git.md +60 -60
- package/files/.github/standards/09-typescript.md +71 -71
- package/files/.github/standards/10-pinia.md +57 -57
- package/files/.github/standards/11-form-validation.md +81 -81
- package/files/.github/standards/12-base-table.md +153 -153
- package/files/.github/standards/13-platform-components.md +123 -123
- package/files/.github/standards/index.md +89 -89
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/api.md +1 -1
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/data.ts +196 -196
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.scss +150 -150
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.vue +79 -79
- package/files/docs/jh-date-range.md +257 -257
- package/files/docs/jh-date.md +222 -222
- package/files/docs/jh-dept-picker.md +190 -190
- package/files/docs/jh-drag-row.md +590 -590
- package/files/docs/jh-file-upload.md +216 -216
- package/files/docs/jh-picker.md +218 -218
- package/files/docs/jh-select.md +148 -148
- package/files/docs/jh-text.md +248 -248
- package/files/docs/jh-user-picker.md +197 -197
- package/files/docs/request.md +24 -9
- package/files/src/components/global/C_RightToolbar/data.ts +228 -0
- package/files/src/components/global/C_RightToolbar/index.scss +44 -0
- package/files/src/components/global/C_RightToolbar/index.vue +34 -336
- package/files/src/components/global/C_Splitter/index.scss +61 -0
- package/files/src/components/global/C_Splitter/index.vue +2 -64
- package/files/src/components/global/C_SvgIcon/index.scss +15 -0
- package/files/src/components/global/C_SvgIcon/index.vue +20 -50
- package/files/src/components/global/C_TagStatus/index.scss +20 -0
- package/files/src/components/global/C_TagStatus/index.vue +1 -22
- package/files/src/components/global/C_Tree/data.ts +61 -0
- package/files/src/components/global/C_Tree/index.vue +12 -53
- package/files/src/components/local/c_listModal/index.scss +4 -0
- package/files/src/components/local/c_listModal/index.vue +1 -1
- package/package.json +5 -9
package/files/docs/jh-date.md
CHANGED
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
# jh-date - 日期选择组件
|
|
2
|
-
|
|
3
|
-
> 平台统一的日期选择组件,封装常用日期选择交互与默认格式,适用于表单、查询条件等需要选择单个日期的场景
|
|
4
|
-
|
|
5
|
-
## 📦 组件位置
|
|
6
|
-
|
|
7
|
-
```ts
|
|
8
|
-
import "@jhlc/common-core";
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
组件已全局注册,可直接在模板中使用 `<jh-date />`。
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 基本用法
|
|
16
|
-
|
|
17
|
-
### 1️⃣ 选择单个日期(最常用)
|
|
18
|
-
|
|
19
|
-
```vue
|
|
20
|
-
<template>
|
|
21
|
-
<jh-date v-model="form.date" placeholder="请选择日期" />
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script setup lang="ts">
|
|
25
|
-
import { ref } from "vue";
|
|
26
|
-
|
|
27
|
-
const form = ref({
|
|
28
|
-
date: ""
|
|
29
|
-
});
|
|
30
|
-
</script>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
### 2️⃣ 查询条件使用
|
|
36
|
-
|
|
37
|
-
```vue
|
|
38
|
-
<jh-date v-model="query.bizDate" placeholder="业务日期" clearable />
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Props 属性
|
|
44
|
-
|
|
45
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
46
|
-
| -------------------- | ---------------------------- | --------------------------------------- | -------------- |
|
|
47
|
-
| modelValue / v-model | 绑定值 | `string \| Date` | - |
|
|
48
|
-
| placeholder | 占位提示 | `string` | `"请选择日期"` |
|
|
49
|
-
| type | 日期类型 | `"date" \| "week" \| "month" \| "year"` | `"date"` |
|
|
50
|
-
| format | 绑定值格式(返回给 v-model) | `string` | `"YYYY-MM-DD"` |
|
|
51
|
-
| showFormat | 显示格式 | `string` | `"YYYY-MM-DD"` |
|
|
52
|
-
| disabled | 是否禁用 | `boolean` | `false` |
|
|
53
|
-
| clearable | 是否可清空 | `boolean` | `true` |
|
|
54
|
-
| teleported | 是否将下拉面板插入 body | `boolean` | `true` |
|
|
55
|
-
|
|
56
|
-
> **提示**: `valueFormat` 为 Element Plus 原生属性,此处统一使用 `format` 属性代替,控制返回值格式。
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Events 事件
|
|
61
|
-
|
|
62
|
-
| 事件名 | 说明 | 回调参数 |
|
|
63
|
-
| ----------------- | -------------- | ----------------- |
|
|
64
|
-
| change | 日期变化时触发 | `(value) => void` |
|
|
65
|
-
| update:modelValue | v-model 更新 | `(value) => void` |
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## 常见场景
|
|
70
|
-
|
|
71
|
-
### 场景 1:表单录入日期
|
|
72
|
-
|
|
73
|
-
```vue
|
|
74
|
-
<jh-date v-model="form.deliveryDate" placeholder="请选择交期" />
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
### 场景 2:列表查询日期
|
|
80
|
-
|
|
81
|
-
```vue
|
|
82
|
-
<jh-date v-model="query.createDate" placeholder="创建日期" />
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
### 场景 3:详情页日期展示(配合 jh-text / 普通文本)
|
|
88
|
-
|
|
89
|
-
```vue
|
|
90
|
-
<span>{{ detail.bizDate }}</span>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
> ⚠️ `jh-date` 仅用于选择,详情展示建议直接展示字符串或统一格式化后展示
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
### 场景 3:BaseQuery 配置式用法
|
|
98
|
-
|
|
99
|
-
```ts
|
|
100
|
-
// data.ts 查询项配置
|
|
101
|
-
export const queryItemsConfig: BaseQueryItemDesc<any>[] = [
|
|
102
|
-
{
|
|
103
|
-
name: "deliveryDate",
|
|
104
|
-
label: "交期日期",
|
|
105
|
-
component: () => {
|
|
106
|
-
return {
|
|
107
|
-
tag: "jh-date",
|
|
108
|
-
type: "date",
|
|
109
|
-
showFormat: "YYYY-MM-DD",
|
|
110
|
-
valueFormat: "YYYY-MM-DD" // 或使用 format
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: "month",
|
|
116
|
-
label: "月份",
|
|
117
|
-
component: () => {
|
|
118
|
-
return {
|
|
119
|
-
tag: "jh-date",
|
|
120
|
-
type: "month",
|
|
121
|
-
showFormat: "YYYY-MM",
|
|
122
|
-
valueFormat: "YYYY-MM"
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
];
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## 与 el-date-picker 对比
|
|
132
|
-
|
|
133
|
-
### 使用 jh-date(推荐)
|
|
134
|
-
|
|
135
|
-
```vue
|
|
136
|
-
<jh-date v-model="form.date" />
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
✅ 统一默认格式
|
|
140
|
-
✅ 简化 props 配置
|
|
141
|
-
✅ 风格一致
|
|
142
|
-
|
|
143
|
-
### 使用 el-date-picker(不推荐)
|
|
144
|
-
|
|
145
|
-
```vue
|
|
146
|
-
<el-date-picker
|
|
147
|
-
v-model="form.date"
|
|
148
|
-
type="date"
|
|
149
|
-
value-format="YYYY-MM-DD"
|
|
150
|
-
format="YYYY-MM-DD"
|
|
151
|
-
/>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
❌ 每处都要重复配置格式
|
|
155
|
-
❌ 样式与交互不统一
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## 最佳实践
|
|
160
|
-
|
|
161
|
-
### 1️⃣ 统一返回字符串格式
|
|
162
|
-
|
|
163
|
-
推荐保持 `valueFormat="YYYY-MM-DD"`,避免 Date / string 混用:
|
|
164
|
-
|
|
165
|
-
```vue
|
|
166
|
-
<jh-date v-model="form.date" value-format="YYYY-MM-DD" />
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
### 2️⃣ 查询条件优先可清空
|
|
172
|
-
|
|
173
|
-
```vue
|
|
174
|
-
<jh-date v-model="query.date" clearable />
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### 3️⃣ 与日期范围选择区分使用
|
|
180
|
-
|
|
181
|
-
- 单个日期:`jh-date`
|
|
182
|
-
- 日期范围:`jh-date-range`
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## 注意事项
|
|
187
|
-
|
|
188
|
-
1. **v-model 返回值取决于 valueFormat**
|
|
189
|
-
- 默认返回 `"YYYY-MM-DD"` 字符串
|
|
190
|
-
- 若不配置可能返回 Date(取决于组件封装)
|
|
191
|
-
|
|
192
|
-
2. **后端字段格式建议统一**
|
|
193
|
-
- 推荐后端/前端统一使用 `"YYYY-MM-DD"`
|
|
194
|
-
|
|
195
|
-
3. **不要在不同页面混用格式**
|
|
196
|
-
- 避免接口参数混乱
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## 🎯 真实项目示例
|
|
201
|
-
|
|
202
|
-
### 示例 1:订单交期
|
|
203
|
-
|
|
204
|
-
```vue
|
|
205
|
-
<jh-date v-model="form.deliveryDate" />
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### 示例 2:查询条件
|
|
209
|
-
|
|
210
|
-
```vue
|
|
211
|
-
<jh-date v-model="query.bizDate" clearable />
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## 🚀 快速开始
|
|
217
|
-
|
|
218
|
-
1. 直接使用 v-model 绑定字段
|
|
219
|
-
2. 默认返回 `"YYYY-MM-DD"` 字符串
|
|
220
|
-
3. 范围选择使用 `jh-date-range`
|
|
221
|
-
|
|
222
|
-
**推荐作为平台统一的单日期选择组件使用!**
|
|
1
|
+
# jh-date - 日期选择组件
|
|
2
|
+
|
|
3
|
+
> 平台统一的日期选择组件,封装常用日期选择交互与默认格式,适用于表单、查询条件等需要选择单个日期的场景
|
|
4
|
+
|
|
5
|
+
## 📦 组件位置
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import "@jhlc/common-core";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
组件已全局注册,可直接在模板中使用 `<jh-date />`。
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 基本用法
|
|
16
|
+
|
|
17
|
+
### 1️⃣ 选择单个日期(最常用)
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<template>
|
|
21
|
+
<jh-date v-model="form.date" placeholder="请选择日期" />
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { ref } from "vue";
|
|
26
|
+
|
|
27
|
+
const form = ref({
|
|
28
|
+
date: ""
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### 2️⃣ 查询条件使用
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<jh-date v-model="query.bizDate" placeholder="业务日期" clearable />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Props 属性
|
|
44
|
+
|
|
45
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
46
|
+
| -------------------- | ---------------------------- | --------------------------------------- | -------------- |
|
|
47
|
+
| modelValue / v-model | 绑定值 | `string \| Date` | - |
|
|
48
|
+
| placeholder | 占位提示 | `string` | `"请选择日期"` |
|
|
49
|
+
| type | 日期类型 | `"date" \| "week" \| "month" \| "year"` | `"date"` |
|
|
50
|
+
| format | 绑定值格式(返回给 v-model) | `string` | `"YYYY-MM-DD"` |
|
|
51
|
+
| showFormat | 显示格式 | `string` | `"YYYY-MM-DD"` |
|
|
52
|
+
| disabled | 是否禁用 | `boolean` | `false` |
|
|
53
|
+
| clearable | 是否可清空 | `boolean` | `true` |
|
|
54
|
+
| teleported | 是否将下拉面板插入 body | `boolean` | `true` |
|
|
55
|
+
|
|
56
|
+
> **提示**: `valueFormat` 为 Element Plus 原生属性,此处统一使用 `format` 属性代替,控制返回值格式。
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Events 事件
|
|
61
|
+
|
|
62
|
+
| 事件名 | 说明 | 回调参数 |
|
|
63
|
+
| ----------------- | -------------- | ----------------- |
|
|
64
|
+
| change | 日期变化时触发 | `(value) => void` |
|
|
65
|
+
| update:modelValue | v-model 更新 | `(value) => void` |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 常见场景
|
|
70
|
+
|
|
71
|
+
### 场景 1:表单录入日期
|
|
72
|
+
|
|
73
|
+
```vue
|
|
74
|
+
<jh-date v-model="form.deliveryDate" placeholder="请选择交期" />
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### 场景 2:列表查询日期
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<jh-date v-model="query.createDate" placeholder="创建日期" />
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### 场景 3:详情页日期展示(配合 jh-text / 普通文本)
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<span>{{ detail.bizDate }}</span>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
> ⚠️ `jh-date` 仅用于选择,详情展示建议直接展示字符串或统一格式化后展示
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### 场景 3:BaseQuery 配置式用法
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
// data.ts 查询项配置
|
|
101
|
+
export const queryItemsConfig: BaseQueryItemDesc<any>[] = [
|
|
102
|
+
{
|
|
103
|
+
name: "deliveryDate",
|
|
104
|
+
label: "交期日期",
|
|
105
|
+
component: () => {
|
|
106
|
+
return {
|
|
107
|
+
tag: "jh-date",
|
|
108
|
+
type: "date",
|
|
109
|
+
showFormat: "YYYY-MM-DD",
|
|
110
|
+
valueFormat: "YYYY-MM-DD" // 或使用 format
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "month",
|
|
116
|
+
label: "月份",
|
|
117
|
+
component: () => {
|
|
118
|
+
return {
|
|
119
|
+
tag: "jh-date",
|
|
120
|
+
type: "month",
|
|
121
|
+
showFormat: "YYYY-MM",
|
|
122
|
+
valueFormat: "YYYY-MM"
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
];
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 与 el-date-picker 对比
|
|
132
|
+
|
|
133
|
+
### 使用 jh-date(推荐)
|
|
134
|
+
|
|
135
|
+
```vue
|
|
136
|
+
<jh-date v-model="form.date" />
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
✅ 统一默认格式
|
|
140
|
+
✅ 简化 props 配置
|
|
141
|
+
✅ 风格一致
|
|
142
|
+
|
|
143
|
+
### 使用 el-date-picker(不推荐)
|
|
144
|
+
|
|
145
|
+
```vue
|
|
146
|
+
<el-date-picker
|
|
147
|
+
v-model="form.date"
|
|
148
|
+
type="date"
|
|
149
|
+
value-format="YYYY-MM-DD"
|
|
150
|
+
format="YYYY-MM-DD"
|
|
151
|
+
/>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
❌ 每处都要重复配置格式
|
|
155
|
+
❌ 样式与交互不统一
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 最佳实践
|
|
160
|
+
|
|
161
|
+
### 1️⃣ 统一返回字符串格式
|
|
162
|
+
|
|
163
|
+
推荐保持 `valueFormat="YYYY-MM-DD"`,避免 Date / string 混用:
|
|
164
|
+
|
|
165
|
+
```vue
|
|
166
|
+
<jh-date v-model="form.date" value-format="YYYY-MM-DD" />
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### 2️⃣ 查询条件优先可清空
|
|
172
|
+
|
|
173
|
+
```vue
|
|
174
|
+
<jh-date v-model="query.date" clearable />
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### 3️⃣ 与日期范围选择区分使用
|
|
180
|
+
|
|
181
|
+
- 单个日期:`jh-date`
|
|
182
|
+
- 日期范围:`jh-date-range`
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 注意事项
|
|
187
|
+
|
|
188
|
+
1. **v-model 返回值取决于 valueFormat**
|
|
189
|
+
- 默认返回 `"YYYY-MM-DD"` 字符串
|
|
190
|
+
- 若不配置可能返回 Date(取决于组件封装)
|
|
191
|
+
|
|
192
|
+
2. **后端字段格式建议统一**
|
|
193
|
+
- 推荐后端/前端统一使用 `"YYYY-MM-DD"`
|
|
194
|
+
|
|
195
|
+
3. **不要在不同页面混用格式**
|
|
196
|
+
- 避免接口参数混乱
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 🎯 真实项目示例
|
|
201
|
+
|
|
202
|
+
### 示例 1:订单交期
|
|
203
|
+
|
|
204
|
+
```vue
|
|
205
|
+
<jh-date v-model="form.deliveryDate" />
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 示例 2:查询条件
|
|
209
|
+
|
|
210
|
+
```vue
|
|
211
|
+
<jh-date v-model="query.bizDate" clearable />
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 🚀 快速开始
|
|
217
|
+
|
|
218
|
+
1. 直接使用 v-model 绑定字段
|
|
219
|
+
2. 默认返回 `"YYYY-MM-DD"` 字符串
|
|
220
|
+
3. 范围选择使用 `jh-date-range`
|
|
221
|
+
|
|
222
|
+
**推荐作为平台统一的单日期选择组件使用!**
|