unitAccessto.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. <template>
  2. <div class="main-data data-unit-access">
  3. <!-- <div class="title-area">各单位的接入情况</div> -->
  4. <div class="content-area">
  5. <div class="content-title">
  6. <span class="title">工程现场监控接入情况</span>
  7. </div>
  8. <div class="content">
  9. <div class="table-cont">
  10. <div class="table-top">
  11. <div class="fir">接入单位名称</div>
  12. <div class="snd">已接入项目数量</div>
  13. <div class="thd">已接入摄像头数量</div>
  14. </div>
  15. <div class="table-bot">
  16. <div class="table-list" v-for="(item,index) in monitorList" :key="index" @click="choose">
  17. <div class="said"></div>
  18. <div class="fir">{{item.name}}</div>
  19. <div class="snd">{{item.num}}</div>
  20. <div class="thd color">{{item.onLineNum}}</div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import BarChart from "@/components/Echarts/BarChart";
  30. import LineChart from "@/components/Echarts/LineChart.vue";
  31. import echarts from "echarts";
  32. import { getProjectCameraNumList } from '@/api/screen/service'
  33. export default {
  34. name: "UnitAccessTo",
  35. components: {
  36. LineChart,
  37. BarChart,
  38. },
  39. props:{
  40. appOrg: {
  41. type: String,
  42. default: "0000",
  43. },
  44. },
  45. watch:{
  46. appOrg(newVal, oldVal){
  47. // this.handleDataList();
  48. // this.handleUnitDataList();
  49. // this.handleCurrentArea();
  50. // this.handleOnlineData();
  51. }
  52. },
  53. data() {
  54. return {
  55. show: true,
  56. barData: [],
  57. barAxis: {},
  58. barYAxis: {},
  59. barGrid: {
  60. top: 30,
  61. left: "3%",
  62. right: "6%",
  63. containLabel: true,
  64. bottom: 0,
  65. },
  66. dataList: [
  67. {
  68. name: "接入单位数量",
  69. num: "56",
  70. unit: "个",
  71. },
  72. {
  73. name: "应接入项目数量",
  74. num: "56",
  75. unit: "个",
  76. },
  77. {
  78. name: "已接入项目数量",
  79. num: "56",
  80. unit: "个",
  81. },
  82. {
  83. name: "已接入摄像头数量",
  84. num: "56",
  85. unit: "个",
  86. },
  87. {
  88. name: "已接入摄像头在线数量",
  89. num: "56",
  90. unit: "个",
  91. },
  92. {
  93. name: "已接入摄像头在线率",
  94. num: "56",
  95. unit: "%",
  96. },
  97. ],
  98. lineData: [],
  99. lineAxis: {},
  100. lineYAxis: {
  101. name: "历史摄像头在线率",
  102. nameTextStyle: {
  103. color: "#fff",
  104. padding: [0, 0, 0, 30],
  105. },
  106. axisLabel: {
  107. color: "#FFF",
  108. },
  109. splitLine: {
  110. show: false,
  111. },
  112. axisLine: {
  113. show: false,
  114. },
  115. axisTick: {
  116. show: false,
  117. },
  118. splitArea: false,
  119. },
  120. onlineData: [],
  121. onlineAxis: {},
  122. onlineYAxis: {
  123. name: "历史摄像头数(个)",
  124. nameTextStyle: {
  125. color: "#fff",
  126. fontSize: 14,
  127. padding: [0,0,0,35]
  128. },
  129. axisLabel: {
  130. color: "#FFF",
  131. },
  132. splitLine: {
  133. show: false,
  134. },
  135. axisLine: {
  136. show: false,
  137. },
  138. axisTick: {
  139. show: false,
  140. },
  141. splitArea: false,
  142. },
  143. monitorList: [],
  144. unitDataList: [],
  145. };
  146. },
  147. created() {
  148. this.handleDataList();
  149. this.handleUnitDataList();
  150. this.handleCurrentArea();
  151. this.handleOnlineData();
  152. this.getProjectCameraNumList()
  153. },
  154. destroyed() {},
  155. beforeDestroy() {},
  156. mounted() {},
  157. methods: {
  158. getProjectCameraNumList(){
  159. getProjectCameraNumList(this.$props.appOrg).then((res) => {
  160. if (Number(res.code) === 200) {
  161. this.monitorList = res.data;
  162. this.monitorList.forEach((item, index) => {
  163. item.name = item.unitName;
  164. item.num = item.projectNum;
  165. item.onLineNum = item.cameraNum;
  166. });
  167. }
  168. });
  169. },
  170. choose(){
  171. this.$emit('chooseUnit')
  172. },
  173. handleDataList() {
  174. this.dataList = [];
  175. setTimeout(()=>{
  176. this.dataList = [
  177. {
  178. name: "接入单位数量",
  179. num: "56",
  180. unit: "个",
  181. },
  182. {
  183. name: "应接入项目数量",
  184. num: "56",
  185. unit: "个",
  186. },
  187. {
  188. name: "已接入项目数量",
  189. num: "56",
  190. unit: "个",
  191. },
  192. {
  193. name: "已接入摄像头数量",
  194. num: "56",
  195. unit: "个",
  196. },
  197. {
  198. name: "已接入摄像头在线数量",
  199. num: "56",
  200. unit: "个",
  201. },
  202. {
  203. name: "已接入摄像头在线率",
  204. num: "56",
  205. unit: "%",
  206. },
  207. ];
  208. },100)
  209. },
  210. //初始化
  211. handleUnitDataList() {
  212. let unitDataList = [];
  213. unitDataList.push({
  214. name: "国网山西省电力公司",
  215. num: 56,
  216. onLineNum: 46
  217. });
  218. unitDataList.push({
  219. name: "国网太原供电公司",
  220. num: 10,
  221. onLineNum: 8
  222. });
  223. unitDataList.push({
  224. name: "国网运城供电公司",
  225. num: 8,
  226. onLineNum: 4
  227. });
  228. unitDataList.push({
  229. name: "国网临汾供电公司",
  230. num: 7,
  231. onLineNum: 6
  232. });
  233. unitDataList.push({
  234. name: "国网晋城供电公司",
  235. num: 6,
  236. onLineNum: 6
  237. });
  238. unitDataList.push({
  239. name: "国网吕梁供电公司",
  240. num: 4,
  241. onLineNum: 3
  242. });
  243. unitDataList.push({
  244. name: "国网大同供电公司",
  245. num: 4,
  246. onLineNum: 3
  247. });
  248. this.unitDataList = unitDataList;
  249. },
  250. handleCurrentArea() {
  251. (this.lineData = [
  252. {
  253. name: "",
  254. type: "line",
  255. areaStyle: {
  256. opacity: 0.8,
  257. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  258. {
  259. offset: 0.03,
  260. color: "rgba(30, 240, 215, 0.4196)",
  261. },
  262. {
  263. offset: 0.68,
  264. color: "rgba(23, 240, 240, 0)",
  265. },
  266. ]),
  267. },
  268. lineStyle: {
  269. width: 2, // 设置线宽
  270. color: "#00FFFF", // 设置线的颜色
  271. },
  272. smooth: true,
  273. data: [40, 60, 80, 50],
  274. },
  275. ]),
  276. (this.lineAxis = {
  277. type: "category",
  278. data: ["0-6", "6-12", "12-18", "18-24"],
  279. axisLabel: {
  280. color: "white", // 设置横坐标轴字体颜色为红色
  281. },
  282. axisTick: {
  283. show: false,
  284. },
  285. axisLine: {
  286. lineStyle: {
  287. color: "#465A64",
  288. },
  289. },
  290. boundaryGap: false,
  291. });
  292. },
  293. handleOnlineData() {
  294. (this.onlineData = [
  295. {
  296. name: "",
  297. type: "line",
  298. areaStyle: {
  299. opacity: 0.8,
  300. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  301. {
  302. offset: 0.03,
  303. color: "rgba(30, 240, 215, 0.4196)",
  304. },
  305. {
  306. offset: 0.68,
  307. color: "rgba(23, 240, 240, 0)",
  308. },
  309. ]),
  310. },
  311. lineStyle: {
  312. width: 2, // 设置线宽
  313. color: "#00FFFF", // 设置线的颜色
  314. },
  315. smooth: true,
  316. data: [40, 60, 80, 50],
  317. },
  318. ]),
  319. (this.onlineAxis = {
  320. type: "category",
  321. data: ["0-6", "6-12", "12-18", "18-24"],
  322. axisLabel: {
  323. color: "white", // 设置横坐标轴字体颜色为红色
  324. },
  325. axisTick: {
  326. show: false,
  327. },
  328. axisLine: {
  329. lineStyle: {
  330. color: "#465A64",
  331. },
  332. },
  333. boundaryGap: false,
  334. });
  335. },
  336. },
  337. };
  338. </script>
  339. <style lang="scss" scoped>
  340. .content-title {
  341. width: 100%;
  342. height: 26px;
  343. background: url("../../../assets/images/main/title_pro_long.png") no-repeat;
  344. background-size: 100% 100%;
  345. font-family: "PingFangSC";
  346. font-size: 16px;
  347. font-weight: bold;
  348. color: #00ffff;
  349. padding-left: 15px;
  350. .title {
  351. display: block;
  352. position: relative;
  353. top:-5px;
  354. }
  355. }
  356. .data-unit-access {
  357. height: 100%;
  358. overflow: hidden;
  359. .content-area {
  360. display: flex;
  361. flex-direction: column;
  362. padding: 15px 20px 0 15px;
  363. }
  364. .said{
  365. width: 1px;
  366. height: 13px;
  367. background-color: #00FFFF;
  368. }
  369. .content {
  370. width: 100%;
  371. margin-top: 20px;
  372. display: flex;
  373. flex-direction: column;
  374. .title-format {
  375. display: flex;
  376. flex-direction: row;
  377. align-items: center;
  378. img {
  379. width: 6px;
  380. height: 24px;
  381. margin-right: 6px;
  382. }
  383. .title-info {
  384. display: flex;
  385. flex-direction: column;
  386. font-size: 14px;
  387. color: #ffffff;
  388. .title-en {
  389. font-size: 8px;
  390. color: #ffffff;
  391. opacity: 0.4;
  392. }
  393. }
  394. }
  395. .total-data {
  396. display: flex;
  397. align-items: baseline;
  398. color: #19fcde;
  399. margin-top: 4px;
  400. .total {
  401. font-size: 35px;
  402. font-family: "electronicFont";
  403. }
  404. .unit {
  405. font-size: 12px;
  406. }
  407. }
  408. data-detail{
  409. align-items: center;
  410. }
  411. .data-list {
  412. display: flex;
  413. width: 100%;
  414. .data-item {
  415. display: flex;
  416. flex-direction: column;
  417. justify-content: center;
  418. width: 50%;
  419. margin-bottom: 11px;
  420. .data-detail {
  421. display: flex;
  422. flex-direction: row;
  423. align-items: center;
  424. color: #00ffff;
  425. margin-top: 11px;
  426. font-size: 12px;
  427. .data {
  428. font-size: 30px;
  429. font-family: "electronicFont";
  430. }
  431. }
  432. }
  433. .data-item:nth-child(3n) {
  434. margin-right: 0;
  435. }
  436. }
  437. .rate-area {
  438. position: relative;
  439. margin-left: 35px;
  440. img {
  441. width: 168px;
  442. height: 97px;
  443. }
  444. .rate {
  445. display: flex;
  446. flex-direction: column;
  447. align-items: center;
  448. justify-content: center;
  449. width: 100%;
  450. position: absolute;
  451. top: 0;
  452. left: -10px;
  453. color: #fff;
  454. .rate-data {
  455. display: flex;
  456. flex-direction: row;
  457. align-items: baseline;
  458. color: #ffba44;
  459. .data {
  460. font-size: 30px;
  461. font-family: "electronicFont";
  462. }
  463. .unit {
  464. font-size: 12px;
  465. }
  466. }
  467. .desc {
  468. font-size: 12px;
  469. text-align: center;
  470. }
  471. }
  472. }
  473. .chart-area{
  474. margin-top: 50px;
  475. }
  476. }
  477. .iaco{
  478. width: 58px;
  479. height:56px ;
  480. margin-left: 45px;
  481. margin-right: 5px;
  482. }
  483. .table-cont{
  484. width:100%;
  485. .table-top{
  486. width:100%;
  487. height: 26px;
  488. background: url("../../../assets/images/building_guarantee/img_11.png") no-repeat;
  489. background-size: 100% 100%;
  490. padding:0 25px 0 10px;
  491. display: flex;
  492. justify-content: space-between;
  493. align-items: center;
  494. font-size:14px;
  495. color:#00FFFF;
  496. }
  497. .table-bot{
  498. width:100%;
  499. .table-list{
  500. width:100%;
  501. height:30px;
  502. margin-top: 3px;
  503. padding:5px 25px 0 10px;
  504. display: flex;
  505. justify-content: space-between;
  506. align-items: center;
  507. font-size:14px;
  508. color:#FFFFFF;
  509. font-weight: 500;
  510. }
  511. .table-list:hover{
  512. cursor: pointer;
  513. }
  514. }
  515. .fir{
  516. width:40%;
  517. text-align: left;
  518. margin-left: 5px;
  519. }
  520. .snd{
  521. width:30%;
  522. text-align: left;
  523. }
  524. .thd{
  525. width:30%;
  526. text-align: left;
  527. }
  528. }
  529. ::-webkit-scrollbar {
  530. display: none;
  531. width: 3px;
  532. height: 3px;
  533. }
  534. ::-webkit-scrollbar-thumb {
  535. //滑块部分
  536. // border-radius: 5px;
  537. background-color: #58cbbb;
  538. }
  539. ::-webkit-scrollbar-track {
  540. //轨道部分
  541. // box-shadow: inset 0 0 5px #ddd;
  542. background: #ddd;
  543. // border-radius: 5px;
  544. }
  545. }
  546. </style>