index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  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="selectedOrg.id"
  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 }} {{ week }}</span>
  25. <span>|</span>
  26. </div>
  27. </div>
  28. <div class="main">
  29. <div>
  30. <div>
  31. <resumptionReport :orgId="selectedOrg.id" :api="api.resumption" title="日常安全履职" />
  32. </div>
  33. <div>
  34. <resumptionReport :orgId="selectedOrg.id" :api="api.monitor" title="监控调阅" />
  35. </div>
  36. <div>
  37. <resumptionReport :orgId="selectedOrg.id" :api="api.safetyCheck" title="日常安全检查" />
  38. </div>
  39. </div>
  40. <div>
  41. <div>
  42. <div>
  43. <mapChart :orgId="selectedOrg.id" :orgName="selectedOrg.name" />
  44. </div>
  45. <div>
  46. <orgStatis :orgId="selectedOrg.id" />
  47. </div>
  48. </div>
  49. </div>
  50. <div>
  51. <div>
  52. <question :orgId="selectedOrg.id" />
  53. </div>
  54. <div>
  55. <resumptionReport :orgId="selectedOrg.id" :api="api.drill" title="预案演练" />
  56. </div>
  57. <div>
  58. <resumptionReport :orgId="selectedOrg.id" :api="api.edu" title="教育培训" />
  59. </div>
  60. <!-- <div>
  61. <div>
  62. <safetyIndex :orgId="selectedOrg.id" />
  63. </div>
  64. </div> -->
  65. </div>
  66. </div>
  67. </div>
  68. </template>
  69. <script>
  70. import { mapGetters } from "vuex";
  71. import resumptionReport from "./charts/resumption/report_bar.vue";
  72. import question from "./charts/question/report.vue";
  73. import mapChart from "./charts/map/report.vue";
  74. import orgStatis from "./charts/org/report.vue";
  75. import dayjs from "dayjs";
  76. import * as api from '@/api/board/cockpit.js'
  77. import "./board.scss";
  78. export default {
  79. props: [],
  80. data() {
  81. return {
  82. time: "",
  83. week: "",
  84. orgTree: [], //分行下拉列表
  85. activeIndex: "0",
  86. selectedOrg: {
  87. id: null,
  88. name: null,
  89. },
  90. electricHost: undefined,
  91. api
  92. };
  93. },
  94. components: {
  95. resumptionReport,
  96. question,
  97. mapChart,
  98. orgStatis,
  99. },
  100. computed: {
  101. ...mapGetters(["orgId", "depTree", "orgName"]),
  102. orgOptions() {
  103. let deps = this.depTree;
  104. let recursion = (deps) => {
  105. for (let index in deps) {
  106. let dep = deps[index];
  107. if (!dep.children) {
  108. continue;
  109. }
  110. if (dep.children.length === 0) {
  111. delete dep.children;
  112. continue;
  113. }
  114. recursion(dep.children);
  115. }
  116. };
  117. recursion(deps);
  118. // console.info(deps);
  119. return deps;
  120. },
  121. },
  122. watch: {
  123. // depTree: {
  124. // deep:true,
  125. // immediate:true,
  126. // handler(trees) {
  127. // },
  128. // },
  129. },
  130. created() {
  131. this.time = dayjs().format("YYYY-MM-DD HH:mm:ss");
  132. // this.week = this.getweek();
  133. },
  134. mounted() {
  135. // getElectricUrl().then((h) => {
  136. // // let h='10.87.10.105:8090';
  137. // this.electricHost = h;
  138. // Vue.$electricHost = h;
  139. // getCurrentUserInfo().then((r) => {
  140. // if (r.ret != 1) {
  141. // this.$notify.error({
  142. // message: "未获取到登录用户信息",
  143. // });
  144. // return;
  145. // }
  146. // const userInfo = {
  147. // orgId: r.data,
  148. // };
  149. // Vue.$currentUserInfo = userInfo;
  150. // this.getOrgList(userInfo.orgId);
  151. // this.orgtimer = setInterval(() => {
  152. // this.getOrgList(userInfo.orgId);
  153. // }, 1 * 60 * 60 * 1000);
  154. // });
  155. // });
  156. this.selectedOrg = {
  157. id: this.orgId,
  158. name: this.orgName,
  159. };
  160. },
  161. beforeDestroy() {
  162. clearInterval(this.orgtimer);
  163. this.orgtimer = null;
  164. },
  165. methods: {
  166. getweek() {
  167. let week = this.moment().day();
  168. switch (week) {
  169. case 1:
  170. return "星期一";
  171. case 2:
  172. return "星期二";
  173. case 3:
  174. return "星期三";
  175. case 4:
  176. return "星期四";
  177. case 5:
  178. return "星期五";
  179. case 6:
  180. return "星期六";
  181. case 0:
  182. return "星期日";
  183. }
  184. },
  185. handOrgChange(id, m, n) {
  186. let checked = this.$refs["orgCascader"].getCheckedNodes(true);
  187. if (!checked || checked.length === 0) {
  188. return;
  189. }
  190. this.selectedOrg = { ...checked[0].data };
  191. },
  192. // handleSelect(e) {
  193. // var item = this.branchlist.find((o) => o.orgId === parseInt(e));
  194. // this.activeIndex = e;
  195. // this.selectedOrg = { ...item };
  196. // },
  197. // async getOrgList(currentUserOrgId) {
  198. // let r = await getOrgList();
  199. // if (r.ret === 2) {
  200. // this.exitSys();
  201. // } else if (r.ret != 1) {
  202. // this.$notify.error({
  203. // message: `获取机构列表错误:${r.errorMsg}`,
  204. // duration: 20 * 1000,
  205. // });
  206. // return;
  207. // }
  208. // let { data } = r;
  209. // Vue.prototype.$treeList = data;
  210. // const tree = this.genDropdownTree(data, currentUserOrgId);
  211. // if (tree && tree.length > 0) {
  212. // this.selectedOrg = {
  213. // orgId: tree[0].id,
  214. // name: tree[0].label,
  215. // };
  216. // }
  217. // this.orgTree = tree;
  218. // let top = data.find((d) => !data.find((d2) => d2.orgId == d.parentId));
  219. // if (!top) {
  220. // this.$$notify.error({
  221. // message: "未找到顶级机构",
  222. // duration: 20 * 1000,
  223. // });
  224. // return;
  225. // }
  226. // let branchlist = [];
  227. // if (
  228. // top.orgType != dictionary.orgType.firstLevelBranchType &&
  229. // top.orgType != dictionary.orgType.secondLevelBranchType &&
  230. // top.orgType != dictionary.orgType.subBranchType
  231. // ) {
  232. // this.$$notify.error({
  233. // message: "不支持机构类型" + top.orgType,
  234. // duration: 20 * 1000,
  235. // });
  236. // return;
  237. // }
  238. // branchlist.push(top);
  239. // var subOrgType =
  240. // top.orgType == dictionary.orgType.firstLevelBranchType
  241. // ? dictionary.orgType.secondLevelBranchType
  242. // : top.orgType == dictionary.orgType.secondLevelBranchType
  243. // ? dictionary.orgType.subBranchType
  244. // : undefined;
  245. // let subs = data.filter(
  246. // (d) => d.orgId != top.orgId && d.orgType == subOrgType
  247. // );
  248. // this.branchlist = branchlist.concat(subs);
  249. // if (!this.branchlist || this.branchlist.length === 0) {
  250. // this.$notify.error({
  251. // message: "机构列表为空",
  252. // duration: 20 * 1000,
  253. // });
  254. // } else {
  255. // if (!this.selectedOrg) {
  256. // this.selectedOrg = {
  257. // ...this.branchlist[0],
  258. // };
  259. // }
  260. // }
  261. // },
  262. // /**生成下拉树 */
  263. // genDropdownTree(orgList, topOrgId) {
  264. // const orgTypeConst = dictionary.orgType;
  265. // const needOrgTypes = [
  266. // orgTypeConst.firstLevelBranchType,
  267. // orgTypeConst.secondLevelBranchType,
  268. // orgTypeConst.subBranchType,
  269. // ];
  270. // const topOrg = orgList.find((org) => org.orgId == topOrgId);
  271. // var top = { id: topOrg.orgId, label: topOrg.orgName, path: topOrg.path };
  272. // var topTypeIndex = needOrgTypes.indexOf(topOrg.orgType);
  273. // if (topTypeIndex < 0) {
  274. // return [];
  275. // }
  276. // var nodes = [top];
  277. // if (topTypeIndex == needOrgTypes.length - 1) {
  278. // return [top];
  279. // }
  280. // for (var i = topTypeIndex + 1; i < needOrgTypes.length; i++) {
  281. // let tmpNodes = [];
  282. // nodes.forEach((item) => {
  283. // var children = orgList.filter(
  284. // (org) =>
  285. // org.path.startsWith(item.path) && org.orgType == needOrgTypes[i]
  286. // );
  287. // children = children.map((c) => ({
  288. // id: c.orgId,
  289. // label: c.orgName,
  290. // path: c.path,
  291. // }));
  292. // tmpNodes = tmpNodes.concat(children);
  293. // item.children = children;
  294. // });
  295. // nodes = tmpNodes;
  296. // }
  297. // return [top];
  298. // },
  299. // exitSys() {
  300. // this.$alert("确定退出系统吗?", "提示", {
  301. // confirmButtonText: "确定",
  302. // cancelButtonText: "取消",
  303. // showCancelButton: true,
  304. // callback: (r) => {
  305. // if (r === "confirm") {
  306. // logout()
  307. // .then((r) => {
  308. // location.href =
  309. // Vue.$electricHost + "/security/login/sysCenterMain.html";
  310. // })
  311. // .catch((e) => {
  312. // location.href =
  313. // Vue.$electricHost + "/security/login/sysCenterMain.html";
  314. // });
  315. // }
  316. // },
  317. // });
  318. // },
  319. },
  320. };
  321. </script>
  322. <style lang="scss" scoped>
  323. .body {
  324. background-image: url(@/assets/board/bg.png);
  325. background-position: 100%;
  326. background-color: rgba(8, 8, 8);
  327. color: white;
  328. /* text-shadow: 0 0 5px #252525; */
  329. font-size: 18px;
  330. height: calc(100vh - 86px);
  331. position: relative;
  332. overflow: hidden;
  333. }
  334. .topDiv {
  335. background-image: url(@/assets/board/title-bg.png);
  336. /* position: absolute; */
  337. z-index: 100;
  338. top: 0;
  339. left: 0;
  340. right: 0;
  341. height: 65px;
  342. display: flex;
  343. background-size: 100% 65px;
  344. justify-content: space-between;
  345. .logoDiv {
  346. padding-top: 0;
  347. padding-top: 10px !important;
  348. display: flex;
  349. width: 30%;
  350. padding-left: 60px;
  351. // img {
  352. // // margin-bottom: 20px;
  353. // }
  354. // ::v-deep .el-divider--vertical {
  355. // margin-left: 16px;
  356. // }
  357. // ::v-deep .el-select {
  358. // // margin-bottom: 30px;
  359. // margin-top: 0;
  360. // width: 120px;
  361. // .el-input--suffix .el-input__inner {
  362. // padding-left: 0;
  363. // }
  364. // }
  365. }
  366. .title {
  367. flex: 1;
  368. text-align: center;
  369. padding-top: 10px;
  370. }
  371. .title > span:first-child {
  372. font-size: 1.5rem;
  373. letter-spacing: 0.3rem;
  374. color: white;
  375. line-height: 35px;
  376. }
  377. .title > div:last-child {
  378. line-height: 35px;
  379. /* width: 300px; */
  380. margin-top: -20px;
  381. margin-left: auto;
  382. margin-right: auto;
  383. }
  384. .iconDiv {
  385. text-align: right;
  386. padding-right: 2.5rem;
  387. padding-top: 1.5rem;
  388. font-size: 16px;
  389. width: 30%;
  390. }
  391. .iconDiv > span {
  392. margin-left: 5px;
  393. margin-right: 5px;
  394. }
  395. // .iconDiv > span .exit_btn {
  396. // // background: url("../../../public/images/exit.png") no-repeat left center;
  397. // // background-size: 20px 24px;
  398. // padding-left: 25px;
  399. // color: #fff;
  400. // text-decoration: none;
  401. // cursor: pointer;
  402. // }
  403. // .iconDiv > span .exit_btn:hover {
  404. // text-decoration: underline;
  405. // }
  406. }
  407. .main {
  408. padding: 0 20px;
  409. padding-top: 5px;
  410. height: calc(100% - 65px);
  411. display: flex;
  412. flex-direction: row;
  413. justify-content: space-between;
  414. ::v-deep .el-tabs__nav-wrap::after {
  415. height: 1 !important;
  416. background-color: #424040;
  417. }
  418. ::v-deep .el-tabs__item {
  419. color: #8e949c;
  420. padding: 0 5px;
  421. font-size: 12px;
  422. &:hover {
  423. color: #ffffff;
  424. }
  425. }
  426. ::v-deep .el-tabs {
  427. .is-active {
  428. color: #ffffff;
  429. }
  430. .el-tabs__header {
  431. margin: 0 0 8px;
  432. }
  433. .el-tabs__active-bar {
  434. background-color: #2754dd;
  435. }
  436. .el-tabs__nav-scroll {
  437. display: flex;
  438. justify-content: center;
  439. }
  440. }
  441. & > div {
  442. //height: calc(100% - 100px);
  443. & > div {
  444. // border: 1px solid rgba(0, 217, 255, 0.25);
  445. // background-color: rgba(0, 119, 255, 0.06);
  446. // border-radius: 8px;
  447. margin: 0.5rem;
  448. background-image: url(@/assets/board/area_border.png);
  449. background-size: 100% 100%;
  450. display: flex;
  451. flex-direction: column;
  452. height: 100%;
  453. }
  454. &:first-child {
  455. display: flex;
  456. flex-direction: column;
  457. height: 100%;
  458. width: 27%;
  459. & > div {
  460. width: calc(100% - 10px);
  461. }
  462. & > div:first-child {
  463. // border: none;
  464. // border-radius: 0px;
  465. display: flex;
  466. flex-direction: row;
  467. justify-content: space-between;
  468. height: calc(33% - 16px);
  469. // padding: 0;
  470. // margin-bottom: 0px;
  471. // padding-bottom: 10px;
  472. // & > div {
  473. // width: 49.2%;
  474. // & > div {
  475. // width: 100%;
  476. // height: 100%;
  477. // padding: 0.5rem 1rem;
  478. // border: 1px solid rgba(0, 217, 255, 0.25);
  479. // background-color: rgba(0, 119, 255, 0.06);
  480. // border-radius: 8px;
  481. // & > p {
  482. // text-align: center;
  483. // font-size: 16px;
  484. // }
  485. // }
  486. // }
  487. }
  488. & > div:nth-child(2) {
  489. // width: 100%;
  490. height: calc(34% - 16px);
  491. display: flex;
  492. justify-content: space-between;
  493. // border: none;
  494. // padding: 0;
  495. }
  496. & > div:nth-child(3) {
  497. // width: 100%;
  498. height: calc(33% - 16px);
  499. display: flex;
  500. justify-content: space-between;
  501. // border: none;
  502. // padding: 0;
  503. }
  504. }
  505. &:nth-child(2) {
  506. display: flex;
  507. flex-direction: column;
  508. height: 100%;
  509. width: 46%;
  510. & > div {
  511. width: calc(100% - 10px);
  512. }
  513. .el-divider {
  514. background-color: #1c326a;
  515. }
  516. .el-divider--horizontal {
  517. margin: 10px 0;
  518. }
  519. & > div:first-child {
  520. height: calc(100%);
  521. display: flex;
  522. flex-direction: column;
  523. // padding: 0.5rem 1rem;
  524. overflow: hidden;
  525. & > div:first-child {
  526. width: 100%;
  527. height: 80%;
  528. }
  529. & > div:nth-child(2) {
  530. height: calc(20%);
  531. }
  532. }
  533. }
  534. &:nth-child(3) {
  535. width: 27%;
  536. & > div:first-child {
  537. width: 100%;
  538. height: calc(33% - 16px);
  539. // & > div {
  540. // height: calc(100% - 21px);
  541. // }
  542. }
  543. & > div:nth-child(2) {
  544. width: 100%;
  545. height: calc(34% - 16px);
  546. // & > div {
  547. // height: calc(100% - 21px);
  548. // }
  549. }
  550. & > div:nth-child(3) {
  551. width: 100%;
  552. height: calc(33% - 16px);
  553. // & > div {
  554. // height: calc(100% - 21px);
  555. // }
  556. }
  557. // & > div:nth-child(3) {
  558. // width: 100%;
  559. // height: 34%;
  560. // & > div {
  561. // height: calc(100% - 21px);
  562. // }
  563. // }
  564. }
  565. }
  566. }
  567. .org-cascader {
  568. margin-top: -5px;
  569. width: 180px;
  570. ::v-deep .el-input__inner {
  571. background-color: transparent !important;
  572. border: none !important;
  573. color: rgb(230, 230, 230);
  574. font-size: 16px;
  575. }
  576. }
  577. </style>