|
@@ -443,6 +443,7 @@ export default {
|
|
type: 'success',
|
|
type: 'success',
|
|
message: '操作成功!'
|
|
message: '操作成功!'
|
|
})
|
|
})
|
|
|
|
+ this.handleClose()
|
|
this.getPreProcessingAPI({ aircraftId: this.aircaftModelIdList })
|
|
this.getPreProcessingAPI({ aircraftId: this.aircaftModelIdList })
|
|
}
|
|
}
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
@@ -529,23 +530,35 @@ export default {
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
const { data } = await getOssIdPlaybackDataAPI(row.ossId)
|
|
const { data } = await getOssIdPlaybackDataAPI(row.ossId)
|
|
- const { contentData, headData } = this.handleResultData(JSON.parse(data))
|
|
|
|
- this.chartData.legendData = headData
|
|
|
|
- for (var key in contentData) {
|
|
|
|
- if (key === '时间') {
|
|
|
|
- this.chartData.xAxisData = contentData['时间']
|
|
|
|
- } else {
|
|
|
|
- this.chartData.seriesData.push({
|
|
|
|
- name: key,
|
|
|
|
- type: 'line',
|
|
|
|
- data: contentData[key],
|
|
|
|
- connectNulls: true
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.resultVisible = true
|
|
|
|
|
|
+ this.getResultData(data)
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ getResultData(data) {
|
|
|
|
+ this.chartData = {
|
|
|
|
+ title: '',
|
|
|
|
+ legendData: [],
|
|
|
|
+ xAxisData: [],
|
|
|
|
+ yAxisData: [],
|
|
|
|
+ seriesData: []
|
|
|
|
+ }
|
|
|
|
+ const { contentData, headData } = this.handleResultData(JSON.parse(data))
|
|
|
|
+ this.chartData.legendData = headData
|
|
|
|
+ for (var key in contentData) {
|
|
|
|
+ if (key === '时间') {
|
|
|
|
+ this.chartData.xAxisData = contentData['时间']
|
|
|
|
+ } else {
|
|
|
|
+ this.chartData.seriesData.push({
|
|
|
|
+ name: key,
|
|
|
|
+ type: 'line',
|
|
|
|
+ data: contentData[key],
|
|
|
|
+ connectNulls: true
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.resultVisible = true
|
|
|
|
+ },
|
|
|
|
+
|
|
handleResultData(resultData) {
|
|
handleResultData(resultData) {
|
|
const headData = Object.keys(resultData[0])
|
|
const headData = Object.keys(resultData[0])
|
|
const contentData = {}
|
|
const contentData = {}
|
|
@@ -567,30 +580,38 @@ export default {
|
|
},
|
|
},
|
|
async beginExecute() {
|
|
async beginExecute() {
|
|
this.progressVisible = true
|
|
this.progressVisible = true
|
|
- this.percentage += 1
|
|
|
|
|
|
+
|
|
|
|
+ let myTimer = setInterval(() => {
|
|
|
|
+ if (this.percentage < 100) {
|
|
|
|
+ this.percentage += 1
|
|
|
|
+ } else {
|
|
|
|
+ clearInterval(myTimer)
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: '执行有误'
|
|
|
|
+ })
|
|
|
|
+ this.progressVisible = false
|
|
|
|
+ this.percentage = 0
|
|
|
|
+ }
|
|
|
|
+ }, 30)
|
|
|
|
+
|
|
try {
|
|
try {
|
|
const res = await executePreProcessing(this.executeForm)
|
|
const res = await executePreProcessing(this.executeForm)
|
|
- this.percentage += 1
|
|
|
|
- const myTimer = setInterval(() => {
|
|
|
|
- if (res?.code === 200 && this.percentage == 100) {
|
|
|
|
- this.progressVisible = false
|
|
|
|
- clearInterval(myTimer)
|
|
|
|
- this.percentage = 0
|
|
|
|
- this.handleClose()
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '执行成功!'
|
|
|
|
- })
|
|
|
|
- this.getPreProcessingAPI({ aircraftId: this.aircaftModelIdList })
|
|
|
|
- } else {
|
|
|
|
- this.percentage += 1
|
|
|
|
- }
|
|
|
|
- }, 30)
|
|
|
|
|
|
+ this.percentage = 100
|
|
|
|
+ clearInterval(myTimer)
|
|
|
|
+ if (res?.code === 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '执行成功!'
|
|
|
|
+ })
|
|
|
|
+ this.handleClose()
|
|
|
|
+ this.getResultData(res.data)
|
|
|
|
+ this.getPreProcessingAPI({ aircraftId: this.aircaftModelIdList })
|
|
|
|
+ }
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
|
+ clearInterval(myTimer)
|
|
|
|
+ } finally {
|
|
this.progressVisible = false
|
|
this.progressVisible = false
|
|
- if (myTimer) {
|
|
|
|
- clearInterval(myTimer)
|
|
|
|
- }
|
|
|
|
this.percentage = 0
|
|
this.percentage = 0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -638,7 +659,6 @@ export default {
|
|
switch (this.dialogTitle) {
|
|
switch (this.dialogTitle) {
|
|
case '编辑':
|
|
case '编辑':
|
|
this.updatePreProcessingAPI()
|
|
this.updatePreProcessingAPI()
|
|
- this.handleClose()
|
|
|
|
break
|
|
break
|
|
case '新增':
|
|
case '新增':
|
|
this.beginExecute()
|
|
this.beginExecute()
|