fix(storefabric): 修复坯布库存表格上滑误触发下拉刷新
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
162e10a6fc
commit
3f2481d1eb
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="warehouse-table-wrap">
|
||||
<view class="warehouse-table-wrap" :class="{ 'is-auto-height': isAutoHeight }">
|
||||
<scroll-view scroll-x class="tableScrollX">
|
||||
<wyb-table
|
||||
ref="table"
|
||||
@ -22,10 +22,14 @@ export default {
|
||||
props: {
|
||||
headers: { type: Array, default: () => [] },
|
||||
contents: { type: Array, default: () => [] },
|
||||
// auto:高度随内容撑开,纵向滚动交给外层 scroll-view,避免与下拉刷新抢手势
|
||||
height: { type: String, default: 'auto' },
|
||||
firstLineFixed: { type: Boolean, default: true },
|
||||
},
|
||||
computed: {
|
||||
isAutoHeight() {
|
||||
return !this.height || this.height === 'auto';
|
||||
},
|
||||
tableWidth() {
|
||||
const total = (this.headers || []).reduce((sum, col) => sum + (col.width || 160), 0);
|
||||
return `${total}rpx`;
|
||||
@ -49,4 +53,10 @@ export default {
|
||||
.tableScrollX {
|
||||
width: 100%;
|
||||
}
|
||||
/* 取消表格内部纵向滚动,只保留横向;纵向由页面 scroll-view 处理 */
|
||||
.is-auto-height ::v-deep .wyb-table-scroll-view {
|
||||
height: auto !important;
|
||||
overflow-x: auto;
|
||||
overflow-y: visible;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<WarehouseDataTable
|
||||
:headers="tableHeaders"
|
||||
:contents="tableContents"
|
||||
:height="tableHeight"
|
||||
height="auto"
|
||||
@row-click="goStockList"
|
||||
/>
|
||||
</view>
|
||||
@ -56,7 +56,6 @@ import {
|
||||
GROUP_TABLE_COLUMNS,
|
||||
buildGroupListQuery,
|
||||
buildStockListNavigateQuery,
|
||||
calcTableHeight,
|
||||
fetchAllWarehouseList,
|
||||
mapGroupTableRow,
|
||||
sumStockTotals,
|
||||
@ -85,9 +84,6 @@ export default {
|
||||
totals() {
|
||||
return sumStockTotals(this.list);
|
||||
},
|
||||
tableHeight() {
|
||||
return calcTableHeight(this.tableContents.length);
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
uni.setNavigationBarTitle({ title: '坯布库存' });
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<WarehouseDataTable
|
||||
:headers="tableHeaders"
|
||||
:contents="tableContents"
|
||||
:height="tableHeight"
|
||||
height="auto"
|
||||
@row-click="goDetail"
|
||||
/>
|
||||
</view>
|
||||
@ -50,7 +50,6 @@ import {
|
||||
STOCK_TABLE_COLUMNS,
|
||||
buildDetailNavigateQuery,
|
||||
buildStockListQuery,
|
||||
calcTableHeight,
|
||||
fetchAllWarehouseList,
|
||||
mapStockTableRow,
|
||||
parsePageQuery,
|
||||
@ -84,9 +83,6 @@ export default {
|
||||
totals() {
|
||||
return sumStockTotals(this.list);
|
||||
},
|
||||
tableHeight() {
|
||||
return calcTableHeight(this.tableContents.length, { maxPx: 9999 });
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const parsed = parsePageQuery(options || {});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user