|
|
<div >
|
|
|
<div style="width:auto;height: 100%">
|
|
|
<!-- 表格-->
|
|
|
<el-table :border="showBorder" v-loading="loading" :size="size" ref="multipleTable" @selection-change="handleSelectionChange" :data="dataList" stripe header-row-class-name="tbl-header-class" :height="height"
|
|
|
style="width: 100%;margin: 0px 0px; font-size:13.5px;" :row-key="getRowKeys" :expand-row-keys="expands">
|
|
|
<el-table class="table-style-custom" :border="showBorder" v-loading="loading" :size="size" ref="multipleTable"
|
|
|
@selection-change="handleSelectionChange" :data="dataList"
|
|
|
:height="height"
|
|
|
:row-key="getRowKeys" :expand-row-keys="expands">
|
|
|
|
|
|
<el-table-column type="expand" v-if="showExpand">
|
|
|
<template #default="scope">
|
|
|
<slot name="expand" :scope="scope" >
|
|
|
<slot name="expand" :scope="scope">
|
|
|
|
|
|
</slot>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="showSelection && columns.length > 0" align="center" type="selection" width="55" />
|
|
|
<el-table-column v-if="showIndex && columns.length > 0" type="index" :label="indexLabel" align="center" width="50"/>
|
|
|
<el-table-column v-if="showSelection && columns.length > 0" align="center" type="selection" width="55"/>
|
|
|
<el-table-column v-if="showIndex && columns.length > 0" type="index" :label="indexLabel" align="center"
|
|
|
width="50"/>
|
|
|
|
|
|
<el-table-column v-for="item in columns" :prop="item.prop" :label="item.label" :sortable="item.sortable == undefined ? false : item.sortable" :align="item.align == undefined ? 'center' : item.align "
|
|
|
<el-table-column v-for="item in columns" :prop="item.prop" :label="item.label"
|
|
|
:sortable="item.sortable == undefined ? false : item.sortable"
|
|
|
:align="item.align == undefined ? 'center' : item.align "
|
|
|
:width="getWidth(item.width)">
|
|
|
<template #default="scope">
|
|
|
<slot :row="scope.row" :prop="item.prop" :column="item">
|
|
|
<div v-if="typeof(item.click) == 'function' && typeof(item.render) == 'function'">
|
|
|
<span style="cursor: pointer" @click="item.click(scope.row)" v-html="item.render(scope.row)"></span>
|
|
|
<div v-if="typeof(item.click) == 'function' && typeof(item.render) == 'function'">
|
|
|
<span style="cursor: pointer" @click="item.click(scope.row)"
|
|
|
v-html="item.render(scope.row)"></span>
|
|
|
</div>
|
|
|
<div v-else-if="typeof(item.click) == 'function'" >
|
|
|
<div v-else-if="typeof(item.click) == 'function'">
|
|
|
<span style="cursor: pointer" @click="item.click(scope.row)"> {{scope.row[item.prop]}}</span>
|
|
|
</div>
|
|
|
<div v-else-if="typeof(item.render) == 'function'" >
|
|
|
<div v-else-if="typeof(item.render) == 'function'">
|
|
|
<span v-html="item.render(scope.row)">{{scope.row[item.prop]}}</span>
|
|
|
</div>
|
|
|
|
...
|
...
|
@@ -42,9 +48,9 @@ |
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column v-if="showTools && columns.length > 0" label="操作" width="80" align="center">
|
|
|
<el-table-column v-if="showTools && columns.length > 0" label="操作" width="80" align="center">
|
|
|
<template #default="scope">
|
|
|
<slot name="tools" :scope="scope" ></slot>
|
|
|
<slot name="tools" :scope="scope"></slot>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
...
|
...
|
@@ -63,4 +69,39 @@ |
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
<style lang="scss" scoped>
|
|
|
.table-style-custom {
|
|
|
width: calc(100% - 10px);
|
|
|
max-width: calc(100% - 10px);
|
|
|
margin: 5px auto;
|
|
|
border: 1px solid #4d5457; /* 表格整体的边框样式 */
|
|
|
border-top: 1px solid #4d5457;
|
|
|
border-left: 1px solid #4d5457;
|
|
|
//background-color: #131720;
|
|
|
}
|
|
|
|
|
|
.table-style-custom .el-table__body-wrapper .el-table__body,.table-style-custom .el-table__header-wrapper .el-table__header{
|
|
|
width: auto;
|
|
|
max-width: calc(100% - 10px);
|
|
|
}
|
|
|
.table-style-custom .el-table__header tr, .el-table__header th {
|
|
|
height: 40px;
|
|
|
padding: 0;
|
|
|
color: #ccd3cc;
|
|
|
background-color: #131720;
|
|
|
}
|
|
|
|
|
|
.table-style-custom .el-table__body tr, .el-table__body td {
|
|
|
padding: 0;
|
|
|
height: 40px;
|
|
|
color: #ccd3cc;
|
|
|
background-color: #2e313d;
|
|
|
}
|
|
|
|
|
|
.table-style-custom .el-table__body tr.current-row > td,
|
|
|
.table-style-custom .el-table__body tr:hover > td {
|
|
|
color: #07f;
|
|
|
cursor: pointer;
|
|
|
background-color: #363c53 !important;
|
|
|
}
|
|
|
</style> |
|
|
\ No newline at end of file |
...
|
...
|
|