2b76acdf by renchao@pashanhoo.com

style:首页增加定时器

1 parent d8f268f3
......@@ -3,12 +3,13 @@
</template>
<script>
import Chart from './Chart'
import work from "@/api/work";
export default {
import Chart from './Chart'
import work from "@/api/work";
export default {
data () {
return {
cdata: {
timer: null,
legendItem: ['接入', '上报', '登簿'],
color: [
"#02D9FD",
......@@ -22,24 +23,31 @@ export default {
components: {
Chart
},
mounted() {
created () {
this.dataTrend()
this.timer = setInterval(() => {
this.dataTrend()
}, 10000) // 10s
},
mounted () {
window.addEventListener("resize", () => {
this.dataTrend()
});
this.dataTrend()
},
methods: {
async dataTrend() {
async dataTrend () {
try {
let { result: res } = await work.dataTrend();
this.cdata.echartData = [];
this.cdata.echartData=res,
this.cdata.echartData = res,
this.cdata.echartData.reverse()
} catch (error) {
console.log(error);
}
},
},
}
destroyed () {
clearInterval(this.timer)
}
}
</script>
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-04-03 13:40:18
* @LastEditTime: 2023-07-03 16:50:43
-->
<template>
<Chart :cdata="cdata" />
</template>
<script>
import Chart from "./Chart";
import work from "@/api/work";
export default {
import Chart from "./Chart";
import work from "@/api/work";
export default {
data () {
return {
timer: null, // 定时器
cdata: []
}
},
components: {
Chart
},
mounted () {
created () {
this.mapViews();
this.timer = setInterval(() => {
this.mapViews();
}, 10000) // 10s
},
methods: {
async mapViews () {
......@@ -37,6 +41,9 @@ export default {
this.$refs.msg.messageShow();
}
}
},
destroyed () {
clearInterval(this.timer)
}
}
}
</script>
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-03 16:45:40
-->
<template>
<div class="centercard">
<div class="card1">
......@@ -11,21 +16,18 @@
</template>
<script>
import maps from "@/components/Echart/Map";
import brokenline from "@/components/Echart/Brokenline";
export default {
import maps from "@/components/Echart/Map";
import brokenline from "@/components/Echart/Brokenline";
export default {
data () {
return {};
},
components: { maps, brokenline },
mounted () { },
beforeDestroy () { },
methods: {},
};
};
</script>
<style lang="scss" scoped>
.centercard {
.centercard {
width: 40%;
height: calc(100vh - 114px);
box-sizing: border-box;
......@@ -81,5 +83,5 @@ export default {
width: 100%;
}
}
}
}
</style>
......
<!--
* @Description :工作台左侧表
* @Autor : miaofang
* @LastEditTime : 2023-05-18 11:27:22
* @LastEditTime: 2023-07-03 16:50:16
-->
<template>
<div class="leftcard">
......@@ -57,14 +57,13 @@
</div>
</div>
</template>
<script>
import columnar from "@/components/Echart/Columnar";
import work from "@/api/work";
export default {
data () {
return {
timer: null, // 定时器
// 日均接入量
qxerrer: "",
qxsuccess: "",
......@@ -76,8 +75,11 @@
stcgl: ""
};
},
mounted () {
created () {
this.getsthjqxjrtotal();
this.timer = setInterval(() => {
this.getsthjqxjrtotal();
}, 10000) // 10s
},
components: { columnar },
computed: {
......@@ -118,6 +120,9 @@
});
},
},
destroyed () {
clearInterval(this.timer)
}
};
</script>
......
<!--
* @Description :工作台右侧表
* @Autor : miaofang
* @LastEditTime : 2023-05-18 11:26:52
* @LastEditTime: 2023-07-03 16:50:07
-->
<template>
<div class="rightcard">
......@@ -30,6 +30,7 @@
export default {
data () {
return {
timer: null,
config: {
headerBGC: '#016AC5',
oddRowBGC: '#154295',
......@@ -42,8 +43,13 @@
}
},
components: { columnarsmat, Rose },
created () {
this.getdjywltotal()
this.timer = setInterval(() => {
this.getdjywltotal()
}, 5000) // 5s
},
mounted () {
this.getdjywltotal();
window.addEventListener("resize", () => {
this.config.data = [];
this.getdjywltotal();
......@@ -65,19 +71,21 @@
this.config.data.push([index + 1, item.AREACODE, item.ywtotal])
});
// 遍历修改数组键,作为echars图表的参数
} catch (error) {
console.log(error);
}
},
}
},
destroyed () {
clearInterval(this.timer)
}
}
</script>
<style lang="scss" scoped>
/deep/.dv-scroll-board .rows {
overflow-y: auto;
}
/deep/.row-item:not(:last-child) {
margin-bottom: 0.026rem;
}
......
<!--
* @Description :工作台表内容
* @Autor : miaofang
* @LastEditTime : 2023-05-18 13:09:47
* @LastEditTime: 2023-07-03 16:39:09
-->
<template>
<div class="content" id="box">
......@@ -11,12 +11,12 @@
</div>
</template>
<script>
import "@/utils/flexible.js";
import drawMixin from "@/utils/drawMixin";
import leftcard from "./leftcard";
import centercard from "./centercard";
import rightcard from "./rightcard";
export default {
import "@/utils/flexible.js";
import drawMixin from "@/utils/drawMixin";
import leftcard from "./leftcard";
import centercard from "./centercard";
import rightcard from "./rightcard";
export default {
mixins: [drawMixin],
data () {
return {
......@@ -42,24 +42,16 @@ export default {
}, 500);
},
},
};
};
</script>
<style scoped lang="scss">
.content {
.content {
width: 100%;
height: calc(100% -94px);
margin: auto;
display: flex;
justify-content: space-between;
margin-top: 15px;
}
// #box{
// width: 1620px;
// height: 680px;
// position: absolute;
// transform-origin: left top;
// overflow: hidden;
// }
}
</style>
......
<!--
* @Description :修改登簿日志弹窗
* @Autor : miaofang
* @LastEditTime : 2023-05-18 13:16:22
* @LastEditTime: 2023-07-03 16:27:13
-->
<template>
<!-- 修改登簿日志弹窗 -->
......@@ -15,6 +15,7 @@
<el-tabs v-model="titleName" type="card">
<el-tab-pane label="登薄详情" name="sjmx"></el-tab-pane>
<el-tab-pane label="xml报文" name="xml"></el-tab-pane>
<el-tab-pane label="返回结果" name="fhjg"></el-tab-pane>
</el-tabs>
<div class="dialog-from" v-if="titleName == 'sjmx'">
<el-row class="dialog-from_header item-content-input">
......@@ -186,6 +187,9 @@
<div class="JsonEditor" v-if="titleName == 'xml'">
<JsonEditor class="editXML" :resultInfo="resultInfo" :key="key" />
</div>
<div class="JsonEditor" v-if="titleName == 'fhjg'">
<JsonEditor class="editXML" :resultInfo="resultInfo" :key="key" />
</div>
</div>
</div>
<div class="d-center" v-if="titleName == 'sjmx'">
......@@ -310,6 +314,9 @@
getDetail(data).then(res => {
let { accessLog, registerInfo, accessInfo, accessList, registerList
} = res.result
console.log(res.result, 'res.resultres.resultres.result');
this.accessLog = accessLog
this.resultInfo = accessLog.LOGSXML
this.registerInfo = registerInfo
......