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