Merge branch 'master-dev' into feature-Beta-dev-renpy
This commit is contained in:
commit
2bb4937e26
|
@ -30,9 +30,10 @@ export default {
|
||||||
this._chart.setOption(this.option, this.opts)
|
this._chart.setOption(this.option, this.opts)
|
||||||
this.initEventListener()
|
this.initEventListener()
|
||||||
},
|
},
|
||||||
destroyed() {
|
beforeDestroy() {
|
||||||
if (this._chart) {
|
if (this._chart) {
|
||||||
this._chart.dispose()
|
this._chart.dispose()
|
||||||
|
this._chart = null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import user from './modules/user'
|
||||||
import permission from './modules/permission'
|
import permission from './modules/permission'
|
||||||
import enhance from './modules/enhance'
|
import enhance from './modules/enhance'
|
||||||
import online from './modules/online'
|
import online from './modules/online'
|
||||||
import sample from './modules/sample'
|
|
||||||
import getters from './getters'
|
import getters from './getters'
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
@ -18,7 +17,6 @@ export default new Vuex.Store({
|
||||||
permission,
|
permission,
|
||||||
enhance,
|
enhance,
|
||||||
online,
|
online,
|
||||||
sample
|
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
|
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
const sample = {
|
|
||||||
state: Object.freeze({
|
|
||||||
sampleList: [] // [{ inputFileName: String; data: Object; }]
|
|
||||||
}),
|
|
||||||
mutations: {
|
|
||||||
SET_SAMPLE_LIST: (state, sampleList) => {
|
|
||||||
state.sampleList = sampleList
|
|
||||||
},
|
|
||||||
|
|
||||||
ADD_SAMPLE_DATA: (state, sampleData) => {
|
|
||||||
const find = state.sampleList.find(item => item.inputFileName == sampleData.inputFileName)
|
|
||||||
if (find) {
|
|
||||||
find.data = sampleData.data
|
|
||||||
} else {
|
|
||||||
state.sampleList.push(sampleData)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
UPDATE_SAMPLE_DATA: (state, { inputFileName, key, data }) => {
|
|
||||||
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
|
|
||||||
if (find) {
|
|
||||||
find.data[key] = data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
UPDATE_SAMPLE_DATA_ANALY: (state, { inputFileName, data }) => {
|
|
||||||
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
|
|
||||||
if (find) {
|
|
||||||
data.DetailedInformation = find.data.DetailedInformation
|
|
||||||
find.data = data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
REMOVE_SAMPLE_DATA: (state, inputFileName) => {
|
|
||||||
const findIndex = state.sampleList.findIndex(item => item.inputFileName == inputFileName)
|
|
||||||
if(-1 !== findIndex) {
|
|
||||||
state.sampleList.splice(findIndex, 1)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
CLEAR_SAMPLE_DATA: (state) => {
|
|
||||||
state.sampleList = []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
GET_SAMPLE_DATA: ({ state }, inputFileName) => {
|
|
||||||
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
|
|
||||||
return find ? find : null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default sample
|
|
84
src/utils/SampleStore.js
Normal file
84
src/utils/SampleStore.js
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
// 所有缓存的谱
|
||||||
|
let sampleList = []
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新设置缓存的谱
|
||||||
|
* @param {Array} list
|
||||||
|
*/
|
||||||
|
const setSampleList = list => {
|
||||||
|
sampleList = list
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存一条谱数据
|
||||||
|
* @param {*} sampleData
|
||||||
|
*/
|
||||||
|
const addSampleData = sampleData => {
|
||||||
|
const find = sampleList.find(item => item.inputFileName == sampleData.inputFileName)
|
||||||
|
if (find) {
|
||||||
|
find.data = sampleData.data
|
||||||
|
} else {
|
||||||
|
sampleList.push(sampleData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新谱数据
|
||||||
|
* @param {{ inputFileName: string; key: string; data: any; }} param0
|
||||||
|
*/
|
||||||
|
const updateSampleData = ({ inputFileName, key, data }) => {
|
||||||
|
const find = sampleList.find(item => item.inputFileName == inputFileName)
|
||||||
|
if (find) {
|
||||||
|
find.data[key] = data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除谱数据
|
||||||
|
* @param {string} inputFileName
|
||||||
|
*/
|
||||||
|
const removeSampleData = inputFileName => {
|
||||||
|
const findIndex = sampleList.findIndex(item => item.inputFileName == inputFileName)
|
||||||
|
if (-1 !== findIndex) {
|
||||||
|
sampleList.splice(findIndex, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新分析数据
|
||||||
|
* @param {{ inputFileName: string; data: any; }} param0
|
||||||
|
*/
|
||||||
|
const updateSampleDataAnaly = ({ inputFileName, data }) => {
|
||||||
|
const find = sampleList.find(item => item.inputFileName == inputFileName)
|
||||||
|
if (find) {
|
||||||
|
data.DetailedInformation = find.data.DetailedInformation
|
||||||
|
find.data = data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理缓存列表
|
||||||
|
*/
|
||||||
|
const clearSampleData = () => {
|
||||||
|
sampleList = []
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据文件名获取谱
|
||||||
|
* @param {string} inputFileName
|
||||||
|
*/
|
||||||
|
const getSampleData = inputFileName => {
|
||||||
|
const find = sampleList.find(item => item.inputFileName == inputFileName)
|
||||||
|
return find ? find : null
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
sampleList,
|
||||||
|
setSampleList,
|
||||||
|
addSampleData,
|
||||||
|
updateSampleData,
|
||||||
|
removeSampleData,
|
||||||
|
updateSampleDataAnaly,
|
||||||
|
clearSampleData,
|
||||||
|
getSampleData
|
||||||
|
}
|
|
@ -121,6 +121,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { addSampleData, getSampleData, sampleList, setSampleList, updateSampleData } from '@/utils/SampleStore'
|
||||||
import { getAction, postAction } from '../../api/manage'
|
import { getAction, postAction } from '../../api/manage'
|
||||||
import BetaGammaChartContainer from './components/BetaGammaChartContainer.vue'
|
import BetaGammaChartContainer from './components/BetaGammaChartContainer.vue'
|
||||||
import BetaGammaSpectrumChart from './components/BetaGammaSpectrumChart.vue'
|
import BetaGammaSpectrumChart from './components/BetaGammaSpectrumChart.vue'
|
||||||
|
@ -189,6 +190,10 @@ export default {
|
||||||
analyseCurrentSpectrum: {
|
analyseCurrentSpectrum: {
|
||||||
type: Object,
|
type: Object,
|
||||||
},
|
},
|
||||||
|
sampleList: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
this.SampleType = SampleType
|
this.SampleType = SampleType
|
||||||
|
@ -237,7 +242,7 @@ export default {
|
||||||
this.qcFlagsVisible = true
|
this.qcFlagsVisible = true
|
||||||
}, 100)
|
}, 100)
|
||||||
},
|
},
|
||||||
destroyed() {
|
beforeDestroy() {
|
||||||
this.cancelLastRequest()
|
this.cancelLastRequest()
|
||||||
this.$bus.$off('ReAnalyses', this.handleReAnalyse)
|
this.$bus.$off('ReAnalyses', this.handleReAnalyse)
|
||||||
|
|
||||||
|
@ -323,7 +328,7 @@ export default {
|
||||||
this.changeChartByType('sample')
|
this.changeChartByType('sample')
|
||||||
this.emitGetFiles(result)
|
this.emitGetFiles(result)
|
||||||
|
|
||||||
this.$store.commit('ADD_SAMPLE_DATA', {
|
addSampleData({
|
||||||
inputFileName,
|
inputFileName,
|
||||||
data: result,
|
data: result,
|
||||||
from: 'db',
|
from: 'db',
|
||||||
|
@ -369,11 +374,12 @@ export default {
|
||||||
this.sampleDetail = result
|
this.sampleDetail = result
|
||||||
this.changeChartByType('sample')
|
this.changeChartByType('sample')
|
||||||
|
|
||||||
this.$store.commit('ADD_SAMPLE_DATA', {
|
addSampleData({
|
||||||
inputFileName: this.sample.sampleFileName,
|
inputFileName: this.sample.sampleFileName,
|
||||||
data: result,
|
data: result,
|
||||||
from: 'file',
|
from: 'file',
|
||||||
})
|
})
|
||||||
|
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
|
@ -557,6 +563,16 @@ export default {
|
||||||
})
|
})
|
||||||
this.$emit('reAnalyCurr', res.result.savedAnalysisResult, res.result.XeData)
|
this.$emit('reAnalyCurr', res.result.savedAnalysisResult, res.result.XeData)
|
||||||
this.handleReAnalyse(res.result)
|
this.handleReAnalyse(res.result)
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName: this.sample.inputFileName,
|
||||||
|
key: 'XeData',
|
||||||
|
data: res.result.XeData,
|
||||||
|
})
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName: this.sample.inputFileName,
|
||||||
|
key: 'savedAnalysisResult',
|
||||||
|
data: res.result.savedAnalysisResult,
|
||||||
|
})
|
||||||
if (res.result.bProcessed) {
|
if (res.result.bProcessed) {
|
||||||
this.$message.success(res.result.message)
|
this.$message.success(res.result.message)
|
||||||
} else {
|
} else {
|
||||||
|
@ -568,31 +584,78 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getAnalyzeAllSpectrum() {
|
// 分析全部
|
||||||
let params = {
|
async getAnalyzeAllSpectrum() {
|
||||||
dbNames: [this.sample.dbName],
|
const regExp = /^([A-Z]{1,}\d{1,})_/
|
||||||
sampleIds: [this.sample.sampleId ? this.sample.sampleId : ''],
|
const regMatched = this.sample.inputFileName.match(regExp)
|
||||||
sampleFileNames: [this.sample.inputFileName],
|
const currStationName = regMatched[1]
|
||||||
gasFileNames: [this.sample.gasFileName],
|
const dbNames = [],
|
||||||
detFileNames: [this.sample.detFileName],
|
sampleIds = [],
|
||||||
qcFileNames: [this.sample.qcFileName],
|
sampleFileNames = [],
|
||||||
|
gasFileNames = [],
|
||||||
|
detFileNames = [],
|
||||||
|
qcFileNames = []
|
||||||
|
|
||||||
|
const matchedSampleList = this.sampleList.filter((item) => item.inputFileName.includes(currStationName))
|
||||||
|
matchedSampleList.forEach(
|
||||||
|
({ dbName, sampleId, inputFileName, sampleFileName, gasFileName, detFileName, qcFileName, qcFileStatus }) => {
|
||||||
|
dbNames.push(dbName || '')
|
||||||
|
sampleIds.push(sampleId || '')
|
||||||
|
sampleFileNames.push(sampleFileName || inputFileName || '')
|
||||||
|
gasFileNames.push(gasFileName || '')
|
||||||
|
detFileNames.push(detFileName || '')
|
||||||
|
qcFileNames.push(qcFileStatus ? qcFileName : '')
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
dbNames,
|
||||||
|
sampleIds,
|
||||||
|
sampleFileNames,
|
||||||
|
gasFileNames,
|
||||||
|
detFileNames,
|
||||||
|
qcFileNames,
|
||||||
currentFileName: this.sample.inputFileName,
|
currentFileName: this.sample.inputFileName,
|
||||||
}
|
}
|
||||||
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
|
const { success, result, message } = await postAction('/spectrumAnalysis/analyseAllSpectrum', params)
|
||||||
if (res.success) {
|
if (success) {
|
||||||
// this.analyseCurrentSpectrum = res.result
|
// 对所有已加载的谱中和本谱相似的谱(指台站和探测器相同)
|
||||||
this.$emit('sendXeData', res.result.XeData)
|
Object.entries(result).forEach(([inputFileName, sampleInfo]) => {
|
||||||
res.result.XeData.forEach((item) => {
|
const { XeData, savedAnalysisResult, bProcessed, message } = sampleInfo
|
||||||
|
XeData.forEach((item) => {
|
||||||
item.conc = parseFloat(item.conc.toPrecision(6))
|
item.conc = parseFloat(item.conc.toPrecision(6))
|
||||||
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
||||||
item.lc = parseFloat(item.lc.toPrecision(6))
|
item.lc = parseFloat(item.lc.toPrecision(6))
|
||||||
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
||||||
})
|
})
|
||||||
this.$emit('reAnalyAll', true, res.result.XeData)
|
|
||||||
|
if (inputFileName == this.sample.inputFileName) {
|
||||||
|
this.$emit('sendXeData', XeData)
|
||||||
|
this.$emit('reAnalyAll', savedAnalysisResult, XeData)
|
||||||
|
this.handleReAnalyse(sampleInfo)
|
||||||
|
|
||||||
|
if (bProcessed) {
|
||||||
|
this.$message.success(message)
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(message)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName,
|
||||||
|
key: 'XeData',
|
||||||
|
data: XeData,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName,
|
||||||
|
key: 'savedAnalysisResult',
|
||||||
|
data: savedAnalysisResult,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.warning(message)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 右下角放大镜
|
// 右下角放大镜
|
||||||
|
@ -655,7 +718,7 @@ export default {
|
||||||
sample: {
|
sample: {
|
||||||
async handler(newVal, oldVal) {
|
async handler(newVal, oldVal) {
|
||||||
this.resultDisplay = []
|
this.resultDisplay = []
|
||||||
const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName)
|
const sampleData = getSampleData(newVal.inputFileName)
|
||||||
if (sampleData) {
|
if (sampleData) {
|
||||||
this.cancelLastRequest()
|
this.cancelLastRequest()
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
@ -673,6 +736,7 @@ export default {
|
||||||
this.getSampleDetail_file()
|
this.getSampleDetail_file()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
await this.$nextTick()
|
||||||
this.$refs.betaGammaChartRef.handleUnzoom()
|
this.$refs.betaGammaChartRef.handleUnzoom()
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
@ -683,11 +747,6 @@ export default {
|
||||||
// this.currResultDisplay = newVal.XeData
|
// this.currResultDisplay = newVal.XeData
|
||||||
this.resultDisplay = cloneDeep(newVal.XeData) || []
|
this.resultDisplay = cloneDeep(newVal.XeData) || []
|
||||||
this.sortResultDisplay()
|
this.sortResultDisplay()
|
||||||
this.$store.commit('UPDATE_SAMPLE_DATA', {
|
|
||||||
inputFileName: this.sample.inputFileName,
|
|
||||||
key: 'XeData',
|
|
||||||
data: newVal.XeData,
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
// immediate: true,
|
// immediate: true,
|
||||||
deep: true,
|
deep: true,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { deleteAction } from '@/api/manage'
|
import { deleteAction } from '@/api/manage'
|
||||||
import store from '@/store'
|
import { removeSampleData } from '@/utils/SampleStore'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,7 +20,7 @@ export const clearSampleCache = sampleList => {
|
||||||
params = { sampleFileName: fileName }
|
params = { sampleFileName: fileName }
|
||||||
}
|
}
|
||||||
deleteAction(url, params)
|
deleteAction(url, params)
|
||||||
store.commit('REMOVE_SAMPLE_DATA', fileName)
|
removeSampleData(fileName)
|
||||||
Vue.ls.remove(`CALIBRATION_GAMMA_${fileName}`)
|
Vue.ls.remove(`CALIBRATION_GAMMA_${fileName}`)
|
||||||
Vue.ls.remove(`CALIBRATION_BETA_${fileName}`)
|
Vue.ls.remove(`CALIBRATION_BETA_${fileName}`)
|
||||||
})
|
})
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -228,6 +228,7 @@ import { updateBaseLine } from '@/utils/WasmHelper'
|
||||||
import RectList from './components/RectList.vue'
|
import RectList from './components/RectList.vue'
|
||||||
import { isNullOrUndefined } from '@/utils/util'
|
import { isNullOrUndefined } from '@/utils/util'
|
||||||
import { findNearPeak, getLineData, transformPointListData } from '@/utils/sampleHelper'
|
import { findNearPeak, getLineData, transformPointListData } from '@/utils/sampleHelper'
|
||||||
|
import { getSampleData } from '@/utils/SampleStore'
|
||||||
|
|
||||||
// 初始配置
|
// 初始配置
|
||||||
const initialOption = {
|
const initialOption = {
|
||||||
|
@ -514,7 +515,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getInfo() {
|
getInfo() {
|
||||||
this.option.series = []
|
this.option.series = []
|
||||||
this.thumbnailOption.series = []
|
this.thumbnailOption.series = []
|
||||||
this.list = []
|
this.list = []
|
||||||
|
@ -522,7 +523,7 @@ export default {
|
||||||
|
|
||||||
const { inputFileName } = this.sampleData
|
const { inputFileName } = this.sampleData
|
||||||
|
|
||||||
const currSampleDetailInfo = await this.$store.dispatch('GET_SAMPLE_DATA', inputFileName)
|
const currSampleDetailInfo = getSampleData(inputFileName)
|
||||||
const {
|
const {
|
||||||
data: { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls, barChart },
|
data: { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls, barChart },
|
||||||
} = currSampleDetailInfo
|
} = currSampleDetailInfo
|
||||||
|
@ -583,8 +584,8 @@ export default {
|
||||||
this.handleResetChart()
|
this.handleResetChart()
|
||||||
},
|
},
|
||||||
|
|
||||||
async beforeModalOpen() {
|
beforeModalOpen() {
|
||||||
await this.getInfo()
|
this.getInfo()
|
||||||
this.reset()
|
this.reset()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -629,7 +629,7 @@ export default {
|
||||||
this.$bus.$on('betaRefresh', this.getData)
|
this.$bus.$on('betaRefresh', this.getData)
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
destroyed() {
|
beforeDestroy() {
|
||||||
this.$bus.$off('betaRefresh', this.handleReset)
|
this.$bus.$off('betaRefresh', this.handleReset)
|
||||||
this.$bus.$off('betaRefresh', this.getData)
|
this.$bus.$off('betaRefresh', this.getData)
|
||||||
},
|
},
|
||||||
|
|
|
@ -50,6 +50,7 @@ import { postAction } from '@/api/manage'
|
||||||
import BetaDetectorCalibration from './components/BetaDetectorCalibration.vue'
|
import BetaDetectorCalibration from './components/BetaDetectorCalibration.vue'
|
||||||
import GammaDetectorCalibration from './components/GammaDetectorCalibration.vue'
|
import GammaDetectorCalibration from './components/GammaDetectorCalibration.vue'
|
||||||
import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder.vue'
|
import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder.vue'
|
||||||
|
import { removeSampleData } from '@/utils/SampleStore'
|
||||||
export default {
|
export default {
|
||||||
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
|
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
|
||||||
mixins: [ModalMixin, SampleDataMixin],
|
mixins: [ModalMixin, SampleDataMixin],
|
||||||
|
@ -179,8 +180,7 @@ export default {
|
||||||
// 清理相同台站的缓存
|
// 清理相同台站的缓存
|
||||||
clearSameStationCache(sampleList) {
|
clearSameStationCache(sampleList) {
|
||||||
sampleList.forEach(({ inputFileName }) => {
|
sampleList.forEach(({ inputFileName }) => {
|
||||||
console.log('inputFileName>>' + inputFileName)
|
removeSampleData(inputFileName)
|
||||||
this.$store.commit('REMOVE_SAMPLE_DATA', inputFileName)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 相同台站能谱缓存一样的Calibration数据 20231115:xiao
|
// 相同台站能谱缓存一样的Calibration数据 20231115:xiao
|
||||||
|
|
|
@ -136,6 +136,7 @@ import { readFile, zipFile } from '@/utils/file'
|
||||||
import { findNearPeak } from '@/utils/sampleHelper'
|
import { findNearPeak } from '@/utils/sampleHelper'
|
||||||
import { add, subtract } from 'xe-utils/methods'
|
import { add, subtract } from 'xe-utils/methods'
|
||||||
import { PHDParser, isSample, getSampleTypeIdentify } from '@/utils/phdHelper'
|
import { PHDParser, isSample, getSampleTypeIdentify } from '@/utils/phdHelper'
|
||||||
|
import { addSampleData, getSampleData } from '@/utils/SampleStore'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
@ -190,8 +191,8 @@ export default {
|
||||||
stripSumOrCutLine: null,
|
stripSumOrCutLine: null,
|
||||||
stripReferenceLine: null,
|
stripReferenceLine: null,
|
||||||
}
|
}
|
||||||
;(this.peakList = []), // Peak 列表(非点位)
|
this.peakList = [] // Peak 列表(非点位)
|
||||||
(this.baseCtrls = {}) // BaseCtrls
|
this.baseCtrls = {} // BaseCtrls
|
||||||
|
|
||||||
return {
|
return {
|
||||||
abc: false,
|
abc: false,
|
||||||
|
@ -253,7 +254,7 @@ export default {
|
||||||
window.addEventListener('keydown', this.handleKeyboardEvent)
|
window.addEventListener('keydown', this.handleKeyboardEvent)
|
||||||
window.addEventListener('click', this.closePeakInfomationTooltip)
|
window.addEventListener('click', this.closePeakInfomationTooltip)
|
||||||
},
|
},
|
||||||
destroyed() {
|
beforeDestroy() {
|
||||||
this.cancelLastRequest()
|
this.cancelLastRequest()
|
||||||
|
|
||||||
this.$bus.$off('gammaRefresh', this.handleRefresh)
|
this.$bus.$off('gammaRefresh', this.handleRefresh)
|
||||||
|
@ -263,8 +264,16 @@ export default {
|
||||||
window.removeEventListener('click', this.closePeakInfomationTooltip)
|
window.removeEventListener('click', this.closePeakInfomationTooltip)
|
||||||
|
|
||||||
if (this.qcFlagsTimer) {
|
if (this.qcFlagsTimer) {
|
||||||
clearTimeout(this.qcFlagsTimer)
|
window.clearTimeout(this.qcFlagsTimer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.closeWebSocket()
|
||||||
|
|
||||||
|
if (this.websocketTimer) {
|
||||||
|
window.clearTimeout(this.websocketTimer)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.websock = null
|
||||||
},
|
},
|
||||||
deactivated() {
|
deactivated() {
|
||||||
// Object.keys(this.subOperatorsState).forEach(k => {
|
// Object.keys(this.subOperatorsState).forEach(k => {
|
||||||
|
@ -464,10 +473,10 @@ export default {
|
||||||
let token = Vue.ls.get(ACCESS_TOKEN)
|
let token = Vue.ls.get(ACCESS_TOKEN)
|
||||||
this.websock = new WebSocket(url, [token])
|
this.websock = new WebSocket(url, [token])
|
||||||
//update-end-author:taoyan date:2022-4-22 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
//update-end-author:taoyan date:2022-4-22 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||||
this.websock.onopen = this.websocketOnopen
|
this.websock.addEventListener('open', this.websocketOnopen)
|
||||||
this.websock.onerror = this.websocketOnerror
|
this.websock.addEventListener('error', this.websocketOnerror)
|
||||||
this.websock.onmessage = this.websocketOnmessage
|
this.websock.addEventListener('message', this.websocketOnmessage)
|
||||||
this.websock.onclose = this.websocketOnclose
|
this.websock.addEventListener('close', this.websocketOnclose)
|
||||||
},
|
},
|
||||||
websocketOnopen: function () {
|
websocketOnopen: function () {
|
||||||
// console.log('WebSocket连接成功1231')
|
// console.log('WebSocket连接成功1231')
|
||||||
|
@ -493,12 +502,25 @@ export default {
|
||||||
if (that.lockReconnect) return
|
if (that.lockReconnect) return
|
||||||
that.lockReconnect = true
|
that.lockReconnect = true
|
||||||
//没连接上会一直重连,设置延迟避免请求过多
|
//没连接上会一直重连,设置延迟避免请求过多
|
||||||
setTimeout(function () {
|
this.websocketTimer = setTimeout(function () {
|
||||||
console.info('尝试重连...')
|
console.info('尝试重连...')
|
||||||
that.initWebSocket()
|
that.initWebSocket()
|
||||||
that.lockReconnect = false
|
that.lockReconnect = false
|
||||||
}, 20000)
|
}, 20000)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 关闭websocket
|
||||||
|
closeWebSocket() {
|
||||||
|
if (this.websock) {
|
||||||
|
this.websock.removeEventListener('open', this.websocketOnopen)
|
||||||
|
this.websock.removeEventListener('error', this.websocketOnerror)
|
||||||
|
this.websock.removeEventListener('message', this.websocketOnmessage)
|
||||||
|
this.websock.removeEventListener('close', this.websocketOnclose)
|
||||||
|
this.websock.close()
|
||||||
|
this.websock = null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 获取样品详情
|
// 获取样品详情
|
||||||
async getSampleDetail() {
|
async getSampleDetail() {
|
||||||
const { dbName, sampleId, analyst } = this.sample
|
const { dbName, sampleId, analyst } = this.sample
|
||||||
|
@ -579,7 +601,7 @@ export default {
|
||||||
dataProcess(result, flag) {
|
dataProcess(result, flag) {
|
||||||
const { inputFileName } = this.sample
|
const { inputFileName } = this.sample
|
||||||
|
|
||||||
this.$store.commit('ADD_SAMPLE_DATA', {
|
addSampleData({
|
||||||
inputFileName,
|
inputFileName,
|
||||||
data: result,
|
data: result,
|
||||||
from: flag,
|
from: flag,
|
||||||
|
@ -2057,11 +2079,11 @@ export default {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
sample: {
|
sample: {
|
||||||
async handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
console.log('newValnewVal', newVal)
|
console.log('newValnewVal', newVal)
|
||||||
this.graphAssistance.axisType = 'Channel'
|
this.graphAssistance.axisType = 'Channel'
|
||||||
this.handleResetState()
|
this.handleResetState()
|
||||||
const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName)
|
const sampleData = getSampleData(newVal.inputFileName)
|
||||||
if (sampleData) {
|
if (sampleData) {
|
||||||
this.cancelLastRequest()
|
this.cancelLastRequest()
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
:sampleInfo="sampleInfo"
|
:sampleInfo="sampleInfo"
|
||||||
:sample="sampleData"
|
:sample="sampleData"
|
||||||
:analyseCurrentSpectrum="analyseCurrentSpectrumData"
|
:analyseCurrentSpectrum="analyseCurrentSpectrumData"
|
||||||
|
:sampleList="sampleList"
|
||||||
/>
|
/>
|
||||||
<!-- Beta-Gamma 分析 -->
|
<!-- Beta-Gamma 分析 -->
|
||||||
<div v-else class="empty">Please Select a Sample</div>
|
<div v-else class="empty">Please Select a Sample</div>
|
||||||
|
@ -295,6 +296,7 @@ import BGLogViewer from './components/Modals/BetaGammaModals/BGLogViewer.vue'
|
||||||
|
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
import CompareFromDbModal from './components/Modals/CompareFromDBModal.vue'
|
import CompareFromDbModal from './components/Modals/CompareFromDBModal.vue'
|
||||||
|
import { clearSampleData, getSampleData, updateSampleDataAnaly } from '@/utils/SampleStore'
|
||||||
|
|
||||||
// 分析类型
|
// 分析类型
|
||||||
const ANALYZE_TYPE = {
|
const ANALYZE_TYPE = {
|
||||||
|
@ -489,9 +491,9 @@ export default {
|
||||||
window.addEventListener('beforeunload', this.handleCleanAll)
|
window.addEventListener('beforeunload', this.handleCleanAll)
|
||||||
},
|
},
|
||||||
|
|
||||||
destroyed() {
|
beforeDestroy() {
|
||||||
this.$bus.$off('reanalyse', this.handleReanalyse)
|
this.$bus.$off('reanalyse', this.handleReanalyse)
|
||||||
this.$store.commit('CLEAR_SAMPLE_DATA')
|
clearSampleData()
|
||||||
this.handleCleanAll()
|
this.handleCleanAll()
|
||||||
window.removeEventListener('beforeunload', this.handleCleanAll)
|
window.removeEventListener('beforeunload', this.handleCleanAll)
|
||||||
},
|
},
|
||||||
|
@ -502,8 +504,10 @@ export default {
|
||||||
this.params_toDB.savedAnalysisResult = flag
|
this.params_toDB.savedAnalysisResult = flag
|
||||||
this.resultDisplayFlag = val
|
this.resultDisplayFlag = val
|
||||||
},
|
},
|
||||||
getReAnalyAll(val) {
|
getReAnalyAll(flag, val) {
|
||||||
|
this.isReAnalyed_beta = flag
|
||||||
this.resultDisplayFlag = val
|
this.resultDisplayFlag = val
|
||||||
|
this.params_toDB.savedAnalysisResult = flag
|
||||||
},
|
},
|
||||||
handleReAnalyed(val) {
|
handleReAnalyed(val) {
|
||||||
this.isReAnalyed_gamma = val
|
this.isReAnalyed_gamma = val
|
||||||
|
@ -525,6 +529,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.resultDisplayFlag = arg
|
this.resultDisplayFlag = arg
|
||||||
this.params_toDB.stationName = val
|
this.params_toDB.stationName = val
|
||||||
|
this.params_toDB.savedAnalysisResult = flag
|
||||||
this.isReAnalyed_beta = this.isReAnalyed_beta ? this.isReAnalyed_beta : flag
|
this.isReAnalyed_beta = this.isReAnalyed_beta ? this.isReAnalyed_beta : flag
|
||||||
},
|
},
|
||||||
getCheckFlag(val) {
|
getCheckFlag(val) {
|
||||||
|
@ -645,6 +650,8 @@ export default {
|
||||||
// B是beta-gamma P G是gamma
|
// B是beta-gamma P G是gamma
|
||||||
if (sample.sampleType == 'B') {
|
if (sample.sampleType == 'B') {
|
||||||
this.analysisType = ANALYZE_TYPE.BETA_GAMMA
|
this.analysisType = ANALYZE_TYPE.BETA_GAMMA
|
||||||
|
const sampleData = getSampleData(sample.inputFileName)
|
||||||
|
this.params_toDB.savedAnalysisResult = sampleData ? sampleData.data.savedAnalysisResult : false
|
||||||
} else if (sample.sampleType == 'C') {
|
} else if (sample.sampleType == 'C') {
|
||||||
this.analysisType = ANALYZE_TYPE.BETA
|
this.analysisType = ANALYZE_TYPE.BETA
|
||||||
} else {
|
} else {
|
||||||
|
@ -652,7 +659,6 @@ export default {
|
||||||
}
|
}
|
||||||
this.sampleData = this.newSampleData = sample
|
this.sampleData = this.newSampleData = sample
|
||||||
this.currSampleDet = this.allSampleDet[sample.inputFileName]
|
this.currSampleDet = this.allSampleDet[sample.inputFileName]
|
||||||
this.params_toDB.savedAnalysisResult = sample.sampleId ? true : false
|
|
||||||
this.params_toDB.comment = ''
|
this.params_toDB.comment = ''
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -883,7 +889,6 @@ export default {
|
||||||
* @param { 'all' | 'current' } type
|
* @param { 'all' | 'current' } type
|
||||||
*/
|
*/
|
||||||
handleSavePHDToFile(type) {
|
handleSavePHDToFile(type) {
|
||||||
console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type)
|
|
||||||
if (this.isGamma) {
|
if (this.isGamma) {
|
||||||
if (type == 'current') {
|
if (type == 'current') {
|
||||||
let params = {
|
let params = {
|
||||||
|
@ -943,7 +948,7 @@ export default {
|
||||||
try {
|
try {
|
||||||
const { success, result, message } = await postAction(`/gamma/Reprocessing?fileName=${fileNames[0]}`)
|
const { success, result, message } = await postAction(`/gamma/Reprocessing?fileName=${fileNames[0]}`)
|
||||||
if (success) {
|
if (success) {
|
||||||
this.$store.commit('UPDATE_SAMPLE_DATA_ANALY', {
|
updateSampleDataAnaly({
|
||||||
inputFileName: fileNames[0],
|
inputFileName: fileNames[0],
|
||||||
data: result,
|
data: result,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user