Commit 8ce31181 by limin

Merge branch 'master' of http://192.168.3.233:8090/npm/glsx-components into master

2 parents 38d77cb6 16f24d37
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
<template> <template>
<div class="glsx-table"> <div class="glsx-table">
<el-table id="initTable" v-bind="$attrs" v-on="$listeners" :key="componentKey" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-class-name="tableParams.rowClassName" :row-style="tableParams.rowStyle" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle" :show-summary="tableParams.showSummary" :summary-method="tableParams.summaryMethod"> <el-table id="initTable" v-bind="$attrs" v-on="$listeners" :key="componentKey" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-class-name="tableParams.rowClassName" :row-style="tableParams.rowStyle" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle" :show-summary="tableParams.showSummary" :summary-method="tableParams.summaryMethod" @cell-mouse-enter="hoverFn" @cell-mouse-leave="leavehoverFn">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column> <el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column>
<el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column> <el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
<el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable" :render-header="item.renderHeader"> <el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable" :render-header="item.renderHeader">
...@@ -65,6 +60,7 @@ ...@@ -65,6 +60,7 @@
</template> </template>
<script> <script>
let hignLigihtLine = ''
import SubElTableColumn from './sub-el-table-column.vue' import SubElTableColumn from './sub-el-table-column.vue'
import GlSubTableColumn from '../../GlSubTableColumn' import GlSubTableColumn from '../../GlSubTableColumn'
import GlSubTable from '../../GlSubTable' import GlSubTable from '../../GlSubTable'
...@@ -247,6 +243,42 @@ export default { ...@@ -247,6 +243,42 @@ export default {
}, },
methods: { methods: {
// 竖线高亮实现
hoverFn(row, column, cell, event) {
// console.log('row, column, cell, event: ', cell.offsetHeight)
setTimeout(() => {
const height = cell.offsetHeight
const offsetTop = cell.getBoundingClientRect().y
if (!hignLigihtLine) {
hignLigihtLine = document.createElement('div')
hignLigihtLine.setAttribute(
'style',
`position: fixed;
display:block;
top: ${offsetTop}px;
left:276px;
width:5px;
height: ${height}px;
background-color: #5850ff;`
)
} else {
hignLigihtLine.setAttribute(
'style',
`position: fixed;
display:block;
top: ${offsetTop}px;
left: 276px;
width:5px;
height: ${height}px;
background-color: #5850ff;`
)
}
document.body.appendChild(hignLigihtLine)
})
},
leavehoverFn() {
hignLigihtLine.style.display = 'none'
},
findShowHeadCol() { findShowHeadCol() {
// findShowHeadCol事件 // findShowHeadCol事件
this.tableColumns = [] this.tableColumns = []
...@@ -485,39 +517,7 @@ export default { ...@@ -485,39 +517,7 @@ export default {
.el-table tbody tr:last-child td { .el-table tbody tr:last-child td {
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
} }
//添加高亮行的竖线
.el-table .el-table__body tr.hover-row {
td:first-child {
background-color: #5850ff !important;
}
}
.el-table tbody tr:hover {
td:first-child {
background-color: #5850ff !important;
}
}
//除去左边fixed的阴影,添加竖线的时候
.el-table__fixed{
box-shadow: none !important;
}
// .el-table tbody .el-table__row:hover {
// td:first-child {
// // .el-table__cell:first-child .cell
// // background-color:red!important;
// position: relative;
// &:after {
// position: absolute;
// top: 0;
// left: 0;
// display: block;
// content: '';
// width: 5px;
// height: 100%;
// background-color: #5850ff;
// }
// }
// }
/* 样式新增光亮tr */ /* 样式新增光亮tr */
// 气泡(基础用法) // 气泡(基础用法)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!