From c24a5a2a99515b365ebc343b04538bb862790de1 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 21 十二月 2023 11:44:22 +0800 Subject: [PATCH] Merge branch 'feature-code-refactoring' and 'feature-002' --- src/views/exception/components/CompFlightInspection.vue | 85 +++++++++++++++++++++++++++++++----------- 1 files changed, 63 insertions(+), 22 deletions(-) diff --git a/src/views/exception/components/CompFlightInspection.vue b/src/views/exception/components/CompFlightInspection.vue index dbd2081..ff0fcb1 100644 --- a/src/views/exception/components/CompFlightInspection.vue +++ b/src/views/exception/components/CompFlightInspection.vue @@ -33,8 +33,8 @@ type: String, default: '' }, - // 鏈堜唤 - month:{ + // 鏃ユ椂闂存垨鑰呮湀鏃堕棿 + time:{ type:String, default:'' }, @@ -42,6 +42,12 @@ showAll: { type: Boolean, default: true + }, + + // 0浠h〃鏃ユ椂闂达紝1浠h〃鏈堟椂闂� + timeType:{ + type:Number, + default:-1 } }, components: { @@ -170,7 +176,7 @@ // 鏍囪浣� flag: { - // 鍔犺浇鏃� 涓婁笅鏉℃寜閽笉鑳藉啀鐐瑰嚮 + // 鏁版嵁鍔犺浇鏃� 涓婁笅鏉℃寜閽笉鑳藉啀鐐瑰嚮 banTouch: 0, // 0浠h〃鍒嗛〉锛�1浠h〃涓嶅垎椤� originClick: 0 @@ -179,7 +185,6 @@ } }, setup() { - // provide('search',readonly(form)) const { isExceedOneMonth } = useCommonFunction() return { isExceedOneMonth @@ -221,17 +226,26 @@ 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').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() + // 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'){ + 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'){ + 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') + } + this.backExceptionDataAWeekAgo() + this.getShopNames() } }, computed: { @@ -379,6 +393,12 @@ mounted() { this.getSiteNume() + + // 椋炶宸℃椤甸潰锛岃繘鍘诲姞杞� + if(this.showAll == true){ + this.backExceptionDataAWeekAgo() + this.getShopNames() + } }, methods: { @@ -413,7 +433,9 @@ // 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, @@ -424,6 +446,7 @@ '', this.tableCurrentRowData.exception, areaObj, + lineColor, this.tableCurrentRowData.exceptionType ) }, @@ -526,7 +549,6 @@ let endIndex = dateList.findIndex((item) => item === exceptionET) // 璁剧疆鎶樼嚎鍥鹃厤缃」 - // this.reSetChart(dateList, dustValue, exceptionBT, exceptionET, startIndex, endIndex) this.dialog.option = exceptionOption.setExceptionChartOption( dateList, dustValue, @@ -535,6 +557,7 @@ startIndex, endIndex, this.tableCurrentRowData.exception, + '', '', this.tableCurrentRowData.exceptionType ) @@ -899,7 +922,6 @@ 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; @@ -1201,10 +1223,11 @@ align="center" show-overflow-tooltip /> - <el-table-column prop="flag" label="flag" 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'" >缂哄け鏁版嵁锛� @@ -1214,13 +1237,19 @@ tableCurrentRowData.exceptionType == '1' || tableCurrentRowData.exceptionType == '2' || tableCurrentRowData.exceptionType == '3' || - tableCurrentRowData.exceptionType == '4' + 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> + </div> </template> </el-dialog> </div> @@ -1332,6 +1361,8 @@ } /* 琛ㄦ牸妯″潡缁撴潫 */ + + /* 鏌ョ湅璇︽儏瀵硅瘽妗嗘ā鍧楃殑鏍峰紡 */ .diag-head { @@ -1359,9 +1390,19 @@ } .mx-1 { - position: absolute; + /* position: absolute; left: 10px; - bottom: 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