|
|
|
@ -22,7 +22,7 @@ |
|
|
|
|
<el-form label-width="80px" class="flex-between mgb20"> |
|
|
|
|
<div class="flex-center"> |
|
|
|
|
<el-form-item label="更新时间" style="margin: 0 20px 0 0"> |
|
|
|
|
<el-date-picker v-model="updateTime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initData"></el-date-picker> |
|
|
|
|
<el-date-picker v-model="updateTime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="searchData"></el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-input placeholder="请输入数据表名称" v-model="keyword" prefix-icon="el-icon-search" clearable></el-input> |
|
|
|
|
</div> |
|
|
|
@ -41,7 +41,7 @@ |
|
|
|
|
{{scope.row.dataSize}}M |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="createTime" label="更新时间" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" width="220" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="preview(scope.row)">预览</el-button> |
|
|
|
@ -118,6 +118,8 @@ export default { |
|
|
|
|
defaultTypeActive: [], |
|
|
|
|
defaultTypeChecked: [], |
|
|
|
|
listData: [], |
|
|
|
|
listDataAll: [], |
|
|
|
|
searchListData: [], |
|
|
|
|
keyword: '', |
|
|
|
|
page: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
@ -140,7 +142,7 @@ export default { |
|
|
|
|
keyword: function(val) { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.getData() |
|
|
|
|
this.searchData() |
|
|
|
|
},500) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -179,10 +181,36 @@ export default { |
|
|
|
|
}, |
|
|
|
|
getData(){ |
|
|
|
|
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => { |
|
|
|
|
this.listData = res.list |
|
|
|
|
this.total = res.totalCount |
|
|
|
|
let list = JSON.parse(res.getIdQueryTable) |
|
|
|
|
list.map(n => { |
|
|
|
|
n.updateTime = n.updateTime ? this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n.updateTime)) : '' |
|
|
|
|
}) |
|
|
|
|
this.listDataAll = list |
|
|
|
|
this.total = list.length |
|
|
|
|
this.handlePage() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
handlePage(){ |
|
|
|
|
let list = this.keyword ? this.searchListData : this.listDataAll |
|
|
|
|
let result = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize) |
|
|
|
|
this.listData = result |
|
|
|
|
}, |
|
|
|
|
searchData(){ |
|
|
|
|
let list = this.listDataAll |
|
|
|
|
let result = [] |
|
|
|
|
let updateTime = this.updateTime |
|
|
|
|
list.map(n => { |
|
|
|
|
if(updateTime){ |
|
|
|
|
if(n.updateTime && updateTime == this.formatDate('yyyy-MM-dd',new Date(n.updateTime)) && n.showName.includes(this.keyword)) result.push(n) |
|
|
|
|
}else{ |
|
|
|
|
n.showName.includes(this.keyword) && result.push(n) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
this.searchListData = result |
|
|
|
|
this.listData = result.slice(0,10) |
|
|
|
|
this.total = result.length |
|
|
|
|
}, |
|
|
|
|
initData(){ |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
@ -272,7 +300,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
this.page = val |
|
|
|
|
this.getData() |
|
|
|
|
this.handlePage() |
|
|
|
|
}, |
|
|
|
|
delAllSelection() { |
|
|
|
|
if(this.multipleSelection.length != ''){ |
|
|
|
@ -294,8 +322,9 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getTable(n,i){ |
|
|
|
|
this.$post(`${this.api.originalListById}?categoryId=${n.realId}&showName=&pageNum=1&pageSize=10000`).then(res => { |
|
|
|
|
res.list.map(n => { |
|
|
|
|
this.$post(`${this.api.originalListById}?categoryId=${n.realId}`).then(res => { |
|
|
|
|
let list = JSON.parse(res.originalListById) |
|
|
|
|
list.map(n => { |
|
|
|
|
n.label = n.showName |
|
|
|
|
n.id = String(n.id) |
|
|
|
|
if(this.defaultTypeChecked.includes(n.id)){ |
|
|
|
@ -303,7 +332,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
n.children = res.list |
|
|
|
|
n.children = list |
|
|
|
|
// if(!i && !this.tableName){ |
|
|
|
|
// this.tableName = res.list[0].name |
|
|
|
|
// this.curId = res.list[0].id |
|
|
|
@ -332,8 +361,8 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=1&pageSize=10000&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res1 => { |
|
|
|
|
this.defaultTypeChecked = res1.list.map(n => n.copyId) |
|
|
|
|
|
|
|
|
|
let list = JSON.parse(res1.getIdQueryTable) |
|
|
|
|
this.defaultTypeChecked = list.map(n => n.copyId) |
|
|
|
|
res.map((n,i) => { |
|
|
|
|
if(n.children.length){ |
|
|
|
|
n.children.map(n => { |
|
|
|
@ -398,7 +427,6 @@ export default { |
|
|
|
|
showNames.push(n.showName) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log(11,names,showNames) |
|
|
|
|
if(!names.length) return this.$message.warning('请选择数据') |
|
|
|
|
|
|
|
|
|
this.submited = true |
|
|
|
|