修改测试bug
This commit is contained in:
@@ -19,6 +19,7 @@ import { ArrowLeft, Message } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { analyseWave, getFileByEventId } from '@/api/common'
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
const tableParams: any = ref({})
|
||||
const refheader = ref()
|
||||
const view = ref(true)
|
||||
@@ -38,7 +39,9 @@ const props = defineProps({
|
||||
default: '0'
|
||||
}
|
||||
})
|
||||
|
||||
const dictData = useDictData()
|
||||
const ReasonList: any = dictData.getBasicData('Event_Reason')
|
||||
const EventTypeList: any = dictData.getBasicData('Event_Type')
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-device-boot/csGroup/deviceDataByType',
|
||||
publicHeight: 215,
|
||||
@@ -52,16 +55,16 @@ const tableStore: any = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'startTime', title: '暂降发生时刻', minWidth: 180, sortable: true },
|
||||
{ field: 'startTime', title: '发生时刻', minWidth: 180, sortable: true },
|
||||
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
minWidth: 160,
|
||||
title: '暂降幅值(%)',
|
||||
minWidth: 120,
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
//row.cellValue = row.cellValue + '' ? row.cellValue.toFixed(2) : '/'
|
||||
row.cellValue = row.cellValue != null ? Number(row.cellValue).toFixed(2) : '/'
|
||||
row.cellValue = row.cellValue != null ? Number(row.cellValue).toFixed(2) : '-'
|
||||
if (String(row.cellValue).split('.')[1] == '00') {
|
||||
row.cellValue = String(row.cellValue).split('.')[0]
|
||||
}
|
||||
@@ -76,7 +79,7 @@ const tableStore: any = new TableStore({
|
||||
formatter: (row: any) => {
|
||||
// console.log('🚀 ~ row.cellValue:', row.cellValue)
|
||||
|
||||
return row.cellValue ? (row.cellValue - 0).toFixed(2) : '/'
|
||||
return row.cellValue ? (row.cellValue - 0).toFixed(2) : '-'
|
||||
},
|
||||
sortable: true
|
||||
},
|
||||
@@ -85,12 +88,27 @@ const tableStore: any = new TableStore({
|
||||
title: '相别',
|
||||
minWidth: 80,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
return row.cellValue || '-'
|
||||
}
|
||||
},
|
||||
{ field: 'showName', title: '触发类型', minWidth: 120 },
|
||||
{
|
||||
title: '暂降原因', field: 'advanceReason', minWidth: 100, align: 'center', formatter: (row: any) => {
|
||||
return ReasonList.find((item: any) => item.value == row.cellValue)?.label || '未知'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '暂降类型', field: 'advanceType', minWidth: 100, align: 'center', formatter: (row: any) => {
|
||||
return EventTypeList.find((item: any) => item.value == row.cellValue)?.label || '未知'
|
||||
}
|
||||
},
|
||||
{ title: '电压等级(kV)', field: 'lineVoltage', minWidth: 120, align: 'center', sortable: true, },
|
||||
{
|
||||
title: '发生位置', field: 'sagSource', minWidth: 120, align: 'center', formatter: (row: any) => {
|
||||
|
||||
|
||||
return row.cellValue == 1 ? '上游' : row.cellValue == 2 ? '下游' : '未知'
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
@@ -150,7 +168,7 @@ const tableStore: any = new TableStore({
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.wavePath
|
||||
return row.wavePath
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -165,6 +183,7 @@ const tableStore: any = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
row.loading2 = true
|
||||
ElMessage.info('下载中......')
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
@@ -176,6 +195,9 @@ const tableStore: any = new TableStore({
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
ElMessage.success('波形下载成功')
|
||||
row.loading2 = false
|
||||
}).catch(() => {
|
||||
row.loading2 = false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user