微调
This commit is contained in:
@@ -13,63 +13,63 @@
|
||||
:percentage="percentage"
|
||||
:color="customColors"/>
|
||||
|
||||
<!-- <div style="width: 15%">-->
|
||||
<!-- <el-button type="primary" v-if="testStatus=='test_init'" disabled @click="handlePause()">-->
|
||||
<!-- <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">-->
|
||||
<!-- <component :is="Refresh"/>-->
|
||||
<!-- </el-icon>-->
|
||||
<!-- 初始化中-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <div style="width: 15%">-->
|
||||
<!-- <el-button type="primary" v-if="testStatus=='test_init'" disabled @click="handlePause()">-->
|
||||
<!-- <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">-->
|
||||
<!-- <component :is="Refresh"/>-->
|
||||
<!-- </el-icon>-->
|
||||
<!-- 初始化中-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- v-if="testStatus=='process' && percentage < 100"-->
|
||||
<!-- :icon="VideoPause"-->
|
||||
<!-- @click="handlePause()">停止检测-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button type="warning" v-if="testStatus === 'paused_ing' && percentage < 100" disabled>-->
|
||||
<!-- <el-icon class="loading-box" style="margin-right: 8px;">-->
|
||||
<!-- <component :is="Refresh"/>-->
|
||||
<!-- </el-icon>-->
|
||||
<!-- 暂停中-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <!– <el-button–>-->
|
||||
<!-- <!– type="primary"–>-->
|
||||
<!-- <!– v-if="testStatus=='test_init'"–>-->
|
||||
<!-- <!– :icon="VideoPause"–>-->
|
||||
<!-- <!– disabled>初始化中–>-->
|
||||
<!-- <!– </el-button>–>-->
|
||||
<!-- <!– <el-button–>-->
|
||||
<!-- <!– type="danger"–>-->
|
||||
<!-- <!– v-if="testStatus=='test_init_fail'"–>-->
|
||||
<!-- <!– :icon="Failed"–>-->
|
||||
<!-- <!– disabled>初始化失败–>-->
|
||||
<!-- <!– </el-button>–>-->
|
||||
<!-- <!– <el-button–>-->
|
||||
<!-- <!– type="danger"–>-->
|
||||
<!-- <!– v-if="testStatus=='connect_timeout'"–>-->
|
||||
<!-- <!– :icon="Failed"–>-->
|
||||
<!-- <!– disabled>连接超时–>-->
|
||||
<!-- <!– </el-button>–>-->
|
||||
<!-- <!– <el-button–>-->
|
||||
<!-- <!– type="primary"–>-->
|
||||
<!-- <!– :icon="RefreshLeft"–>-->
|
||||
<!-- <!– v-if="testStatus === 'recheck'"–>-->
|
||||
<!-- <!– @click="emit('sendReCheck')">重新检测–>-->
|
||||
<!-- <!– </el-button>–>-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- v-if="testStatus=='process' && percentage < 100"-->
|
||||
<!-- :icon="VideoPause"-->
|
||||
<!-- @click="handlePause()">停止检测-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button type="warning" v-if="testStatus === 'paused_ing' && percentage < 100" disabled>-->
|
||||
<!-- <el-icon class="loading-box" style="margin-right: 8px;">-->
|
||||
<!-- <component :is="Refresh"/>-->
|
||||
<!-- </el-icon>-->
|
||||
<!-- 暂停中-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <!– <el-button–>-->
|
||||
<!-- <!– type="primary"–>-->
|
||||
<!-- <!– v-if="testStatus=='test_init'"–>-->
|
||||
<!-- <!– :icon="VideoPause"–>-->
|
||||
<!-- <!– disabled>初始化中–>-->
|
||||
<!-- <!– </el-button>–>-->
|
||||
<!-- <!– <el-button–>-->
|
||||
<!-- <!– type="danger"–>-->
|
||||
<!-- <!– v-if="testStatus=='test_init_fail'"–>-->
|
||||
<!-- <!– :icon="Failed"–>-->
|
||||
<!-- <!– disabled>初始化失败–>-->
|
||||
<!-- <!– </el-button>–>-->
|
||||
<!-- <!– <el-button–>-->
|
||||
<!-- <!– type="danger"–>-->
|
||||
<!-- <!– v-if="testStatus=='connect_timeout'"–>-->
|
||||
<!-- <!– :icon="Failed"–>-->
|
||||
<!-- <!– disabled>连接超时–>-->
|
||||
<!-- <!– </el-button>–>-->
|
||||
<!-- <!– <el-button–>-->
|
||||
<!-- <!– type="primary"–>-->
|
||||
<!-- <!– :icon="RefreshLeft"–>-->
|
||||
<!-- <!– v-if="testStatus === 'recheck'"–>-->
|
||||
<!-- <!– @click="emit('sendReCheck')">重新检测–>-->
|
||||
<!-- <!– </el-button>–>-->
|
||||
|
||||
|
||||
<!-- <el-button type="success" v-if="percentage >= 100" :icon="Check" disabled>检测完成</el-button>-->
|
||||
<!-- <el-button type="success" v-if="percentage >= 100" :icon="Check" disabled>检测完成</el-button>-->
|
||||
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- v-if="(testStatus=='paused' || testStatus === 'pause_timeout') && percentage < 100"-->
|
||||
<!-- :icon="VideoPlay"-->
|
||||
<!-- :disabled="testStatus === 'pause_timeout'"-->
|
||||
<!-- @click="emit('sendResume')"-->
|
||||
<!-- >继续检测-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- v-if="(testStatus=='paused' || testStatus === 'pause_timeout') && percentage < 100"-->
|
||||
<!-- :icon="VideoPlay"-->
|
||||
<!-- :disabled="testStatus === 'pause_timeout'"-->
|
||||
<!-- @click="emit('sendResume')"-->
|
||||
<!-- >继续检测-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </div>-->
|
||||
<el-button style="width: 10%" type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
</div>
|
||||
<div class="drawer-container">
|
||||
<el-drawer v-model="drawer" title="检测项进度" direction="btt">
|
||||
<el-drawer v-model="drawer" title="检测项进度" direction="btt" :size="'38%'">
|
||||
<div ref="scrollContainerRef" style="height: 100%; overflow-y: auto;">
|
||||
<p v-for="(item, index) in testLogList"
|
||||
:key="index"
|
||||
@@ -156,15 +156,15 @@
|
||||
</el-drawer>
|
||||
</div>
|
||||
|
||||
<!-- <resultPopup-->
|
||||
<!-- :visible="resultDialogVisible"-->
|
||||
<!-- @update:visible="resultDialogVisible = $event"-->
|
||||
<!-- ></resultPopup>-->
|
||||
<!-- <resultPopup-->
|
||||
<!-- :visible="resultDialogVisible"-->
|
||||
<!-- @update:visible="resultDialogVisible = $event"-->
|
||||
<!-- ></resultPopup>-->
|
||||
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="tsx" setup name="test">
|
||||
import {Check, InfoFilled, Loading, Refresh, VideoPause, VideoPlay} from '@element-plus/icons-vue'
|
||||
import {InfoFilled, Loading} from '@element-plus/icons-vue'
|
||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||
import {computed, reactive, ref, toRef, watch} from "vue";
|
||||
import {dialogBig} from "@/utils/elementBind";
|
||||
@@ -198,7 +198,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:testStatus', 'update:webMsgSend', 'sendPause', 'sendResume', 'sendReCheck']);
|
||||
const emit = defineEmits(['update:testStatus', 'update:webMsgSend', 'sendPause', 'sendResume', 'sendReCheck', 'closeWebSocket']);
|
||||
|
||||
// 用来保存测试项进度抽屉是否打开
|
||||
const drawer = ref(false)
|
||||
@@ -456,7 +456,18 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源连接失败!`})
|
||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:服务端主动关闭连接!`})
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
count++
|
||||
}
|
||||
break;
|
||||
case 'device_error':
|
||||
if (newValue.operateCode === 'device_error' && count === 0) {
|
||||
ElMessageBox.alert('设备端主动关闭连接!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:设备端主动关闭连接!`})
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
count++
|
||||
}
|
||||
@@ -563,7 +574,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
log: `${new Date().toLocaleString()}:脚本与icd校验失败!icd名称:${data['icdType']} -> 校验项:${data['dataType']}`
|
||||
})
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
}else if(newValue.code == 10500) {
|
||||
} else if (newValue.code == 10500) {
|
||||
ElMessageBox.alert(`装置中未找到该icd!`, '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
@@ -682,9 +693,9 @@ const handleStartItem = (code: string, desc: string | undefined) => {
|
||||
updateCheckResultView(code, true)
|
||||
updateLog(true)
|
||||
} else {
|
||||
if (desc.length > 150) {
|
||||
desc = desc.substring(0, 150) + '...'
|
||||
}
|
||||
// if (desc.length > 150) {
|
||||
// desc = desc.substring(0, 150) + '...'
|
||||
// }
|
||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:${desc}准确度检测:开始`})
|
||||
}
|
||||
}
|
||||
@@ -700,9 +711,9 @@ const handleEndItem = (code: string, desc: string | undefined, devices: CheckDat
|
||||
}
|
||||
} else {
|
||||
let result = getResult(devices)
|
||||
if (desc.length > 150) {
|
||||
desc = desc.substring(0, 150) + '...'
|
||||
}
|
||||
// if (desc.length > 150) {
|
||||
// desc = desc.substring(0, 150) + '...'
|
||||
// }
|
||||
if (result === 1) {
|
||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:${desc}检测结束:符合`})
|
||||
}
|
||||
@@ -726,20 +737,22 @@ const updatePercentage = async () => {
|
||||
let {data: autoGenerate} = await getAutoGenerate()
|
||||
if (autoGenerate == 1) {
|
||||
//调用自动生成报告接口
|
||||
let devIdList=checkStore.devices.map(item => {
|
||||
let devIdList = checkStore.devices.map(item => {
|
||||
return item.deviceId
|
||||
})
|
||||
|
||||
await generateDevReport({
|
||||
'planId': checkStore.plan.id,
|
||||
'devIdList':devIdList,
|
||||
'scriptId':checkStore.plan.scriptId,
|
||||
'planCode':checkStore.plan.code+''
|
||||
'devIdList': devIdList,
|
||||
'scriptId': checkStore.plan.scriptId,
|
||||
'planCode': checkStore.plan.code + ''
|
||||
})
|
||||
}
|
||||
ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', {
|
||||
confirmButtonText: '确定',
|
||||
})
|
||||
// 关闭WebSocket连接
|
||||
emit('closeWebSocket')
|
||||
//clear();
|
||||
}
|
||||
}
|
||||
@@ -773,7 +786,7 @@ const showTestLog = () => {
|
||||
// 初始化检测脚本数据
|
||||
const initScriptData = async () => {
|
||||
|
||||
let response: any = await getBigTestItem({reCheckType:checkStore.reCheckType, planId:checkStore.plan.id,devIds:checkStore.devices.map(item => item.deviceId)})
|
||||
let response: any = await getBigTestItem({reCheckType: checkStore.reCheckType, planId: checkStore.plan.id, devIds: checkStore.devices.map(item => item.deviceId)})
|
||||
|
||||
let temp = response.data.map(item => {
|
||||
return {
|
||||
@@ -1566,6 +1579,7 @@ defineExpose({
|
||||
:deep(header.el-drawer__header) {
|
||||
color: #fff !important;
|
||||
background-color: var(--el-color-primary) !important;
|
||||
|
||||
.el-drawer__close-btn svg:hover {
|
||||
color: #ccc !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user