|
@@ -1,59 +1,61 @@
|
|
|
<template>
|
|
|
- <div id="list-frame">
|
|
|
- <el-card style="background:rgb(231, 224, 235);border-radius: 60px;" shadow="hover">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24" class="title">
|
|
|
- <span v-if="returns">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- plan
|
|
|
- circle
|
|
|
- @click="$router.push({ path: returns })"
|
|
|
- style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)"
|
|
|
- >
|
|
|
- <span class="el-icon-arrow-left" style="zoom:1.5;font-weight:700"></span>
|
|
|
- </el-button>
|
|
|
- </span>
|
|
|
- <slot name="title">
|
|
|
- {{ title }}
|
|
|
- </slot>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <slot name="filter">
|
|
|
- <el-form :inline="true">
|
|
|
- <el-form-item v-for="(item, index) in filter" :key="index" :label="item.label" label-width="auto">
|
|
|
- <template v-if="item.type === `select`">
|
|
|
- <el-select v-model="searchInfo[`${item.model}`]" size="mini">
|
|
|
- <el-option v-for="(select, sIndex) in item.list" :key="sIndex" :label="select.label" :value="select.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <el-input v-model="searchInfo[`${item.model}`]" size="mini"></el-input>
|
|
|
- </template>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" size="mini">查询</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </slot>
|
|
|
+ <div id="list-frame" :style="`height:${heights}px`">
|
|
|
+ <el-scrollbar style="height:100%">
|
|
|
+ <el-card style="background:rgb(231, 224, 235);border-radius: 60px;" shadow="hover">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="title">
|
|
|
+ <span v-if="returns">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ plan
|
|
|
+ circle
|
|
|
+ @click="$router.push({ path: returns })"
|
|
|
+ style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)"
|
|
|
+ >
|
|
|
+ <span class="el-icon-arrow-left" style="zoom:1.5;font-weight:700"></span>
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ <slot name="title">
|
|
|
+ {{ title }}
|
|
|
+ </slot>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <slot name="filter" v-if="needFilter">
|
|
|
+ <el-form :inline="true">
|
|
|
+ <el-form-item v-for="(item, index) in filter" :key="index" :label="item.label" label-width="auto">
|
|
|
+ <template v-if="item.type === `select`">
|
|
|
+ <el-select v-model="searchInfo[`${item.model}`]" size="mini">
|
|
|
+ <el-option v-for="(select, sIndex) in item.list" :key="sIndex" :label="select.label" :value="select.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-input v-model="searchInfo[`${item.model}`]" size="mini"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" size="mini">查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </slot>
|
|
|
|
|
|
- <div style="padding:1.875rem;">
|
|
|
- <slot> </slot>
|
|
|
- </div>
|
|
|
- <el-row type="flex" align="middle" justify="end" v-if="needPag">
|
|
|
- <el-col :span="24" style="text-align:right;">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout="total, prev, pager, next"
|
|
|
- :total="totalRow"
|
|
|
- :page-size="limit"
|
|
|
- :current-page.sync="currentPage"
|
|
|
- @current-change="changePage"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-card>
|
|
|
+ <div style="padding:1.875rem;">
|
|
|
+ <slot> </slot>
|
|
|
+ </div>
|
|
|
+ <el-row type="flex" align="middle" justify="end" v-if="needPag">
|
|
|
+ <el-col :span="24" style="text-align:right;">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ :total="totalRow"
|
|
|
+ :page-size="limit"
|
|
|
+ :current-page.sync="currentPage"
|
|
|
+ @current-change="changePage"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-card>
|
|
|
+ </el-scrollbar>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -67,15 +69,26 @@ export default {
|
|
|
totalRow: { type: Number, default: 0 },
|
|
|
needPag: { type: Boolean, default: true },
|
|
|
returns: { type: null, default: null },
|
|
|
+ needFilter: { type: Boolean, default: true },
|
|
|
},
|
|
|
components: {},
|
|
|
data: () => ({
|
|
|
limit: _.get(this, `$limit`, undefined) !== undefined ? this.$limit : 15,
|
|
|
currentPage: 1,
|
|
|
searchInfo: {},
|
|
|
+ heights: document.documentElement.clientHeight - 80,
|
|
|
}),
|
|
|
created() {},
|
|
|
computed: {},
|
|
|
+ mounted() {
|
|
|
+ const that = this;
|
|
|
+ window.onresize = () => {
|
|
|
+ return (() => {
|
|
|
+ window.fullHeight = document.documentElement.clientHeight - 80;
|
|
|
+ that.heights = window.fullHeight;
|
|
|
+ })();
|
|
|
+ };
|
|
|
+ },
|
|
|
methods: {
|
|
|
changePage(page) {
|
|
|
this.$emit('query', { skip: (page - 1) * this.limit, limit: this.limit, ...this.searchInfo });
|
|
@@ -90,4 +103,7 @@ export default {
|
|
|
font-weight: 700;
|
|
|
padding: 1rem;
|
|
|
}
|
|
|
+/deep/.el-scrollbar__wrap {
|
|
|
+ overflow-x: auto;
|
|
|
+}
|
|
|
</style>
|