修改现场测试问题
This commit is contained in:
@@ -109,7 +109,8 @@ import {
|
||||
resetEquipmentDelivery,
|
||||
governDeviceRegister,
|
||||
portableDeviceRegister,
|
||||
portableDeviceAccess
|
||||
portableDeviceAccess,
|
||||
getExcelTemplate
|
||||
} from '@/api/cs-system-boot/device'
|
||||
import html2canvas from 'html2canvas'
|
||||
import { fullUrl } from '@/utils/common'
|
||||
@@ -153,10 +154,10 @@ queryByCode('Device_Type').then(res => {
|
||||
...item
|
||||
}
|
||||
})
|
||||
let index = devTypeOptions.value.findIndex((item: any) => {
|
||||
return item.name == '网关'
|
||||
})
|
||||
devTypeOptions.value.splice(index, 1)
|
||||
// let index = devTypeOptions.value.findIndex((item: any) => {
|
||||
// return item.name == '网关'
|
||||
// })
|
||||
// devTypeOptions.value.splice(index, 1)
|
||||
})
|
||||
queryByid(id).then(res => {
|
||||
res.data.map((item: any, index: any) => {
|
||||
@@ -209,7 +210,7 @@ const tableStore = new TableStore({
|
||||
return devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: '设备型号',
|
||||
field: 'devModel',
|
||||
@@ -225,7 +226,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{ title: '录入时间', field: 'createTime' },
|
||||
|
||||
|
||||
{
|
||||
title: '使用状态',
|
||||
render: 'switch',
|
||||
@@ -259,7 +260,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
}).then(({ value }) => {
|
||||
passwordConfirm(value).then(res => {
|
||||
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status == 6 ? 2 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
||||
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status == 6 ? 2 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
||||
ElMessage.success(row.usageStatus == 1 ? '设备停用成功!' : '设备启用成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
@@ -560,7 +561,20 @@ const devTypeChange = (e: any) => {
|
||||
}
|
||||
// 下载模版
|
||||
const downLoadFile = () => {
|
||||
window.open(window.location.origin + '/api/cs-device-boot/EquipmentDelivery/getExcelTemplate')
|
||||
|
||||
getExcelTemplate().then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '设备导入模版.xlsx' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
ElMessage.success('下载成功')
|
||||
})
|
||||
}
|
||||
|
||||
// 导入模版
|
||||
@@ -615,9 +629,9 @@ const onSubmit = () => {
|
||||
nDid: res.data.ndid
|
||||
}).then(pres => {
|
||||
ElMessage.success(pres.message)
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
},1000)
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
}, 1000)
|
||||
}).catch(err => {
|
||||
// clearTimeout (time)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user