terminalData.vue 15 KB

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