2021-04-07 09:58:34 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div :class="from" class="list-page">
|
|
|
|
|
|
<!-- 主页面 -->
|
|
|
|
|
|
<div :class="{'main-list-with-sub': bottomBox.showSubList}" class="main-list">
|
|
|
|
|
|
<!-- 顶部工具栏 -->
|
|
|
|
|
|
<div class="main-modal"></div>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<div class="main-container">
|
|
|
|
|
|
<div v-show="bottomBox.mainResizeShow" class="top-tools">
|
|
|
|
|
|
<div class="top-tool-left" style="width: 300px">
|
|
|
|
|
|
<slot name="top-tool-left"></slot>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div :class="{'top-tool-main-right-to-left': bottomBox.showSubList}" class="top-tool-right">
|
|
|
|
|
|
<div v-if="layout.indexOf('searchInput') > -1" class="top-tool-search margin-r-20">
|
|
|
|
|
|
<search-input ref="searchInput" :inTransform="bottomBox.inTransform" :searchMsg="searchMsg" @search="search"></search-input>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<slot name="top-tool-right"></slot>
|
2021-04-16 21:10:31 +08:00
|
|
|
|
<button v-if="layout.indexOf('elementSet') > -1" class="top-tool-btn table-column-setting"
|
2021-04-14 18:35:42 +08:00
|
|
|
|
type="button" @click="tools.showCustomTableTitle = true">
|
|
|
|
|
|
<i class="nz-icon-gear nz-icon"></i>
|
|
|
|
|
|
</button>
|
2021-04-07 09:58:34 +08:00
|
|
|
|
</div>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<!-- 顶部分页组件,当打开底部上滑框时出现 -->
|
|
|
|
|
|
<!-- <div v-if="layout.indexOf('pagination') > -1" class="pagination-top pagination-top-hide display-none"></div>-->
|
|
|
|
|
|
</div>
|
2021-04-21 11:39:16 +08:00
|
|
|
|
<div v-if="hasSearch" class="search-box">
|
|
|
|
|
|
<slot name="search"></slot>
|
|
|
|
|
|
</div>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<div v-show="bottomBox.mainResizeShow" class="nz-table2">
|
|
|
|
|
|
<slot v-bind:mainResizeShow="bottomBox.mainResizeShow"></slot>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-show="bottomBox.mainResizeShow" class="pagination-bottom">
|
|
|
|
|
|
<slot name="pagination"></slot>
|
2021-04-07 09:58:34 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 自定义table列 -->
|
|
|
|
|
|
<transition name="el-zoom-in-top">
|
|
|
|
|
|
<element-set
|
|
|
|
|
|
v-if="tools.showCustomTableTitle"
|
2021-04-14 18:35:42 +08:00
|
|
|
|
:tableId="tableId"
|
2021-04-07 09:58:34 +08:00
|
|
|
|
ref="customTableTitle"
|
|
|
|
|
|
:custom-table-title="customTableTitle"
|
|
|
|
|
|
:original-table-title="tableTitle"
|
|
|
|
|
|
@close="tools.showCustomTableTitle = false"
|
|
|
|
|
|
@update="updateCustomTableTitle"
|
|
|
|
|
|
></element-set>
|
|
|
|
|
|
</transition>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<transition name="el-zoom-in-bottom">
|
|
|
|
|
|
<bottom-box v-if="bottomBox.showSubList"
|
|
|
|
|
|
ref="bottomBox"
|
|
|
|
|
|
:from="from"
|
|
|
|
|
|
:is-full-screen="bottomBox.isFullScreen"
|
|
|
|
|
|
:obj="bottomBox.object"
|
|
|
|
|
|
:sub-resize-show="bottomBox.subResizeShow"
|
|
|
|
|
|
:target-tab.sync="bottomBox.targetTab"
|
2021-04-08 20:28:54 +08:00
|
|
|
|
@closeSubList="bottomBox.showSubList = false"
|
|
|
|
|
|
@exitFullScreen="exitFullScreen"
|
|
|
|
|
|
@fullScreen="fullScreen"
|
|
|
|
|
|
@listResize="listResize" ></bottom-box>
|
2021-04-07 09:58:34 +08:00
|
|
|
|
</transition>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-04-08 20:28:54 +08:00
|
|
|
|
import bottomBox from '@/components/common/bottomBox/bottomBox'
|
2021-04-07 09:58:34 +08:00
|
|
|
|
import { bottomBoxWindow } from '@/components/common/js/tools'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'nzDataList',
|
2021-04-08 20:28:54 +08:00
|
|
|
|
components: {
|
|
|
|
|
|
bottomBox
|
|
|
|
|
|
},
|
2021-04-07 09:58:34 +08:00
|
|
|
|
props: {
|
|
|
|
|
|
from: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
tableTitle: {
|
|
|
|
|
|
type: Array
|
|
|
|
|
|
},
|
|
|
|
|
|
customTableTitle: {
|
|
|
|
|
|
type: Array
|
|
|
|
|
|
},
|
2021-04-12 13:00:59 +08:00
|
|
|
|
layout: {
|
2021-04-07 09:58:34 +08:00
|
|
|
|
type: Array,
|
|
|
|
|
|
default () { return [] }
|
|
|
|
|
|
},
|
|
|
|
|
|
searchMsg: {
|
|
|
|
|
|
type: Object
|
|
|
|
|
|
},
|
|
|
|
|
|
tableId: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
2021-04-21 11:39:16 +08:00
|
|
|
|
},
|
|
|
|
|
|
hasSearch: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: false
|
2021-04-07 09:58:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
/* 二级页面相关 */
|
|
|
|
|
|
bottomBox: {
|
|
|
|
|
|
object: {},
|
|
|
|
|
|
mainResizeShow: true, // dom高度改变时是否展示|隐藏
|
|
|
|
|
|
subResizeShow: true,
|
|
|
|
|
|
isFullScreen: false, // 全屏状态
|
|
|
|
|
|
showSubList: false, // 是否显示二级列表
|
|
|
|
|
|
targetTab: '', // 显示二级列表中的哪个页签
|
|
|
|
|
|
inTransform: false // 搜索框相关,搜索条件下拉框是否在transform里
|
|
|
|
|
|
},
|
|
|
|
|
|
tools: {
|
|
|
|
|
|
toTopBtnTop: this.$tableHeight.toTopBtnTop, // to-top按钮的top属性
|
|
|
|
|
|
tableHover: false, // 控制滚动条和top按钮同时出现
|
|
|
|
|
|
showCustomTableTitle: false // 自定义列弹框是否显示
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
updateCustomTableTitle (custom) {
|
|
|
|
|
|
this.$emit('update:customTableTitle', custom)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 全屏
|
|
|
|
|
|
fullScreen () {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.fullScreen(vm)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 退出全屏
|
|
|
|
|
|
exitFullScreen () {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.exitFullScreen(vm)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 鼠标拖动二级列表
|
|
|
|
|
|
listResize (e) {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.listResize(vm, e)
|
|
|
|
|
|
},
|
|
|
|
|
|
showBottomBox (targetTab, row) {
|
2021-04-20 19:27:49 +08:00
|
|
|
|
console.log(targetTab, row)
|
2021-04-07 09:58:34 +08:00
|
|
|
|
this.bottomBox.targetTab = targetTab
|
|
|
|
|
|
this.bottomBox.object = JSON.parse(JSON.stringify(row))
|
|
|
|
|
|
this.bottomBox.showSubList = true
|
|
|
|
|
|
},
|
|
|
|
|
|
search (searchObj) {
|
|
|
|
|
|
this.$emit('search', searchObj)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
'bottomBox.showSubList': function (n) {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.showSubListWatch(vm, n)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
@import '@/assets/css/common/tableCommon.scss';
|
|
|
|
|
|
</style>
|