main.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  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" :resourceData="resourceData" :carTypeNum="carTypeNum" :carActivationNum="carActivationNum" :carUseNum="carUseNum"></terminal-data>
  20. </div>
  21. </div>
  22. <div class="left-bottom"
  23. @click="showDialog(2)"
  24. @mouseover="showDialog(2)"
  25. >
  26. <div class="cont-title-area">
  27. <img
  28. class="cont-title-bg"
  29. src="@/assets/images/main/cont_title_bg.png"
  30. alt=""
  31. />
  32. <div class="cont-title">监控管理</div>
  33. </div>
  34. <div class="components-item bg2">
  35. <car-stock :key="appOrg" :monitorData="monitorData"></car-stock>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="middle">
  41. <img src="@/assets/zhang/publicCar/officialCar.png" width="50" style="position: absolute;top: 125px;left: 20px;cursor: pointer">
  42. <MapTwo @transmit="transmit"></MapTwo>
  43. <!-- <img
  44. v-if="showLocal"
  45. class="build"
  46. src="@/assets/images/build.png"
  47. alt=""
  48. />-->
  49. <!-- 返回按钮 -->
  50. <!-- <div class="bottom-area flex-row align-items-center space-between">
  51. <div class="bottom-left flex-row align-items-center">
  52. <div class="left-item">
  53. <el-cascader
  54. v-model="curCompany"
  55. :options="company"
  56. @change="handleCompanyChange"
  57. placeholder="单位"
  58. :show-all-levels="false"
  59. >
  60. <template slot-scope="{ node, data }">
  61. <div style="display: flex; align-items: center">
  62. <img
  63. v-if="data.label == '山西省公司(本部)'"
  64. src="../../../assets/images/main/tiaozhuanlouyu.png"
  65. style="width: 15px; margin-right: 10px"
  66. />
  67. <span
  68. v-else-if="data.value == '1A001' || data.value == '1A002' || data.value == '1A004' || data.value == '1A005'"
  69. style="
  70. display: inline-block;
  71. width: 10px;
  72. height: 10px;
  73. border-radius: 50%;
  74. margin-right: 10px;
  75. background: rgb(255, 180, 74);
  76. "
  77. ></span>
  78. <span
  79. v-else-if="data.value.length == 5 && data.value != '10001'"
  80. style="
  81. display: inline-block;
  82. width: 10px;
  83. height: 10px;
  84. border-radius: 50%;
  85. margin-right: 10px;
  86. background: rgb(74, 194, 29);
  87. "
  88. ></span>
  89. <span
  90. v-else-if="data.value.length == 7"
  91. style="
  92. display: inline-block;
  93. width: 10px;
  94. height: 10px;
  95. border-radius: 50%;
  96. margin-right: 10px;
  97. background: rgb(99, 235, 255);
  98. "
  99. ></span>
  100. <span>{{ data.label }}</span>
  101. </div>
  102. &lt;!&ndash; <div
  103. v-if="data.level == 2"
  104. style="width: 1.5vh;height: 1.5vh;background-color: red;border-radius: 60%;margin-top:10px;margin-left:10px;float:right"
  105. ></div> &ndash;&gt;
  106. </template>
  107. </el-cascader>
  108. </div>
  109. <div class="office" disabled>办公区</div>
  110. </div>
  111. <div class="bottom-right">
  112. <img
  113. v-if="showBack"
  114. @click="onBack"
  115. src="@/assets/images/main/back.png"
  116. class="back"
  117. />
  118. </div>
  119. </div>-->
  120. </div>
  121. <div class="right">
  122. <div class="right-cont" v-if="rightShow">
  123. <div class="cont-title-area">
  124. <img
  125. class="cont-title-bg"
  126. src="@/assets/images/main/cont_title_bg.png"
  127. alt=""
  128. />
  129. <div class="cont-title">运行管理</div>
  130. </div>
  131. <div class="components-item bg3">
  132. <car-warning :key="appOrg" :manageTopHalf="manageTopHalf" :manageLastHalf="manageLastHalf" v-if="this.flag >= 2"></car-warning>
  133. </div>
  134. </div>
  135. </div>
  136. <!--弹出层-->
  137. <div
  138. :class="dialogType < 3 ? 'dialog' : 'dialog-r'"
  139. v-if="dialogShow"
  140. @click="closeDialog"
  141. >
  142. <terminal-data-dialog
  143. v-if="dialogType === 1"
  144. :resourceData="resourceData" :carTypeNum="carTypeNum" :carActivationNum="carActivationNum" :carUseNum="carUseNum"
  145. @chooseX="chooseCost"
  146. @chooseY="chooseHealth"
  147. @closeDialog="closeDialog"
  148. ></terminal-data-dialog>
  149. <car-warning-dialog
  150. v-if="dialogType === 4"
  151. @choose="chooseCost"
  152. @closeDialog="closeDialog"
  153. ></car-warning-dialog>
  154. <car-stock-dialog
  155. v-if="dialogType === 2"
  156. :monitorData="monitorData"
  157. @chooseX="chooseOp('未带工单预警数')"
  158. @chooseY="chooseOp('超速预警数')"
  159. @chooseZ="chooseOp('节假日预警数')"
  160. @closeDialog="closeDialog"
  161. ></car-stock-dialog>
  162. </div>
  163. <div v-if="showC" class="dialog-2">
  164. <div class="dialog-center">
  165. <resource-list
  166. v-if="showRes === 1"
  167. :op = "op"
  168. @close="onCloseRes"
  169. ></resource-list>
  170. <car-cost
  171. v-if="showCost === 1"
  172. @close="onCloseCost"
  173. ></car-cost>
  174. <car-health
  175. v-if="showHealth === 1"
  176. @close="onCloseHealth"
  177. ></car-health>
  178. </div>
  179. </div>
  180. </div>
  181. </template>
  182. <script>
  183. import ResourceList from '@/views/screen/official/resourceList.vue'
  184. import Province from "../map/province.vue";
  185. import TerminalData from "./terminalData.vue";
  186. import TerminalDataDialog from "./terminalDataDialog.vue";
  187. import TerminalOnline from "./terminalOnline.vue";
  188. import CarWarning from "./carWarning.vue";
  189. import CarWarningDialog from "./carWarningDialog.vue";
  190. import CarStock from "../logistics/car/carStock.vue";
  191. import CarTerminal from "../logistics/car/carTerminal.vue";
  192. import company from "@/views/screen/data/company.json";
  193. import CarCost from '@/views/screen/official/carCost.vue'
  194. import CarHealth from '@/views/screen/official/carHealth.vue'
  195. import CarStockDialog from "@/views/screen/logistics/car/carStockDialog.vue";
  196. import MapTwo from '@/views/screen/map/mapTwo.vue'
  197. import { getMonitor, getOperationManageLastHalf, getOperationManageTopHalf, getResource } from '@/api/screen/service'
  198. export default {
  199. name: "OfficialMain",
  200. components: {
  201. MapTwo,
  202. CarHealth,
  203. CarCost,
  204. ResourceList,
  205. Province,
  206. TerminalData,
  207. TerminalOnline,
  208. CarWarning,
  209. CarStock,
  210. CarTerminal,
  211. TerminalDataDialog,
  212. CarWarningDialog,
  213. CarStockDialog,
  214. },
  215. // props: {
  216. // appOrg: {
  217. // type: String,
  218. // default: "0000",
  219. // },
  220. // },
  221. data() {
  222. return {
  223. flag: 0,
  224. carActivationNum:[],
  225. carUseNum:[],
  226. carTypeNum:[],
  227. resourceData:{},
  228. monitorData:{},
  229. manageTopHalf:{},
  230. manageLastHalf:{},
  231. op:'',
  232. showC:false,
  233. showRes:0,
  234. showCost:0,
  235. showHealth:0,
  236. leftShow: true,
  237. rightShow: true,
  238. dialogShow: false,
  239. dialogType: 1,
  240. curDeep: 1,
  241. showBack: false,
  242. showMap: true,
  243. showLocal: false,
  244. appOrg: "10001",
  245. curCompany: [],
  246. company: company,
  247. };
  248. },
  249. created() {
  250. this.resource();
  251. this.monitor();
  252. this.operationManage();
  253. },
  254. destroyed() {},
  255. beforeDestroy() {},
  256. mounted() {},
  257. methods: {
  258. transmit(appOrg){
  259. this.appOrg = appOrg
  260. this.resource();
  261. this.monitor();
  262. this.operationManageTopHalf();
  263. },
  264. resource(){
  265. getResource(this.appOrg).then(res => {
  266. if (Number(res.code) === 200) {
  267. this.resourceData = res.data
  268. this.resourceData.cd = 5 - this.resourceData.totalCarNum.toString().length
  269. this.resourceData.totalCarNum = this.resourceData.totalCarNum.toString().padStart(5, '0');
  270. this.resourceData.percentageLack = Math.round(((this.resourceData.totalCarNum - this.resourceData.establishmentsCarNum) / this.resourceData.totalCarNum) * 100);
  271. this.resourceData.percentagePosess = Math.round((this.resourceData.establishmentsCarNum / this.resourceData.totalCarNum) * 100);
  272. this.carTypeNum = [
  273. {
  274. type: "商务车",
  275. num: this.resourceData.carNumOne
  276. },
  277. {
  278. type: "越野车",
  279. num: this.resourceData.carNumTwo
  280. },
  281. {
  282. type: "小轿车",
  283. num: this.resourceData.carNumThree
  284. },
  285. {
  286. type: "小型客车",
  287. num: this.resourceData.carNumFour
  288. },
  289. {
  290. type: "大型客车",
  291. num: this.resourceData.carNumFive
  292. }
  293. ]
  294. this.carUseNum = [
  295. {
  296. type: "企业用车",
  297. num: this.resourceData.enterpriseCarNum
  298. },
  299. {
  300. type: "企业负责人用车",
  301. num: this.resourceData.headCarNum
  302. }
  303. ]
  304. this.carActivationNum = [
  305. {
  306. type: "燃油汽车",
  307. num: this.resourceData.oilCarNum
  308. },
  309. {
  310. type: "新能源汽车",
  311. num: this.resourceData.newPowerCarNum
  312. }
  313. ]
  314. }
  315. })
  316. },
  317. monitor(){
  318. getMonitor(this.appOrg).then(res => {
  319. if (Number(res.code) === 200) {
  320. this.monitorData = res.data
  321. this.monitorData.percentageInstall = Math.round((this.monitorData.terminalInstall / this.monitorData.terminalTotal) * 100);
  322. this.monitorData.percentageOnline = Math.round((this.monitorData.terminalOnline / this.monitorData.terminalTotal) * 100);
  323. }
  324. })
  325. },
  326. operationManageTopHalf(){
  327. getOperationManageTopHalf(this.appOrg).then(res => {
  328. if (Number(res.code) === 200) {
  329. this.manageTopHalf = res.data
  330. this.flag++
  331. }
  332. })
  333. },
  334. operationManageLastHalf(){
  335. getOperationManageLastHalf().then(res => {
  336. if (Number(res.code) === 200) {
  337. this.manageLastHalf = res.data
  338. this.flag++
  339. }
  340. })
  341. },
  342. operationManage(){
  343. this.operationManageTopHalf()
  344. this.operationManageLastHalf()
  345. },
  346. chooseOp(title){
  347. this.op = title
  348. this.closeDialog()
  349. this.showC = true
  350. this.showRes = 1
  351. },
  352. chooseRes(){
  353. this.closeDialog()
  354. this.showC = true
  355. this.showRes = 1
  356. },
  357. onCloseRes(){
  358. this.showC = false
  359. this.showRes = 0
  360. },
  361. chooseCost(){
  362. this.closeDialog()
  363. this.showC = true
  364. this.showCost = 1
  365. },
  366. onCloseCost(){
  367. this.showC = false
  368. this.showCost = 0
  369. },
  370. chooseHealth(){
  371. this.closeDialog()
  372. this.showC = true
  373. this.showHealth = 1
  374. },
  375. onCloseHealth(){
  376. this.showC = false
  377. this.showHealth = 0
  378. },
  379. showDialog(type) {
  380. if (type < 4) {
  381. this.leftShow = false;
  382. this.rightShow = true;
  383. } else {
  384. this.rightShow = false;
  385. this.leftShow = true;
  386. }
  387. this.dialogShow = true;
  388. this.dialogType = type;
  389. },
  390. closeDialog() {
  391. this.leftShow = true;
  392. this.rightShow = true;
  393. this.dialogShow = false;
  394. },
  395. //点击地图事件
  396. onMapClick(e) {
  397. this.curDeep = e.deep;
  398. if (e.deep > 1) {
  399. this.showBack = true;
  400. } else {
  401. this.showBack = false;
  402. }
  403. //点击山西省本部
  404. if (e.name == "山西省公司(本部)") {
  405. this.showMap = false;
  406. this.showLocal = true;
  407. this.curCompany = ["10001", "10001"];
  408. this.appOrg = "10001";
  409. } else {
  410. this.showMap = true;
  411. this.showLocal = false;
  412. this.curCompany = e.curCompany;
  413. }
  414. //判断是否点击了子单位
  415. if (e.curCompany && e.curCompany.length > 0) {
  416. let appOrg = e.curCompany[e.curCompany.length - 1];
  417. this.appOrg = appOrg;
  418. }
  419. },
  420. //返回操作
  421. onBack() {
  422. this.curDeep = 1;
  423. if (this.curDeep <= 1) {
  424. this.showBack = false;
  425. this.showMap = true;
  426. this.showLocal = false;
  427. this.curCompany = [];
  428. }
  429. this.appOrg = "0000";
  430. this.$refs.province.reloadMap(this.curDeep);
  431. },
  432. //选择公司
  433. handleCompanyChange(e) {
  434. console.log(e);
  435. if (e && e.length > 0) {
  436. if (e[1] == "10001") {
  437. this.showMap = false;
  438. this.showLocal = true;
  439. this.showBack = true;
  440. } else {
  441. this.showMap = true;
  442. this.showLocal = false;
  443. }
  444. let appOrg = e[e.length - 1];
  445. this.appOrg = appOrg;
  446. }
  447. if(e[1] == "1A001" || e[1] == "1A002" || e[1] == "1A004" || e[1] == "1A005"){
  448. this.showMap = true;
  449. this.showLocal = false;
  450. this.showBack = true;
  451. // return;
  452. }
  453. this.$refs.province.chooseUnit(e);
  454. },
  455. },
  456. };
  457. </script>
  458. <style lang="scss">
  459. .data-official {
  460. width: 100%;
  461. height: 100%;
  462. margin: 0 auto;
  463. // background-image: url("../../../assets/images/official_car/bg.jpg");
  464. // background-size: cover;
  465. display: flex;
  466. flex-direction: row;
  467. justify-content: space-between;
  468. .left {
  469. margin: 125px 0 0 40px;
  470. width: 580px;
  471. .left-cont {
  472. width: 100%;
  473. height: 920px;
  474. padding-top: 19px;
  475. background: url("../../../assets/images/main/main_bg.png") no-repeat;
  476. background-size: cover;
  477. }
  478. .components-item {
  479. width: 550px;
  480. height: 389px;
  481. background: url("../../../assets/images/main/components_mid_bg.png")
  482. no-repeat;
  483. background-size: cover;
  484. margin-bottom: 28px;
  485. margin-left: 15px;
  486. overflow: hidden;
  487. }
  488. .components-item.bg2 {
  489. background: url("../../../assets/images/main/components_mid_bg2.png")
  490. no-repeat;
  491. background-size: cover;
  492. }
  493. .left-top {
  494. // width: 550px;
  495. // height: 444px;
  496. // background: url("../../../assets/images/service_new/left_top_2.png")
  497. // no-repeat;
  498. // background-size: cover;
  499. // margin-bottom: 21px;
  500. }
  501. .left-bottom {
  502. // width: 550px;
  503. // height: 444px;
  504. // background: url("../../../assets/images/service_new/left_top_2.png")
  505. // no-repeat;
  506. // background-size: cover;
  507. }
  508. }
  509. .middle {
  510. //background: url('../../../assets/zhang/public_map.png') no-repeat center;
  511. display: flex;
  512. flex: 1;
  513. align-items: center;
  514. justify-content: center;
  515. padding: 125px 0 0 0px;
  516. position: relative;
  517. .bottom-area {
  518. position: absolute;
  519. right: 50px;
  520. left: 50px;
  521. bottom: 50px;
  522. .bottom-left {
  523. .left-item {
  524. width: 180px;
  525. height: 30px;
  526. background: url("../../../assets/images/main/choose_bg_long.png")
  527. no-repeat;
  528. background-size: cover;
  529. input {
  530. background: rgba(255, 255, 255, 0);
  531. border: none;
  532. color: #00ffff;
  533. }
  534. .el-input__icon {
  535. color: #00ffff;
  536. }
  537. }
  538. .office {
  539. margin-left: 10px;
  540. width: 180px;
  541. height: 30px;
  542. line-height: 30px;
  543. padding-left: 15px;
  544. color: #898989;
  545. background: url("../../../assets/images/main/choose_bg_long.png")
  546. no-repeat;
  547. background-size: cover;
  548. font-size: 14px;
  549. }
  550. }
  551. .bottom-right {
  552. .back {
  553. width: 34px;
  554. height: 30px;
  555. cursor: pointer;
  556. }
  557. }
  558. }
  559. }
  560. .right {
  561. margin: 125px 40px 0 0px;
  562. width: 580px;
  563. .right-cont {
  564. width: 100%;
  565. height: 920px;
  566. padding-top: 19px;
  567. background: url("../../../assets/images/main/main_bg.png") no-repeat;
  568. background-size: cover;
  569. }
  570. .components-item {
  571. width: 550px;
  572. height: 389px;
  573. background: url("../../../assets/images/main/components_mid_bg.png")
  574. no-repeat;
  575. background-size: cover;
  576. margin-bottom: 28px;
  577. margin-left: 15px;
  578. overflow: hidden;
  579. }
  580. .components-item.bg2 {
  581. background: url("../../../assets/images/main/components_mid_bg2.png")
  582. no-repeat;
  583. background-size: cover;
  584. }
  585. .components-item.bg3 {
  586. height: 849px;
  587. background: url("../../../assets/images/main/components_long_bg.png")
  588. no-repeat;
  589. background-size: cover;
  590. }
  591. .right-top {
  592. // width: 550px;
  593. // height: 444px;
  594. // background: url("../../../assets/images/service_new/left_top_2.png")
  595. // no-repeat;
  596. // background-size: cover;
  597. // margin-bottom: 21px;
  598. }
  599. .right-bottom {
  600. // width: 550px;
  601. // height: 444px;
  602. // background: url("../../../assets/images/service_new/left_top_2.png")
  603. // no-repeat;
  604. // background-size: cover;
  605. }
  606. }
  607. .cont-title-area {
  608. display: flex;
  609. flex-direction: row;
  610. align-items: center;
  611. justify-content: center;
  612. position: relative;
  613. margin-bottom: 10px;
  614. img {
  615. width: 284px;
  616. height: 32px;
  617. }
  618. .cont-title {
  619. font-size: 20px;
  620. font-weight: 900;
  621. font-family: "PingFangSC";
  622. width: 100%;
  623. position: absolute;
  624. display: flex;
  625. align-items: center;
  626. justify-content: center;
  627. top: -5px;
  628. color: #fff;
  629. }
  630. }
  631. .dialog {
  632. position: fixed;
  633. top: 125px;
  634. left: 40px;
  635. z-index: 10;
  636. width: 100%;
  637. }
  638. .dialog-r {
  639. position: fixed;
  640. top: 125px;
  641. right: 40px;
  642. z-index: 10;
  643. width: 100%;
  644. display: flex;
  645. justify-content: flex-end;
  646. }
  647. .dialog-2 {
  648. position: fixed;
  649. left: 0;
  650. top: 0;
  651. right: 0;
  652. bottom: 0;
  653. z-index: 9999;
  654. display: flex;
  655. flex-direction: row;
  656. align-items: center;
  657. justify-content: center;
  658. background: rgba(0, 0, 0, 0.7);
  659. }
  660. .build {
  661. margin: 0 auto;
  662. width: 90%;
  663. height: auto;
  664. object-fit: contain;
  665. }
  666. ::-webkit-scrollbar {
  667. width: 3px;
  668. height: 3px;
  669. }
  670. ::-webkit-scrollbar-thumb {
  671. //滑块部分
  672. // border-radius: 5px;
  673. background-color: #58cbbb;
  674. }
  675. ::-webkit-scrollbar-track {
  676. //轨道部分
  677. // box-shadow: inset 0 0 5px #ddd;
  678. background: #ddd;
  679. // border-radius: 5px;
  680. }
  681. }
  682. </style>