main.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <template>
  2. <div class="main-data data-official">
  3. <div class="left">
  4. <div class="left-cont" v-if="leftShow">
  5. <div
  6. class="left-top"
  7. @click="showDialog(1)"
  8. @mouseover="showDialog(1)"
  9. >
  10. <div class="cont-title-area">
  11. <img
  12. class="cont-title-bg"
  13. src="@/assets/images/main/cont_title_bg.png"
  14. alt=""
  15. />
  16. <div class="cont-title">各单位终端数据</div>
  17. </div>
  18. <div class="components-item bg2">
  19. <terminal-data :key="appOrg"></terminal-data>
  20. </div>
  21. </div>
  22. <div class="left-bottom">
  23. <div class="cont-title-area">
  24. <img
  25. class="cont-title-bg"
  26. src="@/assets/images/main/cont_title_bg.png"
  27. alt=""
  28. />
  29. <div class="cont-title">公务用车资源情况</div>
  30. </div>
  31. <div class="components-item">
  32. <car-stock :key="appOrg"></car-stock>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="middle" style="">
  38. <img
  39. v-if="showLocal"
  40. class="build"
  41. src="@/assets/images/build.png"
  42. alt=""
  43. />
  44. <!-- 返回按钮 -->
  45. <div class="bottom-area flex-row align-items-center space-between">
  46. <div class="bottom-left flex-row align-items-center">
  47. <div class="left-item">
  48. <el-cascader
  49. v-model="curCompany"
  50. :options="company"
  51. @change="handleCompanyChange"
  52. placeholder="单位"
  53. :show-all-levels="false"
  54. >
  55. <template slot-scope="{ node, data }">
  56. <div style="display: flex; align-items: center">
  57. <img
  58. v-if="data.label == '山西省公司(本部)'"
  59. src="../../../assets/images/main/tiaozhuanlouyu.png"
  60. style="width: 15px; margin-right: 10px"
  61. />
  62. <span
  63. v-else-if="data.value == '1A001' || data.value == '1A002' || data.value == '1A004' || data.value == '1A005'"
  64. style="
  65. display: inline-block;
  66. width: 10px;
  67. height: 10px;
  68. border-radius: 50%;
  69. margin-right: 10px;
  70. background: rgb(255, 180, 74);
  71. "
  72. ></span>
  73. <span
  74. v-else-if="data.value.length == 5 && data.value != '10001'"
  75. style="
  76. display: inline-block;
  77. width: 10px;
  78. height: 10px;
  79. border-radius: 50%;
  80. margin-right: 10px;
  81. background: rgb(74, 194, 29);
  82. "
  83. ></span>
  84. <span
  85. v-else-if="data.value.length == 7"
  86. style="
  87. display: inline-block;
  88. width: 10px;
  89. height: 10px;
  90. border-radius: 50%;
  91. margin-right: 10px;
  92. background: rgb(99, 235, 255);
  93. "
  94. ></span>
  95. <span>{{ data.label }}</span>
  96. </div>
  97. <!-- <div
  98. v-if="data.level == 2"
  99. style="width: 1.5vh;height: 1.5vh;background-color: red;border-radius: 60%;margin-top:10px;margin-left:10px;float:right"
  100. ></div> -->
  101. </template>
  102. </el-cascader>
  103. </div>
  104. <div class="office" disabled>办公区</div>
  105. </div>
  106. <div class="bottom-right">
  107. <img
  108. v-if="showBack"
  109. @click="onBack"
  110. src="@/assets/images/main/back.png"
  111. class="back"
  112. />
  113. </div>
  114. </div>
  115. </div>
  116. <div class="right" @click="chooseCost">
  117. <div class="right-cont" v-if="rightShow">
  118. <div
  119. class="right-top"
  120. >
  121. <div class="cont-title-area">
  122. <img
  123. class="cont-title-bg"
  124. src="@/assets/images/main/cont_title_bg.png"
  125. alt=""
  126. />
  127. <div class="cont-title">监控管理</div>
  128. </div>
  129. <div class="components-item">
  130. <car-warning :key="appOrg"></car-warning>
  131. </div>
  132. </div>
  133. <div class="right-bottom" @mouseover="showDialog(4)">
  134. <div class="cont-title-area">
  135. <img
  136. class="cont-title-bg"
  137. src="@/assets/images/main/cont_title_bg.png"
  138. alt=""
  139. />
  140. <div class="cont-title">成本管理</div>
  141. </div>
  142. <div class="components-item bg2">
  143. <car-terminal :key="appOrg"></car-terminal>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. <!--弹出层-->
  149. <div
  150. :class="dialogType < 3 ? 'dialog' : 'dialog-r'"
  151. v-if="dialogShow"
  152. @click="closeDialog"
  153. >
  154. <terminal-data-dialog
  155. v-if="dialogType === 1"
  156. @choose="chooseRes"
  157. @chooseH="chooseHealth"
  158. @closeDialog="closeDialog"
  159. ></terminal-data-dialog>
  160. <car-warning-dialog
  161. v-if="dialogType === 4"
  162. @choose="chooseCost"
  163. @closeDialog="closeDialog"
  164. ></car-warning-dialog>
  165. </div>
  166. <div v-if="showC" class="dialog-2">
  167. <div class="dialog-center">
  168. <resource-list
  169. v-if="showRes === 1"
  170. @close="onCloseRes"
  171. ></resource-list>
  172. <car-cost
  173. v-if="showCost === 1"
  174. @close="onCloseCost"
  175. ></car-cost>
  176. <car-health
  177. v-if="showHealth === 1"
  178. @close="onCloseHealth"
  179. ></car-health>
  180. </div>
  181. </div>
  182. </div>
  183. </template>
  184. <script>
  185. import ResourceList from '@/views/screen/official/resourceList.vue'
  186. import Province from "../map/province.vue";
  187. import TerminalData from "./terminalData.vue";
  188. import TerminalDataDialog from "./terminalDataDialog.vue";
  189. import TerminalOnline from "./terminalOnline.vue";
  190. import CarWarning from "./carWarning.vue";
  191. import CarWarningDialog from "./carWarningDialog.vue";
  192. import CarStock from "../logistics/car/carStock.vue";
  193. import CarTerminal from "../logistics/car/carTerminal.vue";
  194. import company from "@/views/screen/data/company.json";
  195. import CarCost from '@/views/screen/official/carCost.vue'
  196. import CarHealth from '@/views/screen/official/carHealth.vue'
  197. export default {
  198. name: "OfficialMain",
  199. components: {
  200. CarHealth,
  201. CarCost,
  202. ResourceList,
  203. Province,
  204. TerminalData,
  205. TerminalOnline,
  206. CarWarning,
  207. CarStock,
  208. CarTerminal,
  209. TerminalDataDialog,
  210. CarWarningDialog,
  211. },
  212. // props: {
  213. // appOrg: {
  214. // type: String,
  215. // default: "0000",
  216. // },
  217. // },
  218. watch:{
  219. appOrg(newValue,oldValue){
  220. this.resetData();
  221. },
  222. },
  223. data() {
  224. return {
  225. showC:false,
  226. showRes:0,
  227. showCost:0,
  228. showHealth:0,
  229. leftShow: true,
  230. rightShow: true,
  231. dialogShow: false,
  232. dialogType: 1,
  233. curDeep: 1,
  234. showBack: false,
  235. showMap: true,
  236. showLocal: false,
  237. appOrg: "0000",
  238. curCompany: [],
  239. company: company,
  240. };
  241. },
  242. created() {},
  243. destroyed() {},
  244. beforeDestroy() {},
  245. mounted() {},
  246. methods: {
  247. chooseRes(){
  248. this.closeDialog()
  249. this.showC = true
  250. this.showRes = 1
  251. },
  252. onCloseRes(){
  253. this.showC = false
  254. this.showRes = 0
  255. },
  256. chooseCost(){
  257. this.closeDialog()
  258. this.showC = true
  259. this.showCost = 1
  260. },
  261. onCloseCost(){
  262. this.showC = false
  263. this.showCost = 0
  264. },
  265. chooseHealth(){
  266. this.closeDialog()
  267. this.showC = true
  268. this.showHealth = 1
  269. },
  270. onCloseHealth(){
  271. this.showC = false
  272. this.showHealth = 0
  273. },
  274. showDialog(type) {
  275. if (type < 4) {
  276. this.leftShow = false;
  277. this.rightShow = true;
  278. } else {
  279. this.rightShow = false;
  280. this.leftShow = true;
  281. }
  282. this.dialogShow = true;
  283. this.dialogType = type;
  284. },
  285. closeDialog() {
  286. this.leftShow = true;
  287. this.rightShow = true;
  288. this.dialogShow = false;
  289. },
  290. //点击地图事件
  291. onMapClick(e) {
  292. this.curDeep = e.deep;
  293. if (e.deep > 1) {
  294. this.showBack = true;
  295. } else {
  296. this.showBack = false;
  297. }
  298. //点击山西省本部
  299. if (e.name == "山西省公司(本部)") {
  300. this.showMap = false;
  301. this.showLocal = true;
  302. this.curCompany = ["10001", "10001"];
  303. this.appOrg = "10001";
  304. } else {
  305. this.showMap = true;
  306. this.showLocal = false;
  307. this.curCompany = e.curCompany;
  308. }
  309. //判断是否点击了子单位
  310. if (e.curCompany && e.curCompany.length > 0) {
  311. let appOrg = e.curCompany[e.curCompany.length - 1];
  312. this.appOrg = appOrg;
  313. }
  314. },
  315. //返回操作
  316. onBack() {
  317. this.curDeep = 1;
  318. if (this.curDeep <= 1) {
  319. this.showBack = false;
  320. this.showMap = true;
  321. this.showLocal = false;
  322. this.curCompany = [];
  323. }
  324. this.appOrg = "0000";
  325. this.$refs.province.reloadMap(this.curDeep);
  326. },
  327. //选择公司
  328. handleCompanyChange(e) {
  329. console.log(e);
  330. if (e && e.length > 0) {
  331. if (e[1] == "10001") {
  332. this.showMap = false;
  333. this.showLocal = true;
  334. this.showBack = true;
  335. } else {
  336. this.showMap = true;
  337. this.showLocal = false;
  338. }
  339. let appOrg = e[e.length - 1];
  340. this.appOrg = appOrg;
  341. }
  342. if(e[1] == "1A001" || e[1] == "1A002" || e[1] == "1A004" || e[1] == "1A005"){
  343. this.showMap = true;
  344. this.showLocal = false;
  345. this.showBack = true;
  346. // return;
  347. }
  348. this.$refs.province.chooseUnit(e);
  349. },
  350. },
  351. };
  352. </script>
  353. <style lang="scss">
  354. .data-official {
  355. width: 100%;
  356. height: 100%;
  357. margin: 0 auto;
  358. // background-image: url("../../../assets/images/official_car/bg.jpg");
  359. // background-size: cover;
  360. display: flex;
  361. flex-direction: row;
  362. justify-content: space-between;
  363. .left {
  364. margin: 125px 0 0 40px;
  365. width: 580px;
  366. .left-cont {
  367. width: 100%;
  368. height: 920px;
  369. padding-top: 19px;
  370. background: url("../../../assets/images/main/main_bg.png") no-repeat;
  371. background-size: cover;
  372. }
  373. .components-item {
  374. width: 550px;
  375. height: 389px;
  376. background: url("../../../assets/images/main/components_mid_bg.png")
  377. no-repeat;
  378. background-size: cover;
  379. margin-bottom: 28px;
  380. margin-left: 15px;
  381. overflow: hidden;
  382. }
  383. .components-item.bg2 {
  384. background: url("../../../assets/images/main/components_mid_bg2.png")
  385. no-repeat;
  386. background-size: cover;
  387. }
  388. .left-top {
  389. // width: 550px;
  390. // height: 444px;
  391. // background: url("../../../assets/images/service_new/left_top_2.png")
  392. // no-repeat;
  393. // background-size: cover;
  394. // margin-bottom: 21px;
  395. }
  396. .left-bottom {
  397. // width: 550px;
  398. // height: 444px;
  399. // background: url("../../../assets/images/service_new/left_top_2.png")
  400. // no-repeat;
  401. // background-size: cover;
  402. }
  403. }
  404. .middle {
  405. background: url('../../../assets/camera/public_map.png') no-repeat center;
  406. display: flex;
  407. flex: 1;
  408. align-items: center;
  409. justify-content: center;
  410. padding: 125px 0 0 0px;
  411. position: relative;
  412. .bottom-area {
  413. position: absolute;
  414. right: 50px;
  415. left: 50px;
  416. bottom: 50px;
  417. .bottom-left {
  418. .left-item {
  419. width: 180px;
  420. height: 30px;
  421. background: url("../../../assets/images/main/choose_bg_long.png")
  422. no-repeat;
  423. background-size: cover;
  424. input {
  425. background: rgba(255, 255, 255, 0);
  426. border: none;
  427. color: #00ffff;
  428. }
  429. .el-input__icon {
  430. color: #00ffff;
  431. }
  432. }
  433. .office {
  434. margin-left: 10px;
  435. width: 180px;
  436. height: 30px;
  437. line-height: 30px;
  438. padding-left: 15px;
  439. color: #898989;
  440. background: url("../../../assets/images/main/choose_bg_long.png")
  441. no-repeat;
  442. background-size: cover;
  443. font-size: 14px;
  444. }
  445. }
  446. .bottom-right {
  447. .back {
  448. width: 34px;
  449. height: 30px;
  450. cursor: pointer;
  451. }
  452. }
  453. }
  454. }
  455. .right {
  456. margin: 125px 40px 0 0px;
  457. width: 580px;
  458. .right-cont {
  459. width: 100%;
  460. height: 920px;
  461. padding-top: 19px;
  462. background: url("../../../assets/images/main/main_bg.png") no-repeat;
  463. background-size: cover;
  464. }
  465. .components-item {
  466. width: 550px;
  467. height: 389px;
  468. background: url("../../../assets/images/main/components_mid_bg.png")
  469. no-repeat;
  470. background-size: cover;
  471. margin-bottom: 28px;
  472. margin-left: 15px;
  473. overflow: hidden;
  474. }
  475. .components-item.bg2 {
  476. background: url("../../../assets/images/main/components_mid_bg2.png")
  477. no-repeat;
  478. background-size: cover;
  479. }
  480. .right-top {
  481. // width: 550px;
  482. // height: 444px;
  483. // background: url("../../../assets/images/service_new/left_top_2.png")
  484. // no-repeat;
  485. // background-size: cover;
  486. // margin-bottom: 21px;
  487. }
  488. .right-bottom {
  489. // width: 550px;
  490. // height: 444px;
  491. // background: url("../../../assets/images/service_new/left_top_2.png")
  492. // no-repeat;
  493. // background-size: cover;
  494. }
  495. }
  496. .cont-title-area {
  497. display: flex;
  498. flex-direction: row;
  499. align-items: center;
  500. justify-content: center;
  501. position: relative;
  502. margin-bottom: 10px;
  503. img {
  504. width: 284px;
  505. height: 32px;
  506. }
  507. .cont-title {
  508. font-size: 20px;
  509. font-weight: 900;
  510. font-family: "PingFangSC";
  511. width: 100%;
  512. position: absolute;
  513. display: flex;
  514. align-items: center;
  515. justify-content: center;
  516. top: -5px;
  517. color: #fff;
  518. }
  519. }
  520. .dialog {
  521. position: fixed;
  522. top: 125px;
  523. left: 40px;
  524. z-index: 10;
  525. width: 100%;
  526. }
  527. .dialog-r {
  528. position: fixed;
  529. top: 125px;
  530. right: 40px;
  531. z-index: 10;
  532. width: 100%;
  533. display: flex;
  534. justify-content: flex-end;
  535. }
  536. .dialog-2 {
  537. position: fixed;
  538. left: 0;
  539. top: 0;
  540. right: 0;
  541. bottom: 0;
  542. z-index: 9999;
  543. display: flex;
  544. flex-direction: row;
  545. align-items: center;
  546. justify-content: center;
  547. background: rgba(0, 0, 0, 0.7);
  548. }
  549. .build {
  550. margin: 0 auto;
  551. width: 90%;
  552. height: auto;
  553. object-fit: contain;
  554. }
  555. ::-webkit-scrollbar {
  556. width: 3px;
  557. height: 3px;
  558. }
  559. ::-webkit-scrollbar-thumb {
  560. //滑块部分
  561. // border-radius: 5px;
  562. background-color: #58cbbb;
  563. }
  564. ::-webkit-scrollbar-track {
  565. //轨道部分
  566. // box-shadow: inset 0 0 5px #ddd;
  567. background: #ddd;
  568. // border-radius: 5px;
  569. }
  570. }
  571. </style>