🦄 refactor: 封装统一表格组件,便于批量扩展表格能力

This commit is contained in:
砂糖
2025-08-27 16:47:33 +08:00
parent 278b0c8258
commit 7ea0de6a67
133 changed files with 465 additions and 432 deletions

View File

@@ -68,7 +68,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="purchasePlanList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="purchasePlanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="采购计划编号" align="center" prop="planCode" />
<el-table-column label="负责人" align="center" prop="owner" />
@@ -103,7 +103,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"
@@ -173,13 +173,13 @@
</el-form-item>
</el-form>
<el-table v-loading="orderLoading" :data="orderList" @row-click="handleOrderSelect" style="cursor: pointer;">
<KLPTable v-loading="orderLoading" :data="orderList" @row-click="handleOrderSelect" style="cursor: pointer;">
<el-table-column label="订单编号" align="center" prop="orderCode" />
<el-table-column label="客户名称" align="center" prop="customerName" />
<el-table-column label="销售经理" align="center" prop="salesManager" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
</el-table>
</KLPTable>
<pagination
v-show="orderTotal>0"

View File

@@ -43,7 +43,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="purchasePlanDetailList" @selection-change="handleSelectionChange"
<KLPTable v-loading="loading" :data="purchasePlanDetailList" @selection-change="handleSelectionChange"
ref="purchasePlanDetailTable">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="明细ID" align="center" prop="detailId" v-if="true"/>
@@ -104,7 +104,7 @@
@click="handleStatusChange(scope.row, EPurchaseDetailStatus.FINISH, '采购完成')">设为完成</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />

View File

@@ -19,7 +19,7 @@
<!-- 采购单明细区 -->
<el-card shadow="never">
<div slot="header" class="section-title">采购单明细</div>
<el-table
<KLPTable
:data="purchaseList"
@selection-change="handleRightSelectionChange"
style="width: 100%"
@@ -56,7 +56,7 @@
<el-input v-model="scope.row.remark" size="small" />
</template>
</el-table-column>
</el-table>
</KLPTable>
</el-card>
</div>
<div style="margin-top: 20px; text-align: right;" v-loading="submitLoading" element-loading-text="正在提交数据...">

View File

@@ -52,7 +52,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="purchasePlanDetailList" @selection-change="handleSelectionChange" ref="purchasePlanDetailTable">
<KLPTable v-loading="loading" :data="purchasePlanDetailList" @selection-change="handleSelectionChange" ref="purchasePlanDetailTable">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="明细ID" align="center" prop="detailId" v-if="true"/>
<el-table-column label="采购计划ID" align="center" prop="planId" /> -->
@@ -137,7 +137,7 @@
>设为完成</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total > 0"

View File

@@ -6,14 +6,14 @@
</el-row>
<el-row :gutter="20" style="margin-top: 20px;">
<el-col :span="12">
<el-table :data="oldResult" style="width: 100%">
<KLPTable :data="oldResult" style="width: 100%">
<el-table-column prop="attrKey" label="属性名称" />
<el-table-column prop="attrValue" label="属性值" />
</el-table>
</KLPTable>
</el-col>
<el-col :span="12">
<!-- 默认全部选中 -->
<el-table :data="newResult" style="width: 100%" @selection-change="handleSelectionChange" :default-sort="{ prop: 'attrKey', order: 'ascending' }">
<KLPTable :data="newResult" style="width: 100%" @selection-change="handleSelectionChange" :default-sort="{ prop: 'attrKey', order: 'ascending' }">
<el-table-column type="selection" width="55" />
<el-table-column prop="attrKey" label="属性名称">
<template slot-scope="scope">
@@ -25,7 +25,7 @@
<el-input v-model="scope.row.attrValue" />
</template>
</el-table-column>
</el-table>
</KLPTable>
</el-col>
</el-row>
<el-row style="margin-top: 20px;">

View File

@@ -58,10 +58,10 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-table :data="newResult" style="width: 100%">
<KLPTable :data="newResult" style="width: 100%">
<el-table-column prop="attrKey" label="属性名称" />
<el-table-column prop="attrValue" label="属性值" />
</el-table>
</KLPTable>
</el-col>
<el-col :span="12">
<div>

View File

@@ -58,7 +58,7 @@
<!-- 入库明细表格 -->
<el-form-item label="入库明细">
<el-table
<KLPTable
:data="form.details"
border
style="width: 100%"
@@ -108,7 +108,7 @@
/>
</template>
</el-table-column>
</el-table>
</KLPTable>
</el-form-item>
</el-form>

View File

@@ -19,7 +19,7 @@
<el-row style="height: 60vh;">
<el-col :span="8">
<!-- 原材料表格 -->
<el-table v-loading="rawMaterialLoading" ref="leftTable" :data="rawMaterialList" style="width: 100%" height="600" class="message-table" stripe @selection-change="handleSelectionChange">
<KLPTable v-loading="rawMaterialLoading" ref="leftTable" :data="rawMaterialList" style="width: 100%" height="600" class="message-table" stripe @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="rawMaterialId" label="原材料" align="center">
<template #default="scope">
@@ -35,7 +35,7 @@
<el-table-column prop="onTheWay" label="在途" align="center" />
<el-table-column prop="inventory" label="在库" align="center" />
<el-table-column prop="demand" label="所需" align="center" />
</el-table>
</KLPTable>
<el-pagination
style="margin-top: 10px;"
@@ -56,7 +56,7 @@
</el-col>
<el-col :span="14">
<div slot="header" class="section-title">采购单明细</div>
<el-table
<KLPTable
:data="purchaseList"
@selection-change="handleRightSelectionChange"
style="width: 100%"
@@ -94,7 +94,7 @@
<el-input v-model="scope.row.remark" size="small" />
</template>
</el-table-column>
</el-table>
</KLPTable>
</el-col>
</el-row>
</div>

View File

@@ -51,7 +51,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="字典编码" align="center" prop="dictCode" />
<el-table-column label="字典标签" align="center" prop="dictLabel">
@@ -89,7 +89,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"