index.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520
  1. <template>
  2. <div class="module-container">
  3. <el-row>
  4. <el-col
  5. :span="24"
  6. class="filter-container"
  7. >
  8. <el-select
  9. v-model="project"
  10. placeholder="请选择"
  11. size="small"
  12. clearable
  13. @change="filterCharts"
  14. >
  15. <el-option
  16. label="全部项目"
  17. value=""
  18. />
  19. <el-option
  20. v-for="item in projectList"
  21. :key="item.projectId"
  22. :label="item.projectName"
  23. :value="item.projectId"
  24. />
  25. </el-select>
  26. </el-col>
  27. </el-row>
  28. <el-row
  29. :gutter="15"
  30. class="content-container"
  31. >
  32. <el-col :span="8">
  33. <el-row class="half-container">
  34. <dataContainer
  35. title="设备状态"
  36. :tip-content="(project ? filterForm.projectName : '所有项目') + '的设备状态统计'"
  37. >
  38. <div
  39. id="deviceStatus"
  40. class="charts-container"
  41. />
  42. </dataContainer>
  43. </el-row>
  44. <el-row class="half-container">
  45. <dataContainer
  46. title="设备类型"
  47. :tip-content="(project ? filterForm.projectName : '所有项目') + '的设备类型统计'"
  48. >
  49. <div
  50. id="deviceType"
  51. class="charts-container"
  52. />
  53. </dataContainer>
  54. </el-row>
  55. </el-col>
  56. <el-col :span="8">
  57. <el-row class="two-third-container">
  58. <dataContainer title="基础数据">
  59. <div
  60. v-if="filterForm.projectId"
  61. class="base-project-container"
  62. >
  63. <div class="project-info">
  64. <el-image
  65. :src="projectOption.src"
  66. fit="cover"
  67. style="width: 50%; height: 15vh; float: left; margin: 0 10px 10px 0;"
  68. />
  69. <span class="project-info-title">{{ projectOption.title }}</span>
  70. <br>
  71. <span class="project-info-text">{{ projectOption.info }}</span>
  72. </div>
  73. </div>
  74. <div
  75. v-else
  76. class="base-all-project"
  77. />
  78. <div class="base-info-container">
  79. <div
  80. class="base-info-card"
  81. @click="getChartData(1)"
  82. >
  83. <el-tooltip
  84. placement="top"
  85. popper-class="tooltip-dark"
  86. effect="dark"
  87. >
  88. <template #content>
  89. <span class="tooltip-title">在管设备:</span>{{ (project ? filterForm.projectName : '所有项目') + '的设备总数' }}
  90. </template>
  91. <div class="base-info-title base-info-icon1">
  92. 在管设备
  93. </div>
  94. </el-tooltip>
  95. <div class="base-info-data">
  96. {{ baseInfoOption.deviceCount }}
  97. </div>
  98. <div class="base-info-tip">
  99. 在管项目
  100. <span>{{ baseInfoOption.projectCount }}</span>
  101. 个&nbsp;&nbsp;&nbsp;&nbsp;在管机房
  102. <span>{{ baseInfoOption.devicePartrolCount }}</span>
  103. </div>
  104. </div>
  105. <div
  106. class="base-info-card"
  107. @click="getChartData(2)"
  108. >
  109. <el-tooltip
  110. placement="top"
  111. popper-class="tooltip-dark"
  112. effect="dark"
  113. >
  114. <template #content>
  115. <span class="tooltip-title">设备完好率:</span>维修中、故障中定义为设备损坏状态,其他状态定义为完好状态
  116. </template>
  117. <div class="base-info-title base-info-icon2">
  118. 设备完好率
  119. </div>
  120. </el-tooltip>
  121. <div class="base-info-data">
  122. {{ baseInfoOption.intactRate }}%
  123. </div>
  124. </div>
  125. <div
  126. class="base-info-card"
  127. @click="getChartData(3)"
  128. >
  129. <el-tooltip
  130. placement="top"
  131. popper-class="tooltip-dark"
  132. effect="dark"
  133. >
  134. <template #content>
  135. <span class="tooltip-title">巡检完成率:</span>{{ '所有项目' + getYearAndMonth() + '巡检完成率(所有项目的任务完成数总计*100%/任务总数总计)' }}
  136. </template>
  137. <div class="base-info-title base-info-icon3">
  138. 巡检完成率
  139. </div>
  140. </el-tooltip>
  141. <div class="base-info-data">
  142. {{ baseInfoOption.patrolFinishRate }}%
  143. </div>
  144. </div>
  145. <div
  146. class="base-info-card"
  147. @click="getChartData(4)"
  148. >
  149. <el-tooltip
  150. placement="top"
  151. popper-class="tooltip-dark"
  152. effect="dark"
  153. >
  154. <template #content>
  155. <span class="tooltip-title">维保完成率:</span>{{ '所有项目' + getYearAndMonth() + '维保完成率(所有项目的任务完成数总计*100%/任务总数总计)' }}
  156. </template>
  157. <div class="base-info-title base-info-icon4">
  158. 维保完成率
  159. </div>
  160. </el-tooltip>
  161. <div class="base-info-data">
  162. {{ baseInfoOption.maintainFinishRatehRate }}%
  163. </div>
  164. </div>
  165. </div>
  166. </dataContainer>
  167. </el-row>
  168. <el-row class="one-third-container">
  169. <dataContainer
  170. title="巡检任务"
  171. :tip-content="(project ? filterForm.projectName : '所有项目') + getYearAndMonth() + '已生成巡检任务统计'"
  172. >
  173. <div
  174. id="patrolTask"
  175. class="charts-container"
  176. />
  177. </dataContainer>
  178. </el-row>
  179. </el-col>
  180. <el-col :span="8">
  181. <el-row class="one-third-container">
  182. <dataContainer
  183. title="设备大检预警信息"
  184. :tip-content="(project ? filterForm.projectName : '所有项目') + getYearAndMonth() + '预警中的大检信息'"
  185. >
  186. <div class="warning-info-box">
  187. <div
  188. class="warning-info-move-box"
  189. :style="{
  190. animation: warningInfoList.length <= 2 ? 'none' : '',
  191. 'animation-duration': (warningInfoList.length - 2) + 's'
  192. }"
  193. >
  194. <div
  195. v-for="(item ,index) in warningInfoList"
  196. :key="index"
  197. class="warning-info-card"
  198. >
  199. <div class="warning-info-data">
  200. <div class="warning-info-data-title">
  201. <span>{{ item.projectName }}:</span>
  202. {{ item.addressName }}机房&nbsp;&nbsp;{{ item.sysName }}系统&nbsp;&nbsp;{{ item.deviceName }}设备
  203. </div>
  204. <div class="warning-info-data-content">
  205. {{ item.warningContent }}
  206. </div>
  207. </div>
  208. <div class="warning-info-date">
  209. <div class="warning-info-date-label">
  210. 预警日期:{{ item.warningTime }}
  211. </div>
  212. <div class="warning-info-date-label">
  213. 到期日期:{{ item.inspectionTime }}
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. </dataContainer>
  220. </el-row>
  221. <el-row class="one-third-container">
  222. <dataContainer
  223. title="设备大检任务"
  224. :tip-content="(project ? filterForm.projectName : '所有项目') + '已生成大检任务统计'"
  225. >
  226. <div
  227. id="deviceTask"
  228. class="charts-container"
  229. />
  230. </dataContainer>
  231. </el-row>
  232. <el-row class="one-third-container">
  233. <dataContainer
  234. title="维保任务"
  235. :tip-content="(project ? filterForm.projectName : '所有项目') + getYearAndMonth() + '已生成维保任务统计'"
  236. >
  237. <div
  238. id="maintenanceTask"
  239. class="charts-container"
  240. />
  241. </dataContainer>
  242. </el-row>
  243. </el-col>
  244. </el-row>
  245. <el-drawer
  246. v-model="tableOption.display"
  247. :title="tableOption.title"
  248. size="90%"
  249. custom-class="table-dialog"
  250. >
  251. <div class="drawer-body">
  252. <el-table
  253. v-loading="tableOption.loading"
  254. :data="tableOption.data"
  255. :height="resizeHeight - 190"
  256. stripe
  257. border
  258. fit
  259. >
  260. <el-table-column
  261. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  262. prop="deviceName"
  263. label="设备名称"
  264. align="center"
  265. />
  266. <el-table-column
  267. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  268. prop="deviceCode"
  269. label="设备编码"
  270. align="center"
  271. />
  272. <el-table-column
  273. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  274. prop="deviceState"
  275. label="当前状态"
  276. align="center"
  277. />
  278. <el-table-column
  279. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  280. prop="sysName"
  281. label="所属系统"
  282. align="center"
  283. />
  284. <el-table-column
  285. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  286. prop="devicePartrolName"
  287. label="所属机房"
  288. align="center"
  289. />
  290. <el-table-column
  291. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  292. prop="levelName"
  293. label="系统级别"
  294. align="center"
  295. />
  296. <el-table-column
  297. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  298. prop="isDisable"
  299. label="是否报废"
  300. align="center"
  301. />
  302. <el-table-column
  303. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  304. prop="fmDeviceType"
  305. label="设备/设施"
  306. align="center"
  307. />
  308. <el-table-column
  309. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  310. prop="buildingLocations"
  311. label="设备地址"
  312. align="center"
  313. />
  314. <el-table-column
  315. v-if="tableOption.type == 'deviceStatus' || tableOption.type == 'deviceType'"
  316. prop="isImportant"
  317. label="是否重点设备"
  318. align="center"
  319. >
  320. <template #default="scope">
  321. {{ scope.row.isImportant ? '是' : '否' }}
  322. </template>
  323. </el-table-column>
  324. <el-table-column
  325. v-if="tableOption.type == 'patrolMaintenanceTask'"
  326. prop="projectName"
  327. label="所属项目"
  328. align="center"
  329. />
  330. <el-table-column
  331. v-if="tableOption.type == 'patrolMaintenanceTask'"
  332. prop="addressName"
  333. label="机房"
  334. align="center"
  335. />
  336. <el-table-column
  337. v-if="tableOption.type == 'patrolMaintenanceTask'"
  338. prop="sysName"
  339. label="所属系统"
  340. align="center"
  341. />
  342. <el-table-column
  343. v-if="tableOption.type == 'patrolMaintenanceTask'"
  344. prop="patrolRuleName"
  345. label="计划名称"
  346. align="center"
  347. />
  348. <el-table-column
  349. v-if="tableOption.type == 'patrolMaintenanceTask'"
  350. prop="userName"
  351. label="巡检人员"
  352. align="center"
  353. />
  354. <el-table-column
  355. v-if="tableOption.type == 'patrolMaintenanceTask'"
  356. prop="fullStartDate"
  357. label="开始时间"
  358. align="center"
  359. />
  360. <el-table-column
  361. v-if="tableOption.type == 'patrolMaintenanceTask'"
  362. prop="fullEndDate"
  363. label="结束时间"
  364. align="center"
  365. />
  366. <el-table-column
  367. v-if="tableOption.type == 'patrolMaintenanceTask'"
  368. prop="submitDate"
  369. label="提交时间"
  370. align="center"
  371. />
  372. <el-table-column
  373. v-if="tableOption.type == 'patrolMaintenanceTask'"
  374. prop="taskStateName"
  375. label="巡检状态"
  376. align="center"
  377. />
  378. <el-table-column
  379. v-if="tableOption.type == 'patrolMaintenanceTask'"
  380. prop="handleStateName"
  381. label="审核状态"
  382. align="center"
  383. />
  384. <el-table-column
  385. v-if="tableOption.type == 'patrolMaintenanceTask'"
  386. prop="workingTime"
  387. label="工时(分钟)"
  388. align="center"
  389. />
  390. <el-table-column
  391. v-if="tableOption.type == 'patrolMaintenanceTask'"
  392. prop="serverTime"
  393. label="同步时间"
  394. align="center"
  395. />
  396. <el-table-column
  397. v-if="tableOption.type == 'deviceTask'"
  398. prop="projectName"
  399. label="所属项目"
  400. align="center"
  401. />
  402. <el-table-column
  403. v-if="tableOption.type == 'deviceTask'"
  404. prop="addressName"
  405. label="机房名称"
  406. align="center"
  407. />
  408. <el-table-column
  409. v-if="tableOption.type == 'deviceTask'"
  410. prop="sysName"
  411. label="系统名称"
  412. align="center"
  413. />
  414. <el-table-column
  415. v-if="tableOption.type == 'deviceTask'"
  416. prop="deviceName"
  417. label="设备名称"
  418. align="center"
  419. />
  420. <el-table-column
  421. v-if="tableOption.type == 'deviceTask'"
  422. prop="deviceCode"
  423. label="设备编码"
  424. align="center"
  425. />
  426. <el-table-column
  427. v-if="tableOption.type == 'deviceTask'"
  428. prop="warningStatusName"
  429. label="预警状态"
  430. align="center"
  431. />
  432. <el-table-column
  433. v-if="tableOption.type == 'deviceTask'"
  434. prop="useDate"
  435. label="投入日期"
  436. align="center"
  437. />
  438. <el-table-column
  439. v-if="tableOption.type == 'deviceTask'"
  440. prop="inspectionInterial"
  441. label="大检间隔"
  442. align="center"
  443. />
  444. <el-table-column
  445. v-if="tableOption.type == 'deviceTask'"
  446. prop="warningTime"
  447. label="预警时间"
  448. align="center"
  449. />
  450. <el-table-column
  451. v-if="tableOption.type == 'deviceTask'"
  452. prop="detailName"
  453. label="大检类型"
  454. align="center"
  455. />
  456. </el-table>
  457. <el-pagination
  458. background
  459. layout="total, prev, pager, next"
  460. :total="tableOption.total"
  461. @current-change="handlePageChange"
  462. />
  463. </div>
  464. <div class="drawer-footer">
  465. <el-button
  466. size="medium"
  467. @click="tableOption.display = false"
  468. >
  469. 取 消
  470. </el-button>
  471. </div>
  472. </el-drawer>
  473. <el-drawer
  474. v-model="chartsOption.display"
  475. :title="chartsOption.title"
  476. size="90%"
  477. custom-class="table-dialog"
  478. >
  479. <div class="drawer-body">
  480. <div
  481. id="chartsContainer"
  482. class="charts-container"
  483. style="background-color: #ffffff;"
  484. />
  485. </div>
  486. <div class="drawer-footer">
  487. <el-button
  488. size="medium"
  489. @click="chartsOption.display = false"
  490. >
  491. 取 消
  492. </el-button>
  493. </div>
  494. </el-drawer>
  495. </div>
  496. </template>
  497. <script>
  498. import dataContainer from 'comps/dataContainer/index.vue'
  499. import * as echarts from 'echarts'
  500. import {
  501. getProjectDictionary
  502. } from 'api/dictionary'
  503. import {
  504. getProjectDataOfEngineering,
  505. getDeviceStatusDataOfEngineering,
  506. getDeviceStatusListOfEngineering,
  507. getDeviceTypeDataOfEngineering,
  508. getBaseInfoDataOfEngineering,
  509. getBaseInfoRatioOfEngineering,
  510. getBaseInfoChartsDataOfEngineering,
  511. getBaseInfoRatioChartsDataOfEngineering,
  512. getPatrolTaskDataOfEngineering,
  513. getTaskListOfEngineering,
  514. getWarningInfoDataOfEngineering,
  515. getDeviceTaskDataOfEngineering,
  516. getDeviceTaskListOfEngineering,
  517. getMaintenanceTaskDataOfEngineering
  518. } from 'api/engineering'
  519. export default {
  520. name: 'EngineeringScreen',
  521. components: {
  522. dataContainer
  523. },
  524. props: {
  525. resizeHeight: {
  526. type: Number,
  527. default: 500
  528. }
  529. },
  530. data () {
  531. return {
  532. project: '',
  533. projectList: [],
  534. filterForm: {
  535. companyId: localStorage.companyId || 281,
  536. areaId: '',
  537. projectId: '',
  538. projectName: ''
  539. },
  540. colorList: ['#87c9fa', '#b7e9ff', '#007afc', '#4aa1ff', '#71b5ff', '#26baff', '#e8f5ff', '#299ff6'],
  541. deviceStatusOption: [
  542. { name: '维修中', key: 'repairing', code: 2 },
  543. { name: '关机中', key: 'shutdown', code: 4 },
  544. { name: '维保中', key: 'maintenance', code: 3 },
  545. { name: '故障中', key: 'fault', code: 6 },
  546. { name: '停机中', key: 'stopDown', code: 7 },
  547. { name: '运行中', key: 'running', code: 1 }
  548. ],
  549. deviceTypeOption: [],
  550. projectOption: {
  551. src: '',
  552. title: '',
  553. info: ''
  554. },
  555. baseInfoOption: {
  556. deviceCount: '',
  557. projectCount: '',
  558. devicePartrolCount: '',
  559. intactRate: '',
  560. patrolFinishRate: '',
  561. maintainFinishRatehRate: ''
  562. },
  563. patrolTaskOption: [
  564. { name: '已完成', key: 'finished', code: 1 },
  565. { name: '待完成', key: 'unfinished', code: 0 },
  566. { name: '已销单', key: 'cancel', code: 5 },
  567. { name: '已过期', key: 'overDue', code: 2 },
  568. { name: '未派单', key: 'notDeliver', code: 6 },
  569. { name: '审核关闭', key: 'closed', code: 7 }
  570. ],
  571. warningInfoList: [],
  572. deviceTaskOption: [
  573. { name: '待处理', key: '0' },
  574. { name: '已处理', key: '1' },
  575. { name: '已超期', key: '2' }
  576. ],
  577. maintenanceTaskOption: [
  578. { name: '已完成', key: 'finished', code: 1 },
  579. { name: '待完成', key: 'unfinished', code: 0 },
  580. { name: '已销单', key: 'cancel', code: 5 },
  581. { name: '已过期', key: 'overDue', code: 2 },
  582. { name: '未派单', key: 'notDeliver', code: 6 },
  583. { name: '审核关闭', key: 'closed', code: 7 }
  584. ],
  585. tableOption: {
  586. filterForm: {},
  587. api: '',
  588. title: '',
  589. type: '',
  590. pageIndex: 1,
  591. pageSize: 10,
  592. total: 0,
  593. loading: false,
  594. display: false,
  595. data: []
  596. },
  597. chartsOption: {
  598. title: '',
  599. display: false
  600. }
  601. }
  602. },
  603. mounted () {
  604. getProjectDictionary({
  605. companyId: localStorage.companyId || 281
  606. }).then(res => {
  607. if (res.status == 200) {
  608. this.projectList = res.data
  609. }
  610. })
  611. this.getScreenData()
  612. setInterval(() => {
  613. this.getScreenData()
  614. }, 60000)
  615. window.addEventListener('resize', this.resizePage)
  616. },
  617. methods: {
  618. // 获取当前年月
  619. getYearAndMonth () {
  620. return new Date().getFullYear() + '年' + (new Date().getMonth() + 1) + '月'
  621. },
  622. // 选取项目过滤图表
  623. filterCharts (value) {
  624. this.filterForm = {
  625. companyId: localStorage.companyId || 281,
  626. areaId: '',
  627. projectId: '',
  628. projectName: ''
  629. }
  630. if (value) {
  631. const projectOption = this.projectList.find(item => item.projectId == value)
  632. this.filterForm = {
  633. companyId: projectOption.companyId,
  634. areaId: projectOption.areaId,
  635. projectId: projectOption.projectId,
  636. projectName: projectOption.projectName
  637. }
  638. getProjectDataOfEngineering({
  639. projectId: this.filterForm.projectId
  640. }).then(res => {
  641. if (res.resultCode == 200) {
  642. this.projectOption = {
  643. src: res.data.imagePath,
  644. title: res.data.projectName,
  645. info: res.data.projectDesc
  646. }
  647. }
  648. })
  649. }
  650. this.getScreenData()
  651. },
  652. // 获取数据可视化数据
  653. getScreenData () {
  654. // 获取设备状态数据
  655. this.getDeviceStatusData()
  656. this.getDeviceTypeData()
  657. this.getBaseInfoData()
  658. this.getPatrolTaskData()
  659. this.getWarningInfoData()
  660. this.getDeviceTaskData()
  661. this.getMaintenanceTaskData()
  662. },
  663. // 获取设备状态数据
  664. getDeviceStatusData () {
  665. const that = this
  666. getDeviceStatusDataOfEngineering(this.filterForm).then(res => {
  667. if (res.status == 200) {
  668. const myChart = echarts.init(document.getElementById('deviceStatus'))
  669. myChart.clear()
  670. myChart.off('click')
  671. myChart.off('legendselectchanged')
  672. myChart.setOption({
  673. color: this.colorList,
  674. title: {
  675. text: '状态总数',
  676. subtext: res.data.total,
  677. textStyle: {
  678. color: '#46AEFD',
  679. fontSize: 12
  680. },
  681. subtextStyle: {
  682. fontSize: 14,
  683. color: '#FFFFFF'
  684. },
  685. left: 'center',
  686. top: '34%'
  687. },
  688. legend: {
  689. icon: 'circle',
  690. bottom: '10',
  691. orient: 'horizontal',
  692. itemGap: 20,
  693. formatter: function (name) {
  694. return '{nam|' + name + ' }\n{val|' + res.data[that.deviceStatusOption.find(item => item.name == name).key] + '}'
  695. },
  696. textStyle: {
  697. rich: {
  698. nam: {
  699. padding: [0, 80, 0, 0],
  700. align: 'center',
  701. lineHeight: 28,
  702. color: '#51D0FF'
  703. },
  704. val: {
  705. padding: [0, 80, 0, 0],
  706. align: 'center',
  707. color: '#FFB17C'
  708. }
  709. }
  710. }
  711. },
  712. series: [
  713. {
  714. name: '设备状态',
  715. type: 'pie',
  716. radius: ['35%', '50%'],
  717. center: ['50%', '40%'],
  718. minAngle: 0.5,
  719. roseType: 'radius',
  720. label: {
  721. formatter: '{b}: {c}'
  722. },
  723. labelLine: {
  724. normal: {
  725. length: 30,
  726. length2: 20
  727. }
  728. },
  729. itemStyle: {
  730. shadowColor: '#4db2ff',
  731. shadowBlur: 8
  732. },
  733. data: that.deviceStatusOption.map((item, index) => {
  734. return {
  735. name: item.name,
  736. value: res.data[item.key],
  737. through: item.through
  738. }
  739. }).sort((a, b) => {
  740. return b.value - a.value
  741. }).map((item, index) => {
  742. return {
  743. name: item.name,
  744. value: item.value,
  745. label: {
  746. color: item.through ? '#F56C6C' : this.colorList[index]
  747. }
  748. }
  749. })
  750. }
  751. ]
  752. })
  753. myChart.on('click', (params) => {
  754. this.showDeviceStatusTable(params)
  755. })
  756. myChart.on('legendselectchanged', (params) => {
  757. this.showDeviceStatusTable(params)
  758. myChart.dispatchAction({
  759. type: 'legendSelect',
  760. name: params.name
  761. })
  762. })
  763. }
  764. })
  765. },
  766. // 展示设备状态数据
  767. showDeviceStatusTable (params) {
  768. this.tableOption.api = getDeviceStatusListOfEngineering
  769. this.tableOption.filterForm = {
  770. deviceState: this.deviceStatusOption.find(item => item.name == params.name).code
  771. }
  772. this.tableOption.title = params.name + '设备'
  773. this.tableOption.type = 'deviceStatus'
  774. this.tableOption.pageIndex = 1
  775. this.tableOption.data = []
  776. this.tableOption.display = true
  777. this.getTableList()
  778. },
  779. // 获取设备类型数据
  780. getDeviceTypeData () {
  781. getDeviceTypeDataOfEngineering(this.filterForm).then(res => {
  782. if (res.status == 200) {
  783. this.deviceTypeOption = res.data.sysNum
  784. const myChart = echarts.init(document.getElementById('deviceType'))
  785. myChart.clear()
  786. myChart.off('click')
  787. myChart.off('legendselectchanged')
  788. myChart.setOption({
  789. color: this.colorList,
  790. title: {
  791. text: '类型总数',
  792. subtext: res.data.sysNum.reduce((total, item) => {
  793. return total + parseInt(item.value)
  794. }, 0),
  795. textStyle: {
  796. color: '#46AEFD',
  797. fontSize: 12
  798. },
  799. subtextStyle: {
  800. fontSize: 14,
  801. color: '#FFFFFF'
  802. },
  803. left: 'center',
  804. top: '32%'
  805. },
  806. legend: {
  807. icon: 'circle',
  808. bottom: '10',
  809. left: 'center',
  810. orient: 'horizontal',
  811. itemGap: 20,
  812. formatter: function (name) {
  813. return '{nam|' + name + ' }\n{val|' + res.data.sysNum.find(item => item.name == name).value + '}'
  814. },
  815. textStyle: {
  816. rich: {
  817. nam: {
  818. padding: [0, 80, 0, 0],
  819. align: 'center',
  820. lineHeight: 28,
  821. color: '#51D0FF'
  822. },
  823. val: {
  824. padding: [0, 80, 0, 0],
  825. align: 'center',
  826. color: '#FFB17C'
  827. }
  828. }
  829. }
  830. },
  831. series: [
  832. {
  833. name: '设备类型',
  834. type: 'pie',
  835. radius: ['32%', '45%'],
  836. center: ['50%', '38%'],
  837. minAngle: 0.5,
  838. roseType: 'radius',
  839. label: {
  840. formatter: '{b}: {c}'
  841. },
  842. labelLine: {
  843. normal: {
  844. length: 30,
  845. length2: 20
  846. }
  847. },
  848. itemStyle: {
  849. shadowColor: '#4db2ff',
  850. shadowBlur: 8
  851. },
  852. data: res.data.sysNum.map((item, index) => {
  853. return {
  854. name: item.name,
  855. value: item.value,
  856. id: item.id,
  857. id1: 'wsad',
  858. label: {
  859. color: this.colorList[index]
  860. }
  861. }
  862. }).sort((a, b) => {
  863. return b.value - a.value
  864. })
  865. }
  866. ]
  867. })
  868. myChart.on('click', (params) => {
  869. this.showDeviceTypeTable(params)
  870. })
  871. myChart.on('legendselectchanged', (params) => {
  872. this.showDeviceTypeTable(params)
  873. myChart.dispatchAction({
  874. type: 'legendSelect',
  875. name: params.name
  876. })
  877. })
  878. }
  879. })
  880. },
  881. // 展示设备类型数据
  882. showDeviceTypeTable (params) {
  883. this.tableOption.api = getDeviceStatusListOfEngineering
  884. this.tableOption.filterForm = {
  885. sysId: this.deviceTypeOption.find(item => item.name == params.name).id
  886. }
  887. this.tableOption.title = params.name + '设备'
  888. this.tableOption.type = 'deviceType'
  889. this.tableOption.pageIndex = 1
  890. this.tableOption.data = []
  891. this.tableOption.display = true
  892. this.getTableList()
  893. },
  894. // 获取基础数据
  895. getBaseInfoData () {
  896. getBaseInfoDataOfEngineering(this.filterForm).then(res => {
  897. if (res.status == 200) {
  898. this.baseInfoOption.deviceCount = res.data.deviceCount
  899. this.baseInfoOption.projectCount = res.data.projectCount
  900. this.baseInfoOption.devicePartrolCount = res.data.devicePartrolCount
  901. }
  902. })
  903. getBaseInfoRatioOfEngineering(this.filterForm).then(res => {
  904. if (res.status == 200) {
  905. this.baseInfoOption.intactRate = res.data.intactRate
  906. this.baseInfoOption.patrolFinishRate = res.data.patrolFinishRate
  907. this.baseInfoOption.maintainFinishRatehRate = res.data.maintainFinishRatehRate
  908. }
  909. })
  910. },
  911. // 获取巡检任务数据
  912. getPatrolTaskData () {
  913. const that = this
  914. getPatrolTaskDataOfEngineering(this.filterForm).then(res => {
  915. if (res.status == 200) {
  916. const myChart = echarts.init(document.getElementById('patrolTask'))
  917. myChart.clear()
  918. myChart.off('click')
  919. myChart.off('legendselectchanged')
  920. myChart.setOption({
  921. color: this.colorList,
  922. title: {
  923. text: '任务总数',
  924. subtext: res.data.total,
  925. textAlign: 'center',
  926. textStyle: {
  927. color: '#46AEFD',
  928. fontSize: 12
  929. },
  930. subtextStyle: {
  931. fontSize: 14,
  932. color: '#FFFFFF'
  933. },
  934. left: '33%',
  935. top: '40%'
  936. },
  937. legend: {
  938. icon: 'circle',
  939. width: 200,
  940. height: 180,
  941. right: '10',
  942. top: 'center',
  943. orient: 'vertical',
  944. itemGap: 20,
  945. formatter: function (name) {
  946. return '{nam|' + name + ' }\n{val|' + res.data[that.patrolTaskOption.find(item => item.name == name).key] + '}'
  947. },
  948. textStyle: {
  949. rich: {
  950. nam: {
  951. padding: [0, 80, 0, 0],
  952. align: 'center',
  953. lineHeight: 28,
  954. color: '#51D0FF'
  955. },
  956. val: {
  957. padding: [0, 80, 0, 0],
  958. align: 'center',
  959. color: '#FFB17C'
  960. }
  961. }
  962. }
  963. },
  964. series: [
  965. {
  966. name: '巡检任务',
  967. type: 'pie',
  968. radius: ['40%', '68%'],
  969. center: ['34%', '50%'],
  970. minAngle: 0.5,
  971. roseType: 'radius',
  972. label: {
  973. formatter: '{b}: {c}'
  974. },
  975. labelLine: {
  976. length: 20
  977. },
  978. labelLayout: {
  979. moveOverlap: 'shiftY'
  980. },
  981. itemStyle: {
  982. shadowColor: '#4db2ff',
  983. shadowBlur: 8
  984. },
  985. data: that.patrolTaskOption.map((item, index) => {
  986. return {
  987. name: item.name,
  988. value: res.data[item.key],
  989. through: item.through
  990. }
  991. }).sort((a, b) => {
  992. return b.value - a.value
  993. }).map((item, index) => {
  994. return {
  995. name: item.name,
  996. value: item.value,
  997. label: {
  998. color: item.through ? '#F56C6C' : this.colorList[index]
  999. }
  1000. }
  1001. })
  1002. }
  1003. ]
  1004. })
  1005. myChart.on('click', (params) => {
  1006. this.showPatrolTaskTable(params)
  1007. })
  1008. myChart.on('legendselectchanged', (params) => {
  1009. this.showPatrolTaskTable(params)
  1010. myChart.dispatchAction({
  1011. type: 'legendSelect',
  1012. name: params.name
  1013. })
  1014. })
  1015. }
  1016. })
  1017. },
  1018. // 展示巡检任务数据
  1019. showPatrolTaskTable (params) {
  1020. this.tableOption.api = getTaskListOfEngineering
  1021. this.tableOption.filterForm = {
  1022. lpCategory: 1,
  1023. taskState: this.patrolTaskOption.find(item => item.name == params.name).code
  1024. }
  1025. this.tableOption.title = params.name + '任务'
  1026. this.tableOption.type = 'patrolMaintenanceTask'
  1027. this.tableOption.pageIndex = 1
  1028. this.tableOption.data = []
  1029. this.tableOption.display = true
  1030. this.getTableList()
  1031. },
  1032. // 获取预警信息数据
  1033. getWarningInfoData () {
  1034. getWarningInfoDataOfEngineering(this.filterForm).then(res => {
  1035. if (res.status == 200) {
  1036. this.warningInfoList = res.data.warningInfoList
  1037. }
  1038. })
  1039. },
  1040. // 获取设备大检任务数据
  1041. getDeviceTaskData () {
  1042. const that = this
  1043. getDeviceTaskDataOfEngineering(this.filterForm).then(res => {
  1044. if (res.status == 200) {
  1045. const myChart = echarts.init(document.getElementById('deviceTask'))
  1046. myChart.clear()
  1047. myChart.off('click')
  1048. myChart.off('legendselectchanged')
  1049. myChart.setOption({
  1050. color: this.colorList,
  1051. title: {
  1052. text: '任务总数',
  1053. subtext: res.data.warningInfoTotal,
  1054. textAlign: 'center',
  1055. textStyle: {
  1056. color: '#46AEFD',
  1057. fontSize: 12
  1058. },
  1059. subtextStyle: {
  1060. fontSize: 14,
  1061. color: '#FFFFFF'
  1062. },
  1063. left: '33%',
  1064. top: '40%'
  1065. },
  1066. legend: {
  1067. icon: 'circle',
  1068. width: 200,
  1069. height: 180,
  1070. right: '10',
  1071. top: 'center',
  1072. orient: 'vertical',
  1073. itemGap: 20,
  1074. formatter: function (name) {
  1075. const site = res.data.warningInfoCount.find(site => site.warningStatusName == name)
  1076. return '{nam|' + name + ' }\n{val|' + (site ? site.countNum : 0) + '}'
  1077. },
  1078. textStyle: {
  1079. rich: {
  1080. nam: {
  1081. padding: [0, 80, 0, 0],
  1082. align: 'center',
  1083. lineHeight: 28,
  1084. color: '#51D0FF'
  1085. },
  1086. val: {
  1087. padding: [0, 80, 0, 0],
  1088. align: 'center',
  1089. color: '#FFB17C'
  1090. }
  1091. }
  1092. }
  1093. },
  1094. series: [
  1095. {
  1096. name: '巡检任务',
  1097. type: 'pie',
  1098. radius: ['40%', '68%'],
  1099. center: ['34%', '50%'],
  1100. minAngle: 0.5,
  1101. roseType: 'radius',
  1102. label: {
  1103. formatter: '{b}: {c}'
  1104. },
  1105. labelLine: {
  1106. length: 20
  1107. },
  1108. labelLayout: {
  1109. moveOverlap: 'shiftY'
  1110. },
  1111. itemStyle: {
  1112. shadowColor: '#4db2ff',
  1113. shadowBlur: 8
  1114. },
  1115. data: that.deviceTaskOption.map((item, index) => {
  1116. const site = res.data.warningInfoCount.find(site => site.warningStatus == item.key)
  1117. return {
  1118. name: item.name,
  1119. value: site ? site.countNum : 0,
  1120. through: item.through
  1121. }
  1122. }).sort((a, b) => {
  1123. return b.value - a.value
  1124. }).map((item, index) => {
  1125. return {
  1126. name: item.name,
  1127. value: item.value,
  1128. label: {
  1129. color: item.through ? '#F56C6C' : this.colorList[index]
  1130. }
  1131. }
  1132. })
  1133. }
  1134. ]
  1135. })
  1136. myChart.on('click', (params) => {
  1137. this.showDeviceTaskTable(params)
  1138. })
  1139. myChart.on('legendselectchanged', (params) => {
  1140. this.showDeviceTaskTable(params)
  1141. myChart.dispatchAction({
  1142. type: 'legendSelect',
  1143. name: params.name
  1144. })
  1145. })
  1146. }
  1147. })
  1148. },
  1149. // 展示设备大检任务数据
  1150. showDeviceTaskTable (params) {
  1151. this.tableOption.api = getDeviceTaskListOfEngineering
  1152. this.tableOption.filterForm = {
  1153. warningStatus: this.deviceTaskOption.find(item => item.name == params.name).key
  1154. }
  1155. this.tableOption.title = params.name + '任务'
  1156. this.tableOption.type = 'deviceTask'
  1157. this.tableOption.pageIndex = 1
  1158. this.tableOption.data = []
  1159. this.tableOption.display = true
  1160. this.getTableList()
  1161. },
  1162. // 获取维保任务数据
  1163. getMaintenanceTaskData () {
  1164. const that = this
  1165. getMaintenanceTaskDataOfEngineering(this.filterForm).then(res => {
  1166. if (res.status == 200) {
  1167. const myChart = echarts.init(document.getElementById('maintenanceTask'))
  1168. myChart.clear()
  1169. myChart.off('click')
  1170. myChart.off('legendselectchanged')
  1171. myChart.setOption({
  1172. color: this.colorList,
  1173. title: {
  1174. text: '任务总数',
  1175. subtext: res.data.warningInfoTotal,
  1176. textAlign: 'center',
  1177. textStyle: {
  1178. color: '#46AEFD',
  1179. fontSize: 12
  1180. },
  1181. subtextStyle: {
  1182. fontSize: 14,
  1183. color: '#FFFFFF'
  1184. },
  1185. left: '33%',
  1186. top: '40%'
  1187. },
  1188. legend: {
  1189. icon: 'circle',
  1190. width: 200,
  1191. height: 180,
  1192. right: '10',
  1193. top: 'center',
  1194. orient: 'vertical',
  1195. itemGap: 20,
  1196. formatter: function (name) {
  1197. return '{nam|' + name + ' }\n{val|' + res.data[that.maintenanceTaskOption.find(item => item.name == name).key] + '}'
  1198. },
  1199. textStyle: {
  1200. rich: {
  1201. nam: {
  1202. padding: [0, 80, 0, 0],
  1203. align: 'center',
  1204. lineHeight: 28,
  1205. color: '#51D0FF'
  1206. },
  1207. val: {
  1208. padding: [0, 80, 0, 0],
  1209. align: 'center',
  1210. color: '#FFB17C'
  1211. }
  1212. }
  1213. }
  1214. },
  1215. series: [
  1216. {
  1217. name: '巡检任务',
  1218. type: 'pie',
  1219. radius: ['40%', '68%'],
  1220. center: ['34%', '50%'],
  1221. minAngle: 0.5,
  1222. roseType: 'radius',
  1223. label: {
  1224. formatter: '{b}: {c}'
  1225. },
  1226. labelLine: {
  1227. length: 20
  1228. },
  1229. labelLayout: {
  1230. moveOverlap: 'shiftY'
  1231. },
  1232. itemStyle: {
  1233. shadowColor: '#4db2ff',
  1234. shadowBlur: 8
  1235. },
  1236. data: that.maintenanceTaskOption.map((item, index) => {
  1237. return {
  1238. name: item.name,
  1239. value: res.data[item.key],
  1240. through: item.through
  1241. }
  1242. }).sort((a, b) => {
  1243. return b.value - a.value
  1244. }).map((item, index) => {
  1245. return {
  1246. name: item.name,
  1247. value: item.value,
  1248. label: {
  1249. color: item.through ? '#F56C6C' : this.colorList[index]
  1250. }
  1251. }
  1252. })
  1253. }
  1254. ]
  1255. })
  1256. myChart.on('click', (params) => {
  1257. this.showMaintenanceTaskTable(params)
  1258. })
  1259. myChart.on('legendselectchanged', (params) => {
  1260. this.showMaintenanceTaskTable(params)
  1261. myChart.dispatchAction({
  1262. type: 'legendSelect',
  1263. name: params.name
  1264. })
  1265. })
  1266. }
  1267. })
  1268. },
  1269. // 展示维保任务数据
  1270. showMaintenanceTaskTable (params) {
  1271. this.tableOption.api = getTaskListOfEngineering
  1272. this.tableOption.filterForm = {
  1273. lpCategory: 2,
  1274. taskState: this.maintenanceTaskOption.find(item => item.name == params.name).code
  1275. }
  1276. this.tableOption.title = params.name + '任务'
  1277. this.tableOption.type = 'patrolMaintenanceTask'
  1278. this.tableOption.pageIndex = 1
  1279. this.tableOption.data = []
  1280. this.tableOption.display = true
  1281. this.getTableList()
  1282. },
  1283. // 切换页面
  1284. handlePageChange (val) {
  1285. this.tableOption.pageIndex = val
  1286. this.getTableList()
  1287. },
  1288. // 获取列表
  1289. getTableList () {
  1290. this.tableOption.loading = true
  1291. this.tableOption.api({
  1292. ...this.filterForm,
  1293. ...this.tableOption.filterForm,
  1294. pageIndex: this.tableOption.pageIndex,
  1295. pageSize: this.tableOption.pageSize
  1296. }).then(res => {
  1297. this.tableOption.loading = false
  1298. if (res.status == 200) {
  1299. this.tableOption.data = res.data.records
  1300. this.tableOption.total = res.data.total
  1301. }
  1302. })
  1303. },
  1304. // 获取图表数据
  1305. getChartData (type) {
  1306. if (this.project) {
  1307. return false
  1308. }
  1309. if (type == 1) {
  1310. this.chartsOption.display = true
  1311. this.chartsOption.title = '在管设备'
  1312. getBaseInfoChartsDataOfEngineering({
  1313. ...this.filterForm
  1314. }).then(res => {
  1315. if (res.status == 200) {
  1316. const myChart = echarts.init(document.getElementById('chartsContainer'))
  1317. myChart.clear()
  1318. myChart.setOption({
  1319. color: ['#286be0'],
  1320. legend: {
  1321. top: '4%',
  1322. data: ['设备数量']
  1323. },
  1324. grid: {
  1325. left: '5%',
  1326. right: '5%',
  1327. top: '10%',
  1328. bottom: '5%',
  1329. containLabel: true
  1330. },
  1331. xAxis: {
  1332. type: 'category',
  1333. data: res.data.map(item => {
  1334. return item.projectName
  1335. })
  1336. },
  1337. yAxis: {
  1338. type: 'value'
  1339. },
  1340. series: [{
  1341. name: '设备数量',
  1342. type: 'bar',
  1343. label: {
  1344. show: true,
  1345. position: 'top'
  1346. },
  1347. data: res.data.map(item => {
  1348. return item.deviceNum
  1349. })
  1350. }]
  1351. })
  1352. }
  1353. })
  1354. } else if (type == 3 || type == 4) {
  1355. this.tableOption.filterForm = {
  1356. lpCategory: type == 3 ? 1 : 2
  1357. }
  1358. this.chartsOption.display = true
  1359. this.chartsOption.title = type == 3 ? '巡检完成率' : '维保完成率'
  1360. getBaseInfoRatioChartsDataOfEngineering({
  1361. ...this.filterForm,
  1362. lpCategory: type == 3 ? 1 : 2
  1363. }).then(res => {
  1364. if (res.status == 200) {
  1365. const myChart = echarts.init(document.getElementById('chartsContainer'))
  1366. myChart.clear()
  1367. myChart.off('click')
  1368. const sourceType = res.data.map(item => {
  1369. return item.projectName
  1370. })
  1371. sourceType.unshift('ratio')
  1372. const sourceData1 = res.data.map(item => {
  1373. return item.finishRate
  1374. })
  1375. sourceData1.unshift('完成率')
  1376. const sourceData2 = res.data.map(item => {
  1377. return item.unFinishRate
  1378. })
  1379. sourceData2.unshift('未完成率')
  1380. myChart.setOption({
  1381. color: ['#286be0', '#87c9fa'],
  1382. legend: {
  1383. top: res.data.length > 6 ? 'middle' : '4%',
  1384. left: res.data.length <= 6 ? 'center' : '1%',
  1385. orient: res.data.length > 6 ? 'vertical' : 'horizontal',
  1386. tooltip: {
  1387. show: true,
  1388. formatter: (params) => {
  1389. return params.name == '完成率' ? '完成率:任务完成数÷任务总数×100%(包含特殊关闭)' : '未完成率:(任务未完成数+已过期数+特殊关闭)÷任务总数×100%(包含特殊关闭)'
  1390. }
  1391. }
  1392. },
  1393. dataset: {
  1394. source: [
  1395. sourceType,
  1396. sourceData1,
  1397. sourceData2
  1398. ]
  1399. },
  1400. tooltip: {
  1401. trigger: 'item',
  1402. formatter: '{b}:{d}%'
  1403. },
  1404. series: res.data.map((item, index) => {
  1405. return {
  1406. type: 'pie',
  1407. radius: res.data.length <= 9 ? '30%' : (100 / Math.ceil(res.data.length / 3) - 4) + '%',
  1408. center: [
  1409. 100 / 6 * ((index % 3) * 2 + 1) + '%',
  1410. 50 / Math.ceil(res.data.length / 3) * (Math.floor(index / 3) * 2 + 1) + '%'
  1411. ],
  1412. encode: {
  1413. itemName: 'ratio',
  1414. value: item.projectName
  1415. },
  1416. label: {
  1417. position: 'inner',
  1418. fontSize: 14,
  1419. color: '#ffffff',
  1420. formatter: '{d}%'
  1421. },
  1422. markPoint: {
  1423. symbol: 'roundRect',
  1424. itemStyle: {
  1425. color: 'transparent'
  1426. },
  1427. tooltip: {
  1428. show: false
  1429. },
  1430. data: [
  1431. {
  1432. name: item.triangle,
  1433. x: 100 / 6 * ((index % 3) * 2 + 1) + '%',
  1434. y: 50 / Math.ceil(res.data.length / 3) * (Math.floor(index / 3 + 1) * 2) - 4 + '%',
  1435. label: {
  1436. normal: {
  1437. show: true,
  1438. width: '33%',
  1439. align: 'center',
  1440. formatter: item.projectName,
  1441. color: '#000000',
  1442. fontSize: 18,
  1443. fontWeight: 'bold'
  1444. }
  1445. }
  1446. }
  1447. ]
  1448. }
  1449. }
  1450. })
  1451. })
  1452. myChart.on('click', (params) => {
  1453. this.tableOption.api = getTaskListOfEngineering
  1454. this.tableOption.filterForm = {
  1455. lpCategory: this.tableOption.filterForm.lpCategory,
  1456. finishType: params.name == '完成率' ? 1 : 2,
  1457. companyId: localStorage.companyId,
  1458. projectId: res.data[params.componentIndex].projectId
  1459. }
  1460. this.tableOption.title = params.name == '完成率' ? '已完成任务' : '未完成任务'
  1461. this.tableOption.type = 'patrolMaintenanceTask'
  1462. this.tableOption.pageIndex = 1
  1463. this.tableOption.data = []
  1464. this.tableOption.display = true
  1465. this.getTableList()
  1466. })
  1467. }
  1468. })
  1469. }
  1470. },
  1471. resizePage () {
  1472. this.$nextTick(() => {
  1473. echarts.init(document.getElementById('deviceStatus')).resize()
  1474. echarts.init(document.getElementById('deviceType')).resize()
  1475. echarts.init(document.getElementById('patrolTask')).resize()
  1476. echarts.init(document.getElementById('deviceTask')).resize()
  1477. echarts.init(document.getElementById('maintenanceTask')).resize()
  1478. try {
  1479. echarts.init(document.getElementById('chartsContainer')).resize()
  1480. } catch (e) {
  1481. console.log('--')
  1482. }
  1483. })
  1484. }
  1485. }
  1486. }
  1487. </script>
  1488. <style scoped lang="scss">
  1489. .base-info-container{
  1490. width: calc(100% + 10px);
  1491. margin-left: -5px;
  1492. display: flex;
  1493. height: 7vw;
  1494. .base-info-card{
  1495. width: calc(25% - 8px);
  1496. height: 100%;
  1497. margin: 4px;
  1498. padding: 15px 5px 15px 20px;
  1499. .base-info-title{
  1500. height: 3vh;
  1501. font-size: 1.6vh;
  1502. line-height: 3vh;
  1503. background-size: 2.2vh;
  1504. }
  1505. .base-info-data{
  1506. width: 100%;
  1507. height: calc(100% - 6vh);
  1508. font-size: 2.4vh;
  1509. }
  1510. .base-info-tip{
  1511. height: 4vh;
  1512. font-size: 1.2vh;
  1513. line-height: 2vh;
  1514. }
  1515. }
  1516. }
  1517. </style>