调整开始检测接口
This commit is contained in:
@@ -40,3 +40,8 @@ export const resumeTest = (params) => {
|
|||||||
export const contrastTest = (params: any) => {
|
export const contrastTest = (params: any) => {
|
||||||
return http.post(`/prepare/startContrastTest`,params)
|
return http.post(`/prepare/startContrastTest`,params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const getContrastTestNumInfo = (id: string) => {
|
||||||
|
return http.get(`/prepare/getContrastTestNumInfo?planId=${id}`)
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,18 +4,18 @@
|
|||||||
:cell-style="{ textAlign: 'center' }" max-height="282px"
|
:cell-style="{ textAlign: 'center' }" max-height="282px"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
||||||
<el-table-column prop="time" label="数据时间"/>
|
|
||||||
<el-table-column prop="dataA" :label="'A相'">
|
<el-table-column prop="dataA" :label="'被检设备'">
|
||||||
<el-table-column prop="dataA" :label="'被检值'"/>
|
<el-table-column prop="time" label="数据时间" width="200"/>
|
||||||
<el-table-column prop="isDataA" label="标准值"/>
|
<el-table-column prop="dataA" :label="'A相'"/>
|
||||||
|
<el-table-column prop="dataA" :label="'B相'"/>
|
||||||
|
<el-table-column prop="dataA" :label="'C相'"/>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="dataB" :label="'B相'">
|
<el-table-column prop="dataA" :label="'标准设备'">
|
||||||
<el-table-column prop="dataA" :label="'被检值'"/>
|
<el-table-column prop="time" label="数据时间" width="200"/>
|
||||||
<el-table-column prop="isDataA" label="标准值"/>
|
<el-table-column prop="dataA" :label="'A相'"/>
|
||||||
</el-table-column>
|
<el-table-column prop="dataA" :label="'B相'"/>
|
||||||
<el-table-column prop="dataC" :label="'C相'">
|
<el-table-column prop="dataA" :label="'C相'"/>
|
||||||
<el-table-column prop="dataA" :label="'被检值'"/>
|
|
||||||
<el-table-column prop="isDataA" label="标准值"/>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ import CompareDataCheckRawDataTable from './compareDataCheckRawDataTable.vue'
|
|||||||
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 {Histogram, Postcard} from "@element-plus/icons-vue";
|
import {Histogram, Postcard} from "@element-plus/icons-vue";
|
||||||
|
import {getPqErrSysList} from '@/api/plan/plan'
|
||||||
|
import { getFormData} from "@/api/check/test";
|
||||||
|
|
||||||
const {appendToBody} = withDefaults(defineProps<{
|
const {appendToBody} = withDefaults(defineProps<{
|
||||||
appendToBody: boolean
|
appendToBody: boolean
|
||||||
@@ -83,6 +85,8 @@ const searchValue = ref<string>('')
|
|||||||
const pqErrorList = reactive<{ id: string; name: string; }[]>([])
|
const pqErrorList = reactive<{ id: string; name: string; }[]>([])
|
||||||
const activeTab = ref('resultTab')
|
const activeTab = ref('resultTab')
|
||||||
const currentCheckItem = ref<any>()
|
const currentCheckItem = ref<any>()
|
||||||
|
let deviceId: string = ''
|
||||||
|
let scriptType: string | null = null
|
||||||
|
|
||||||
watch(searchValue, (val) => {
|
watch(searchValue, (val) => {
|
||||||
treeRef.value!.filter(val)
|
treeRef.value!.filter(val)
|
||||||
@@ -112,7 +116,8 @@ const rawTableData = reactive<CheckData.RawDataItem[]>([])
|
|||||||
|
|
||||||
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
|
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
|
deviceId = _deviceId
|
||||||
|
scriptType = null
|
||||||
// 设置默认选中第一个选项
|
// 设置默认选中第一个选项
|
||||||
if (options.length > 0) {
|
if (options.length > 0) {
|
||||||
const firstOption = options[0];
|
const firstOption = options[0];
|
||||||
@@ -124,6 +129,19 @@ const open = async (_deviceId: string, chnNum: string, _scriptType: string | nul
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
formContent.errorSysId = checkStore.plan.errorSysId
|
||||||
|
|
||||||
|
pqErrorList.length = 0
|
||||||
|
let {data: resPqErrorList} = await getPqErrSysList()
|
||||||
|
Object.assign(pqErrorList, resPqErrorList)
|
||||||
|
}
|
||||||
|
|
||||||
|
const close = () => {
|
||||||
|
visible.value = false;
|
||||||
|
// 可以在这里添加其他清理逻辑
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
|
|||||||
@@ -626,8 +626,6 @@ const updatePercentage = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await initScriptData()
|
await initScriptData()
|
||||||
initDeviceList()
|
initDeviceList()
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ import ComparePreTest from './comparePreTest.vue'
|
|||||||
import CompareTest from './compareTest.vue'
|
import CompareTest from './compareTest.vue'
|
||||||
import socketClient from '@/utils/webSocketClient';
|
import socketClient from '@/utils/webSocketClient';
|
||||||
import {useCheckStore} from "@/stores/modules/check";
|
import {useCheckStore} from "@/stores/modules/check";
|
||||||
import {pauseTest, resumeTest, startPreTest,contrastTest} from '@/api/socket/socket'
|
import {pauseTest, resumeTest, startPreTest,contrastTest,getContrastTestNumInfo} from '@/api/socket/socket'
|
||||||
import {useUserStore} from "@/stores/modules/user";
|
import {useUserStore} from "@/stores/modules/user";
|
||||||
import {JwtUtil} from "@/utils/jwtUtil";
|
import {JwtUtil} from "@/utils/jwtUtil";
|
||||||
|
|
||||||
@@ -145,6 +145,7 @@ const devIds = ref<[]>()
|
|||||||
const standardDevIds = ref<[]>()
|
const standardDevIds = ref<[]>()
|
||||||
const pairs = ref<any>()
|
const pairs = ref<any>()
|
||||||
const testAgain = ref(false)//重新检测按钮是否显示
|
const testAgain = ref(false)//重新检测按钮是否显示
|
||||||
|
const checkNumber = ref(0)//检测次数
|
||||||
const open = async (title: string,mapping:any,plan: string,login: string,devIdsArray: [],standardDevIdsArray: [],pair:any) => {
|
const open = async (title: string,mapping:any,plan: string,login: string,devIdsArray: [],standardDevIdsArray: [],pair:any) => {
|
||||||
if(checkStore.selectTestItems.preTest && !checkStore.selectTestItems.test){
|
if(checkStore.selectTestItems.preTest && !checkStore.selectTestItems.test){
|
||||||
testAgain.value = true
|
testAgain.value = true
|
||||||
@@ -203,6 +204,7 @@ const handleSubmitAgain = async () => {
|
|||||||
ActiveStatue.value = 'waiting'
|
ActiveStatue.value = 'waiting'
|
||||||
preTestStatus.value = 'waiting'
|
preTestStatus.value = 'waiting'
|
||||||
|
|
||||||
|
const checkNum = await mapValue()
|
||||||
|
|
||||||
await contrastTest({
|
await contrastTest({
|
||||||
planId: planId.value,
|
planId: planId.value,
|
||||||
@@ -210,7 +212,8 @@ const handleSubmitAgain = async () => {
|
|||||||
devIds: devIds.value,
|
devIds: devIds.value,
|
||||||
standardDevIds: standardDevIds.value,
|
standardDevIds: standardDevIds.value,
|
||||||
pairs:pairs.value,
|
pairs:pairs.value,
|
||||||
testItemList:[checkStore.selectTestItems.preTest,false,checkStore.selectTestItems.test]
|
testItemList:[checkStore.selectTestItems.preTest,false,checkStore.selectTestItems.test],
|
||||||
|
num: checkNum
|
||||||
})
|
})
|
||||||
|
|
||||||
preTestStatus.value = 'start'
|
preTestStatus.value = 'start'
|
||||||
@@ -222,7 +225,10 @@ const handleSubmitFast = async () => {
|
|||||||
ElMessage.error('webSocket连接中断!')
|
ElMessage.error('webSocket连接中断!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log("handleSubmit", TestStatus.value)
|
|
||||||
|
const checkNum = await mapValue()
|
||||||
|
|
||||||
|
|
||||||
switch (stepsActive.value) {
|
switch (stepsActive.value) {
|
||||||
case 1:
|
case 1:
|
||||||
if (preTestStatus.value == 'waiting') {
|
if (preTestStatus.value == 'waiting') {
|
||||||
@@ -233,7 +239,8 @@ const handleSubmitFast = async () => {
|
|||||||
devIds: devIds.value,
|
devIds: devIds.value,
|
||||||
standardDevIds: standardDevIds.value,
|
standardDevIds: standardDevIds.value,
|
||||||
pairs:pairs.value,
|
pairs:pairs.value,
|
||||||
testItemList:[checkStore.selectTestItems.preTest,false,checkStore.selectTestItems.test]
|
testItemList:[checkStore.selectTestItems.preTest,false,checkStore.selectTestItems.test],
|
||||||
|
num: checkNum
|
||||||
})
|
})
|
||||||
|
|
||||||
preTestStatus.value = 'start'
|
preTestStatus.value = 'start'
|
||||||
@@ -254,6 +261,18 @@ const handleSubmitFast = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const mapValue = (async () => {
|
||||||
|
const data = await getContrastTestNumInfo(checkStore.plan.id)
|
||||||
|
// 解析返回的数据,现在是 map 类型 {99: 1}
|
||||||
|
const dataMap = data.data as Record<string, number>
|
||||||
|
// 获取键值对
|
||||||
|
const entries = Object.entries(dataMap)
|
||||||
|
// 获取第一对键值
|
||||||
|
const [key, value] = entries[0]
|
||||||
|
|
||||||
|
return value
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'quitClicked'): void;
|
(e: 'quitClicked'): void;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="tsx" setup>
|
<script lang="tsx" setup>
|
||||||
import {defineProps} from 'vue';
|
import {computed, defineProps} from 'vue';
|
||||||
import {CheckData} from "@/api/check/interface";
|
import {CheckData} from "@/api/check/interface";
|
||||||
|
|
||||||
const {tableData, currentScriptTypeName} = defineProps<{
|
const {tableData, currentScriptTypeName} = defineProps<{
|
||||||
|
|||||||
@@ -51,10 +51,14 @@ import SelectTestItemPopup from "@/views/home/components/selectTestItemPopup.vue
|
|||||||
import CompareTestPopup from './compareTestPopup.vue'
|
import CompareTestPopup from './compareTestPopup.vue'
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import CustomEdge from './RemoveableEdge.vue' // 导入自定义连接线组件
|
import CustomEdge from './RemoveableEdge.vue' // 导入自定义连接线组件
|
||||||
|
import {getContrastTestNumInfo} from '@/api/socket/socket'
|
||||||
import { jwtUtil } from "@/utils/jwtUtil";
|
import { jwtUtil } from "@/utils/jwtUtil";
|
||||||
|
import {useCheckStore} from "@/stores/modules/check";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const checkStore = useCheckStore();
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const selectTestItemPopupRef = ref<InstanceType<typeof SelectTestItemPopup>>()
|
const selectTestItemPopupRef = ref<InstanceType<typeof SelectTestItemPopup>>()
|
||||||
const testPopup = ref()
|
const testPopup = ref()
|
||||||
@@ -185,20 +189,6 @@ const removeEdge = (params: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 打印当前节点和连线信息
|
|
||||||
function logConnections() {
|
|
||||||
console.log('当前节点:', nodes.value);
|
|
||||||
console.log('当前连线:', edges.value);
|
|
||||||
|
|
||||||
const connections = edges.value.map(edge => ({
|
|
||||||
source: edge.source,
|
|
||||||
target: edge.target,
|
|
||||||
label: `${edge.source} → ${edge.target}`
|
|
||||||
}));
|
|
||||||
|
|
||||||
console.table(connections);
|
|
||||||
}
|
|
||||||
|
|
||||||
const nodes = ref([])
|
const nodes = ref([])
|
||||||
const planId = ref('')
|
const planId = ref('')
|
||||||
const devIds = ref<string[]>()
|
const devIds = ref<string[]>()
|
||||||
@@ -224,6 +214,25 @@ const handleNext = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openTestDialog = async () => {
|
const openTestDialog = async () => {
|
||||||
|
const data = await getContrastTestNumInfo(checkStore.plan.id)
|
||||||
|
|
||||||
|
// 解析返回的数据,现在是 map 类型 {99: 1}
|
||||||
|
const dataMap = data.data as Record<string, number>
|
||||||
|
// 获取键值对
|
||||||
|
const entries = Object.entries(dataMap)
|
||||||
|
|
||||||
|
// 获取第一对键值
|
||||||
|
const [key, value] = entries[0]
|
||||||
|
const former = Number(key)
|
||||||
|
const latter = value
|
||||||
|
|
||||||
|
// 判断后者是否大于等于前者
|
||||||
|
if (latter >= former) {
|
||||||
|
ElMessage.warning(`检测次数不足`)
|
||||||
|
return // 阻止继续执行
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 转换连接信息,只保留设备ID和通道号
|
// 转换连接信息,只保留设备ID和通道号
|
||||||
const connections = edges.value.reduce((map, edge) => {
|
const connections = edges.value.reduce((map, edge) => {
|
||||||
// 从source中提取设备ID和通道号: 被检通道-{deviceId}-{channelNum} => {deviceId}-{channelNum}
|
// 从source中提取设备ID和通道号: 被检通道-{deviceId}-{channelNum} => {deviceId}-{channelNum}
|
||||||
@@ -238,6 +247,7 @@ const openTestDialog = async () => {
|
|||||||
|
|
||||||
|
|
||||||
generateChannelMapping()
|
generateChannelMapping()
|
||||||
|
|
||||||
testPopup.value?.open(dialogTitle.value,channelMapping.value,planId.value,jwtUtil.getLoginName(),devIds.value,standardDevIds.value,connections)
|
testPopup.value?.open(dialogTitle.value,channelMapping.value,planId.value,jwtUtil.getLoginName(),devIds.value,standardDevIds.value,connections)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,14 +44,14 @@ const channelsTestShow = ref(false)
|
|||||||
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const formContent = reactive<CheckData.SelectTestItem>({preTest: true, timeTest: false, channelsTest: false, test: false})
|
const formContent = reactive<CheckData.SelectTestItem>({preTest: true, timeTest: false, channelsTest: false, test: false})
|
||||||
const sourceIdArray = ref<string[]>()
|
const open = async () => {
|
||||||
const open = async (sourcesIds: string[]) => {
|
|
||||||
|
|
||||||
sourceIdArray.value = sourcesIds
|
|
||||||
resetFormContent()
|
resetFormContent()
|
||||||
checkStore.setSelectTestItems(formContent)
|
checkStore.setSelectTestItems(formContent)
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
if(modeStore.currentMode === '比对式'){
|
if(modeStore.currentMode === '比对式'){
|
||||||
|
|
||||||
|
|
||||||
channelsTestShow.value = false
|
channelsTestShow.value = false
|
||||||
}else{
|
}else{
|
||||||
if(AppSceneStore.currentScene === '1'){
|
if(AppSceneStore.currentScene === '1'){
|
||||||
|
|||||||
@@ -850,7 +850,7 @@ const handleTest = async (val: string) => {
|
|||||||
if (appSceneStore.currentScene === '0') {
|
if (appSceneStore.currentScene === '0') {
|
||||||
writeTHPopupRef.value?.open()
|
writeTHPopupRef.value?.open()
|
||||||
} else {
|
} else {
|
||||||
selectTestItemPopupRef.value?.open([])
|
selectTestItemPopupRef.value?.open()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((action: Action) => {
|
.catch((action: Action) => {
|
||||||
@@ -860,14 +860,14 @@ const handleTest = async (val: string) => {
|
|||||||
if (appSceneStore.currentScene === '0') {
|
if (appSceneStore.currentScene === '0') {
|
||||||
writeTHPopupRef.value?.open()
|
writeTHPopupRef.value?.open()
|
||||||
} else {
|
} else {
|
||||||
selectTestItemPopupRef.value?.open([])
|
selectTestItemPopupRef.value?.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
checkStore.setSelectTestItems({ preTest: false, timeTest: false, channelsTest: false, test: true })
|
checkStore.setSelectTestItems({ preTest: false, timeTest: false, channelsTest: false, test: true })
|
||||||
} else {
|
} else {
|
||||||
selectTestItemPopupRef.value?.open([])
|
selectTestItemPopupRef.value?.open()
|
||||||
checkStore.setReCheckType(1)
|
checkStore.setReCheckType(1)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user