index.vue 11 KB

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