布局适配
This commit is contained in:
@@ -548,13 +548,14 @@ export default function XinTable<T extends Record<string, any> = any>(props: Xin
|
||||
<Space>{ ...actionBarRender() }</Space>
|
||||
<Space size={1}>{...toolBarRender()}</Space>
|
||||
</Flex>
|
||||
{/* 表格 */}
|
||||
{/* 表格(默认横向滚动:窄屏/平板下表格内部滚动而非撑宽整页) */}
|
||||
<Table
|
||||
loading={loading}
|
||||
dataSource={dataSource}
|
||||
size={density}
|
||||
bordered={bordered}
|
||||
{...props}
|
||||
scroll={props.scroll ?? { x: 'max-content' }}
|
||||
columns={tableColumns}
|
||||
rowKey={rowKey}
|
||||
onChange={handleTableChange}
|
||||
|
||||
@@ -64,7 +64,9 @@ const LayoutContent: React.FC = () => {
|
||||
{ layout === "columns" ? <ColumnsMenu/> : <MenuRender />}
|
||||
</Sider>
|
||||
)}
|
||||
<Layout>
|
||||
{/* min-w-0:flex 子项默认 min-width:auto 会被宽表格撑破,
|
||||
归零后内容区宽度收敛到视口,表格自身的横向滚动才生效 */}
|
||||
<Layout className="min-w-0">
|
||||
<Content style={{padding: themeConfig.bodyPadding}}>
|
||||
<Outlet/>
|
||||
</Content>
|
||||
|
||||
@@ -429,6 +429,7 @@ const Index: React.FC = () => {
|
||||
rowKey={"product_id"}
|
||||
dataSource={dashboard.top_products}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
columns={[
|
||||
{
|
||||
title: t("dashboard.analysis.rank"),
|
||||
@@ -472,6 +473,7 @@ const Index: React.FC = () => {
|
||||
rowKey={"store_id"}
|
||||
dataSource={dashboard.top_stores}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
columns={[
|
||||
{
|
||||
title: t("dashboard.analysis.rank"),
|
||||
@@ -558,6 +560,7 @@ const Index: React.FC = () => {
|
||||
rowKey={"id"}
|
||||
dataSource={dashboard.latest_orders}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
columns={[
|
||||
{
|
||||
title: t("dashboard.analysis.orderNo"),
|
||||
|
||||
@@ -217,6 +217,7 @@ const Layout = () => {
|
||||
columns={productColumns}
|
||||
dataSource={productData}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
summary={() => (
|
||||
<Table.Summary>
|
||||
<Table.Summary.Row>
|
||||
|
||||
@@ -1061,6 +1061,7 @@ const PurchaseOrderPage: React.FC = () => {
|
||||
columns={storeColumns}
|
||||
dataSource={storeSummary.items}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
summary={renderStoreTotal}
|
||||
/>
|
||||
) : (
|
||||
@@ -1111,6 +1112,7 @@ const PurchaseOrderPage: React.FC = () => {
|
||||
columns={supplierColumns}
|
||||
dataSource={supplierItems}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
summary={renderSupplierTotal}
|
||||
/>
|
||||
) : (
|
||||
@@ -1130,6 +1132,7 @@ const PurchaseOrderPage: React.FC = () => {
|
||||
columns={billColumns}
|
||||
dataSource={detail.bills}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
summary={renderBillSummary}
|
||||
/>
|
||||
) : (
|
||||
|
||||
@@ -418,6 +418,7 @@ const BillPage: React.FC = () => {
|
||||
columns={itemColumns}
|
||||
dataSource={detail.items}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
summary={renderItemSummary}
|
||||
/>
|
||||
|
||||
@@ -431,6 +432,7 @@ const BillPage: React.FC = () => {
|
||||
columns={orderColumns}
|
||||
dataSource={detail.orders}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
@@ -342,6 +342,7 @@ const PaymentPage: React.FC = () => {
|
||||
columns={billColumns}
|
||||
dataSource={detail.bills}
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user