Commit bbbc711d by 李长胜

允许border有无,增加表头样式,增加表格无数据的情况

1 parent a8727f10
...@@ -6,12 +6,13 @@ ...@@ -6,12 +6,13 @@
:data="getListApi ? data : tableData" :data="getListApi ? data : tableData"
:row-key="tableParams.mutiSelectUniqueKey || ''" :row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading" v-loading="loading"
border :border="border"
:highlight-current-row="true" :highlight-current-row="true"
:stripe="true" :stripe="true"
@sort-change="sortChange" @sort-change="sortChange"
@selection-change="handleSelect" @selection-change="handleSelect"
:size="size" :size="size"
:header-cell-style="headerStyle"
> >
<el-table-column <el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
...@@ -90,6 +91,11 @@ ...@@ -90,6 +91,11 @@
></slot> ></slot>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty" class="emptyBg">
<img class="noDataImg" :src="noDataImg" v-if=noDataImg alt="" />
<p>{{noDataText}}</p>
<slot name="additionalContent"></slot>
</div>
</el-table> </el-table>
<el-pagination <el-pagination
v-if="hasPage" v-if="hasPage"
...@@ -127,6 +133,22 @@ export default { ...@@ -127,6 +133,22 @@ export default {
type: String, type: String,
default: 'medium' default: 'medium'
}, },
noDataImg:{
type:String,
default:''
},
noDataText:{
type:String,
default:'暂无数据'
},
border: {
type: Boolean,
default: false
},
headerStyle: {
type: Object,
default: () => {}
},
// 搜索条件 // 搜索条件
searchForm: { searchForm: {
type: Object, type: Object,
...@@ -342,4 +364,13 @@ export default { ...@@ -342,4 +364,13 @@ export default {
padding-left: 14px!important; padding-left: 14px!important;
padding-right: 14px!important; padding-right: 14px!important;
} }
.glsx-table .emptyBg .noDataImg{
display: inline-block;
margin-top: 150px;
height: 100%;
}
.glsx-table .emptyBg p{
margin-top: -20px;
height: 100%;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!