定时刷新
This commit is contained in:
@ -3,11 +3,10 @@
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container"
|
||||
:class="
|
||||
zbInfo.emsCommunicationStatus !== '0'
|
||||
? 'zb-common-card-container'
|
||||
: 'cnb-common-card-container'
|
||||
"
|
||||
:class="{
|
||||
'zb-common-card-container':zbInfo.emsCommunicationStatus && zbInfo.emsCommunicationStatus !== '0',
|
||||
'cnb-common-card-container':zbInfo.emsCommunicationStatus === '0'
|
||||
}"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="large-title">1#{{ zbInfo.deviceName }}</span>
|
||||
@ -40,11 +39,10 @@
|
||||
shadow="always"
|
||||
class="common-card-container"
|
||||
style="margin-top: 20px"
|
||||
:class="
|
||||
cnbInfo.emsCommunicationStatus !== '0'
|
||||
? 'zb-common-card-container'
|
||||
: 'cnb-common-card-container'
|
||||
"
|
||||
:class="{
|
||||
'zb-common-card-container':zbInfo.emsCommunicationStatus && zbInfo.emsCommunicationStatus !== '0',
|
||||
'cnb-common-card-container':zbInfo.emsCommunicationStatus === '0'
|
||||
}"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="large-title">2#{{ cnbInfo.deviceName }}</span>
|
||||
@ -77,9 +75,10 @@
|
||||
<script>
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { getAmmeterDataList } from "@/api/ems/dzjk";
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
export default {
|
||||
name: "DzjkSbjkDb",
|
||||
mixins: [getQuerySiteId],
|
||||
mixins: [getQuerySiteId,intervalUpdate],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@ -88,20 +87,24 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
updateData(){
|
||||
this.loading = true;
|
||||
getAmmeterDataList(this.siteId)
|
||||
.then((response) => {
|
||||
this.zbInfo = JSON.parse(
|
||||
JSON.stringify(response?.data?.ammeterLoadData || {})
|
||||
);
|
||||
this.cnbInfo = JSON.parse(
|
||||
JSON.stringify(response?.data?.ammeterMeteData || {})
|
||||
);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
.then((response) => {
|
||||
this.zbInfo = JSON.parse(
|
||||
JSON.stringify(response?.data?.ammeterLoadData || {})
|
||||
);
|
||||
this.cnbInfo = JSON.parse(
|
||||
JSON.stringify(response?.data?.ammeterMeteData || {})
|
||||
);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
init() {
|
||||
this.updateData()
|
||||
this.updateInterval(this.updateData)
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
@ -109,17 +112,23 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.zb-common-card-container,
|
||||
.cnb-common-card-container {
|
||||
.common-card-container {
|
||||
::v-deep {
|
||||
.el-card__header {
|
||||
background-color: transparent;
|
||||
padding: 10px 14px;
|
||||
background-color: #fc6b69;
|
||||
color: #ffffff;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
}
|
||||
.zb-common-card-container{
|
||||
::v-deep {
|
||||
.el-card__header {
|
||||
background-color: #fc6b69;
|
||||
}
|
||||
}
|
||||
}
|
||||
.cnb-common-card-container {
|
||||
margin-top: 25px;
|
||||
::v-deep {
|
||||
|
||||
Reference in New Issue
Block a user