微调
This commit is contained in:
@@ -87,7 +87,7 @@ export const changeErrorSystem = (params: {
|
||||
deviceId: string,
|
||||
code: string
|
||||
}) => {
|
||||
return http.post("/result/changeErrorSystem", params, {loading: false});
|
||||
return http.post("/result/changeErrorSystem", params, {loading: true});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,33 +25,41 @@ export const deletePqDev = (params: string[]) => {
|
||||
return http.post(`/pqDev/delete`, params)
|
||||
}
|
||||
|
||||
// export const downloadTemplate = () => {
|
||||
// return http.download(`/pqDev/downloadTemplate`)
|
||||
// }
|
||||
|
||||
// //导入被检设备(比对)
|
||||
// export const importPqDev=(params: Device.ReqPqDevParams)=>{
|
||||
// return http.upload(`/pqDev/import`, params)
|
||||
// }
|
||||
// //导入比对式被检设备
|
||||
// export const importContrastPqDev=(params: Device.ReqPqDevParams)=>{
|
||||
// return http.upload(`/pqDev/importContrast`, params)
|
||||
// }
|
||||
|
||||
//导出灿能二楼设备
|
||||
export const exportCNDev = (params: Device.ReqPqDevParams) => {
|
||||
return http.download(`/pqDev/exportCNDev`, params)
|
||||
//导出被检设备
|
||||
export const exportPqDev = (params: Device.ReqPqDevParams) => {
|
||||
return http.download(`/pqDev/export`, params)
|
||||
}
|
||||
// 下载导入文件模板
|
||||
export const downloadTemplate = () => {
|
||||
return http.download(`/pqDev/downloadTemplate`)
|
||||
}
|
||||
|
||||
// 下载灿能二楼设备导入文件模板
|
||||
export const downloadCNDevTemplate = () => {
|
||||
return http.download(`/pqDev/downloadCNDevTemplate`)
|
||||
//导入被检设备
|
||||
export const importPqDev = (params: Device.ReqPqDevParams) => {
|
||||
return http.uploadExcel(`/pqDev/import`, params)
|
||||
}
|
||||
|
||||
//导入灿能二楼设备
|
||||
export const importCNDev = (params: Device.ReqPqDevParams) => {
|
||||
return http.uploadExcel(`/pqDev/importCNDev`, params)
|
||||
//导入比对式被检设备
|
||||
export const importContrastPqDev = (params: Device.ReqPqDevParams) => {
|
||||
return http.upload(`/pqDev/importContrast`, params)
|
||||
}
|
||||
|
||||
// //导出灿能二楼设备
|
||||
// export const exportCNDev = (params: Device.ReqPqDevParams) => {
|
||||
// return http.download(`/pqDev/exportCNDev`, params)
|
||||
// }
|
||||
//
|
||||
// // 下载灿能二楼设备导入文件模板
|
||||
// export const downloadCNDevTemplate = () => {
|
||||
// return http.download(`/pqDev/downloadCNDevTemplate`)
|
||||
// }
|
||||
//
|
||||
// //导入灿能二楼设备
|
||||
// export const importCNDev = (params: Device.ReqPqDevParams) => {
|
||||
// return http.uploadExcel(`/pqDev/importCNDev`, params)
|
||||
// }
|
||||
|
||||
|
||||
//根据设备类型决定(电源、icd、模板、通道数、额定电压、额定电流);
|
||||
export const getPqDev = () => {
|
||||
return http.get(`/devType/listAll`)
|
||||
|
||||
@@ -38,3 +38,8 @@ export const refreshToken = () => {
|
||||
)
|
||||
}
|
||||
|
||||
//获取场景
|
||||
export const getCurrentScene = () => {
|
||||
return http.get('/admin/getCurrentScene', {}, { loading: false })
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ import { ElMessage } from "element-plus";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useModeStore, useAppSceneStore } from "@/stores/modules/mode"; // 引入模式 store
|
||||
import { ref } from "vue";
|
||||
import {getCurrentScene} from "@/api/user/login";
|
||||
const authStore = useAuthStore();
|
||||
const modeStore = useModeStore(); // 使用模式 store
|
||||
const AppSceneStore = useAppSceneStore();
|
||||
@@ -82,7 +83,9 @@ const modeList = [
|
||||
];
|
||||
const handelOpen = async (item: any) => {
|
||||
modeStore.setCurrentMode(item.code); // 将模式code存入 store
|
||||
AppSceneStore.setCurrentMode('1');//0:省级平台,1:设备出厂,2:研发自测
|
||||
const {data:scene} = await getCurrentScene(); // 获取当前场景
|
||||
// AppSceneStore.setCurrentMode(scene+'');//0:省级平台,1:设备出厂,2:研发自测
|
||||
AppSceneStore.setCurrentMode('0');//0:省级平台,1:设备出厂,2:研发自测
|
||||
await authStore.setShowMenu();
|
||||
return;
|
||||
// if (isActive) {
|
||||
|
||||
@@ -43,21 +43,14 @@ import { useHandleData } from '@/hooks/useHandleData'
|
||||
import {useDownload} from '@/hooks/useDownload'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import ImportExcel from '@/components/ImportExcel/index.vue'
|
||||
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
|
||||
import {type ColumnProps, type ProTableInstance} from '@/components/ProTable/interface'
|
||||
import DevicePopup from '@/views/machine/device/components/devicePopup.vue'
|
||||
import { CirclePlus, Delete, EditPen, Download, Upload } from '@element-plus/icons-vue'
|
||||
import {CirclePlus, Delete, Download, EditPen, Upload} from '@element-plus/icons-vue'
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
import {
|
||||
getPqDevList,
|
||||
deletePqDev,
|
||||
getPqDev,
|
||||
exportCNDev,
|
||||
downloadCNDevTemplate,
|
||||
importCNDev,
|
||||
} from '@/api/device/device/index.ts'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev} from '@/api/device/device/index.ts'
|
||||
import {ElMessageBox} from 'element-plus'
|
||||
import {onBeforeMount, reactive, ref} from 'vue'
|
||||
import { useModeStore, useAppSceneStore } from '@/stores/modules/mode'
|
||||
import {useAppSceneStore, useModeStore} from '@/stores/modules/mode'
|
||||
|
||||
// defineOptions({
|
||||
// name: 'device',
|
||||
@@ -72,6 +65,7 @@ const boundPqDevList = ref<Device.ReqPqDevParams[]>([])//根据检测计划id查
|
||||
// 存储设备类型选项
|
||||
const devTypeOptions = ref<Device.ResDev[]>([])
|
||||
|
||||
|
||||
const getTableList = async (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
newParams.searchEndTime = endDate.value
|
||||
@@ -231,7 +225,7 @@ const downloadFile = async () => {
|
||||
|
||||
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', {type: 'warning'}).then(() => {
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id
|
||||
useDownload(exportCNDev, '被检设备导出数据', { ...proTable.value?.searchParam, pattern: patternId }, false, '.xlsx')
|
||||
useDownload(exportPqDev, '被检设备导出数据', {...proTable.value?.searchParam, pattern: patternId}, false, '.xlsx')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -254,8 +248,8 @@ const importFile = async (pattern: string) => {
|
||||
title: '被检设备',
|
||||
showCover: false,
|
||||
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id,
|
||||
tempApi: downloadCNDevTemplate,
|
||||
importApi: importCNDev,
|
||||
tempApi: downloadTemplate,
|
||||
importApi: importPqDev,
|
||||
// importApi: modeStore.currentMode === "比对式"? importContrastPqDev: importCNDev,
|
||||
getTableList: proTable.value?.getTableList,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user