index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. <!-- -->
  2. <template>
  3. <div class="body">
  4. <!-- 标题栏-->
  5. <div class="topDiv">
  6. <div class="logoDiv">
  7. <img width="160px" height="30px" src="@/assets/logo/logo.png" />
  8. <el-divider direction="vertical" style="margin-top: 5px"></el-divider>
  9. <el-cascader
  10. :options="orgOptions"
  11. v-model="orgCascaderSelectedIds"
  12. :props="{ checkStrictly: true, value: 'id', label: 'shortName' }"
  13. :show-all-levels="false"
  14. class="org-cascader"
  15. popper-class="board-org-popper"
  16. @change="handOrgChange"
  17. ref="orgCascader"
  18. ></el-cascader>
  19. </div>
  20. <div class="title">
  21. <span>移动安全保卫管理平台项目</span>
  22. </div>
  23. <div class="iconDiv">
  24. <span> {{ time }} {{ getweek() }}</span>
  25. </div>
  26. </div>
  27. <div class="main">
  28. <div>
  29. <div>
  30. <resumptionReport
  31. :orgId="selectedOrg.id"
  32. :maxDiagram="maxDiagram"
  33. :orgName="selectedOrg.name"
  34. />
  35. </div>
  36. <div>
  37. <question :orgId="selectedOrg.id" />
  38. </div>
  39. <div>
  40. <ga38-chart
  41. :orgId="selectedOrg.id"
  42. :maxDiagram="maxDiagram"
  43. :orgName="selectedOrg.name"
  44. />
  45. </div>
  46. </div>
  47. <div>
  48. <div>
  49. <div>
  50. <mapChart :orgId="selectedOrg.id" />
  51. </div>
  52. <div>
  53. <comprehesive-chart :orgId="selectedOrg.id" />
  54. </div>
  55. </div>
  56. </div>
  57. <div>
  58. <div>
  59. <safety-check-chart :orgId="selectedOrg.id" />
  60. </div>
  61. <div>
  62. <drill-chart
  63. :orgId="selectedOrg.id"
  64. :maxDiagram="maxDiagram"
  65. :orgName="selectedOrg.name"
  66. />
  67. </div>
  68. <div>
  69. <eduChart
  70. :orgId="selectedOrg.id"
  71. :maxDiagram="maxDiagram"
  72. :orgName="selectedOrg.name"
  73. />
  74. </div>
  75. <!-- <div>
  76. <div>
  77. <safetyIndex :orgId="selectedOrg.id" />
  78. </div>
  79. </div> -->
  80. </div>
  81. </div>
  82. </div>
  83. </template>
  84. <script>
  85. import { mapGetters } from "vuex";
  86. import resumptionReport from "./charts/resumption/report.vue";
  87. import question from "./charts/question/report.vue";
  88. import mapChart from "./charts/map/report.vue";
  89. // import orgStatis from "./charts/org/report.vue";
  90. import ga38Chart from "./charts/ga38/report.vue";
  91. import comprehesiveChart from "./charts/comprehesive/report.vue";
  92. import safetyCheckChart from "./charts/safetycheck/report.vue";
  93. import drillChart from "./charts/drill/report.vue";
  94. import eduChart from "./charts/edu/report.vue";
  95. import dayjs from "dayjs";
  96. import * as api from "@/api/board/cockpit.js";
  97. import "./board.scss";
  98. export default {
  99. props: [],
  100. data() {
  101. return {
  102. time: "",
  103. week: "",
  104. orgTree: [], //分行下拉列表
  105. activeIndex: "0",
  106. selectedOrg: {
  107. id: null,
  108. name: null,
  109. },
  110. maxDiagram: null,
  111. orgCascaderSelectedIds: [],
  112. electricHost: undefined,
  113. api,
  114. };
  115. },
  116. components: {
  117. resumptionReport,
  118. question,
  119. mapChart,
  120. ga38Chart,
  121. comprehesiveChart,
  122. safetyCheckChart,
  123. drillChart,
  124. eduChart,
  125. },
  126. computed: {
  127. ...mapGetters(["orgId", "depTree", "orgName","orgType"]),
  128. orgOptions() {
  129. let deps = this.depTree;
  130. let recursion = (deps) => {
  131. for (let index in deps) {
  132. let dep = deps[index];
  133. if (!dep.children) {
  134. continue;
  135. }
  136. if (dep.children.length === 0) {
  137. delete dep.children;
  138. continue;
  139. }
  140. recursion(dep.children);
  141. }
  142. };
  143. recursion(deps);
  144. // console.info(deps);
  145. return deps;
  146. },
  147. },
  148. watch: {
  149. // depTree: {
  150. // deep:true,
  151. // immediate:true,
  152. // handler(trees) {
  153. // },
  154. // },
  155. },
  156. created() {
  157. this.time = dayjs().format("YYYY-MM-DD HH:mm:ss");
  158. // this.week = this.getweek();
  159. },
  160. mounted() {
  161. // getElectricUrl().then((h) => {
  162. // // let h='10.87.10.105:8090';
  163. // this.electricHost = h;
  164. // Vue.$electricHost = h;
  165. // getCurrentUserInfo().then((r) => {
  166. // if (r.ret != 1) {
  167. // this.$notify.error({
  168. // message: "未获取到登录用户信息",
  169. // });
  170. // return;
  171. // }
  172. // const userInfo = {
  173. // orgId: r.data,
  174. // };
  175. // Vue.$currentUserInfo = userInfo;
  176. // this.getOrgList(userInfo.orgId);
  177. // this.orgtimer = setInterval(() => {
  178. // this.getOrgList(userInfo.orgId);
  179. // }, 1 * 60 * 60 * 1000);
  180. // });
  181. // });
  182. this.selectedOrg = {
  183. id: this.orgId,
  184. name: this.orgName,
  185. };
  186. this.setMaxDiagram(this.orgType)
  187. this.orgCascaderSelectedIds = [this.orgId];
  188. },
  189. beforeDestroy() {
  190. clearInterval(this.orgtimer);
  191. this.orgtimer = null;
  192. },
  193. methods: {
  194. getweek() {
  195. let week = dayjs().day();
  196. switch (week) {
  197. case 1:
  198. return "星期一";
  199. case 2:
  200. return "星期二";
  201. case 3:
  202. return "星期三";
  203. case 4:
  204. return "星期四";
  205. case 5:
  206. return "星期五";
  207. case 6:
  208. return "星期六";
  209. case 0:
  210. return "星期日";
  211. }
  212. },
  213. handOrgChange(id, m, n) {
  214. let checked = this.$refs["orgCascader"].getCheckedNodes(true);
  215. if (!checked || checked.length === 0) {
  216. return;
  217. }
  218. this.selectedOrg = {
  219. id: checked[0].data.id,
  220. name: checked[0].data.shortName,
  221. };
  222. this. setMaxDiagram(checked[0].data.type)
  223. },
  224. setMaxDiagram(type){
  225. if (type == 3) {
  226. this.maxDiagram = 10;
  227. } else {
  228. this.maxDiagram = null;
  229. }
  230. }
  231. },
  232. };
  233. </script>
  234. <style lang="scss" scoped>
  235. .body {
  236. background-image: url(@/assets/board/bg.png);
  237. background-position: 100%;
  238. background-color: rgba(8, 8, 8);
  239. color: white;
  240. /* text-shadow: 0 0 5px #252525; */
  241. font-size: 18px;
  242. height: calc(100vh - 86px);
  243. position: relative;
  244. overflow: hidden;
  245. }
  246. .topDiv {
  247. background-image: url(@/assets/board/title-bg.png);
  248. /* position: absolute; */
  249. z-index: 100;
  250. top: 0;
  251. left: 0;
  252. right: 0;
  253. height: 65px;
  254. display: flex;
  255. background-size: 100% 65px;
  256. justify-content: space-between;
  257. .logoDiv {
  258. padding-top: 0;
  259. padding-top: 10px !important;
  260. display: flex;
  261. width: 30%;
  262. padding-left: 60px;
  263. // img {
  264. // // margin-bottom: 20px;
  265. // }
  266. // ::v-deep .el-divider--vertical {
  267. // margin-left: 16px;
  268. // }
  269. // ::v-deep .el-select {
  270. // // margin-bottom: 30px;
  271. // margin-top: 0;
  272. // width: 120px;
  273. // .el-input--suffix .el-input__inner {
  274. // padding-left: 0;
  275. // }
  276. // }
  277. }
  278. .title {
  279. flex: 1;
  280. text-align: center;
  281. padding-top: 10px;
  282. }
  283. .title > span:first-child {
  284. font-size: 1.5rem;
  285. letter-spacing: 0.3rem;
  286. color: white;
  287. line-height: 35px;
  288. }
  289. .title > div:last-child {
  290. line-height: 35px;
  291. /* width: 300px; */
  292. margin-top: -20px;
  293. margin-left: auto;
  294. margin-right: auto;
  295. }
  296. .iconDiv {
  297. text-align: right;
  298. padding-right: 4rem;
  299. padding-top: 1rem;
  300. font-size: 16px;
  301. width: 30%;
  302. }
  303. .iconDiv > span {
  304. margin-left: 5px;
  305. margin-right: 5px;
  306. }
  307. // .iconDiv > span .exit_btn {
  308. // // background: url("../../../public/images/exit.png") no-repeat left center;
  309. // // background-size: 20px 24px;
  310. // padding-left: 25px;
  311. // color: #fff;
  312. // text-decoration: none;
  313. // cursor: pointer;
  314. // }
  315. // .iconDiv > span .exit_btn:hover {
  316. // text-decoration: underline;
  317. // }
  318. }
  319. .main {
  320. padding: 0 20px;
  321. padding-top: 5px;
  322. height: calc(100% - 65px);
  323. display: flex;
  324. flex-direction: row;
  325. justify-content: space-between;
  326. ::v-deep .el-tabs__nav-wrap::after {
  327. height: 1 !important;
  328. background-color: #424040;
  329. }
  330. ::v-deep .el-tabs__item {
  331. color: #8e949c;
  332. padding: 0 5px;
  333. font-size: 12px;
  334. &:hover {
  335. color: #ffffff;
  336. }
  337. }
  338. ::v-deep .el-tabs {
  339. .is-active {
  340. color: #ffffff;
  341. }
  342. .el-tabs__header {
  343. margin: 0 0 8px;
  344. }
  345. .el-tabs__active-bar {
  346. background-color: #2754dd;
  347. }
  348. .el-tabs__nav-scroll {
  349. display: flex;
  350. justify-content: center;
  351. }
  352. }
  353. & > div {
  354. //height: calc(100% - 100px);
  355. & > div {
  356. // border: 1px solid rgba(0, 217, 255, 0.25);
  357. // background-color: rgba(0, 119, 255, 0.06);
  358. // border-radius: 8px;
  359. margin: 0.5rem;
  360. background-image: url(@/assets/board/area_border.png);
  361. background-size: 100% 100%;
  362. display: flex;
  363. flex-direction: column;
  364. height: 100%;
  365. }
  366. &:first-child {
  367. display: flex;
  368. flex-direction: column;
  369. height: 100%;
  370. width: 27%;
  371. & > div {
  372. width: calc(100% - 10px);
  373. }
  374. & > div:first-child {
  375. // border: none;
  376. // border-radius: 0px;
  377. display: flex;
  378. flex-direction: row;
  379. justify-content: space-between;
  380. height: calc(33% - 16px);
  381. // padding: 0;
  382. // margin-bottom: 0px;
  383. // padding-bottom: 10px;
  384. // & > div {
  385. // width: 49.2%;
  386. // & > div {
  387. // width: 100%;
  388. // height: 100%;
  389. // padding: 0.5rem 1rem;
  390. // border: 1px solid rgba(0, 217, 255, 0.25);
  391. // background-color: rgba(0, 119, 255, 0.06);
  392. // border-radius: 8px;
  393. // & > p {
  394. // text-align: center;
  395. // font-size: 16px;
  396. // }
  397. // }
  398. // }
  399. }
  400. & > div:nth-child(2) {
  401. // width: 100%;
  402. height: calc(34% - 16px);
  403. display: flex;
  404. justify-content: space-between;
  405. // border: none;
  406. // padding: 0;
  407. }
  408. & > div:nth-child(3) {
  409. // width: 100%;
  410. height: calc(33% - 16px);
  411. display: flex;
  412. justify-content: space-between;
  413. // border: none;
  414. // padding: 0;
  415. }
  416. }
  417. &:nth-child(2) {
  418. display: flex;
  419. flex-direction: column;
  420. height: 100%;
  421. width: 46%;
  422. & > div {
  423. width: calc(100% - 10px);
  424. }
  425. .el-divider {
  426. background-color: #1c326a;
  427. }
  428. .el-divider--horizontal {
  429. margin: 10px 0;
  430. }
  431. & > div:first-child {
  432. height: calc(100%);
  433. display: flex;
  434. flex-direction: column;
  435. // padding: 0.5rem 1rem;
  436. overflow: hidden;
  437. & > div:first-child {
  438. width: 100%;
  439. height: 75%;
  440. }
  441. & > div:nth-child(2) {
  442. height: calc(25%);
  443. }
  444. }
  445. }
  446. &:nth-child(3) {
  447. width: 27%;
  448. & > div:first-child {
  449. width: 100%;
  450. height: calc(33% - 16px);
  451. // & > div {
  452. // height: calc(100% - 21px);
  453. // }
  454. }
  455. & > div:nth-child(2) {
  456. width: 100%;
  457. height: calc(34% - 16px);
  458. // & > div {
  459. // height: calc(100% - 21px);
  460. // }
  461. }
  462. & > div:nth-child(3) {
  463. width: 100%;
  464. height: calc(33% - 16px);
  465. // & > div {
  466. // height: calc(100% - 21px);
  467. // }
  468. }
  469. // & > div:nth-child(3) {
  470. // width: 100%;
  471. // height: 34%;
  472. // & > div {
  473. // height: calc(100% - 21px);
  474. // }
  475. // }
  476. }
  477. }
  478. }
  479. .org-cascader {
  480. margin-top: -5px;
  481. width: 180px;
  482. ::v-deep .el-input__inner {
  483. background-color: transparent !important;
  484. border: none !important;
  485. color: rgb(230, 230, 230);
  486. font-size: 16px;
  487. }
  488. }
  489. </style>
  490. <style lang="scss">
  491. .board-org-popper {
  492. .el-cascader-menu__wrap {
  493. height: auto !important;
  494. }
  495. .el-scrollbar__wrap {
  496. overflow: auto;
  497. }
  498. }
  499. </style>