|
|
@ -1,11 +1,5 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="wrap"> |
|
|
|
<div class="wrap"> |
|
|
|
<div class="search"> |
|
|
|
|
|
|
|
<!-- <img src="../../../assets/img/remove-black.png" alt="" class="remove" @click="keyword = ''"> --> |
|
|
|
|
|
|
|
<input v-model="keyword" type="text" placeholder="请输入数据表名称"> |
|
|
|
|
|
|
|
<img src="../../../assets/img/search.png" alt="" class="search-icon"> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="left"> |
|
|
|
<div class="left"> |
|
|
|
<el-menu class="menu" ref="type" @open="openType" @select="selectType" unique-opened :default-active="defaultType" :default-openeds="defaultOpenType"> |
|
|
|
<el-menu class="menu" ref="type" @open="openType" @select="selectType" unique-opened :default-active="defaultType" :default-openeds="defaultOpenType"> |
|
|
|
<template v-for="item in typeList"> |
|
|
|
<template v-for="item in typeList"> |
|
|
@ -81,14 +75,19 @@ |
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" highlight-current-row @current-change="previewCurrentChange"> |
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" highlight-current-row @current-change="previewCurrentChange"> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column prop="showName" label="数据表名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="showName" label="数据表名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column> |
|
|
|
<el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column> |
|
|
|
<el-table-column prop="dataSize" label="数据大小" align="center"> |
|
|
|
<el-table-column label="起止时间" width="190" align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{scope.row.startTime}}-{{scope.row.endTime}} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="dataSize" label="数据大小" width="110" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{scope.row.dataSize}}M |
|
|
|
{{scope.row.dataSize}}M |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column> |
|
|
|
<el-table-column prop="updateTime" label="更新时间" width="150" align="center"></el-table-column> |
|
|
|
<el-table-column label="操作" width="220" align="center"> |
|
|
|
<el-table-column label="操作" width="120" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" @click="preview(scope.row)">预览</el-button> |
|
|
|
<el-button type="text" @click="preview(scope.row)">预览</el-button> |
|
|
|
<el-button type="text" @click="download(scope.row)">下载</el-button> |
|
|
|
<el-button type="text" @click="download(scope.row)">下载</el-button> |
|
|
@ -148,6 +147,7 @@ import { mapState } from 'vuex' |
|
|
|
import axios from 'axios' |
|
|
|
import axios from 'axios' |
|
|
|
import util from '@/libs/util' |
|
|
|
import util from '@/libs/util' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
|
|
|
|
import bus from '@/libs/bus' |
|
|
|
|
|
|
|
|
|
|
|
let startTimeLimit = '' |
|
|
|
let startTimeLimit = '' |
|
|
|
let endTimeLimit = '' |
|
|
|
let endTimeLimit = '' |
|
|
@ -156,13 +156,12 @@ export default { |
|
|
|
return { |
|
|
|
return { |
|
|
|
that: this, |
|
|
|
that: this, |
|
|
|
token: util.local.get(Setting.tokenKey), |
|
|
|
token: util.local.get(Setting.tokenKey), |
|
|
|
keyword: '', |
|
|
|
|
|
|
|
searchTimer: null, |
|
|
|
|
|
|
|
typeId: this.$route.query.typeId, |
|
|
|
typeId: this.$route.query.typeId, |
|
|
|
typeList: [], |
|
|
|
typeList: [], |
|
|
|
defaultType: '', |
|
|
|
defaultType: '', |
|
|
|
defaultOpenType: [], |
|
|
|
defaultOpenType: [], |
|
|
|
introduce: '', |
|
|
|
introduce: '', |
|
|
|
|
|
|
|
keyword: '', |
|
|
|
listData: [], |
|
|
|
listData: [], |
|
|
|
listDataAll: [], |
|
|
|
listDataAll: [], |
|
|
|
searchListData: [], |
|
|
|
searchListData: [], |
|
|
@ -215,15 +214,12 @@ export default { |
|
|
|
'schoolId' |
|
|
|
'schoolId' |
|
|
|
]), |
|
|
|
]), |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
|
|
|
|
keyword: function(val) { |
|
|
|
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
|
|
|
this.initData() |
|
|
|
|
|
|
|
},500) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
|
|
|
|
bus.$on('initData',keyword => { |
|
|
|
|
|
|
|
this.keyword = keyword |
|
|
|
|
|
|
|
this.initData() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.getType() |
|
|
|
this.getType() |
|
|
|
if(this.$route.query.download){ |
|
|
|
if(this.$route.query.download){ |
|
|
|
this.download({ |
|
|
|
this.download({ |
|
|
@ -290,6 +286,7 @@ export default { |
|
|
|
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=`).then(res => { |
|
|
|
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=`).then(res => { |
|
|
|
this.listData = res.pageList.records |
|
|
|
this.listData = res.pageList.records |
|
|
|
this.total = res.pageList.total |
|
|
|
this.total = res.pageList.total |
|
|
|
|
|
|
|
this.listData.length && this.preview(this.listData[0],1) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData(){ |
|
|
|
initData(){ |
|
|
@ -326,25 +323,30 @@ export default { |
|
|
|
this.previewData = [] |
|
|
|
this.previewData = [] |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
findId(data,id){ |
|
|
|
|
|
|
|
let result = '' |
|
|
|
|
|
|
|
data.forEach(n => { |
|
|
|
|
|
|
|
if(n.id == id){ |
|
|
|
|
|
|
|
if(n.children[0].children.length){ |
|
|
|
|
|
|
|
return result = n.children[0].children[0].id |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
return result = n.children[0].id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.findId(n.children,id) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return result |
|
|
|
|
|
|
|
}, |
|
|
|
openType(index,indexPath){ |
|
|
|
openType(index,indexPath){ |
|
|
|
let typeList = this.typeList |
|
|
|
console.log(11,this.typeList) |
|
|
|
let firstChild = typeList.find(n => n.id == index) |
|
|
|
let id = this.findId(this.typeList,index) |
|
|
|
let id = '' |
|
|
|
|
|
|
|
if(firstChild){ |
|
|
|
|
|
|
|
id = firstChild.children[0].id |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
typeList.map(n => { |
|
|
|
|
|
|
|
n.children.map(n => { |
|
|
|
|
|
|
|
if(n.id == index) id = n.children[0].id |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.selectType(id,indexPath) |
|
|
|
this.selectType(id,indexPath) |
|
|
|
}, |
|
|
|
}, |
|
|
|
previewCurrentChange(val){ |
|
|
|
previewCurrentChange(val){ |
|
|
|
this.currentRow = val |
|
|
|
this.currentRow = val |
|
|
|
}, |
|
|
|
}, |
|
|
|
preview(row){ |
|
|
|
preview(row,isDefault){ |
|
|
|
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { |
|
|
|
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { |
|
|
|
this.$post(this.api.saveRecord,{ |
|
|
|
this.$post(this.api.saveRecord,{ |
|
|
|
tableId: row.id, |
|
|
|
tableId: row.id, |
|
|
@ -365,7 +367,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.previewData = data |
|
|
|
this.previewData = data |
|
|
|
this.$nextTick(() => { |
|
|
|
isDefault || this.$nextTick(() => { |
|
|
|
document.querySelector('#previewTable').scrollIntoView() |
|
|
|
document.querySelector('#previewTable').scrollIntoView() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
@ -492,41 +494,6 @@ export default { |
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.wrap{ |
|
|
|
.wrap{ |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
.search{ |
|
|
|
|
|
|
|
z-index: 2; |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
top: 0; |
|
|
|
|
|
|
|
left: 70%; |
|
|
|
|
|
|
|
transform: translate(-50%); |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
justify-content: space-between; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
width: 300px; |
|
|
|
|
|
|
|
height: 80px; |
|
|
|
|
|
|
|
padding: 7px 20px; |
|
|
|
|
|
|
|
margin: 0 auto; |
|
|
|
|
|
|
|
background-color: #fff; |
|
|
|
|
|
|
|
input{ |
|
|
|
|
|
|
|
width: 195px; |
|
|
|
|
|
|
|
margin-left: 10px; |
|
|
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
|
|
color: #333; |
|
|
|
|
|
|
|
background-color: transparent; |
|
|
|
|
|
|
|
border: 0; |
|
|
|
|
|
|
|
&::-webkit-input-placeholder{color: #999} |
|
|
|
|
|
|
|
&::-moz-placeholder{color: #999} |
|
|
|
|
|
|
|
&:-moz-placeholder{color: #999} |
|
|
|
|
|
|
|
&:focus{ |
|
|
|
|
|
|
|
outline: none; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.remove{ |
|
|
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.search-icon{ |
|
|
|
|
|
|
|
width: 18px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/deep/.left{ |
|
|
|
/deep/.left{ |
|
|
|
margin-right: 20px; |
|
|
|
margin-right: 20px; |
|
|
|
|
|
|
|
|
|
|
@ -547,6 +514,9 @@ export default { |
|
|
|
.el-submenu.is-active{ |
|
|
|
.el-submenu.is-active{ |
|
|
|
.el-submenu__title{ |
|
|
|
.el-submenu__title{ |
|
|
|
background-color: rgba(147,184,255,.3); |
|
|
|
background-color: rgba(147,184,255,.3); |
|
|
|
|
|
|
|
&+.el-menu .el-submenu__title{ |
|
|
|
|
|
|
|
background-color: rgba(147,184,255,.15); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.el-menu-item.is-active{ |
|
|
|
.el-menu-item.is-active{ |
|
|
|