From 18eb4308e941a265daba8eda2f2ee91115963a3c Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 18 四月 2024 17:06:04 +0800
Subject: [PATCH] 1
---
src/views/dashboard/components/TroubleTrackerModal.vue | 38 ++++++++++++++------------------------
1 files changed, 14 insertions(+), 24 deletions(-)
diff --git a/src/views/dashboard/components/TroubleTrackerModal.vue b/src/views/dashboard/components/TroubleTrackerModal.vue
index 31c8c01..e21d0c1 100644
--- a/src/views/dashboard/components/TroubleTrackerModal.vue
+++ b/src/views/dashboard/components/TroubleTrackerModal.vue
@@ -4,17 +4,17 @@
<template #title>闂璇婃柇 </template>
<div class="modal-content">
<el-scrollbar always class="scroller">
- <div v-if="fakeTroubles?.length" class="trouble">
- <div v-for="(item, index) in fakeTroubles" :key="index" class="trouble-item">
+ <div v-if="problems?.length" class="trouble">
+ <div v-for="(item, index) in problems" :key="index" class="trouble-item">
<div class="trouble-content">
<div class="trouble-icon">
- <el-icon v-if="item.status === 2" size="30" color="#ff0000"><WarnTriangleFilled /></el-icon>
- <el-icon v-if="item.status === 1" size="30" color="#00ff00"><CircleCheckFilled /></el-icon>
+ <el-icon v-if="item.CheckResult" size="30" color="#00ff00"><CircleCheckFilled /></el-icon>
+ <el-icon v-if="!item.CheckResult" size="30" color="#ff0000"><WarnTriangleFilled /></el-icon>
</div>
- <div class="trouble-text">{{ item.content }}</div>
+ <div class="trouble-text">{{ item.ItemName }}</div>
</div>
- <div class="trouble-status" :class="{ green: item.status === 1, red: item.status === 2 }">
- {{ DEVICE_STATUS_NAME_MAP[item.status] }}
+ <div class="trouble-status" :class="{ green: item.CheckResult, red: !item.CheckResult }">
+ {{ item.CheckResult ? '姝e父' : '寮傚父' }}
</div>
</div>
</div>
@@ -25,15 +25,18 @@
</template>
<script setup lang="ts">
import { useVModel } from '@vueuse/core'
-import { ref } from 'vue'
import { CircleCheckFilled, WarnTriangleFilled } from '@element-plus/icons-vue'
-import { DEVICE_STATUS_NAME_MAP } from '@/common/constants'
+import type { Problem } from '@/api/problem'
+import { toRefs } from 'vue'
export interface TroubleTrackerModalProps {
modelValue: boolean
+ problems?: Problem[]
}
const props = withDefaults(defineProps<TroubleTrackerModalProps>(), {
- modelValue: false
+ modelValue: false,
+ problems: undefined
})
+const { problems } = toRefs(props)
const emit = defineEmits<{
'update:modelValue': [show: boolean]
}>()
@@ -42,19 +45,6 @@
function closeModal() {
modelData.value = false
}
-
-const fakeTroubles = ref<{ content: string; status: 1 | 2 }[]>([{ content: '浜戠缃戠粶杩炴帴', status: 1 }])
-// TODO: 绛夋帴鍙�
-fakeTroubles.value.push(
- ...Array(100)
- .fill(0)
- .map(() => {
- return {
- content: '浜戠缃戠粶杩炴帴',
- status: Math.ceil(Math.random() + 1)
- } as { content: string; status: 1 | 2 }
- })
-)
</script>
<style scoped lang="scss">
.modal-content {
@@ -90,6 +80,6 @@
}
}
.scroller {
- padding: 4px 16px;
+ padding: 4px 10px;
}
</style>
--
Gitblit v1.8.0