zmc
2023-11-22 a969126ac530da96b1edb02152db87f0ad317f6e
1. 传递相对路径
2.使用循环展示异常卡片
3.飞行巡检写成组件
已修改6个文件
已添加1个文件
2955 ■■■■ 文件已修改
src/api/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exception/FlightInspection.vue 1500 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exception/components/AnalysisCard.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exception/components/FlightInspection1.vue 1426 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exception/components/SubFlightInspection.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/risk_assessment/components/SiteDetail.vue 6 ●●●● 补丁 | 查看 | 原始文档 | 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>