fix: 优化

This commit is contained in:
Xu Zhimeng 2024-04-11 16:00:04 +08:00
parent e9c693ee51
commit 990ab9def5
2 changed files with 18 additions and 9 deletions

View File

@ -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)
},

View File

@ -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,