carWarning.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <div>
  3. <div style="display: flex;width: 100%;flex-wrap: wrap">
  4. <div style="width: 50%;margin-bottom: 10px">
  5. <div class="c1_title_half">
  6. <div style="position: absolute;left: 20px;top: -5px;">公务车派车单总数</div>
  7. </div>
  8. <div style="display: flex;align-items: center">
  9. <img src="../../../assets/zhang/public_car.png" width="58" style="margin: 0 5px 0 33px">
  10. <div style="width: 108px;height: 24px;color: #00FFFF;font-size: 34px;margin-bottom: 10px">
  11. <span style="font-family: 'electronicFont'">5566</span>
  12. <span style="width: 15px;height: 24px;font-size: 14px;align-content: end">单</span>
  13. </div>
  14. </div>
  15. </div>
  16. <div style="width: 50%;margin-bottom: 10px">
  17. <div class="c1_title_half">
  18. <div style="position: absolute;left: 20px;top: -5px;">均车派单数</div>
  19. </div>
  20. <div style="display: flex;align-items: center">
  21. <img src="../../../assets/zhang/public_car.png" width="58" style="margin: 0 5px 0 33px">
  22. <div style="width: 108px;height: 24px;color: #00FFFF;font-size: 34px;margin-bottom: 10px">
  23. <span style="font-family: 'electronicFont'">5566</span>
  24. <span style="width: 15px;height: 24px;font-size: 14px;align-content: end">单</span>
  25. </div>
  26. </div>
  27. </div>
  28. <div style="width: 50%;margin-bottom: 10px">
  29. <div class="c1_title_half">
  30. <div style="position: absolute;left: 20px;top: -5px;">公务车行驶总里程</div>
  31. </div>
  32. <div style="display: flex;align-items: center">
  33. <img src="../../../assets/zhang/public_car.png" width="58" style="margin: 0 5px 0 33px">
  34. <div style="width: 108px;height: 24px;color: #00FFFF;font-size: 34px;margin-bottom: 10px">
  35. <span style="font-family: 'electronicFont'">5566</span>
  36. <span style="width: 15px;height: 24px;font-size: 14px;align-content: end">公里</span>
  37. </div>
  38. </div>
  39. </div>
  40. <div style="width: 50%;margin-bottom: 10px">
  41. <div class="c1_title_half">
  42. <div style="position: absolute;left: 20px;top: -5px;">均车里程数</div>
  43. </div>
  44. <div style="display: flex;align-items: center">
  45. <img src="../../../assets/zhang/public_car.png" width="58" style="margin: 0 5px 0 33px">
  46. <div style="width: 108px;height: 24px;color: #00FFFF;font-size: 34px;margin-bottom: 10px">
  47. <span style="font-family: 'electronicFont'">5566</span>
  48. <span style="width: 15px;height: 24px;font-size: 14px;align-content: end">公里</span>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="c1_title">
  54. <div style="position: absolute;left: 20px;top: -5px;">单位用车活跃度</div>
  55. </div>
  56. <div style="display: flex;width: 100%;margin-bottom: 30px">
  57. <div style="width: 50%">
  58. <div class="c1_titleText">
  59. <div style="position: absolute;left: 20px;top: 8px;color: #FFFFFF;font-size: 12px;">前三名单位情况</div>
  60. </div>
  61. <bar-chart
  62. :chart-data="barData"
  63. :x-axis="barAxis"
  64. :y-axis="barYAxis"
  65. :grid="barGrid"
  66. :legend="legend"
  67. y-color="#FFF"
  68. l-color="#FFF"
  69. width="80%"
  70. height="254px"
  71. style="left: 30px;"
  72. />
  73. </div>
  74. <div style="width: 50%">
  75. <div class="c1_titleText">
  76. <div style="position: absolute;left: 20px;top: 8px;color: #FFFFFF;font-size: 12px;">后三名单位情况</div>
  77. </div>
  78. <bar-chart
  79. :chart-data="barData"
  80. :x-axis="barAxis1"
  81. :y-axis="barYAxis"
  82. :grid="barGrid"
  83. :legend="legend"
  84. y-color="#FFF"
  85. l-color="#FFF"
  86. width="80%"
  87. height="254px"
  88. style="left: 30px;"
  89. />
  90. </div>
  91. </div>
  92. <div class="c1_title">
  93. <div style="position: absolute;left: 20px;top: -5px;">单车活跃度排名</div>
  94. </div>
  95. <div style="width: 100%;padding: 0 15px 0 15px">
  96. <div class="flex-container">
  97. <div class="header" style="margin-bottom: 10px">
  98. <div class="flex-column" style="width: 60%">单位名称</div>
  99. <div class="flex-column">车牌号码</div>
  100. <div class="flex-column">派车单数</div>
  101. </div>
  102. <div class="dataBody">
  103. <div class="flex-row" style="margin-bottom: 10px" v-for="(item,index) in dataList" :key="index" @click="choose()">
  104. <div class="flex-column" style="width: 60%">{{item.unit}}</div>
  105. <div class="flex-column">{{item.car}}</div>
  106. <div class="flex-column">{{item.order}}</div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </template>
  113. <script>
  114. import PieChart from "@/components/Echarts/PieChart";
  115. import BarChart from '@/components/Echarts/BarChart.vue'
  116. export default {
  117. name: "CarResource",
  118. components: { BarChart, PieChart },
  119. props: {
  120. appOrg: {
  121. type: String,
  122. default: "0000",
  123. },
  124. },
  125. watch:{
  126. appOrg(newValue,oldValue){
  127. this.show = false;
  128. setTimeout(()=>{
  129. this.show = true;
  130. },100)
  131. },
  132. },
  133. data() {
  134. return {
  135. // 公务用车资源情况
  136. dataList: [
  137. {
  138. unit: "国网山西省电力公司太原供电公司",
  139. car: "晋C36727",
  140. order: 200,
  141. },
  142. {
  143. unit: "国网山西省电力公司太原供电公司",
  144. car: "晋C36727",
  145. order: 200,
  146. },
  147. {
  148. unit: "国网山西省电力公司太原供电公司",
  149. car: "晋C36727",
  150. order: 200,
  151. },
  152. {
  153. unit: "国网山西省电力公司太原供电公司",
  154. car: "晋C36727",
  155. order: 200,
  156. },
  157. {
  158. unit: "国网山西省电力公司太原供电公司",
  159. car: "晋C36727",
  160. order: 200,
  161. },
  162. {
  163. unit: "国网山西省电力公司太原供电公司",
  164. car: "晋C36727",
  165. order: 200,
  166. },
  167. {
  168. unit: "国网山西省电力公司太原供电公司",
  169. car: "晋C36727",
  170. order: 200,
  171. },
  172. {
  173. unit: "国网山西省电力公司太原供电公司",
  174. car: "晋C36727",
  175. order: 200,
  176. },
  177. ],
  178. barData: [
  179. {
  180. name: "公务车总数",
  181. type: "bar",
  182. itemStyle: {
  183. color: {
  184. type:'linear',
  185. x:0,//右
  186. y:0,//下
  187. x2:0,//左
  188. y2:1,//上
  189. colorStops:[
  190. {
  191. offset:0,
  192. color:'#FFD296'
  193. },
  194. {
  195. offset:1,
  196. color:'#D67C15'
  197. },
  198. ]
  199. }
  200. },
  201. barWidth: 10,
  202. data: [110, 140, 150],
  203. },
  204. {
  205. name: "派车单数",
  206. type: "bar",
  207. itemStyle: {
  208. color: {
  209. type:'linear',
  210. x:0,//右
  211. y:0,//下
  212. x2:0,//左
  213. y2:1,//上
  214. colorStops:[
  215. {
  216. offset:0,
  217. color:'#43DCDB'
  218. },
  219. {
  220. offset:1,
  221. color:'#00576D'
  222. },
  223. ]
  224. }
  225. },
  226. barWidth: 10,
  227. data: [110, 120, 130],
  228. },
  229. ],
  230. barAxis:{
  231. type: "category",
  232. data: [
  233. "国网山西省太原供电公司", "国网山西省运城供电公司", "国网山西省晋城供电公司"
  234. ],
  235. axisLabel: {
  236. color: "white",
  237. fontSize: 10,
  238. rotate: 65,
  239. },
  240. axisTick: {
  241. show: false,
  242. },
  243. },
  244. barAxis1:{
  245. type: "category",
  246. data: [
  247. "国网山西省朔州供电公司", "国网山西省阳泉供电公司", "国网山西省忻州供电公司"
  248. ],
  249. axisLabel: {
  250. color: "white",
  251. fontSize: 10,
  252. rotate: 65,
  253. },
  254. axisTick: {
  255. show: false,
  256. },
  257. },
  258. barYAxis:{
  259. type: "value",
  260. axisLabel: {
  261. color: "white",
  262. },
  263. splitLine: {
  264. show: true,
  265. lineStyle:{
  266. type:"dashed",
  267. color: '#504e4e',
  268. width:0.5,
  269. dashOffset: 0,
  270. }
  271. },
  272. axisTick: {
  273. show: false,
  274. },
  275. splitArea:false,
  276. axisLine: {
  277. show: false, //不显示坐标轴线
  278. },
  279. interval: 50,
  280. },
  281. barGrid: {
  282. top: 30,
  283. left: "2%",
  284. right: "2%",
  285. containLabel: true,
  286. bottom: 0,
  287. },
  288. legend:{
  289. orient: 'horizontal',
  290. textStyle: {
  291. fontSize: 10,
  292. color: '#FFFFFF' // 设置文字颜色为白色
  293. },
  294. itemWidth: 8, // 设置图例图标的宽度
  295. itemHeight: 8, // 设置图例图标的高度
  296. icon: 'rect',
  297. right: 'left', // 将图例放置在容器的左侧
  298. top: 'top', // 将图例放置在容器的顶部
  299. },
  300. pieCenter: ["25%", "50%"],
  301. pieRadius: ["50%", "60%"],
  302. pieLegend: {
  303. orient: "vertical",
  304. top:60,
  305. right: 0,
  306. itemWidth: 8, // 设置图例标记的宽度
  307. itemHeight: 8, // 设置图例标记的高度
  308. textStyle: {
  309. color: "#FFF",
  310. },
  311. },
  312. //各类车型
  313. totalPieData: [
  314. { value: 110, name: "商务车" },
  315. { value: 120, name: "越野车" },
  316. { value: 130, name: "小型客车" },
  317. { value: 140, name: "大型客车" },
  318. { value: 150, name: "小轿车" },
  319. ],
  320. totalCenter: ["30%", "50%"],
  321. totalPieLegend: {
  322. top: 20,
  323. right: 10,
  324. itemWidth: 8,
  325. itemHeight: 8,
  326. orient: "vertical",
  327. textStyle: {
  328. color: "#FFF",
  329. },
  330. },
  331. //车辆类型
  332. catePieData: [
  333. { value: 40, name: "新能源汽车" },
  334. { value: 20, name: "燃油汽车" },
  335. ],
  336. catePieLegend: {
  337. show: false,
  338. },
  339. catePieCenter: ["50%", "50%"],
  340. show:true
  341. };
  342. },
  343. created() {},
  344. destroyed() {},
  345. beforeDestroy() {},
  346. mounted() {},
  347. methods: {},
  348. };
  349. </script>
  350. <style lang="scss" scoped>
  351. .c1_title_half{
  352. width: 100%;
  353. height: 36px;
  354. background: url("../../../assets/images/main/title_pro.png") no-repeat;
  355. color: #00FFFF;
  356. margin: 20px 0 0 15px;
  357. position: relative;
  358. }
  359. .c1_title{
  360. width: 100%;
  361. height: 36px;
  362. background: url("../../../assets/images/main/title_pro_long.png") no-repeat;
  363. color: #00FFFF;
  364. margin: 20px 0 0 15px;
  365. position: relative;
  366. }
  367. .c1_titleText{
  368. height: 32px;
  369. margin-left: 35px;
  370. margin-bottom: 10px;
  371. background: url("../../../assets/zhang/publicCar/titleBox.png") no-repeat;
  372. position: relative;
  373. }
  374. .flex-container {
  375. width: 100%;
  376. }
  377. .header{
  378. display: flex; /* 每行使用 flexbox 布局 */
  379. position: relative;
  380. background-color: rgba(21, 105, 107, 0.5);
  381. }
  382. .flex-row {
  383. display: flex; /* 每行使用 flexbox 布局 */
  384. position: relative;
  385. }
  386. .flex-row::before{
  387. content: "";
  388. height: 15px;
  389. border-left: 2px #00FFFF solid;
  390. position: absolute;
  391. left: 0;
  392. top: 10px
  393. }
  394. .flex-column {
  395. width: 25%;
  396. padding: 8px 12px;
  397. text-align: left; /* 左对齐文本 */
  398. color: white;
  399. }
  400. .header .flex-column {
  401. color: #00ffff;
  402. }
  403. .dataBody{
  404. width:100%;
  405. height:250px;
  406. overflow: auto
  407. }
  408. .dataBody::-webkit-scrollbar {
  409. display: none; /* 隐藏滚动条 */
  410. }
  411. </style>