Commit caac205d authored by tianhongyang's avatar tianhongyang

fix bug

parent 0ef1f2fc
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<div class="table-item"> <div class="table-item">
<el-table v-if="tableDataTotal>0" class="fixed-table" :class="headerFixed ? 'headerFixed':''" v-loading="tableLoading" :data="tableData" <el-table v-if="tableDataTotal>0" class="fixed-table" :class="headerFixed ? 'headerFixed':''" v-loading="tableLoading" :data="tableData"
element-loading-text="Loading" ref="tableRef" border fit highlight-current-row v-sticky-header.always="stickyHeader" element-loading-text="Loading" ref="tableRef" border fit highlight-current-row v-sticky-header.always="stickyHeader"
:default-sort="defaultSort?defaultSort:{}" @sort-change="sortChange" @selection-change="selectionChange"> :default-sort="defaultSort?defaultSort:{}" @sort-change="sortChange" @selection-change="selectionChange" :cell-class-name="cellClassName" :cell-style="cellStyle">
<el-table-column type="selection" :width="needSelection.width ? needSelection.width : '38px'" v-if="needSelection.flag" <el-table-column type="selection" :width="needSelection.width ? needSelection.width : '38px'" v-if="needSelection.flag"
:fixed="needSelection.fixed" :align="needSelection.align"> :fixed="needSelection.fixed" :align="needSelection.align" :show-overflow-tooltip="needSelection.showOverflowTooltip">
</el-table-column> </el-table-column>
<el-table-column v-if="isIndex" label="序号" :width="flexWidth(tableData)" align="left" :fixed="indexFixed" :resizable="false"> <el-table-column v-if="isIndex" label="序号" :width="flexWidth(tableData)" align="left" :fixed="indexFixed" :resizable="false">
<template slot-scope="scope">{{ queryParams.pageNum * queryParams.pageSize - queryParams.pageSize + scope.$index + 1 }}</template> <template slot-scope="scope">{{ queryParams.pageNum * queryParams.pageSize - queryParams.pageSize + scope.$index + 1 }}</template>
...@@ -69,9 +69,18 @@ export default { ...@@ -69,9 +69,18 @@ export default {
flag: false, flag: false,
width: "39px", width: "39px",
fixed: false, fixed: false,
align: "left" align: "left",
showOverflowTooltip: false
}) })
}, },
cellClassName: {
type: Function,
default: () => () => { }
},
cellStyle: {
type: Function,
default: () => () => { }
},
// 吸顶偏移量 // 吸顶偏移量
stickyHeader: { stickyHeader: {
type: Object, type: Object,
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<transition name="fade-position" appear mode="out-in"> <transition name="fade-position" appear mode="out-in">
<span v-if="!form.hover && !form.value">搜索</span> <span v-if="!form.hover && !form.value">搜索</span>
<el-input v-model="form.value" :placeholder="form.placeholder ? form.placeholder : '输入关键词查询'" <el-input v-model="form.value" :placeholder="form.placeholder ? form.placeholder : '输入关键词查询'"
:style="form.width?'width:'+form.width+'px':'width:238px'" @focus="searchFocus($event,form)" @blur="searchBlur($event,form)" :style="form.width?'width:'+form.width+'px':'width:238px'" @focus.stop="searchFocus($event,form)" @blur.stop="searchBlur($event,form)"
@input="value => searchInput(value,form)" v-else @keydown.native.enter="changeSelect"> @input="value => searchInput(value,form)" v-else @keydown.native.enter="changeSelect">
<template slot="suffix"> <template slot="suffix">
<transition mode="out-in" appear name="fade"> <transition mode="out-in" appear name="fade">
......
...@@ -369,7 +369,6 @@ export default { ...@@ -369,7 +369,6 @@ export default {
if (this.sideRoute1[i].children) { if (this.sideRoute1[i].children) {
for (var j in this.sideRoute1[i].children) { for (var j in this.sideRoute1[i].children) {
if (item.title == this.sideRoute1[i].children[j].title) { if (item.title == this.sideRoute1[i].children[j].title) {
console.log(this.sideRoute1[i].children[j]);
obj.pathName = this.sideRoute1[i].children[j].pathName; obj.pathName = this.sideRoute1[i].children[j].pathName;
} }
} }
......
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
.el-table__body { .el-table__body {
tr:first-child { tr:first-child {
position: sticky; position: sticky;
top: 56px; top: 0px;
z-index: 9; z-index: 9;
} }
} }
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
<!-- 列表 --> <!-- 列表 -->
<div class="table-data-list-container" v-else-if="!isLoadingData || !tableDataList.length"> <div class="table-data-list-container" v-else-if="!isLoadingData || !tableDataList.length">
<table-list-com :formColum="formColum" :queryParams="queryParams" :tableData="tableDataList" :tableDataTotal="tableDataTotal" <table-list-com :formColum="formColum" :queryParams="queryParams" :tableData="tableDataList" :tableDataTotal="tableDataTotal"
:needSelection="needSelection" :stickyHeader="{offsetTop:'48px',offsetBottom : '10px'}" @selectionChange="selectionChange" :needSelection="needSelection" :cellClassName="cellClassName" :stickyHeader="{offsetTop:'48px',offsetBottom : '10px'}"
@handle-current-change="pageCurrentChange" ref="tableListComParent"> @selectionChange="selectionChange" @handle-current-change="pageCurrentChange" ref="tableListComParent">
<template slot="tenderAmountHeader"> <template slot="tenderAmountHeader">
<div class="tender-amount-header"> <div class="tender-amount-header">
<span>投标金额(万元)</span> <span>投标金额(万元)</span>
...@@ -161,7 +161,8 @@ export default { ...@@ -161,7 +161,8 @@ export default {
], ],
needSelection: { needSelection: {
flag: true, flag: true,
width: "39px", width: "46px",
align: "center"
}, },
// 查询参数 // 查询参数
queryParams: { queryParams: {
...@@ -224,6 +225,12 @@ export default { ...@@ -224,6 +225,12 @@ export default {
}, },
//方法集 //方法集
methods: { methods: {
cellClassName({ row, column, rowIndex, columnIndex }) {
if (columnIndex == 0) {
return "need-selection-column";
}
return "";
},
async dataInit() { async dataInit() {
try { try {
if (!this.notHasPermission) { if (!this.notHasPermission) {
...@@ -517,6 +524,15 @@ export default { ...@@ -517,6 +524,15 @@ export default {
} }
} }
} }
::v-deep .el-table {
.need-selection-column {
.cell {
white-space: nowrap;
overflow: visible;
}
}
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment