terminalData.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <template>
  2. <div class="c1">
  3. <div class="c1_title">
  4. <span class="title">公务车实有数
  5. <span class="smallTitle">截止至{{timeString}}</span>
  6. </span>
  7. </div>
  8. <div class="c1_body">
  9. <div style="display: flex;justify-content: center;align-items: center;margin-bottom: 10px">
  10. <img src="../../../assets/zhang/publicCar/car.png" width="68" style="margin-right: 20px">
  11. <div class="carNum" v-for="(it, index) in resourceData.totalCarNum">
  12. <span v-if="index < resourceData.cd" style="color: rgba(0,255,255,0.3)">{{ it }}</span>
  13. <span v-if="index >= resourceData.cd">{{ it }}</span>
  14. </div>
  15. <div class="carText">辆</div>
  16. </div>
  17. <div class="c1_titleText"></div>
  18. <div style="display: flex;justify-content: center;align-items: center;margin-bottom: 20px">
  19. <div class="carTypeNumBox" v-for="(it, index) in carTypeNum">
  20. <div style="display: flex;width: 100%;height: 25px">
  21. <img src="../../../assets/zhang/publicCar/miniCar.png" width="18" style="object-fit: cover">
  22. <div style="color: white;font-size: 15px">{{ it.type }}</div>
  23. </div>
  24. <div style="width: 100%;height: 25px;color: #00FFFF;display: flex">
  25. <div style="font-size: 30px;font-family: 'electronicFont'">{{ it.num }}</div>
  26. <div style="font-size: 10px;height: 100%;display: flex;align-items: end;margin-top: 4px">辆</div>
  27. </div>
  28. </div>
  29. </div>
  30. <div style="display: flex;width: 100%;">
  31. <div style="width: 50%">
  32. <div class="c1_titleText_half1"></div>
  33. <div style="display: flex;align-items: center;margin-bottom: 10px;padding-left: 30px">
  34. <div style="height: 50px;margin-right: 15px" v-for="(it, index) in carUseNum">
  35. <div style="display: flex;width: 100%;height: 25px;align-items: center">
  36. <img src="../../../assets/zhang/publicCar/miniCar.png" width="30" style="object-fit: cover">
  37. <div style="color: white;font-size: 13px">{{ it.type }}</div>
  38. </div>
  39. <div style="width: 100%;height: 25px;color: #00FFFF;display: flex;margin-left: 10px">
  40. <div style="font-size: 30px;font-family: 'electronicFont'">{{ it.num }}</div>
  41. <div style="font-size: 10px;height: 100%;display: flex;align-items: end;margin-top: 4px">辆</div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div style="width: 50%">
  47. <div class="c1_titleText_half2"></div>
  48. <div style="display: flex;align-items: center;margin-bottom: 10px;padding-left: 30px">
  49. <div style="height: 50px;margin-right: 15px" v-for="(it, index) in carActivationNum">
  50. <div style="display: flex;width: 100%;height: 25px;align-items: center">
  51. <img src="../../../assets/zhang/publicCar/miniCar.png" width="30" style="object-fit: cover">
  52. <div style="color: white;font-size: 13px">{{ it.type }}</div>
  53. </div>
  54. <div style="width: 100%;height: 25px;color: #00FFFF;display: flex;margin-left: 10px">
  55. <div style="font-size: 30px;font-family: 'electronicFont'">{{ it.num }}</div>
  56. <div style="font-size: 10px;height: 100%;display: flex;align-items: end;margin-top: 4px">辆</div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import PieChart from "@/components/Echarts/PieChart";
  67. import BarChart from "@/components/Echarts/BarChart.vue";
  68. export default {
  69. name: "TerminalData",
  70. components: {
  71. PieChart,
  72. BarChart
  73. },
  74. props: {
  75. carTypeNum: Array,
  76. carUseNum: Array,
  77. carActivationNum: Array,
  78. resourceData:{},
  79. appOrg: {
  80. type: String,
  81. default: "0000",
  82. },
  83. },
  84. watch:{
  85. appOrg(newValue,oldValue){
  86. this.resetData();
  87. },
  88. },
  89. data() {
  90. return {
  91. //在线数
  92. currentTime: new Date(),
  93. pieData: [],
  94. catePieData: [
  95. { value: 0, name: "新能源汽车" },
  96. { value: 0, name: "燃油汽车" },
  97. ],
  98. totalPieData: [
  99. { value: 0, name: "商务车" },
  100. { value: 0, name: "越野车" },
  101. { value: 0, name: "小型客车" },
  102. { value: 0, name: "大型客车" },
  103. { value: 0, name: "小轿车" },
  104. ],
  105. catePieLegend: {
  106. orient: "vertical",
  107. top: 60,
  108. right: 23,
  109. itemWidth: 8, // 设置图例标记的宽度
  110. itemHeight: 8, // 设置图例标记的高度
  111. textStyle: {
  112. color: "#FFF",
  113. },
  114. },
  115. totalPieLegend: {
  116. top: 20,
  117. right: 10,
  118. itemWidth: 8,
  119. itemHeight: 8,
  120. orient: "vertical",
  121. textStyle: {
  122. color: "#FFF",
  123. },
  124. },
  125. pieLegend: {
  126. orient: "vertical",
  127. top: 50,
  128. right: 30,
  129. itemWidth: 8, // 设置图例标记的宽度
  130. itemHeight: 8, // 设置图例标记的高度
  131. textStyle: {
  132. color: "#FFF",
  133. },
  134. },
  135. pieCenter: ["27%", "50%"],
  136. totalCenter: ["30%", "50%"],
  137. catePieCenter: ["27%", "50%"],
  138. pieRadius: ["35%", "50%"],
  139. //各单位终端在线
  140. barData: [],
  141. barAxis: {},
  142. barYAxis: {},
  143. barLegend: {},
  144. personInOutBarData: [
  145. {
  146. name: "员工",
  147. type: "bar",
  148. itemStyle: {
  149. color: "#43DCDB",
  150. //barBorderRadius: [10, 10, 0, 0], // 统一设置四个角的圆角大小
  151. },
  152. barWidth: 10,
  153. data: [110, 120, 130, 140, 150, 160, 155, 145, 135, 125, 115, 15],
  154. },
  155. {
  156. name: "访客",
  157. type: "bar",
  158. itemStyle: {
  159. color: "#FFD296",
  160. //barBorderRadius: [10, 10, 0, 0], // 统一设置四个角的圆角大小
  161. },
  162. barWidth: 10,
  163. data: [10, 20, 30, 40, 50, 60, 55, 45, 35, 25, 15, 5],
  164. },
  165. ],
  166. personInOutBarAxis: {
  167. type: "category",
  168. data: [
  169. "01月",
  170. "02月",
  171. "03月",
  172. "04月",
  173. "05月",
  174. "06月",
  175. "07月",
  176. "08月",
  177. "09月",
  178. "10月",
  179. "11月",
  180. "12月",
  181. ],
  182. axisLabel: {
  183. color: "white", // 设置横坐标轴字体颜色为红色
  184. },
  185. axisLine: {
  186. show: true,
  187. lineStyle: {
  188. color: "#08595B",
  189. },
  190. },
  191. axisTick: {
  192. show: false,
  193. },
  194. splitArea: false,
  195. },
  196. personInOutBarYaxis: {
  197. type: "value",
  198. boundaryGap: [0, 0.01],
  199. name: "人",
  200. nameTextStyle: {
  201. color: "#fff",
  202. },
  203. axisLine: {
  204. show: false,
  205. },
  206. axisLabel: {
  207. color: "white", // 设置横坐标轴字体颜色为红色
  208. },
  209. splitLine: {
  210. show: false,
  211. },
  212. axisTick: {
  213. show: false,
  214. },
  215. splitArea: false,
  216. },
  217. personInOutBarLegend: {
  218. top: 0,
  219. orient: "horizontal",
  220. right: 0,
  221. itemWidth: 17, // 设置图例标记的宽度
  222. itemHeight: 10, // 设置图例标记的高度
  223. textStyle: {
  224. color: "#FFF",
  225. },
  226. },
  227. barGrid: {
  228. top: 30,
  229. left: "2%",
  230. right: "5%",
  231. containLabel: true,
  232. bottom: 0,
  233. },
  234. departmentPersonInOutBarData: [
  235. {
  236. name: "员工",
  237. type: "bar",
  238. itemStyle: {
  239. color: "#43DCDB",
  240. //barBorderRadius: [10, 10, 0, 0], // 统一设置四个角的圆角大小
  241. },
  242. barWidth: 10,
  243. data: [110, 150, 160, 135, 115, 15],
  244. },
  245. {
  246. name: "访客",
  247. type: "bar",
  248. itemStyle: {
  249. color: "#FFD296",
  250. //barBorderRadius: [10, 10, 0, 0], // 统一设置四个角的圆角大小
  251. },
  252. barWidth: 10,
  253. data: [10, 20, 30, 40, 50, 60, 55, 45, 35, 25, 15, 5],
  254. },
  255. ],
  256. departmentPersonInOutBarAxis: {
  257. type: "category",
  258. data: ["财务资产部", "离退休工作部", "后勤保障部", "物资管理部", "数字化工作部", "纪委办公室"],
  259. axisLabel: {
  260. color: "white", // 设置横坐标轴字体颜色为红色
  261. },
  262. axisLine: {
  263. show: true,
  264. lineStyle: {
  265. color: "#08595B",
  266. },
  267. },
  268. axisTick: {
  269. show: false,
  270. },
  271. splitArea: false,
  272. },
  273. departmentPersonInOutBarYaxis: {
  274. type: "value",
  275. boundaryGap: [0, 0.01],
  276. name: "人",
  277. nameTextStyle: {
  278. color: "#fff",
  279. },
  280. axisLine: {
  281. show: false,
  282. },
  283. axisLabel: {
  284. color: "white", // 设置横坐标轴字体颜色为红色
  285. },
  286. splitLine: {
  287. show: false,
  288. },
  289. axisTick: {
  290. show: false,
  291. },
  292. splitArea: false,
  293. },
  294. departmentPersonInOutBarLegend: {
  295. top: 0,
  296. orient: "horizontal",
  297. right: 0,
  298. itemWidth: 17, // 设置图例标记的宽度
  299. itemHeight: 10, // 设置图例标记的高度
  300. textStyle: {
  301. color: "#FFF",
  302. },
  303. },
  304. visitorDataList: [
  305. {
  306. name: "于俊",
  307. time: "2024 / 11 / 15 15:01",
  308. department: "财务资产部",
  309. },
  310. {
  311. name: "于俊",
  312. time: "2024 / 11 / 15 14:58",
  313. department: "财务资产部",
  314. },
  315. {
  316. name: "于俊",
  317. time: "2024 / 11 / 15 14:55",
  318. department: "财务资产部",
  319. },
  320. {
  321. name: "于俊",
  322. time: "2024 / 11 / 15 14:01",
  323. department: "财务资产部",
  324. },
  325. ],
  326. warningList: [
  327. {
  328. name: "国网太原供电公司",
  329. data1: 356,
  330. data2: 100,
  331. data3: 56,
  332. data4: 67,
  333. data5: 133,
  334. },
  335. {
  336. name: "国网临汾供电公司",
  337. data1: 324,
  338. data2: 80,
  339. data3: 95,
  340. data4: 63,
  341. data5: 86,
  342. },
  343. {
  344. name: "国网晋城供电公司",
  345. data1: 286,
  346. data2: 80,
  347. data3: 65,
  348. data4: 46,
  349. data5: 95,
  350. },
  351. {
  352. name: "国网长治供电公司",
  353. data1: 275,
  354. data2: 84,
  355. data3: 72,
  356. data4: 63,
  357. data5: 56,
  358. },
  359. {
  360. name: "国网运城供电公司",
  361. data1: 268,
  362. data2: 70,
  363. data3: 65,
  364. data4: 73,
  365. data5: 60,
  366. },
  367. ],
  368. };
  369. },
  370. computed: {
  371. timeString() {
  372. const year = this.currentTime.getFullYear();
  373. const month = String(this.currentTime.getMonth() + 1);
  374. const day = String(this.currentTime.getDate());
  375. return `${year}年${month}月${day}日`;
  376. },
  377. },
  378. created() {
  379. this.handlePie();
  380. this.handleBar();
  381. },
  382. destroyed() {},
  383. beforeDestroy() {},
  384. mounted() {},
  385. methods: {
  386. //初始化
  387. resetData(){
  388. this.show = false;
  389. setTimeout(()=>{
  390. this.show = true;
  391. },100)
  392. },
  393. //实例化饼图
  394. handlePie() {
  395. this.pieData = [
  396. { value: 100, name: "离线数" },
  397. { value: 200, name: "在线数" },
  398. ];
  399. },
  400. //实例化柱状图
  401. handleBar() {
  402. this.barData = [
  403. {
  404. name: "总数",
  405. type: "bar",
  406. itemStyle: {
  407. color: "#43DCDB",
  408. },
  409. barWidth: 10,
  410. data: [320, 332, 301, 334, 390, 200],
  411. },
  412. {
  413. name: "离线数",
  414. type: "bar",
  415. itemStyle: {
  416. color: "#EAA553",
  417. },
  418. barWidth: 10,
  419. data: [320, 332, 301, 334, 390, 300],
  420. },
  421. {
  422. name: "在线数",
  423. type: "bar",
  424. itemStyle: {
  425. color: "#1B5CBB",
  426. },
  427. barWidth: 10,
  428. data: [320, 332, 301, 334, 390, 300],
  429. },
  430. ];
  431. this.barGrid = {
  432. top: 30,
  433. bottom: 0,
  434. left: "2%",
  435. right: "2%",
  436. containLabel: true,
  437. };
  438. this.barLegend = {
  439. right: 20,
  440. top: 0,
  441. itemWidth: 17, // 设置图例标记的宽度
  442. itemHeight: 10, // 设置图例标记的高度
  443. textStyle: {
  444. color: "#FFF",
  445. },
  446. };
  447. this.barAxis = {
  448. type: "category",
  449. data: [
  450. "公司名称一",
  451. "公司名称一",
  452. "公司名称一",
  453. "公司名称一",
  454. "公司名称一",
  455. ],
  456. axisLabel: {
  457. color: "white", // 设置横坐标轴字体颜色为红色
  458. },
  459. axisLine:{
  460. lineStyle:{
  461. color:"#08595B"
  462. }
  463. },
  464. axisTick: {
  465. show: false,
  466. },
  467. splitArea: false,
  468. };
  469. this.barYAxis = {
  470. name: "数量(个)",
  471. nameTextStyle: {
  472. color: "#fff",
  473. padding: [0,0,0,5],
  474. fontSize: 14,
  475. },
  476. axisLabel: {
  477. formatter: "{value}",
  478. color: "#FFF",
  479. },
  480. axisLine:{
  481. show:false
  482. },
  483. axisTick: {
  484. show: false,
  485. },
  486. splitLine: {
  487. show: false,
  488. },
  489. splitArea: false,
  490. };
  491. },
  492. },
  493. };
  494. </script>
  495. <style lang="scss" scoped>
  496. .c1{
  497. width: 580px;
  498. height: 920px;
  499. }
  500. .c1_title{
  501. width: 100%;
  502. height: 36px;
  503. background: url("../../../assets/images/main/title_pro_long.png") no-repeat;
  504. color: #00FFFF;
  505. margin: 20px 0 0 15px;
  506. position: relative;
  507. padding-left: 20px !important;
  508. .title {
  509. display: block;
  510. position: relative;
  511. top: -5px !important;
  512. }
  513. .smallTitle{
  514. font-size: 10px;
  515. font-weight: 100;
  516. color: #ffffff;
  517. }
  518. }
  519. .c1_body{
  520. width: 550px;
  521. }
  522. .carNum{
  523. width: 40px;
  524. height: 58px;
  525. margin-right: 3px;
  526. background: url("../../../assets/zhang/publicCar/numBack.png") no-repeat;
  527. color: #00FFFF;
  528. font-size: 40px;
  529. display: flex;
  530. justify-content: center;
  531. align-items: center;
  532. font-style: oblique;
  533. }
  534. .carText{
  535. width: 40px;
  536. height: 58px;
  537. color: #00FFFF;
  538. font-size: 24px;
  539. margin-left: 3px;
  540. display: flex;
  541. flex-direction: column;
  542. justify-content: flex-end;
  543. }
  544. .c1_titleText{
  545. width: 100%;
  546. height: 32px;
  547. margin-left: 35px;
  548. margin-bottom: 10px;
  549. background: url("../../../assets/zhang/publicCar/titleBox.png") no-repeat;
  550. position: relative;
  551. }
  552. .c1_titleText::after{
  553. content: '车辆类型';
  554. position: absolute;
  555. color: #FFFFFF;
  556. font-size: 12px;
  557. left: 20px;
  558. top: 8px;
  559. }
  560. .carTypeNumBox{
  561. width: 95px;
  562. height: 50px;
  563. }
  564. .c1_titleText_half1{
  565. height: 32px;
  566. margin-left: 35px;
  567. margin-bottom: 10px;
  568. background: url("../../../assets/zhang/publicCar/titleBox.png") no-repeat;
  569. position: relative;
  570. }
  571. .c1_titleText_half1::after{
  572. content: '车辆用途';
  573. position: absolute;
  574. color: #FFFFFF;
  575. font-size: 12px;
  576. left: 20px;
  577. top: 8px;
  578. }
  579. .c1_titleText_half2{
  580. height: 32px;
  581. margin-left: 35px;
  582. margin-bottom: 10px;
  583. background: url("../../../assets/zhang/publicCar/titleBox.png") no-repeat;
  584. position: relative;
  585. }
  586. .c1_titleText_half2::after{
  587. content: '动力类型';
  588. position: absolute;
  589. color: #FFFFFF;
  590. font-size: 12px;
  591. left: 20px;
  592. top: 8px;
  593. }
  594. </style>