feat: 手机连续扫与出仓汇总表改用t-table并升至1.1.24
This commit is contained in:
@@ -1,29 +1,52 @@
|
||||
<template>
|
||||
<view class="fabric-out-summary">
|
||||
<scroll-view scroll-x class="fabric-out-summaryScroll">
|
||||
<wyb-table
|
||||
:headers="headers"
|
||||
:contents="contents"
|
||||
:width="tableWidth"
|
||||
height="auto"
|
||||
:font-size="[36, 36]"
|
||||
:min-height="[100, 100]"
|
||||
:padding="[16, 12]"
|
||||
:first-line-fixed="false"
|
||||
empty-string=""
|
||||
@onCellClick="$emit('cell-click', $event)"
|
||||
/>
|
||||
<view class="fabric-out-summaryInner" :style="{ width: tableWidth }">
|
||||
<t-table border="1" border-color="#e1e1e1">
|
||||
<t-tr font-size="18" color="#3e3e3e" align="center">
|
||||
<t-th
|
||||
v-for="col in headers"
|
||||
:key="col.key"
|
||||
align="center"
|
||||
>
|
||||
<view class="fabric-out-th" :style="cellStyle(col)">{{ col.label }}</view>
|
||||
</t-th>
|
||||
</t-tr>
|
||||
<t-tr
|
||||
v-for="(row, rowIndex) in contents"
|
||||
:key="row.group_key || rowIndex"
|
||||
font-size="18"
|
||||
color="#333"
|
||||
align="center"
|
||||
>
|
||||
<t-td
|
||||
v-for="col in headers"
|
||||
:key="col.key"
|
||||
align="center"
|
||||
>
|
||||
<view
|
||||
class="fabric-out-td"
|
||||
:style="cellStyle(col)"
|
||||
@click="onCellClick(col.key, row)"
|
||||
>{{ formatCell(row, col.key) }}</view>
|
||||
</t-td>
|
||||
</t-tr>
|
||||
</t-table>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-if="!contents.length" class="fabric-out-summaryEmpty">暂无数据~~</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
import tTable from '@/components/t-table/t-table.vue';
|
||||
import tTr from '@/components/t-table/t-tr.vue';
|
||||
import tTh from '@/components/t-table/t-th.vue';
|
||||
import tTd from '@/components/t-table/t-td.vue';
|
||||
import { SUMMARY_TABLE_COLUMNS } from '@/common/storeFabricBusinessOut';
|
||||
|
||||
export default {
|
||||
components: { wybTable },
|
||||
components: { tTable, tTr, tTh, tTd },
|
||||
props: {
|
||||
rows: { type: Array, default: () => [] },
|
||||
},
|
||||
@@ -47,10 +70,30 @@ export default {
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
cellStyle(col) {
|
||||
const width = `${col.width || 160}rpx`;
|
||||
return {
|
||||
width,
|
||||
minWidth: width,
|
||||
maxWidth: width,
|
||||
};
|
||||
},
|
||||
formatCell(row, key) {
|
||||
const val = row[key];
|
||||
if (val === 0) return '0';
|
||||
return val != null && val !== '' ? val : '-';
|
||||
},
|
||||
onCellClick(key, row) {
|
||||
this.$emit('cell-click', { key, lineData: row });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/common/pda-typography.scss';
|
||||
|
||||
.fabric-out-summary {
|
||||
background: #fff;
|
||||
margin-top: 16rpx;
|
||||
@@ -58,16 +101,40 @@ export default {
|
||||
.fabric-out-summaryScroll {
|
||||
width: 100%;
|
||||
}
|
||||
.fabric-out-summary ::v-deep .wyb-table-scroll-view {
|
||||
height: auto !important;
|
||||
overflow-x: auto;
|
||||
overflow-y: visible;
|
||||
.fabric-out-summaryInner {
|
||||
min-width: 100%;
|
||||
}
|
||||
.fabric-out-summary ::v-deep .t-table {
|
||||
width: 100%;
|
||||
}
|
||||
.fabric-out-summary ::v-deep .t-th,
|
||||
.fabric-out-summary ::v-deep .t-td {
|
||||
flex: 0 0 auto;
|
||||
width: auto;
|
||||
padding: 0;
|
||||
min-height: $pda-row-min-height;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.fabric-out-th,
|
||||
.fabric-out-td {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: $pda-row-min-height;
|
||||
padding: 16rpx 12rpx;
|
||||
font-size: $pda-font-body;
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
}
|
||||
.fabric-out-th {
|
||||
font-weight: bold;
|
||||
}
|
||||
.fabric-out-summaryEmpty {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 36rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: $pda-font-body;
|
||||
line-height: $pda-row-min-height;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user