|
@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="table-page-com">
|
|
|
<template v-if="inited">
|
|
|
<div class="search-bar">
|
|
|
<div class="search-bar" v-if="showSearchBar">
|
|
|
<el-form :inline="true">
|
|
|
<template v-for="(item, i) in configs.columns">
|
|
|
<el-form-item :label="item.label" :key="i" v-if="item.isSearch" :class="{'radioGroup-item':item.type=='radioGroup'}">
|
|
@ -46,8 +46,8 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" @click="emitLoad()">查询</el-button>
|
|
|
<el-form-item class="mb22">
|
|
|
<el-button v-if="showSearchButton" type="primary" icon="el-icon-search" @click="emitLoad()">查询</el-button>
|
|
|
<el-button @click="$emit('onAdd')" v-if="configs.showAddButton" type="success" icon="el-icon-circle-plus-outline">新增</el-button>
|
|
|
<slot name="topBanner"></slot>
|
|
|
</el-form-item>
|
|
@ -58,6 +58,12 @@
|
|
|
<div style="position:absolute;height:100%;width:100%">
|
|
|
<el-table v-on="$listeners" v-bind="$attrs" v-loading="loading" border height="100%" style="width: 100%; ">
|
|
|
<el-table-column
|
|
|
v-if="configs.selection"
|
|
|
type="selection"
|
|
|
width="55">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
v-else
|
|
|
type="index"
|
|
|
label="序号"
|
|
|
align="center"
|
|
@ -148,6 +154,28 @@ export default {
|
|
|
inited: true
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
showSearchBar(){
|
|
|
var res = _.filter(this.configs.columns, (item)=>{
|
|
|
return item.isSearch
|
|
|
})
|
|
|
return this.showSearchButton || this.configs.showAddButton
|
|
|
},
|
|
|
showSearchButton(){
|
|
|
var res = _.filter(this.configs.columns, (item)=>{
|
|
|
return item.isSearch
|
|
|
})
|
|
|
return res.length>0
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
searchForm: {
|
|
|
handler(n){
|
|
|
this.$emit('getSearchForm', n)
|
|
|
},
|
|
|
immediate: true
|
|
|
},
|
|
|
},
|
|
|
created(){
|
|
|
var searchForm = {}
|
|
|
this.configs.columns.forEach(v => {
|
|
@ -212,6 +240,9 @@ export default {
|
|
|
width: auto;
|
|
|
margin-right: 40px;
|
|
|
}
|
|
|
.mb22{
|
|
|
margin-bottom: 22px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="scss">
|