jianghu-ui 1.0.6 → 1.0.8
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/dist/jianghu-ui.css +195 -132
- package/dist/jianghu-ui.js +1 -1
- package/package.json +1 -1
- package/src/components/JhDrawer/JhDrawer.stories.js +6 -6
- package/src/components/JhDrawer/JhDrawer.vue +7 -1
- package/src/components/JhDrawerForm/JhDrawerForm.stories.js +161 -0
- package/src/components/JhDrawerForm/JhDrawerForm.vue +1 -1
- package/src/components/JhForm/JhForm.stories.js +114 -95
- package/src/components/JhForm/JhForm.vue +896 -205
- package/src/components/JhFormFields/JhFormFields.vue +42 -16
- package/src/components/JhModal/JhModal.stories.js +6 -6
- package/src/components/JhModal/JhModal.vue +1 -1
- package/src/components/JhModalForm/JhModalForm.vue +1 -1
- package/src/components/JhTable/JhTable.stories.js +134 -167
- package/src/components/JhTable/JhTable.vue +83 -23
- package/src/style/globalCSSVuetifyV4.css +1 -2
- package/src/components/JhAddressSelect/JhAddressSelect.md +0 -267
- package/src/components/JhCard/JhCard.md +0 -246
- package/src/components/JhCheckCard/JhCheckCard.md +0 -245
- package/src/components/JhConfirmDialog/JhConfirmDialog.md +0 -70
- package/src/components/JhDateRangePicker/JhDateRangePicker.md +0 -56
- package/src/components/JhDescriptions/JhDescriptions.md +0 -724
- package/src/components/JhDraggable/JhDraggable.md +0 -66
- package/src/components/JhDrawer/JhDrawer.md +0 -68
- package/src/components/JhDrawerForm/JhDrawerForm.md +0 -69
- package/src/components/JhEditableTable/JhEditableTable.md +0 -507
- package/src/components/JhFileInput/JhFileInput.md +0 -56
- package/src/components/JhForm/JhForm.md +0 -676
- package/src/components/JhFormFields/JhFormFields.md +0 -647
- package/src/components/JhFormList/JhFormList.md +0 -303
- package/src/components/JhJsonEditor/JhJsonEditor.md +0 -54
- package/src/components/JhLayout/JhLayout.md +0 -580
- package/src/components/JhList/JhList.md +0 -441
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.md +0 -56
- package/src/components/JhMask/JhMask.md +0 -62
- package/src/components/JhMenu/JhMenu.md +0 -85
- package/src/components/JhModal/JhModal.md +0 -68
- package/src/components/JhModalForm/JhModalForm.md +0 -69
- package/src/components/JhPageContainer/JhPageContainer.md +0 -409
- package/src/components/JhQueryFilter/JhQueryFilter.md +0 -77
- package/src/components/JhScene/JhScene.md +0 -64
- package/src/components/JhStatisticCard/JhStatisticCard.md +0 -363
- package/src/components/JhStepsForm/JhStepsForm.md +0 -666
- package/src/components/JhTable/JhTable.md +0 -730
- package/src/components/JhTableAttachment/JhTableAttachment.md +0 -70
- package/src/components/JhToast/JhToast.md +0 -67
- package/src/components/JhTreeSelect/JhTreeSelect.md +0 -82
- package/src/components/JhWaterMark/JhWaterMark.md +0 -190
- package/src/components/README.md +0 -52
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# JhModalForm - 模态框表单组件
|
|
2
|
-
|
|
3
|
-
JhModalForm 结合 JhForm 与模态框交互,适用于弹出式创建、编辑流程,可通过配置快速生成表单布局。
|
|
4
|
-
|
|
5
|
-
## 功能特性
|
|
6
|
-
|
|
7
|
-
- 🧱 **模态承载**:继承 JhModal 行为,支持宽度、全屏、粘性标题等
|
|
8
|
-
- 🧩 **配置化表单**:`fields` 描述表单结构,支持多 ValueType 与联动
|
|
9
|
-
- 🧽 **自动重置**:模态框打开时会重置表单值和验证状态
|
|
10
|
-
- 🧯 **校验守卫**:`validateBeforeConfirm` 控制确认前是否校验
|
|
11
|
-
- 🎛️ **插槽扩展**:`content` 自定义整块内容,`field-xxx` 精准覆盖单个字段
|
|
12
|
-
|
|
13
|
-
## 基础用法
|
|
14
|
-
|
|
15
|
-
```vue
|
|
16
|
-
<template>
|
|
17
|
-
<jh-modal-form
|
|
18
|
-
v-model="dialogVisible"
|
|
19
|
-
title="新增成员"
|
|
20
|
-
:fields="fields"
|
|
21
|
-
:initial-data="form"
|
|
22
|
-
@confirm="handleSubmit"
|
|
23
|
-
/>
|
|
24
|
-
</template>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## API
|
|
28
|
-
|
|
29
|
-
### Props
|
|
30
|
-
|
|
31
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
32
|
-
| --- | --- | --- | --- |
|
|
33
|
-
| value | `v-model`,控制显隐 | boolean | false |
|
|
34
|
-
| title | 弹窗标题 | string | `表单` |
|
|
35
|
-
| fields | JhForm 字段配置数组 | Array | [] |
|
|
36
|
-
| initialData | 表单初始值 | Object | `{}` |
|
|
37
|
-
| width | 最大宽度 | number \| string | 600 |
|
|
38
|
-
| fullscreen | 是否全屏 | boolean | false |
|
|
39
|
-
| persistent | 是否禁止点击遮罩关闭 | boolean | true |
|
|
40
|
-
| closable | 是否显示右上角关闭按钮 | boolean | true |
|
|
41
|
-
| showConfirmButton | 是否显示确认按钮 | boolean | true |
|
|
42
|
-
| confirmText | 确认按钮文本 | string | `确认` |
|
|
43
|
-
| cancelText | 取消按钮文本 | string | `取消` |
|
|
44
|
-
| formRef | 内部 JhForm ref 名称 | string | `modalForm` |
|
|
45
|
-
| validateBeforeConfirm | 确认前是否自动校验 | boolean | true |
|
|
46
|
-
| validationRules | 通用验证规则 | Object | 预置常用校验 |
|
|
47
|
-
|
|
48
|
-
### Events
|
|
49
|
-
|
|
50
|
-
| 事件名 | 说明 | 回调参数 |
|
|
51
|
-
| --- | --- | --- |
|
|
52
|
-
| input | `v-model` 更新 | (visible: boolean) |
|
|
53
|
-
| close | 弹窗关闭后触发 | - |
|
|
54
|
-
| cancel | 点击取消或关闭按钮触发 | - |
|
|
55
|
-
| confirm | 校验通过后触发 | (formData: object) |
|
|
56
|
-
| field-change | 字段变化时触发 | ({ key, value, formData }) |
|
|
57
|
-
|
|
58
|
-
### Slots
|
|
59
|
-
|
|
60
|
-
| 名称 | 说明 |
|
|
61
|
-
| --- | --- |
|
|
62
|
-
| content | 完全自定义表单区域,默认渲染 JhForm |
|
|
63
|
-
| field-`key` | 针对特定字段自定义渲染 |
|
|
64
|
-
|
|
65
|
-
## 使用建议
|
|
66
|
-
|
|
67
|
-
- 如果需在关闭后保留数据,可监听 `close` 事件并阻止 `resetForm`
|
|
68
|
-
- 复杂布局可直接在 `content` 插槽内放置任意组件,自行控制 JhForm
|
|
69
|
-
- 通过 `this.$refs.modalForm.getFormData()` 可以手动读取当前表单数据
|
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
# JhPageContainer - 页面容器组件
|
|
2
|
-
|
|
3
|
-
页面容器组件,提供统一的页面布局结构。这是与 test 目录中组件样式和功能保持一致的基础版本。
|
|
4
|
-
|
|
5
|
-
## 功能特性
|
|
6
|
-
|
|
7
|
-
- ✅ **统一的页面头部布局**: 标准化的页面标题区域
|
|
8
|
-
- ✅ **页面标题显示**: 清晰的页面标识
|
|
9
|
-
- ✅ **帮助按钮**: 可选的帮助功能入口
|
|
10
|
-
- ✅ **搜索栏插槽**: 灵活的搜索过滤区域
|
|
11
|
-
- ✅ **内容区域插槽**: 主要内容展示区域
|
|
12
|
-
- ✅ **响应式布局**: 自动适配不同屏幕尺寸
|
|
13
|
-
- ✅ **内置全局组件**: 集成 JhToast、JhMask、JhConfirmDialog
|
|
14
|
-
|
|
15
|
-
## 设计理念
|
|
16
|
-
|
|
17
|
-
`JhPageContainer` 是页面级的容器组件,通常与 `JhLayout` 配合使用:
|
|
18
|
-
|
|
19
|
-
- **JhLayout**: 应用级布局(导航、头部、侧边栏、底部)
|
|
20
|
-
- **JhPageContainer**: 页面级容器(页面标题、搜索栏、内容区域)
|
|
21
|
-
|
|
22
|
-
## 基础用法
|
|
23
|
-
|
|
24
|
-
```vue
|
|
25
|
-
<template>
|
|
26
|
-
<jh-page-container
|
|
27
|
-
page-name="用户管理"
|
|
28
|
-
:show-help-button="true"
|
|
29
|
-
@help-click="handleHelpClick"
|
|
30
|
-
>
|
|
31
|
-
<template v-slot:search-bar>
|
|
32
|
-
<!-- 搜索栏内容 -->
|
|
33
|
-
<jh-query-filter
|
|
34
|
-
:keyword.sync="keyword"
|
|
35
|
-
:keywordFieldList.sync="keywordFieldList"
|
|
36
|
-
@search="handleSearch"
|
|
37
|
-
/>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<template v-slot:content>
|
|
41
|
-
<!-- 主要内容 -->
|
|
42
|
-
<jh-table
|
|
43
|
-
:headers="headers"
|
|
44
|
-
:items="items"
|
|
45
|
-
/>
|
|
46
|
-
</template>
|
|
47
|
-
</jh-page-container>
|
|
48
|
-
</template>
|
|
49
|
-
|
|
50
|
-
<script>
|
|
51
|
-
export default {
|
|
52
|
-
data() {
|
|
53
|
-
return {
|
|
54
|
-
keyword: '',
|
|
55
|
-
keywordFieldList: ['username', 'email'],
|
|
56
|
-
headers: [],
|
|
57
|
-
items: []
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
methods: {
|
|
61
|
-
handleHelpClick() {
|
|
62
|
-
// 显示帮助信息
|
|
63
|
-
},
|
|
64
|
-
handleSearch() {
|
|
65
|
-
// 执行搜索
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
</script>
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Props
|
|
73
|
-
|
|
74
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
75
|
-
|------|------|------|--------|
|
|
76
|
-
| pageName | 页面标题 | String | '页面标题' |
|
|
77
|
-
| showHelpButton | 是否显示帮助按钮 | Boolean | true |
|
|
78
|
-
|
|
79
|
-
## 插槽
|
|
80
|
-
|
|
81
|
-
### menu
|
|
82
|
-
菜单区域插槽,用于放置顶部菜单组件
|
|
83
|
-
|
|
84
|
-
```vue
|
|
85
|
-
<jh-page-container page-name="用户管理">
|
|
86
|
-
<template v-slot:menu>
|
|
87
|
-
<jh-menu
|
|
88
|
-
:items="menuItems"
|
|
89
|
-
@select="handleMenuSelect"
|
|
90
|
-
/>
|
|
91
|
-
</template>
|
|
92
|
-
</jh-page-container>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### search-bar
|
|
96
|
-
搜索栏区域插槽,通常放置搜索过滤组件
|
|
97
|
-
|
|
98
|
-
```vue
|
|
99
|
-
<jh-page-container page-name="用户管理">
|
|
100
|
-
<template v-slot:search-bar>
|
|
101
|
-
<jh-query-filter
|
|
102
|
-
:keyword.sync="keyword"
|
|
103
|
-
:keywordFieldList.sync="keywordFieldList"
|
|
104
|
-
@search="handleSearch"
|
|
105
|
-
/>
|
|
106
|
-
</template>
|
|
107
|
-
</jh-page-container>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### content
|
|
111
|
-
主要内容区域插槽,放置页面的主要内容
|
|
112
|
-
|
|
113
|
-
```vue
|
|
114
|
-
<jh-page-container page-name="用户管理">
|
|
115
|
-
<template v-slot:content>
|
|
116
|
-
<jh-table
|
|
117
|
-
:headers="headers"
|
|
118
|
-
:items="items"
|
|
119
|
-
/>
|
|
120
|
-
</template>
|
|
121
|
-
</jh-page-container>
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### default
|
|
125
|
-
默认插槽,用于放置其他内容(如抽屉、对话框等)
|
|
126
|
-
|
|
127
|
-
```vue
|
|
128
|
-
<jh-page-container page-name="用户管理">
|
|
129
|
-
<template v-slot:content>
|
|
130
|
-
<!-- 主要内容 -->
|
|
131
|
-
</template>
|
|
132
|
-
|
|
133
|
-
<!-- 默认插槽:抽屉、对话框等 -->
|
|
134
|
-
<jh-drawer v-model="drawerVisible">
|
|
135
|
-
<!-- 抽屉内容 -->
|
|
136
|
-
</jh-drawer>
|
|
137
|
-
</jh-page-container>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## 事件
|
|
141
|
-
|
|
142
|
-
| 事件名 | 说明 | 回调参数 |
|
|
143
|
-
|--------|------|----------|
|
|
144
|
-
| help-click | 点击帮助按钮时触发 | - |
|
|
145
|
-
|
|
146
|
-
## 使用场景
|
|
147
|
-
|
|
148
|
-
### 列表页面
|
|
149
|
-
|
|
150
|
-
```vue
|
|
151
|
-
<template>
|
|
152
|
-
<jh-page-container
|
|
153
|
-
page-name="用户列表"
|
|
154
|
-
@help-click="showHelp"
|
|
155
|
-
>
|
|
156
|
-
<template v-slot:search-bar>
|
|
157
|
-
<jh-query-filter
|
|
158
|
-
:keyword.sync="keyword"
|
|
159
|
-
:keywordFieldList.sync="keywordFieldList"
|
|
160
|
-
:headers="headers"
|
|
161
|
-
@search="handleSearch"
|
|
162
|
-
/>
|
|
163
|
-
</template>
|
|
164
|
-
|
|
165
|
-
<template v-slot:content>
|
|
166
|
-
<jh-table
|
|
167
|
-
:headers="headers"
|
|
168
|
-
:items="users"
|
|
169
|
-
:loading="loading"
|
|
170
|
-
@create-click="handleCreate"
|
|
171
|
-
@update-click="handleUpdate"
|
|
172
|
-
@delete-click="handleDelete"
|
|
173
|
-
/>
|
|
174
|
-
</template>
|
|
175
|
-
</jh-page-container>
|
|
176
|
-
</template>
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### 详情页面
|
|
180
|
-
|
|
181
|
-
```vue
|
|
182
|
-
<template>
|
|
183
|
-
<jh-page-container
|
|
184
|
-
page-name="用户详情"
|
|
185
|
-
:show-help-button="false"
|
|
186
|
-
>
|
|
187
|
-
<template v-slot:content>
|
|
188
|
-
<jh-descriptions
|
|
189
|
-
:columns="columns"
|
|
190
|
-
:data="userDetail"
|
|
191
|
-
/>
|
|
192
|
-
</template>
|
|
193
|
-
</jh-page-container>
|
|
194
|
-
</template>
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### 表单页面
|
|
198
|
-
|
|
199
|
-
```vue
|
|
200
|
-
<template>
|
|
201
|
-
<jh-page-container
|
|
202
|
-
page-name="新增用户"
|
|
203
|
-
:show-help-button="false"
|
|
204
|
-
>
|
|
205
|
-
<template v-slot:content>
|
|
206
|
-
<v-card>
|
|
207
|
-
<v-card-text>
|
|
208
|
-
<v-form>
|
|
209
|
-
<v-text-field label="用户名" v-model="form.username" />
|
|
210
|
-
<v-text-field label="邮箱" v-model="form.email" />
|
|
211
|
-
</v-form>
|
|
212
|
-
</v-card-text>
|
|
213
|
-
<v-card-actions>
|
|
214
|
-
<v-btn color="primary" @click="handleSubmit">提交</v-btn>
|
|
215
|
-
<v-btn @click="handleCancel">取消</v-btn>
|
|
216
|
-
</v-card-actions>
|
|
217
|
-
</v-card>
|
|
218
|
-
</template>
|
|
219
|
-
</jh-page-container>
|
|
220
|
-
</template>
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
## 与 JhLayout 配合使用
|
|
224
|
-
|
|
225
|
-
推荐的完整页面结构:
|
|
226
|
-
|
|
227
|
-
```vue
|
|
228
|
-
<template>
|
|
229
|
-
<jh-layout
|
|
230
|
-
title="管理系统"
|
|
231
|
-
:menu-data="menuData"
|
|
232
|
-
:current-path="currentPath"
|
|
233
|
-
show-breadcrumb
|
|
234
|
-
:content-padding="false"
|
|
235
|
-
:show-page-header="false"
|
|
236
|
-
>
|
|
237
|
-
<jh-page-container
|
|
238
|
-
page-name="用户管理"
|
|
239
|
-
:show-help-button="true"
|
|
240
|
-
@help-click="handleHelpClick"
|
|
241
|
-
>
|
|
242
|
-
<template v-slot:search-bar>
|
|
243
|
-
<jh-query-filter
|
|
244
|
-
:keyword.sync="keyword"
|
|
245
|
-
:keywordFieldList.sync="keywordFieldList"
|
|
246
|
-
:headers="headers"
|
|
247
|
-
@search="handleSearch"
|
|
248
|
-
/>
|
|
249
|
-
</template>
|
|
250
|
-
|
|
251
|
-
<template v-slot:content>
|
|
252
|
-
<jh-table
|
|
253
|
-
:headers="headers"
|
|
254
|
-
:items="items"
|
|
255
|
-
:loading="loading"
|
|
256
|
-
/>
|
|
257
|
-
</template>
|
|
258
|
-
</jh-page-container>
|
|
259
|
-
</jh-layout>
|
|
260
|
-
</template>
|
|
261
|
-
|
|
262
|
-
<script>
|
|
263
|
-
export default {
|
|
264
|
-
data() {
|
|
265
|
-
return {
|
|
266
|
-
currentPath: '/users/list',
|
|
267
|
-
menuData: [
|
|
268
|
-
{
|
|
269
|
-
name: '用户管理',
|
|
270
|
-
path: '/users/list',
|
|
271
|
-
icon: 'mdi-account-group'
|
|
272
|
-
}
|
|
273
|
-
],
|
|
274
|
-
keyword: '',
|
|
275
|
-
keywordFieldList: ['username', 'email'],
|
|
276
|
-
headers: [
|
|
277
|
-
{ text: 'ID', value: 'id' },
|
|
278
|
-
{ text: '用户名', value: 'username' },
|
|
279
|
-
{ text: '邮箱', value: 'email' }
|
|
280
|
-
],
|
|
281
|
-
items: [],
|
|
282
|
-
loading: false
|
|
283
|
-
};
|
|
284
|
-
},
|
|
285
|
-
methods: {
|
|
286
|
-
handleHelpClick() {
|
|
287
|
-
// 显示帮助信息
|
|
288
|
-
},
|
|
289
|
-
handleSearch() {
|
|
290
|
-
this.loading = true;
|
|
291
|
-
// 执行搜索逻辑
|
|
292
|
-
setTimeout(() => {
|
|
293
|
-
this.loading = false;
|
|
294
|
-
}, 1000);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
</script>
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
**配置说明**:
|
|
302
|
-
- `JhLayout` 的 `content-padding` 设置为 `false`,避免与 `JhPageContainer` 的内边距重复
|
|
303
|
-
- `JhLayout` 的 `show-page-header` 设置为 `false`,使用 `JhPageContainer` 的页面标题
|
|
304
|
-
- `JhLayout` 提供应用级导航和面包屑
|
|
305
|
-
- `JhPageContainer` 提供页面级标题和搜索栏
|
|
306
|
-
|
|
307
|
-
## 内置全局组件
|
|
308
|
-
|
|
309
|
-
`JhPageContainer` 内置了以下全局组件,无需额外引入:
|
|
310
|
-
|
|
311
|
-
- **JhToast**: 消息提示组件
|
|
312
|
-
- **JhMask**: 遮罩层组件
|
|
313
|
-
- **JhConfirmDialog**: 确认对话框组件
|
|
314
|
-
|
|
315
|
-
这些组件可以在页面的任何地方通过事件总线或全局方法调用。
|
|
316
|
-
|
|
317
|
-
## 响应式设计
|
|
318
|
-
|
|
319
|
-
组件会自动适配不同屏幕尺寸:
|
|
320
|
-
|
|
321
|
-
- **桌面端(>= 960px)**: 搜索栏在右侧,与标题同行
|
|
322
|
-
- **移动端(< 960px)**: 搜索栏在标题下方,独占一行
|
|
323
|
-
|
|
324
|
-
## 样式定制
|
|
325
|
-
|
|
326
|
-
组件使用 Vuetify 的样式系统,可以通过以下方式定制:
|
|
327
|
-
|
|
328
|
-
```vue
|
|
329
|
-
<jh-page-container page-name="用户管理">
|
|
330
|
-
<template v-slot:search-bar>
|
|
331
|
-
<div class="custom-search-bar">
|
|
332
|
-
<!-- 自定义样式的搜索栏 -->
|
|
333
|
-
</div>
|
|
334
|
-
</template>
|
|
335
|
-
</jh-page-container>
|
|
336
|
-
|
|
337
|
-
<style scoped>
|
|
338
|
-
.custom-search-bar {
|
|
339
|
-
/* 自定义样式 */
|
|
340
|
-
}
|
|
341
|
-
</style>
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
## 最佳实践
|
|
345
|
-
|
|
346
|
-
1. **标题命名**: 使用清晰、简洁的页面标题,便于用户理解当前页面功能
|
|
347
|
-
2. **帮助按钮**: 对于复杂页面,建议显示帮助按钮,提供操作指引
|
|
348
|
-
3. **搜索栏**: 列表页面建议使用搜索栏,提供快速过滤功能
|
|
349
|
-
4. **内容区域**: 主要内容建议使用卡片或表格组件,保持视觉一致性
|
|
350
|
-
5. **与 JhLayout 配合**: 使用 JhLayout 时,注意避免重复的内边距和头部
|
|
351
|
-
|
|
352
|
-
## 常见问题
|
|
353
|
-
|
|
354
|
-
### 如何隐藏帮助按钮?
|
|
355
|
-
|
|
356
|
-
设置 `show-help-button` 为 `false`:
|
|
357
|
-
|
|
358
|
-
```vue
|
|
359
|
-
<jh-page-container
|
|
360
|
-
page-name="用户管理"
|
|
361
|
-
:show-help-button="false"
|
|
362
|
-
>
|
|
363
|
-
</jh-page-container>
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
### 如何自定义页面标题样式?
|
|
367
|
-
|
|
368
|
-
页面标题使用 Vuetify 的 `text-body-1` 和 `font-weight-bold` 类,可以通过全局样式覆盖:
|
|
369
|
-
|
|
370
|
-
```css
|
|
371
|
-
.jh-page-second-bar .text-body-1 {
|
|
372
|
-
font-size: 18px !important;
|
|
373
|
-
color: #333 !important;
|
|
374
|
-
}
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
### 可以不使用 JhLayout 吗?
|
|
378
|
-
|
|
379
|
-
可以。`JhPageContainer` 内置了 `v-app` 和 `v-main`,可以独立使用。但推荐与 `JhLayout` 配合使用,以获得完整的应用布局。
|
|
380
|
-
|
|
381
|
-
### 如何在内容区域添加多个卡片?
|
|
382
|
-
|
|
383
|
-
使用 Vuetify 的栅格系统:
|
|
384
|
-
|
|
385
|
-
```vue
|
|
386
|
-
<jh-page-container page-name="仪表盘">
|
|
387
|
-
<template v-slot:content>
|
|
388
|
-
<v-row>
|
|
389
|
-
<v-col cols="12" md="6">
|
|
390
|
-
<v-card>
|
|
391
|
-
<!-- 卡片 1 -->
|
|
392
|
-
</v-card>
|
|
393
|
-
</v-col>
|
|
394
|
-
<v-col cols="12" md="6">
|
|
395
|
-
<v-card>
|
|
396
|
-
<!-- 卡片 2 -->
|
|
397
|
-
</v-card>
|
|
398
|
-
</v-col>
|
|
399
|
-
</v-row>
|
|
400
|
-
</template>
|
|
401
|
-
</jh-page-container>
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
## 参考资料
|
|
405
|
-
|
|
406
|
-
- [JhLayout - 页面布局组件](../JhLayout/JhLayout.md)
|
|
407
|
-
- [JhTable - 数据表格组件](../JhTable/JhTable.md)
|
|
408
|
-
- [JhQueryFilter - 查询过滤组件](../JhQueryFilter/README.md)
|
|
409
|
-
- [Vuetify - Application](https://vuetifyjs.com/en/components/application/)
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# JhQueryFilter - 查询过滤器
|
|
2
|
-
|
|
3
|
-
JhQueryFilter 用于在列表/报表场景中快速搭建多字段筛选区域,内置折叠、查询/重置按钮及字段联动逻辑。
|
|
4
|
-
|
|
5
|
-
## 功能特性
|
|
6
|
-
|
|
7
|
-
- 🧱 **配置化字段**:复用 JhFormFields,支持 JSON 配置与自定义插槽
|
|
8
|
-
- 🔁 **折叠/展开**:根据 `defaultVisibleCount` 决定初始展示字段,支持展开全部
|
|
9
|
-
- ⚡ **一键查询/重置**:内置按钮区,可插槽重写,也可在字段上配置 `realtime`
|
|
10
|
-
- 🎯 **响应式布局**:`colSpan` 控制 xs/sm/md/lg 列宽,自动适配
|
|
11
|
-
- 🧽 **数据清洗**:查询前自动过滤空值,并抛出 `search` 事件
|
|
12
|
-
|
|
13
|
-
## 基础用法
|
|
14
|
-
|
|
15
|
-
```vue
|
|
16
|
-
<template>
|
|
17
|
-
<jh-query-filter
|
|
18
|
-
:fields="fields"
|
|
19
|
-
:initial-values="query"
|
|
20
|
-
:default-visible-count="4"
|
|
21
|
-
@search="handleSearch"
|
|
22
|
-
@reset="handleReset"
|
|
23
|
-
/>
|
|
24
|
-
</template>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## API
|
|
28
|
-
|
|
29
|
-
### Props
|
|
30
|
-
|
|
31
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
32
|
-
| --- | --- | --- | --- |
|
|
33
|
-
| fields | 查询字段配置 | Array | [] |
|
|
34
|
-
| initialValues | 初始查询数据 | Object | `{}` |
|
|
35
|
-
| collapsible | 是否开启折叠 | boolean | true |
|
|
36
|
-
| defaultCollapsed | 默认是否折叠 | boolean | true |
|
|
37
|
-
| defaultVisibleCount | 折叠时展示的字段数 | number | 3 |
|
|
38
|
-
| colSpan | 各断点的列宽设置 | Object | `{ xs:24, sm:12, md:6, lg:4 }` |
|
|
39
|
-
| showLabels | 是否显示字段标签 | boolean | true |
|
|
40
|
-
| dense | 输入框是否紧凑 | boolean | true |
|
|
41
|
-
| filled | 输入框是否 filled | boolean | true |
|
|
42
|
-
| outlined | 输入框是否 outlined | boolean | false |
|
|
43
|
-
| singleLine | 标签是否单行显示 | boolean | true |
|
|
44
|
-
| searchText | 查询按钮文案 | string | `查询` |
|
|
45
|
-
| resetText | 重置按钮文案 | string | `重置` |
|
|
46
|
-
| expandText | 折叠状态下按钮文案 | string | `展开` |
|
|
47
|
-
| collapseText | 展开状态下按钮文案 | string | `收起` |
|
|
48
|
-
| buttonSize | 按钮尺寸 `small/default/large` | string | `small` |
|
|
49
|
-
| buttonAlign | 按钮对齐方式 | string | `left` |
|
|
50
|
-
| loading | 外部 loading 状态 | boolean | false |
|
|
51
|
-
| labelClass | 标签 class | string | `jh-input-label` |
|
|
52
|
-
| inputClass | 输入框 class | string | `jh-v-input` |
|
|
53
|
-
| rowClass | 整体行 class | string | `ma-0` |
|
|
54
|
-
| buttonClass | 按钮容器 class | string | `gap-2` |
|
|
55
|
-
| buttonColumnClass | 操作列 class | string | `''` |
|
|
56
|
-
|
|
57
|
-
### Events
|
|
58
|
-
|
|
59
|
-
| 事件名 | 说明 | 回调参数 |
|
|
60
|
-
| --- | --- | --- |
|
|
61
|
-
| search | 点击查询或重置后触发,返回过滤后的数据 | (query: object) |
|
|
62
|
-
| reset | 点击重置后触发 | - |
|
|
63
|
-
| field-change | 字段值变化时触发 | ({ key, value, formData }) |
|
|
64
|
-
| collapse-change | 折叠状态切换时触发 | (collapsed: boolean) |
|
|
65
|
-
|
|
66
|
-
### Slots
|
|
67
|
-
|
|
68
|
-
| 名称 | 说明 |
|
|
69
|
-
| --- | --- |
|
|
70
|
-
| field-`key` | 自定义某个字段的渲染 |
|
|
71
|
-
| buttons | 自定义操作区,参数 `{ formData, search, reset }` |
|
|
72
|
-
|
|
73
|
-
## 使用建议
|
|
74
|
-
|
|
75
|
-
- 想要实时查询的字段可配置 `realtime: true`,组件会在 `field-change` 内自动触发查询
|
|
76
|
-
- 对于日期范围等复杂字段,可将 `type` 设置为 `slot` 并配合插槽自定义
|
|
77
|
-
- 若需要和表格联动,可在 `@search` 中直接触发 `loadTableData(query)`
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# JhScene - 场景切换组件
|
|
2
|
-
|
|
3
|
-
JhScene 用于保存并切换用户的查询/配置场景,支持本地存储、场景管理弹窗,适用于列表筛选方案、仪表盘布局等。
|
|
4
|
-
|
|
5
|
-
## 功能特性
|
|
6
|
-
|
|
7
|
-
- 🧭 **快速切换**:通过按钮组切换系统场景或自定义场景
|
|
8
|
-
- 🧺 **场景管理**:内置新增、删除弹窗,可管理自定义场景列表
|
|
9
|
-
- 💾 **持久化**:可选择写入 localStorage,刷新后仍保存
|
|
10
|
-
- 🧱 **外部联动**:切换后会将场景对象回传,父组件可更新查询条件
|
|
11
|
-
- 🧩 **可插槽扩展**:提供 `form` 插槽以渲染自定义筛选表单
|
|
12
|
-
|
|
13
|
-
## 基础用法
|
|
14
|
-
|
|
15
|
-
```vue
|
|
16
|
-
<template>
|
|
17
|
-
<jh-scene
|
|
18
|
-
:scenes="defaultScenes"
|
|
19
|
-
:init-form-data="query"
|
|
20
|
-
storage-key="customer-scene"
|
|
21
|
-
:use-local-storage="true"
|
|
22
|
-
@scene-change="applyScene"
|
|
23
|
-
@scene-created="saveScene"
|
|
24
|
-
>
|
|
25
|
-
<template #form="{ form }">
|
|
26
|
-
<customer-filter v-model="form" />
|
|
27
|
-
</template>
|
|
28
|
-
</jh-scene>
|
|
29
|
-
</template>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## API
|
|
33
|
-
|
|
34
|
-
### Props
|
|
35
|
-
|
|
36
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
37
|
-
| --- | --- | --- | --- |
|
|
38
|
-
| initFormData | 新建场景时复制的初始表单数据 | object | `{}` |
|
|
39
|
-
| storageKey | 使用 localStorage 时的键名 | string | `jh-scene-list` |
|
|
40
|
-
| scenes | 系统内置场景列表 | Array | [] |
|
|
41
|
-
| currentSceneId | 默认选中的场景 id | string | null |
|
|
42
|
-
| showActionBtn | 是否显示“新建/管理”动作按钮 | boolean | true |
|
|
43
|
-
| useLocalStorage | 是否启用 localStorage 持久化 | boolean | false |
|
|
44
|
-
|
|
45
|
-
### Events
|
|
46
|
-
|
|
47
|
-
| 事件名 | 说明 | 回调参数 |
|
|
48
|
-
| --- | --- | --- |
|
|
49
|
-
| scene-change | 切换场景后触发 | (scene: object) |
|
|
50
|
-
| scene-created | 新建场景成功时触发 | (scene: object) |
|
|
51
|
-
| scene-deleted | 删除场景时触发 | (scene: object) |
|
|
52
|
-
| error | 创建失败(如重名)时触发 | (message: string) |
|
|
53
|
-
|
|
54
|
-
### Slots
|
|
55
|
-
|
|
56
|
-
| 名称 | 说明 |
|
|
57
|
-
| --- | --- |
|
|
58
|
-
| form | 新建场景弹窗中的“筛选条件”区域,参数 `{ form }` |
|
|
59
|
-
|
|
60
|
-
## 使用建议
|
|
61
|
-
|
|
62
|
-
- 每个场景对象建议包含 `{ id, name, form, system, default }` 等字段,方便控制默认场景
|
|
63
|
-
- 当 `useLocalStorage` 为 true 时,组件自动将所有场景写入浏览器存储
|
|
64
|
-
- 切换场景时会将完整对象抛出,可直接将其 form 数据写回查询条件
|