|
@@ -272,7 +272,7 @@ import testBgsamll from '~src/assets/view/testBgsamll.png';
|
|
|
import HcCard1 from './components/hc-card1.vue'
|
|
|
import HcTable1 from './components/hc-table1.vue'
|
|
|
import reportApi from "~api/custody/testing.js";
|
|
|
-import {getArrValue, toParse, getObjValue, isArrIndex} from "js-fast-way"
|
|
|
+import {getArrValue, toParse, getObjValue, isArrIndex, deepClone} from "js-fast-way"
|
|
|
import truePng from '~src/assets/testphoto/true.png';
|
|
|
import fullPng from '~src/assets/testphoto/full.png';
|
|
|
import usePng from '~src/assets/testphoto/use.png';
|
|
@@ -305,7 +305,7 @@ const tableLoading = ref(false)
|
|
|
//一键检测
|
|
|
const reportId=ref(0)
|
|
|
const detectionLoad=ref(false)
|
|
|
-const detection=async()=>{
|
|
|
+const detection = async()=>{
|
|
|
detectionLoad.value=true
|
|
|
const { error, code, data } = await reportApi.getExamining({
|
|
|
projectId: projectId.value,
|
|
@@ -328,7 +328,7 @@ const detection=async()=>{
|
|
|
onMounted(() => {
|
|
|
getReportData()
|
|
|
getReportStatusdata()
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
//获取检测报告状态
|
|
|
const getReportStatusdata=async()=>{
|
|
@@ -361,18 +361,46 @@ const props = defineProps(
|
|
|
}
|
|
|
)
|
|
|
//检测百分比
|
|
|
-const statusPercent=ref('25%')
|
|
|
-const finalUrl=ref('')
|
|
|
-const pushTable = (item) => {
|
|
|
- setTimeout(() => {
|
|
|
- tableData.value.unshift(item)
|
|
|
+const statusPercent = ref('25%')
|
|
|
+const finalUrl = ref('')
|
|
|
|
|
|
- }, 1000);
|
|
|
+const newTabledata = ref([])
|
|
|
|
|
|
-
|
|
|
+const pushTable = async () => {
|
|
|
+ const arr = reTabledata.value
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ if (!isArrIndex(newTabledata.value, 'id', arr[i].id)) {
|
|
|
+ console.log(arr[i].id, 'id')
|
|
|
+ newTabledata.value.push(arr[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setTimeoutData().then()
|
|
|
}
|
|
|
|
|
|
-const reTabledata=ref([])
|
|
|
+
|
|
|
+const isTimeout = ref(false)
|
|
|
+const setTimeoutData = async () => {
|
|
|
+ const arr = newTabledata.value
|
|
|
+ console.log(arr, 'arr');
|
|
|
+ if (!isTimeout.value && arr.length > 0) {
|
|
|
+ isTimeout.value = true
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ const item = await getTimeoutData(arr[i])
|
|
|
+ tableData.value.unshift(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const getTimeoutData = (item) => {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ resolve(item)
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const reTabledata = ref([])
|
|
|
+
|
|
|
//监听
|
|
|
watch(() => [
|
|
|
props.msgCount,
|
|
@@ -380,17 +408,15 @@ watch(() => [
|
|
|
props.msgChange,
|
|
|
], ([val,index,msgChange]) => {
|
|
|
const res = toParse(val)
|
|
|
- if(res===true&&msgChange>0) {
|
|
|
+ if(res === true && msgChange > 0) {
|
|
|
reportApi.getCurrentExaminingInfo({ reportId: reportId.value}).then((res)=>{
|
|
|
- console.log(res.data,'res');
|
|
|
- let resdata=res.data
|
|
|
+ let resdata = res.data
|
|
|
activeIndex.value = resdata.status;
|
|
|
- tableData.value=resdata.detailList;
|
|
|
- reTabledata.value=resdata.detailList
|
|
|
- finalUrl.value=resdata.pdfUrl||''
|
|
|
+ reTabledata.value = resdata.detailList
|
|
|
+ finalUrl.value = resdata.pdfUrl||''
|
|
|
+ pushTable()
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
if(index.value===1){
|
|
|
statusPercent.value='25%'
|
|
|
}else if(index.value===2){
|
|
@@ -400,7 +426,7 @@ watch(() => [
|
|
|
}else if(index.value===4){
|
|
|
statusPercent.value='100%'
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
)
|
|
|
//监听
|
|
@@ -427,7 +453,6 @@ const getReportData = async () => {
|
|
|
reportLoading.value = true
|
|
|
const { error, code, data } = await reportApi.getReportList({
|
|
|
projectId: projectId.value,
|
|
|
-
|
|
|
})
|
|
|
reportLoading.value = false
|
|
|
if (!error && code === 200) {
|