|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
<div class="data-table" :style="{ marginTop: marginTop }">
|
|
|
- <div :style="{ 'min-height': minHeight + 'vh' }" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="data-table-content">
|
|
|
+ <div :style="dataTableContentStyle" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="data-table-content">
|
|
|
<div v-if="isBtn" class="data-table-btn flex-end">
|
|
|
<el-button size="small" @click="handleAdd" plain type="primary">新增</el-button>
|
|
|
</div>
|
|
|
<template v-if="tableData.length">
|
|
|
<div>
|
|
|
- <el-table :data="filteredTableData" :summary-method="getSummaries" :span-method="tableSpanMethod" stripe :show-summary="showSummary" border ref="table" :height="minHeight - 8 + 'vh'" class="table infinite-list" style="width: 100%; overflow: auto" @select="selectHandler">
|
|
|
+ <el-table :data="filteredTableData" :summary-method="getSummaries" :span-method="tableSpanMethod" stripe :show-summary="showSummary" border ref="table" :height="tableHeight ? tableHeight : (minHeight - 8 + 'vh')" class="table infinite-list" style="width: 100%; overflow: auto" @select="selectHandler">
|
|
|
<el-table-column
|
|
|
v-if="selectionEnable"
|
|
|
type="selection"
|
|
@@ -57,7 +57,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <NoData />
|
|
|
+ <NoData image-width="auto" image-height="100%" />
|
|
|
</template>
|
|
|
</div>
|
|
|
<div class="data-table-dialog">
|
|
@@ -127,10 +127,11 @@ export default {
|
|
|
},
|
|
|
//接口ID
|
|
|
dataId: {
|
|
|
- type: String || Number,
|
|
|
+ type: [String, Number],
|
|
|
+ default: ''
|
|
|
},
|
|
|
editId: {
|
|
|
- type: String || Number,
|
|
|
+ type: [String, Number],
|
|
|
default: ''
|
|
|
},
|
|
|
dataContent: {
|
|
@@ -153,6 +154,10 @@ export default {
|
|
|
default: "80px",
|
|
|
},
|
|
|
//表格高度
|
|
|
+ tableHeight: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
minHeight: {
|
|
|
type: Number,
|
|
|
default: 65,
|
|
@@ -226,6 +231,16 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ dataTableContentStyle() {
|
|
|
+ const style = {}
|
|
|
+ if (this.minHeight) {
|
|
|
+ style['min-height'] = this.minHeight
|
|
|
+ }
|
|
|
+ if (this.tableHeight) {
|
|
|
+ style['height'] = this.tableHeight
|
|
|
+ }
|
|
|
+ return style
|
|
|
+ },
|
|
|
//设置表头-下拉-箭头样式
|
|
|
arrowClass () {
|
|
|
return function (prop) {
|
|
@@ -359,7 +374,7 @@ export default {
|
|
|
//初始化表格
|
|
|
initTableData () {
|
|
|
this.tableColsCopy = this.tableCols.filter((item) => item.needShow);
|
|
|
- console.log(this.tableColsCopy)
|
|
|
+ // console.log(this.tableColsCopy)
|
|
|
this.tableDataCopy = _.cloneDeep(this.tableData);
|
|
|
const datas = _.cloneDeep(this.tableColsCopy);
|
|
|
const reqUts = []
|
|
@@ -373,7 +388,7 @@ export default {
|
|
|
// const reqUt = this.getSelectData(item.listqueryTemplateID)
|
|
|
// reqUts.push(reqUt)
|
|
|
this.tableOptions[item.columnName] = await this.getSelectData(item.listqueryTemplateID)
|
|
|
- console.log(this.tableOptions[item.columnName])
|
|
|
+ // console.log(this.tableOptions[item.columnName])
|
|
|
}
|
|
|
// this.filterValues[item.columnName] = ''
|
|
|
});
|
|
@@ -626,6 +641,9 @@ export default {
|
|
|
.cell {
|
|
|
font-weight: bold;
|
|
|
color: #101116;
|
|
|
+ > .el-checkbox {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
.has-gutter {
|
|
|
tr {
|
|
@@ -634,9 +652,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .table-column--selection .cell .el-checkbox {
|
|
|
- display: none;
|
|
|
- }
|
|
|
}
|
|
|
.el-table__body-wrapper {
|
|
|
tr.bgl-hui {
|