微调
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
<div class="dialog-title">
|
||||
<div class="timeView">
|
||||
<el-icon style="margin: 0px 5px">
|
||||
<Clock />
|
||||
<Clock/>
|
||||
</el-icon>
|
||||
<span>检测用时:{{ timeView }}</span>
|
||||
</div>
|
||||
<el-progress style="width: 82%; margin-right: 3%" :percentage="percentage" :color="customColors" />
|
||||
<el-progress style="width: 82%; margin-right: 3%" :percentage="percentage" :color="customColors"/>
|
||||
<el-button style="width: 10%" type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button>
|
||||
</div>
|
||||
<div class="dialog-content">
|
||||
@@ -77,10 +77,10 @@
|
||||
class="loading-box"
|
||||
style="color: #fff"
|
||||
>
|
||||
<component :is="Loading" />
|
||||
<component :is="Loading"/>
|
||||
</el-icon>
|
||||
<el-icon v-else style="color: #fff">
|
||||
<component :is="row.devices[index1].chnResult[index2].icon" />
|
||||
<component :is="row.devices[index1].chnResult[index2].icon"/>
|
||||
</el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
@@ -107,7 +107,7 @@
|
||||
}"
|
||||
>
|
||||
{{ item.log }}
|
||||
<br />
|
||||
<br/>
|
||||
</p>
|
||||
</div>
|
||||
</el-drawer>
|
||||
@@ -120,19 +120,17 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="tsx" setup name="test">
|
||||
import { InfoFilled, Loading } from '@element-plus/icons-vue'
|
||||
import {InfoFilled, Loading} from '@element-plus/icons-vue'
|
||||
import CompareDataCheckSingleChannelSingleTestPopup from './compareDataCheckSingleChannelSingleTestPopup.vue'
|
||||
import { computed, ComputedRef, onBeforeMount, reactive, ref, toRef, watch, onMounted } from 'vue'
|
||||
import { dialogBig } from '@/utils/elementBind'
|
||||
import { CheckData } from '@/api/check/interface'
|
||||
import { useCheckStore } from '@/stores/modules/check'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getBigTestItem } from '@/api/check/test'
|
||||
import { getAutoGenerate } from '@/api/user/login'
|
||||
import { generateDevReport } from '@/api/plan/plan'
|
||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {computed, ComputedRef, onBeforeMount, onMounted, reactive, ref, toRef, watch} from 'vue'
|
||||
import {dialogBig} from '@/utils/elementBind'
|
||||
import {CheckData} from '@/api/check/interface'
|
||||
import {useCheckStore} from '@/stores/modules/check'
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {getBigTestItem} from '@/api/check/test'
|
||||
import {getAutoGenerate} from '@/api/user/login'
|
||||
import {useModeStore} from '@/stores/modules/mode' // 引入模式 store
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
|
||||
const checkStore = useCheckStore()
|
||||
const modeStore = useModeStore()
|
||||
@@ -169,7 +167,7 @@ const emit = defineEmits([
|
||||
// 用来保存测试项进度抽屉是否打开
|
||||
const drawer = ref(false)
|
||||
// 进度条颜色
|
||||
const customColors = [{ color: '#91cc75', percentage: 100 }]
|
||||
const customColors = [{color: '#91cc75', percentage: 100}]
|
||||
// 检测脚本数据
|
||||
let scriptData: CheckData.ScriptItem[] = []
|
||||
// 用来保存被检设备
|
||||
@@ -192,7 +190,7 @@ const checkResult = reactive<CheckData.ScriptChnItem[]>([])
|
||||
// 用来存放检测出现失败的测试项id。只要有一个通道检测不合格,则该检测项的id会被加入该数组。
|
||||
let errorCheckItem: Array<{ scriptType: string; type: CheckData.ChnCheckResultEnum }> = []
|
||||
// 用来存放检测日志
|
||||
const testLogList = reactive<CheckData.LogItem[]>([{ type: 'info', log: '暂无数据,等待检测开始' }])
|
||||
const testLogList = reactive<CheckData.LogItem[]>([{type: 'info', log: '暂无数据,等待检测开始'}])
|
||||
|
||||
const testStatus = toRef(props, 'testStatus')
|
||||
const webMsgSend = toRef(props, 'webMsgSend')
|
||||
@@ -226,10 +224,10 @@ const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(()
|
||||
for (let j = 0; j < device.chnResult.length; j++) {
|
||||
switch (device.chnResult[j]) {
|
||||
case CheckData.ChnCheckResultEnum.UNKNOWN:
|
||||
tempChnBtnResult.push({ color: CheckData.ButtonColorEnum.INFO, icon: 'More' })
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'More'})
|
||||
break
|
||||
case CheckData.ChnCheckResultEnum.LOADING:
|
||||
tempChnBtnResult.push({ color: CheckData.ButtonColorEnum.LOADING, icon: 'Loading' })
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.LOADING, icon: 'Loading'})
|
||||
break
|
||||
case CheckData.ChnCheckResultEnum.SUCCESS:
|
||||
tempChnBtnResult.push({
|
||||
@@ -238,10 +236,10 @@ const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(()
|
||||
})
|
||||
break
|
||||
case CheckData.ChnCheckResultEnum.FAIL:
|
||||
tempChnBtnResult.push({ color: CheckData.ButtonColorEnum.DANGER, icon: 'Close' })
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.DANGER, icon: 'Close'})
|
||||
break
|
||||
case CheckData.ChnCheckResultEnum.TIMEOUT:
|
||||
tempChnBtnResult.push({ color: CheckData.ButtonColorEnum.WARNING, icon: 'Link' })
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.WARNING, icon: 'Link'})
|
||||
break
|
||||
case CheckData.ChnCheckResultEnum.ERRORDATA:
|
||||
tempChnBtnResult.push({
|
||||
@@ -250,7 +248,7 @@ const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(()
|
||||
})
|
||||
break
|
||||
case CheckData.ChnCheckResultEnum.NOT_PART_IN_ERROR:
|
||||
tempChnBtnResult.push({ color: CheckData.ButtonColorEnum.INFO, icon: 'Minus' })
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Minus'})
|
||||
break
|
||||
default:
|
||||
break
|
||||
@@ -276,7 +274,7 @@ watch(testStatus, function (newValue, oldValue) {
|
||||
ElMessage.success('初始化开始!')
|
||||
emit('update:testStatus', 'test_init')
|
||||
if (checkStore.selectTestItems.test && checkStore.selectTestItems.preTest) {
|
||||
testLogList.push({ type: 'info', log: `${new Date().toLocaleString()}:初始化开始!` })
|
||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`})
|
||||
}
|
||||
} else {
|
||||
emit('update:testStatus', 'process')
|
||||
@@ -339,6 +337,7 @@ watch(
|
||||
}
|
||||
switch (newValue.code) {
|
||||
case 25001:
|
||||
case 25005:
|
||||
let result: CheckData.ScriptChnItem[] = []
|
||||
let message = JSON.parse(newValue.data)
|
||||
|
||||
@@ -364,9 +363,14 @@ watch(
|
||||
})
|
||||
Object.assign(checkResult, result)
|
||||
|
||||
if (newValue.code == 25001) {
|
||||
setLogList('info', '检测完成!')
|
||||
stopTimeCount()
|
||||
updatePercentage()
|
||||
}
|
||||
if(newValue.code == 25005){
|
||||
setLogList("error", '实时数据校验失败!开始录波校验...')
|
||||
}
|
||||
break
|
||||
case 25003:
|
||||
setLogList('error', '检测失败!')
|
||||
@@ -426,7 +430,7 @@ watch(
|
||||
break
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
{deep: true}
|
||||
)
|
||||
const setLogList = (state: 'error' | 'info' | 'warning', text: string) => {
|
||||
testLogList.push({
|
||||
@@ -443,7 +447,7 @@ const updatePercentage = async () => {
|
||||
percentage.value = 100
|
||||
emit('update:testStatus', 'success')
|
||||
|
||||
let { data: autoGenerate } = await getAutoGenerate()
|
||||
let {data: autoGenerate} = await getAutoGenerate()
|
||||
if (autoGenerate == 1) {
|
||||
//调用自动生成报告接口
|
||||
let devIdList = checkStore.devices.map(item => {
|
||||
@@ -507,7 +511,8 @@ const secondToTime = (second: number) => {
|
||||
return h + ':' + m + ':' + s
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {})
|
||||
onBeforeMount(async () => {
|
||||
})
|
||||
|
||||
const showTestLog = () => {
|
||||
drawer.value = true
|
||||
@@ -583,7 +588,7 @@ watch(
|
||||
() => {
|
||||
scrollToBottom()
|
||||
},
|
||||
{ deep: true }
|
||||
{deep: true}
|
||||
)
|
||||
|
||||
// 点击查看(设备)通道检测详情。参数1:设备信息,参数2:通道号,-1:代表查看全部通道
|
||||
|
||||
Reference in New Issue
Block a user