src/api/index.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/exception/FlightInspection.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/exception/components/AnalysisCard.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/exception/components/FlightInspection1.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/exception/components/SubFlightInspection.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/risk_assessment/components/SiteDetail.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/index.js
@@ -1,9 +1,9 @@ import axios from 'axios'; import { setInterceptors } from './config'; // const url = 'http://localhost:8081/'; const url = 'http://localhost:8081/'; // é¨ç½² const url = 'http://114.215.109.124:8803/'; // const url = 'http://114.215.109.124:8803/'; // const url = 'http://192.168.1.8:8081/'; //é£ç¾½ç管 src/main.js
@@ -32,9 +32,9 @@ // æ¬å° // axios.defaults.baseURL = 'http://localhost:8081' axios.defaults.baseURL = 'http://localhost:8081' // é¨ç½² axios.defaults.baseURL = 'http://114.215.109.124:8803' // axios.defaults.baseURL = 'http://114.215.109.124:8803' // axios.defaults.baseURL = 'http://192.168.1.8:8081' app.config.globalProperties.$http = axios src/views/exception/FlightInspection.vue
@@ -1,1501 +1,27 @@ <script> import { defineAsyncComponent } from 'vue' import TimeShortCuts from '@/sfc/TimeShortCuts.vue' import { useCommonFunction } from '../../utils/common.js' import AreaAndmonitorType from '@/sfc/AreaAndmonitorType.vue' import ButtonClick from '@/sfc/ButtonClick.vue' import index from '@/utils/exception_common_function/index.js' // å¼å¸¸å¾å½¢å¼æ¥ç»ä»¶ const DustLineChart = defineAsyncComponent(() => import('./components/DustLineChart.vue')) import exceptionApi from '@/api/exceptionApi.js' import dayjs from 'dayjs' import { ElMessage } from 'element-plus' import AnalysisCard from './components/AnalysisCard.vue' import DutyCompany from '@/sfc/DutyCompany.vue' import StreetInfo from '@/sfc/StreetInfo.vue' import historyApi from '@/api/historyApi.js' import time from '@/utils/time.js' import lineChart from '@/utils/chartFunction/lineChart.js' import exceptionOption from '@/utils/chartFunction/exceptionOption.js' export default { components: { TimeShortCuts, DustLineChart, ButtonClick, AreaAndmonitorType, AnalysisCard, DutyCompany, StreetInfo import FlightInspection1 from '@/views/exception/components/FlightInspection1.vue' export default { components: { FlightInspection1 }, data() { return { // 表åå 容 form: { // ç«ç¹åç§° name: '', // è¿ç»´å dutyCompany: [], // è¡é street: [], // éæ©çå¼å¸¸ç±»å exceptionName: [] }, beginTime: '', endTime: '', // è¿åçæ°æ® tableData: [], // è¡¨æ ¼å±ç¤ºçæ°æ® displayData: [], // è¡¨æ ¼é«åº¦ tableHeight: 400, // è¡¨æ ¼æ¾ç¤º isTableShow: false, // å®¡æ ¸è¾ å©æé®æ¾ç¤º auditButton: false, // å½å页 currentPage: 1, // æ¯é¡µæ¡æ° pageSize: 20, // è¡¨æ ¼çæ»è®°å½æ° total: 0, // æ¥è¯¢æé®æ æ°æ®æ¶ isNoData: { exception0: true, exception1: true, exception2: true, exception3: true, exception4: true, exception5: true, exception6: true, exception7: true, exception8: true }, // eslint-disable-next-line no-undef // å¯¹è¯æ¡æ¾ç¤º dialogTableVisible: false, // ä¿åå¼å¸¸å¯¹åºçåºéºåç§°å设å¤ç¼å· exception: { // æçµææç½ exception0: [], // æ°æ®è¶ ä½ exception1: [], // è¶ æ exception2: [], // æ°æ®é¿æ¶æ®µæ æ³¢å¨ exception3: [], // é级çªåå¼å¸¸ exception4: [], // 临è¿è¶ æ å¼å¸¸ exception5: [], // åæ¥è¶ æ æ¬¡æ°ä¸´çå¼å¸¸ exception6: [], // æ»å¨å¹³åå¼å¼å¸¸ exception7: [], // ææçå¼å¸¸ exception8: [], // è¯¥æ¶æ®µçå¼å¸¸æ°é exception0Num: 0, exception1Num: 0, exception2Num: 0, exception3Num: 0, exception4Num: 0, exception5Num: 0, exception6Num: 0, exception7Num: 0, exception8Num: 0 }, // ç«ç¹æ»æ°é siteTotal: 0, // éä¸è¡¨æ ¼å½åè¡çæ°æ® tableCurrentRowData: null, // éä¸è¡¨æ ¼å½åè¡çç´¢å¼ selectedRowIndex: -2, // 页é¢ä¸çæé®å è½½ç¶æ loading: { // æ¥è¯¢æé® queryButton: false, // è¡¨æ ¼å è½½ä¸ tableLoading: false, // ä¸ä¸æ¡æé® preButton: false, // ä¸ä¸æ¡æé® afterButton: false, // æçº¿å¾ lineChart: false }, dialog: { // æå¼å¯¹è¯æ¡è¯·æ±è¯¥åºé´çå岿°æ® historyData: [], // 该æ¶é´æ®µçå¼å¸¸æ¡æ° exceptionTotal: 0, // æçº¿å¾é 置项 option: {}, // âä¸ä¸æ¡âæé®æ¯å¦å¯ä»¥è¢«ç¹å»ç¶æ isPreCantouch: false, // âä¸ä¸æ¡âæé®æ¯å¦å¯ä»¥è¢«ç¹å»ç¶æ isNextCantouch: false, // å¼å¸¸çåä¸ååºé´æææ°æ® allExceptionTimeData: [] }, // æ è®°ä½ flag: { // å è½½æ¶ ä¸ä¸æ¡æé®ä¸è½åç¹å» banTouch: 0, // 0代表å页ï¼1代表ä¸å页 originClick: 0 }, areaColor: null } }, setup() { // provide('search',readonly(form)) const { isExceedOneMonth } = useCommonFunction() return { isExceedOneMonth } }, // çå¬ å¤ææé®æ¯å¦å¯ç¹å» watch: { selectedRowIndex(newVaue) { // å¤äºè¡¨æ ¼çæå䏿¡æ°æ® 设置âä¸ä¸æ¡âæé®ä¸å¯ç¹ if (newVaue === 0) { this.dialog.isPreCantouch = true //ç¨æ·å ç¹äºç¬¬ä¸æ¡ï¼pre为true,ç¶åç¹å»æå䏿¡,next为trueãæ¤æ¶ä¸¤ä¸ªæé®é½è¢«å°é if (this.dialog.isNextCantouch == true) { this.dialog.isNextCantouch = false } } // å¤äºè¡¨æ ¼ç¬¬ä¸æ¡æ°æ® 设置âä¸ä¸æ¡âæé®ä¸å¯ç¹ else if (newVaue === this.displayData.length - 1) { this.dialog.isNextCantouch = true //ç¨æ·å ç¹äºè¡¨æ ¼æå䏿¡,next为true,ç¶åç¹å»ç¬¬ä¸æ¡ï¼pre为trueãæ¤æ¶ä¸¤ä¸ªæé®é½è¢«å°é if (this.dialog.isPreCantouch == true) { this.dialog.isPreCantouch = false } } // å¤äºè¡¨æ ¼çä¸é´è¡ å°æé®è®¾ç½®ä¸ºå¯ç¹å»ç¶æ else { this.dialog.isPreCantouch = false this.dialog.isNextCantouch = false data() { return{ } }, mounted() { // å½éæ©çæ¶é´åçååæ¶ï¼å¼å¸¸åæé¨åçå¼å¸¸åºéºæ°é忥åå // beginTime() { // this.getShopNames() // }, // endTime() { // this.getShopNames() // }, dialogTableVisible() { window.addEventListener('resize', this.updateChart) } }, computed: { exceptionAllNum() { let sum = this.exception.exception0Num + this.exception.exception1Num + this.exception.exception2Num + this.exception.exception3Num + this.exception.exception4Num + this.exception.exception5Num + this.exception.exception6Num + this.exception.exception7Num + this.exception.exception8Num if (sum == 0) { return 1 } else { return sum } }, long_time_notchange() { let sum = this.exception.exception0Num + this.exception.exception1Num + this.exception.exception2Num + this.exception.exception3Num + this.exception.exception4Num + this.exception.exception5Num + this.exception.exception6Num + this.exception.exception7Num + this.exception.exception8Num if (sum == 0) { return 0 } else { return ( 100 - (this.exception.exception0Num / this.exceptionAllNum) * 100 - (this.exception.exception1Num / this.exceptionAllNum) * 100 - (this.exception.exception2Num / this.exceptionAllNum) * 100 - (this.exception.exception4Num / this.exceptionAllNum) * 100 - (this.exception.exception5Num / this.exceptionAllNum) * 100 - (this.exception.exception6Num / this.exceptionAllNum) * 100 - (this.exception.exception7Num / this.exceptionAllNum) * 100 - (this.exception.exception8Num / this.exceptionAllNum) * 100 ).toFixed(1) } }, // ç¬¬ä¸æå¡ç cardRow1() { return [ { siteName: this.exception.exception4, exceptionType: '4', exceptionName: 'é级çªå', iconSrc: '@/assets/exception/exception4.png', siteNum: this.exception.exception4.length, exceptionNum: this.exception.exception4Num, isNoDataStatus: this.isNoData.exception4 }, { siteName: this.exception.exception5, exceptionType: '5', exceptionName: '临è¿è¶ æ å¼å¸¸', iconSrc: '@/assets/exception/exception5.png', siteNum: this.exception.exception5.length, exceptionNum: this.exception.exception5Num, isNoDataStatus: this.isNoData.exception5 }, { siteName: this.exception.exception6, exceptionType: '6', exceptionName: 'åæ¥è¶ æ æ¬¡æ°ä¸´çå¼å¸¸', iconSrc: '@/assets/exception/exception6.png', siteNum: this.exception.exception6.length, exceptionNum: this.exception.exception6Num, isNoDataStatus: this.isNoData.exception6 } ] }, cardRow2() { return [ { siteName: this.exception.exception7, exceptionType: '7', exceptionName: 'ååè¶å¿å¼å¸¸', iconSrc: '@/assets/exception/exception7.png', siteNum: this.exception.exception7.length, exceptionNum: this.exception.exception7Num, isNoDataStatus: this.isNoData.exception7 }, { siteName: this.exception.exception0, exceptionType: '0', exceptionName: 'æ°æ®ç¼ºå¤±å¼å¸¸', iconSrc: '@/assets/exception/exception0.png', siteNum: this.exception.exception0.length, exceptionNum: this.exception.exception0Num, isNoDataStatus: this.isNoData.exception0 }, { siteName: this.exception.exception1, exceptionType: '1', exceptionName: 'æ°æ®è¶ ä½', iconSrc: '@/assets/exception/exception1.png', siteNum: this.exception.exception1.length, exceptionNum: this.exception.exception1Num, isNoDataStatus: this.isNoData.exception1 } ] }, cardRow3() { return [ { siteName: this.exception.exception2, exceptionType: '2', exceptionName: 'è¶ æ ', iconSrc: '@/assets/exception/exception2.png', siteNum: this.exception.exception2.length, exceptionNum: this.exception.exception2Num, isNoDataStatus: this.isNoData.exception2 }, { siteName: this.exception.exception3, exceptionType: '3', exceptionName: 'æ°æ®é¿æ¶æ®µæ æ³¢å¨', iconSrc: '@/assets/exception/exception3.png', siteNum: this.exception.exception3.length, exceptionNum: this.exception.exception3Num, isNoDataStatus: this.isNoData.exception3 }, { siteName: this.exception.exception8, exceptionType: '8', exceptionName: 'ææçå¼å¸¸', iconSrc: '@/assets/exception/exception3.png', siteNum: this.exception.exception8.length, exceptionNum: this.exception.exception8Num, isNoDataStatus: this.isNoData.exception8 } ] } }, mounted() { this.backExceptionDataAWeekAgo() // æ¥è¯¢æ¶é´æ®µçåå¼å¸¸çç«ç¹ï¼æ¥è¯¢è¯¥æ¶é´åºé´çåå¼å¸¸æ°é this.getShopNames() this.getSiteNume() methods: { let a = [ ['2023-10-01 11:45:00', '2023-10-01 13:45:00'], ['2023-10-01 11:45:00', '2023-10-01 12:45:00'] ] let b = time.splitTime(a) console.log('æ¶é´ï¼', b) }, methods: { /** * ææçå¼å¸¸ 设置æçº¿å¾é 置项 * @paramï¼ * @returnsï¼ */ validProcess() { // xè½´æ°æ® let xList = time.ascTime( this.tableCurrentRowData.beginTime, this.tableCurrentRowData.endTime, 15 ) // yè½´æ°æ® let yList = [] xList.forEach((item) => { // æ¥æ¾è¯¥æ¶é´çæ°æ® let r = lineChart.findDate(this.dialog.historyData, item) if (r) { yList.push(r.dustValue) } else { yList.push(null) } }) // é¢è²èæ¯åºé´ // å¾å°æ æ°æ®çæ¶é´ç¹æflagä¸çäºNçæ¶é´ç¹ let noDataTime = time.invalidTime(this.dialog.historyData, xList) let rangeTime = time.seriesTime(noDataTime, 15) // let rangeTime_1 = time.splitTime(rangeTime) // å¾å°èæ¯åºé´çé ç½® let areaObj = lineChart.getMarkArea(rangeTime, 'å¼å¸¸') // ä¼ å ¥åæ° this.dialog.option = exceptionOption.setExceptionChartOption( xList, yList, '', '', '', '', this.tableCurrentRowData.exception, areaObj, this.tableCurrentRowData.exceptionType ) }, getImageUrl(name) { return new URL(`../../lib/Carousel/assets/${name}`, import.meta.url).href }, // æ¾åç«ç¹æ»æ°é getSiteNume() { exceptionApi.getSitesNum().then((res) => { this.siteTotal = res.data.data.length }) }, /** * descriptionï¼ç¹å»å¼å¸¸ç«ç¹ååæ¶ è¿åçæ°æ® * @paramï¼ * @createTime:2023-08-17 * @returnsï¼ */ getAbnormalDataByClick(val) { this.flag.originClick = 1 // æ¾ç¤ºè¡¨æ ¼ this.isTableShow = true this.tableData = val this.total = this.tableData.length // é»è®¤æ¾ç¤ºç¬¬ä¸é¡µ this.handleCurrentChange(1) }, // ç¹å»è¡¨æ ¼çè¡æ¶ selectTableRow() { // è·åå½åè¡çç´¢å¼ this.selectedRowIndex = this.displayData.indexOf(this.tableCurrentRowData) }, /** * descriptionï¼æçµææç½æ¶è®¾ç½®çè¡¨æ ¼æ°æ® */ setOfflineTbleData() { // æ æ°æ®æ¶çæ¶é´æ°ç» æ¶é´ç¸å·®15åé const abnormalTimeTenMinute = index.descFiftyTime( this.tableCurrentRowData.beginTime, this.tableCurrentRowData.endTime ) // ä¿åæ æ°æ®æ¶è¡¨æ ¼æ¡æ° this.dialog.exceptionTotal = abnormalTimeTenMinute.length // å»é¤ä¾çµå¼å¸¸åæçº¿åºé´ç第ä¸ä¸ªæå ç´ çå¼ this.dialog.historyData = [] for (let i = 0; i < abnormalTimeTenMinute.length; i++) { this.dialog.historyData.push({ name: this.tableCurrentRowData.name, mnCode: this.tableCurrentRowData.mnCode, dutyCompany: this.tableCurrentRowData.dutyCompany, lst: abnormalTimeTenMinute[i], dustValue: '' }) } }, // æ®µçµææç½åºé´æ æ°æ®ï¼éè¦è¡¥å ãå ¶ä»çé½ææ°æ®ï¼ç´æ¥ä¸æ¬¡è¯·æ±å ¨é¨æ¶æ®µå°±å¥½ // æ ¹æ®å¼å¸¸åºé´æé åå端é¦å°¾ ååºé´ ä¸é´åºé´ ååºé´ // å¤ææ¯æ®µçµææç½ï¼æ¯å请æ±åååºé´ï¼å¦ååªè¯·æ±ä¸æ¬¡å®æ´ç // å¾å°æç»æ°æ® // å夿å¼å¸¸ç§ç±» ï¼è¿è¡è®¾ç½®é 置项 /** * descriptionï¼ä¸æ¬¡è¯·æ±ååä¸ååºé´çæ°æ®,å¯¹æ°æ®è¿è¡åæ * @paramï¼ åä¸ååºé´ç请æ±åæ°ï¼åä¸åçæ»åºé´æ¶é´ï¼å¼å¸¸å¼å§æ¶é´ï¼ä¸åºç»ææ¶é´ */ otherExceptionRequest(allTimeArgs, allTime, exceptionBT, exceptionET) { // æçº¿å¾å è½½ä¸ææ this.loading.lineChart = true historyApi.queryHistoryData(allTimeArgs).then((result) => { this.dialog.allExceptionTimeData = result.data.data // æ°æ®ç¼ºå¤±å¼å¸¸æ¶éæ°è®¾ç½®è¡¨æ ¼ if (this.tableCurrentRowData.exceptionType == '0') { this.setOfflineTbleData() } // xè½´æ¥ææ¶é´ let dateList = [] // yè½´ è¶ æ æ²¹çæµåº¦ let dustValue = [] let timeAndValue = {} // 仿·»å äºé¦ä½åºé´çå¼å§åç»ææ¶é´è¿è¡éå ä¿è¯æ¶é´ä»¥15åé为é´é timeAndValue = index.keepContinuousByEachFiftyMinutes( allTime[0], allTime[3], this.dialog.allExceptionTimeData ) dateList = timeAndValue['xAxis'] dustValue = timeAndValue['yAxis'] // æåå¼å¸¸èµ·å§æ¶é´ç¹å¨æ´ä¸ªåºé´å çæ°æ®ç´¢å¼ let startIndex = dateList.findIndex((item) => item === exceptionBT) let endIndex = dateList.findIndex((item) => item === exceptionET) // 设置æçº¿å¾é 置项 // this.reSetChart(dateList, dustValue, exceptionBT, exceptionET, startIndex, endIndex) this.dialog.option = exceptionOption.setExceptionChartOption( dateList, dustValue, exceptionBT, exceptionET, startIndex, endIndex, this.tableCurrentRowData.exception, '', this.tableCurrentRowData.exceptionType ) this.flag.banTouch = 0 this.loading.lineChart = false }) }, /** * descriptionï¼åååºå¼å¸¸èµ·å§æ¶é´ï¼æé 请æ±åä¸åçåæ° */ timeAndDataProcessed() { //å¼å¸¸çå¼å§æ¶é´ ç»ææ¶é´ let exceptionBeginTime = this.tableCurrentRowData.beginTime let exceptionEndTime = this.tableCurrentRowData.endTime // beforeAndAfterTime[0]:å45åéçæ¶é´ç¹ // beforeAndAfterTime[1]:å15åéçæ¶é´ç¹ // beforeAndAfterTime[2]:å15åéçæ¶é´ç¹ // beforeAndAfterTime[3]:å45åéçæ¶é´ç¹ let beforeAndAfterTime = index.before45AndAfter45(exceptionBeginTime, exceptionEndTime) // æé å¼å¸¸æ¶é´åååºé´æ°æ®è¯·æ±åæ°(é¤äºæç½ä¸é½ç¨å°ï¼ let paramsAllTime = index.requestGetParms( this.tableCurrentRowData.name, beforeAndAfterTime[0], beforeAndAfterTime[3] ) // å°å¼å¸¸æ°æ®è¿è¡é¢å¤çï¼éåå°ç»æä½ä¸ºæçº¿å¾çé 置项 this.otherExceptionRequest( paramsAllTime, beforeAndAfterTime, exceptionBeginTime, exceptionEndTime ) }, /** * descriptionï¼è·åä¸ä¸æ¡å¼å¸¸ä¿¡æ¯ */ getPreviousRowData() { // // 䏿¯è¡¨æ ¼çæåä¸è¡ if (this.selectedRowIndex < this.displayData.length - 1) { // ç¹å»è¿ç¨ä¸ éä½ä¸ä¸æ¡æé® å¨è®¾ç½®å®å¾å½¢é 置项åè§£é this.flag.banTouch = 1 //å¾å°ä¸ä¸è¡æ°æ®ç´¢å¼ this.selectedRowIndex = this.selectedRowIndex + 1 // å¾å°ä¸ä¸è¡çæ°æ® this.tableCurrentRowData = this.displayData[this.selectedRowIndex] this.loading.preButton = true historyApi.queryHistoryData({ siteName:this.tableCurrentRowData.name, beginTime:this.tableCurrentRowData.beginTime, endTime:this.tableCurrentRowData.endTime }).then(response => { // ä¿åè¿åçè¶ æ æ°æ® this.dialog.historyData = response.data.data this.dialog.exceptionTotal = response.data.data.length // é»è¾å¤ç if (this.tableCurrentRowData.exceptionType != '8') { this.timeAndDataProcessed() } else { this.loading.lineChart = true this.validProcess() this.loading.lineChart = false this.flag.banTouch = 0 } this.loading.preButton = false }) } }, /** * descriptionï¼è·åä¸ä¸æ¡å¼å¸¸ä¿¡æ¯ */ getNextRowData() { // 䏿¯è¡¨æ ¼ç第ä¸è¡ if (this.selectedRowIndex !== 0) { // ç¹å»è¿ç¨ä¸ éä½ä¸ä¸æ¡æé® å¨è®¾ç½®å®å¾å½¢é 置项åè§£é this.flag.banTouch = 1 //å¾å°ä¸ä¸è¡æ°æ®ç´¢å¼ this.selectedRowIndex = this.selectedRowIndex - 1 // å¾å°ä¸ä¸è¡çæ°æ® this.tableCurrentRowData = this.displayData[this.selectedRowIndex] this.loading.afterButton = true historyApi.queryHistoryData({ siteName:this.tableCurrentRowData.name, beginTime:this.tableCurrentRowData.beginTime, endTime:this.tableCurrentRowData.endTime }).then(response => { // ä¿åè¿åçè¶ æ æ°æ® this.dialog.historyData = response.data.data this.dialog.exceptionTotal = response.data.data.length // é»è¾å¤ç if (this.tableCurrentRowData.exceptionType != '8') { this.timeAndDataProcessed() } else { this.loading.lineChart = true this.validProcess() this.loading.lineChart = false this.flag.banTouch = 0 } this.loading.afterButton = false }) } }, /** * descriptionï¼ä»åç»ä»¶è·å¾æç«ç¹è¯¥æ¶æ®µçå¼å¸¸æ°æ® * @createTime:2023-08-18 */ backExceptionData(val1, val2) { this.displayData = val1 this.total = val2 }, // æ¥è¯¢å¼å¸¸æ°æ®çç«ç¹åååæ°é queryExceptionSite(url, exceptionType) { let params = {} params['beginTime'] = this.beginTime params['endTime'] = this.endTime params['exceptionType'] = exceptionType if (this.form.street.length != 0) { params['street'] = this.form.street.join() } if (this.form.dutyCompany.length != 0) { params['dutyCompany'] = this.form.dutyCompany.join() } return this.$http.get(url, { params: params }) }, /** * descriptionï¼å½ç¨æ·æ¹åæ¥è¯¢çæ¶é´åºé´æ¶ï¼ä¼æ ¹æ®è¯¥åºé´æ¥è¯¢åå¼å¸¸çç«ç¹ï¼æ¥è¯¢è¯¥æ¶é´åºé´çåå¼å¸¸æ°é * @createTime:2023-08-18 */ getShopNames() { /* æ¥è¯¢å¼å¸¸çç«ç¹ */ this.queryExceptionSite('/dust/sitenamecode', 0).then((result) => { this.exception.exception0 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception0 = true return } this.isNoData.exception0 = false }) this.queryExceptionSite('/dust/sitenamecode', 1).then((result) => { this.exception.exception1 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception1 = true return } this.isNoData.exception1 = false }) this.queryExceptionSite('/dust/sitenamecode', 2).then((result) => { this.exception.exception2 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception2 = true return } this.isNoData.exception2 = false }) this.queryExceptionSite('/dust/sitenamecode', 3).then((result) => { this.exception.exception3 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception3 = true return } this.isNoData.exception3 = false }) this.queryExceptionSite('/dust/sitenamecode', 4).then((result) => { this.exception.exception4 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception4 = true return } this.isNoData.exception4 = false }) this.queryExceptionSite('/dust/sitenamecode', 5).then((result) => { this.exception.exception5 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception5 = true return } this.isNoData.exception5 = false }) this.queryExceptionSite('/dust/sitenamecode', 6).then((result) => { this.exception.exception6 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception6 = true return } this.isNoData.exception6 = false }) this.queryExceptionSite('/dust/sitenamecode', 7).then((result) => { this.exception.exception7 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception7 = true return } this.isNoData.exception7 = false }) this.queryExceptionSite('/dust/sitenamecode', 8).then((result) => { this.exception.exception8 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception8 = true return } this.isNoData.exception8 = false }) /* å¼å¸¸å¼å¸¸æ°é */ this.queryExceptionSite('/dust/exceptionnum', 0).then((result) => { this.exception.exception0Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 1).then((result) => { this.exception.exception1Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 2).then((result) => { this.exception.exception2Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 3).then((result) => { this.exception.exception3Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 4).then((result) => { this.exception.exception4Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 5).then((result) => { this.exception.exception5Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 6).then((result) => { this.exception.exception6Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 7).then((result) => { this.exception.exception7Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 8).then((result) => { this.exception.exception8Num = result.data.data }) }, /** * descriptionï¼æ¾ç¤ºå¯¹è¯æ¡,è¿å该å¼å¸¸æ¶é´æ®µçæææ°æ® * @paramï¼ç¹å»âæ¥ç详æ âçè¯¥è¡ææåæ®µæ°æ® * @createTime:2023-08-18 */ showDialog(row) { // æå¼å¯¹è¯æ¡ this.dialogTableVisible = true // ä¿åå½åè¡æ°æ® this.tableCurrentRowData = row // è·åå½åè¡çç´¢å¼ this.selectedRowIndex = this.displayData.indexOf(row) //æ ¹æ®å½åè¡çç¼å·ï¼èµ·å§æ¶é´æ¥ 请æ±å¼å¸¸æ°æ® // 对请æ±å°çæ°æ®è¿è¡é¦å°¾æ¼æ¥ // å¾å°åå宿´æ°æ®è¿è¡ç»å¶å¾å½¢ historyApi.queryHistoryData({ siteName:row.name, beginTime:row.beginTime, endTime:row.endTime }).then(response => { // ä¿åè¿åçè¶ æ æ°æ® this.dialog.historyData = response.data.data this.dialog.exceptionTotal = response.data.data.length // é»è¾å¤ç if (this.tableCurrentRowData.exceptionType != '8') { this.timeAndDataProcessed() } else { this.loading.lineChart = true this.validProcess() this.loading.lineChart = false this.flag.banTouch = 0 } }) }, /** * descriptionï¼æ¡ä»¶æ¥è¯¢å¼å¸¸çæ°æ® * @createTime:2023-08-18 */ handleSubmit() { if (this.isExceedOneMonth(this.beginTime, this.endTime)) { alert('æ¶é´è·¨åº¦ä¸è½è¶ è¿ä¸ä¸ªæ') return } // æ´æ°å¼å¸¸åæ this.getShopNames() this.loading.queryButton = true this.flag.originClick = 0 this.loading.tableLoading = true let params = {} params['page'] = this.currentPage params['pageSize'] = this.pageSize if (this.form.name) { params['siteName'] = this.form.name } if (this.form.exceptionName.length != 0) { params['exceptionType'] = this.form.exceptionName.join() } if (this.form.street.length != 0) { params['street'] = this.form.street.join() } if (this.form.dutyCompany.length != 0) { params['dutyCompany'] = this.form.dutyCompany.join() } params['beginTime'] = this.beginTime params['endTime'] = this.endTime this.$http.get('/dust/exceptiondata2', { params: params }).then((response) => { // ä¿åè¿åç // this.tableData = response.data.data.rows; this.displayData = response.data.data.rows this.loading.queryButton = false this.loading.tableLoading = false if (response.data.data.total == 0) { ElMessage('è¯¥æ¶æ®µæ æ°æ®') this.isTableShow = false return } this.isTableShow = true this.total = response.data.data.total // ç§»é¤ç©ºæ°æ®ç¶æ }) }, /** * descriptionï¼æå¼é¡µé¢é»è®¤å è½½æè¿ä¸å¨çå¼å¸¸æ°æ® * @createTime:2023-08-18 */ backExceptionDataAWeekAgo() { this.loading.tableLoading = true let params = {} if (this.form.name) { params['siteName'] = this.form.name } if (this.form.exceptionName) { params['exceptionType'] = this.form.exceptionName } params['beginTime'] = this.beginTime params['endTime'] = this.endTime this.$http.get('/dust/exceptiondata', { params: params }).then((response) => { // ä¿åè¿åç // this.tableData = response.data.data.rows; this.displayData = response.data.data.rows this.loading.tableLoading = false if (response.data.data.total == 0) { ElMessage('è¯¥æ¶æ®µæ æ°æ®') this.isTableShow = false return } this.isTableShow = true this.total = response.data.data.total }) }, /** * descriptionï¼å°ä¸å½æ åæ¶é´è½¬ä¸ºæå®æ ¼å¼(该ç»ä»¶è¿åçæ åæ¶é´çæ ¼å¼ï¼æä»¥å¿ é¡»çå è¿ä¸ªå½æ°) * @createTime:2023-08-17 */ giveTime(val) { this.beginTime = dayjs(val[0]).format('YYYY-MM-DD HH:mm:ss') this.endTime = dayjs(val[1]).format('YYYY-MM-DD HH:mm:ss') }, // åè½ï¼è¡¨æ ¼é«åº¦æ ¹æ®å 容èªéåº calTableHeight() { const h1 = this.$refs.h1.$el.offsetHeight const h2 = this.$refs.h2.$el.offsetHeight const h3 = this.$refs.h3.$el.offsetHeight const h4 = this.$refs.h4.$el.offsetHeight // å ¶ä¸ä¸ä¸ª40æ¯çåçæ»å¤è¾¹è· this.tableHeight = `calc(100vh - ${h1}px - ${h2}px - ${h3}px - ${h4}px - 40px - var(--el-main-padding) * 2)` }, // 页大尿¹åæ¶è§¦å handleSizeChange(val) { this.pageSize = val // æ¹åæ¯é¡µæ¾ç¤ºæ°ç®æ¶è·³å°å½å页 this.handleCurrentChange(1) }, // 页巿¹åæ¶è§¦å /** * descriptionï¼é¡µå·æ¹åæ¶è§¦å * @paramï¼ å½åé¡µï¼æ è®°ä½ï¼0代表æ¯ç¹å»âæ¥è¯¢â触åçï¼1代表æ¶ç¹å»å¼å¸¸ç«ç¹ææ¬æé®è§¦åçï¼ * @createTime:2023-08-17 * @returnsï¼ */ handleCurrentChange(val) { // å°å½å页å·ç»currentPage this.currentPage = val // 页é¢ååæ¶è°ç¨ æ¥è¯¢æ°æ®å½æ° if (this.flag.originClick == 0) { this.handleSubmit() } else if (this.flag.originClick == 1) { const startIndex = (val - 1) * this.pageSize const endIndex = startIndex + this.pageSize this.displayData = this.tableData.slice(startIndex, endIndex) } }, // è¡¨æ ¼åºå·éå¢ indexMethod1(index) { return index + 1 + (this.currentPage - 1) * this.pageSize }, // è¡¨æ ¼åºå·éå¢ indexMethod2(index) { return index + 1 } } } } </script> <template> <div class="all-container"> <el-row ref="h1"> <el-col> <el-form :inline="true"> <div class="head-container-text"> <el-form-item> <AreaAndmonitorType></AreaAndmonitorType> </el-form-item> <el-form-item> <DutyCompany @submitDutyCompanyValue="(n) => (form.dutyCompany = n)"> </DutyCompany> </el-form-item> <el-form-item> <StreetInfo @submitStreetValue="(n) => (form.street = n)"> </StreetInfo> </el-form-item> <el-form-item> <TimeShortCuts timeType="day" @submit-time="giveTime"></TimeShortCuts> </el-form-item> <el-form-item> <ButtonClick content="é£é©è¯ä¼°" type="warning" color="rgb(12,104,165)" :loading="loading.queryButton" :havaIcon="false" @do-search="handleSubmit" ><img src="@/assets/exception/riskButton.png" height="24" class="img-button" /></ButtonClick> </el-form-item> </div> </el-form> </el-col> </el-row> <!-- æ¶é´æè¦ --> <el-row class="head-describtion-text" ref="h2"> <el-row> <span> éå±±åº {{ beginTime }} ââ {{ endTime }} æ¬å°çæµå¼å¸¸ä¿¡æ¯æ±æ»</span> </el-row> </el-row> <!-- å¼å¸¸åæ --> <el-row ref="h3"> <el-col> <el-card class="card-container"> <template #header> <div class="card-header">å¼å¸¸åæ</div> </template> <el-row :gutter="20" class="card-row"> <el-col :span="5"> <AnalysisCard :site-name="cardRow1[0].siteName" :exception-type="cardRow1[0].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow1[0].exceptionName" :site-num="cardRow1[0].siteNum" :exception-num="cardRow1[0].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow1[0].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception4.png" height="24" width="24" /> </AnalysisCard> </el-col> <el-col :span="5"> <AnalysisCard :site-name="cardRow1[1].siteName" :exception-type="cardRow1[1].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow1[1].exceptionName" :site-num="cardRow1[1].siteNum" :exception-num="cardRow1[1].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow1[1].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception5.png" height="24" width="24" /> </AnalysisCard> </el-col> <el-col :span="4"> <AnalysisCard :site-name="cardRow3[2].siteName" :exception-type="cardRow3[2].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow3[2].exceptionName" :site-num="cardRow3[2].siteNum" :exception-num="cardRow3[2].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow3[2].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception3.png" height="24" width="24" /> </AnalysisCard> </el-col> <el-col :span="5"> <AnalysisCard :site-name="cardRow2[0].siteName" :exception-type="cardRow2[0].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow2[0].exceptionName" :site-num="cardRow2[0].siteNum" :exception-num="cardRow2[0].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow2[0].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception7.png" height="24" width="24" /> </AnalysisCard> </el-col> <el-col :span="5"> <AnalysisCard :site-name="cardRow1[2].siteName" :exception-type="cardRow1[2].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow1[2].exceptionName" :site-num="cardRow1[2].siteNum" :exception-num="cardRow1[2].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow1[2].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception6.png" height="24" width="24" /> </AnalysisCard> </el-col> </el-row> <el-row :gutter="20" class="card-row"> <el-col :span="6"> <AnalysisCard :site-name="cardRow2[2].siteName" :exception-type="cardRow2[2].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow2[2].exceptionName" :site-num="cardRow2[2].siteNum" :exception-num="cardRow2[2].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow2[2].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception1.png" height="24" width="24" /> </AnalysisCard> </el-col> <el-col :span="6"> <AnalysisCard :site-name="cardRow3[0].siteName" :exception-type="cardRow3[0].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow3[0].exceptionName" :site-num="cardRow3[0].siteNum" :exception-num="cardRow3[0].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow3[0].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception2.png" height="24" width="24" /> </AnalysisCard> </el-col> <el-col :span="6"> <AnalysisCard :site-name="cardRow3[1].siteName" :exception-type="cardRow3[1].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow3[1].exceptionName" :site-num="cardRow3[1].siteNum" :exception-num="cardRow3[1].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow3[1].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception3.png" height="24" width="24" /> </AnalysisCard> </el-col> <el-col :span="6"> <AnalysisCard :site-name="cardRow2[1].siteName" :exception-type="cardRow2[1].exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="cardRow2[1].exceptionName" :site-num="cardRow2[1].siteNum" :exception-num="cardRow2[1].exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="cardRow2[1].isNoDataStatus" @get-abnormal-data-by-click="getAbnormalDataByClick" > <img src="@/assets/exception/exception0.png" height="24" width="24" /> </AnalysisCard> </el-col> </el-row> <!-- <el-row :gutter="20"> </el-row> --> </el-card> </el-col> </el-row> <el-button-group> <el-button color="#626aef" plain @click="isTableShow = true" v-show="!isTableShow"> æ¾ç¤ºå¼å¸¸æ¸ å<el-icon class="i-ep-Arrow"><i-ep-ArrowUp /></el-icon> </el-button> <el-button color="#626aef" plain @click="isTableShow = false" v-show="isTableShow"> éèå¼å¸¸æ¸ å<el-icon class="i-ep-Arrow"><i-ep-ArrowDown /></el-icon> </el-button> </el-button-group> <!-- è¡¨æ ¼ --> <el-row v-show="isTableShow"> <el-col> <el-table ref="table" :data="displayData" :height="tableHeight" :highlight-current-row="true" size="default" v-loading="loading.tableLoading" border > <el-table-column type="index" label="åºå·" width="60px" align="center" fixed :index="indexMethod1" /> <el-table-column prop="name" label="ç¹ä½åç§°" show-overflow-tooltip /> <el-table-column prop="mnCode" label="设å¤ç¼ç " align="center" show-overflow-tooltip /> <el-table-column prop="exception" label="å¼å¸¸ç±»å" align="center" show-overflow-tooltip /> <el-table-column prop="region" label="åºå¿" align="center" show-overflow-tooltip /> <el-table-column prop="beginTime" label="å¼å§æ¶é´" align="center" show-overflow-tooltip /> <el-table-column prop="endTime" label="ç»ææ¶é´" align="center" show-overflow-tooltip /> <el-table-column prop="typename" label="åºæ¯" align="center" width="82" show-overflow-tooltip /> <el-table-column prop="address" label="å°å" align="center" show-overflow-tooltip /> <el-table-column prop="dutyCompany" label="è¿ç»´å" align="center" show-overflow-tooltip /> <el-table-column label="æä½" align="center"> <template #default="{ row }"> <el-button type="primary" class="table-button" @click="showDialog(row)" >æ¥ç详æ </el-button > </template> </el-table-column> </el-table> <el-pagination ref="h4" background layout="total, sizes, prev, pager, next, jumper" v-model:current-page="currentPage" v-model:page-size="pageSize" :total="total" :page-sizes="[10, 20, 50, 100]" @size-change="handleSizeChange" @current-change="handleCurrentChange" > </el-pagination> </el-col> </el-row> <!-- å¯¹è¯æ¡ --> <el-dialog class="exception-dialog" v-model="dialogTableVisible" draggable align-center height="700px" width="700px" > <!-- 头 --> <template #header> <div class="diag-head"> <div class="diag-head-text"> <div><span class="diag-head-text1">ç«ç¹åç§°ï¼</span>{{ tableCurrentRowData.name }}</div> <div> <span class="diag-head-text1">设å¤ç¼å·ï¼</span>{{ tableCurrentRowData.mnCode }} </div> <div> <span class="diag-head-text1">è¿ç»´åï¼</span>{{ tableCurrentRowData.dutyCompany }} </div> <div> <span class="diag-head-text1">å¼å¸¸æ¶é´æ®µï¼</span>{{ tableCurrentRowData.beginTime }} ~ {{ tableCurrentRowData.endTime }} </div> </div> <!-- <div class="chart-jump-button"> <el-button type="danger" :loading="loading.preButton" :disabled="dialog.isPreCantouch || flag.banTouch" @click="getPreviousRowData" >䏿¡å¼å¸¸</el-button > <el-button type="danger" :loading="loading.afterButton" :disabled="dialog.isNextCantouch || flag.banTouch" @click="getNextRowData" >䏿¡å¼å¸¸</el-button > </div> --> <div class="chart-jump-button"> <el-button type="danger" :loading="loading.preButton" :disabled="dialog.isPreCantouch || flag.banTouch" @click="getNextRowData" >䏿¡å¼å¸¸</el-button > <el-button type="danger" :loading="loading.afterButton" :disabled="dialog.isNextCantouch || flag.banTouch" @click="getPreviousRowData" >䏿¡å¼å¸¸</el-button > </div> </div> </template> <!-- å¾å½¢ --> <DustLineChart :option="dialog.option" :is-open-dialog="dialogTableVisible" v-loading="loading.lineChart" ></DustLineChart> <!-- è¡¨æ ¼ --> <div> <el-table :data="dialog.historyData" size="default" height="200" border> <el-table-column type="index" label="åºå·" width="60px" align="center" fixed :index="indexMethod2" ></el-table-column> <el-table-column prop="lst" label="ééæ¶é´" align="center" show-overflow-tooltip /> <el-table-column prop="dustValue" label="TSP(mg/m³)" align="center" show-overflow-tooltip /> <el-table-column prop="flag" label="flag" align="center" show-overflow-tooltip /> </el-table> </div> <template #footer> <el-tag type="success" class="mx-1" effect="dark" round ><span class="table-line-lable" v-show="tableCurrentRowData.exceptionType == '0'" >ç¼ºå¤±æ°æ®ï¼ </span> <span v-show=" tableCurrentRowData.exceptionType == '1' || tableCurrentRowData.exceptionType == '2' || tableCurrentRowData.exceptionType == '3' || tableCurrentRowData.exceptionType == '4' " >å¼å¸¸æ°æ®ï¼</span > <span class="table-line-num">{{ dialog.exceptionTotal }}æ¡</span> <span v-show="tableCurrentRowData.exceptionType == '0'"> (é»è¾è®¡ç®)</span> </el-tag> </template> </el-dialog> </div> <FlightInspection1 :show-all="true"> </FlightInspection1> </template> <style lang="scss" scoped> .el-row { margin-left: 10px; } <style scoped> /* æ¡ä»¶æ¥è¯¢æ¨¡åçæ ·å¼ */ .el-form { margin: 10px; } img { margin-right: 5px; } .head-container-search { float: right; } .head-describtion-text { justify-content: flex-end; margin-bottom: 2px; margin-right: 20px; font-size: 14px; color: gray; } .button-set { margin: 10px; } /* æ¡ä»¶æ¥è¯¢æ¨¡åç»æ */ /* å¼å¸¸åææ¨¡åçæ ·å¼ */ .card-text1 { /* é»ä½çå¼å¸¸ååé¨å */ margin: 10px; } .card-text1 + div { /* é»ä½çå¼å¸¸ååä¸é¢ç */ margin: 12px; } .card-exception-buttom { /* å¼å¸¸ç«ç¹ææ¬æé®åºå */ padding: 11px; } .card-header { margin-left: 5px; font-size: 18px; font-weight: bold; } .card-content-unnormal { min-height: 200px; border: 2px solid #ffcf8b; border-radius: 20px; } .card-content-normal { min-height: 200px; border: 2px solid red; border-radius: 20px; } .card-header-text { font-size: 16px; font-weight: bold; margin-top: 4px; margin-left: 4px; } .card-content-text { white-space: nowrap; } .card-exceptionname-text1 { /* å¼å¸¸ç«ç¹å æ¯ */ font-size: 14px; white-space: nowrap; } .card-exceptionname-text2 { /* å¼å¸¸æ°å æ¯çå¤è¾¹è· */ font-size: 14px; white-space: nowrap; } .text-blank { /* éå· */ margin-right: 10px; color: #000000; } .card-row { margin-bottom: 10px; } /* å¼å¸¸åææ¨¡åç»æ */ /* éèè¡¨æ ¼æé®ç»æ ·å¼ */ .el-button-group { margin: 10px 0px 10px 10px; } .i-ep-Arrow { margin-left: 6px; margin-bottom: 2px; font-size: 1.2em; } /* éèè¡¨æ ¼æé®ç»æ ·å¼ç»æ */ /* è¡¨æ ¼æ¨¡åçæ ·å¼ */ .el-table { color: #333333; } /* è¡¨æ ¼æ¨¡åç»æ */ /* æ¥ç详æ å¯¹è¯æ¡æ¨¡åçæ ·å¼ */ .diag-head { /* å¯¹è¯æ¡å¤´é¨åºå */ min-height: 200px; } .diag-head-text1 { /* å¯¹è¯æ¡å¤´é¨ç屿§å段å ç² */ font-weight: bold; } .diag-head-text > div { /* å¯¹è¯æ¡å¼å¸¸æ¶é´æ®µ */ margin-top: 15px; } .diag-head-text { margin: 10px; padding: 10px; background: linear-gradient(90deg, #00c9ff 0%, #92fe9d 100%); border: 2px solid #7bc0fc; } .chart-jump-button { display: flex; justify-content: right; } .mx-1 { position: absolute; left: 10px; bottom: 10px; } /* æ¥ç详æ å¯¹è¯æ¡æ¨¡åç»æ */ </style> </style> src/views/exception/components/AnalysisCard.vue
@@ -33,7 +33,7 @@ default: 'å¼å¸¸' }, // 徿 å°å iconsrc: { icon: { type: String, default: '111' }, @@ -62,6 +62,7 @@ type:Boolean, default:false } }, emits:['getAbnormalDataByClick'], components: { @@ -100,7 +101,8 @@ <el-card> <template #header> <div class="icon-text"> <slot/> <!-- <slot/> --> <img :src="icon" height="24" width="24" /> <div class="exception-name">{{ exceptionName }}</div> <el-button type="danger" size="small" class="audit-button" v-show="auditButton_1" @click="openDetail">å®¡æ ¸</el-button> </div> src/views/exception/components/FlightInspection1.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,1426 @@ <script> import { defineAsyncComponent } from 'vue' import TimeShortCuts from '@/sfc/TimeShortCuts.vue' import { useCommonFunction } from '@/utils/common.js' import AreaAndmonitorType from '@/sfc/AreaAndmonitorType.vue' import ButtonClick from '@/sfc/ButtonClick.vue' import index from '@/utils/exception_common_function/index.js' // å¼å¸¸å¾å½¢å¼æ¥ç»ä»¶ const DustLineChart = defineAsyncComponent(() => import('@/views/exception/components/DustLineChart.vue')) import exceptionApi from '@/api/exceptionApi.js' import dayjs from 'dayjs' import { ElMessage } from 'element-plus' import AnalysisCard from './AnalysisCard.vue' import DutyCompany from '@/sfc/DutyCompany.vue' import StreetInfo from '@/sfc/StreetInfo.vue' import historyApi from '@/api/historyApi.js' import time from '@/utils/time.js' import lineChart from '@/utils/chartFunction/lineChart.js' import exceptionOption from '@/utils/chartFunction/exceptionOption.js' export default { props: { // ç¹ä½åå siteName: { type: String, default: '' }, // æä»½ month:{ type:String, default:'' }, // å±ç¤ºé¡µé¢çå ¨é¨ showAll: { type: Boolean, default: true } }, components: { TimeShortCuts, DustLineChart, ButtonClick, AreaAndmonitorType, AnalysisCard, DutyCompany, StreetInfo }, data() { return { // 表åå 容 form: { // ç«ç¹åç§° name: '', // è¿ç»´å dutyCompany: [], // è¡é street: [], // éæ©çå¼å¸¸ç±»å exceptionName: [] }, beginTime: '', endTime: '', // è¿åçæ°æ® tableData: [], // è¡¨æ ¼å±ç¤ºçæ°æ® displayData: [], // è¡¨æ ¼é«åº¦ tableHeight: 400, // è¡¨æ ¼æ¾ç¤º isTableShow: false, // å®¡æ ¸è¾ å©æé®æ¾ç¤º auditButton: false, // å½å页 currentPage: 1, // æ¯é¡µæ¡æ° pageSize: 20, // è¡¨æ ¼çæ»è®°å½æ° total: 0, // æ¥è¯¢æé®æ æ°æ®æ¶ isNoData: { exception0: true, exception1: true, exception2: true, exception3: true, exception4: true, exception5: true, exception6: true, exception7: true, exception8: true }, // eslint-disable-next-line no-undef // å¯¹è¯æ¡æ¾ç¤º dialogTableVisible: false, // ä¿åå¼å¸¸å¯¹åºçåºéºåç§°å设å¤ç¼å· exception: { // æçµææç½ exception0: [], // æ°æ®è¶ ä½ exception1: [], // è¶ æ exception2: [], // æ°æ®é¿æ¶æ®µæ æ³¢å¨ exception3: [], // é级çªåå¼å¸¸ exception4: [], // 临è¿è¶ æ å¼å¸¸ exception5: [], // åæ¥è¶ æ æ¬¡æ°ä¸´çå¼å¸¸ exception6: [], // æ»å¨å¹³åå¼å¼å¸¸ exception7: [], // ææçå¼å¸¸ exception8: [], // è¯¥æ¶æ®µçå¼å¸¸æ°é exception0Num: 0, exception1Num: 0, exception2Num: 0, exception3Num: 0, exception4Num: 0, exception5Num: 0, exception6Num: 0, exception7Num: 0, exception8Num: 0 }, // ç«ç¹æ»æ°é siteTotal: 0, // éä¸è¡¨æ ¼å½åè¡çæ°æ® tableCurrentRowData: null, // éä¸è¡¨æ ¼å½åè¡çç´¢å¼ selectedRowIndex: -2, // 页é¢ä¸çæé®å è½½ç¶æ loading: { // æ¥è¯¢æé® queryButton: false, // è¡¨æ ¼å è½½ä¸ tableLoading: false, // ä¸ä¸æ¡æé® preButton: false, // ä¸ä¸æ¡æé® afterButton: false, // æçº¿å¾ lineChart: false }, dialog: { // æå¼å¯¹è¯æ¡è¯·æ±è¯¥åºé´çå岿°æ® historyData: [], // 该æ¶é´æ®µçå¼å¸¸æ¡æ° exceptionTotal: 0, // æçº¿å¾é 置项 option: {}, // âä¸ä¸æ¡âæé®æ¯å¦å¯ä»¥è¢«ç¹å»ç¶æ isPreCantouch: false, // âä¸ä¸æ¡âæé®æ¯å¦å¯ä»¥è¢«ç¹å»ç¶æ isNextCantouch: false, // å¼å¸¸çåä¸ååºé´æææ°æ® allExceptionTimeData: [] }, // æ è®°ä½ flag: { // å è½½æ¶ ä¸ä¸æ¡æé®ä¸è½åç¹å» banTouch: 0, // 0代表å页ï¼1代表ä¸å页 originClick: 0 }, areaColor: null } }, setup() { // provide('search',readonly(form)) const { isExceedOneMonth } = useCommonFunction() return { isExceedOneMonth } }, // çå¬ å¤ææé®æ¯å¦å¯ç¹å» watch: { selectedRowIndex(newVaue) { // å¤äºè¡¨æ ¼çæå䏿¡æ°æ® 设置âä¸ä¸æ¡âæé®ä¸å¯ç¹ if (newVaue === 0) { this.dialog.isPreCantouch = true //ç¨æ·å ç¹äºç¬¬ä¸æ¡ï¼pre为true,ç¶åç¹å»æå䏿¡,next为trueãæ¤æ¶ä¸¤ä¸ªæé®é½è¢«å°é if (this.dialog.isNextCantouch == true) { this.dialog.isNextCantouch = false } } // å¤äºè¡¨æ ¼ç¬¬ä¸æ¡æ°æ® 设置âä¸ä¸æ¡âæé®ä¸å¯ç¹ else if (newVaue === this.displayData.length - 1) { this.dialog.isNextCantouch = true //ç¨æ·å ç¹äºè¡¨æ ¼æå䏿¡,next为true,ç¶åç¹å»ç¬¬ä¸æ¡ï¼pre为trueãæ¤æ¶ä¸¤ä¸ªæé®é½è¢«å°é if (this.dialog.isPreCantouch == true) { this.dialog.isPreCantouch = false } } // å¤äºè¡¨æ ¼çä¸é´è¡ å°æé®è®¾ç½®ä¸ºå¯ç¹å»ç¶æ else { this.dialog.isPreCantouch = false this.dialog.isNextCantouch = false } }, dialogTableVisible() { window.addEventListener('resize', this.updateChart) }, // 页é¢å è½½æ¶showAllæä¼åå䏿¬¡ // 为true表示çé£è¡å·¡æ£é¡µé¢ showAll(){ if(this.showAll){ this.backExceptionDataAWeekAgo() } }, siteName(){ this.beginTime = dayjs(this.month).startOf('month').format('YYYY-MM-DD HH:mm:ss') this.endTime = dayjs(this.month).endOf('month').format('YYYY-MM-DD HH:mm:ss') this.backExceptionDataAWeekAgo() this.getShopNames() }, month(){ this.beginTime = dayjs(this.month).startOf('month') this.endTime = dayjs(this.month).endOf('month') this.backExceptionDataAWeekAgo() this.getShopNames() } }, computed: { exceptionAllNum() { let sum = this.exception.exception0Num + this.exception.exception1Num + this.exception.exception2Num + this.exception.exception3Num + this.exception.exception4Num + this.exception.exception5Num + this.exception.exception6Num + this.exception.exception7Num + this.exception.exception8Num if (sum == 0) { return 1 } else { return sum } }, long_time_notchange() { let sum = this.exception.exception0Num + this.exception.exception1Num + this.exception.exception2Num + this.exception.exception3Num + this.exception.exception4Num + this.exception.exception5Num + this.exception.exception6Num + this.exception.exception7Num + this.exception.exception8Num if (sum == 0) { return 0 } else { return ( 100 - (this.exception.exception0Num / this.exceptionAllNum) * 100 - (this.exception.exception1Num / this.exceptionAllNum) * 100 - (this.exception.exception2Num / this.exceptionAllNum) * 100 - (this.exception.exception4Num / this.exceptionAllNum) * 100 - (this.exception.exception5Num / this.exceptionAllNum) * 100 - (this.exception.exception6Num / this.exceptionAllNum) * 100 - (this.exception.exception7Num / this.exceptionAllNum) * 100 - (this.exception.exception8Num / this.exceptionAllNum) * 100 ).toFixed(1) } }, // ç¬¬ä¸æå¡ç cardRow() { return [ { siteName: this.exception.exception4, exceptionType: '4', exceptionName: 'é级çªå', iconSrc: '../../../assets/exception/exception4.png', siteNum: this.exception.exception4.length, exceptionNum: this.exception.exception4Num, isNoDataStatus: this.isNoData.exception4, span: 5 }, { siteName: this.exception.exception5, exceptionType: '5', exceptionName: '临è¿è¶ æ å¼å¸¸', iconSrc: '@/assets/exception/exception5.png', siteNum: this.exception.exception5.length, exceptionNum: this.exception.exception5Num, isNoDataStatus: this.isNoData.exception5, span: 5 }, { siteName: this.exception.exception6, exceptionType: '6', exceptionName: 'åæ¥è¶ æ æ¬¡æ°ä¸´çå¼å¸¸', iconSrc: '@/assets/exception/exception6.png', siteNum: this.exception.exception6.length, exceptionNum: this.exception.exception6Num, isNoDataStatus: this.isNoData.exception6, span: 5 }, { siteName: this.exception.exception7, exceptionType: '7', exceptionName: 'ååè¶å¿å¼å¸¸', iconSrc: '@/assets/exception/exception7.png', siteNum: this.exception.exception7.length, exceptionNum: this.exception.exception7Num, isNoDataStatus: this.isNoData.exception7, span: 5 }, { siteName: this.exception.exception0, exceptionType: '0', exceptionName: 'æ°æ®ç¼ºå¤±å¼å¸¸', iconSrc: '@/assets/exception/exception0.png', siteNum: this.exception.exception0.length, exceptionNum: this.exception.exception0Num, isNoDataStatus: this.isNoData.exception0, span: 4 }, { siteName: this.exception.exception1, exceptionType: '1', exceptionName: 'æ°æ®è¶ ä½', iconSrc: '@/assets/exception/exception1.png', siteNum: this.exception.exception1.length, exceptionNum: this.exception.exception1Num, isNoDataStatus: this.isNoData.exception1, span: 6 }, { siteName: this.exception.exception2, exceptionType: '2', exceptionName: 'è¶ æ ', iconSrc: '@/assets/exception/exception2.png', siteNum: this.exception.exception2.length, exceptionNum: this.exception.exception2Num, isNoDataStatus: this.isNoData.exception2, span: 6 }, { siteName: this.exception.exception3, exceptionType: '3', exceptionName: 'æ°æ®é¿æ¶æ®µæ æ³¢å¨', iconSrc: '@/assets/exception/exception3.png', siteNum: this.exception.exception3.length, exceptionNum: this.exception.exception3Num, isNoDataStatus: this.isNoData.exception3, span: 6 }, { siteName: this.exception.exception8, exceptionType: '8', exceptionName: 'ææçå¼å¸¸', iconSrc: '@/assets/exception/exception3.png', siteNum: this.exception.exception8.length, exceptionNum: this.exception.exception8Num, isNoDataStatus: this.isNoData.exception8, span: 6 } ] }, cardRow2() { return [ { siteName: this.exception.exception7, exceptionType: '7', exceptionName: 'ååè¶å¿å¼å¸¸', iconSrc: '@/assets/exception/exception7.png', siteNum: this.exception.exception7.length, exceptionNum: this.exception.exception7Num, isNoDataStatus: this.isNoData.exception7 }, { siteName: this.exception.exception0, exceptionType: '0', exceptionName: 'æ°æ®ç¼ºå¤±å¼å¸¸', iconSrc: '@/assets/exception/exception0.png', siteNum: this.exception.exception0.length, exceptionNum: this.exception.exception0Num, isNoDataStatus: this.isNoData.exception0 }, { siteName: this.exception.exception1, exceptionType: '1', exceptionName: 'æ°æ®è¶ ä½', iconSrc: '@/assets/exception/exception1.png', siteNum: this.exception.exception1.length, exceptionNum: this.exception.exception1Num, isNoDataStatus: this.isNoData.exception1 } ] }, cardRow3() { return [ { siteName: this.exception.exception2, exceptionType: '2', exceptionName: 'è¶ æ ', iconSrc: '@/assets/exception/exception2.png', siteNum: this.exception.exception2.length, exceptionNum: this.exception.exception2Num, isNoDataStatus: this.isNoData.exception2 }, { siteName: this.exception.exception3, exceptionType: '3', exceptionName: 'æ°æ®é¿æ¶æ®µæ æ³¢å¨', iconSrc: '@/assets/exception/exception3.png', siteNum: this.exception.exception3.length, exceptionNum: this.exception.exception3Num, isNoDataStatus: this.isNoData.exception3 }, { siteName: this.exception.exception8, exceptionType: '8', exceptionName: 'ææçå¼å¸¸', iconSrc: '@/assets/exception/exception3.png', siteNum: this.exception.exception8.length, exceptionNum: this.exception.exception8Num, isNoDataStatus: this.isNoData.exception8 } ] } }, mounted() { // this.backExceptionDataAWeekAgo() // æ¥è¯¢æ¶é´æ®µçåå¼å¸¸çç«ç¹ï¼æ¥è¯¢è¯¥æ¶é´åºé´çåå¼å¸¸æ°é // this.getShopNames() this.getSiteNume() }, methods: { /** * ææçå¼å¸¸ 设置æçº¿å¾é 置项 * @paramï¼ * @returnsï¼ */ validProcess() { // xè½´æ°æ® let xList = time.ascTime( this.tableCurrentRowData.beginTime, this.tableCurrentRowData.endTime, 15 ) // yè½´æ°æ® let yList = [] xList.forEach((item) => { // æ¥æ¾è¯¥æ¶é´çæ°æ® let r = lineChart.findDate(this.dialog.historyData, item) if (r) { yList.push(r.dustValue) } else { yList.push(null) } }) // é¢è²èæ¯åºé´ // å¾å°æ æ°æ®çæ¶é´ç¹æflagä¸çäºNçæ¶é´ç¹ let noDataTime = time.invalidTime(this.dialog.historyData, xList) let rangeTime = time.seriesTime(noDataTime, 15) // let rangeTime_1 = time.splitTime(rangeTime) // å¾å°èæ¯åºé´çé ç½® let areaObj = lineChart.getMarkArea(rangeTime, 'å¼å¸¸') // ä¼ å ¥åæ° this.dialog.option = exceptionOption.setExceptionChartOption( xList, yList, '', '', '', '', this.tableCurrentRowData.exception, areaObj, this.tableCurrentRowData.exceptionType ) }, getImageUrl(name) { return new URL(`../../lib/Carousel/assets/${name}`, import.meta.url).href }, // æ¾åç«ç¹æ»æ°é getSiteNume() { exceptionApi.getSitesNum().then((res) => { this.siteTotal = res.data.data.length }) }, /** * descriptionï¼ç¹å»å¼å¸¸ç«ç¹ååæ¶ è¿åçæ°æ® * @paramï¼ * @createTime:2023-08-17 * @returnsï¼ */ getAbnormalDataByClick(val) { this.flag.originClick = 1 // æ¾ç¤ºè¡¨æ ¼ this.isTableShow = true this.tableData = val this.total = this.tableData.length // é»è®¤æ¾ç¤ºç¬¬ä¸é¡µ this.handleCurrentChange(1) }, // ç¹å»è¡¨æ ¼çè¡æ¶ selectTableRow() { // è·åå½åè¡çç´¢å¼ this.selectedRowIndex = this.displayData.indexOf(this.tableCurrentRowData) }, /** * descriptionï¼æçµææç½æ¶è®¾ç½®çè¡¨æ ¼æ°æ® */ setOfflineTbleData() { // æ æ°æ®æ¶çæ¶é´æ°ç» æ¶é´ç¸å·®15åé const abnormalTimeTenMinute = index.descFiftyTime( this.tableCurrentRowData.beginTime, this.tableCurrentRowData.endTime ) // ä¿åæ æ°æ®æ¶è¡¨æ ¼æ¡æ° this.dialog.exceptionTotal = abnormalTimeTenMinute.length // å»é¤ä¾çµå¼å¸¸åæçº¿åºé´ç第ä¸ä¸ªæå ç´ çå¼ this.dialog.historyData = [] for (let i = 0; i < abnormalTimeTenMinute.length; i++) { this.dialog.historyData.push({ name: this.tableCurrentRowData.name, mnCode: this.tableCurrentRowData.mnCode, dutyCompany: this.tableCurrentRowData.dutyCompany, lst: abnormalTimeTenMinute[i], dustValue: '' }) } }, // æ®µçµææç½åºé´æ æ°æ®ï¼éè¦è¡¥å ãå ¶ä»çé½ææ°æ®ï¼ç´æ¥ä¸æ¬¡è¯·æ±å ¨é¨æ¶æ®µå°±å¥½ // æ ¹æ®å¼å¸¸åºé´æé åå端é¦å°¾ ååºé´ ä¸é´åºé´ ååºé´ // å¤ææ¯æ®µçµææç½ï¼æ¯å请æ±åååºé´ï¼å¦ååªè¯·æ±ä¸æ¬¡å®æ´ç // å¾å°æç»æ°æ® // å夿å¼å¸¸ç§ç±» ï¼è¿è¡è®¾ç½®é 置项 /** * descriptionï¼ä¸æ¬¡è¯·æ±ååä¸ååºé´çæ°æ®,å¯¹æ°æ®è¿è¡åæ * @paramï¼ åä¸ååºé´ç请æ±åæ°ï¼åä¸åçæ»åºé´æ¶é´ï¼å¼å¸¸å¼å§æ¶é´ï¼ä¸åºç»ææ¶é´ */ otherExceptionRequest(allTimeArgs, allTime, exceptionBT, exceptionET) { // æçº¿å¾å è½½ä¸ææ this.loading.lineChart = true historyApi.queryHistoryData(allTimeArgs).then((result) => { this.dialog.allExceptionTimeData = result.data.data // æ°æ®ç¼ºå¤±å¼å¸¸æ¶éæ°è®¾ç½®è¡¨æ ¼ if (this.tableCurrentRowData.exceptionType == '0') { this.setOfflineTbleData() } // xè½´æ¥ææ¶é´ let dateList = [] // yè½´ è¶ æ æ²¹çæµåº¦ let dustValue = [] let timeAndValue = {} // 仿·»å äºé¦ä½åºé´çå¼å§åç»ææ¶é´è¿è¡éå ä¿è¯æ¶é´ä»¥15åé为é´é timeAndValue = index.keepContinuousByEachFiftyMinutes( allTime[0], allTime[3], this.dialog.allExceptionTimeData ) dateList = timeAndValue['xAxis'] dustValue = timeAndValue['yAxis'] // æåå¼å¸¸èµ·å§æ¶é´ç¹å¨æ´ä¸ªåºé´å çæ°æ®ç´¢å¼ let startIndex = dateList.findIndex((item) => item === exceptionBT) let endIndex = dateList.findIndex((item) => item === exceptionET) // 设置æçº¿å¾é 置项 // this.reSetChart(dateList, dustValue, exceptionBT, exceptionET, startIndex, endIndex) this.dialog.option = exceptionOption.setExceptionChartOption( dateList, dustValue, exceptionBT, exceptionET, startIndex, endIndex, this.tableCurrentRowData.exception, '', this.tableCurrentRowData.exceptionType ) this.flag.banTouch = 0 this.loading.lineChart = false }) }, /** * descriptionï¼åååºå¼å¸¸èµ·å§æ¶é´ï¼æé 请æ±åä¸åçåæ° */ timeAndDataProcessed() { //å¼å¸¸çå¼å§æ¶é´ ç»ææ¶é´ let exceptionBeginTime = this.tableCurrentRowData.beginTime let exceptionEndTime = this.tableCurrentRowData.endTime // beforeAndAfterTime[0]:å45åéçæ¶é´ç¹ // beforeAndAfterTime[1]:å15åéçæ¶é´ç¹ // beforeAndAfterTime[2]:å15åéçæ¶é´ç¹ // beforeAndAfterTime[3]:å45åéçæ¶é´ç¹ let beforeAndAfterTime = index.before45AndAfter45(exceptionBeginTime, exceptionEndTime) // æé å¼å¸¸æ¶é´åååºé´æ°æ®è¯·æ±åæ°(é¤äºæç½ä¸é½ç¨å°ï¼ let paramsAllTime = index.requestGetParms( this.tableCurrentRowData.name, beforeAndAfterTime[0], beforeAndAfterTime[3] ) // å°å¼å¸¸æ°æ®è¿è¡é¢å¤çï¼éåå°ç»æä½ä¸ºæçº¿å¾çé 置项 this.otherExceptionRequest( paramsAllTime, beforeAndAfterTime, exceptionBeginTime, exceptionEndTime ) }, /** * descriptionï¼è·åä¸ä¸æ¡å¼å¸¸ä¿¡æ¯ */ getPreviousRowData() { // // 䏿¯è¡¨æ ¼çæåä¸è¡ if (this.selectedRowIndex < this.displayData.length - 1) { // ç¹å»è¿ç¨ä¸ éä½ä¸ä¸æ¡æé® å¨è®¾ç½®å®å¾å½¢é 置项åè§£é this.flag.banTouch = 1 //å¾å°ä¸ä¸è¡æ°æ®ç´¢å¼ this.selectedRowIndex = this.selectedRowIndex + 1 // å¾å°ä¸ä¸è¡çæ°æ® this.tableCurrentRowData = this.displayData[this.selectedRowIndex] this.loading.preButton = true historyApi .queryHistoryData({ siteName: this.tableCurrentRowData.name, beginTime: this.tableCurrentRowData.beginTime, endTime: this.tableCurrentRowData.endTime }) .then((response) => { // ä¿åè¿åçè¶ æ æ°æ® this.dialog.historyData = response.data.data this.dialog.exceptionTotal = response.data.data.length // é»è¾å¤ç if (this.tableCurrentRowData.exceptionType != '8') { this.timeAndDataProcessed() } else { this.loading.lineChart = true this.validProcess() this.loading.lineChart = false this.flag.banTouch = 0 } this.loading.preButton = false }) } }, /** * descriptionï¼è·åä¸ä¸æ¡å¼å¸¸ä¿¡æ¯ */ getNextRowData() { // 䏿¯è¡¨æ ¼ç第ä¸è¡ if (this.selectedRowIndex !== 0) { // ç¹å»è¿ç¨ä¸ éä½ä¸ä¸æ¡æé® å¨è®¾ç½®å®å¾å½¢é 置项åè§£é this.flag.banTouch = 1 //å¾å°ä¸ä¸è¡æ°æ®ç´¢å¼ this.selectedRowIndex = this.selectedRowIndex - 1 // å¾å°ä¸ä¸è¡çæ°æ® this.tableCurrentRowData = this.displayData[this.selectedRowIndex] this.loading.afterButton = true historyApi .queryHistoryData({ siteName: this.tableCurrentRowData.name, beginTime: this.tableCurrentRowData.beginTime, endTime: this.tableCurrentRowData.endTime }) .then((response) => { // ä¿åè¿åçè¶ æ æ°æ® this.dialog.historyData = response.data.data this.dialog.exceptionTotal = response.data.data.length // é»è¾å¤ç if (this.tableCurrentRowData.exceptionType != '8') { this.timeAndDataProcessed() } else { this.loading.lineChart = true this.validProcess() this.loading.lineChart = false this.flag.banTouch = 0 } this.loading.afterButton = false }) } }, /** * descriptionï¼ä»åç»ä»¶è·å¾æç«ç¹è¯¥æ¶æ®µçå¼å¸¸æ°æ® * @createTime:2023-08-18 */ backExceptionData(val1, val2) { this.displayData = val1 this.total = val2 }, // æ¥è¯¢å¼å¸¸æ°æ®çç«ç¹åååæ°é queryExceptionSite(url, exceptionType) { let params = {} params['beginTime'] = this.beginTime params['endTime'] = this.endTime params['exceptionType'] = exceptionType if(this.siteName){ params['siteName'] = this.siteName } if (this.form.street.length != 0) { params['street'] = this.form.street.join() } if (this.form.dutyCompany.length != 0) { params['dutyCompany'] = this.form.dutyCompany.join() } return this.$http.get(url, { params: params }) }, /** * descriptionï¼å½ç¨æ·æ¹åæ¥è¯¢çæ¶é´åºé´æ¶ï¼ä¼æ ¹æ®è¯¥åºé´æ¥è¯¢åå¼å¸¸çç«ç¹ï¼æ¥è¯¢è¯¥æ¶é´åºé´çåå¼å¸¸æ°é * @createTime:2023-08-18 */ getShopNames() { /* æ¥è¯¢å¼å¸¸çç«ç¹ */ this.queryExceptionSite('/dust/sitenamecode', 0).then((result) => { this.exception.exception0 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception0 = true return } this.isNoData.exception0 = false }) this.queryExceptionSite('/dust/sitenamecode', 1).then((result) => { this.exception.exception1 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception1 = true return } this.isNoData.exception1 = false }) this.queryExceptionSite('/dust/sitenamecode', 2).then((result) => { this.exception.exception2 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception2 = true return } this.isNoData.exception2 = false }) this.queryExceptionSite('/dust/sitenamecode', 3).then((result) => { this.exception.exception3 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception3 = true return } this.isNoData.exception3 = false }) this.queryExceptionSite('/dust/sitenamecode', 4).then((result) => { this.exception.exception4 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception4 = true return } this.isNoData.exception4 = false }) this.queryExceptionSite('/dust/sitenamecode', 5).then((result) => { this.exception.exception5 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception5 = true return } this.isNoData.exception5 = false }) this.queryExceptionSite('/dust/sitenamecode', 6).then((result) => { this.exception.exception6 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception6 = true return } this.isNoData.exception6 = false }) this.queryExceptionSite('/dust/sitenamecode', 7).then((result) => { this.exception.exception7 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception7 = true return } this.isNoData.exception7 = false }) this.queryExceptionSite('/dust/sitenamecode', 8).then((result) => { this.exception.exception8 = result.data.data if (result.data.data.length == 0) { this.isNoData.exception8 = true return } this.isNoData.exception8 = false }) /* å¼å¸¸å¼å¸¸æ°é */ this.queryExceptionSite('/dust/exceptionnum', 0).then((result) => { this.exception.exception0Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 1).then((result) => { this.exception.exception1Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 2).then((result) => { this.exception.exception2Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 3).then((result) => { this.exception.exception3Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 4).then((result) => { this.exception.exception4Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 5).then((result) => { this.exception.exception5Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 6).then((result) => { this.exception.exception6Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 7).then((result) => { this.exception.exception7Num = result.data.data }) this.queryExceptionSite('/dust/exceptionnum', 8).then((result) => { this.exception.exception8Num = result.data.data }) }, /** * descriptionï¼æ¾ç¤ºå¯¹è¯æ¡,è¿å该å¼å¸¸æ¶é´æ®µçæææ°æ® * @paramï¼ç¹å»âæ¥ç详æ âçè¯¥è¡ææåæ®µæ°æ® * @createTime:2023-08-18 */ showDialog(row) { // æå¼å¯¹è¯æ¡ this.dialogTableVisible = true // ä¿åå½åè¡æ°æ® this.tableCurrentRowData = row // è·åå½åè¡çç´¢å¼ this.selectedRowIndex = this.displayData.indexOf(row) //æ ¹æ®å½åè¡çç¼å·ï¼èµ·å§æ¶é´æ¥ 请æ±å¼å¸¸æ°æ® // 对请æ±å°çæ°æ®è¿è¡é¦å°¾æ¼æ¥ // å¾å°åå宿´æ°æ®è¿è¡ç»å¶å¾å½¢ historyApi .queryHistoryData({ siteName: row.name, beginTime: row.beginTime, endTime: row.endTime }) .then((response) => { // ä¿åè¿åçè¶ æ æ°æ® this.dialog.historyData = response.data.data this.dialog.exceptionTotal = response.data.data.length // é»è¾å¤ç if (this.tableCurrentRowData.exceptionType != '8') { this.timeAndDataProcessed() } else { this.loading.lineChart = true this.validProcess() this.loading.lineChart = false this.flag.banTouch = 0 } }) }, /** * descriptionï¼æ¡ä»¶æ¥è¯¢å¼å¸¸çæ°æ® * @createTime:2023-08-18 */ handleSubmit() { if (this.isExceedOneMonth(this.beginTime, this.endTime)) { alert('æ¶é´è·¨åº¦ä¸è½è¶ è¿ä¸ä¸ªæ') return } // æ´æ°å¼å¸¸åæ this.getShopNames() this.loading.queryButton = true this.flag.originClick = 0 this.loading.tableLoading = true let params = {} params['page'] = this.currentPage params['pageSize'] = this.pageSize if (this.siteName) { params['siteName'] = this.siteName } if (this.form.exceptionName.length != 0) { params['exceptionType'] = this.form.exceptionName.join() } if (this.form.street.length != 0) { params['street'] = this.form.street.join() } if (this.form.dutyCompany.length != 0) { params['dutyCompany'] = this.form.dutyCompany.join() } params['beginTime'] = this.beginTime params['endTime'] = this.endTime this.$http.get('/dust/exceptiondata2', { params: params }).then((response) => { // ä¿åè¿åç this.displayData = response.data.data.rows this.loading.queryButton = false this.loading.tableLoading = false if (response.data.data.total == 0) { ElMessage('è¯¥æ¶æ®µæ æ°æ®') this.isTableShow = false return } this.isTableShow = true this.total = response.data.data.total // ç§»é¤ç©ºæ°æ®ç¶æ }) }, /** * descriptionï¼æå¼é¡µé¢é»è®¤å è½½æè¿ä¸å¨çå¼å¸¸æ°æ® * @createTime:2023-08-18 */ backExceptionDataAWeekAgo() { this.loading.tableLoading = true let params = {} if (this.siteName) { params['siteName'] = this.siteName } if (this.form.exceptionName) { params['exceptionType'] = this.form.exceptionName } params['beginTime'] = this.beginTime params['endTime'] = this.endTime this.$http.get('/dust/exceptiondata', { params: params }).then((response) => { // ä¿åè¿åç // this.tableData = response.data.data.rows; this.displayData = response.data.data.rows this.loading.tableLoading = false if (response.data.data.total == 0) { ElMessage('è¯¥æ¶æ®µæ æ°æ®') this.isTableShow = false return } this.isTableShow = true this.total = response.data.data.total }) }, /** * descriptionï¼å°ä¸å½æ åæ¶é´è½¬ä¸ºæå®æ ¼å¼(该ç»ä»¶è¿åçæ åæ¶é´çæ ¼å¼ï¼æä»¥å¿ é¡»çå è¿ä¸ªå½æ°) * @createTime:2023-08-17 */ giveTime(val) { this.beginTime = dayjs(val[0]).format('YYYY-MM-DD HH:mm:ss') this.endTime = dayjs(val[1]).format('YYYY-MM-DD HH:mm:ss') }, // åè½ï¼è¡¨æ ¼é«åº¦æ ¹æ®å 容èªéåº calTableHeight() { const h1 = this.$refs.h1.$el.offsetHeight const h2 = this.$refs.h2.$el.offsetHeight const h3 = this.$refs.h3.$el.offsetHeight const h4 = this.$refs.h4.$el.offsetHeight // å ¶ä¸ä¸ä¸ª40æ¯çåçæ»å¤è¾¹è· this.tableHeight = `calc(100vh - ${h1}px - ${h2}px - ${h3}px - ${h4}px - 40px - var(--el-main-padding) * 2)` }, // 页大尿¹åæ¶è§¦å handleSizeChange(val) { this.pageSize = val // æ¹åæ¯é¡µæ¾ç¤ºæ°ç®æ¶è·³å°å½å页 this.handleCurrentChange(1) }, // 页巿¹åæ¶è§¦å /** * descriptionï¼é¡µå·æ¹åæ¶è§¦å * @paramï¼ å½åé¡µï¼æ è®°ä½ï¼0代表æ¯ç¹å»âæ¥è¯¢â触åçï¼1代表æ¶ç¹å»å¼å¸¸ç«ç¹ææ¬æé®è§¦åçï¼ * @createTime:2023-08-17 * @returnsï¼ */ handleCurrentChange(val) { // å°å½å页å·ç»currentPage this.currentPage = val // 页é¢ååæ¶è°ç¨ æ¥è¯¢æ°æ®å½æ° if (this.flag.originClick == 0) { this.handleSubmit() } else if (this.flag.originClick == 1) { const startIndex = (val - 1) * this.pageSize const endIndex = startIndex + this.pageSize this.displayData = this.tableData.slice(startIndex, endIndex) } }, // è¡¨æ ¼åºå·éå¢ indexMethod1(index) { return index + 1 + (this.currentPage - 1) * this.pageSize }, // è¡¨æ ¼åºå·éå¢ indexMethod2(index) { return index + 1 } } } </script> <template> <div class="all-container"> <el-row ref="h1"> <el-col> <el-form :inline="true"> <div class="head-container-text"> <el-form-item> <AreaAndmonitorType></AreaAndmonitorType> </el-form-item> <el-form-item v-show="!showAll"> <span class="site-text"> ç¹ä½åç§°:</span> <span> {{ this.siteName }}</span> </el-form-item> <el-form-item v-show="showAll"> <DutyCompany @submitDutyCompanyValue="(n) => (form.dutyCompany = n)"> </DutyCompany> </el-form-item> <el-form-item v-show="showAll"> <StreetInfo @submitStreetValue="(n) => (form.street = n)"> </StreetInfo> </el-form-item> <el-form-item> <TimeShortCuts timeType="day" @submit-time="giveTime" :beginAndEndTime="[beginTime,endTime]"></TimeShortCuts> </el-form-item> <el-form-item> <ButtonClick content="é£é©è¯ä¼°" type="warning" color="rgb(12,104,165)" :loading="loading.queryButton" :havaIcon="false" @do-search="handleSubmit" ><img src="@/assets/exception/riskButton.png" height="24" class="img-button" /></ButtonClick> </el-form-item> </div> </el-form> </el-col> </el-row> <!-- æ¶é´æè¦ --> <el-row class="head-describtion-text" ref="h2"> <el-row> <span> éå±±åº {{ beginTime }} ââ {{ endTime }} æ¬å°çæµå¼å¸¸ä¿¡æ¯æ±æ»</span> </el-row> </el-row> <!-- å¼å¸¸åæ --> <el-row ref="h3"> <el-col> <el-card class="card-container"> <template #header> <div class="card-header">å¼å¸¸åæ</div> </template> <el-row :gutter="20"> <el-col v-for="item in cardRow" :key="item.exceptionType" :span="item.span"> <AnalysisCard :site-name="item.siteName" :exception-type="item.exceptionType" :begin-time="beginTime" :end-time="endTime" :exception-name="item.exceptionName" :site-num="item.siteNum" :exception-num="item.exceptionNum" :exception-all-num="exceptionAllNum" :site-num-all="siteTotal" :isNoDataStatus="item.isNoDataStatus" :icon="item.iconSrc" @get-abnormal-data-by-click="getAbnormalDataByClick" class="card-row" > > </AnalysisCard> </el-col> </el-row> </el-card> </el-col> </el-row> <el-button-group> <el-button color="#626aef" plain @click="isTableShow = true" v-show="!isTableShow"> æ¾ç¤ºå¼å¸¸æ¸ å<el-icon class="i-ep-Arrow"><i-ep-ArrowUp /></el-icon> </el-button> <el-button color="#626aef" plain @click="isTableShow = false" v-show="isTableShow"> éèå¼å¸¸æ¸ å<el-icon class="i-ep-Arrow"><i-ep-ArrowDown /></el-icon> </el-button> </el-button-group> <!-- è¡¨æ ¼ --> <el-row v-show="isTableShow"> <el-col> <el-table ref="table" :data="displayData" :height="tableHeight" :highlight-current-row="true" size="default" v-loading="loading.tableLoading" border > <el-table-column type="index" label="åºå·" width="60px" align="center" fixed :index="indexMethod1" /> <el-table-column prop="name" label="ç¹ä½åç§°" show-overflow-tooltip /> <el-table-column prop="mnCode" label="设å¤ç¼ç " align="center" show-overflow-tooltip /> <el-table-column prop="exception" label="å¼å¸¸ç±»å" align="center" show-overflow-tooltip /> <el-table-column prop="region" label="åºå¿" align="center" show-overflow-tooltip /> <el-table-column prop="beginTime" label="å¼å§æ¶é´" align="center" show-overflow-tooltip /> <el-table-column prop="endTime" label="ç»ææ¶é´" align="center" show-overflow-tooltip /> <el-table-column prop="typename" label="åºæ¯" align="center" width="82" show-overflow-tooltip /> <el-table-column prop="address" label="å°å" align="center" show-overflow-tooltip /> <el-table-column prop="dutyCompany" label="è¿ç»´å" align="center" show-overflow-tooltip /> <el-table-column label="æä½" align="center"> <template #default="{ row }"> <el-button type="primary" class="table-button" @click="showDialog(row)" >æ¥ç详æ </el-button > </template> </el-table-column> </el-table> <el-pagination ref="h4" background layout="total, sizes, prev, pager, next, jumper" v-model:current-page="currentPage" v-model:page-size="pageSize" :total="total" :page-sizes="[10, 20, 50, 100]" @size-change="handleSizeChange" @current-change="handleCurrentChange" > </el-pagination> </el-col> </el-row> <!-- å¯¹è¯æ¡ --> <el-dialog class="exception-dialog" v-model="dialogTableVisible" draggable align-center height="700px" width="700px" > <!-- 头 --> <template #header> <div class="diag-head"> <div class="diag-head-text"> <div><span class="diag-head-text1">ç«ç¹åç§°ï¼</span>{{ tableCurrentRowData.name }}</div> <div> <span class="diag-head-text1">设å¤ç¼å·ï¼</span>{{ tableCurrentRowData.mnCode }} </div> <div> <span class="diag-head-text1">è¿ç»´åï¼</span>{{ tableCurrentRowData.dutyCompany }} </div> <div> <span class="diag-head-text1">å¼å¸¸æ¶é´æ®µï¼</span>{{ tableCurrentRowData.beginTime }} ~ {{ tableCurrentRowData.endTime }} </div> </div> <div class="chart-jump-button"> <el-button type="danger" :loading="loading.preButton" :disabled="dialog.isPreCantouch || flag.banTouch" @click="getNextRowData" >䏿¡å¼å¸¸</el-button > <el-button type="danger" :loading="loading.afterButton" :disabled="dialog.isNextCantouch || flag.banTouch" @click="getPreviousRowData" >䏿¡å¼å¸¸</el-button > </div> </div> </template> <!-- å¾å½¢ --> <DustLineChart :option="dialog.option" :is-open-dialog="dialogTableVisible" v-loading="loading.lineChart" ></DustLineChart> <!-- è¡¨æ ¼ --> <div> <el-table :data="dialog.historyData" size="default" height="200" border> <el-table-column type="index" label="åºå·" width="60px" align="center" fixed :index="indexMethod2" ></el-table-column> <el-table-column prop="lst" label="ééæ¶é´" align="center" show-overflow-tooltip /> <el-table-column prop="dustValue" label="TSP(mg/m³)" align="center" show-overflow-tooltip /> <el-table-column prop="flag" label="flag" align="center" show-overflow-tooltip /> </el-table> </div> <template #footer> <el-tag type="success" class="mx-1" effect="dark" round ><span class="table-line-lable" v-show="tableCurrentRowData.exceptionType == '0'" >ç¼ºå¤±æ°æ®ï¼ </span> <span v-show=" tableCurrentRowData.exceptionType == '1' || tableCurrentRowData.exceptionType == '2' || tableCurrentRowData.exceptionType == '3' || tableCurrentRowData.exceptionType == '4' " >å¼å¸¸æ°æ®ï¼</span > <span class="table-line-num">{{ dialog.exceptionTotal }}æ¡</span> <span v-show="tableCurrentRowData.exceptionType == '0'"> (é»è¾è®¡ç®)</span> </el-tag> </template> </el-dialog> </div> </template> <style lang="scss" scoped> .el-row { margin-left: 10px; } /* æ¡ä»¶æ¥è¯¢æ¨¡åçæ ·å¼ */ .el-form { margin: 10px; } img { margin-right: 5px; } .head-container-search { float: right; } .head-describtion-text { justify-content: flex-end; margin-bottom: 2px; margin-right: 20px; font-size: 14px; color: gray; } .button-set { margin: 10px; } /* æ¡ä»¶æ¥è¯¢æ¨¡åç»æ */ /* å¼å¸¸åææ¨¡åçæ ·å¼ */ .card-text1 { /* é»ä½çå¼å¸¸ååé¨å */ margin: 10px; } .card-text1 + div { /* é»ä½çå¼å¸¸ååä¸é¢ç */ margin: 12px; } .card-exception-buttom { /* å¼å¸¸ç«ç¹ææ¬æé®åºå */ padding: 11px; } .card-header { margin-left: 5px; font-size: 18px; font-weight: bold; } .card-content-unnormal { min-height: 200px; border: 2px solid #ffcf8b; border-radius: 20px; } .card-content-normal { min-height: 200px; border: 2px solid red; border-radius: 20px; } .card-header-text { font-size: 16px; font-weight: bold; margin-top: 4px; margin-left: 4px; } .card-content-text { white-space: nowrap; } .card-exceptionname-text1 { /* å¼å¸¸ç«ç¹å æ¯ */ font-size: 14px; white-space: nowrap; } .card-exceptionname-text2 { /* å¼å¸¸æ°å æ¯çå¤è¾¹è· */ font-size: 14px; white-space: nowrap; } .text-blank { /* éå· */ margin-right: 10px; color: #000000; } .card-row { margin-bottom: 10px; } /* å¼å¸¸åææ¨¡åç»æ */ /* éèè¡¨æ ¼æé®ç»æ ·å¼ */ .el-button-group { margin: 10px 0px 10px 10px; } .i-ep-Arrow { margin-left: 6px; margin-bottom: 2px; font-size: 1.2em; } /* éèè¡¨æ ¼æé®ç»æ ·å¼ç»æ */ /* è¡¨æ ¼æ¨¡åçæ ·å¼ */ .el-table { color: #333333; } /* è¡¨æ ¼æ¨¡åç»æ */ /* æ¥ç详æ å¯¹è¯æ¡æ¨¡åçæ ·å¼ */ .diag-head { /* å¯¹è¯æ¡å¤´é¨åºå */ min-height: 200px; } .diag-head-text1 { /* å¯¹è¯æ¡å¤´é¨ç屿§å段å ç² */ font-weight: bold; } .diag-head-text > div { /* å¯¹è¯æ¡å¼å¸¸æ¶é´æ®µ */ margin-top: 15px; } .diag-head-text { margin: 10px; padding: 10px; background: linear-gradient(90deg, #00c9ff 0%, #92fe9d 100%); border: 2px solid #7bc0fc; } .chart-jump-button { display: flex; justify-content: right; } .mx-1 { position: absolute; left: 10px; bottom: 10px; } /* æ¥ç详æ å¯¹è¯æ¡æ¨¡åç»æ */ </style> src/views/exception/components/SubFlightInspection.vue
@@ -1018,7 +1018,7 @@ params['beginTime'] = this.beginTime params['endTime'] = this.endTime params['exceptionType'] = exceptionType if(siteName){ if(this.siteName){ params['siteName'] = this.siteName } return this.$http.get(url, { params: params }) @@ -1344,14 +1344,18 @@ <el-form-item> <AreaAndmonitorType></AreaAndmonitorType> </el-form-item> <el-form-item> <span class="site-text"> ç¹ä½åç§°:</span> <span> {{this.siteName}}</span> </el-form-item> <el-form-item> <TimeShortCuts timeType="day" @submit-time="giveTime" :beginAndEndTime="[form.beginTime,form.endTime]"></TimeShortCuts> <TimeShortCuts timeType="day" @submit-time="giveTime" :beginAndEndTime="[beginTime,endTime]"></TimeShortCuts> </el-form-item> <el-form-item> <ButtonClick @@ -1363,6 +1367,7 @@ @do-search="handleSubmit" ><img src="@/assets/exception/riskButton.png" height="24" class="img-button" /></ButtonClick> </el-form-item> </div> </el-form> src/views/risk_assessment/components/SiteDetail.vue
@@ -1,9 +1,9 @@ <!--ç¹å»ç«ç¹ 跳转è³é£é©æ¨¡åé¡µé¢ --> <script> import SubFlightInspection from '@/views/exception/components/SubFlightInspection.vue' import FlightInspection1 from '@/views/exception/components/FlightInspection1.vue' export default { components: { SubFlightInspection FlightInspection1 }, data() { return { @@ -41,7 +41,7 @@ </template> </el-page-header> <SubFlightInspection :site-name="siteName" :month="month"> </SubFlightInspection> <FlightInspection1 :site-name="siteName" :month="month" :show-all="false"> </FlightInspection1> </template> <style scoped>