index.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  1. <template>
  2. <div>
  3. <el-row :gutter="10">
  4. <el-col :span="8">
  5. <el-card shadow="always" style="height:280px">
  6. <div ref="rtuInfoCountChart" style="width: 100%;height: 280px;">
  7. </div>
  8. </el-card>
  9. </el-col>
  10. <el-col :span="8">
  11. <el-card shadow="always" style="height:280px">
  12. <div ref="checkOrderChart" style="width: 100%;height: 280px;">
  13. </div>
  14. </el-card>
  15. </el-col>
  16. <el-col :span="8">
  17. <el-card shadow="always" style="height:280px">
  18. <div ref="equipmentInspectionCountChart" style="width: 100%;height: 280px;">
  19. </div>
  20. </el-card>
  21. </el-col>
  22. </el-row>
  23. <el-row :gutter="10">
  24. <el-col :span="8">
  25. <el-card style="width: 100%;height: 500px;overflow-y: auto;">
  26. <div slot="header" class="clearfix">
  27. <span>今日维修任务动态</span>
  28. <el-button style="float: right; padding: 3px 0" type="text"
  29. @click="openMoreTodayOrderProcess">更多</el-button>
  30. </div>
  31. <div v-for="(item, index) in todayOrderList" :key="index" class="list-item">
  32. <el-row type="flex">
  33. <el-col :span="20">
  34. <div style="display: flex; flex-direction: row;align-items: center;">
  35. <label>{{ item.rtuName }}</label>
  36. <label style="margin-left: 5px;color: gray;"> / {{ item.rtuCode }}</label>
  37. </div>
  38. <div style="display: flex; flex-direction: row;align-items: center;margin-top: 4px;">
  39. <label style="margin-right: 10px;">维修状态:<span style="color:gray">{{
  40. item.orderStatusName }}</span></label>
  41. </div>
  42. <div style="display: flex; flex-direction: row;align-items: center;margin-top: 4px;">
  43. <label>更新时间:<span style="color:gray">{{ item.updateTime }}</span></label>
  44. </div>
  45. <div style="margin-top: 4px;margin-bottom: 5px;">
  46. <label>备注:<span style="color:gray">{{ item.processDesc }}</span></label>
  47. </div>
  48. </el-col>
  49. <el-col :span="4" style="display: flex;flex-direction: column;justify-content: center;">
  50. <el-button style="margin-right: 10px;" size="mini" type="info" round
  51. @click="openCheckOrderReportDetail(item)">查看详情</el-button>
  52. </el-col>
  53. </el-row>
  54. </div>
  55. </el-card>
  56. </el-col>
  57. <el-col :span="8">
  58. <el-card style="width: 100%;height: 500px;overflow-y: auto;">
  59. <div slot="header" class="clearfix">
  60. <span>今日巡检动态</span>
  61. <el-button style="float: right; padding: 3px 0" type="text"
  62. @click="openMoreTodayInspectionReport">更多</el-button>
  63. </div>
  64. <div v-for="(item, index) in todayInspectionReportList" :key="index" class="list-item">
  65. <el-row type="flex">
  66. <el-col :span="20">
  67. <div style="display: flex; flex-direction: row;align-items: center;">
  68. <label>{{ item.rtuName }}</label>
  69. <label style="margin-left: 5px;color: gray;"> / {{ item.rtuCode }}</label>
  70. </div>
  71. <div style="display: flex; flex-direction: row;align-items: center;margin-top: 4px;">
  72. <label style="margin-right: 10px;">填报人:<span style="color:gray">{{
  73. item.servicePersonName
  74. }}</span></label>
  75. </div>
  76. <div
  77. style="display: flex; flex-direction: row;align-items: center;margin-top: 4px;margin-bottom: 5px;">
  78. <label>填报时间:<span style="color:gray">{{ item.updateTime }}</span></label>
  79. </div>
  80. </el-col>
  81. <el-col :span="4" style="display: flex;flex-direction: column;justify-content: center;">
  82. <el-button style="margin-right: 10px;" size="mini" type="info" round
  83. @click="openInspectionReportDetail(item)">查看详情</el-button>
  84. </el-col>
  85. </el-row>
  86. </div>
  87. </el-card>
  88. </el-col>
  89. <el-col :span="8">
  90. <el-row>
  91. <el-col :span="24">
  92. <el-card class="box-card-news">
  93. <div slot="header" class="clearfix">
  94. <span>通知公告</span>
  95. <el-button style="float: right; padding: 3px 0" type="text"
  96. @click="openMoreNotice">更多</el-button>
  97. </div>
  98. <div v-for="(item, index) in noticeList" :key="index" class="notice-item">
  99. <div>
  100. <label>{{ item.title }}</label>
  101. </div>
  102. <div style="margin-top: 4px;">
  103. <label class="notice-time">发布时间: {{ item.releaseTime }}</label>
  104. </div>
  105. <div style="margin-top: 4px;margin-bottom: 2px;">
  106. <label>{{
  107. item.content
  108. }}</label>
  109. </div>
  110. </div>
  111. </el-card>
  112. </el-col>
  113. </el-row>
  114. <el-row>
  115. <el-col :span="24">
  116. <el-card class="box-card-apk">
  117. <div slot="header" class="clearfix">
  118. <span>手机客户端下载</span>
  119. </div>
  120. <div>
  121. <img style="width: 100px;height: 100px;" :src="appinfo.apkQrUrl" />
  122. </div>
  123. <div style="margin-top: 4px;">
  124. <label style="padding-left: 5px;font-size: 0.8rem;">版本号 {{ appinfo.version }}</label>
  125. </div>
  126. <div style="margin-top: 4px;">
  127. <el-button type="text" @click="downloadApk">下载安卓客户端</el-button>
  128. </div>
  129. </el-card>
  130. </el-col>
  131. </el-row>
  132. </el-col>
  133. </el-row>
  134. <el-drawer title="今日维修任务动态" :visible.sync="moreTodayOrderProcessDig" v-if="moreTodayOrderProcessDig" size="50%"
  135. :close-on-click-modal="false" append-to-body>
  136. <todaycheckorderprocesslist ref="todaycheckorderprocesslist">
  137. </todaycheckorderprocesslist>
  138. </el-drawer>
  139. <el-drawer title="今日巡检动态" :visible.sync="moreTodayInspectionReportDig" v-if="moreTodayInspectionReportDig"
  140. size="50%" :close-on-click-modal="false" append-to-body>
  141. <todaynspectionrportlist ref="todaynspectionrportlist"></todaynspectionrportlist>
  142. </el-drawer>
  143. <el-drawer title="通知公告" :visible.sync="moreNoticeDig" v-if="moreNoticeDig" size="50%" :close-on-click-modal="false"
  144. append-to-body>
  145. <todaynoticelist ref="todaynoticelist"></todaynoticelist>
  146. </el-drawer>
  147. <el-drawer title="异常测站信息" :visible.sync="warninglistDig" v-if="warninglistDig" size="50%"
  148. :close-on-click-modal="false" append-to-body>
  149. <warninglist ref="warninglist"></warninglist>
  150. </el-drawer>
  151. <el-drawer title="未确认维修任务" :visible.sync="uncomfireCheckOrderDig" v-if="uncomfireCheckOrderDig" size="50%"
  152. :close-on-click-modal="false" append-to-body>
  153. <uncomfirecheckorderlist ref="uncomfirecheckorderlist"></uncomfirecheckorderlist>
  154. </el-drawer>
  155. <el-drawer title="确认超时维修任务" :visible.sync="comfireDelayCheckOrderDig" v-if="comfireDelayCheckOrderDig" size="50%"
  156. :close-on-click-modal="false" append-to-body>
  157. <comfiredelaycheckorderlist ref="comfiredelaycheckorderlist"></comfiredelaycheckorderlist>
  158. </el-drawer>
  159. <el-drawer title="维修任务详情" :visible.sync="checkorderprocessdetailDig" v-if="checkorderprocessdetailDig" size="50%"
  160. :close-on-click-modal="false" append-to-body>
  161. <checkorderprocessdetail ref="checkorderprocessdetail" :orderId="checkOrderReportId"></checkorderprocessdetail>
  162. </el-drawer>
  163. <el-drawer title="设备巡检详情" :visible.sync="inspectionreportdetailDig" v-if="inspectionreportdetailDig" size="50%"
  164. :close-on-click-modal="false" append-to-body>
  165. <inspectionreportdetail ref="inspectionreportdetail" :id="inspectionReportId"></inspectionreportdetail>
  166. </el-drawer>
  167. <el-drawer :visible.sync="inspectionreportlistDig" v-if="inspectionreportlistDig" size="50%"
  168. :close-on-click-modal="false" append-to-body>
  169. <div slot="title" class="header-title">
  170. <span class="name">{{ dialogTitle }}</span>
  171. </div>
  172. <inspectionreportlistVue ref="inspectionreportlist" :rainSeasonKind="rainSeasonKind"></inspectionreportlistVue>
  173. </el-drawer>
  174. </div>
  175. </template>
  176. <script>
  177. import { getRealData } from "@/api/home/home.js";
  178. import { todayOrderProcessList } from "@/api/business/order/process.js";
  179. import { todayInspectionReportList } from "@/api/business/inspection/inspectionreport.js";
  180. import { getLastList } from "@/api/notice/notice.js";
  181. import { getStore } from '@/util/store.js';
  182. import { getAppInfo } from "@/api/versionmanage/version.js";
  183. import todaycheckorderprocesslist from "../business/order/todaycheckorderprocesslist.vue";
  184. import uncomfirecheckorderlist from "../business/order/uncomfirecheckorderlist.vue";
  185. import comfiredelaycheckorderlist from "../business/order/comfiredelaycheckorderlist.vue";
  186. import todaynspectionrportlist from "../business/inspection/todaynspectionrportlist.vue";
  187. import todaynoticelist from "../notice/todaynoticelist.vue";
  188. import warninglist from "../business/warning/warninglist.vue";
  189. import checkorderprocessdetail from "../business/order/checkorderprocessdetail.vue";
  190. import inspectionreportdetail from "../business/inspection/inspectionreportdetail.vue";
  191. import inspectionreportlistVue from "../business/inspection/inspectionreportlist.vue";
  192. export default {
  193. name: "home",
  194. components: {
  195. todaycheckorderprocesslist,
  196. todaynspectionrportlist,
  197. todaynoticelist,
  198. warninglist,
  199. uncomfirecheckorderlist,
  200. comfiredelaycheckorderlist,
  201. checkorderprocessdetail,
  202. inspectionreportdetail,
  203. inspectionreportlistVue
  204. },
  205. data() {
  206. return {
  207. warninglistDig: false,
  208. uncomfireCheckOrderDig: false,
  209. comfireDelayCheckOrderDig: false,
  210. moreTodayOrderProcessDig: false,
  211. moreTodayInspectionReportDig: false,
  212. moreNoticeDig: false,
  213. checkorderprocessdetailDig: false,
  214. inspectionreportdetailDig: false,
  215. inspectionreportlistDig: false,
  216. appinfo: {
  217. apkUrl: '',
  218. apkQrUrl: '',
  219. version: ''
  220. },
  221. checkOrderReportId: '',
  222. inspectionReportId: '',
  223. realData: {
  224. },
  225. stompClient: null,
  226. layout: [],
  227. cache: [],
  228. editSw: false,
  229. dialog: false,
  230. dialogTitle: '',
  231. id: "",
  232. guideForm: {},
  233. second: 0,
  234. timer: null,
  235. state: 5,
  236. todayOrderList: [],
  237. todayInspectionReportList: [],
  238. noticeList: [],
  239. userInfo: getStore({ name: 'userInfo' }) || [],
  240. rainSeasonKind: 0,
  241. rtuInfoMap: null,
  242. rtuInfoCountOption: {
  243. tooltip: {
  244. trigger: 'axis',
  245. axisPointer: {
  246. type: 'shadow',
  247. },
  248. showContent: true,
  249. formatter: function (params) {
  250. console.log(JSON.stringify(params))
  251. if (params[0].data.showpercent) {
  252. return "点击柱状图可查看详情";
  253. } else {
  254. return "点击打开管理工作台页面";
  255. }
  256. }
  257. },
  258. title: {
  259. text: '测站统计信息',
  260. textStyle: {
  261. fontSize: 16,
  262. fontWeight: "bold",
  263. color: "#464646",
  264. }
  265. },
  266. color: ['#5470c6'],
  267. yAxis: {
  268. type: 'category',
  269. data: ['设备异常', '测站数量']
  270. },
  271. xAxis: {
  272. type: 'value',
  273. },
  274. grid: {
  275. right: '2%',
  276. containLabel: true
  277. },
  278. series: [
  279. {
  280. data: [
  281. {
  282. value: 0,
  283. itemStyle: {
  284. color: 'rgba(84, 112, 198,1.0)'
  285. },
  286. showpercent: false,
  287. percent: 0
  288. },
  289. {
  290. value: 0,
  291. itemStyle: {
  292. color: 'rgba(84, 112, 198,1.0)'
  293. },
  294. showpercent: false,
  295. percent: 0
  296. },
  297. ],
  298. type: 'bar',
  299. barWidth: 20,
  300. label: {
  301. show: true,
  302. position: 'insideLeft',
  303. rich: {
  304. a: {
  305. color: 'red',
  306. width: 20,
  307. padding: [0, 0, 4, 0]
  308. },
  309. b: {
  310. color: 'red',
  311. width: 50,
  312. height: 0,
  313. borderWidth: 1,
  314. borderColor: 'red'
  315. }
  316. },
  317. formatter(params) {
  318. if (params.data.showpercent) {
  319. return ' ' + params.data.value + ' / ' + params.data.percent + '%';
  320. } else {
  321. return ' ' + params.data.value;
  322. }
  323. }
  324. },
  325. }
  326. ]
  327. },
  328. checkOrderMap: null,
  329. checkOrderCountOption: {
  330. tooltip: {
  331. trigger: 'axis',
  332. axisPointer: {
  333. type: 'shadow',
  334. },
  335. showContent: true,
  336. formatter: function (params) {
  337. console.log(JSON.stringify(params))
  338. if (params[0].data.showpercent) {
  339. return "点击柱状图可查看详情";
  340. } else {
  341. return "点击打开维修任务页面";
  342. }
  343. },
  344. textStyle: {
  345. fontSize: 12
  346. }
  347. },
  348. title: {
  349. text: '维修任务统计信息',
  350. textStyle: {
  351. fontSize: 16,
  352. fontWeight: "bold",
  353. color: "#464646",
  354. }
  355. },
  356. color: ['#5470c6'],
  357. yAxis: {
  358. type: 'category',
  359. data: ['超时未确认任务', '未确认任务', '维修任务数量']
  360. },
  361. xAxis: {
  362. type: 'value',
  363. },
  364. grid: {
  365. right: '2%',
  366. containLabel: true
  367. },
  368. series: [
  369. {
  370. data: [
  371. {
  372. value: 0,
  373. itemStyle: {
  374. color: 'rgba(238, 122, 122,1.0)'
  375. },
  376. showpercent: true,
  377. percent: 0
  378. },
  379. {
  380. value: 0,
  381. itemStyle: {
  382. color: 'rgba(250, 200, 88,1.0)'
  383. },
  384. showpercent: true,
  385. percent: 0
  386. },
  387. {
  388. value: 0,
  389. itemStyle: {
  390. color: 'rgba(84, 112, 198,1.0)'
  391. },
  392. showpercent: true,
  393. percent: 0
  394. },
  395. ],
  396. type: 'bar',
  397. barWidth: 20,
  398. label: {
  399. show: true,
  400. position: 'insideLeft',
  401. formatter(params) {
  402. if (params.data.showpercent) {
  403. return ' ' + params.data.value + ' / ' + params.data.percent + '%';
  404. } else {
  405. return ' ' + params.data.value;
  406. }
  407. }
  408. },
  409. }
  410. ]
  411. },
  412. equipmentInspectionChartMap: null,
  413. equipmentInspectionCountOption: {
  414. tooltip: {
  415. trigger: 'axis',
  416. axisPointer: {
  417. type: 'shadow',
  418. },
  419. showContent: true,
  420. formatter: function (params) {
  421. // console.log(JSON.stringify(params))
  422. if (params[0].data.showpercent) {
  423. return "点击柱状图可查看详情";
  424. } else {
  425. return "点击打开设备巡检信息页面";
  426. }
  427. }
  428. },
  429. title: {
  430. text: '本年度设备巡检统计信息',
  431. textStyle: {
  432. fontSize: 16,
  433. fontWeight: "bold",
  434. color: "#464646",
  435. }
  436. },
  437. color: ['#5470c6'],
  438. yAxis: {
  439. type: 'category',
  440. data: ['汛中(二)已巡检', '汛中(一)已巡检', '汛前已巡检', '需巡检站点数量']
  441. },
  442. xAxis: {
  443. type: 'value',
  444. },
  445. grid: {
  446. right: '2%',
  447. containLabel: true
  448. },
  449. series: [
  450. {
  451. data: [
  452. {
  453. value: 0,
  454. itemStyle: {
  455. color: 'rgba(84, 112, 198,1.0)'
  456. },
  457. showpercent: false,
  458. percent: 0
  459. },
  460. {
  461. value: 0,
  462. itemStyle: {
  463. color: 'rgba(84, 112, 198,1.0)'
  464. },
  465. showpercent: false,
  466. percent: 0
  467. },
  468. {
  469. value: 0,
  470. itemStyle: {
  471. color: 'rgba(84, 112, 198,1.0)'
  472. },
  473. showpercent: false,
  474. percent: 0
  475. },
  476. {
  477. value: 0,
  478. itemStyle: {
  479. color: 'rgba(84, 112, 198,1.0)'
  480. },
  481. showpercent: false,
  482. percent: 0
  483. },
  484. ],
  485. type: 'bar',
  486. barWidth: 20,
  487. label: {
  488. show: true,
  489. position: 'insideLeft',
  490. formatter(params) {
  491. if (params.data.showpercent) {
  492. return ' ' + params.data.value + ' / ' + params.data.percent + '%';
  493. } else {
  494. return ' ' + params.data.value;
  495. }
  496. }
  497. },
  498. }
  499. ]
  500. },
  501. };
  502. },
  503. created() {
  504. // let u = getStore({ name: 'userInfo' });
  505. // console.log(JSON.stringify(u));
  506. this.getData();
  507. },
  508. computed: {
  509. // ...mapGetters(["userInfo"]),
  510. },
  511. mounted() {
  512. console.log("mounted ++++++++++++++++++++");
  513. // this.initWebsocket();
  514. this.initRtuInfoCountMap();
  515. this.initCheckOrderCountMap();
  516. this.initEquipmentInspectionCountMap();
  517. if (this.timer == null) {
  518. this.timer = setInterval(this.timeCall, 10000);
  519. }
  520. },
  521. beforeDestroy() {
  522. console.log("beforeDestroy ++++++++++++++++++++");
  523. // this.closeSocket();
  524. if (this.timer != null) {
  525. console.log("clear timer ++++++++++++++ ")
  526. clearInterval(this.timer);
  527. this.timer = null;
  528. }
  529. },
  530. methods: {
  531. timeCall() {
  532. console.log("time ++++++++++++++++++++");
  533. this.getData();
  534. },
  535. initRtuInfoCountMap() {
  536. var that = this;
  537. let chart = this.$refs.rtuInfoCountChart;
  538. if (chart) {
  539. this.rtuInfoMap = this.$echarts.init(chart);
  540. this.rtuInfoMap.setOption(this.rtuInfoCountOption);
  541. // window.addEventListener("resize", function () {
  542. // that.$refs['rtuInfoChart'].resize();
  543. // })
  544. // this.$on('hook:destroyed', () => {
  545. // window.removeEventListener("resize", function () {
  546. // that.$refs['rtuInfoChart'].resize();
  547. // })
  548. // })
  549. // this.rtuInfoMap.clear();
  550. this.rtuInfoMap.getZr().off('click');
  551. this.rtuInfoMap.getZr().on('click', function (p) {
  552. console.log("checkOrderChart zr ++++++++++++++++++++++++++++++++++++")
  553. let pointInPixel = [p.offsetX, p.offsetY];
  554. if (that.rtuInfoMap.containPixel('grid', pointInPixel)) {
  555. let yIndex = that.rtuInfoMap.convertFromPixel({ seriesIndex: 0 }, [p.offsetX, p.offsetY])[1];
  556. //let yData=that.checkOrderCountOption.yAxis.data[yIndex];//当前点击柱子的数据
  557. let value = that.rtuInfoCountOption.series[0].data[yIndex].value;
  558. if (yIndex == 1) {
  559. console.log("测站数量 index " + yIndex)
  560. that.$router.push({ path: '/business/manage/index' });
  561. } else if (yIndex == 0) {
  562. if (value > 0) {
  563. console.log("设备异常 index " + yIndex)
  564. that.warninglistDig = true;
  565. that.$nextTick(() => {
  566. that.$refs['warninglist'].init();
  567. });
  568. } else {
  569. that.$message.warning("超时未确认维修任务暂无数据");
  570. }
  571. }
  572. }
  573. });
  574. // this.rtuInfoMap.off('click');
  575. // this.rtuInfoMap.on('click', function (p) {
  576. // if (p.name === '设备异常') {
  577. // that.warninglistDig = true;
  578. // that.$nextTick(() => {
  579. // that.$refs['warninglist'].init();
  580. // });
  581. // }
  582. // })
  583. }
  584. },
  585. initCheckOrderCountMap() {
  586. let chart = this.$refs.checkOrderChart;
  587. if (chart) {
  588. this.checkOrderMap = this.$echarts.init(chart);
  589. this.checkOrderMap.setOption(this.checkOrderCountOption);
  590. // window.addEventListener("resize", function () {
  591. // this.$refs.checkOrderChart.resize();
  592. // })
  593. // this.$on('hook:destroyed', () => {
  594. // window.removeEventListener("resize", function () {
  595. // this.$refs.checkOrderChart.resize();
  596. // })
  597. // })
  598. var that = this;
  599. //this.checkOrderMap.clear();
  600. this.checkOrderMap.getZr().off('click');
  601. this.checkOrderMap.getZr().on('click', function (p) {
  602. console.log("checkOrderChart zr ++++++++++++++++++++++++++++++++++++")
  603. let pointInPixel = [p.offsetX, p.offsetY];
  604. if (that.checkOrderMap.containPixel('grid', pointInPixel)) {
  605. let yIndex = that.checkOrderMap.convertFromPixel({ seriesIndex: 0 }, [p.offsetX, p.offsetY])[1];
  606. //let yData=that.checkOrderCountOption.yAxis.data[yIndex];//当前点击柱子的数据
  607. let value = that.checkOrderCountOption.series[0].data[yIndex].value;
  608. if (yIndex == 2) {
  609. console.log("维修数量 index " + yIndex)
  610. that.$router.push({ path: '/business/order/checkorderlist' });
  611. } else if (yIndex == 1) {
  612. if (value > 0) {
  613. console.log("未确认 index " + yIndex)
  614. that.uncomfireCheckOrderDig = true;
  615. that.$nextTick(() => {
  616. that.$refs["uncomfirecheckorderlist"].init();
  617. });
  618. } else {
  619. that.$message.warning("未确认维修任务暂无数据");
  620. }
  621. } else if (yIndex == 0) {
  622. if (value > 0) {
  623. console.log("超时未确认 index " + yIndex)
  624. that.comfireDelayCheckOrderDig = true;
  625. that.$nextTick(() => {
  626. that.$refs["comfiredelaycheckorderlist"].init();
  627. });
  628. } else {
  629. that.$message.warning("超时未确认维修任务暂无数据");
  630. }
  631. }
  632. }
  633. });
  634. // this.checkOrderMap.off('click');
  635. // this.checkOrderMap.on('click', function (p) {
  636. // if (p.name === '未确认任务') {
  637. // that.uncomfireCheckOrderDig = true;
  638. // that.$nextTick(() => {
  639. // that.$refs["uncomfirecheckorderlist"].init();
  640. // });
  641. // } else if (p.name === '超时未确认任务') {
  642. // that.comfireDelayCheckOrderDig = true;
  643. // that.$nextTick(() => {
  644. // that.$refs["comfiredelaycheckorderlist"].init();
  645. // });
  646. // }
  647. // })
  648. }
  649. },
  650. initEquipmentInspectionCountMap() {
  651. let chart = this.$refs.equipmentInspectionCountChart;
  652. if (chart) {
  653. this.equipmentInspectionChartMap = this.$echarts.init(chart);
  654. this.equipmentInspectionChartMap.setOption(this.equipmentInspectionCountOption);
  655. // window.addEventListener("resize", function () {
  656. // this.$refs.equipmentInspectionCountChart.resize();
  657. // })
  658. // this.$on('hook:destroyed', () => {
  659. // window.removeEventListener("resize", function () {
  660. // this.$refs.equipmentInspectionCountChart.resize();
  661. // })
  662. // })
  663. var that = this;
  664. this.equipmentInspectionChartMap.getZr().off('click');
  665. this.equipmentInspectionChartMap.getZr().on('click', function (p) {
  666. console.log("checkOrderChart zr ++++++++++++++++++++++++++++++++++++")
  667. let pointInPixel = [p.offsetX, p.offsetY];
  668. if (that.equipmentInspectionChartMap.containPixel('grid', pointInPixel)) {
  669. let yIndex = that.equipmentInspectionChartMap.convertFromPixel({ seriesIndex: 0 }, [p.offsetX, p.offsetY])[1];
  670. //let yData = that.equipmentInspectionCountOption.yAxis.data[yIndex];//当前点击柱子的数据
  671. let value = that.equipmentInspectionCountOption.series[0].data[yIndex].value;
  672. console.log(" yData " + value)
  673. if (yIndex == 3) {
  674. console.log("巡检数量 index " + yIndex)
  675. that.$router.push({ path: '/business/inspection/index' });
  676. } else if (yIndex == 2) {
  677. if (value > 0) {
  678. console.log("汛前 index " + yIndex)
  679. that.rainSeasonKind = 1;
  680. that.inspectionreportlistDig = true;
  681. that.dialogTitle = '汛前已巡检信息';
  682. that.$nextTick(() => {
  683. that.$refs["inspectionreportlist"].init();
  684. });
  685. } else {
  686. that.$message.warning("汛前巡检暂无上报数据");
  687. }
  688. } else if (yIndex == 1) {
  689. if (value > 0) {
  690. console.log("汛中一 index " + yIndex)
  691. that.rainSeasonKind = 2;
  692. that.inspectionreportlistDig = true;
  693. that.dialogTitle = '汛中(一)已巡检信息';
  694. that.$nextTick(() => {
  695. that.$refs["inspectionreportlist"].init();
  696. });
  697. } else {
  698. that.$message.warning("汛中第一次巡检暂无上报数据");
  699. }
  700. } else if (yIndex == 0) {
  701. if (value > 0) {
  702. console.log("汛中二 index " + yIndex)
  703. that.rainSeasonKind = 3;
  704. that.inspectionreportlistDig = true;
  705. that.dialogTitle = '汛中(二)已巡检信息';
  706. that.$nextTick(() => {
  707. that.$refs["inspectionreportlist"].init();
  708. });
  709. } else {
  710. that.$message.warning("汛中第二次巡检暂无上报数据");
  711. }
  712. }
  713. }
  714. });
  715. // this.equipmentInspectionChartMap.off('click');
  716. // this.equipmentInspectionChartMap.on('click', function (p) {
  717. // console.log("equipmentInspectionChartMap**********************************")
  718. // console.log(p)
  719. // if (p.name === '汛前已巡检') {
  720. // that.rainSeasonKind = 1;
  721. // that.inspectionreportlistDig = true;
  722. // that.dialogTitle = '汛前已巡检信息';
  723. // that.$nextTick(() => {
  724. // that.$refs["inspectionreportlist"].init();
  725. // });
  726. // } else if (p.name === '汛中(一)已巡检') {
  727. // that.rainSeasonKind = 2;
  728. // that.inspectionreportlistDig = true;
  729. // that.dialogTitle = '汛中(一)已巡检信息';
  730. // that.$nextTick(() => {
  731. // that.$refs["inspectionreportlist"].init();
  732. // });
  733. // } else if (p.name === '汛中(二)已巡检') {
  734. // that.rainSeasonKind = 3;
  735. // that.inspectionreportlistDig = true;
  736. // that.dialogTitle = '汛中(二)已巡检信息';
  737. // that.$nextTick(() => {
  738. // that.$refs["inspectionreportlist"].init();
  739. // });
  740. // }
  741. // })
  742. }
  743. },
  744. close() {
  745. this.dialog = false;
  746. },
  747. openMoreTodayOrderProcess() {
  748. this.moreTodayOrderProcessDig = true;
  749. this.$nextTick(() => {
  750. this.$refs["todaycheckorderprocesslist"].init();
  751. });
  752. },
  753. openMoreTodayInspectionReport() {
  754. this.moreTodayInspectionReportDig = true;
  755. this.$nextTick(() => {
  756. this.$refs["todaynspectionrportlist"].init();
  757. });
  758. },
  759. openMoreNotice() {
  760. this.moreNoticeDig = true;
  761. this.$nextTick(() => {
  762. this.$refs["todaynoticelist"].init();
  763. });
  764. },
  765. openCheckOrderReportDetail(item) {
  766. this.checkOrderReportId = item.orderId;
  767. this.checkorderprocessdetailDig = true;
  768. this.$nextTick(() => {
  769. this.$refs["checkorderprocessdetail"].init();
  770. });
  771. },
  772. openInspectionReportDetail(item) {
  773. this.inspectionReportId = item.id;
  774. this.inspectionreportdetailDig = true;
  775. this.$nextTick(() => {
  776. this.$refs["inspectionreportdetail"].init();
  777. });
  778. },
  779. downloadApk() {
  780. if (this.appinfo.apkUrl !== '') {
  781. window.open(this.appinfo.apkUrl);
  782. }
  783. },
  784. getData() {
  785. getRealData().then((res) => {
  786. if (res.data.code === 200) {
  787. this.realData = res.data.data;
  788. let data = [];
  789. let num = new Number(this.realData.warningRtus / this.realData.rtus * 100);
  790. let bar = {
  791. value: this.realData.warningRtus,
  792. itemStyle: {
  793. color: 'rgba(255, 0, 0,1.0)'
  794. },
  795. showpercent: true,
  796. percent: num.toFixed(2),
  797. }
  798. data.push(bar)
  799. bar = {
  800. value: this.realData.rtus,
  801. itemStyle: {
  802. color: 'rgba(84, 112, 198,1.0)'
  803. },
  804. showpercent: false,
  805. percent: 0
  806. }
  807. data.push(bar)
  808. this.rtuInfoCountOption.series[0].data = data;
  809. this.rtuInfoMap.setOption(this.rtuInfoCountOption);
  810. num = new Number(this.realData.delayComfireOrders / this.realData.orderCount * 100);
  811. this.checkOrderCountOption.series[0].data[0].value = this.realData.delayComfireOrders;
  812. this.checkOrderCountOption.series[0].data[0].showpercent = true;
  813. this.checkOrderCountOption.series[0].data[0].percent = num.toFixed(2);
  814. num = new Number(this.realData.unconfirmOrderCount / this.realData.orderCount * 100);
  815. this.checkOrderCountOption.series[0].data[1].value = this.realData.unconfirmOrderCount;
  816. this.checkOrderCountOption.series[0].data[1].showpercent = true;
  817. this.checkOrderCountOption.series[0].data[1].percent = num.toFixed(2);
  818. // num = new Number((this.realData.orderCount - this.realData.unconfirmOrderCount) / this.realData.orderCount * 100);
  819. // this.checkOrderCountOption.series[0].data[2].value = this.realData.orderCount - this.realData.unconfirmOrderCount;
  820. // this.checkOrderCountOption.series[0].data[2].showpercent = true;
  821. // this.checkOrderCountOption.series[0].data[2].percent = num.toFixed(2);
  822. this.checkOrderCountOption.series[0].data[2].value = this.realData.orderCount;
  823. this.checkOrderCountOption.series[0].data[2].showpercent = false;
  824. this.checkOrderCountOption.series[0].data[2].percent = num.toFixed(2);
  825. // let data = [];
  826. // num = new Number(this.realData.delayComfireOrders / this.realData.orderCount * 100);
  827. // bar = {
  828. // value: this.realData.delayComfireOrders,
  829. // itemStyle: {
  830. // color: 'rgba(255, 0, 0,1.0)'
  831. // },
  832. // showpercent: true,
  833. // percent: num.toFixed(2),
  834. // }
  835. // data.push(bar)
  836. // let num = new Number(this.realData.unconfirmOrderCount / this.realData.orderCount * 100);
  837. // let bar = {
  838. // value: this.realData.unconfirmOrderCount,
  839. // itemStyle: {
  840. // color: 'rgba(255, 0, 0,1.0)'
  841. // },
  842. // showpercent: true,
  843. // percent: num.toFixed(2),
  844. // }
  845. // data.push(bar)
  846. // bar = {
  847. // value: this.realData.orderCount,
  848. // itemStyle: {
  849. // color: 'rgba(84, 112, 198,1.0)'
  850. // },
  851. // showpercent: false,
  852. // percent: 0
  853. // }
  854. // data.push(bar)
  855. // this.checkOrderCountOption.series[0].data = data;
  856. this.checkOrderMap.setOption(this.checkOrderCountOption);
  857. data = [];
  858. num = new Number(this.realData.equipmentInspectionRainSecondReports / this.realData.equipmentInspectionCount * 100);
  859. bar = {
  860. value: this.realData.equipmentInspectionRainSecondReports,
  861. itemStyle: {
  862. color: 'rgba(0, 133, 133,1.0)'
  863. },
  864. showpercent: true,
  865. percent: num.toFixed(2),
  866. }
  867. data.push(bar)
  868. num = new Number(this.realData.equipmentInspectionRainFirstReports / this.realData.equipmentInspectionCount * 100);
  869. bar = {
  870. value: this.realData.equipmentInspectionRainFirstReports,
  871. itemStyle: {
  872. color: 'rgba(0, 133, 133,1.0)'
  873. },
  874. showpercent: true,
  875. percent: num.toFixed(2),
  876. }
  877. data.push(bar)
  878. num = new Number(this.realData.equipmentInspectionBeforeRainReports / this.realData.equipmentInspectionCount * 100);
  879. bar = {
  880. value: this.realData.equipmentInspectionBeforeRainReports,
  881. itemStyle: {
  882. color: 'rgba(0, 133, 133,1.0)'
  883. },
  884. showpercent: true,
  885. percent: num.toFixed(2),
  886. }
  887. data.push(bar)
  888. bar = {
  889. value: this.realData.equipmentInspectionCount,
  890. itemStyle: {
  891. color: 'rgba(84, 112, 198,1.0)'
  892. },
  893. showpercent: false,
  894. percent: 0,
  895. }
  896. data.push(bar)
  897. this.equipmentInspectionCountOption.series[0].label.position = 'insideLeft';
  898. this.equipmentInspectionCountOption.series[0].data = data;
  899. this.equipmentInspectionChartMap.setOption(this.equipmentInspectionCountOption);
  900. }
  901. });
  902. todayOrderProcessList().then((res) => {
  903. this.todayOrderList = [];
  904. for (let i = 0; i < 3 && i < res.data.data.length; i++) {
  905. this.todayOrderList.push(res.data.data[i]);
  906. }
  907. });
  908. todayInspectionReportList().then((res) => {
  909. this.todayInspectionReportList = [];
  910. for (let i = 0; i < 3 && i < res.data.data.length; i++) {
  911. this.todayInspectionReportList.push(res.data.data[i]);
  912. }
  913. });
  914. getLastList(1).then((res) => {
  915. this.noticeList = [];
  916. this.noticeList = res.data.data;
  917. });
  918. getAppInfo().then((res) => {
  919. console.log(JSON.stringify(res.data.data))
  920. this.appinfo = res.data.data;
  921. });
  922. },
  923. changeState(state) {
  924. this.state = state;
  925. if (state != 5) {
  926. if (this.timer) clearInterval(this.timer);
  927. this.timer = setInterval(() => {
  928. this.second++;
  929. }, 1000);
  930. } else {
  931. if (this.timer) {
  932. clearInterval(this.timer);
  933. }
  934. this.second = 0;
  935. }
  936. },
  937. confirm() {
  938. // let arr = this.layout.map((e) => {
  939. // return {
  940. // x: e.x,
  941. // y: e.y,
  942. // width: e.w,
  943. // height: e.h,
  944. // isShow: e.isShow,
  945. // moduleName: e.i,
  946. // moduleCode: e.i,
  947. // };
  948. // });
  949. // let params = {
  950. // layoutId: "",
  951. // homeLayoutDetailEntityList: arr,
  952. // };
  953. // insertCustom(params).then((res) => {});
  954. // this.cache = [...this.layout];
  955. // this.editSw = false;
  956. },
  957. /**
  958. * 建立websocket连接
  959. */
  960. // initWebsocket: function () {
  961. // console.log("WebSocket 准备建立连接");
  962. // const socket = new SockJS("/api/galaxy-yjjcpt/ws");
  963. // this.stompClient = Stomp.over(socket);
  964. // this.stompClient.connect({}, this.onConnected, this.onError);
  965. // },
  966. /**
  967. * 连接成功: 订阅服务器的地址。为了浏览器可以接收到消息,必须先订阅服务器的地址
  968. */
  969. // onConnected: function () {
  970. // console.log("WebSocket 连接成功");
  971. // // 设置心跳发送接受频率(ms)默认为10000ms。 heart-beating是利用window.setInterval()去规律地发送heart-beats或者检查服务端的heart-beats。
  972. // this.stompClient.heartbeat.outgoing = 10000;
  973. // this.stompClient.heartbeat.incoming = 0;
  974. // // 订阅
  975. // this.stompClient.subscribe("/topic/event", this.onMessageReceived);
  976. // },
  977. /**
  978. * 连接失败
  979. */
  980. // onError: function (error) {
  981. // console.log("WebSocket 连接失败", error);
  982. // },
  983. /**
  984. * 接收消息
  985. */
  986. // onMessageReceived: function (res) {
  987. // console.log(res.body);
  988. // console.log("WebSocket 接收消息-----------------------------------");
  989. // },
  990. /**
  991. * 发送消息
  992. */
  993. // sendMessage: function () {
  994. // const chatMessage = {
  995. // sender: "",
  996. // content: "",
  997. // type: "CHAT",
  998. // };
  999. // this.stompClient.send(
  1000. // "/app/chat.sendMessage",
  1001. // {},
  1002. // JSON.stringify(chatMessage)
  1003. // );
  1004. // },
  1005. /**
  1006. * 关闭websocket连接
  1007. */
  1008. // closeSocket: function () {
  1009. // if (this.stompClient != null) {
  1010. // // this.stompClient.disconnect();
  1011. // this.stompClient.disconnect(() => {
  1012. // console.log("连接关闭");
  1013. // });
  1014. // }
  1015. // },
  1016. },
  1017. };
  1018. </script>
  1019. <style>
  1020. .box-card {
  1021. width: 100%;
  1022. height: 500px;
  1023. overflow-y: auto;
  1024. }
  1025. .box-card-news {
  1026. width: 100%;
  1027. height: 250px;
  1028. overflow-y: auto;
  1029. }
  1030. .box-card-apk {
  1031. width: 100%;
  1032. height: 220px;
  1033. }
  1034. .el-row {
  1035. margin-bottom: 20px;
  1036. }
  1037. .el-col {
  1038. border-radius: 4px;
  1039. }
  1040. .bg-purple-dark {
  1041. background: #99a9bf;
  1042. }
  1043. .bg-purple {
  1044. background: #d3dce6;
  1045. }
  1046. .bg-purple-light {
  1047. background: #e5e9f2;
  1048. }
  1049. .grid-content {
  1050. border-radius: 4px;
  1051. min-height: 36px;
  1052. }
  1053. .row-bg {
  1054. padding: 10px 0;
  1055. background-color: #f9fafc;
  1056. }
  1057. .list-item {
  1058. padding-top: 5px;
  1059. padding-left: 2px;
  1060. border-width: thin;
  1061. border-bottom-style: solid;
  1062. border-bottom-color: lightgray;
  1063. }
  1064. .notice-item {
  1065. padding-top: 5px;
  1066. padding-left: 2px;
  1067. border-width: thin;
  1068. border-bottom-style: solid;
  1069. border-bottom-color: lightgray;
  1070. }
  1071. .notice-time {
  1072. font-size: 0.8rem;
  1073. color: gray;
  1074. }
  1075. .notice-content {
  1076. font-size: 0.9rem;
  1077. white-space: nowrap;
  1078. overflow: hidden;
  1079. text-overflow: ellipsis;
  1080. }
  1081. </style>