index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <div class="dashboard-container" v-if="render">
  3. <div class="header">
  4. <div class="title">
  5. 变电配电大数据可视化系统
  6. </div>
  7. <div class="r-title">
  8. {{ dateTitle }}
  9. </div>
  10. </div>
  11. <div class="content-wrap">
  12. <div class="coner left">
  13. <div class="o-item map">
  14. <ChartMap/>
  15. <div class="jryl-wrap">
  16. <CardWrap>
  17. <span slot="title" @click="openDrawer('变电-电力异常信息')">今日遗留</span>
  18. <div slot="content">
  19. <Jryl/>
  20. </div>
  21. </CardWrap>
  22. </div>
  23. </div>
  24. <div class="o-item">
  25. <CardWrap>
  26. <span slot="title" @click="openDrawer('试验计划本月兑现情况')">试验计划兑现情况</span>
  27. <div slot="content">
  28. <SyjhdxqkChart/>
  29. </div>
  30. </CardWrap>
  31. </div>
  32. <div class="o-item">
  33. <CardWrap>
  34. <span slot="title" @click="openDrawer('电力远动调试本月兑现情况')">电力远动调试兑现情况</span>
  35. <div slot="content">
  36. <Dlydtssx/>
  37. </div>
  38. </CardWrap>
  39. </div>
  40. <div class="o-item b-r-3">
  41. <div class="t-1">
  42. <CardWrap>
  43. <span slot="title" @click="openDrawer('电力远动调试本月兑现情况')">电力受电线路</span>
  44. <div slot="content">
  45. <Dlsdxl/>
  46. </div>
  47. </CardWrap>
  48. </div>
  49. <div class="t-2">
  50. <CardWrap>
  51. <span slot="title" @click="openDrawer('电力远动调试本月兑现情况')">电力变配电所</span>
  52. <div slot="content">
  53. <Dlbpds/>
  54. </div>
  55. </CardWrap>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="coner right">
  60. <div class="sop sop-1">
  61. <CardWrap>
  62. <span slot="title" @click="openDrawer('待办事项')">重要待办事项</span>
  63. <div slot="content">
  64. <Zydbsx/>
  65. </div>
  66. </CardWrap>
  67. </div>
  68. <div class="sop sop-2">
  69. <CardWrap>
  70. <span slot="title" @click="openDrawer('检修兑现情况')">检修兑现情况</span>
  71. <div slot="content">
  72. <Jxdxqk/>
  73. </div>
  74. </CardWrap>
  75. </div>
  76. <div class="sop sop-3">
  77. <CardWrap>
  78. <span slot="title" @click="openDrawer('设备巡检兑现情况')">牵变、电力设备巡视兑现(本月)</span>
  79. <div slot="content">
  80. <QbDlsbxjdx/>
  81. </div>
  82. </CardWrap>
  83. </div>
  84. </div>
  85. </div>
  86. <el-drawer
  87. custom-class="drawer-wrap"
  88. :title="drawer.title"
  89. :visible.sync="drawer.visible"
  90. :with-header="true"
  91. size="100%"
  92. :direction="drawer.direction"
  93. >
  94. <component :is="drawer.comp"/>
  95. </el-drawer>
  96. </div>
  97. </template>
  98. <script>
  99. import CardWrap from '@/views/dashboard-screen/chard-wrap/card-wrap.vue'
  100. import SyjhdxqkChart from '@/views/dashboard-screen/syjhdxqk/index.vue'
  101. import Dlydtssx from '@/views/dashboard-screen/dlydtssx/index.vue'
  102. import Dlsdxl from '@/views/dashboard-screen/dlsdxl/index.vue'
  103. import Dlbpds from '@/views/dashboard-screen/dlbpds/index.vue'
  104. import Zydbsx from '@/views/dashboard-screen/zydbsx/index.vue'
  105. import Jxdxqk from '@/views/dashboard-screen/jxdxqk/index.vue'
  106. import QbDlsbxjdx from '@/views/dashboard-screen/qb-dlsbxjdx/index.vue'
  107. import Jryl from '@/views/dashboard-screen/jryl/index.vue'
  108. import ChartMap from '@/views/dashboard-screen/chart-map/chartMap.vue'
  109. import dayjs from 'dayjs'
  110. import ScreenBdDlYcxx from '@/views/dashboard-screen/screen/screen_Bd_Dl_Ycxx/ScreenBdDlYcxx.vue'
  111. import ScreenJxdxqk from '@/views/dashboard-screen/screen/screenJxdxqk.vue'
  112. import ScreenSyjhbydxqk from '@/views/dashboard-screen/screen/ScreenSyjhbydxqk.vue'
  113. import ScreenDbsx from '@/views/dashboard-screen/screen/screenDbsx/ScreenDbsx.vue'
  114. import ScreenDlts from '@/views/dashboard-screen/screen/screenDlts/screenDlts.vue'
  115. import ScreenSbxjdxqk from '@/views/dashboard-screen/screen/screenSbxjdxqk/screenSbxjdxqk.vue'
  116. import * as _ from 'lodash'
  117. require('dayjs/locale/zh-cn')
  118. export default {
  119. name: 'Dashboard',
  120. components: {ChartMap, Jryl, QbDlsbxjdx, Jxdxqk, Zydbsx, Dlbpds, Dlsdxl, CardWrap, SyjhdxqkChart, Dlydtssx},
  121. data() {
  122. return {
  123. render: true,
  124. dateTitle: dayjs().locale('zh-cn').format('YYYY年MM月DD日 d'),
  125. drawer: {
  126. title: '',
  127. visible: false,
  128. direction: 'btt',
  129. comp: null
  130. }
  131. }
  132. },
  133. watch: {
  134. $route: {
  135. handler: (route) => {
  136. // this.redirect = route.query && route.query.redirect
  137. },
  138. immediate: true
  139. }
  140. },
  141. created() {
  142. const doResize = _.debounce(() => {
  143. console.log('doResize')
  144. this.render = false;
  145. setTimeout(() => {
  146. this.render = true
  147. }, 100)
  148. }, 500)
  149. window.addEventListener('resize', doResize)
  150. setInterval(() => {
  151. this.dateTitle = dayjs().locale('zh-cn').format('YYYY年MM月DD日 星期dd')
  152. }, 1000)
  153. },
  154. methods: {
  155. openDrawer(title) {
  156. const map = {
  157. '检修兑现情况': ScreenJxdxqk,
  158. '变电-电力异常信息': ScreenBdDlYcxx,
  159. '试验计划本月兑现情况': ScreenSyjhbydxqk,
  160. '待办事项': ScreenDbsx,
  161. '电力远动调试本月兑现情况': ScreenDlts,
  162. '设备巡检兑现情况': ScreenSbxjdxqk
  163. }
  164. this.drawer.title = title
  165. this.drawer.visible = true
  166. this.drawer.comp = map[title]
  167. this.drawer = Object.assign({}, this.drawer)
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. @font-face {
  174. font-family: "hxb";
  175. src: url("hxb.woff2") format('woff2'),;
  176. font-weight: 400;
  177. font-style: normal;
  178. }
  179. @font-face {
  180. font-family: "shr";
  181. src: url("shr.woff2") format('woff2'),;
  182. font-weight: 400;
  183. font-style: normal;
  184. }
  185. * {
  186. font: 400 auto shr;
  187. }
  188. .hxbFont {
  189. font: 400 auto hxb;
  190. }
  191. .dashboard-container {
  192. width: 100%;
  193. height: 100%;
  194. min-height: fit-content;
  195. //min-width: 1920px;
  196. display: flex;
  197. flex-direction: column;
  198. align-items: flex-start;
  199. justify-content: flex-start;
  200. background-image: url("/static/images/bg.png");
  201. background-repeat: no-repeat;
  202. background-size: cover;
  203. .header {
  204. width: 100%;
  205. height: 88px;
  206. flex-shrink: 0;
  207. background-image: url("/static/images/header@2x.png");
  208. background-repeat: no-repeat;
  209. background-size: 100% 100%;
  210. display: flex;
  211. .title {
  212. width: 30%;
  213. height: 100%;
  214. flex-shrink: 0;
  215. display: flex;
  216. align-items: center;
  217. justify-content: center;
  218. font-size: 36px;
  219. font-weight: bold;
  220. color: white;
  221. }
  222. .r-title {
  223. height: 100%;
  224. display: flex;
  225. align-items: center;
  226. justify-content: center;
  227. margin-left: auto;
  228. width: fit-content;
  229. padding-right: 3vw;
  230. font-size: 36px;
  231. font-weight: bold;
  232. color: white;
  233. font: normal 36px hxb;
  234. }
  235. }
  236. .content-wrap {
  237. width: 100%;
  238. height: 100%;
  239. flex-grow: 1;
  240. display: flex;
  241. .coner {
  242. &.left {
  243. flex: 6.3;
  244. flex-shrink: 0;
  245. height: 100%;
  246. display: grid;
  247. grid-template-rows: 2fr 1fr;
  248. grid-template-columns: 1fr 1fr 2fr;
  249. grid-auto-flow: row;
  250. .o-item {
  251. &.map {
  252. grid-column-start: 1;
  253. grid-column-end: 5;
  254. position: relative;
  255. .jryl-wrap {
  256. width: 25%;
  257. height: 20vh;
  258. position: absolute;
  259. z-index: 1;
  260. bottom: 0;
  261. left: 0;
  262. }
  263. }
  264. &.b-r-3 {
  265. display: flex;
  266. flex-direction: column;
  267. align-items: flex-start;
  268. justify-content: flex-start;
  269. .t-1 {
  270. flex: 1.5;
  271. width: 100%;
  272. flex-shrink: 0;
  273. }
  274. .t-2 {
  275. flex: 1;
  276. width: 100%;
  277. flex-shrink: 0;
  278. }
  279. }
  280. }
  281. }
  282. &.right {
  283. flex: 1.3;
  284. flex-shrink: 0;
  285. overflow: hidden;
  286. width: 100%;
  287. height: 100%;
  288. display: flex;
  289. flex-direction: column;
  290. .sop {
  291. width: 100%;
  292. height: 100%;
  293. flex-direction: 0;
  294. overflow: hidden;
  295. //border: 1px solid teal;
  296. &.sop-1 {
  297. flex: 1.5;
  298. ::v-deep {
  299. .card-wrap {
  300. .content {
  301. height: calc(100% - 20px);
  302. overflow-y: auto;
  303. }
  304. }
  305. }
  306. }
  307. &.sop-2 {
  308. flex: 1.2
  309. }
  310. &.sop-3 {
  311. flex: 2
  312. }
  313. }
  314. }
  315. }
  316. }
  317. }
  318. ::v-deep {
  319. .drawer-wrap {
  320. background-image: url("/static/images/bg.png");
  321. background-repeat: no-repeat;
  322. background-size: cover;
  323. header {
  324. color: #fff;
  325. font-size: 1.3vw;
  326. span {
  327. outline: none !important;
  328. }
  329. }
  330. }
  331. }
  332. </style>