Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
# Conflicts: # frontend/src/views/machine/testScript/components/testScriptPopup.vue # frontend/src/views/machine/testScript/index.vue
This commit is contained in:
@@ -86,7 +86,7 @@ export const downloadDevData = (params: Device.ReqDevReportParams) => {
|
|||||||
return http.download(`/report/downloadReport`, params)
|
return http.download(`/report/downloadReport`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const staticsAnalyse = (params: { planId: string }) => {
|
export const staticsAnalyse = (params: { id: string[] }) => {
|
||||||
return http.download(`/adPlan/analyse?planId=${params.planId}`)
|
return http.download('/adPlan/analyse', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,64 +27,64 @@ export const staticRouter: RouteRecordRaw[] = [
|
|||||||
name: "plan",
|
name: "plan",
|
||||||
redirect: "/plan/planList",
|
redirect: "/plan/planList",
|
||||||
children: [
|
children: [
|
||||||
{
|
// {
|
||||||
path: "/plan/planList",
|
// path: "/plan/planList",
|
||||||
name: "planList",
|
// name: "planList",
|
||||||
component: () => import("@/views/plan/planList/index.vue"),
|
// component: () => import("@/views/plan/planList/index.vue"),
|
||||||
meta: {
|
// meta: {
|
||||||
title: "检测计划列表",
|
// title: "检测计划列表",
|
||||||
icon: "List",
|
// icon: "List",
|
||||||
isLink: "",
|
// isLink: "",
|
||||||
isHide: false,
|
// isHide: false,
|
||||||
isFull: false,
|
// isFull: false,
|
||||||
isAffix: false,
|
// isAffix: false,
|
||||||
isKeepAlive: true,//缓存改成true
|
// isKeepAlive: true,//缓存改成true
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: "/plan/singlePlanList",
|
// path: "/plan/singlePlanList",
|
||||||
name: "singlePlanList",
|
// name: "singlePlanList",
|
||||||
component: () => import("@/views/plan/singlePlanList/index.vue"),
|
// component: () => import("@/views/plan/singlePlanList/index.vue"),
|
||||||
meta: {
|
// meta: {
|
||||||
title: "单个计划列表",
|
// title: "单个计划列表",
|
||||||
icon: "List",
|
// icon: "List",
|
||||||
isLink: "",
|
// isLink: "",
|
||||||
isHide: false,
|
// isHide: false,
|
||||||
isFull: false,
|
// isFull: false,
|
||||||
isAffix: false,
|
// isAffix: false,
|
||||||
isKeepAlive: true,
|
// isKeepAlive: true,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: "/plan/preTest",
|
// path: "/plan/preTest",
|
||||||
name: "preTest",
|
// name: "preTest",
|
||||||
component: () => import("@/views/plan/preTest/index.vue"),
|
// component: () => import("@/views/plan/preTest/index.vue"),
|
||||||
meta: {
|
// meta: {
|
||||||
title: "预检测",
|
// title: "预检测",
|
||||||
icon: "List",
|
// icon: "List",
|
||||||
isLink: "",
|
// isLink: "",
|
||||||
isHide: false,
|
// isHide: false,
|
||||||
isFull: false,
|
// isFull: false,
|
||||||
isAffix: false,
|
// isAffix: false,
|
||||||
isKeepAlive: false,
|
// isKeepAlive: false,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: "/plan/autoTest",
|
// path: "/plan/autoTest",
|
||||||
name: "autoTest",
|
// name: "autoTest",
|
||||||
component: () => import("@/views/plan/autoTest/index.vue"),
|
// component: () => import("@/views/plan/autoTest/index.vue"),
|
||||||
meta: {
|
// meta: {
|
||||||
title: "自动检测",
|
// title: "自动检测",
|
||||||
icon: "List",
|
// icon: "List",
|
||||||
isLink: "",
|
// isLink: "",
|
||||||
hideTab:true,
|
// hideTab:true,
|
||||||
parentPath:'/system/proTable',
|
// parentPath:'/system/proTable',
|
||||||
isHide: false,
|
// isHide: false,
|
||||||
isFull: false,
|
// isFull: false,
|
||||||
isAffix: false,
|
// isAffix: false,
|
||||||
isKeepAlive: true,
|
// isKeepAlive: true,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: "/machine/testScriptAdd",
|
path: "/machine/testScriptAdd",
|
||||||
name: "testScriptAdd",
|
name: "testScriptAdd",
|
||||||
|
|||||||
@@ -2,10 +2,17 @@
|
|||||||
<div class="dialog" v-bind="dialogBig">
|
<div class="dialog" v-bind="dialogBig">
|
||||||
<div class="dialog-title">
|
<div class="dialog-title">
|
||||||
<el-progress
|
<el-progress
|
||||||
style="width: 90%"
|
style="width: 65%"
|
||||||
:percentage="percentage"
|
:percentage="percentage"
|
||||||
:color="customColors"/>
|
:color="customColors"/>
|
||||||
|
|
||||||
|
<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
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="testStatus=='process' && percentage < 100"
|
v-if="testStatus=='process' && percentage < 100"
|
||||||
@@ -54,6 +61,7 @@
|
|||||||
@click="emit('sendResume')"
|
@click="emit('sendResume')"
|
||||||
>继续检测
|
>继续检测
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<div type="text" :icon="Timer" disabled>检测用时:{{ timeView }}</div>
|
||||||
<el-button type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button>
|
<el-button type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -143,7 +151,7 @@
|
|||||||
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
||||||
</template>
|
</template>
|
||||||
<script lang="tsx" setup name="test">
|
<script lang="tsx" setup name="test">
|
||||||
import {Check, Failed, InfoFilled, Loading, Refresh, RefreshLeft, VideoPause, VideoPlay} from '@element-plus/icons-vue'
|
import {Check, Failed, InfoFilled, Loading, Timer,Refresh, RefreshLeft, VideoPause, VideoPlay} from '@element-plus/icons-vue'
|
||||||
import resultPopup from './resultPopup.vue'
|
import resultPopup from './resultPopup.vue'
|
||||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||||
import {computed, reactive, ref, toRef, watch} from "vue";
|
import {computed, reactive, ref, toRef, watch} from "vue";
|
||||||
@@ -152,7 +160,6 @@ 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 {tryHideFullScreenLoading} from "@/components/Loading/fullScreen";
|
|
||||||
|
|
||||||
const checkStore = useCheckStore()
|
const checkStore = useCheckStore()
|
||||||
|
|
||||||
@@ -187,6 +194,10 @@ const deviceList = reactive<CheckData.Device[]>([])
|
|||||||
let activeIndex = 0
|
let activeIndex = 0
|
||||||
// 百分比
|
// 百分比
|
||||||
const percentage = ref(0);
|
const percentage = ref(0);
|
||||||
|
// 时间计数器
|
||||||
|
let timer: any = null
|
||||||
|
const timeCount = ref(0)
|
||||||
|
const timeView = ref('00:00:00')
|
||||||
//测试项开始检测时间(或继续检测时间)
|
//测试项开始检测时间(或继续检测时间)
|
||||||
const startData = ref(new Date())
|
const startData = ref(new Date())
|
||||||
//测试项检测结束时间(或暂停时的时间)
|
//测试项检测结束时间(或暂停时的时间)
|
||||||
@@ -303,6 +314,7 @@ const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(()
|
|||||||
watch(testStatus, function (newValue, oldValue) {
|
watch(testStatus, function (newValue, oldValue) {
|
||||||
if (newValue == 'start') {
|
if (newValue == 'start') {
|
||||||
ElMessage.success('初始化开始!')
|
ElMessage.success('初始化开始!')
|
||||||
|
startTimeCount()
|
||||||
|
|
||||||
showTestLog()
|
showTestLog()
|
||||||
|
|
||||||
@@ -855,6 +867,7 @@ const updateLog = (isStart: boolean) => {
|
|||||||
type: 'info',
|
type: 'info',
|
||||||
log: currentTime.value + ' :检测结束,总用时' + getTimeDifference(timeDifference.value),
|
log: currentTime.value + ' :检测结束,总用时' + getTimeDifference(timeDifference.value),
|
||||||
})
|
})
|
||||||
|
stopTimeCount()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1222,6 +1235,7 @@ const pauseSuccessCallback = () => {
|
|||||||
type: 'info',
|
type: 'info',
|
||||||
log: `${new Date().toLocaleString()}:暂停检测`,
|
log: `${new Date().toLocaleString()}:暂停检测`,
|
||||||
})
|
})
|
||||||
|
stopTimeCount()
|
||||||
console.log('暂停中')
|
console.log('暂停中')
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1314,6 +1328,7 @@ const handleResumeTest = () => {
|
|||||||
log: `${new Date().toLocaleString()}:继续检测`,
|
log: `${new Date().toLocaleString()}:继续检测`,
|
||||||
})
|
})
|
||||||
//startTimer()
|
//startTimer()
|
||||||
|
resumeTimeCount()
|
||||||
console.log('开始继续检测')
|
console.log('开始继续检测')
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1347,7 +1362,44 @@ const getNextActiveIndex = (code: string = ''): number => {
|
|||||||
}
|
}
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
const startTimeCount = () => {
|
||||||
|
timer = setInterval(() => {
|
||||||
|
timeCount.value = timeCount.value + 1
|
||||||
|
timeView.value = secondToTime(timeCount.value)
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
const stopTimeCount = () => {
|
||||||
|
if (timer) {
|
||||||
|
clearInterval(timer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const resumeTimeCount = () => {
|
||||||
|
timer = setInterval(() => {
|
||||||
|
timeCount.value = timeCount.value + 1
|
||||||
|
timeView.value = secondToTime(timeCount.value)
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const secondToTime = (second: number) => {
|
||||||
|
//将秒数转换成时分秒
|
||||||
|
let h: string | number = Math.floor(second / 3600)
|
||||||
|
let m: string | number = Math.floor((second - h * 3600) / 60)
|
||||||
|
let s: string | number = Math.floor(second % 60);
|
||||||
|
|
||||||
|
h = h < 10 ? '0' + h : h;
|
||||||
|
m = m < 10 ? '0' + m : m;
|
||||||
|
s = s < 10 ? '0' + s : s;
|
||||||
|
return h + ':' + m + ':' + s;
|
||||||
|
}
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
if (timer) {
|
||||||
|
clearInterval(timer)
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-transfer v-model="value"
|
<el-transfer v-model="value"
|
||||||
filterable
|
filterable
|
||||||
:filter-method="filterMethod"
|
:filter-method="filterMethod"
|
||||||
filter-placeholder="请输入内容搜索"
|
filter-placeholder="请输入内容搜索"
|
||||||
:data="allData"
|
:data="allData"
|
||||||
:titles="['未绑定设备', '已绑定设备']">
|
:titles="['未绑定设备', '已绑定设备']">
|
||||||
<template #default="{ option }">
|
<template #default="{ option }">
|
||||||
<el-tooltip :content="option.tips" placement="top" :show-after=1000>
|
<el-tooltip :content="option.tips" placement="top" :show-after=1000>
|
||||||
<span>{{ option.label }}</span>
|
<span>{{ option.label }}</span>
|
||||||
@@ -69,6 +69,8 @@ const filterMethod = (query: string, item: { label?: string }) => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
planData.value = data
|
planData.value = data
|
||||||
|
|
||||||
|
console.log('123')
|
||||||
|
|
||||||
const pqDevList_Result1 = await getUnboundPqDevList(data);
|
const pqDevList_Result1 = await getUnboundPqDevList(data);
|
||||||
unboundPqDevList.value = pqDevList_Result1.data as Device.ReqPqDevParams[];
|
unboundPqDevList.value = pqDevList_Result1.data as Device.ReqPqDevParams[];
|
||||||
|
|
||||||
@@ -76,9 +78,11 @@ const filterMethod = (query: string, item: { label?: string }) => {
|
|||||||
boundPqDevList.value = pqDevList_Result2.data as Device.ReqPqDevParams[];
|
boundPqDevList.value = pqDevList_Result2.data as Device.ReqPqDevParams[];
|
||||||
|
|
||||||
value.value = boundPqDevList.value.map((i: { id: { toString: () => any } }) => i.id.toString());
|
value.value = boundPqDevList.value.map((i: { id: { toString: () => any } }) => i.id.toString());
|
||||||
|
console.log('123',value.value)
|
||||||
}
|
}
|
||||||
const close = () => {
|
const close = () => {
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const save = async () => {
|
const save = async () => {
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
|||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const close = () => {
|
const close = () => {
|
||||||
|
value.value = []
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
// 清空dialogForm中的值
|
// 清空dialogForm中的值
|
||||||
resetFormContent()
|
resetFormContent()
|
||||||
@@ -279,6 +280,7 @@ const open = async (sign: string,
|
|||||||
data: Plan.ReqPlan,
|
data: Plan.ReqPlan,
|
||||||
currentMode: string,) => {
|
currentMode: string,) => {
|
||||||
|
|
||||||
|
value.value = []
|
||||||
//处理异步调用
|
//处理异步调用
|
||||||
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== currentMode)?.id ?? ''
|
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== currentMode)?.id ?? ''
|
||||||
data.pattern = patternId
|
data.pattern = patternId
|
||||||
|
|||||||
@@ -13,9 +13,11 @@
|
|||||||
合并
|
合并
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type='primary' v-auth.plan="'add'" :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
<el-button type='primary' v-auth.plan="'add'" :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||||
|
<el-button type='primary' v-auth.plan="'analysis'" :icon='List' @click='statisticalAnalysisMore(scope.selectedListIds)'>统计分析</el-button>
|
||||||
<el-button type='danger' v-auth.plan="'delete'" :icon='Delete' plain :disabled='!scope.isSelected' @click='batchDelete(scope.selectedListIds)'>
|
<el-button type='danger' v-auth.plan="'delete'" :icon='Delete' plain :disabled='!scope.isSelected' @click='batchDelete(scope.selectedListIds)'>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
<template #operation='scope'>
|
<template #operation='scope'>
|
||||||
@@ -394,8 +396,12 @@ const showDeviceOpen = (row: Partial<Plan.ReqPlan> = {}) => {
|
|||||||
|
|
||||||
const myDict = new Map<string, any[]>();
|
const myDict = new Map<string, any[]>();
|
||||||
|
|
||||||
|
const statisticalAnalysisMore = async (id: string[]) =>{
|
||||||
|
useDownload(staticsAnalyse,'分析结果', id, false,'.xlsx')
|
||||||
|
}
|
||||||
|
|
||||||
const statisticalAnalysis = async (row: Partial<Plan.ReqPlan> = {}) => {
|
const statisticalAnalysis = async (row: Partial<Plan.ReqPlan> = {}) => {
|
||||||
useDownload(staticsAnalyse,row.name+'分析结果', {planId:row.id}, false,'.xlsx')
|
useDownload(staticsAnalyse,'分析结果', [row.id], false,'.xlsx')
|
||||||
|
|
||||||
// const response = await getTestConfig() as unknown as Base.ResTestConfig
|
// const response = await getTestConfig() as unknown as Base.ResTestConfig
|
||||||
// const maxTime= response.data.maxTime//检测最大次数
|
// const maxTime= response.data.maxTime//检测最大次数
|
||||||
|
|||||||
Reference in New Issue
Block a user