@agile-team/wl-skills-kit 1.0.0
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 +13 -0
- package/README.md +328 -0
- package/bin/wl-skills.js +104 -0
- package/files/.github/copilot-instructions.md +211 -0
- package/files/.github/docs/SYS_MENU_INFO.md +247 -0
- package/files/.github/docs/menu-sync-design.md +265 -0
- package/files/.github/docs/use-skill.md +379 -0
- package/files/.github/docs/wl-skills-kit.md +266 -0
- package/files/.github/skills/api-contract/SKILL.md +247 -0
- package/files/.github/skills/convention-extract/SKILL.md +355 -0
- package/files/.github/skills/menu-sync/SKILL.md +255 -0
- package/files/.github/skills/menu-sync/env/guide.md +73 -0
- package/files/.github/skills/page-codegen/SKILL.md +825 -0
- package/files/.github/skills/page-codegen/TPL-CHANGE-HISTORY.md +281 -0
- package/files/.github/skills/page-codegen/TPL-DETAIL-TABS.md +1112 -0
- package/files/.github/skills/page-codegen/TPL-DRIVEN.md +124 -0
- package/files/.github/skills/page-codegen/TPL-FORM-ROUTE.md +441 -0
- package/files/.github/skills/page-codegen/TPL-LIST.md +196 -0
- package/files/.github/skills/page-codegen/TPL-MASTER-DETAIL.md +153 -0
- package/files/.github/skills/page-codegen/TPL-OPERATION-STATION.md +442 -0
- package/files/.github/skills/page-codegen/TPL-RECORD-FORM.md +376 -0
- package/files/.github/skills/page-codegen/TPL-TREE-LIST.md +191 -0
- package/files/.github/skills/prototype-scan/SKILL.md +414 -0
- package/files/demo/README.md +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/api.md +54 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/data.ts +346 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/index.vue +28 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/data.ts +115 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/index.scss +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/index.vue +43 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/data.ts +338 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/index.vue +28 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/data.ts +115 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/index.scss +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/index.vue +43 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/data.ts +196 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.scss +150 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.vue +79 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/api.md +88 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/data.ts +601 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/index.vue +64 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/api.md +67 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/data.ts +286 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/index.scss +139 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/index.vue +318 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/api.md +98 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/data.ts +543 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/index.vue +52 -0
- package/files/demo/sale/demo/add-demo/data.ts +518 -0
- package/files/demo/sale/demo/add-demo/index.scss +207 -0
- package/files/demo/sale/demo/add-demo/index.vue +167 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/data.ts +524 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/index.scss +155 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/index.vue +117 -0
- package/files/demo/sale/demo/domestic-trade-order/data.ts +308 -0
- package/files/demo/sale/demo/domestic-trade-order/index.scss +99 -0
- package/files/demo/sale/demo/domestic-trade-order/index.vue +77 -0
- package/files/demo/sale/demo/heat-batch-return/data.ts +367 -0
- package/files/demo/sale/demo/heat-batch-return/index.scss +100 -0
- package/files/demo/sale/demo/heat-batch-return/index.vue +170 -0
- package/files/demo/sale/demo/heat-batch-return/meltDialog.vue +320 -0
- package/files/demo/sale/demo/metallurgical-spec/data.ts +825 -0
- package/files/demo/sale/demo/metallurgical-spec/index.scss +264 -0
- package/files/demo/sale/demo/metallurgical-spec/index.vue +309 -0
- package/files/docs/jh-date-range.md +257 -0
- package/files/docs/jh-date.md +222 -0
- package/files/docs/jh-dept-picker.md +190 -0
- package/files/docs/jh-drag-row.md +590 -0
- package/files/docs/jh-file-upload.md +216 -0
- package/files/docs/jh-pagination.md +505 -0
- package/files/docs/jh-picker.md +218 -0
- package/files/docs/jh-select.md +148 -0
- package/files/docs/jh-text.md +248 -0
- package/files/docs/jh-user-picker.md +197 -0
- package/files/docs/page-query-hook-best-practices.md +362 -0
- package/files/docs/request.md +925 -0
- package/files/src/components/global/C_ParentView/index.vue +3 -0
- package/files/src/components/global/C_RightToolbar/index.vue +459 -0
- package/files/src/components/global/C_Splitter/index.vue +195 -0
- package/files/src/components/global/C_SvgIcon/index.vue +61 -0
- package/files/src/components/global/C_SvgIcon/svgicon.js +10 -0
- package/files/src/components/global/C_TagStatus/README.md +264 -0
- package/files/src/components/global/C_TagStatus/config.ts +192 -0
- package/files/src/components/global/C_TagStatus/index.vue +127 -0
- package/files/src/components/global/C_TagStatus/types.ts +64 -0
- package/files/src/components/global/C_Tree/README.md +153 -0
- package/files/src/components/global/C_Tree/index.scss +42 -0
- package/files/src/components/global/C_Tree/index.vue +119 -0
- package/files/src/components/global/C_Tree/types.ts +59 -0
- package/files/src/components/local/c_formModal/README.md +235 -0
- package/files/src/components/local/c_formModal/data.ts +95 -0
- package/files/src/components/local/c_formModal/index.scss +8 -0
- package/files/src/components/local/c_formModal/index.vue +107 -0
- package/files/src/components/local/c_formSections/README.md +496 -0
- package/files/src/components/local/c_formSections/data.ts +175 -0
- package/files/src/components/local/c_formSections/index.scss +280 -0
- package/files/src/components/local/c_formSections/index.vue +429 -0
- package/files/src/components/local/c_listModal/data.ts +41 -0
- package/files/src/components/local/c_listModal/index.vue +136 -0
- package/files/src/components/local/c_spliterTitle/index.scss +25 -0
- package/files/src/components/local/c_spliterTitle/index.vue +21 -0
- package/files/src/components/remote/AGGrid/README.md +530 -0
- package/files/src/components/remote/BaseForm/README.md +508 -0
- package/files/src/components/remote/BaseQuery/README.md +865 -0
- package/files/src/components/remote/BaseTable/README.md +941 -0
- package/files/src/components/remote/BaseToolbar/README.md +496 -0
- package/files/src/types/page.ts +24 -0
- package/package.json +31 -0
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
# jh-drag-row - 可拖拽分栏组件
|
|
2
|
+
|
|
3
|
+
> 上下分栏布局组件,支持拖拽调整上下区域高度,适用于双表联动、主从表等场景
|
|
4
|
+
|
|
5
|
+
## 📦 组件位置
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// 来自远程 common-core 包
|
|
9
|
+
import "@jhlc/common-core";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
组件已在全局注册,无需手动导入,直接在模板中使用 `<jh-drag-row>`。
|
|
13
|
+
|
|
14
|
+
## ⚠️ 重要提醒
|
|
15
|
+
|
|
16
|
+
**使用 jh-drag-row 必须设置以下样式,否则拖拽手柄无法正常工作!**
|
|
17
|
+
|
|
18
|
+
```scss
|
|
19
|
+
// 在页面的 style 标签中添加(必需!)
|
|
20
|
+
:deep(.drager_row) {
|
|
21
|
+
height: 100%;
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> **核心说明**:
|
|
26
|
+
> 1. 组件渲染时会自动生成 `.drager_row` CSS 类名
|
|
27
|
+
> 2. 必须使用 `:deep()` 穿透 scoped 样式
|
|
28
|
+
> 3. 如果使用全局样式文件,也可以: `.app-page-container .drager_row { height: 100%; }`
|
|
29
|
+
|
|
30
|
+
## 基本用法
|
|
31
|
+
|
|
32
|
+
### 标准双表布局(推荐)
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<template>
|
|
36
|
+
<div class="app-container app-page-container">
|
|
37
|
+
<jh-drag-row :top-height="350">
|
|
38
|
+
<template #top>
|
|
39
|
+
<!-- 上表区域:搜索栏 -->
|
|
40
|
+
<BaseQuery
|
|
41
|
+
:form="queryParam"
|
|
42
|
+
:items="queryItems"
|
|
43
|
+
:columns="4"
|
|
44
|
+
@select="select"
|
|
45
|
+
@reset="select"
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<!-- 上表区域:工具栏 -->
|
|
49
|
+
<BaseToolbar :items="toolbars" />
|
|
50
|
+
|
|
51
|
+
<!-- 上表区域:表格 -->
|
|
52
|
+
<BaseTable
|
|
53
|
+
ref="tableRef"
|
|
54
|
+
:data="list"
|
|
55
|
+
:columns="columns"
|
|
56
|
+
showToolbar
|
|
57
|
+
@row-click="handleRowClick"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<!-- 上表区域:分页 -->
|
|
61
|
+
<jh-pagination
|
|
62
|
+
v-show="page.total && page.total > 0"
|
|
63
|
+
:total="page.total || 0"
|
|
64
|
+
v-model:currentPage="page.current"
|
|
65
|
+
v-model:pageSize="page.size"
|
|
66
|
+
@current-change="select"
|
|
67
|
+
@size-change="select"
|
|
68
|
+
/>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<template #bottom>
|
|
72
|
+
<!-- 下表区域:工具栏 -->
|
|
73
|
+
<BaseToolbar :items="bottomToolbars" />
|
|
74
|
+
|
|
75
|
+
<!-- 下表区域:表格 -->
|
|
76
|
+
<BaseTable
|
|
77
|
+
ref="bottomTableRef"
|
|
78
|
+
:data="bottomList"
|
|
79
|
+
:columns="bottomColumns"
|
|
80
|
+
showToolbar
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<!-- 下表区域:分页(如果需要) -->
|
|
84
|
+
<jh-pagination
|
|
85
|
+
v-show="bottomPage.total && bottomPage.total > 0"
|
|
86
|
+
:total="bottomPage.total || 0"
|
|
87
|
+
v-model:currentPage="bottomPage.current"
|
|
88
|
+
v-model:pageSize="bottomPage.size"
|
|
89
|
+
@current-change="selectBottom"
|
|
90
|
+
@size-change="selectBottom"
|
|
91
|
+
/>
|
|
92
|
+
</template>
|
|
93
|
+
</jh-drag-row>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<script setup lang="ts">
|
|
98
|
+
import { ref } from "vue";
|
|
99
|
+
|
|
100
|
+
const page = ref({ current: 1, size: 10, total: 0 });
|
|
101
|
+
const list = ref([]);
|
|
102
|
+
const bottomPage = ref({ current: 1, size: 10, total: 0 });
|
|
103
|
+
const bottomList = ref([]);
|
|
104
|
+
|
|
105
|
+
// 查询上表数据
|
|
106
|
+
const select = async () => {
|
|
107
|
+
// 查询逻辑...
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// 查询下表数据
|
|
111
|
+
const selectBottom = async () => {
|
|
112
|
+
// 查询逻辑...
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// 行点击事件:联动查询下表
|
|
116
|
+
const handleRowClick = (row: any) => {
|
|
117
|
+
// 根据选中行的数据查询下表
|
|
118
|
+
selectBottom();
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
onMounted(() => {
|
|
122
|
+
select();
|
|
123
|
+
});
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<style scoped lang="scss">
|
|
127
|
+
// ⚠️ 必需样式:让拖拽组件占满容器高度
|
|
128
|
+
:deep(.drager_row) {
|
|
129
|
+
height: 100%;
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 在 Tab 标签页中使用
|
|
135
|
+
|
|
136
|
+
```vue
|
|
137
|
+
<template>
|
|
138
|
+
<div class="app-container app-page-container my-page">
|
|
139
|
+
<el-tabs v-model="activeTab" class="tabs-container">
|
|
140
|
+
<el-tab-pane label="主从表" name="master">
|
|
141
|
+
<jh-drag-row :top-height="400">
|
|
142
|
+
<template #top>
|
|
143
|
+
<!-- 上表内容 -->
|
|
144
|
+
</template>
|
|
145
|
+
<template #bottom>
|
|
146
|
+
<!-- 下表内容 -->
|
|
147
|
+
</template>
|
|
148
|
+
</jh-drag-row>
|
|
149
|
+
</el-tab-pane>
|
|
150
|
+
</el-tabs>
|
|
151
|
+
</div>
|
|
152
|
+
</template>
|
|
153
|
+
|
|
154
|
+
<style scoped lang="scss">
|
|
155
|
+
.my-page {
|
|
156
|
+
.tabs-container {
|
|
157
|
+
height: calc(100vh - 120px);
|
|
158
|
+
|
|
159
|
+
:deep(.el-tabs__content) {
|
|
160
|
+
height: calc(100% - 55px);
|
|
161
|
+
padding: 10px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:deep(.el-tab-pane) {
|
|
165
|
+
height: 100%;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// ⚠️ 核心样式:确保拖拽组件能正常工作
|
|
169
|
+
:deep(.drager_row) {
|
|
170
|
+
height: 100%;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</style>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Props 属性
|
|
178
|
+
|
|
179
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
180
|
+
| ---------- | ------------------------------------ | --------- | ------- |
|
|
181
|
+
| top-height | 上部区域的初始高度(单位:px) | `number` | - |
|
|
182
|
+
| topPercent | 上部区域的初始百分比(与 top-height 二选一) | `number` | - |
|
|
183
|
+
| bottomHeight | 下部区域的初始高度(单位:px) | `number` | - |
|
|
184
|
+
| bottomPercent | 下部区域的初始百分比 | `number` | - |
|
|
185
|
+
| height | 容器总高度 | `string` | `"400px"` |
|
|
186
|
+
| sliderWidth | 拖拽分割线的宽度(单位:px) | `number` | `10` |
|
|
187
|
+
|
|
188
|
+
> **提示**: 推荐使用 `top-height` 设置上部区域高度,下部区域会自动填充剩余空间。
|
|
189
|
+
|
|
190
|
+
## Slots 插槽
|
|
191
|
+
|
|
192
|
+
| 插槽名 | 说明 |
|
|
193
|
+
| ------ | ------------ |
|
|
194
|
+
| top | 上部区域内容 |
|
|
195
|
+
| bottom | 下部区域内容 |
|
|
196
|
+
|
|
197
|
+
## 使用场景
|
|
198
|
+
|
|
199
|
+
### 1. 主从表联动
|
|
200
|
+
|
|
201
|
+
```vue
|
|
202
|
+
<template>
|
|
203
|
+
<div class="app-container app-page-container">
|
|
204
|
+
<jh-drag-row :top-height="350">
|
|
205
|
+
<template #top>
|
|
206
|
+
<!-- 主表:订单列表 -->
|
|
207
|
+
<BaseTable
|
|
208
|
+
:data="orderList"
|
|
209
|
+
:columns="orderColumns"
|
|
210
|
+
@row-click="handleOrderClick"
|
|
211
|
+
/>
|
|
212
|
+
</template>
|
|
213
|
+
<template #bottom>
|
|
214
|
+
<!-- 从表:订单明细 -->
|
|
215
|
+
<BaseTable :data="orderDetailList" :columns="detailColumns" />
|
|
216
|
+
</template>
|
|
217
|
+
</jh-drag-row>
|
|
218
|
+
</div>
|
|
219
|
+
</template>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### 2. 轧钢计划与钢坯信息
|
|
223
|
+
|
|
224
|
+
```vue
|
|
225
|
+
<template>
|
|
226
|
+
<div class="app-container app-page-container">
|
|
227
|
+
<jh-drag-row :top-height="380">
|
|
228
|
+
<template #top>
|
|
229
|
+
<!-- 上表:轧钢计划列表 -->
|
|
230
|
+
<BaseTable
|
|
231
|
+
:data="planList"
|
|
232
|
+
:columns="planColumns"
|
|
233
|
+
highlight-current-row
|
|
234
|
+
@current-change="handlePlanChange"
|
|
235
|
+
/>
|
|
236
|
+
</template>
|
|
237
|
+
<template #bottom>
|
|
238
|
+
<!-- 下表:钢坯信息 -->
|
|
239
|
+
<BaseToolbar :items="slabToolbars" />
|
|
240
|
+
<BaseTable :data="slabList" :columns="slabColumns" />
|
|
241
|
+
</template>
|
|
242
|
+
</jh-drag-row>
|
|
243
|
+
</div>
|
|
244
|
+
</template>
|
|
245
|
+
|
|
246
|
+
<script setup lang="ts">
|
|
247
|
+
// 上表选中行变化时,查询下表数据
|
|
248
|
+
const handlePlanChange = (row: any) => {
|
|
249
|
+
if (row && row.lotNo) {
|
|
250
|
+
querySlabList(row.lotNo);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
</script>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 3. 合并订单(左右+上下布局)
|
|
257
|
+
|
|
258
|
+
```vue
|
|
259
|
+
<template>
|
|
260
|
+
<div class="app-container app-page-container">
|
|
261
|
+
<jh-drag-row :top-height="300">
|
|
262
|
+
<template #top>
|
|
263
|
+
<!-- 上部:母订单列表 -->
|
|
264
|
+
<BaseQuery :form="queryParam" :items="queryItems" />
|
|
265
|
+
<BaseTable :data="motherOrderList" :columns="columns" />
|
|
266
|
+
</template>
|
|
267
|
+
<template #bottom>
|
|
268
|
+
<!-- 下部:左右两个表格 -->
|
|
269
|
+
<div class="bottom-container">
|
|
270
|
+
<div class="left-table">
|
|
271
|
+
<div class="title">已合并订单</div>
|
|
272
|
+
<BaseTable :data="mergedList" :columns="mergedColumns" />
|
|
273
|
+
</div>
|
|
274
|
+
<div class="right-table">
|
|
275
|
+
<div class="title">未合并订单</div>
|
|
276
|
+
<BaseTable :data="unmergedList" :columns="unmergedColumns" />
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</template>
|
|
280
|
+
</jh-drag-row>
|
|
281
|
+
</div>
|
|
282
|
+
</template>
|
|
283
|
+
|
|
284
|
+
<style scoped lang="scss">
|
|
285
|
+
.bottom-container {
|
|
286
|
+
display: flex;
|
|
287
|
+
gap: 10px;
|
|
288
|
+
height: 100%;
|
|
289
|
+
|
|
290
|
+
.left-table,
|
|
291
|
+
.right-table {
|
|
292
|
+
flex: 1;
|
|
293
|
+
overflow: auto;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
:deep(.drager_row) {
|
|
298
|
+
height: 100%;
|
|
299
|
+
}
|
|
300
|
+
</style>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### 项目真实代码示例
|
|
304
|
+
|
|
305
|
+
```vue
|
|
306
|
+
<!-- src/views/produce/production-order/sclk/ommt-steel-lib/index.vue -->
|
|
307
|
+
<template>
|
|
308
|
+
<div class="app-container app-page-container">
|
|
309
|
+
<jh-drag-row :top-height="350">
|
|
310
|
+
<template #top>
|
|
311
|
+
<!-- 搜索栏 -->
|
|
312
|
+
<BaseQuery
|
|
313
|
+
:form="queryParam"
|
|
314
|
+
:items="queryItems"
|
|
315
|
+
:columns="4"
|
|
316
|
+
@select="select"
|
|
317
|
+
@reset="select"
|
|
318
|
+
/>
|
|
319
|
+
<!-- 工具栏 -->
|
|
320
|
+
<BaseToolbar :items="toolbars" />
|
|
321
|
+
<!-- 表格 -->
|
|
322
|
+
<BaseTable
|
|
323
|
+
ref="tableRef"
|
|
324
|
+
:data="list"
|
|
325
|
+
:columns="columns"
|
|
326
|
+
showToolbar
|
|
327
|
+
/>
|
|
328
|
+
<!-- 分页 -->
|
|
329
|
+
<jh-pagination
|
|
330
|
+
v-show="page.total && page.total > 0"
|
|
331
|
+
:total="page.total || 0"
|
|
332
|
+
v-model:currentPage="page.current"
|
|
333
|
+
v-model:pageSize="page.size"
|
|
334
|
+
@current-change="select"
|
|
335
|
+
@size-change="select"
|
|
336
|
+
/>
|
|
337
|
+
</template>
|
|
338
|
+
<template #bottom>
|
|
339
|
+
<BaseTable
|
|
340
|
+
ref="bottomTableRef"
|
|
341
|
+
:data="bottomList"
|
|
342
|
+
:columns="bottomColumns"
|
|
343
|
+
showToolbar
|
|
344
|
+
/>
|
|
345
|
+
</template>
|
|
346
|
+
</jh-drag-row>
|
|
347
|
+
</div>
|
|
348
|
+
</template>
|
|
349
|
+
|
|
350
|
+
<style scoped lang="scss">
|
|
351
|
+
.app-page-container {
|
|
352
|
+
// ⭐ 关键样式:让 drager_row 占满容器高度
|
|
353
|
+
:deep(.drager_row) {
|
|
354
|
+
height: 100%;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
</style>
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### 另一种样式写法(全局样式)
|
|
361
|
+
|
|
362
|
+
```scss
|
|
363
|
+
// index.scss (非scoped)
|
|
364
|
+
.app-page-container .drager_row {
|
|
365
|
+
height: 100%;
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## 常见问题
|
|
372
|
+
|
|
373
|
+
### ❌ 问题 1:拖拽手柄无法拖动
|
|
374
|
+
|
|
375
|
+
**原因:** 缺少关键样式 `.drager_row { height: 100%; }`
|
|
376
|
+
|
|
377
|
+
**解决方案:**
|
|
378
|
+
|
|
379
|
+
```scss
|
|
380
|
+
// 方案 1:使用 :deep() 穿透(推荐)
|
|
381
|
+
:deep(.drager_row) {
|
|
382
|
+
height: 100%;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// 方案 2:使用全局样式
|
|
386
|
+
.app-page-container .drager_row {
|
|
387
|
+
height: 100%;
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### ❌ 问题 2:上表只有一条数据时高度太矮,显示拥挤
|
|
392
|
+
|
|
393
|
+
**原因:** `top-height` 设置过小
|
|
394
|
+
|
|
395
|
+
**解决方案:**
|
|
396
|
+
|
|
397
|
+
```vue
|
|
398
|
+
<!-- 适当增加 top-height 值 -->
|
|
399
|
+
<jh-drag-row :top-height="400">
|
|
400
|
+
<!-- 推荐值:350-450 之间 -->
|
|
401
|
+
</jh-drag-row>
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### ❌ 问题 3:在 Tab 标签页中无法拖动
|
|
405
|
+
|
|
406
|
+
**原因:** Tab 容器没有设置高度,或 `.drager_row` 样式未正确应用
|
|
407
|
+
|
|
408
|
+
**解决方案:**
|
|
409
|
+
|
|
410
|
+
```scss
|
|
411
|
+
.tabs-container {
|
|
412
|
+
height: calc(100vh - 120px); // 给 Tab 容器设置高度
|
|
413
|
+
|
|
414
|
+
:deep(.el-tabs__content) {
|
|
415
|
+
height: calc(100% - 55px);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
:deep(.el-tab-pane) {
|
|
419
|
+
height: 100%;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// ⚠️ 关键:必须添加这行
|
|
423
|
+
:deep(.drager_row) {
|
|
424
|
+
height: 100%;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### ❌ 问题 4:拖拽后布局错乱
|
|
430
|
+
|
|
431
|
+
**原因:** 容器高度链条断裂
|
|
432
|
+
|
|
433
|
+
**检查清单:**
|
|
434
|
+
|
|
435
|
+
1. ✅ 父容器是否有明确的高度(如 `calc(100vh - 120px)`)
|
|
436
|
+
2. ✅ 所有中间层容器是否设置了 `height: 100%`
|
|
437
|
+
3. ✅ `.drager_row` 是否设置了 `height: 100%`
|
|
438
|
+
4. ✅ 是否使用了 `overflow: hidden` 阻止了拖拽
|
|
439
|
+
|
|
440
|
+
## 最佳实践
|
|
441
|
+
|
|
442
|
+
### ✅ 推荐做法
|
|
443
|
+
|
|
444
|
+
```vue
|
|
445
|
+
<template>
|
|
446
|
+
<div class="app-container app-page-container my-component">
|
|
447
|
+
<jh-drag-row :top-height="380">
|
|
448
|
+
<template #top>
|
|
449
|
+
<!-- 上表完整内容:搜索栏、工具栏、表格、分页 -->
|
|
450
|
+
<BaseQuery />
|
|
451
|
+
<BaseToolbar />
|
|
452
|
+
<BaseTable />
|
|
453
|
+
<jh-pagination />
|
|
454
|
+
</template>
|
|
455
|
+
<template #bottom>
|
|
456
|
+
<!-- 下表完整内容 -->
|
|
457
|
+
<BaseToolbar />
|
|
458
|
+
<BaseTable />
|
|
459
|
+
</template>
|
|
460
|
+
</jh-drag-row>
|
|
461
|
+
</div>
|
|
462
|
+
</template>
|
|
463
|
+
|
|
464
|
+
<style scoped lang="scss">
|
|
465
|
+
.my-component {
|
|
466
|
+
// ⚠️ 必需样式
|
|
467
|
+
:deep(.drager_row) {
|
|
468
|
+
height: 100%;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
</style>
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### ❌ 不推荐做法
|
|
475
|
+
|
|
476
|
+
```vue
|
|
477
|
+
<!-- ❌ 错误 1:忘记设置 .drager_row 高度 -->
|
|
478
|
+
<style scoped lang="scss">
|
|
479
|
+
.my-component {
|
|
480
|
+
// 缺少 .drager_row 的高度设置
|
|
481
|
+
}
|
|
482
|
+
</style>
|
|
483
|
+
|
|
484
|
+
<!-- ❌ 错误 2:在 jh-drag-row 外层包裹不必要的容器 -->
|
|
485
|
+
<div class="wrapper">
|
|
486
|
+
<jh-drag-row>
|
|
487
|
+
<!-- 内容 -->
|
|
488
|
+
</jh-drag-row>
|
|
489
|
+
</div>
|
|
490
|
+
|
|
491
|
+
<!-- ❌ 错误 3:top-height 设置过小 -->
|
|
492
|
+
<jh-drag-row :top-height="100">
|
|
493
|
+
<!-- 上表会显得很拥挤 -->
|
|
494
|
+
</jh-drag-row>
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
## 高度设置建议
|
|
498
|
+
|
|
499
|
+
| 场景 | 推荐 top-height | 说明 |
|
|
500
|
+
| ---------------------- | --------------- | ------------------------------ |
|
|
501
|
+
| 简单表格(无搜索栏) | 250-300 | 足够显示表头和 5-8 条数据 |
|
|
502
|
+
| 标准表格(含搜索栏) | 350-400 | 显示搜索栏、工具栏、表格、分页 |
|
|
503
|
+
| 复杂表格(多搜索条件) | 400-450 | 搜索条件多,需要更多空间 |
|
|
504
|
+
| 强调上表(主表更重要) | 450-500 | 上表占据更多空间 |
|
|
505
|
+
| 强调下表(从表更重要) | 250-300 | 给下表留更多空间 |
|
|
506
|
+
|
|
507
|
+
## 样式定制
|
|
508
|
+
|
|
509
|
+
### 修改拖拽手柄样式
|
|
510
|
+
|
|
511
|
+
```scss
|
|
512
|
+
:deep(.drager_row) {
|
|
513
|
+
height: 100%;
|
|
514
|
+
|
|
515
|
+
// 拖拽手柄
|
|
516
|
+
.drager {
|
|
517
|
+
background: #e0e0e0; // 手柄背景色
|
|
518
|
+
height: 6px; // 手柄高度
|
|
519
|
+
cursor: row-resize; // 鼠标样式
|
|
520
|
+
|
|
521
|
+
&:hover {
|
|
522
|
+
background: #1890ff; // 悬停颜色
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### 调整上下区域内边距
|
|
529
|
+
|
|
530
|
+
```scss
|
|
531
|
+
:deep(.drager_row) {
|
|
532
|
+
height: 100%;
|
|
533
|
+
|
|
534
|
+
.top-area {
|
|
535
|
+
padding: 10px;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.bottom-area {
|
|
539
|
+
padding: 10px;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
## 性能优化
|
|
545
|
+
|
|
546
|
+
### 避免频繁重渲染
|
|
547
|
+
|
|
548
|
+
```vue
|
|
549
|
+
<script setup lang="ts">
|
|
550
|
+
// ✅ 使用防抖,避免拖拽时频繁触发查询
|
|
551
|
+
import { debounce } from "lodash-es";
|
|
552
|
+
|
|
553
|
+
const handleRowChange = debounce((row: any) => {
|
|
554
|
+
queryBottomData(row);
|
|
555
|
+
}, 300);
|
|
556
|
+
</script>
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
### 虚拟滚动(大数据量)
|
|
560
|
+
|
|
561
|
+
```vue
|
|
562
|
+
<!-- 上下表格数据量大时,配合虚拟滚动 -->
|
|
563
|
+
<template #top>
|
|
564
|
+
<BaseTable
|
|
565
|
+
:data="list"
|
|
566
|
+
:columns="columns"
|
|
567
|
+
virtual-scroll
|
|
568
|
+
:virtual-scroll-height="300"
|
|
569
|
+
/>
|
|
570
|
+
</template>
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
## 参考示例
|
|
574
|
+
|
|
575
|
+
- 📄 钢坯利库:`src/views/produce/production-order/sclk/ommt-billet-lib/index.vue`
|
|
576
|
+
- 📄 订单合并:`src/views/produce/production-order/scdd/omom-order-merge/index.vue`
|
|
577
|
+
- 📄 轧钢计划:`src/views/produce/production-mmwr/jhgl/mmwr-steel-rolling-plan/index.vue`
|
|
578
|
+
- 📄 剔钢作业:`src/views/produce/production-mmwr/sjgl/mmwr-steel-stripping-operations/index.vue`
|
|
579
|
+
|
|
580
|
+
## 总结
|
|
581
|
+
|
|
582
|
+
✅ **使用 jh-drag-row 的核心要点:**
|
|
583
|
+
|
|
584
|
+
1. **必须设置** `:deep(.drager_row) { height: 100%; }`
|
|
585
|
+
2. **合理设置** `top-height` 属性(推荐 350-450)
|
|
586
|
+
3. **确保高度链完整**(父容器 → Tab → 拖拽组件都要有高度)
|
|
587
|
+
4. **上下区域内容完整**(包含搜索栏、工具栏、表格、分页等)
|
|
588
|
+
5. **在 Tab 中使用时**额外注意样式穿透
|
|
589
|
+
|
|
590
|
+
遵循以上规范,jh-drag-row 组件能够提供流畅的拖拽体验和良好的用户交互!
|