This commit is contained in:
sjl
2025-10-23 14:42:07 +08:00
5 changed files with 81 additions and 54 deletions

View File

@@ -42,7 +42,7 @@ export const getPqErrSysList = () => {
}
//获取指定模式下所有未绑定的设备
export const getUnboundPqDevList = (params: { pattern: string}) => {
export const getUnboundPqDevList = (params: { pattern: string }) => {
return http.get(`/pqDev/listUnbound?pattern=${params.pattern}`)
}
@@ -141,22 +141,22 @@ export const importSubPlan = (params: Plan.ResPlan) => {
// 导出计划检测结果数据
export const exportPlanCheckData = (params: any) => {
return http.post(
`/adPlan/exportPlanCheckData?planId=${params.id}&devIds=${params.devIds}&report=${params.report}`
)
return http.post(`/adPlan/exportPlanCheckData?planId=${params.id}&devIds=${params.devIds}&report=${params.report}`)
}
//根据误差体系id获取测试项
export const getPqErrSysTestItemList = (params: {errorSysId : string}) => {
export const getPqErrSysTestItemList = (params: { errorSysId: string }) => {
return http.get(`/pqErrSys/getTestItems?id=${params.errorSysId}`)
}
// 获取计划项目成员
export const getMemberList = (params: {id : string}) => {
export const getMemberList = (params: { id: string }) => {
return http.get(`/adPlan/getMemberList?planId=${params.id}`)
}
// 导入并合并子检测计划检测结果数据
export const importAndMergePlanCheckData = (params: Plan.ResPlan) => {
return http.upload(`/adPlan/importAndMergePlanCheckData`, params)
return http.upload(`/adPlan/importAndMergePlanCheckData`, params, {
timeout: 60000 * 20
})
}

View File

@@ -12,6 +12,7 @@
action="#"
class="upload"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadZip"
accept=".zip"
:auto-upload="!parameter.confirmMessage"
@@ -56,7 +57,15 @@
<script setup lang="ts" name="ImportZip">
import { ref } from 'vue'
import { ElMessage, ElMessageBox, type UploadInstance, type UploadProps, type UploadRequestOptions } from 'element-plus'
import {
ElMessage,
ElMessageBox,
genFileId,
type UploadInstance,
type UploadProps,
type UploadRawFile,
type UploadRequestOptions
} from 'element-plus'
import http from '@/api'
export interface ZipParameterProps {
@@ -170,7 +179,12 @@ const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
message: ''
}
}
const handleExceed: UploadProps['onExceed'] = files => {
uploadRef.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
uploadRef.value!.handleStart(file)
}
const progressData = ref({
percentage: 0,
status: '',

View File

@@ -184,10 +184,9 @@
v-if="progressData.status === 'success'"
type="primary"
title="点击打开目录"
:href="progressData.message"
@click="openDownloadLocation"
>
{{ progressData.message }}
{{ filePath }}
</el-link>
</el-row>
<el-progress
@@ -692,6 +691,7 @@ const exportPlan = async () => {
}
const exportPlanCheckResultData = async (selectedListIds: string[]) => {
filePath.value = ''
const params = {
id: planFormContent.value.id,
report: downloadReport.value,
@@ -773,10 +773,6 @@ const openDownloadLocation = () => {
if (filePath.value) {
// 打开指定文件所在的目录,并选中该文件
Renderer.shell.showItemInFolder(filePath.value)
} else {
// 使用默认下载路径
const downloadPath = Renderer.app.getPath('downloads')
Renderer.shell.openPath(downloadPath)
}
} else {
ElMessage.warning('当前运行环境不支持,请复制路径自行打开')