|
@@ -6,7 +6,7 @@
|
|
|
<el-table :data="reportData" style="width: 100%;" border :span-method="spanMethod">
|
|
|
<el-table-column prop="className" label="分类" width="180" align="center"/>
|
|
|
<el-table-column prop="checkName" label="巡检项"/>
|
|
|
- <el-table-column label="巡检结果" width="160" align="center" prop="resultL" />
|
|
|
+ <el-table-column label="巡检结果" width="160" align="center" prop="resultL"/>
|
|
|
<el-table-column prop="remark" label="备注" align="center" width="160">
|
|
|
<template #default="{row}">
|
|
|
<span :style="`color:${row.resultR === '正常'?'#1ab43f':'#e43'}`">
|
|
@@ -20,24 +20,26 @@
|
|
|
<script setup lang="ts">
|
|
|
import {chkcResult} from "@/api/check/chkc"
|
|
|
import axios from "axios";
|
|
|
-import { getToken } from '@/utils/auth'
|
|
|
+import {getToken} from '@/utils/auth'
|
|
|
+import {onMounted} from "vue";
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
crId: {
|
|
|
type: Number,
|
|
|
default: 0
|
|
|
},
|
|
|
- spanMethod:{
|
|
|
- type:Function
|
|
|
+ spanMethod: {
|
|
|
+ type: Function
|
|
|
}
|
|
|
})
|
|
|
const reportData = ref([])
|
|
|
|
|
|
-const exportReport=async ()=>{
|
|
|
+const exportReport = async () => {
|
|
|
const response = await axios({
|
|
|
- url: import.meta.env.VITE_APP_BASE_API+'/check/chkc/export/' + props.crId,
|
|
|
+ url: import.meta.env.VITE_APP_BASE_API + '/check/chkc/export/' + props.crId,
|
|
|
method: 'GET',
|
|
|
responseType: 'blob',
|
|
|
- headers: { 'Authorization': 'Bearer ' + getToken() }
|
|
|
+ headers: {'Authorization': 'Bearer ' + getToken()}
|
|
|
});
|
|
|
const url = window.URL.createObjectURL(new Blob([response.data]));
|
|
|
const link = document.createElement('a');
|
|
@@ -53,7 +55,11 @@ const getReport = async () => {
|
|
|
reportData.value = res.data.detailList
|
|
|
}
|
|
|
|
|
|
-watch(()=>props.crId,()=>{
|
|
|
+watch(() => props.crId, () => {
|
|
|
+ getReport()
|
|
|
+})
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
getReport()
|
|
|
})
|
|
|
|