From a969126ac530da96b1edb02152db87f0ad317f6e Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期三, 22 十一月 2023 13:20:17 +0800 Subject: [PATCH] 1. 传递相对路径 2.使用循环展示异常卡片 3.飞行巡检写成组件 --- src/views/exception/components/AnalysisCard.vue | 34 ++++++++++++++++++++++++++++------ 1 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/views/exception/components/AnalysisCard.vue b/src/views/exception/components/AnalysisCard.vue index 82e6b0d..7328b77 100644 --- a/src/views/exception/components/AnalysisCard.vue +++ b/src/views/exception/components/AnalysisCard.vue @@ -2,7 +2,7 @@ <script> import DustExceptionText from './DustExceptionText.vue' import NoDataStatus from './NoDataStatus.vue' - +import dayjs from 'dayjs' export default { props: { // 寮傚父鐨勭珯鐐瑰悕绉� @@ -33,7 +33,7 @@ default: '寮傚父' }, // 鍥炬爣鍦板潃 - iconsrc: { + icon: { type: String, default: '111' }, @@ -57,11 +57,12 @@ type:Number, default:100 }, - // 鏄惁鏄棤鏁版嵁 + // 鏄惁鏃犳暟鎹� isNoDataStatus:{ type:Boolean, default:false } + }, emits:['getAbnormalDataByClick'], components: { @@ -69,13 +70,29 @@ NoDataStatus }, data() { - return {} + return { + // 瀹℃牳杈呭姪鎸夐挳鏄剧ず + // auditButton:false, + } + }, + + computed: { + auditButton_1() { + let today = dayjs().subtract(1,'day').format('YYYY-MM-DD 00:00:00') + if(this.beginTime >= today && this.isNoDataStatus == false) { + return true + } + return false + } }, mounted() {}, methods: { getAbnormalDataByClick(val) { this.$emit('getAbnormalDataByClick',val) }, + openDetail() { + this.$router.push(`/AuditDetail/${this.beginTime}/${this.endTime}/${this.exceptionType}`) + } } } </script> @@ -84,9 +101,10 @@ <el-card> <template #header> <div class="icon-text"> - <!-- <img :src="iconsrc" height="24" width="24"> --> - <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> <div class="exception-num"> @@ -125,6 +143,10 @@ .icon-text { display:flex; margin-bottom:10px; + +} +.audit-button { + margin-left:auto; } .exception-name { font-size:18px; -- Gitblit v1.9.3