From 9c1d136e4f5ed9b5bce100147edbb52486da985a Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期五, 08 十二月 2023 13:57:32 +0800 Subject: [PATCH] 对飞行巡检和审核辅助对话框逻辑写成组件 --- src/views/exception/components/CompFlightInspection.vue | 698 ++++++--------------------------------------------------- 1 files changed, 79 insertions(+), 619 deletions(-) diff --git a/src/views/exception/components/CompFlightInspection.vue b/src/views/exception/components/CompFlightInspection.vue index 01b7aea..4030ecf 100644 --- a/src/views/exception/components/CompFlightInspection.vue +++ b/src/views/exception/components/CompFlightInspection.vue @@ -1,23 +1,15 @@ +<!-- 椋炶宸℃椤甸潰 --> + <script> -import { defineAsyncComponent } from 'vue' import TimeShortCuts from '@/sfc/TimeShortCuts.vue' import { useCommonFunction } from '@/utils/common.js' -import AreaAndmonitorType from '@/sfc/AreaAndmonitorType.vue' +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 AnalysisCard from '@/views/exception/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' import exception0 from '@/assets/exception/exception0.png' import exception1 from '@/assets/exception/exception1.png' import exception2 from '@/assets/exception/exception2.png' @@ -26,6 +18,8 @@ import exception5 from '@/assets/exception/exception5.png' import exception6 from '@/assets/exception/exception6.png' import exception7 from '@/assets/exception/exception7.png' + +import CompDialogDetail from '@/views/exception/components/CompDialogDetail.vue' export default { props: { // 鐐逛綅鍚嶅瓧 @@ -34,37 +28,34 @@ default: '' }, // 鏃ユ椂闂存垨鑰呮湀鏃堕棿 - time:{ - type:String, - default:'' + time: { + type: String, + default: '' }, // 灞曠ず椤甸潰鐨勫叏閮� showAll: { type: Boolean, default: true }, - + // 0浠h〃鏃ユ椂闂达紝1浠h〃鏈堟椂闂� - timeType:{ - type:Number, - default:-1 + timeType: { + type: Number, + default: -1 } }, components: { TimeShortCuts, - DustLineChart, ButtonClick, - AreaAndmonitorType, + AreaAndMonitorType, AnalysisCard, DutyCompany, - StreetInfo + CompDialogDetail }, data() { return { // 琛ㄥ崟鍐呭 form: { - // 绔欑偣鍚嶇О - name: '', // 杩愮淮鍟� dutyCompany: [], // 琛楅亾 @@ -103,7 +94,6 @@ exception7: true, exception8: true }, - // eslint-disable-next-line no-undef // 瀵硅瘽妗嗘樉绀� dialogTableVisible: false, // 淇濆瓨寮傚父瀵瑰簲鐨勫簵閾哄悕绉板拰璁惧缂栧彿 @@ -150,38 +140,13 @@ // 鏌ヨ鎸夐挳 queryButton: false, // 琛ㄦ牸鍔犺浇涓� - tableLoading: false, - // 涓婁竴鏉℃寜閽� - preButton: false, - // 涓嬩竴鏉℃寜閽� - afterButton: false, - // 鎶樼嚎鍥� - lineChart: false + tableLoading: false }, - - dialog: { - // 鎵撳紑瀵硅瘽妗嗚姹傝鍖洪棿鐨勫巻鍙叉暟鎹� - historyData: [], - // 璇ユ椂闂存鐨勫紓甯告潯鏁� - exceptionTotal: 0, - // 鎶樼嚎鍥鹃厤缃」 - option: {}, - // 鈥欎笂涓�鏉♀�樻寜閽槸鍚﹀彲浠ヨ鐐瑰嚮鐘舵�� - isPreCantouch: false, - // 鈥欎笅涓�鏉♀�樻寜閽槸鍚﹀彲浠ヨ鐐瑰嚮鐘舵�� - isNextCantouch: false, - // 寮傚父鐨勫墠涓悗鍖洪棿鎵�鏈夋暟鎹� - allExceptionTimeData: [] - }, - // 鏍囪浣� flag: { - // 鍔犺浇鏃� 涓婁笅鏉℃寜閽笉鑳藉啀鐐瑰嚮 - banTouch: 0, // 0浠h〃鍒嗛〉锛�1浠h〃涓嶅垎椤� originClick: 0 - }, - areaColor: null + } } }, setup() { @@ -192,55 +157,19 @@ }, // 鐩戝惉 鍒ゆ柇鎸夐挳鏄惁鍙偣鍑� watch: { - selectedRowIndex(newVaue) { - // 澶勪簬琛ㄦ牸鐨勬渶鍚庝竴鏉℃暟鎹� 璁剧疆鈥樹笂涓�鏉♀�欐寜閽笉鍙偣 - if (newVaue === 0) { - this.dialog.isPreCantouch = true - //鐢ㄦ埛鍏堢偣浜嗙涓�鏉★紝pre涓簍rue,鐒跺悗鐐瑰嚮鏈�鍚庝竴鏉�,next涓簍rue銆傛鏃朵袱涓寜閽兘琚皝閿� - if (this.dialog.isNextCantouch == true) { - this.dialog.isNextCantouch = false - } + // 椤甸潰鍔犺浇鏃秙howAll鎵嶄細鍙樺寲涓�娆� + // 涓簍rue琛ㄧず鐨勯琛屽贰妫�椤甸潰 + showAll() { + if (this.showAll) { + this.backExceptionDataAWeekAgo() } - // 澶勪簬琛ㄦ牸绗竴鏉℃暟鎹� 璁剧疆鈥樹笂涓�鏉♀�欐寜閽笉鍙偣 - else if (newVaue === this.displayData.length - 1) { - this.dialog.isNextCantouch = true - //鐢ㄦ埛鍏堢偣浜嗚〃鏍兼渶鍚庝竴鏉�,next涓簍rue,鐒跺悗鐐瑰嚮绗竴鏉★紝pre涓簍rue銆傛鏃朵袱涓寜閽兘琚皝閿� - if (this.dialog.isPreCantouch == true) { - this.dialog.isPreCantouch = false - } - } - // 澶勪簬琛ㄦ牸鐨勪腑闂磋 灏嗘寜閽缃负鍙偣鍑荤姸鎬� - else { - this.dialog.isPreCantouch = false - this.dialog.isNextCantouch = false - } - }, - dialogTableVisible() { - window.addEventListener('resize', this.updateChart) }, - // 椤甸潰鍔犺浇鏃秙howAll鎵嶄細鍙樺寲涓�娆� - // 涓簍rue琛ㄧず鐨勯琛屽贰妫�椤甸潰 - showAll(){ - if(this.showAll){ - this.backExceptionDataAWeekAgo() - } - }, - // siteName(){ - // if(this.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() - // } - - // }, - - timeType(){ - if(this.timeType == '0'){ + timeType() { + if (this.timeType == '0') { this.beginTime = dayjs(this.time).format('YYYY-MM-DD 00:00:00') this.endTime = dayjs(this.time).format('YYYY-MM-DD 23:59:59') - }else if(this.timeType == '1'){ + } else if (this.timeType == '1') { this.beginTime = dayjs(this.time).startOf('month').format('YYYY-MM-DD HH:mm:ss') this.endTime = dayjs(this.time).endOf('month').format('YYYY-MM-DD HH:mm:ss') } @@ -249,6 +178,23 @@ } }, computed: { + // 璁剧疆瀵硅瘽妗嗕腑鐨勬寜閽槸鍚﹁兘琚偣鍑� + buttonDisabled() { + // 琛ㄦ牸鍙湁涓�鏉℃暟鎹椂 + if (this.selectedRowIndex === 0 && this.selectedRowIndex === this.displayData.length - 1) { + return { pre: true, next: true } + } else if (this.selectedRowIndex === 0) { + return { pre: true, next: false } + } + // 澶勪簬琛ㄦ牸绗竴鏉℃暟鎹� 璁剧疆鈥樹笂涓�鏉♀�欐寜閽笉鍙偣 + else if (this.selectedRowIndex === this.displayData.length - 1) { + return { pre: false, next: true } + } + // 澶勪簬琛ㄦ牸鐨勪腑闂磋 灏嗘寜閽缃负鍙偣鍑荤姸鎬� + else { + return { pre: false, next: false } + } + }, exceptionAllNum() { let sum = this.exception.exception0Num + @@ -266,34 +212,8 @@ 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 [ { @@ -388,74 +308,21 @@ span: 6 } ] - }, + } }, mounted() { - - this.getSiteNume() + this.getSiteNum() // 椋炶宸℃椤甸潰锛岃繘鍘诲姞杞� - if(this.showAll == true){ + if (this.showAll == true) { this.backExceptionDataAWeekAgo() this.getShopNames() } }, 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涓嶇瓑浜嶯鐨勬椂闂寸偣 - 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, '寮傚父') - // let lineColor = lineChart.getLineColor(rangeTime,xList) - let lineColor = [] - // console.log('绾挎',lineColor); - // 浼犲叆鍙傛暟 - this.dialog.option = exceptionOption.setExceptionChartOption( - xList, - yList, - '', - '', - '', - '', - this.tableCurrentRowData.exception, - areaObj, - lineColor, - this.tableCurrentRowData.exceptionType - ) - }, - - getImageUrl(name) { - return new URL(`../../lib/Carousel/assets/${name}`, import.meta.url).href - }, // 鏀惧洖绔欑偣鎬绘暟閲� - getSiteNume() { + getSiteNum() { exceptionApi.getSitesNum().then((res) => { this.siteTotal = res.data.data.length }) @@ -476,36 +343,6 @@ // 榛樿鏄剧ず绗竴椤� 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: '' - }) - } - }, // 娈电數鎴栨柇缃戝尯闂存棤鏁版嵁锛岄渶瑕佽ˉ鍏呫�傚叾浠栫殑閮芥湁鏁版嵁锛岀洿鎺ヤ竴娆¤姹傚叏閮ㄦ椂娈靛氨濂� @@ -515,169 +352,18 @@ // 鍐嶅垽鏂紓甯哥绫� 锛岃繘琛岃缃厤缃」 /** - * 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) { - // 鐐瑰嚮杩囩▼涓� 閿佷綇涓婁笅鏉℃寜閽� 鍦ㄨ缃畬鍥惧舰閰嶇疆椤瑰悗瑙i攣 - 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 - }) - } + this.selectedRowIndex < this.displayData.length - 1 + ? this.showDialog(this.selectedRowIndex + 1) + : '' }, /** * description锛氳幏鍙栦笅涓�鏉″紓甯镐俊鎭� */ getNextRowData() { - // 涓嶆槸琛ㄦ牸鐨勭涓�琛� - if (this.selectedRowIndex !== 0) { - // 鐐瑰嚮杩囩▼涓� 閿佷綇涓婁笅鏉℃寜閽� 鍦ㄨ缃畬鍥惧舰閰嶇疆椤瑰悗瑙i攣 - 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 - }) - } + this.selectedRowIndex > 0 ? this.showDialog(this.selectedRowIndex - 1) : '' }, /** @@ -696,12 +382,9 @@ params['endTime'] = this.endTime params['exceptionType'] = exceptionType - if(this.siteName){ + 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() } @@ -827,41 +510,14 @@ * @param锛氱偣鍑烩�樻煡鐪嬭鎯呪�欑殑璇ヨ鎵�鏈夊瓧娈垫暟鎹� * @createTime:2023-08-18 */ - showDialog(row) { + showDialog(rowIndex) { + // 褰撳墠琛ㄦ牸琛岀殑绱㈠紩 + this.selectedRowIndex = rowIndex + // 鎵撳紑瀵硅瘽妗� 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 - } - }) + this.tableCurrentRowData = this.displayData[rowIndex] }, /** * description锛氭潯浠舵煡璇㈠紓甯哥殑鏁版嵁 @@ -884,9 +540,7 @@ 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() } @@ -923,10 +577,8 @@ params['beginTime'] = this.beginTime params['endTime'] = this.endTime - console.log('name',this.siteName) 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 @@ -992,10 +644,6 @@ // 琛ㄦ牸搴忓彿閫掑 indexMethod1(index) { return index + 1 + (this.currentPage - 1) * this.pageSize - }, - // 琛ㄦ牸搴忓彿閫掑 - indexMethod2(index) { - return index + 1 } } } @@ -1008,7 +656,7 @@ <el-form :inline="true"> <div class="head-container-text"> <el-form-item> - <AreaAndmonitorType></AreaAndmonitorType> + <AreaAndMonitorType></AreaAndMonitorType> </el-form-item> <el-form-item v-show="!showAll"> @@ -1021,11 +669,15 @@ </el-form-item> <!-- <el-form-item v-show="showAll"> - <StreetInfo @submitStreetValue="(n) => (form.street = n)"> </StreetInfo> - </el-form-item> --> + <StreetInfo @submitStreetValue="(n) => (form.street = n)"> </StreetInfo> + </el-form-item> --> <el-form-item> - <TimeShortCuts timeType="day" @submit-time="giveTime" :beginAndEndTime="[beginTime,endTime]"></TimeShortCuts> + <TimeShortCuts + timeType="day" + @submit-time="giveTime" + :beginAndEndTime="[beginTime, endTime]" + ></TimeShortCuts> </el-form-item> <el-form-item> @@ -1045,7 +697,7 @@ </el-row> <!-- 鏃堕棿鎽樿 --> - <el-row class="head-describtion-text" ref="h2"> + <el-row class="head-description-text" ref="h2"> <el-row> <span> 閲戝北鍖� {{ beginTime }} 鈥斺�� {{ endTime }} 鎵皹鐩戞祴寮傚父淇℃伅姹囨��</span> </el-row> @@ -1130,8 +782,8 @@ <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)" + <template #default="{ $index }"> + <el-button type="primary" class="table-button" @click="showDialog($index)" >鏌ョ湅璇︽儏</el-button > </template> @@ -1152,109 +804,13 @@ </el-pagination> </el-col> </el-row> - - <!-- 瀵硅瘽妗� --> - <el-dialog - class="exception-dialog" + <CompDialogDetail + :row="tableCurrentRowData" + :button-disabled="buttonDisabled" 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="鏁版嵁鏍囪瘑" align="center" show-overflow-tooltip /> - </el-table> - </div> - <template #footer> - <div class="dialog-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' || - tableCurrentRowData.exceptionType == '5' || - tableCurrentRowData.exceptionType == '6' || - tableCurrentRowData.exceptionType == '7' || - tableCurrentRowData.exceptionType == '8' - " - >寮傚父鏁版嵁锛�</span - > - <span class="table-line-num">{{ dialog.exceptionTotal }}鏉�</span> - <span v-show="tableCurrentRowData.exceptionType == '0'"> (閫昏緫璁$畻)</span> - </el-tag> - <el-text v-show="tableCurrentRowData.exceptionType == '8'" type="warning" class="dialog-footer-text">鏁版嵁鏍囪瘑A涓烘暟鎹暱鏈熺己澶�,绯荤粺鑷姩琛ュ叏</el-text> - <!-- <el-text class="mx-1" type="warning">Warning</el-text> --> - </div> - </template> - </el-dialog> + @get-pre-row-data="getNextRowData" + @get-next-row-data="getPreviousRowData" + /> </div> </template> @@ -1267,90 +823,37 @@ .el-form { margin: 10px; } + img { margin-right: 5px; } -.head-container-search { - float: right; -} -.head-describtion-text { +.head-description-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; @@ -1363,47 +866,4 @@ 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; */ - justify-content: flex-start; -} -.dialog-footer{ - display: flex; -} -.dialog-footer-text { - justify-content: flex-end; - margin-left: auto; - font-size: 14px; - /* color: #333333; */ -} -/* 鏌ョ湅璇︽儏瀵硅瘽妗嗘ā鍧楃粨鏉� */ </style> -- Gitblit v1.9.3