parent
542e863193
commit
a74f864c61
@ -0,0 +1,93 @@ |
||||
<template> |
||||
<el-card shadow="never" v-loading="loading"> |
||||
<template #header> |
||||
<div class="flex justify-between"> |
||||
<div style="display: flex; align-items: center"> |
||||
<el-icon size="15"> <Grid /> </el-icon> <span |
||||
style="font-weight: 700; font-size: 14px; line-height: 16px" |
||||
>{{ prop.name }}</span |
||||
> |
||||
</div> |
||||
<div> |
||||
<el-button |
||||
type="primary" |
||||
:disabled="devId === undefined" |
||||
@click="openDiagnosis(prop.remote)" |
||||
>开始诊断</el-button |
||||
> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<div> |
||||
<el-descriptions :column="1" border> |
||||
<el-descriptions-item |
||||
label-align="left" |
||||
align="left" |
||||
label-class-name="my-label2" |
||||
class-name="my-content" |
||||
width="150px" |
||||
> |
||||
<div class="my-content"> |
||||
进行{{ name }} 综合诊断{{ result.endTime }} |
||||
</div> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item |
||||
label-align="left" |
||||
align="left" |
||||
label-class-name="my-label2" |
||||
class-name="my-content" |
||||
width="150px" |
||||
> |
||||
<div class="my-content">测试结果 : {{ result.testResult }}</div> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item |
||||
label-align="left" |
||||
align="left" |
||||
label-class-name="my-label2" |
||||
class-name="my-content" |
||||
width="150px" |
||||
> |
||||
<div class="my-content">修复建议 : {{ result.errorDesc }}</div> |
||||
</el-descriptions-item> |
||||
</el-descriptions> |
||||
</div> |
||||
</el-card> |
||||
</template> |
||||
|
||||
<script setup lang="ts"> |
||||
import { Grid } from "@element-plus/icons-vue"; |
||||
import { confirm } from "@/utils/confirm"; |
||||
import { basicInfoDiagnosis } from "@/api/fault"; |
||||
import { FaultDiagnosisResult } from "@/api/fault/types"; |
||||
const prop = defineProps<{ |
||||
devId?: number; |
||||
remote: string; |
||||
name: string; |
||||
}>(); |
||||
const loading = ref<boolean>(false); |
||||
const result = ref<FaultDiagnosisResult>({}); |
||||
const openDiagnosis = (remote: string) => { |
||||
confirm("确定开启诊断吗", () => { |
||||
loading.value = true; |
||||
basicInfoDiagnosis(prop.devId, remote) |
||||
.then(({ data }) => { |
||||
result.value = data; |
||||
}) |
||||
.finally(() => { |
||||
loading.value = false; |
||||
}); |
||||
}); |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped> |
||||
:deep(.my-label2) { |
||||
width: 0 !important; |
||||
display: none !important; |
||||
background: var(--el-color-white) !important; |
||||
} |
||||
.my-content { |
||||
font-size: 14px; |
||||
color: var(--el-text-color-regular); |
||||
} |
||||
</style> |
Loading…
Reference in new issue