|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="dashboard-container" >
|
|
|
+ <div class="dashboard-container">
|
|
|
<div class="header">
|
|
|
<div class="title clickScoop" @click="openDrawer('数据管理')">
|
|
|
变电配电大数据可视化系统
|
|
|
@@ -7,15 +7,15 @@
|
|
|
<div class="r-title">
|
|
|
<span @click="$refs.datePicker.open = true" style="cursor: pointer"> {{ dateTitle }}</span>
|
|
|
<a-date-picker
|
|
|
- :show-today="true"
|
|
|
- :locale="localeZH"
|
|
|
- @click="$refs.datePicker.open = false"
|
|
|
- style="position: absolute;right:20px;top:10px;z-index: -1"
|
|
|
- ref="datePicker"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- :value="date"
|
|
|
- @change="timeChange"
|
|
|
- placeholder="时间"
|
|
|
+ :show-today="true"
|
|
|
+ :locale="localeZH"
|
|
|
+ @click="$refs.datePicker.open = false"
|
|
|
+ style="position: absolute;right:20px;top:10px;z-index: -1"
|
|
|
+ ref="datePicker"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ :value="date"
|
|
|
+ @change="timeChange"
|
|
|
+ placeholder="时间"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -113,7 +113,7 @@
|
|
|
size="100%"
|
|
|
:direction="drawer.direction"
|
|
|
>
|
|
|
- <component :is="drawer.comp" :params="drawer.params"/>
|
|
|
+ <component :is="drawer.comp" :params="drawer.params" @freshRender="freshRender"/>
|
|
|
</el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -144,7 +144,19 @@ import * as _ from 'lodash'
|
|
|
require('dayjs/locale/zh-cn')
|
|
|
export default {
|
|
|
name: 'Dashboard',
|
|
|
- components: {ChartMap, Jryl, QbDlsbxjdx, Jxdxqk, Zydbsx, Dlbpds, Dlsdxl, CardWrap, SyjhdxqkChart, Dlydtssx},
|
|
|
+ components: {
|
|
|
+ ChartMap,
|
|
|
+ Jryl,
|
|
|
+ QbDlsbxjdx,
|
|
|
+ Jxdxqk,
|
|
|
+ Zydbsx,
|
|
|
+ Dlbpds,
|
|
|
+ Dlsdxl,
|
|
|
+ CardWrap,
|
|
|
+ SyjhdxqkChart,
|
|
|
+ Dlydtssx,
|
|
|
+ ScreenSjdr
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
render: true,
|
|
|
@@ -168,6 +180,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.$store.dispatch('setTime', dayjs(new Date()).format('YYYY-MM-DD'))
|
|
|
+ this.$on('freshRender', () => {
|
|
|
+ console.log('freshRender')
|
|
|
+ this.freshRender()
|
|
|
+ })
|
|
|
const doResize = _.debounce(() => {
|
|
|
console.log('doResize')
|
|
|
// this.freshRender()
|
|
|
@@ -182,9 +199,11 @@ export default {
|
|
|
methods: {
|
|
|
timeChange(evt) {
|
|
|
console.log('evt', evt)
|
|
|
+ this.$store.commit('dashboardTime/SET_TIME', dayjs(evt).format('YYYY-MM-DD'))
|
|
|
this.date = dayjs(evt).locale('zh-cn')
|
|
|
this.dateTitle = dayjs(evt).locale('zh-cn').format('YYYY年MM月DD日 星期dd')
|
|
|
this.$refs.datePicker.open = false
|
|
|
+ this.freshRender()
|
|
|
},
|
|
|
openDrawer(title, params = {}) {
|
|
|
const map = {
|
|
|
@@ -206,6 +225,7 @@ export default {
|
|
|
this.drawer = Object.assign({}, this.drawer)
|
|
|
},
|
|
|
freshRender() {
|
|
|
+ console.log('on freshRender')
|
|
|
this.render = false
|
|
|
setTimeout(() => {
|
|
|
this.render = true
|