index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <template>
  2. <div class="table-box">
  3. <div class="card table-search" style="overflow: hidden;">
  4. <el-form ref="formRef" :model="searchParam" :inline="true" label-width="auto">
  5. <el-form-item label="所属基地:" prop="base">
  6. <el-select v-model="searchParam.base" placeholder="请选择" style="width: 200px">
  7. <el-option v-for="item in baseOptions" :key="item.value" :label="item.label"
  8. :value="item.value" />
  9. </el-select>
  10. </el-form-item>
  11. <el-form-item>
  12. <div>
  13. <el-button type="primary">查询</el-button>
  14. <el-button plain @click="resetForm(formRef)">重置</el-button>
  15. </div>
  16. </el-form-item>
  17. </el-form>
  18. </div>
  19. <div class="main_list ">
  20. <el-row :gutter="15">
  21. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  22. <div class="chart_item zhuti">
  23. <div style="font-weight: bold;" class="item_title">
  24. <span>设备工况(单位:台)</span>
  25. </div>
  26. <div class="mt5">
  27. <div ref="device" class="ve-ring" style="height: 200px"></div>
  28. </div>
  29. </div>
  30. </el-col>
  31. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  32. <div class="chart_item zhuti">
  33. <div style="font-weight: bold;" class="item_title">
  34. <span>检定周期(单位:台)</span>
  35. </div>
  36. <div class="mt5">
  37. <div ref="period" class="ve-ring" style="height: 200px"></div>
  38. </div>
  39. </div>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :md="8" :lg="8">
  42. <div class="chart_item zhuti">
  43. <div style="font-weight: bold;" class="item_title">
  44. <span>FTP链路</span>
  45. </div>
  46. <div class="mt5">
  47. <div class="FTP_box" style="height: 200px">
  48. <div class="FTP_item">
  49. <img src="@/assets/images/centerStation.png" alt="">
  50. <div>中心站FTP</div>
  51. </div>
  52. <div class="FTP_item">
  53. <img src="@/assets/images/areaStation.png" alt="">
  54. <div>中心站FTP</div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </el-col>
  60. </el-row>
  61. <el-row :gutter="15">
  62. <el-col :span="24">
  63. <div class="chart_item zhuti">
  64. <div style="font-weight: bold;" class="item_title">
  65. <span>危险天气</span>
  66. </div>
  67. <el-row :gutter="15">
  68. <el-col :span="8">
  69. <div class="mt5">
  70. <div ref="weather" class="ve-ring" style="height: 300px"></div>
  71. </div>
  72. </el-col>
  73. <el-col :span="16" style="margin-bottom: 0;">
  74. <div>
  75. <div ref="element" class="ve-ring" style="height: 300px"></div>
  76. </div>
  77. </el-col>
  78. </el-row>
  79. </div>
  80. </el-col>
  81. </el-row>
  82. <el-row :gutter="15">
  83. <el-col :span="24">
  84. <div class="chart_item zhuti">
  85. <div style="font-weight: bold;" class="item_title">
  86. <span>到报监控</span>
  87. </div>
  88. <div class="mt5">
  89. <div ref="control" class="ve-ring" style="height: 300px"></div>
  90. </div>
  91. </div>
  92. </el-col>
  93. </el-row>
  94. </div>
  95. </div>
  96. </template>
  97. <script setup lang="ts" name="allDevice">
  98. import * as echarts from 'echarts';
  99. import { ref, reactive, onMounted, computed, watch } from "vue";
  100. import { useRouter } from "vue-router";
  101. import { useGlobalStore } from "@/stores/modules/global";
  102. const formRef = ref()
  103. const device = ref()
  104. const period = ref()
  105. const weather = ref()
  106. const element = ref()
  107. const control = ref()
  108. const router = useRouter();
  109. const searchParam = reactive({
  110. base: undefined,
  111. })
  112. const baseOptions = ref([{
  113. value: 0,
  114. label: '基地1',
  115. },
  116. {
  117. value: 1,
  118. label: '基地2',
  119. }])
  120. // resetForm
  121. const resetForm = (formEl) => {
  122. if (!formEl) return;
  123. formEl.resetFields();
  124. };
  125. const globalStore = useGlobalStore();
  126. const isDark = computed(() => globalStore.isDark);
  127. const showDevice = () => {
  128. // console.log(isDark.value,'颜色');
  129. let mychart = echarts.init(device.value);
  130. let option = {
  131. tooltip: {
  132. trigger: 'item',
  133. formatter: "{a} <br/>{b}: {c}台"
  134. },
  135. legend: {
  136. bottom: '1%',
  137. left: 'center',
  138. textStyle: {//图例文字的样式
  139. color: isDark.value ? '#fff' : "#000",
  140. }
  141. },
  142. series: [
  143. {
  144. name: '设备工况',
  145. type: 'pie',
  146. radius: ['50%', '70%'],
  147. center: ['50%', '45%'],
  148. hoverAnimation: false,
  149. itemStyle: {
  150. borderRadius: 3,
  151. borderColor: '#fff',
  152. borderWidth: 1
  153. },
  154. label: {
  155. normal: {
  156. show: true,
  157. position: 'outer',
  158. formatter: '{b}:{c}',
  159. overflow: 'none',
  160. fontSize: 15,
  161. },
  162. },
  163. emphasis: {
  164. label: {
  165. show: true,
  166. fontSize: 20,
  167. fontWeight: 'bold'
  168. }
  169. },
  170. //设置提示线
  171. labelLine: {
  172. normal: {
  173. show: true,//开启提示线展示
  174. length: 15,//设置第一条提示线长度
  175. length2: 30,//设置第二条提示线长度
  176. }
  177. },
  178. data: [
  179. {
  180. value: 4,
  181. name: '正常',
  182. itemStyle: { color: '#00C4B3' },
  183. label: { color: '#00C4B3' }
  184. },
  185. {
  186. value: 1,
  187. name: '告警',
  188. itemStyle: { color: '#EF6666' },
  189. label: { color: '#EF6666' }
  190. }
  191. ]
  192. }
  193. ]
  194. };
  195. mychart.setOption(option)
  196. window.addEventListener("resize", function () {
  197. mychart.resize();
  198. });
  199. }
  200. const showPeriod = () => {
  201. let mychart = echarts.init(period.value);
  202. let option = {
  203. tooltip: {
  204. trigger: 'item',
  205. formatter: "{a} <br/>{b}: {c}台"
  206. },
  207. legend: {
  208. bottom: 0,
  209. left: 'center',
  210. textStyle: {//图例文字的样式
  211. color: isDark.value ? '#fff' : "#000",
  212. }
  213. },
  214. series: [
  215. {
  216. name: '检定周期',
  217. type: 'pie',
  218. radius: '70%',
  219. center: ['50%', '45%'],
  220. data: [
  221. { value: 3, name: '剩余31-60天', itemStyle: { color: '#5470C6' } },
  222. { value: 1, name: '剩余1-30天', itemStyle: { color: '#FAC858' } },
  223. { value: 1, name: '已过检', itemStyle: { color: '#EF6666' } }
  224. ],
  225. emphasis: {
  226. itemStyle: {
  227. shadowBlur: 10,
  228. shadowOffsetX: 0,
  229. shadowColor: 'rgba(0, 0, 0, 0.5)'
  230. }
  231. }
  232. }
  233. ]
  234. };
  235. mychart.setOption(option)
  236. window.addEventListener("resize", function () {
  237. mychart.resize();
  238. });
  239. }
  240. const allSataion = ref(5)
  241. const showWeather = () => {
  242. let mychart = echarts.init(weather.value);
  243. let option = {
  244. title: {
  245. text: `${allSataion.value} \n 总站数 `,
  246. left: "center",
  247. top: "38%",
  248. textStyle: {
  249. fontSize: 20,
  250. color: '#000',
  251. },
  252. },
  253. tooltip: {
  254. trigger: 'item',
  255. formatter: "{a} <br/>{b}: {c}"
  256. },
  257. legend: {
  258. bottom: '1%',
  259. left: 'center',
  260. textStyle: {//图例文字的样式
  261. color: isDark.value ? '#fff' : "#000",
  262. }
  263. },
  264. series: [
  265. {
  266. name: '设备工况',
  267. type: 'pie',
  268. radius: ['50%', '70%'],
  269. center: ['50%', '45%'],
  270. hoverAnimation: false,
  271. itemStyle: {
  272. borderRadius: 3,
  273. borderColor: '#fff',
  274. borderWidth: 1
  275. },
  276. label: {
  277. normal: {
  278. show: true,
  279. position: 'outer',
  280. formatter: '{b}:{c}',
  281. overflow: 'none',
  282. fontSize: 15,
  283. },
  284. },
  285. emphasis: {
  286. label: {
  287. show: true,
  288. fontSize: 20,
  289. fontWeight: 'bold'
  290. }
  291. },
  292. //设置提示线
  293. labelLine: {
  294. normal: {
  295. show: true,//开启提示线展示
  296. length: 15,//设置第一条提示线长度
  297. length2: 30,//设置第二条提示线长度
  298. }
  299. },
  300. data: [
  301. {
  302. value: 4,
  303. name: '正常',
  304. itemStyle: { color: '#5470C6' },
  305. label: { color: '#5470C6' }
  306. },
  307. {
  308. value: 1,
  309. name: '告警',
  310. itemStyle: { color: '#EF6666' },
  311. label: { color: '#EF6666' }
  312. }
  313. ]
  314. }
  315. ]
  316. };
  317. mychart.setOption(option)
  318. window.addEventListener("resize", function () {
  319. mychart.resize();
  320. });
  321. }
  322. const showElement = () => {
  323. let mychart = echarts.init(element.value);
  324. let option = {
  325. tooltip: {
  326. trigger: 'axis',
  327. axisPointer: {
  328. type: 'shadow'
  329. }
  330. },
  331. grid: {
  332. top: '3%',
  333. left: '3%',
  334. right: '4%',
  335. bottom: '0%',
  336. containLabel: true
  337. },
  338. xAxis: [
  339. {
  340. type: 'category',
  341. data: [
  342. '能见度',
  343. '风速',
  344. '大气电场',
  345. '云量',
  346. '云高',
  347. '温度',
  348. '湿度',
  349. '小时雨量'
  350. ]
  351. }
  352. ],
  353. yAxis: [
  354. {
  355. type: 'value'
  356. }
  357. ],
  358. series: [
  359. {
  360. name: '正常',
  361. barWidth: '50%',
  362. type: 'bar',
  363. stack: 'Ad',
  364. emphasis: {
  365. focus: 'series'
  366. },
  367. itemStyle: {
  368. color: '#5470C6'
  369. },
  370. data: [5, 5, 5, 5, 4, 5, 5, 5]
  371. },
  372. {
  373. name: '告警',
  374. barWidth: '50%',
  375. type: 'bar',
  376. stack: 'Ad',
  377. emphasis: {
  378. focus: 'series'
  379. },
  380. itemStyle: {
  381. color: '#EF6666'
  382. },
  383. data: [0, 0, 0, 0, 1, 0, 0, 0]
  384. }
  385. ]
  386. };
  387. mychart.setOption(option)
  388. window.addEventListener("resize", function () {
  389. mychart.resize();
  390. });
  391. }
  392. const showControl = () => {
  393. let mychart = echarts.init(control.value);
  394. let option = {
  395. tooltip: {
  396. trigger: 'axis',
  397. axisPointer: {
  398. type: 'shadow'
  399. }
  400. },
  401. legend: {
  402. textStyle: {//图例文字的样式
  403. color: isDark.value ? '#fff' : "#000",
  404. }
  405. },
  406. grid: {
  407. left: '15',
  408. right: '15',
  409. bottom: '3%',
  410. containLabel: true
  411. },
  412. xAxis: [
  413. {
  414. type: 'category',
  415. data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']
  416. }
  417. ],
  418. yAxis: [
  419. {
  420. type: 'value'
  421. }
  422. ],
  423. series: [
  424. {
  425. name: '应报情况',
  426. type: 'bar',
  427. stack: 'Ad',
  428. emphasis: {
  429. focus: 'series'
  430. },
  431. itemStyle: {
  432. color: '#3BA272' // 蓝色
  433. },
  434. data: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]
  435. },
  436. {
  437. name: '实报情况',
  438. type: 'bar',
  439. stack: 'Ad',
  440. emphasis: {
  441. focus: 'series'
  442. },
  443. itemStyle: {
  444. color: '#5470C6' // 绿色
  445. },
  446. data: [5, 4, 1, 2, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5]
  447. },
  448. {
  449. name: '未报情况',
  450. type: 'bar',
  451. stack: 'Ad',
  452. emphasis: {
  453. focus: 'series'
  454. },
  455. itemStyle: {
  456. color: '#EF6666' // 红色
  457. },
  458. data: [1, 2, 5, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1]
  459. },
  460. ]
  461. };
  462. mychart.setOption(option)
  463. window.addEventListener("resize", function () {
  464. mychart.resize();
  465. });
  466. }
  467. watch(isDark, () => { showDevice(), showPeriod(), showWeather(), showElement(), showControl() });
  468. onMounted(() => {
  469. showDevice()
  470. showPeriod()
  471. showWeather()
  472. showElement()
  473. showControl()
  474. })
  475. </script>
  476. <style scoped lang="scss">
  477. .el-row .el-col {
  478. margin-bottom: 15px;
  479. }
  480. .main_list {
  481. background: transparent !important;
  482. box-shadow: none !important;
  483. padding: 0 !important;
  484. height: calc(100vh - 150px);
  485. margin-bottom: 10px;
  486. overflow-y: scroll;
  487. overflow-x: hidden;
  488. .chart_item {
  489. border-radius: 10px;
  490. padding: 10px;
  491. background-color: #fff;
  492. // height: 100%;
  493. // margin-bottom: 15px;
  494. .item_title {
  495. display: flex;
  496. justify-content: space-between;
  497. align-items: center;
  498. }
  499. .FTP_box {
  500. padding: 0 50px;
  501. display: flex;
  502. align-items: center;
  503. justify-content: space-between;
  504. .FTP_item {
  505. flex: 1;
  506. flex-shrink: 0;
  507. display: flex;
  508. flex-direction: column;
  509. justify-content: center;
  510. align-items: center;
  511. img {
  512. width: 56px;
  513. margin-bottom: 20px;
  514. }
  515. }
  516. }
  517. }
  518. .info_box {
  519. .info_title {
  520. color: #999999;
  521. font-size: 16px;
  522. }
  523. .info_content {
  524. height: 40px;
  525. font-weight: bold;
  526. color: #000;
  527. font-size: 26px;
  528. }
  529. }
  530. }
  531. </style>