|
|
|
@ -1,31 +1,123 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="filedBox">
|
|
|
|
|
<div class="recordBox">
|
|
|
|
|
<div class="reportHead">
|
|
|
|
|
<h3>导出记录</h3>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="page-body">
|
|
|
|
|
<el-button type="primary" icon="el-icon-plus">添加主设备</el-button>
|
|
|
|
|
<div class="zsbTableBox"></div>
|
|
|
|
|
<div class="title">
|
|
|
|
|
<span>监测设备类型:</span>
|
|
|
|
|
<el-select v-model="jcsbType" @change="changeJg">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in jcsbOptions"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.mc + '(' + item.tablename + ')'"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
>
|
|
|
|
|
{{ item.mc + "(" + item.tablename + ")" }}
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="zsbTableBox">
|
|
|
|
|
<el-table
|
|
|
|
|
:data="recordData"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
height="calc(100% - 0px)"
|
|
|
|
|
v-loading="recordLoading"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column label="名称" prop="name">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ scope.row.sensor.name }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="被监测设备标识" prop="equipmentId">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ scope.row.sensor.equipmentId }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="监测装置标识" prop="sensorCode">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ scope.row.sensor.sensorCode }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="最后导出时间" prop="lastDTime">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ scope.row.lastDTime }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
//import { zsbDeleteApi, zsbListAllApi } from "@/utils/api/index";
|
|
|
|
|
import { modevtypeListAllApi, listRecordApi } from "@/utils/api/index";
|
|
|
|
|
// import addzsbDialog from "./components/addzsbDialog";
|
|
|
|
|
export default {
|
|
|
|
|
name: "record",
|
|
|
|
|
components: {},
|
|
|
|
|
data() {
|
|
|
|
|
return {};
|
|
|
|
|
return {
|
|
|
|
|
jcsbType: "",
|
|
|
|
|
jcsbOptions: [{ id: -1, mc: "全部", tablename: "all" }],
|
|
|
|
|
selectTableName: "",
|
|
|
|
|
recordData: [],
|
|
|
|
|
recordLoading: false,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getjcsbListAll();
|
|
|
|
|
},
|
|
|
|
|
created() {},
|
|
|
|
|
mounted() {},
|
|
|
|
|
watch: {},
|
|
|
|
|
methods: {},
|
|
|
|
|
methods: {
|
|
|
|
|
getjcsbListAll() {
|
|
|
|
|
modevtypeListAllApi()
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.jcsbOptions = this.jcsbOptions.concat(res.data);
|
|
|
|
|
|
|
|
|
|
this.jcsbType = this.jcsbOptions[0].id;
|
|
|
|
|
this.selectTableName = this.jcsbOptions[0].tablename;
|
|
|
|
|
this.exportFun();
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//选中的值获取tablename
|
|
|
|
|
changeJg(val) {
|
|
|
|
|
console.log(val);
|
|
|
|
|
let selectedOption = this.jcsbOptions.find((item) => item.id === val);
|
|
|
|
|
if (selectedOption) {
|
|
|
|
|
// 如果找到了匹配的项,访问它的 tablename
|
|
|
|
|
this.selectTableName = selectedOption.tablename;
|
|
|
|
|
console.log(this.selectTableName); // 或者根据你的需求使用 tablename
|
|
|
|
|
this.exportFun();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
exportFun() {
|
|
|
|
|
let params = {};
|
|
|
|
|
if (this.jcsbType !== -1) {
|
|
|
|
|
params.modevtypeId = this.jcsbType;
|
|
|
|
|
}
|
|
|
|
|
this.recordLoading = true;
|
|
|
|
|
listRecordApi(params)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.recordData = res.data;
|
|
|
|
|
this.recordLoading = false;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.zsbBox {
|
|
|
|
|
.recordBox {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
.page-body {
|
|
|
|
@ -33,6 +125,14 @@ export default {
|
|
|
|
|
height: calc(100% - 74px);
|
|
|
|
|
padding: 12px;
|
|
|
|
|
background: #eee;
|
|
|
|
|
.title {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
span {
|
|
|
|
|
color: #000;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.zsbTableBox {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
height: calc(100% - 38px);
|
|
|
|
|