🦄 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

@@ -103,7 +103,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="参数主键" align="center" prop="configId" />
<el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" />
@@ -138,7 +138,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"

View File

@@ -48,7 +48,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
<KLPTable
v-if="refreshTable"
v-loading="loading"
:data="deptList"
@@ -94,7 +94,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<!-- 添加或修改部门对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>

View File

@@ -90,7 +90,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">
@@ -130,7 +130,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"

View File

@@ -108,7 +108,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="字典编号" align="center" prop="dictId" />
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
@@ -148,7 +148,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"

View File

@@ -48,7 +48,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
<KLPTable
v-if="refreshTable"
v-loading="loading"
:data="menuList"
@@ -100,7 +100,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>

View File

@@ -69,7 +69,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table-column
@@ -112,7 +112,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"

View File

@@ -67,7 +67,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ossConfigList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="ossConfigList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主建" align="center" prop="ossConfigId" v-if="false"/>
<el-table-column label="配置key" align="center" prop="configKey" />
@@ -111,7 +111,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total > 0"

View File

@@ -119,7 +119,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ossList" @selection-change="handleSelectionChange"
<KLPTable v-loading="loading" :data="ossList" @selection-change="handleSelectionChange"
:header-cell-class-name="handleHeaderClass"
@header-click="handleHeaderCLick"
v-if="showTable">
@@ -166,7 +166,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"

View File

@@ -79,7 +79,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="岗位编号" align="center" prop="postId" />
<el-table-column label="岗位编码" align="center" prop="postCode" />
@@ -113,7 +113,7 @@
>删除</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"

View File

@@ -59,7 +59,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
@@ -86,7 +86,7 @@
>取消授权</el-button>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"

View File

@@ -98,7 +98,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="角色编号" prop="roleId" width="120" />
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
@@ -146,7 +146,7 @@
</el-dropdown>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"

View File

@@ -24,7 +24,7 @@
</el-form-item>
</el-form>
<el-row>
<el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
<KLPTable @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
@@ -40,7 +40,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"
:total="total"

View File

@@ -17,7 +17,7 @@
</el-form>
<h4 class="form-header h4">角色信息</h4>
<el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
<KLPTable v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
<el-table-column label="序号" type="index" align="center">
<template slot-scope="scope">
<span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
@@ -32,7 +32,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />

View File

@@ -137,7 +137,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<KLPTable v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
@@ -191,7 +191,7 @@
</el-dropdown>
</template>
</el-table-column>
</el-table>
</KLPTable>
<pagination
v-show="total>0"