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