fix: 优化
This commit is contained in:
parent
e9c693ee51
commit
990ab9def5
|
@ -328,7 +328,6 @@ export default {
|
||||||
inputFileName,
|
inputFileName,
|
||||||
data: result,
|
data: result,
|
||||||
from: 'db',
|
from: 'db',
|
||||||
type: 'beta',
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
|
@ -375,7 +374,6 @@ export default {
|
||||||
inputFileName: this.sample.sampleFileName,
|
inputFileName: this.sample.sampleFileName,
|
||||||
data: result,
|
data: result,
|
||||||
from: 'file',
|
from: 'file',
|
||||||
type: 'beta',
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
@ -605,9 +603,14 @@ export default {
|
||||||
|
|
||||||
// 移除其他的beta缓存
|
// 移除其他的beta缓存
|
||||||
removeOtherBetaSamples() {
|
removeOtherBetaSamples() {
|
||||||
const filterList = sampleList.filter(
|
const regExp = /([A-Z]+\d+_\d+)(-[\w\s_\.]+)/
|
||||||
(item) => item.type !== 'beta' || item.inputFileName == this.sample.inputFileName
|
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)
|
setSampleList(filterList)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -327,7 +327,6 @@ export default {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.opts.notMerge = true
|
this.opts.notMerge = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -565,13 +564,20 @@ export default {
|
||||||
// 3D 图表
|
// 3D 图表
|
||||||
histogramDataDList: {
|
histogramDataDList: {
|
||||||
handler(newVal) {
|
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.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.threeDSurfaceOption.visualMap.max = maxCount
|
||||||
|
|
||||||
this.threeDScatterOption.zAxis3D.max = Math.ceil(maxCount * 1.2)
|
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
|
this.threeDScatterOption.visualMap.max = maxCount
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user