故障录波:修改日志与录波显示逻辑
This commit is contained in:
parent
684fa55eb6
commit
60e24b7b93
@ -513,15 +513,13 @@ const fileName = ref('')
|
|||||||
const warningInfo = ref()
|
const warningInfo = ref()
|
||||||
const previewFileDialogVisible = ref(false)
|
const previewFileDialogVisible = ref(false)
|
||||||
const readFile = (data: tableItemData) => {
|
const readFile = (data: tableItemData) => {
|
||||||
fileName.value = data.name.slice(24)
|
fileName.value = activeName.value === 'malFunction' ? data.name.slice(24) : data.name
|
||||||
previewFileDialogVisible.value = true
|
previewFileDialogVisible.value = true
|
||||||
getFileKeyEnum().finally(() => {
|
getFileKeyEnum().finally(() => {
|
||||||
getFileData(data.path)
|
getFileData(data.path)
|
||||||
.then((res) => {
|
.then((res: { data: any; faultTime?: any }) => {
|
||||||
// warningInfo.value = res.data.faultTime ? dayjs(res.data.faultTime).format('YYYY-MM-DD HH:mm:ss.SSS') : ''
|
previewChartData = res.data
|
||||||
|
const attrName = Object.keys(res.data)
|
||||||
previewChartData = res.data.dataCurve
|
|
||||||
const attrName = Object.keys(res.data.dataCurve)
|
|
||||||
const data: any = []
|
const data: any = []
|
||||||
let hasAddFaultTime = false
|
let hasAddFaultTime = false
|
||||||
attrName.forEach((item) => {
|
attrName.forEach((item) => {
|
||||||
@ -529,8 +527,8 @@ const readFile = (data: tableItemData) => {
|
|||||||
let timeStamp: any = []
|
let timeStamp: any = []
|
||||||
previewChartData.TimeStamp = previewChartData.TimeStamp.map((item: any) => {
|
previewChartData.TimeStamp = previewChartData.TimeStamp.map((item: any) => {
|
||||||
const parseTime = dayjs(item).format('YYYY-MM-DD HH:mm:ss.SSS')
|
const parseTime = dayjs(item).format('YYYY-MM-DD HH:mm:ss.SSS')
|
||||||
if (!hasAddFaultTime && res.data?.faultTime && item > res.data.faultTime) {
|
if (!hasAddFaultTime && res?.faultTime && item > res?.faultTime) {
|
||||||
const parseFaultTime = dayjs(res.data.faultTime).format('YYYY-MM-DD HH:mm:ss.SSS')
|
const parseFaultTime = dayjs(res.faultTime).format('YYYY-MM-DD HH:mm:ss.SSS')
|
||||||
warningInfo.value = parseFaultTime
|
warningInfo.value = parseFaultTime
|
||||||
timeStamp.push(parseFaultTime)
|
timeStamp.push(parseFaultTime)
|
||||||
hasAddFaultTime = true
|
hasAddFaultTime = true
|
||||||
@ -694,6 +692,7 @@ const createSeriresData = () => {
|
|||||||
const initPreviewChart = () => {
|
const initPreviewChart = () => {
|
||||||
const chart = previewChartInstance ?? echarts.init(previewChartRef.value)
|
const chart = previewChartInstance ?? echarts.init(previewChartRef.value)
|
||||||
const series = createSeriresData()
|
const series = createSeriresData()
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 50,
|
top: 50,
|
||||||
@ -791,7 +790,9 @@ const initPreviewChart = () => {
|
|||||||
color: '#73767a',
|
color: '#73767a',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
series: [
|
series:
|
||||||
|
activeName.value === 'malFunction'
|
||||||
|
? [
|
||||||
...series,
|
...series,
|
||||||
{
|
{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
@ -811,7 +812,8 @@ const initPreviewChart = () => {
|
|||||||
animation: false,
|
animation: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
]
|
||||||
|
: series,
|
||||||
}
|
}
|
||||||
chart.setOption(option)
|
chart.setOption(option)
|
||||||
previewChartInstance = chart
|
previewChartInstance = chart
|
||||||
@ -823,11 +825,15 @@ const getFileData = (url: string) => {
|
|||||||
return previewFileReq({
|
return previewFileReq({
|
||||||
deviceCode: curTreeData.value.code,
|
deviceCode: curTreeData.value.code,
|
||||||
url: url,
|
url: url,
|
||||||
|
}).then((res) => {
|
||||||
|
return { data: res.data.dataCurve, faultTime: res.data?.faultTime }
|
||||||
})
|
})
|
||||||
} else if (activeName.value === 'logManage') {
|
} else if (activeName.value === 'logManage') {
|
||||||
return previewLogFileReq({
|
return previewLogFileReq({
|
||||||
deviceCode: curTreeData.value.code,
|
deviceCode: curTreeData.value.code,
|
||||||
url: url,
|
url: url,
|
||||||
|
}).then((res) => {
|
||||||
|
return { data: res.data }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return Promise.reject()
|
return Promise.reject()
|
||||||
|
Loading…
Reference in New Issue
Block a user