|
|
@ -1,5 +1,13 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="wrap"> |
|
|
|
<div class="wrap"> |
|
|
|
|
|
|
|
<div class="search"> |
|
|
|
|
|
|
|
<div class="input"> |
|
|
|
|
|
|
|
<img src="../../../assets/img/search-gray.png" alt=""> |
|
|
|
|
|
|
|
<input v-model="keyword" type="text" placeholder="请输入数据表名称"> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<img v-if="keyword" src="../../../assets/img/remove-gray.png" alt="" class="remove" @click="keyword = ''"> |
|
|
|
|
|
|
|
</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"> |
|
|
@ -67,11 +75,12 @@ |
|
|
|
</el-menu> |
|
|
|
</el-menu> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="right"> |
|
|
|
<div class="right"> |
|
|
|
<div class="block"> |
|
|
|
<div class="page"> |
|
|
|
<h6 class="title">数据介绍</h6> |
|
|
|
<h6 class="p-title">数据介绍</h6> |
|
|
|
|
|
|
|
<div class="page-content"> |
|
|
|
<div class="desc">{{introduce}}</div> |
|
|
|
<div class="desc">{{introduce}}</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id"> |
|
|
|
<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="数据总量" align="center"></el-table-column> |
|
|
@ -80,7 +89,7 @@ |
|
|
|
{{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="createTime" label="更新时间" align="center"></el-table-column> |
|
|
|
<el-table-column label="操作" width="220" align="center"> |
|
|
|
<el-table-column label="操作" width="220" 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> |
|
|
@ -92,16 +101,18 @@ |
|
|
|
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
|
|
|
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="block" v-if="previewHead.length"> |
|
|
|
<div class="page" v-if="previewHead.length"> |
|
|
|
<h6 class="title">数据预览</h6> |
|
|
|
<h6 class="p-title">数据预览</h6> |
|
|
|
|
|
|
|
<div class="page-content"> |
|
|
|
<el-table :data="previewData" class="table" stripe header-align="center" row-key="id"> |
|
|
|
<el-table :data="previewData" class="table" id="previewTable" stripe header-align="center" row-key="id"> |
|
|
|
<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 v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.comment" align="center"></el-table-column> |
|
|
|
<el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.comment" align="center"></el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="下载" :visible.sync="downloadVisible" width="540px" @close="closeDownload" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="下载" :visible.sync="downloadVisible" width="540px" @close="closeDownload" :close-on-click-modal="false"> |
|
|
|
<el-form ref="form" label-width="100px" label-suffix=":"> |
|
|
|
<el-form ref="form" label-width="100px" label-suffix=":"> |
|
|
@ -143,6 +154,8 @@ export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
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: '', |
|
|
@ -154,9 +167,6 @@ export default { |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
previewHead: [], |
|
|
|
previewHead: [], |
|
|
|
previewData: [], |
|
|
|
previewData: [], |
|
|
|
pagePreview: 1, |
|
|
|
|
|
|
|
pageSizePreview: 10, |
|
|
|
|
|
|
|
totalPreview: 0, |
|
|
|
|
|
|
|
downloadVisible: false, |
|
|
|
downloadVisible: false, |
|
|
|
curRow: {}, |
|
|
|
curRow: {}, |
|
|
|
checkAllFields: false, |
|
|
|
checkAllFields: false, |
|
|
@ -183,6 +193,7 @@ export default { |
|
|
|
name: '年频' |
|
|
|
name: '年频' |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
currentRow: null |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
@ -190,12 +201,21 @@ export default { |
|
|
|
'schoolId' |
|
|
|
'schoolId' |
|
|
|
]), |
|
|
|
]), |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
keyword: function(val) { |
|
|
|
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
},500) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.getType() |
|
|
|
this.getType() |
|
|
|
if(this.$route.query.download){ |
|
|
|
if(this.$route.query.download){ |
|
|
|
this.download({ |
|
|
|
this.download({ |
|
|
|
id: this.$route.query.id, |
|
|
|
id: this.$route.query.id, |
|
|
|
name: this.$route.query.name |
|
|
|
name: this.$route.query.name, |
|
|
|
|
|
|
|
showName: this.$route.query.showName, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -203,15 +223,33 @@ export default { |
|
|
|
getType(){ |
|
|
|
getType(){ |
|
|
|
this.$post(this.api.getTableByClassification).then(res => { |
|
|
|
this.$post(this.api.getTableByClassification).then(res => { |
|
|
|
let typeId = this.typeId |
|
|
|
let typeId = this.typeId |
|
|
|
|
|
|
|
let introduce = '' |
|
|
|
res.map(n => { |
|
|
|
res.map(n => { |
|
|
|
n.id = String(n.id) |
|
|
|
n.id = String(n.id) |
|
|
|
|
|
|
|
if(typeId && n.id == typeId) introduce = n.introduce |
|
|
|
n.children.map(e => { |
|
|
|
n.children.map(e => { |
|
|
|
e.id = String(e.id) |
|
|
|
e.id = String(e.id) |
|
|
|
|
|
|
|
if(typeId && e.id == typeId){ |
|
|
|
|
|
|
|
if(e.introduce){ |
|
|
|
|
|
|
|
introduce = e.introduce |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
introduce = n.introduce |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(e.children.length && typeId == e.id){ |
|
|
|
if(e.children.length && typeId == e.id){ |
|
|
|
this.defaultOpenType = [n.id,e.id] |
|
|
|
this.defaultOpenType = [n.id,e.id] |
|
|
|
} |
|
|
|
} |
|
|
|
e.children.map(n => { |
|
|
|
e.children.map(j => { |
|
|
|
n.id = String(n.id) |
|
|
|
if(typeId && j.id == typeId && j.introduce){ |
|
|
|
|
|
|
|
if(j.introduce){ |
|
|
|
|
|
|
|
introduce = j.introduce |
|
|
|
|
|
|
|
}else if(e.introduce){ |
|
|
|
|
|
|
|
introduce = e.introduce |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
introduce = n.introduce |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
j.id = String(j.id) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -221,17 +259,21 @@ export default { |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
if(res[0].children.length && res[0].children[0].children.length){ |
|
|
|
if(res[0].children.length && res[0].children[0].children.length){ |
|
|
|
this.defaultType = res[0].children[0].children[0].id |
|
|
|
this.defaultType = res[0].children[0].children[0].id |
|
|
|
|
|
|
|
introduce = res[0].children[0].children[0].introduce |
|
|
|
}else if(res[0].children.length){ |
|
|
|
}else if(res[0].children.length){ |
|
|
|
this.defaultType = res[0].children[0].id |
|
|
|
this.defaultType = res[0].children[0].id |
|
|
|
|
|
|
|
if(!introduce) introduce = res[0].children[0].introduce |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.defaultType = res[0].id |
|
|
|
this.defaultType = res[0].id |
|
|
|
|
|
|
|
if(!introduce) introduce = res[0].introduce |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.introduce = introduce |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getData(){ |
|
|
|
getData(){ |
|
|
|
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=&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.list |
|
|
|
this.listData = res.list |
|
|
|
this.total = res.totalCount |
|
|
|
this.total = res.totalCount |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
@ -242,8 +284,26 @@ export default { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
selectType(index,indexPath){ |
|
|
|
selectType(index,indexPath){ |
|
|
|
|
|
|
|
let introduce = '' |
|
|
|
|
|
|
|
let list = this.typeList |
|
|
|
|
|
|
|
list.map(n => { |
|
|
|
|
|
|
|
if(n.id == index){ |
|
|
|
|
|
|
|
introduce = n.introduce |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
n.children.map(n => { |
|
|
|
|
|
|
|
if(n.id == index){ |
|
|
|
|
|
|
|
introduce = n.introduce |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
n.children.map(n => { |
|
|
|
|
|
|
|
if(n.id == index) introduce = n.introduce |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if(!introduce) introduce = list.find(n => n.id == indexPath[0]).introduce |
|
|
|
this.defaultType = index |
|
|
|
this.defaultType = index |
|
|
|
this.introduce = this.typeList.find(n => n.id == indexPath[0]).introduce |
|
|
|
this.introduce = introduce |
|
|
|
this.previewHead = [] |
|
|
|
this.previewHead = [] |
|
|
|
this.previewData = [] |
|
|
|
this.previewData = [] |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
@ -264,12 +324,16 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
this.selectType(id,indexPath) |
|
|
|
this.selectType(id,indexPath) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
previewCurrentChange(val){ |
|
|
|
|
|
|
|
this.currentRow = val |
|
|
|
|
|
|
|
}, |
|
|
|
preview(row){ |
|
|
|
preview(row){ |
|
|
|
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, |
|
|
|
type: 2, |
|
|
|
type: 2, |
|
|
|
}).then(res => {}).catch(res => {}) |
|
|
|
}).then(res => {}).catch(res => {}) |
|
|
|
|
|
|
|
|
|
|
|
let comment = res.comment |
|
|
|
let comment = res.comment |
|
|
|
let previewHead = [] |
|
|
|
let previewHead = [] |
|
|
|
comment.map(n => { |
|
|
|
comment.map(n => { |
|
|
@ -284,6 +348,10 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.previewData = data |
|
|
|
this.previewData = data |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
document.querySelector('#previewTable').scrollIntoView() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
checkAllFieldsChange(val) { |
|
|
|
checkAllFieldsChange(val) { |
|
|
@ -390,6 +458,43 @@ export default { |
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.wrap{ |
|
|
|
.wrap{ |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
|
|
|
|
.search{ |
|
|
|
|
|
|
|
z-index: 2; |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
top: 20px; |
|
|
|
|
|
|
|
right: 20%; |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
justify-content: space-between; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
width: 300px; |
|
|
|
|
|
|
|
padding: 7px 20px; |
|
|
|
|
|
|
|
margin: 0 auto; |
|
|
|
|
|
|
|
border-bottom: 2px solid #a5a5a5; |
|
|
|
|
|
|
|
.input{ |
|
|
|
|
|
|
|
display: inline-flex; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
margin-right: 20px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
input{ |
|
|
|
|
|
|
|
width: 195px; |
|
|
|
|
|
|
|
padding-left: 20px; |
|
|
|
|
|
|
|
margin-left: 20px; |
|
|
|
|
|
|
|
font-size: 18px; |
|
|
|
|
|
|
|
color: #999; |
|
|
|
|
|
|
|
background-color: transparent; |
|
|
|
|
|
|
|
border: 0; |
|
|
|
|
|
|
|
border-left: 2px solid #ccc; |
|
|
|
|
|
|
|
&::-webkit-input-placeholder{color: #999} |
|
|
|
|
|
|
|
&::-moz-placeholder{color: #999} |
|
|
|
|
|
|
|
&:-moz-placeholder{color: #999} |
|
|
|
|
|
|
|
&:focus{ |
|
|
|
|
|
|
|
outline: none; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.remove{ |
|
|
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
.left{ |
|
|
|
.left{ |
|
|
|
margin-right: 20px; |
|
|
|
margin-right: 20px; |
|
|
|
|
|
|
|
|
|
|
@ -407,19 +512,8 @@ export default { |
|
|
|
.right{ |
|
|
|
.right{ |
|
|
|
flex: 1; |
|
|
|
flex: 1; |
|
|
|
max-width: calc(100% - 220px); |
|
|
|
max-width: calc(100% - 220px); |
|
|
|
.block{ |
|
|
|
.page{ |
|
|
|
padding: 34px; |
|
|
|
|
|
|
|
margin-bottom: 20px; |
|
|
|
|
|
|
|
background-color: #fff; |
|
|
|
|
|
|
|
border-radius: 8px; |
|
|
|
|
|
|
|
.title{ |
|
|
|
|
|
|
|
padding-left: 11px; |
|
|
|
|
|
|
|
margin-bottom: 20px; |
|
|
|
margin-bottom: 20px; |
|
|
|
font-size: 17px; |
|
|
|
|
|
|
|
color: $main-color; |
|
|
|
|
|
|
|
line-height: 1.8; |
|
|
|
|
|
|
|
border-left: 6px solid; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.desc{ |
|
|
|
.desc{ |
|
|
|
margin-bottom: 30px; |
|
|
|
margin-bottom: 30px; |
|
|
|
color: #333; |
|
|
|
color: #333; |
|
|
|