<template>
|
<div class="authorityManagement_box">
|
<My-bread :list="['数据管理', '数据检索']"></My-bread>
|
<el-divider />
|
<div class="searchComp">
|
<el-form ref="ruleForm" :model="ruleForm" :inline="true">
|
<el-form-item label="关键字" prop="name">
|
<el-input v-model="ruleForm.name" placeholder="请输入" />
|
</el-form-item>
|
<el-form-item>
|
<el-button
|
@click="submitForm('ruleForm')"
|
icon="el-icon-search"
|
type="primary"
|
size="small"
|
>查询</el-button
|
>
|
<el-button
|
@click="resetForm('ruleForm')"
|
icon="el-icon-refresh"
|
type="info"
|
size="small"
|
>重置</el-button
|
>
|
<!-- <el-button
|
v-if="btnStatus.delete"
|
@click="DelFormData"
|
icon="el-icon-delete"
|
type="danger"
|
size="small"
|
>删除</el-button
|
> -->
|
<el-button
|
v-if="btnStatus.download"
|
icon="el-icon-position"
|
type="success"
|
size="small"
|
>下载</el-button
|
>
|
<!-- <el-button
|
v-else
|
@click="testfb()"
|
icon="el-icon-position"
|
type="success"
|
size="small"
|
>取消</el-button
|
> -->
|
</el-form-item>
|
<!-- <el-form-item>
|
<span v-if="FBtest">
|
<i class="dotClass" style="background-color: springgreen"></i>
|
</span>
|
<span v-else>
|
<i class="dotClass" style="background-color: gray"></i>
|
</span>
|
</el-form-item>
|
<el-form-item v-if="FBtest">
|
发布地址:http://192.168.20.39/SG/default/streamer.ashx
|
</el-form-item> -->
|
</el-form>
|
</div>
|
<div class="bottom">
|
<div class="leftTree">
|
<el-tree
|
:data="tree"
|
:props="defaultProps"
|
:default-expanded-keys="[1]"
|
node-key="id"
|
@node-click="handleNodeClick"
|
></el-tree>
|
</div>
|
<div class="rightTable">
|
<div class="table_box">
|
<el-table
|
ref="filterTable"
|
:data="tableData"
|
height="99%"
|
border
|
style="width: 100%"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="55" />
|
<el-table-column width="50" type="index" label="序号" />
|
<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-column min-width="80" label="操作">
|
<template slot-scope="scope">
|
<el-link @click="showDetail(scope.$index, scope.row)"
|
>查看</el-link
|
>
|
<el-link
|
@click="dialogFormVisible = true"
|
style="margin-left: 10px"
|
>附件</el-link
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div
|
style="margin-top: 20px; margin-left: 200px"
|
class="pagination_box"
|
>
|
<el-pagination
|
v-if="changePag"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page="this.listData.pageIndex"
|
:page-sizes="[10, 20, 50, 100]"
|
:page-size="this.listData.pageSize"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="count"
|
>
|
</el-pagination>
|
</div>
|
</div>
|
</div>
|
<div class="infoBox" v-show="showinfoBox">
|
<el-card class="box-card">
|
<div slot="header" class="clearfix">
|
<span>详细信息</span>
|
<div style="float: right; cursor: pointer" @click="closeDetial">
|
<i class="el-icon-close"></i>
|
</div>
|
</div>
|
<div class="contentBox">
|
<ul>
|
<li v-for="(item, index) in itemdetail">
|
<p>
|
<label> {{ item.label }}:</label>
|
<label class="boxlabel">{{ item.value }}</label>
|
</p>
|
<el-divider></el-divider>
|
</li>
|
</ul>
|
</div>
|
</el-card>
|
</div>
|
<el-dialog title="附件挂接" width="30%" :visible.sync="dialogFormVisible">
|
<el-form :model="formInline" class="demo-form-inline">
|
<el-form-item label="添加数据">
|
<el-input
|
v-model="formInline.file"
|
style="width: 300px; margin-right: 20px"
|
placeholder="请选择"
|
disabled
|
></el-input>
|
<input
|
name="file1"
|
type="file"
|
id="insertFile"
|
multiple="multiple"
|
style="display: none"
|
@change="insertFile( )"
|
/>
|
<el-link @click="getInsertFile( )" :underline="false"
|
><i class="el-icon-folder-opened"></i
|
></el-link>
|
</el-form-item>
|
<el-form-item>
|
<el-row >
|
<el-col :span="2"> <el-link type="primary" :underline="false" >添加</i></el-link></el-col>
|
<el-col :span="2"> <el-link type="primary" :underline="false" >删除</i></el-link></el-col>
|
<el-col :span="2"> <el-link type="primary" :underline="false" >清空</i></el-link></el-col>
|
</el-row>
|
</el-form-item>
|
<el-form-item>
|
<el-table
|
ref="filterTable"
|
height="99%"
|
border
|
style="width: 100%"
|
>
|
<el-table-column width="50" type="index" label="序号" />
|
<el-table-column prop="date"
|
label="文件路径"
|
/>
|
|
<el-table-column
|
prop="name"
|
label="文件名称"
|
/>
|
|
</el-table>
|
</el-form-item>
|
<el-form-item>
|
|
<el-row :gutter="20">
|
<el-col :span="12" :offset="8"> <el-button plain>确认</el-button> <el-button plain>取消</el-button></el-col>
|
</el-row>
|
</el-form-item>
|
</el-form>
|
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import $ from 'jquery';
|
import {
|
dataQuery_selectTabs,
|
dataQuery_selectDomains,
|
dataQuery_selectFields,
|
dataQuery_selectByPage,
|
} from '../../api/api';
|
|
import catalogueTree from '../../components/catalogueTree.vue';
|
import MyBread from '../../components/MyBread.vue';
|
export default {
|
//import引入的组件需要注入到对象中才能使用
|
name: 'dataSearch',
|
components: { MyBread, catalogueTree },
|
data() {
|
return {
|
formInline: {
|
file:''
|
},
|
tree: [
|
{
|
tabDesc: '基础数据',
|
value: 'BD',
|
children: [],
|
},
|
{
|
tabDesc: '业务数据',
|
value: 'BS',
|
children: [],
|
},
|
],
|
defaultProps: {
|
children: 'children',
|
label: 'tabDesc',
|
},
|
btnStatus: {
|
select: false,
|
delete: false,
|
upload: false,
|
download: false,
|
insert: false,
|
update: false,
|
},
|
tableType: null,
|
ruleForm: {
|
name: '',
|
},
|
FBtest: false,
|
tableData: [],
|
formLabelWidth: '120px',
|
dialogFormVisible: false,
|
upform: {
|
gid: '',
|
pipename: '',
|
sitename: '',
|
type: '',
|
seriesname: '',
|
stationvalue: '',
|
transportm: '',
|
diameter: '',
|
name: '',
|
},
|
|
changePag: true,
|
showinfoBox: false,
|
itemdetail: {},
|
|
tableData: [],
|
attributeData: [],
|
currentPage: 1,
|
searchName: '',
|
multipleSelection: [],
|
filedsLayer: null,
|
count: 0,
|
listData: {
|
pageSize: 10,
|
pageIndex: 1,
|
name: null,
|
filter: null,
|
wkt: null,
|
},
|
};
|
},
|
created() {
|
// this.getSPData(10, 1, "");
|
// this.getSPCount("");
|
this.showPermsBtn();
|
this.getTreeDataAll();
|
},
|
methods: {
|
//附件=>文件选择
|
getInsertFile(){
|
$("#insertFile").click();
|
},
|
insertFile(){
|
var val = document.getElementById("insertFile").files;
|
if (!val || !val.length) return;
|
|
this.formInline.file = val[0].name;
|
},
|
//获取目录树数据
|
async getTreeDataAll() {
|
const data = await dataQuery_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);
|
}
|
}
|
},
|
//授权管理
|
showPermsBtn() {
|
let currentPerms = this.$store.state.currentPerms;
|
let permsEntity = this.$store.state.permsEntity;
|
permsEntity
|
.filter((item) => item.perms == currentPerms)
|
.map((item) => {
|
console.log(item);
|
this.btnStatus[item.tag.substr(1)] = true;
|
});
|
},
|
//树点击事件
|
handleNodeClick(data) {
|
//判断点击是否为子节点
|
if (data.children != null) return;
|
this.listData.name = data.entity; //要查询表格类型;
|
this.filedsLayer = this.getCollapseDomFiled(); //获取每个表字段名称及阈值
|
//获取table信息
|
this.getCollapseTable(this.filedsLayer);
|
},
|
//获取表格信息
|
async getCollapseTable(res) {
|
res.then((val) => {
|
this.attributeData = val;
|
});
|
if (this.ruleForm.name != null) {
|
this.listData.filter = 'name like ' + this.ruleForm.name;
|
}
|
const data = await dataQuery_selectByPage(this.listData);
|
if (data.code != 200) {
|
this.$message.error('调用列表失败,请联系工作人员!');
|
return;
|
}
|
var res_val = this.attributeData;
|
this.count = data.count;
|
for (var i in data.result) {
|
let val_Data = data.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;
|
}
|
}
|
}
|
this.tableData = data.result;
|
},
|
//获取每个表字段名称及阈值
|
async getCollapseDomFiled() {
|
//查询字段信息;
|
const fileds = await dataQuery_selectFields({
|
name: this.listData.name,
|
});
|
if (fileds.code != 200) {
|
this.$message.error('调用列表失败,请联系工作人员!');
|
return;
|
}
|
|
//查询阈值信息;
|
const domains = await dataQuery_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;
|
},
|
// 请求场站点内容
|
getSPData(size, num, name) {
|
querySitePoint(size, num, name).then((res) => {
|
this.tableData = res.data;
|
});
|
},
|
// 请求场站点数量
|
getSPCount(name) {
|
querySitePointCount(name).then((res) => {
|
this.count = res.data;
|
});
|
},
|
// 请求场站点内容
|
getSSData(size, num, name) {
|
queryStationSeries(size, num, name).then((res) => {
|
this.tableData = res.data;
|
});
|
},
|
// 请求场站点数量
|
getSSCount(name) {
|
queryStationSeriesCount(name).then((res) => {
|
this.count = res.data;
|
});
|
},
|
|
// 请求标桩内容
|
getMData(size, num, name) {
|
queryMarker(size, num, name).then((res) => {
|
this.tableData = res.data;
|
});
|
},
|
// 请求标桩数量
|
getMCount(name) {
|
queryMarkerCount(name).then((res) => {
|
this.count = res.data;
|
});
|
},
|
|
// 关键字查询
|
submitForm() {
|
this.listData.pageIndex = 1;
|
this.listData.pageSize = 10;
|
//获取table信息
|
this.getCollapseTable(this.filedsLayer);
|
},
|
//分页点击事件
|
handleSizeChange(val) {
|
this.listdata.pageSize = val;
|
this.listdata.pageIndex = 1;
|
//获取table信息
|
this.getCollapseTable(this.filedsLayer);
|
},
|
handleCurrentChange(val) {
|
this.listdata.pageIndex = val;
|
//获取table信息
|
this.getCollapseTable(this.filedsLayer);
|
},
|
// 重置查询
|
resetForm(formName) {
|
this.searchName = '';
|
this.$refs[formName].resetFields();
|
//获取table信息
|
this.getCollapseTable(this.filedsLayer);
|
},
|
|
// 发布按钮
|
testfb() {
|
// if (this.FBtest) {
|
// this.$confirm("是否取消发布?", "提示", {
|
// confirmButtonText: "确定",
|
// cancelButtonText: "取消",
|
// type: "warning",
|
// })
|
// .then(() => {
|
const loading = this.$loading({
|
lock: true,
|
text: 'Loading',
|
spinner: 'el-icon-loading',
|
background: 'rgba(0, 0, 0, 0.7)',
|
});
|
setTimeout(() => {
|
loading.close();
|
this.FBtest = !this.FBtest;
|
}, 2000);
|
// })
|
// .catch(() => {});
|
// }
|
},
|
// 查看界面
|
showDetail(index, row) {
|
console.log(index, row);
|
console.log(this.attributeData);
|
this.showinfoBox = true;
|
|
var std = [];
|
for (var i in this.attributeData) {
|
std.push({
|
label: this.attributeData[i].alias,
|
value: row[this.attributeData[i].field],
|
});
|
}
|
this.itemdetail = std;
|
},
|
// 关闭查看
|
closeDetial() {
|
this.showinfoBox = false;
|
this.itemdetail = {};
|
},
|
|
// 修改界面
|
handleEdit(index, row) {
|
this.dialogFormVisible = true;
|
this.upform = JSON.parse(JSON.stringify(row));
|
},
|
// 提交修改
|
updateForm() {
|
let params = {};
|
this.$confirm('是否确定编辑?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
})
|
.then(() => {
|
this.dialogFormVisible = false;
|
switch (this.tableType) {
|
case '场站点':
|
params = {
|
gid: this.upform.gid,
|
pipename: this.upform.pipename,
|
sitename: this.upform.sitename,
|
type: this.upform.type,
|
};
|
UpdateSitePoint(params).then((res) => {
|
if (res.data == 1) {
|
this.$message({
|
message: '修改成功',
|
type: 'success',
|
});
|
}
|
this.getSPData(10, 1, '');
|
this.getSPCount('');
|
});
|
break;
|
case '管道中心线':
|
params = {
|
gid: this.upform.gid,
|
pipename: this.upform.pipename,
|
seriesname: this.upform.seriesname,
|
stationvalue: this.upform.stationvalue,
|
transportm: this.upform.transportm,
|
diameter: this.upform.diameter,
|
};
|
UpdateStationSeries(params).then((res) => {
|
if (res.data == 1) {
|
this.$message({
|
message: '修改成功',
|
type: 'success',
|
});
|
}
|
this.getSSData(10, 1, '');
|
this.getSSCount('');
|
});
|
break;
|
case '标桩':
|
params = {
|
gid: this.upform.gid,
|
pipename: this.upform.pipename,
|
name: this.upform.name,
|
type: this.upform.type,
|
};
|
UpdatgeMarker(params).then((res) => {
|
if (res.data == 1) {
|
this.$message({
|
message: '修改成功',
|
type: 'success',
|
});
|
}
|
this.getMData(10, 1, '');
|
this.getMCount('');
|
});
|
break;
|
}
|
// updateMetaData(this.upform).then((res) => {
|
// if (res.data == 1) {
|
// this.$message({
|
// message: "修改成功",
|
// type: "success",
|
// });
|
// }
|
// this.getMetaData(10, 1, "");
|
// this.getMetaCount("");
|
// });
|
})
|
.catch(() => { });
|
},
|
// 获取多选选中的对象
|
handleSelectionChange(val) {
|
this.multipleSelection = val;
|
},
|
// 删除多条
|
DelFormData() {
|
var std = [];
|
for (var i in this.multipleSelection) {
|
std.push(this.multipleSelection[i].gid);
|
}
|
this.$confirm('确定是否删除所选内容?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
})
|
.then(() => {
|
switch (this.tableType) {
|
case '场站点':
|
dltSitePoint(std).then((res) => {
|
if (res.data !== 0) {
|
this.$message({
|
message: '删除成功',
|
type: 'success',
|
});
|
}
|
this.getSPData(10, 1, '');
|
this.getSPCount('');
|
});
|
break;
|
case '管道中心线':
|
dltStationSeries(std).then((res) => {
|
if (res.data !== 0) {
|
this.$message({
|
message: '删除成功',
|
type: 'success',
|
});
|
}
|
this.getSSData(10, 1, '');
|
this.getSSCount('');
|
});
|
break;
|
case '标桩':
|
dltMarker(std).then((res) => {
|
if (res.data !== 0) {
|
this.$message({
|
message: '删除成功',
|
type: 'success',
|
});
|
}
|
this.getMData(10, 1, '');
|
this.getMCount('');
|
});
|
break;
|
}
|
// dltMetaDatas(std).then((res) => {
|
// this.getMetaData(10, 1, "");
|
// this.getMetaCount("");
|
// this.$message({
|
// type: "success",
|
// message: "删除成功!",
|
// });
|
// });
|
})
|
.catch(() => { });
|
},
|
},
|
};
|
</script>
|
<style lang="less" scoped>
|
//@import url(); 引入公共css类
|
.authorityManagement_box {
|
background: rgb(240, 242, 245);
|
border-radius: 10px;
|
height: 100%;
|
padding: 10px;
|
box-sizing: border-box;
|
.searchComp {
|
margin: 10px auto;
|
background: #fff;
|
border-radius: 5px;
|
border: 1px solid rgb(202, 201, 204);
|
.el-form-item {
|
margin: 5px;
|
}
|
.el-input {
|
width: 467px;
|
}
|
}
|
.bottom {
|
width: 100%;
|
height: 85%;
|
display: flex;
|
.leftTree {
|
width: 344px;
|
background: #f4f8ff;
|
border-radius: 10px;
|
overflow: auto;
|
}
|
.rightTable {
|
height: 100%;
|
width: 77.8%;
|
.table_box {
|
width: 100%;
|
height: 93%;
|
margin: 0 auto;
|
background: #fff;
|
.el-table {
|
height: 100%;
|
}
|
.el-table /deep/ .el-table__header-wrapper tr th {
|
background-color: rgb(255, 255, 255) !important;
|
color: rgb(0, 0, 0);
|
}
|
// 修改每行样式:
|
.el-table /deep/ .el-table__row {
|
background-color: rgba(255, 255, 255) !important;
|
color: rgb(0, 0, 0);
|
}
|
.el-table /deep/ .el-table__body tr.current-row > td {
|
background-color: rgb(211, 211, 211) !important;
|
}
|
.el-table /deep/ .el-table__body tr:hover > td {
|
background-color: rgb(211, 211, 211) !important;
|
}
|
// 修改表格每行边框的样式:
|
.el-table /deep/ td,
|
.el-table /deep/ th.is-leaf {
|
border-bottom: 1px solid #eee;
|
border-right: 1px solid #eee;
|
}
|
.el-table /deep/ .el-table__cell {
|
padding: 0;
|
}
|
// 设置表格每行的高度:
|
.el-table /deep/ .el-table__header tr,
|
.el-table /deep/ .el-table__header th {
|
height: 40px;
|
}
|
.el-table__body tr,
|
.el-table__body td {
|
height: 40px;
|
padding: 0px;
|
}
|
// 设置表格边框颜色:
|
|
.el-table--border::after,
|
.el-table--group::after {
|
width: 0;
|
}
|
.el-table::before {
|
height: 0;
|
}
|
}
|
}
|
}
|
.infoBox {
|
width: 500px;
|
border: 1px solid #eee;
|
position: absolute;
|
z-index: 100;
|
top: 15%;
|
right: 25%;
|
background-color: #fff;
|
.el-card {
|
background-color: transparent;
|
span {
|
font-size: 16px;
|
font-weight: 600;
|
}
|
}
|
.contentBox {
|
margin: 0 aotu 10px;
|
p {
|
// background-color: #bfa;
|
// margin-bottom: 10px;
|
font-size: 14px;
|
}
|
}
|
}
|
.dotClass {
|
width: 10px;
|
height: 10px;
|
border-radius: 50%;
|
display: block;
|
margin-top: 15px;
|
margin-left: 10px; //这个用于圆点居中
|
}
|
}
|
</style>
|