main.vue 14 KB

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