fix: 优化
This commit is contained in:
parent
e9c693ee51
commit
990ab9def5
|
@ -328,7 +328,6 @@ export default {
|
|||
inputFileName,
|
||||
data: result,
|
||||
from: 'db',
|
||||
type: 'beta',
|
||||
})
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
|
@ -375,7 +374,6 @@ export default {
|
|||
inputFileName: this.sample.sampleFileName,
|
||||
data: result,
|
||||
from: 'file',
|
||||
type: 'beta',
|
||||
})
|
||||
|
||||
this.isLoading = false
|
||||
|
@ -605,9 +603,14 @@ export default {
|
|||
|
||||
// 移除其他的beta缓存
|
||||
removeOtherBetaSamples() {
|
||||
const filterList = sampleList.filter(
|
||||
(item) => item.type !== 'beta' || item.inputFileName == this.sample.inputFileName
|
||||
)
|
||||
const regExp = /([A-Z]+\d+_\d+)(-[\w\s_\.]+)/
|
||||
const stationAndDetectorName = this.sample.inputFileName.replace(regExp, '$1')
|
||||
// 清理掉不是自己,且台站号+探测器号跟自己一样的谱,让它重新加载
|
||||
const filterList = sampleList.filter((item) => {
|
||||
const inputFileName = item.inputFileName
|
||||
return inputFileName == this.sample.inputFileName || !inputFileName.startsWith(stationAndDetectorName)
|
||||
})
|
||||
|
||||
setSampleList(filterList)
|
||||
},
|
||||
|
||||
|
|
|
@ -327,7 +327,6 @@ export default {
|
|||
},
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.opts.notMerge = true
|
||||
this.$nextTick(() => {
|
||||
|
@ -565,13 +564,20 @@ export default {
|
|||
// 3D 图表
|
||||
histogramDataDList: {
|
||||
handler(newVal) {
|
||||
const maxCount = Math.max(...newVal.map((item) => item.c))
|
||||
let maxCount = 0
|
||||
const data = []
|
||||
for (const item of newVal) {
|
||||
const { b, g, c } = item // 耗时较多
|
||||
if (c > maxCount) maxCount = c
|
||||
data.push([b, g, c])
|
||||
}
|
||||
|
||||
this.threeDSurfaceOption.zAxis3D.max = Math.ceil(maxCount * 1.2)
|
||||
this.threeDSurfaceOption.series.data = newVal.map((item) => [item.b, item.g, item.c]) // 设置3D surface数据
|
||||
this.threeDSurfaceOption.series.data = data // 设置3D surface数据 // 第一次设置耗时较多
|
||||
this.threeDSurfaceOption.visualMap.max = maxCount
|
||||
|
||||
this.threeDScatterOption.zAxis3D.max = Math.ceil(maxCount * 1.2)
|
||||
this.threeDScatterOption.series.data = newVal.map((item) => [item.b, item.g, item.c]) // 设置3D scatter数据
|
||||
this.threeDScatterOption.series.data = data // 设置3D scatter数据
|
||||
this.threeDScatterOption.visualMap.max = maxCount
|
||||
},
|
||||
immediate: true,
|
||||
|
|
Loading…
Reference in New Issue
Block a user