# frontend/src/views/machine/device/components/devicePopup.vue

#	frontend/src/views/machine/device/index.vue
This commit is contained in:
sjl
2024-11-14 20:37:54 +08:00
2 changed files with 440 additions and 67 deletions

View File

@@ -1,9 +1,9 @@
<template>
<div class='table-box' ref='popupBaseView'>
<ProTable
ref='proTable'
:columns='columns'
:request-api='getTableList'
ref='proTable'
:columns='columns'
:request-api='getTableList'
>
<!-- :requestApi="getRoleList" -->
<!-- 表格 header 按钮 -->
@@ -39,8 +39,7 @@ 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} from '@/api/device/device.ts'
import { onMounted, reactive, ref } from 'vue'
import { getPqDevList, deletePqDev, exportPqDev, downloadTemplate, importPqDev } from '@/api/device/device.ts'
import { ElMessageBox } from 'element-plus'
const dictStore = useDictStore()
@@ -64,7 +63,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
{
prop: 'name',
label: '名称',
search: { el: 'input'},
search: { el: 'input' },
minWidth: 200,
},
{
@@ -79,15 +78,24 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
label: '生产日期',
minWidth: 200,
search: {
span:2,
span: 2,
render: () => {
return (
<<<<<<< HEAD
<div class='flx-flex-start'>
<TimeControl
default={'月'}
onUpdate-dates={handleDateChange}
/>
</div>
=======
<div class='flx-flex-start'>
<TimeControl
default={'月'}
onUpdate-dates={handleDateChange}
/>
</div>
>>>>>>> 91eea8cc8ab3fd2cf06e074f25c2adf40548a4b9
)
},
},
@@ -96,25 +104,25 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
prop: 'devChns',
label: '设备通道数',
minWidth: 110,
},
{
prop: 'devVolt',
label: '额定电压V',
minWidth: 130,
},
{
prop: 'devCurr',
label: '额定电流A',
minWidth: 130,
},
{
prop: 'manufacturer',
label: '生产厂商',
enum: dictStore.getDictData('Dev_Manufacturers'),
search: { el: 'select', props: { filterable: true },order:1},
search: { el: 'select', props: { filterable: true }, order: 1 },
fieldNames: { label: 'name', value: 'code' },
minWidth: 200,
},
@@ -149,6 +157,7 @@ const handleDelete = async (params: Device.ResPqDev) => {
// 导出设备
const downloadFile = async () => {
<<<<<<< HEAD
// 获取当前的搜索参数
const searchParam = proTable.value?.searchParam || {};
@@ -158,13 +167,22 @@ const downloadFile = async () => {
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() =>
useDownload(exportPqDev,'被检设备导出数据', proTable.value?.searchParam, false,'.xlsx'),
=======
// 获取当前的搜索参数
const searchParam = proTable.value?.searchParam || {}
// 将开始时间和结束时间添加到搜索参数中
searchParam.searchBeginTime = startDate.value
searchParam.searchEndTime = endDate.value
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() =>
useDownload(exportPqDev, '被检设备导出数据', proTable.value?.searchParam, false, '.xlsx'),
>>>>>>> 91eea8cc8ab3fd2cf06e074f25c2adf40548a4b9
)
}
//导入设备
const deviceImportExcel = ref<InstanceType<typeof ImportExcel> | null>(null)
const importFile=async ()=>{
const importFile = async () => {
const params = {
title: '被检设备',
showCover: false,