Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
<router-view v-slot="{ Component, route }" style="height:100%;">
|
<router-view v-slot="{ Component, route }" style="height:100%;">
|
||||||
<!-- {{ keepAliveName}} -->
|
<!-- {{ keepAliveName}} -->
|
||||||
<!-- <transition name="slide-right" mode="out-in"> -->
|
<!-- <transition name="slide-right" mode="out-in"> -->
|
||||||
<keep-alive :include="keepAliveName" >
|
<keep-alive :include="tabsMenuList" >
|
||||||
<component :is="Component" :key="route.fullPath" />
|
<component :is="Component" :key="route.fullPath" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
<!-- </transition> -->
|
<!-- </transition> -->
|
||||||
@@ -26,11 +26,12 @@ import Maximize from "./components/Maximize.vue";
|
|||||||
import Tabs from "@/layouts/components/Tabs/index.vue";
|
import Tabs from "@/layouts/components/Tabs/index.vue";
|
||||||
import Footer from "@/layouts/components/Footer/index.vue";
|
import Footer from "@/layouts/components/Footer/index.vue";
|
||||||
import { useAuthStore } from "@/stores/modules/auth";
|
import { useAuthStore } from "@/stores/modules/auth";
|
||||||
import { useRoute, type RouteLocationNormalized } from 'vue-router'
|
import { useTabsStore } from '@/stores/modules/tabs'
|
||||||
|
const tabStore = useTabsStore()
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore();
|
||||||
|
const tabsMenuList = computed(() => tabStore.tabsMenuList.map(item => item.name))
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore);
|
const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore);
|
||||||
const route = useRoute()
|
|
||||||
const keepAliveStore = useKeepAliveStore();
|
const keepAliveStore = useKeepAliveStore();
|
||||||
const { keepAliveName } = storeToRefs(keepAliveStore);
|
const { keepAliveName } = storeToRefs(keepAliveStore);
|
||||||
// console.log("🚀 ~ keepAliveName:", keepAliveName)
|
// console.log("🚀 ~ keepAliveName:", keepAliveName)
|
||||||
@@ -61,14 +62,7 @@ watch(
|
|||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
watch(
|
|
||||||
() => route.path,
|
|
||||||
() => {
|
|
||||||
console.log(123, route.path);
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
// 监听窗口大小变化,折叠侧边栏
|
// 监听窗口大小变化,折叠侧边栏
|
||||||
const screenWidth = ref(0);
|
const screenWidth = ref(0);
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ const initTabs = () => {
|
|||||||
name: item.name,
|
name: item.name,
|
||||||
close: !item.meta.isAffix,
|
close: !item.meta.isAffix,
|
||||||
isKeepAlive: item.meta.isKeepAlive,
|
isKeepAlive: item.meta.isKeepAlive,
|
||||||
|
unshift:true
|
||||||
}
|
}
|
||||||
tabStore.addTabs(tabsParams)
|
tabStore.addTabs(tabsParams)
|
||||||
}
|
}
|
||||||
@@ -100,6 +101,7 @@ const tabsDrop = () => {
|
|||||||
// Tab Click
|
// Tab Click
|
||||||
const tabClick = (tabItem: TabsPaneContext) => {
|
const tabClick = (tabItem: TabsPaneContext) => {
|
||||||
const fullPath = tabItem.props.name as string
|
const fullPath = tabItem.props.name as string
|
||||||
|
console.log("🚀 ~ tabClick ~ fullPath:", tabItem)
|
||||||
router.push(fullPath)
|
router.push(fullPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export interface TabsMenuProps {
|
|||||||
name: string;
|
name: string;
|
||||||
close: boolean;
|
close: boolean;
|
||||||
isKeepAlive: boolean;
|
isKeepAlive: boolean;
|
||||||
|
unshift?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TabsState */
|
/* TabsState */
|
||||||
|
|||||||
@@ -16,8 +16,14 @@ export const useTabsStore = defineStore({
|
|||||||
actions: {
|
actions: {
|
||||||
// Add Tabs
|
// Add Tabs
|
||||||
async addTabs(tabItem: TabsMenuProps) {
|
async addTabs(tabItem: TabsMenuProps) {
|
||||||
|
|
||||||
if (this.tabsMenuList.every(item => item.path !== tabItem.path)) {
|
if (this.tabsMenuList.every(item => item.path !== tabItem.path)) {
|
||||||
|
if (tabItem?.unshift) {
|
||||||
|
this.tabsMenuList.unshift(tabItem);
|
||||||
|
}else{
|
||||||
this.tabsMenuList.push(tabItem);
|
this.tabsMenuList.push(tabItem);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!keepAliveStore.keepAliveName.includes(tabItem.name) && tabItem.isKeepAlive) {
|
if (!keepAliveStore.keepAliveName.includes(tabItem.name) && tabItem.isKeepAlive) {
|
||||||
keepAliveStore.addKeepAliveName(tabItem.name);
|
keepAliveStore.addKeepAliveName(tabItem.name);
|
||||||
|
|||||||
@@ -481,6 +481,13 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
type: 'wait',
|
type: 'wait',
|
||||||
log: '获取数据相序校验数据!',
|
log: '获取数据相序校验数据!',
|
||||||
}];
|
}];
|
||||||
|
} else if (newValue.code == 25003) {
|
||||||
|
step4.value = 'error'
|
||||||
|
step4InitLog.value.push({
|
||||||
|
type: 'error',
|
||||||
|
log: '相序校验未通过!',
|
||||||
|
})
|
||||||
|
ts.value = 'error'
|
||||||
}else if (newValue.code == 25001) {
|
}else if (newValue.code == 25001) {
|
||||||
step4.value = 'success'
|
step4.value = 'success'
|
||||||
step5.value = 'success'
|
step5.value = 'success'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
@click="handlePause()">停止检测
|
@click="handlePause()">停止检测
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="warning" v-if="testStatus === 'paused_ing' && percentage < 100" disabled>
|
<el-button type="warning" v-if="testStatus === 'paused_ing' && percentage < 100" disabled>
|
||||||
<el-icon class="loading-box">
|
<el-icon class="loading-box" style="margin-right: 8px;">
|
||||||
<component :is="Refresh"/>
|
<component :is="Refresh"/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
暂停中
|
暂停中
|
||||||
@@ -303,7 +303,6 @@ watch(testStatus, function (newValue, oldValue) {
|
|||||||
if (newValue == 'start') {
|
if (newValue == 'start') {
|
||||||
ElMessage.success('初始化开始!')
|
ElMessage.success('初始化开始!')
|
||||||
|
|
||||||
startData.value = new Date();
|
|
||||||
showTestLog()
|
showTestLog()
|
||||||
|
|
||||||
if (oldValue == 'error') {
|
if (oldValue == 'error') {
|
||||||
@@ -315,6 +314,8 @@ watch(testStatus, function (newValue, oldValue) {
|
|||||||
}
|
}
|
||||||
emit('update:testStatus', 'test_init')
|
emit('update:testStatus', 'test_init')
|
||||||
//startTimer() // todo 可移除
|
//startTimer() // todo 可移除
|
||||||
|
startData.value = new Date();
|
||||||
|
timeDifference.value = 0;
|
||||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`})
|
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -343,7 +344,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
type: 'error',
|
type: 'error',
|
||||||
log: `${new Date().toLocaleString()}:存在已经初始化步骤,执行自动关闭,请重新发起检测!`
|
log: `${new Date().toLocaleString()}:存在已经初始化步骤,执行自动关闭,请重新发起检测!`
|
||||||
})
|
})
|
||||||
emit('update:testStatus', 'error')
|
emit('update:testStatus', 'test_recheck')
|
||||||
} else {
|
} else {
|
||||||
switch (newValue.requestId) {
|
switch (newValue.requestId) {
|
||||||
case 'error_flow_end':
|
case 'error_flow_end':
|
||||||
@@ -418,9 +419,11 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
if (newValue.code == 25001) {
|
if (newValue.code == 25001) {
|
||||||
ElMessage.success('初始化成功!')
|
ElMessage.success('初始化成功!')
|
||||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:协议校验成功!`})
|
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:协议校验成功!`})
|
||||||
|
timeDifference.value = + new Date().getTime() - startData.value.getTime();
|
||||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`})
|
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`})
|
||||||
percentage.value = 3
|
percentage.value = 3
|
||||||
|
|
||||||
|
|
||||||
activeIndex = getNextActiveIndex() + 2
|
activeIndex = getNextActiveIndex() + 2
|
||||||
//startTimer()
|
//startTimer()
|
||||||
|
|
||||||
@@ -448,172 +451,76 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
// ElMessage.error('无法继续检测')
|
// ElMessage.error('无法继续检测')
|
||||||
// break;
|
// break;
|
||||||
case 'FREQ_Start':
|
case 'FREQ_Start':
|
||||||
activeIndex = getActiveIndex('FREQ')
|
handleStartItem('FREQ', newValue.desc)
|
||||||
updateCheckResultView("FREQ", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'FREQ_End':
|
case 'FREQ_End':
|
||||||
updatePercentage()
|
handleEndItem('FREQ', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("FREQ", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('FREQ')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'V_Start':
|
case 'V_Start':
|
||||||
activeIndex = getActiveIndex('V')
|
handleStartItem('V', newValue.desc)
|
||||||
updateCheckResultView("V", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'V_End':
|
case 'V_End':
|
||||||
updatePercentage()
|
handleEndItem('V', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("V", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('V')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'HV_Start':
|
case 'HV_Start':
|
||||||
activeIndex = getActiveIndex('HV')
|
handleStartItem('HV', newValue.desc)
|
||||||
updateCheckResultView("HV", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'HV_End':
|
case 'HV_End':
|
||||||
updatePercentage()
|
handleEndItem('HV', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("HV", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('HV')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'HI_Start':
|
case 'HI_Start':
|
||||||
activeIndex = getActiveIndex('HI')
|
handleStartItem('HI', newValue.desc)
|
||||||
updateCheckResultView("HI", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'HI_End':
|
case 'HI_End':
|
||||||
updatePercentage()
|
handleEndItem('HI', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("HI", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('HI')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'HP_Start':
|
case 'HP_Start':
|
||||||
activeIndex = getActiveIndex('HP')
|
handleStartItem('HP', newValue.desc)
|
||||||
updateCheckResultView("HP", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'HP_End':
|
case 'HP_End':
|
||||||
updatePercentage()
|
handleEndItem('HP', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("HP", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('HP')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'HSV_Start':
|
case 'HSV_Start':
|
||||||
activeIndex = getActiveIndex('HSV')
|
handleStartItem('HSV', newValue.desc)
|
||||||
updateCheckResultView("HSV", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'HSV_End':
|
case 'HSV_End':
|
||||||
updatePercentage()
|
handleEndItem('HSV', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("HSV", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('HSV')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'HSI_Start':
|
case 'HSI_Start':
|
||||||
activeIndex = getActiveIndex('HSI')
|
handleStartItem('HSI', newValue.desc)
|
||||||
updateCheckResultView("HSI", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'HSI_End':
|
case 'HSI_End':
|
||||||
updatePercentage()
|
handleEndItem('HSI', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("HSI", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('HSI')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'VOLTAGE_Start':
|
case 'VOLTAGE_Start':
|
||||||
activeIndex = getActiveIndex('VOLTAGE')
|
handleStartItem('VOLTAGE', newValue.desc)
|
||||||
updateCheckResultView("VOLTAGE", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'VOLTAGE_End':
|
case 'VOLTAGE_End':
|
||||||
updatePercentage()
|
handleEndItem('VOLTAGE', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("VOLTAGE", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('VOLTAGE')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'I_Start':
|
case 'I_Start':
|
||||||
activeIndex = getActiveIndex('I')
|
handleStartItem('I', newValue.desc)
|
||||||
updateCheckResultView("I", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'I_End':
|
case 'I_End':
|
||||||
updatePercentage()
|
handleEndItem('I', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("I", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('I')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'IMBV_Start':
|
case 'IMBV_Start':
|
||||||
activeIndex = getActiveIndex('IMBV')
|
handleStartItem('IMBV', newValue.desc)
|
||||||
updateCheckResultView("IMBV", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'IMBV_End':
|
case 'IMBV_End':
|
||||||
updatePercentage()
|
handleEndItem('IMBV', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("IMBV", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('IMBV')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'IMBA_Start':
|
case 'IMBA_Start':
|
||||||
activeIndex = getActiveIndex('IMBA')
|
handleStartItem('IMBA', newValue.desc)
|
||||||
updateCheckResultView("IMBA", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'IMBA_End':
|
case 'IMBA_End':
|
||||||
updatePercentage()
|
handleEndItem('IMBA', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("IMBA", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('IMBA')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'F_Start':
|
case 'F_Start':
|
||||||
activeIndex = getActiveIndex('F')
|
handleStartItem('F', newValue.desc)
|
||||||
updateCheckResultView("F", true)
|
|
||||||
updateLog(true)
|
|
||||||
break;
|
break;
|
||||||
case 'F_End':
|
case 'F_End':
|
||||||
updatePercentage()
|
handleEndItem('F', newValue.desc, newValue.data)
|
||||||
updateCheckResultView("F", false, newValue.data)
|
|
||||||
updateLog(false)
|
|
||||||
if (testStatus.value != 'paused') {
|
|
||||||
activeIndex = getNextActiveIndex('F')
|
|
||||||
//startTimer()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'Quit':
|
case 'Quit':
|
||||||
console.log('检测结束')
|
console.log('检测结束')
|
||||||
@@ -623,6 +530,44 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
|
|
||||||
}, {deep: true})
|
}, {deep: true})
|
||||||
|
|
||||||
|
const handleStartItem = (code: string, desc: string|undefined) => {
|
||||||
|
if (desc === undefined) {
|
||||||
|
activeIndex = getActiveIndex(code)
|
||||||
|
updateCheckResultView(code, true)
|
||||||
|
updateLog(true)
|
||||||
|
} else {
|
||||||
|
if(desc.length>60){
|
||||||
|
desc = desc.substring(0,60) + '...'
|
||||||
|
}
|
||||||
|
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:${desc}准确度检测:开始`})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleEndItem = (code: string, desc: string|undefined, devices: CheckData.DeviceCheckResult[] = []) => {
|
||||||
|
if (desc === undefined) {
|
||||||
|
updatePercentage()
|
||||||
|
updateCheckResultView(code, false, devices)
|
||||||
|
updateLog(false)
|
||||||
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex = getNextActiveIndex(code)
|
||||||
|
//startTimer()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let result = getResult(devices)
|
||||||
|
if(desc.length>60){
|
||||||
|
desc = desc.substring(0,60) + '...'
|
||||||
|
}
|
||||||
|
if(result === 1){
|
||||||
|
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:${desc}检测结束:符合`})
|
||||||
|
}
|
||||||
|
if(result === 2){
|
||||||
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:${desc}检测结束:不符合`})
|
||||||
|
}
|
||||||
|
if(result === 4){
|
||||||
|
testLogList.push({type: 'warning', log: `${new Date().toLocaleString()}:${desc}检测结束:数据异常`})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 更新进度条
|
// 更新进度条
|
||||||
const updatePercentage = () => {
|
const updatePercentage = () => {
|
||||||
@@ -716,17 +661,21 @@ const updateCheckResult = (data: CheckData.ScriptChnItem) => {
|
|||||||
|
|
||||||
checkResult.forEach(item => {
|
checkResult.forEach(item => {
|
||||||
if (item.scriptType == scriptType) {
|
if (item.scriptType == scriptType) {
|
||||||
item.devices.forEach((device, index) => {
|
for (let i = 0; i < item.devices.length; i++) {
|
||||||
let targetDevice = data.devices.find(dev => dev.deviceId === device.deviceId)
|
let targetDevice = data.devices.find(dev => dev.deviceId === item.devices[i].deviceId)
|
||||||
if (targetDevice !== undefined) {
|
if (targetDevice !== undefined) {
|
||||||
device.chnResult = [...targetDevice.chnResult]
|
item.devices[i].chnResult = [...targetDevice.chnResult]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// item.devices.forEach((device, index) => {
|
||||||
|
// let targetDevice = data.devices.find(dev => dev.deviceId === device.deviceId)
|
||||||
|
// if (targetDevice !== undefined) {
|
||||||
|
// device.chnResult = [...targetDevice.chnResult]
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const scrollToBottom = () => {
|
const scrollToBottom = () => {
|
||||||
if (scrollContainerRef.value) {
|
if (scrollContainerRef.value) {
|
||||||
@@ -768,12 +717,13 @@ const updateLog = (isStart: boolean) => {
|
|||||||
let timeDifferenceItem = 0
|
let timeDifferenceItem = 0
|
||||||
|
|
||||||
if (activeIndex === 1 && isStart) {
|
if (activeIndex === 1 && isStart) {
|
||||||
timeDifference.value = 0;
|
// timeDifference.value = 0;
|
||||||
//testLogList.length = 0; // 清空数组
|
//testLogList.length = 0; // 清空数组
|
||||||
}
|
}
|
||||||
// debugger
|
// debugger
|
||||||
if (activeIndex <= checkTotal) {
|
if (activeIndex <= checkTotal) {
|
||||||
if (isStart) {
|
if (isStart) {
|
||||||
|
startData.value = new Date();
|
||||||
testLogList.push({
|
testLogList.push({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
log: currentTime.value + ` :${scriptData[activeIndex - 1].scriptName}准确度检测:开始`,
|
log: currentTime.value + ` :${scriptData[activeIndex - 1].scriptName}准确度检测:开始`,
|
||||||
@@ -891,8 +841,8 @@ const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: Ch
|
|||||||
// }
|
// }
|
||||||
// {
|
// {
|
||||||
// chnResult: [1, 1, 1, 1],
|
// chnResult: [1, 1, 1, 1],
|
||||||
// deviceId: "2957b271f39d4240a1c5e275c453676c",
|
// deviceId: "461813a4f30f4a34a1a273ecd0379458",
|
||||||
// deviceName: "测试003"
|
// deviceName: "25011407"
|
||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
let temp = null
|
let temp = null
|
||||||
@@ -995,6 +945,23 @@ const getCheckResult = (scriptType: string) => {
|
|||||||
return tempScriptChnItem
|
return tempScriptChnItem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getResult=(devices: CheckData.DeviceCheckResult[] = [])=>{
|
||||||
|
let type = 1
|
||||||
|
let tempChnResult: CheckData.ChnCheckResultEnum[] = []
|
||||||
|
for (let i = 0; i < devices.length; i++) {
|
||||||
|
tempChnResult.push(...devices[i].chnResult)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tempChnResult.some(item => item === CheckData.ChnCheckResultEnum.ERRORDATA)) {
|
||||||
|
type = CheckData.ChnCheckResultEnum.ERRORDATA
|
||||||
|
}
|
||||||
|
if (tempChnResult.some(item => item === CheckData.ChnCheckResultEnum.FAIL)) {
|
||||||
|
type = CheckData.ChnCheckResultEnum.FAIL
|
||||||
|
}
|
||||||
|
return type
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 点击查看(设备)通道检测详情。参数1:设备信息,参数2:通道号,-1:代表查看全部通道
|
// 点击查看(设备)通道检测详情。参数1:设备信息,参数2:通道号,-1:代表查看全部通道
|
||||||
const handleClick = (item: any, chnNum: number, scriptType: string) => {
|
const handleClick = (item: any, chnNum: number, scriptType: string) => {
|
||||||
let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
|
let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
|
||||||
@@ -1082,14 +1049,7 @@ const startTimer = () => {
|
|||||||
}, 6000)
|
}, 6000)
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
emit('update:webMsgSend', {
|
todoItem('V')
|
||||||
requestId: 'V_Start'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'V_End'
|
|
||||||
})
|
|
||||||
}, 2000);
|
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
// requestId: 'FREQ_Start'
|
// requestId: 'FREQ_Start'
|
||||||
@@ -1102,14 +1062,7 @@ const startTimer = () => {
|
|||||||
// }, 2000);
|
// }, 2000);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
emit('update:webMsgSend', {
|
todoItem('I')
|
||||||
requestId: 'I_Start'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'I_End'
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
// requestId: 'V_Start'
|
// requestId: 'V_Start'
|
||||||
// })
|
// })
|
||||||
@@ -1120,14 +1073,7 @@ const startTimer = () => {
|
|||||||
// }, 2000);
|
// }, 2000);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
emit('update:webMsgSend', {
|
todoItem('IMBV')
|
||||||
requestId: 'IMBV_Start'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'IMBV_End'
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
// requestId: 'HV_Start',
|
// requestId: 'HV_Start',
|
||||||
// })
|
// })
|
||||||
@@ -1138,16 +1084,7 @@ const startTimer = () => {
|
|||||||
// }, 2000)
|
// }, 2000)
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
setTimeout(() => {
|
todoItem('FREQ')
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'FREQ_Start'
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'FREQ_End'
|
|
||||||
})
|
|
||||||
}, 2000);
|
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
// requestId: 'HI_Start'
|
// requestId: 'HI_Start'
|
||||||
// })
|
// })
|
||||||
@@ -1158,14 +1095,7 @@ const startTimer = () => {
|
|||||||
// }, 2000)
|
// }, 2000)
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
emit('update:webMsgSend', {
|
todoItem('HV')
|
||||||
requestId: 'HV_Start',
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'HV_End'
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
// requestId: 'HP_Start',
|
// requestId: 'HP_Start',
|
||||||
// })
|
// })
|
||||||
@@ -1176,14 +1106,7 @@ const startTimer = () => {
|
|||||||
// }, 2000)
|
// }, 2000)
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
emit('update:webMsgSend', {
|
todoItem('HI')
|
||||||
requestId: 'HI_Start'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'HI_End'
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
// requestId: 'HSV_Start'
|
// requestId: 'HSV_Start'
|
||||||
// })
|
// })
|
||||||
@@ -1194,14 +1117,7 @@ const startTimer = () => {
|
|||||||
// }, 2000)
|
// }, 2000)
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
emit('update:webMsgSend', {
|
todoItem('HSV')
|
||||||
requestId: 'HSV_Start'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'HSV_End'
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
// requestId: 'HSI_Start'
|
// requestId: 'HSI_Start'
|
||||||
// })
|
// })
|
||||||
@@ -1212,14 +1128,7 @@ const startTimer = () => {
|
|||||||
// }, 2000)
|
// }, 2000)
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
emit('update:webMsgSend', {
|
todoItem('HSI')
|
||||||
requestId: 'HSI_Start'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('update:webMsgSend', {
|
|
||||||
requestId: 'HSI_End'
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
// requestId: 'VOLTAGE_Start'
|
// requestId: 'VOLTAGE_Start'
|
||||||
// })
|
// })
|
||||||
@@ -1269,7 +1178,7 @@ const startTimer = () => {
|
|||||||
// })
|
// })
|
||||||
// }, 2000)
|
// }, 2000)
|
||||||
// break;
|
// break;
|
||||||
case 13:
|
case 9:
|
||||||
emit('update:webMsgSend', {
|
emit('update:webMsgSend', {
|
||||||
requestId: 'Quit'
|
requestId: 'Quit'
|
||||||
})
|
})
|
||||||
@@ -1293,6 +1202,87 @@ const pauseSuccessCallback = () => {
|
|||||||
console.log('暂停中')
|
console.log('暂停中')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const todoItem = (code:string) => {
|
||||||
|
emit('update:webMsgSend', {
|
||||||
|
requestId: `${code}_Start`
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
if(testStatus.value !== 'paused'){
|
||||||
|
emit('update:webMsgSend', {
|
||||||
|
requestId: `${code}_Start`,
|
||||||
|
desc: '输入:频率t=42.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° '
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
setTimeout(() => {
|
||||||
|
if (testStatus.value !== 'paused') {
|
||||||
|
emit('update:webMsgSend', {
|
||||||
|
requestId: `${code}_End`,
|
||||||
|
desc: '输入:频率t=42.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ',
|
||||||
|
data: [{
|
||||||
|
chnResult: [1, 1, 1, 1],
|
||||||
|
deviceId: "461813a4f30f4a34a1a273ecd0379458",
|
||||||
|
deviceName: "25011407"
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 2000)
|
||||||
|
setTimeout(() => {
|
||||||
|
if (testStatus.value !== 'paused') {
|
||||||
|
emit('update:webMsgSend', {
|
||||||
|
requestId: `${code}_Start`,
|
||||||
|
desc: '输入:频率t=45.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° '
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 3000)
|
||||||
|
setTimeout(() => {
|
||||||
|
if (testStatus.value !== 'paused') {
|
||||||
|
emit('update:webMsgSend', {
|
||||||
|
requestId: `${code}_End`,
|
||||||
|
desc: '输入:频率t=45.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ',
|
||||||
|
data: [{
|
||||||
|
chnResult: [1, 1, 1, 1],
|
||||||
|
deviceId: "461813a4f30f4a34a1a273ecd0379458",
|
||||||
|
deviceName: "25011407"
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 5000)
|
||||||
|
setTimeout(() => {
|
||||||
|
if(testStatus.value !== 'paused'){
|
||||||
|
emit('update:webMsgSend', {
|
||||||
|
requestId: `${code}_Start`,
|
||||||
|
desc: '输入:频率t=50.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° '
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 6000)
|
||||||
|
setTimeout(() => {
|
||||||
|
if(testStatus.value !== 'paused'){
|
||||||
|
emit('update:webMsgSend', {
|
||||||
|
requestId: `${code}_End`,
|
||||||
|
desc: '输入:频率t=50.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ',
|
||||||
|
data: [{
|
||||||
|
chnResult: [1, 2, 1, 1],
|
||||||
|
deviceId: "461813a4f30f4a34a1a273ecd0379458",
|
||||||
|
deviceName: "25011407"
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 8000)
|
||||||
|
setTimeout(() => {
|
||||||
|
if(testStatus.value !== 'paused'){
|
||||||
|
emit('update:webMsgSend', {
|
||||||
|
requestId: `${code}_End`,
|
||||||
|
data: [{
|
||||||
|
chnResult: [1, 2, 1, 1],
|
||||||
|
deviceId: "461813a4f30f4a34a1a273ecd0379458",
|
||||||
|
deviceName: "25011407"
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 9000)
|
||||||
|
}
|
||||||
|
|
||||||
const handleResumeTest = () => {
|
const handleResumeTest = () => {
|
||||||
//activeIndex++
|
//activeIndex++
|
||||||
startData.value = new Date();
|
startData.value = new Date();
|
||||||
|
|||||||
Reference in New Issue
Block a user