This commit is contained in:
sjl
2025-01-15 20:32:14 +08:00
6 changed files with 677 additions and 643 deletions

View File

@@ -25,24 +25,16 @@ export const deletePqDev = (params: string[]) => {
return http.post(`/pqDev/delete`, params)
}
//导出被检设备
export const exportPqDev=(params: Device.ReqPqDevParams)=>{
return http.download(`/pqDev/export`, params)
}
export const downloadTemplate = () => {
return http.download(`/pqDev/downloadTemplate`)
}
//导入被检设备(比对)
export const importPqDev=(params: Device.ReqPqDevParams)=>{
return http.upload(`/pqDev/import`, params)
}
//根据设备类型决定电源、icd、模板、通道数、额定电压、额定电流
export const getPqDev = () => {
return http.post(`/devType/list`)
}
//被检设备归档
export const documentedPqDev=(ids:string[])=>{
return http.post(`/pqDev/documented`, ids)

View File

@@ -14,6 +14,14 @@ export namespace Device {
pattern:string;
}
/**
* 被检设备表格分页查询参数
*/
export interface ReqDevReportParams extends ReqPage{
planId?:string; // 计划id
devId?:string; // 装置id
}
/**
* 被检设备新增、修改、根据id查询返回的对象
*/

View File

@@ -2,17 +2,18 @@ import type { Plan } from './interface'
import http from '@/api'
import type { ErrorSystem } from '../device/interface/error'
import type { Device } from '../device/interface/device'
import { ReqDevReportParams } from '@/api/device/interface/device'
/**
* @name 检测计划管理模块
*/
// 获取检测计划列表
export const getPlanList = (params: Plan.ReqPlanParams) => {
return http.post(`/adPlan/list`, params)
return http.post(`/adPlan/list`, params)
}
// 新增检测计划
export const addPlan = (params:any) => {
export const addPlan = (params: any) => {
return http.post(`/adPlan/add`, params)
}
@@ -48,7 +49,7 @@ export const getUnboundPqDevList = (params: Plan.ReqPlan) => {
//根据检测计划id查询出所有已绑定的设备
export const getBoundPqDevList = (params: any) => {
return http.post(`/pqDev/listByPlanId`,params)
return http.post(`/pqDev/listByPlanId`, params)
}
//检测计划绑定设备
@@ -57,12 +58,12 @@ export const getBoundPqDevList = (params: any) => {
// }
// 按照模式查询检测计划(用于首页展示)
export const getPlanListByPattern = (params:Plan.ReqPlan) => {
export const getPlanListByPattern = (params: Plan.ReqPlan) => {
return http.get(`/adPlan/listByPattern?pattern=${params.pattern}`)
}
// 导出检测计划
export const exportPlan=(params: Device.ReqPqDevParams)=>{
export const exportPlan = (params: Device.ReqPqDevParams) => {
return http.download(`/adPlan/export`, params)
}
@@ -71,11 +72,16 @@ export const downloadTemplate = () => {
return http.download(`/adPlan/downloadTemplate`)
}
// 导入检测计划
export const importPlan=(params: Device.ReqPqDevParams)=>{
export const importPlan = (params: Device.ReqPqDevParams) => {
return http.upload(`/adPlan/import`, params)
}
//导出被检设备
export const downloadDevData=(params: Device.ReqPqDevParams)=>{
return http.download(`/report/generateReport`, params)
// 装置检测报告生成
export const generateDevReport = (params: Device.ReqDevReportParams) => {
return http.post(`/report/generateReport`, params)
}
// 装置检测报告下载
export const downloadDevData = (params: Device.ReqDevReportParams) => {
return http.download(`/report/downloadReport`, params)
}

View File

@@ -51,7 +51,11 @@
<div class="div-log">
<p v-for="(item, index) in step4InitLog" :key="index"
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
{{ item.log }} <br/>
{{ item.log.split('&&')[0] }}
<br v-if="item.log.includes('&&')">
{{ item.log.split('&&')[1] }}
<br/>
</p>
</div>
</el-collapse-item>
@@ -441,14 +445,14 @@ watch(webMsgSend, function (newValue, oldValue) {
if (newValue.code == 10200) {
step4InitLog.value.push({
type: 'info',
log: '源已接通!',
log: '源参数下发成功,等待校验中.....',
})
} else if (newValue.code == 10201) {
step4.value = 'process'
step4InitLog.value = [{
type: 'wait',
log: '正在接通源.....',
log: '源参数下发中.....',
}];
} else if (newValue.code == 10552) {
ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
@@ -470,9 +474,11 @@ watch(webMsgSend, function (newValue, oldValue) {
if (newValue.data.includes('不合格')) {
type = 'error'
}
newValue.data.split('<br/>')
step4InitLog.value.push({
type: type,
log: '相序校验:' + newValue.data,
log:newValue.data,
})
} else if (newValue.code == 10201) {
@@ -488,7 +494,7 @@ watch(webMsgSend, function (newValue, oldValue) {
log: '相序校验未通过!',
})
ts.value = 'error'
}else if (newValue.code == 25001) {
} else if (newValue.code == 25001) {
step4.value = 'success'
step5.value = 'success'
step4InitLog.value.push({

File diff suppressed because it is too large Load Diff

View File

@@ -10,8 +10,12 @@
<template #tableHeader='scope'>
<el-button v-auth.device="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
<el-button v-auth.device="'export'" type='primary' :icon='Upload' plain @click='downloadFile()'>导出</el-button>
<<<<<<< HEAD
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('')" v-if='modeStore.currentMode != "比对式"'>导入</el-button>
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('比对式')" v-if='modeStore.currentMode === "比对式"'>导入</el-button>
=======
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click='importFile()'>导入</el-button>
>>>>>>> ab02f8f1b34e2ceeee7cb83be9f6fc79b71116ad
<el-button v-auth.device="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
@click='batchDelete(scope.selectedListIds)'>
删除
@@ -40,10 +44,10 @@ import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/i
import DevicePopup from '@/views/machine/device/components/devicePopup.vue'
import { CirclePlus, Delete, EditPen, Download, Upload } from '@element-plus/icons-vue'
import { useDictStore } from '@/stores/modules/dict'
import { getPqDevList, deletePqDev, exportPqDev, downloadTemplate, importPqDev,getPqDev } from '@/api/device/device/index.ts'
import {getPqDevList, deletePqDev, getPqDev, exportCNDev, downloadCNDevTemplate, importCNDev} from '@/api/device/device/index.ts'
import { ElMessageBox } from 'element-plus'
import { computed, onBeforeMount, onMounted, reactive, ref } from 'vue'
import { useModeStore , useAppSceneStore} from '@/stores/modules/mode'; // 引入模式 store
import { useModeStore , useAppSceneStore} from '@/stores/modules/mode';
defineOptions({
name: 'device'
})
@@ -197,7 +201,7 @@ const downloadFile = async () => {
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() =>{
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
useDownload(exportPqDev,'被检设备导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx')
useDownload(exportCNDev,'被检设备导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx')
})
}
@@ -217,11 +221,12 @@ const importFile = async (pattern:string) => {
deviceImportExcel.value?.acceptParams(params)
}else{
const params = {
title: '被检设备',
showCover: false,
tempApi: downloadTemplate,
getTableList: proTable.value?.getTableList,
title: '被检设备',
showCover: false,
tempApi: downloadCNDevTemplate,
importApi: importCNDev,
// importApi: modeStore.currentMode === "比对式"? importContrastPqDev: importCNDev,
getTableList: proTable.value?.getTableList,
}
deviceImportExcel.value?.acceptParams(params)
}