Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
9231c26d32
|
@ -80,9 +80,13 @@ export class PHDParser {
|
|||
|
||||
// 如果解析的是sample 文件,则解析相关联的文件
|
||||
if (this.isSample) {
|
||||
if (this.fileType == 'B') {
|
||||
const filePrefixes = this.getFilePrefixes(headerInfo[2])
|
||||
this.sampleFilePrefix = filePrefixes.splice(0, 1)[0]
|
||||
this.otherFilePrefixes = filePrefixes
|
||||
} else {
|
||||
this.sampleFilePrefix = this.getGammaFilePrefix(headerInfo[2])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,7 +170,7 @@ export class PHDParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取全部文件名
|
||||
* 获取全部文件名前缀
|
||||
* @param {string} text
|
||||
*/
|
||||
getFilePrefixes(text) {
|
||||
|
@ -179,4 +183,15 @@ export class PHDParser {
|
|||
})
|
||||
return filePrefixes
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取gamma的文件名前缀
|
||||
* @param {string} text
|
||||
*/
|
||||
getGammaFilePrefix(text) {
|
||||
const regExp = /[A-Z]{1,}\d{1,}_\d{1,}-\d{4}\/\d{2}\/\d{2}[-\s]\d{2}:\d{2}/
|
||||
const result = text.match(regExp)
|
||||
const regExpDate = /(\d{4})\/(\d{2})\/(\d{2})[ -](\d{2}):(\d{2})/
|
||||
return result[0].replace(regExpDate, '$1$2$3_$4$5') + '_'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '../../api/manage'
|
||||
import { getAction, postAction } from '../../api/manage'
|
||||
import BetaGammaChartContainer from './components/BetaGammaChartContainer.vue'
|
||||
import BetaGammaSpectrumChart from './components/BetaGammaSpectrumChart.vue'
|
||||
import StatisticsParamerHistoryModalForQcFlags from './components/Modals/BetaGammaModals/StatisticsParamerHistoryModalForQCFlags.vue'
|
||||
|
@ -180,14 +180,15 @@ export default {
|
|||
sample: {
|
||||
type: Object,
|
||||
},
|
||||
analyseCurrentSpectrum: {
|
||||
type: Object,
|
||||
},
|
||||
// analyseCurrentSpectrum: {
|
||||
// type: Object,
|
||||
// },
|
||||
},
|
||||
data() {
|
||||
this.SampleType = SampleType
|
||||
|
||||
return {
|
||||
analyseCurrentSpectrum: {},
|
||||
qcFlags: {},
|
||||
|
||||
spectraVisible: false,
|
||||
|
@ -449,6 +450,58 @@ export default {
|
|||
this.betaEnergyData = energy
|
||||
}
|
||||
},
|
||||
// beta Analyze current spectrum 分析接口
|
||||
getAnalyzeCurrentSpectrum() {
|
||||
let params = {
|
||||
dbNames: [this.sample.dbName],
|
||||
sampleIds: [this.sample.sampleId ? this.sample.sampleId : ''],
|
||||
sampleFileNames: [this.sample.inputFileName],
|
||||
gasFileNames: [this.sample.gasFileName],
|
||||
detFileNames: [this.sample.detFileName],
|
||||
qcFileNames: [this.sample.qcFileName],
|
||||
}
|
||||
postAction('/spectrumAnalysis/analyseCurrentSpectrum', params).then((res) => {
|
||||
console.log('分析分析', res)
|
||||
if (res.success) {
|
||||
// this.isReAnalyed_beta = true
|
||||
this.analyseCurrentSpectrum = res.result
|
||||
res.result.XeData.forEach((item) => {
|
||||
item.conc = parseFloat(item.conc.toPrecision(6))
|
||||
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
||||
item.lc = parseFloat(item.lc.toPrecision(6))
|
||||
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
||||
})
|
||||
this.$emit('reAnalyCurr', true, res.result.XeData)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
getAnalyzeAllSpectrum() {
|
||||
let params = {
|
||||
dbNames: [this.sample.dbName],
|
||||
sampleIds: [this.sample.sampleId ? this.sample.sampleId : ''],
|
||||
sampleFileNames: [this.sample.inputFileName],
|
||||
gasFileNames: [this.sample.gasFileName],
|
||||
detFileNames: [this.sample.detFileName],
|
||||
qcFileNames: [this.sample.qcFileName],
|
||||
currentFileName: this.sample.inputFileName,
|
||||
}
|
||||
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
|
||||
if (res.success) {
|
||||
this.analyseCurrentSpectrum = res.result
|
||||
res.result.XeData.forEach((item) => {
|
||||
item.conc = parseFloat(item.conc.toPrecision(6))
|
||||
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
||||
item.lc = parseFloat(item.lc.toPrecision(6))
|
||||
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
||||
})
|
||||
this.$emit('reAnalyAll', true, res.result.XeData)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
sample: {
|
||||
|
@ -482,7 +535,7 @@ export default {
|
|||
this.$store.commit('UPDATE_SAMPLE_DATA', {
|
||||
inputFileName: this.sample.inputFileName,
|
||||
key: 'XeData',
|
||||
data: newVal.XeData
|
||||
data: newVal.XeData,
|
||||
})
|
||||
},
|
||||
immediate: true,
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<a-button type="primary" :disabled="isLoading" :loading="isAcceptting" @click="handlePeaks(true)">
|
||||
Peaks
|
||||
</a-button>
|
||||
<a-button>Cancel</a-button>
|
||||
<a-button @click="visible = false">Cancel</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</custom-modal>
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
</a-form-model>
|
||||
</div>
|
||||
<a-table
|
||||
ref="tableRef"
|
||||
:class="list.length ? 'has-data' : ''"
|
||||
:columns="columns"
|
||||
:dataSource="list"
|
||||
|
@ -77,9 +78,7 @@
|
|||
<!-- 以下是图表部分 -->
|
||||
<div class="nuclide-review-chart">
|
||||
<div class="nuclide-review-chart-prev">
|
||||
<span @click="handleChangeChart('prev')">
|
||||
<
|
||||
</span>
|
||||
<span @click="handleChangeChart('prev')"> < </span>
|
||||
</div>
|
||||
<a-row class="nuclide-review-chart-list">
|
||||
<a-col class="nuclide-review-chart-item" :span="8" v-for="(chartItem, index) in currChartList" :key="index">
|
||||
|
@ -94,9 +93,7 @@
|
|||
</a-col>
|
||||
</a-row>
|
||||
<div class="nuclide-review-chart-next">
|
||||
<span @click="handleChangeChart('next')">
|
||||
>
|
||||
</span>
|
||||
<span @click="handleChangeChart('next')"> > </span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 图表部分结束 -->
|
||||
|
@ -116,32 +113,32 @@ const columns = [
|
|||
width: '5%',
|
||||
customRender: (_, __, index) => {
|
||||
return index + 1
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Full Name',
|
||||
dataIndex: 'fullName',
|
||||
width: '15%'
|
||||
width: '15%',
|
||||
},
|
||||
{
|
||||
title: 'Energy',
|
||||
dataIndex: 'energy',
|
||||
width: '15%'
|
||||
width: '15%',
|
||||
},
|
||||
{
|
||||
title: 'Energy Err',
|
||||
dataIndex: 'energyUncert',
|
||||
width: '15%'
|
||||
width: '15%',
|
||||
},
|
||||
{
|
||||
title: 'Abundance(%)',
|
||||
dataIndex: 'yield',
|
||||
width: '15%'
|
||||
width: '15%',
|
||||
},
|
||||
{
|
||||
title: 'Abundance Err(%)',
|
||||
dataIndex: 'yieldUncert',
|
||||
width: '15%'
|
||||
width: '15%',
|
||||
},
|
||||
{
|
||||
title: 'KeyLine',
|
||||
|
@ -149,20 +146,20 @@ const columns = [
|
|||
width: '15%',
|
||||
align: 'center',
|
||||
scopedSlots: {
|
||||
customRender: 'keyLine'
|
||||
}
|
||||
}
|
||||
customRender: 'keyLine',
|
||||
},
|
||||
},
|
||||
]
|
||||
export default {
|
||||
components: { NuclideReviewChart },
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
channel: {
|
||||
type: Number
|
||||
type: Number,
|
||||
},
|
||||
nuclide: {
|
||||
type: String
|
||||
}
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
|
@ -177,13 +174,13 @@ export default {
|
|||
currChartList: [], // 当前展示的图表的列表,一般是3个
|
||||
|
||||
model: {},
|
||||
info: {}
|
||||
info: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 搜索栏的向前/向后按钮
|
||||
handleNuclideChange(direction) {
|
||||
const currIndex = this.nuclideList.findIndex(item => item == this.currNuclide)
|
||||
const currIndex = this.nuclideList.findIndex((item) => item == this.currNuclide)
|
||||
if (direction == 'prev' && currIndex > 0) {
|
||||
this.handleNuclideClick(currIndex - 1)
|
||||
} else if (direction == 'next' && currIndex !== this.nuclideList.length - 1) {
|
||||
|
@ -191,6 +188,13 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
scrollIntoView(index) {
|
||||
const tableEle = this.$refs.tableRef.$el
|
||||
const tableBodyEle = tableEle.querySelector('.ant-table-body')
|
||||
const prevEle = tableBodyEle.querySelector(`.ant-table-row:nth-child(${index + 1})`)
|
||||
tableBodyEle.scrollTop = prevEle.offsetTop
|
||||
},
|
||||
|
||||
// 左侧核素列表点击
|
||||
handleNuclideClick(index) {
|
||||
this.currNuclide = this.nuclideList[index]
|
||||
|
@ -226,15 +230,19 @@ export default {
|
|||
const willJumpIndex = currIndex - 3
|
||||
if (willJumpIndex >= 0) {
|
||||
this.selectTableRow(willJumpIndex)
|
||||
this.scrollIntoView(willJumpIndex)
|
||||
} else {
|
||||
this.selectTableRow(0)
|
||||
this.scrollIntoView(0)
|
||||
}
|
||||
} else if (direction == 'next') {
|
||||
const willJumpIndex = currIndex + 3
|
||||
if (willJumpIndex <= this.list.length - 2) {
|
||||
this.selectTableRow(willJumpIndex)
|
||||
this.scrollIntoView(willJumpIndex)
|
||||
} else {
|
||||
this.selectTableRow(this.list.length - 1)
|
||||
this.scrollIntoView(this.list.length - 1)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -246,8 +254,8 @@ export default {
|
|||
on: {
|
||||
click: () => {
|
||||
this.selectTableRow(index)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -259,12 +267,12 @@ export default {
|
|||
const { success, result, message } = await getAction('/gamma/nuclideReview', {
|
||||
sampleId: sampleId,
|
||||
channel: this.channel,
|
||||
fileName
|
||||
fileName,
|
||||
})
|
||||
if (success) {
|
||||
this.model = {
|
||||
energy: result.energy,
|
||||
tolerance: 0.5
|
||||
energy: result ? result.energy : undefined,
|
||||
tolerance: 0.5,
|
||||
}
|
||||
|
||||
this.handleResData(result)
|
||||
|
@ -284,7 +292,7 @@ export default {
|
|||
|
||||
// 处理返回的数据
|
||||
handleResData(result) {
|
||||
if(!result) {
|
||||
if (!result) {
|
||||
result = {
|
||||
chart: [],
|
||||
halfLife: null,
|
||||
|
@ -302,7 +310,7 @@ export default {
|
|||
halfLife,
|
||||
halfLifeErr,
|
||||
lines,
|
||||
name
|
||||
name,
|
||||
}
|
||||
|
||||
this.list = table
|
||||
|
@ -323,7 +331,7 @@ export default {
|
|||
const { success, result, message } = await getAction('/gamma/changeNuclide', {
|
||||
sampleId,
|
||||
nuclideName: this.currNuclide,
|
||||
fileName: inputFileName
|
||||
fileName: inputFileName,
|
||||
})
|
||||
if (success) {
|
||||
const { chart, halfLife, halfLifeErr, lines, name, table } = result
|
||||
|
@ -332,7 +340,7 @@ export default {
|
|||
halfLife,
|
||||
halfLifeErr,
|
||||
lines,
|
||||
name
|
||||
name,
|
||||
}
|
||||
|
||||
this.list = table
|
||||
|
@ -362,7 +370,7 @@ export default {
|
|||
const { success, result, message } = await getAction('/gamma/searchNuclide', {
|
||||
sampleId,
|
||||
fileName,
|
||||
...this.model
|
||||
...this.model,
|
||||
})
|
||||
if (success) {
|
||||
this.handleResData(result)
|
||||
|
@ -374,8 +382,8 @@ export default {
|
|||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@
|
|||
</a-upload>
|
||||
<a-button type="primary" @click="handleReset">Reset</a-button>
|
||||
<a-button :loading="isUploadingZip" type="primary" @click="handleLoad">Load</a-button>
|
||||
<a-button type="primary" @click="handleCancel">Cancel</a-button>
|
||||
<a-button type="warn" @click="handleCancel">Cancel</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<!-- 底部按钮结束 -->
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
ref="betaGammaAnalysisRef"
|
||||
@getFiles="getFiles"
|
||||
@sendInfo="getStationName"
|
||||
@reAnalyCurr="getReAnalyCurr"
|
||||
@reAnalyAll="getReAnalyAll"
|
||||
:sample="sampleData"
|
||||
:analyseCurrentSpectrum="analyseCurrentSpectrumData"
|
||||
/>
|
||||
|
@ -422,6 +424,13 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
getReAnalyCurr(flag, val) {
|
||||
this.isReAnalyed_beta = flag
|
||||
this.resultDisplayFlag = val
|
||||
},
|
||||
getReAnalyAll(val) {
|
||||
this.resultDisplayFlag = val
|
||||
},
|
||||
handleReAnalyed(val) {
|
||||
this.isReAnalyed_gamma = val
|
||||
},
|
||||
|
@ -709,57 +718,6 @@ export default {
|
|||
handleReanalyse(...data) {
|
||||
this.$refs.betaGammaAnalysisRef.reanalyse(data)
|
||||
},
|
||||
// beta Analyze current spectrum 分析接口
|
||||
getAnalyzeCurrentSpectrum() {
|
||||
let params = {
|
||||
dbNames: [this.newSampleData.dbName],
|
||||
sampleIds: [this.newSampleData.sampleId ? this.newSampleData.sampleId : ''],
|
||||
sampleFileNames: [this.newSampleData.inputFileName],
|
||||
gasFileNames: [this.newSampleData.gasFileName],
|
||||
detFileNames: [this.newSampleData.detFileName],
|
||||
qcFileNames: [this.newSampleData.qcFileName],
|
||||
}
|
||||
postAction('/spectrumAnalysis/analyseCurrentSpectrum', params).then((res) => {
|
||||
if (res.success) {
|
||||
this.isReAnalyed_beta = true
|
||||
this.analyseCurrentSpectrumData = res.result
|
||||
this.resultDisplayFlag = res.result.XeData
|
||||
this.resultDisplayFlag.forEach((item) => {
|
||||
item.conc = parseFloat(item.conc.toPrecision(6))
|
||||
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
||||
item.lc = parseFloat(item.lc.toPrecision(6))
|
||||
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
getAnalyzeAllSpectrum() {
|
||||
let params = {
|
||||
dbNames: [this.newSampleData.dbName],
|
||||
sampleIds: [this.newSampleData.sampleId ? this.newSampleData.sampleId : ''],
|
||||
sampleFileNames: [this.newSampleData.inputFileName],
|
||||
gasFileNames: [this.newSampleData.gasFileName],
|
||||
detFileNames: [this.newSampleData.detFileName],
|
||||
qcFileNames: [this.newSampleData.qcFileName],
|
||||
currentFileName: this.newSampleData.inputFileName,
|
||||
}
|
||||
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
|
||||
if (res.success) {
|
||||
this.analyseCurrentSpectrumData = res.result
|
||||
this.resultDisplayFlag = res.result.XeData
|
||||
this.resultDisplayFlag.forEach((item) => {
|
||||
item.conc = parseFloat(item.conc.toPrecision(6))
|
||||
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
||||
item.lc = parseFloat(item.lc.toPrecision(6))
|
||||
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEnergyCalib() {
|
||||
if (this.newSampleData.sampleId) {
|
||||
if (this.newSampleData.qcFileName) {
|
||||
|
@ -998,7 +956,8 @@ export default {
|
|||
title: 'Analyze current spectrum',
|
||||
show: this.isBetaGamma,
|
||||
handler: () => {
|
||||
this.getAnalyzeCurrentSpectrum()
|
||||
// this.getAnalyzeCurrentSpectrum()
|
||||
this.$refs.betaGammaAnalysisRef.getAnalyzeCurrentSpectrum()
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -1006,7 +965,8 @@ export default {
|
|||
title: 'Analyze all spectra',
|
||||
show: this.isBetaGamma,
|
||||
handler: () => {
|
||||
this.getAnalyzeAllSpectrum()
|
||||
// this.getAnalyzeAllSpectrum()
|
||||
this.$refs.betaGammaAnalysisRef.getAnalyzeAllSpectrum()
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue
Block a user