| | |
| | | import index from '@/utils/exception_common_function/index.js' |
| | | import DustLineChart from '@/views/exception/components/DustLineChart.vue' |
| | | import historyApi from '@/api/historyApi.js' |
| | | import exceptionProxy from '../exceptionProxy' |
| | | |
| | | export default { |
| | | props: { |
| | | // 表格的一行数据 |
| | | row: { |
| | | type: Object, |
| | | default: {} |
| | | default: () => { |
| | | return {} |
| | | } |
| | | }, |
| | | // 对话框是否显示 |
| | | dialogTableVisible: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | |
| | | components: { |
| | | DustLineChart |
| | | }, |
| | | emits: ['update:dialogTableVisible'], |
| | | computed: { |
| | | dialogTableVisible: { |
| | | get() { |
| | | return this.dialogTableVisible |
| | | }, |
| | | set(value) { |
| | | this.$emit('update:dialogTableVisible', value) |
| | | } |
| | | } |
| | | }, |
| | | emits: ['update:visible'], |
| | | watch: { |
| | | row: { |
| | | handler(newValue) { |
| | | this.display() |
| | | this.display(newValue) |
| | | }, |
| | | deep: true |
| | | } |
| | |
| | | lineChart: false |
| | | }, |
| | | |
| | | |
| | | // 标记位 |
| | | flag: { |
| | | // 数据加载时 上下条按钮不能再点击 |
| | | banTouch: 0, |
| | | banTouch: 0 |
| | | }, |
| | | |
| | | isPreCantouch:false, |
| | | isNextCantouch:false |
| | | |
| | | } |
| | | }, |
| | | |
| | | mounted() {}, |
| | | methods: { |
| | | display() { |
| | | dialogChange(value) { |
| | | this.$emit('update:visible', value) |
| | | }, |
| | | async display(row) { |
| | | // 折线图加载中效果 |
| | | this.loading.lineChart = true |
| | | // 表格数据 |
| | | this.getExceptionTableDataByCurrenrRow(this.row) |
| | | await this.getExceptionTableDataByCurrenrRow(row) |
| | | |
| | | // 折线图数据 |
| | | this.setLineChart(this.row) |
| | | await this.setLineChart(row) |
| | | }, |
| | | |
| | | /** |
| | |
| | | const beforeAndAfterTime = index.before45AndAfter45(beginTime, endTime) |
| | | // 请求整段时间段的颗粒物浓度数据 |
| | | |
| | | |
| | | // 对请求回的数据进行划分 |
| | | const chartParams = await this.organizeLineChartsOptionParams(beforeAndAfterTime, this.row) |
| | | this.lineChartOption = exceptionOption.setExceptionChartOption(chartParams) |
| | | |
| | | this.lineChartOption = exceptionOption.setExceptionChartOption2(chartParams) |
| | | }, |
| | | |
| | | |
| | | |
| | | /** |
| | | * 构建折线图的配置项的参数 |
| | |
| | | time_point, |
| | | { name, beginTime, endTime, exception, exceptionType } |
| | | ) { |
| | | // 折线图加载中效果 |
| | | this.loading.lineChart = true |
| | | |
| | | // 请求整段颗粒物浓度的数据 |
| | | const response = await historyApi.queryHistoryData({ |
| | | siteName: name, |
| | |
| | | xData = timeAndValue['xAxis'] |
| | | yData = timeAndValue['yAxis'] |
| | | |
| | | // 提取异常起始时间点在整个区间内的数据索引 |
| | | let beginIndex = xData.findIndex((item) => item === beginTime) |
| | | let endIndex = xData.findIndex((item) => item === endTime) |
| | | const exceptionArea = exceptionProxy.getExceptionArea( |
| | | beginTime, |
| | | endTime, |
| | | this.historyData, |
| | | exceptionType |
| | | ) |
| | | |
| | | this.flag.banTouch = 0 |
| | | this.loading.lineChart = false |
| | |
| | | return { |
| | | xData, |
| | | yData, |
| | | exceptionBeginTime: beginTime, |
| | | exceptionEndTime: endTime, |
| | | beginIndex, |
| | | endIndex, |
| | | exceptionArea, |
| | | exceptionName: exception, |
| | | areaObj: '', |
| | | lineColor: '', |
| | | exceptionType |
| | | } |
| | | }, |
| | |
| | | mnCode: mnCode, |
| | | dutyCompany: dutyCompany, |
| | | lst: abnormalTimeTenMinute[i], |
| | | yData: '' |
| | | dustValue: '' |
| | | }) |
| | | } |
| | | }, |
| | | tableRowClassName({ row }) { |
| | | return row.flag == 'N' ? 'normal-row' : 'abnormal-row' |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <el-dialog |
| | | class="exception-dialog" |
| | | v-model="dialogTableVisible" |
| | | :model-value="visible" |
| | | @open="dialogChange(true)" |
| | | @close="dialogChange(false)" |
| | | draggable |
| | | align-center |
| | | height="700px" |
| | | width="700px" |
| | | > |
| | | |
| | | |
| | | <!-- 头 --> |
| | | <template #header> |
| | | <div class="diag-head"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <!-- <div class="chart-jump-button"> |
| | | <el-button |
| | |
| | | >下条异常</el-button |
| | | > |
| | | </div> --> |
| | | |
| | | |
| | | </template> |
| | | |
| | | |
| | | <!-- 图形 --> |
| | | <DustLineChart :option="lineChartOption" v-loading="loading.lineChart"></DustLineChart> |
| | | |
| | | <!-- 表格 --> |
| | | <div> |
| | | <el-table :data="historyData" size="default" height="200" border> |
| | | <el-table |
| | | :data="historyData" |
| | | size="default" |
| | | height="200" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | |
| | | ></el-table-column> |
| | | |
| | | <el-table-column prop="lst" label="采集时间" align="center" show-overflow-tooltip /> |
| | | <el-table-column prop="yData" label="TSP(mg/m³)" 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="数据标识" align="center" show-overflow-tooltip /> |
| | | </el-table> |
| | | </div> |
| | |
| | | > |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | <style> |
| | | /* 查看详情对话框模块的样式 */ |
| | | .el-table .normal-row { |
| | | } |
| | | |
| | | .el-table .abnormal-row { |
| | | /* background-color: var(--el-color-danger-light-5); */ |
| | | color: var(--el-color-danger); |
| | | } |
| | | |
| | | .diag-head { |
| | | /* 对话框头部区域 */ |