<template>
|
<div class="archive">
|
<div class="left_active">
|
<el-card class="arch_card">
|
<div class="title_active">{{ $t('archive.name') }}</div>
|
<el-divider />
|
<el-tree
|
ref="tree"
|
:data="tree"
|
:props="defaultProps"
|
show-checkbox
|
default-expand-all="true"
|
/>
|
</el-card>
|
</div>
|
<div class="right_active">
|
<el-card class="arch_card">
|
<div>
|
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
<el-form-item>
|
<el-input
|
v-model="formInline.name"
|
placeholder="请输入"
|
></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button plain @click="getArchTableData">查询</el-button>
|
</el-form-item>
|
<el-form-item>
|
<el-button plain>重置</el-button>
|
</el-form-item>
|
<el-form-item>
|
<el-button plain>下载</el-button>
|
</el-form-item>
|
<el-form-item>
|
<el-button plain @click="showDialogBox">空间查询</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
<el-divider />
|
<div class="centerBox">
|
<el-collapse v-model="activeNames" @change="handleChange" accordion>
|
<el-collapse-item
|
v-for="(item, index) in companyList"
|
:key="index"
|
:name="item.entity"
|
:title="item.tabDesc"
|
>
|
<div class="centerTable">
|
<el-table :data="tableData" height="550" border stripe>
|
<el-table-column type="selection" width="55" />
|
<el-table-column
|
align="center"
|
type="index"
|
label="序号"
|
width="50"
|
/>
|
<el-table-column
|
v-for="(item, index) in attributeData"
|
:key="index"
|
:label="item.alias"
|
:prop="item.field"
|
show-overflow-tooltip
|
align="center"
|
></el-table-column>
|
</el-table>
|
<el-divider />
|
<el-pagination
|
:current-page="listdata.pageIndex"
|
:page-sizes="[10, 20, 30, 40]"
|
:page-size="listdata.pageSize"
|
:small="small"
|
:disabled="disabled"
|
:background="background"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="count"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
</div>
|
</el-collapse-item>
|
</el-collapse>
|
</div>
|
</el-card>
|
</div>
|
|
<el-dialog
|
title="空间查询"
|
:visible.sync="dialogVisible"
|
width="92%"
|
style="margin-left: 16%"
|
top="5vh"
|
:before-close="handleClose"
|
>
|
<div style="height: 720px; width: 100%">
|
<mapsdk></mapsdk>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import mapsdk from '../../components/mapsdk.vue';
|
import {
|
inquiry_SelectTabs,
|
dataLib_selectFields,
|
dataLib_selectByPage,
|
dataLib_selectDomains,
|
} from '../../api/api.js';
|
export default {
|
components: {
|
mapsdk,
|
},
|
data() {
|
return {
|
dialogVisible: false,
|
activeNames: null,
|
listdata: {
|
pageIndex: 1,
|
pageSize: 10,
|
filter: null,
|
name: null,
|
wkt: null,
|
},
|
companyList: [],
|
formInline: {},
|
count: 0,
|
tree: [
|
{
|
tabDesc: '基础数据',
|
value: 'BD',
|
children: [],
|
},
|
{
|
tabDesc: '业务数据',
|
value: 'BS',
|
children: [],
|
},
|
],
|
defaultProps: {
|
chilren: 'children', //"children"内的每个对象解析为一个子项;
|
label: 'tabDesc', //所有"label"所在的对象解析为一个父项
|
},
|
attributeData: [],
|
tableData: [],
|
archStatus: {
|
download: false,
|
},
|
archOption: [],
|
queryLayer: null,
|
};
|
},
|
|
methods: {
|
handleClose() {
|
this.dialogVisible = false;
|
this.$store.state.mapMenuBoolean = false;
|
this.$store.state.mapMenuBoxFlag = null;
|
this.$store.state.mapPopBoolean = false;
|
this.$store.state.mapPopBoxFlag = null;
|
},
|
showDialogBox() {
|
this.$store.state.mapMenuBoolean = true;
|
this.$store.state.mapMenuBoxFlag = '1';
|
this.dialogVisible = true;
|
},
|
//获取表格数据
|
getArchTableData() {
|
this.companyList = [];
|
this.activeNames = null;
|
var valTree = this.$refs.tree.getCheckedNodes();
|
if (valTree.length == 0) {
|
this.$message.error('请选择要查询的图层资料!');
|
return;
|
}
|
for (var i in valTree) {
|
this.listdata.name = valTree[i].entity;
|
var filedData = this.getCollapseDomFiled();
|
this.archOption.push({
|
name: valTree[i].entity,
|
fileds: filedData,
|
table: this.getCollapseTable(filedData),
|
});
|
}
|
|
this.companyList = valTree;
|
},
|
//获取每个表字段名称及阈值
|
async getCollapseDomFiled() {
|
//查询字段信息;
|
const fileds = await dataLib_selectFields({
|
name: this.listdata.name,
|
});
|
if (fileds.code != 200) {
|
this.$message.error('调用列表失败,请联系工作人员!');
|
return;
|
}
|
//查询阈值信息;
|
const domains = await dataLib_selectDomains({
|
name: this.listdata.name,
|
});
|
if (domains.code != 200) {
|
this.$message.error('调用列表失败,请联系工作人员!');
|
return;
|
}
|
var data1 = fileds.result;
|
var data2 = domains.result;
|
var std = [];
|
for (var i in data1) {
|
if (data1[i].showtype == 1) {
|
if (data1[i].domainNa != null) {
|
data1[i].domainNa = this.getDomainNaFild(data1[i].domainNa, data2);
|
}
|
std.push(data1[i]);
|
}
|
}
|
return std;
|
},
|
//值域字段匹配
|
getDomainNaFild(res, result) {
|
for (var i in result) {
|
if (result[i].domName == res) {
|
return result[i].codeDesc;
|
}
|
}
|
return null;
|
},
|
|
//获取每个表的table
|
async getCollapseTable(res) {
|
var res_val;
|
res.then((val) => {
|
res_val = val;
|
});
|
|
if (this.formInline.name != null) {
|
this.listdata.filter = 'name like ' + this.formInline.name;
|
}
|
const fileds = await dataLib_selectByPage(this.listdata);
|
if (fileds.code != 200) {
|
this.$message.error('调用列表失败,请联系工作人员!');
|
return;
|
}
|
for (var i in fileds.result) {
|
let val_Data = fileds.result[i];
|
|
for (var j in res_val) {
|
if (res_val[j].domainNa != null && res_val[j].domainNa != undefined) {
|
val_Data[res_val[j].field] = res_val[j].domainNa;
|
}
|
}
|
}
|
return fileds;
|
},
|
|
//折叠面板切换事件
|
handleChange(val) {
|
if (val == '') return;
|
var that = this;
|
this.listdata.name = val;
|
this.listdata.pageSize = 10;
|
this.listdata.pageIndex = 1;
|
for (var i in this.archOption) {
|
if (this.archOption[i].name == val) {
|
this.queryLayer = this.archOption[i].fileds;
|
this.archOption[i].fileds.then((res) => {
|
that.attributeData = res;
|
});
|
this.archOption[i].table.then((res) => {
|
this.count = res.count;
|
this.tableData = res.result;
|
});
|
}
|
}
|
},
|
//分页点击事件
|
handleSizeChange(val) {
|
this.listdata.pageSize = val;
|
this.listdata.pageIndex = 1;
|
var res = this.getCollapseTable(this.queryLayer);
|
res.then((res) => {
|
this.tableData = res.result;
|
});
|
},
|
handleCurrentChange(val) {
|
this.listdata.pageIndex = val;
|
var res = this.getCollapseTable(this.queryLayer);
|
res.then((res) => {
|
this.tableData = res.result;
|
});
|
},
|
//获取树
|
async getTreeData() {
|
const data = await inquiry_SelectTabs();
|
if (data.code != 200) {
|
this.$message.error('列表调用失败');
|
}
|
var option = data.result;
|
|
for (var i in option) {
|
var val_Data = option[i];
|
val_Data.id = '1' + i;
|
if (option[i].ns == 'bd') {
|
this.tree[0].children.push(val_Data);
|
} else {
|
this.tree[1].children.push(val_Data);
|
}
|
}
|
},
|
//权限管理
|
showArchMenu(res) {
|
switch (res.tag) {
|
case '/download':
|
this.archStatus.download = true;
|
break;
|
}
|
},
|
},
|
created() {
|
var val = this.$store.state.currentPerms;
|
var permsEntity = this.$store.state.permsEntity;
|
for (var i = 0; i < permsEntity.length; i++) {
|
if (permsEntity[i].perms == val) {
|
// this.showMenuChange(permsEntity[i], permsEntity);
|
this.showArchMenu(permsEntity[i]);
|
}
|
}
|
this.getTreeData();
|
},
|
};
|
</script>
|
|
<style scped lang="less">
|
.archive {
|
width: 100%;
|
height: 100%;
|
position: relative;
|
}
|
|
.archive .left_active {
|
width: 21%;
|
height: 100%;
|
float: left;
|
}
|
|
.archive .right_active {
|
width: 78.5%;
|
height: 100%;
|
float: right;
|
}
|
.archive .arch_card {
|
width: 100%;
|
height: 100%;
|
}
|
.archive .centerBox {
|
max-height: 800px;
|
overflow: auto;
|
}
|
|
.archive .centerBox::-webkit-scrollbar {
|
/*滚动条整体样式*/
|
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
|
height: 1px;
|
}
|
.archive .centerBox::-webkit-scrollbar-thumb {
|
/*滚动条里面小方块*/
|
border-radius: 10px;
|
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
background: #e5e5e5;
|
}
|
.archive .centerBox::-webkit-scrollbar-track {
|
/*滚动条里面轨道*/
|
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
border-radius: 10px;
|
background: #ffffff;
|
}
|
|
.archive .centerTable {
|
height: 600px;
|
}
|
.archive .arch_card .el-card__body {
|
padding: 10px;
|
overflow-y: auto;
|
}
|
|
.archive .el-divider--horizontal {
|
margin: 10px 0 !important;
|
}
|
.archive .left_active .title_active {
|
font-size: 22px;
|
font-family: Microsoft YaHei;
|
font-weight: bold;
|
color: #3b4d6e;
|
}
|
.archive .middle_div {
|
border: 1px solid red;
|
}
|
.archive .middle_card {
|
width: 100%;
|
height: 81vh;
|
border: transparent;
|
}
|
|
.archive .el-table .warning-row {
|
--el-table-tr-bg-color: var(--el-color-warning-light-9);
|
}
|
</style>
|