标准设备,比对模式被检设备
This commit is contained in:
@@ -47,7 +47,7 @@ import {type ColumnProps, type ProTableInstance} from '@/components/ProTable/int
|
||||
import DevicePopup from '@/views/machine/device/components/devicePopup.vue'
|
||||
import {CirclePlus, Delete, Download, EditPen, Upload} from '@element-plus/icons-vue'
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev} from '@/api/device/device/index.ts'
|
||||
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev,getPqDevById} from '@/api/device/device/index.ts'
|
||||
import {ElMessageBox} from 'element-plus'
|
||||
import {onBeforeMount, reactive, ref} from 'vue'
|
||||
import {useAppSceneStore, useModeStore} from '@/stores/modules/mode'
|
||||
@@ -65,11 +65,10 @@ 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
|
||||
newParams.searchBeginTime = startDate.value
|
||||
// newParams.searchEndTime = endDate.value
|
||||
// newParams.searchBeginTime = startDate.value
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id
|
||||
newParams.pattern = patternId
|
||||
return getPqDevList(newParams)
|
||||
@@ -102,54 +101,41 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
},
|
||||
{
|
||||
prop: 'createDate',
|
||||
label: '出厂日期',
|
||||
label: modeStore.currentMode === '比对式' ? '投运日期' : '出厂日期',
|
||||
minWidth: 200,
|
||||
isShow: appSceneStore.currentScene === '0',
|
||||
...(appSceneStore.currentScene === '0' ? {
|
||||
search: {
|
||||
render: () => {
|
||||
return (
|
||||
<div class='flx-flex-start'>
|
||||
<TimeControl
|
||||
default={'月'}
|
||||
onUpdate-dates={handleDateChange}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
},
|
||||
} : {}),
|
||||
// search: {
|
||||
// span: 2,
|
||||
// render: () => {
|
||||
// return (
|
||||
// <div class='flx-flex-start'>
|
||||
// <TimeControl
|
||||
// default={'月'}
|
||||
// onUpdate-dates={handleDateChange}
|
||||
// />
|
||||
// </div>
|
||||
// )
|
||||
// ...(appSceneStore.currentScene === '0' ? {
|
||||
// search: {
|
||||
// render: () => {
|
||||
// return (
|
||||
// <div class='flx-flex-start'>
|
||||
// <TimeControl
|
||||
// default={'月'}
|
||||
// onUpdate-dates={handleDateChange}
|
||||
// />
|
||||
// </div>
|
||||
// )
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// } : {}),
|
||||
},
|
||||
{
|
||||
prop: 'devChns',
|
||||
label: '通道数',
|
||||
minWidth: 110,
|
||||
|
||||
isShow: modeStore.currentMode != '比对式',
|
||||
},
|
||||
{
|
||||
prop: 'devVolt',
|
||||
label: '额定电压(V)',
|
||||
minWidth: 130,
|
||||
|
||||
isShow: modeStore.currentMode != '比对式',
|
||||
},
|
||||
{
|
||||
prop: 'devCurr',
|
||||
label: '额定电流(A)',
|
||||
minWidth: 130,
|
||||
|
||||
isShow: modeStore.currentMode != '比对式',
|
||||
},
|
||||
{
|
||||
prop: 'ip',
|
||||
@@ -167,6 +153,20 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
} : {}),
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'gdName',
|
||||
label: '供电公司',
|
||||
isShow: modeStore.currentMode === '比对式',
|
||||
search: {el: 'input'},
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'subName',
|
||||
label: '变电站',
|
||||
isShow: modeStore.currentMode === '比对式',
|
||||
search: {el: 'input'},
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
@@ -197,8 +197,14 @@ const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
|
||||
endDate.value = endDateTemp
|
||||
}
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
|
||||
devicePopup.value?.open(titleType, row, modeStore.currentMode, appSceneStore.currentScene, devTypeOptions.value)
|
||||
const openDialog = async (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
|
||||
if(titleType === 'add'){
|
||||
devicePopup.value?.open(titleType, row, modeStore.currentMode, appSceneStore.currentScene, devTypeOptions.value)
|
||||
}else{
|
||||
row = await getPqDevById(row)
|
||||
devicePopup.value?.open(titleType, row.data, modeStore.currentMode, appSceneStore.currentScene, devTypeOptions.value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -238,17 +244,6 @@ const downloadFile = async () => {
|
||||
const deviceImportExcel = ref<InstanceType<typeof ImportExcel> | null>(null)
|
||||
|
||||
const importFile = async (pattern: string) => {
|
||||
|
||||
if (pattern === '比对式') {
|
||||
// const params = {
|
||||
// title: '被检设备',
|
||||
// showCover: false,
|
||||
// tempApi: downloadTemplate,
|
||||
// importApi: importPqDev,
|
||||
// getTableList: proTable.value?.getTableList,
|
||||
// }
|
||||
// deviceImportExcel.value?.acceptParams(params)
|
||||
} else {
|
||||
const params = {
|
||||
title: '被检设备',
|
||||
showCover: false,
|
||||
@@ -259,7 +254,7 @@ const importFile = async (pattern: string) => {
|
||||
getTableList: proTable.value?.getTableList,
|
||||
}
|
||||
deviceImportExcel.value?.acceptParams(params)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user