Merge branch 'feature-Beta-dev-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into feature-Beta-dev-renpy

This commit is contained in:
xiaoguangbin 2024-07-22 08:49:30 +08:00
commit a445338e75
3 changed files with 438 additions and 293 deletions

View File

@ -11,13 +11,40 @@
QC Flags QC Flags
<beta-gamma-qc-flags slot="content" :data="qcFlags" @click="handleQcFlagClick" /> <beta-gamma-qc-flags slot="content" :data="qcFlags" @click="handleQcFlagClick" />
</pop-over-with-icon> </pop-over-with-icon>
<custom-select <custom-select v-model="spectraType" :options="SampleType" @change="changeChartByType" style="width: 246px" class="sample-select"></custom-select>
v-model="spectraType" <div class="spectrum-analysis-sub-operators-roi">
:options="SampleType" <div class="spectrum-analysis-sub-operators-roi-name">ROI1</div>
@change="changeChartByType" <a-input-group>
style="width: 246px" <a-input v-model:value="roiValues[0]" class="spectrum-analysis-sub-operators-roi-input" placeholder="Beta1" />
class="sample-select" <a-input class="spectrum-analysis-sub-operators-roi-split site-input-split" placeholder="," disabled />
></custom-select> <a-input v-model:value="roiValues[1]" class="spectrum-analysis-sub-operators-roi-input site-input-right" placeholder="Beta2" />
</a-input-group>
</div>
<div class="spectrum-analysis-sub-operators-roi">
<div class="spectrum-analysis-sub-operators-roi-name">ROI2</div>
<a-input-group>
<a-input v-model:value="roiValues[2]" class="spectrum-analysis-sub-operators-roi-input" placeholder="Beta1" />
<a-input class="spectrum-analysis-sub-operators-roi-split site-input-split" placeholder="," disabled />
<a-input v-model:value="roiValues[3]" class="spectrum-analysis-sub-operators-roi-input site-input-right" placeholder="Beta2" />
</a-input-group>
</div>
<div class="spectrum-analysis-sub-operators-roi">
<div class="spectrum-analysis-sub-operators-roi-name">ROI3</div>
<a-input-group>
<a-input v-model:value="roiValues[4]" class="spectrum-analysis-sub-operators-roi-input" placeholder="Beta1" />
<a-input class="spectrum-analysis-sub-operators-roi-split site-input-split" placeholder="," disabled />
<a-input v-model:value="roiValues[5]" class="spectrum-analysis-sub-operators-roi-input site-input-right" placeholder="Beta2" />
</a-input-group>
</div>
<div class="spectrum-analysis-sub-operators-roi">
<div class="spectrum-analysis-sub-operators-roi-name">ROI4</div>
<a-input-group>
<a-input v-model:value="roiValues[6]" class="spectrum-analysis-sub-operators-roi-input" placeholder="Beta1" />
<a-input class="spectrum-analysis-sub-operators-roi-split site-input-split" placeholder="," disabled />
<a-input v-model:value="roiValues[7]" class="spectrum-analysis-sub-operators-roi-input site-input-right" placeholder="Beta2" />
</a-input-group>
</div>
<div class="spectrum-analysis-sub-operators-button" @click="reDrawRectOri">Update</div>
</div> </div>
<!-- 二级交互栏结束 --> <!-- 二级交互栏结束 -->
@ -28,22 +55,14 @@
<div class="beta-gamma-analysis-main-charts-left"> <div class="beta-gamma-analysis-main-charts-left">
<beta-gamma-chart-container> <beta-gamma-chart-container>
<template slot="title"> Beta-Gamma Spectrum: {{ currSpectrum }} </template> <template slot="title"> Beta-Gamma Spectrum: {{ currSpectrum }} </template>
<beta-gamma-spectrum <beta-gamma-spectrum ref="betaChartRef" :betaEnergyData="betaEnergyData" :roiValues="roiValues" :gammaEnergyData="gammaEnergyData" :histogramDataList="histogramDataList" :boundary="boundaryList" :isLoading.sync="isLoading" :currIdx="currIdx" @refreshRoi="refreshRoi" />
ref="betaChartRef"
:betaEnergyData="betaEnergyData"
:gammaEnergyData="gammaEnergyData"
:histogramDataList="histogramDataList"
:boundary="boundaryList"
:isLoading.sync="isLoading"
:currIdx="currIdx"
@refreshRoi="refreshRoi"
/>
</beta-gamma-chart-container> </beta-gamma-chart-container>
</div> </div>
<div class="beta-gamma-analysis-main-charts-right"> <div class="beta-gamma-analysis-main-charts-right">
<beta-gamma-chart-container> <beta-gamma-chart-container>
<template slot="title"> ROI LIMITS </template> <template slot="title"> ROI LIMITS </template>
<roi-limits ref="RoiChartRef" :ROILists="ROILists" :gammaEnergyData="gammaEnergyData" /> <roi-limits ref="RoiChartRef" :ROILists="ROILists" :ROIAnalyzeLists="ROIAnalyzeLists" :gammaEnergyData="gammaEnergyData" />
</beta-gamma-chart-container> </beta-gamma-chart-container>
<!-- 底部显示 --> <!-- 底部显示 -->
<div class="beta-gamma-analysis-main-bottom"> <div class="beta-gamma-analysis-main-bottom">
@ -53,12 +72,6 @@
<result-display-beta :data="resultDisplay" @sendFlag="handleGetFlag"></result-display-beta> <result-display-beta :data="resultDisplay" @sendFlag="handleGetFlag"></result-display-beta>
</beta-gamma-chart-container> </beta-gamma-chart-container>
</div> </div>
<!-- <div class="beta-gamma-analysis-main-bottom-right">
<beta-gamma-chart-container>
<template slot="title"> ROI Param </template>
<roi-param :roiParamList="roiParamList" />
</beta-gamma-chart-container>
</div> -->
</div> </div>
<!-- 底部显示结束 --> <!-- 底部显示结束 -->
</div> </div>
@ -81,6 +94,7 @@ import BetaGammaSpectrum from './components/BetaGammaSpectrum.vue'
import RoiLimits from './components/RoiLimits.vue' import RoiLimits from './components/RoiLimits.vue'
import RoiParam from './components/RoiParam.vue' import RoiParam from './components/RoiParam.vue'
import axios from 'axios' import axios from 'axios'
import store from '@/store/'
import { getAction, postAction, deleteAction } from '../../api/manage' import { getAction, postAction, deleteAction } from '../../api/manage'
import { addSampleData, getSampleData } from '@/utils/SampleStore' import { addSampleData, getSampleData } from '@/utils/SampleStore'
const SampleType = [ const SampleType = [
@ -121,18 +135,20 @@ export default {
gammaEnergyData: [], gammaEnergyData: [],
betaEnergyData: [], betaEnergyData: [],
ROILists: [], ROILists: [],
ROIAnalyzeLists: [],
roiParamList: [], roiParamList: [],
boundaryList: [], boundaryList: [],
sampleDetail: {}, sampleDetail: {},
qcFlags: {}, qcFlags: {},
resultDisplay: [], resultDisplay: [],
currIdx: 0, currIdx: 0,
roiValues:[],
timerStamp: Date.now(),
} }
}, },
watch: { watch: {
sample: { sample: {
async handler(newVal, oldVal) { async handler(newVal, oldVal) {
// this.resultDisplay = []
const sampleData = getSampleData(newVal.inputFileName) const sampleData = getSampleData(newVal.inputFileName)
if (sampleData) { if (sampleData) {
const { data, from } = sampleData const { data, from } = sampleData
@ -157,7 +173,20 @@ export default {
}, },
}, },
methods: { methods: {
getAnalyzeCurrentSpectrum() { async getAnalyzeCurrentSpectrum() {
const { inputFileName, detFileName } = this.sample
var userId = store.getters.userInfo.id
const { success, result, message } = await postAction(`/selfStation/Reprocessing?fileName=${inputFileName}&processKey=${userId}_${this.timerStamp}`)
console.log(userId,success, result, message)
if(success){
var _result = []
_result.push(result.ROI1)
_result.push(result.ROI2)
_result.push(result.ROI3)
_result.push(result.ROI4)
this.ROIAnalyzeLists = _result
}
let XeData = [ let XeData = [
{ {
sampleId: null, sampleId: null,
@ -273,6 +302,10 @@ export default {
this.roiParamList.splice(this.currIdx, 1, currRoiParam) this.roiParamList.splice(this.currIdx, 1, currRoiParam)
this.boundaryList.splice(this.currIdx, 1, currBoundary) this.boundaryList.splice(this.currIdx, 1, currBoundary)
}, },
reDrawRectOri(){
this.$refs.betaChartRef.reDrawRect()
},
getIndex(val) { getIndex(val) {
this.currIdx = val this.currIdx = val
}, },
@ -381,7 +414,7 @@ export default {
} }
}) })
}, },
resize() {}, resize() { },
}, },
destroyed() { destroyed() {
this.cancelLastRequest() this.cancelLastRequest()
@ -392,6 +425,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.beta-gamma-analysis { .beta-gamma-analysis {
height: 100%; height: 100%;
.ant-spin-nested-loading { .ant-spin-nested-loading {
height: 100%; height: 100%;
@ -401,6 +435,7 @@ export default {
} }
} }
} }
.sample-select { .sample-select {
::v-deep { ::v-deep {
.ant-select-selection { .ant-select-selection {
@ -409,37 +444,45 @@ export default {
} }
} }
} }
&-main { &-main {
height: calc(100% - 55px); height: calc(100% - 55px);
overflow: auto hidden; overflow: auto hidden;
&-charts { &-charts {
height: 100% ; height: 100%;
display: flex; display: flex;
gap: 30px; gap: 30px;
overflow: auto hidden; overflow: auto hidden;
&-left { &-left {
flex: 1; width: 790px;
} }
&-right { &-right {
flex: 1; flex: 1;
.betagamma-chart{
height: calc(100% - 260px); .betagamma-chart {
height: calc(100% - 200px);
} }
} }
} }
&-bottom { &-bottom {
margin-top: 20px; height: 194px;
height: 234px;
overflow: auto hidden; overflow: auto hidden;
&-left { &-left {
flex: 1; flex: 1;
} }
&-right { &-right {
flex: 1; flex: 1;
} }
} }
} }
} }
// //
.spectrum-analysis-sub-operators { .spectrum-analysis-sub-operators {
flex-shrink: 0; flex-shrink: 0;
@ -463,6 +506,48 @@ export default {
width: 125px; width: 125px;
} }
} }
&-roi {
display: flex;
&-name {
padding: 5px 10px;
}
&-input {
width: 80px;
text-align: center;
}
&-input:not(.site-input-right) {
border-right: 0;
}
&-input.site-input-right {
border-left: 0;
}
&-split {
width: 5px;
padding: 0;
border-left: 0;
border-right: 0;
pointer-events: none;
background-color: #03353f;
}
}
&-button{
text-align: center;
height: 32px;
line-height: 32px;
min-width: 94px;
padding: 0 10px;
font-size: 16px;
margin-left: 16px;
background-color: #406979;
cursor: pointer;
}
} }
//
</style> // </style>

View File

@ -6,7 +6,7 @@
</span> </span>
<span @click="handleUnzoom">Unzoom</span> <span @click="handleUnzoom">Unzoom</span>
<span @click="handleROI">ROI</span> <span @click="handleROI">ROI</span>
<span @click="handleUpdate">Update</span> <span @click="handleLOG">Log</span>
</div> </div>
<div class="beta-gamma-spectrum-chart-main"> <div class="beta-gamma-spectrum-chart-main">
<!-- 2D 图表为了相应Unzoom采用的v-show --> <!-- 2D 图表为了相应Unzoom采用的v-show -->
@ -22,8 +22,8 @@
</div> --> </div> -->
</div> </div>
<!-- 2D图表结束 --> <!-- 2D图表结束 -->
<CustomChart v-if="active == 1" key="1" ref="gammaLineChartRef" :option="gammaOption" /> <CustomChart v-if="active == 0" key="1" ref="gammaLineChartRef" :option="gammaOption" />
<CustomChart v-if="active == 2" key="2" ref="betaLineChartRef" :option="betaOption" /> <CustomChart v-if="active == 1" key="2" ref="betaLineChartRef" :option="betaOption" />
</div> </div>
</div> </div>
</template> </template>
@ -34,7 +34,7 @@ import ColorPalette from './ColorPalette.vue'
import { getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper.js' import { getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper.js'
import { putAction } from '../../../api/manage' import { putAction } from '../../../api/manage'
import SampleDataMixin from '../SampleDataMixin' import SampleDataMixin from '../SampleDataMixin'
const buttons = ['Beta-Gamma', 'Gamma', 'Beta'] const buttons = ['Gamma', 'Beta']
// Beta-Gamma // Beta-Gamma
const twoDOption = { const twoDOption = {
grid: { grid: {
@ -389,6 +389,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
roiValues: {
type: Array,
default: () => [],
},
currIdx: { currIdx: {
type: Number, type: Number,
}, },
@ -433,7 +437,7 @@ export default {
currIdx: { currIdx: {
handler(newVal) { handler(newVal) {
// this.boundaryData = this.boundary[newVal] // this.boundaryData = this.boundary[newVal]
this.reDrawRect() this.initDrawRectOri()
}, },
// immediate: true, // immediate: true,
}, },
@ -501,7 +505,7 @@ export default {
data() { data() {
this.buttons = buttons this.buttons = buttons
return { return {
active: 0, active: -1,
twoDOption, twoDOption,
dragOption, dragOption,
gammaOption, gammaOption,
@ -589,16 +593,28 @@ export default {
// }, // },
} }
}, },
initDrawRectOri() {
for (var i = 0; i < 4; i++) {
const data = this.boundary[i]
if (data) {
this.$set(this.roiValues, i * 2, data.minX);
this.$set(this.roiValues, i * 2 + 1, data.maxX);
}
}
this.reDrawRect();
},
// //
reDrawRect() { reDrawRect() {
console.log(this.roiValues)
if (this.showROI) { if (this.showROI) {
// rect // rect
const colors = ['#0CB4C1', '#1B88E5', '#43960C', '#D09324'] const colors = ['#0CB4C1', '#1B88E5', '#43960C', '#D09324']
for (var i = 0; i < 4; i++) { for (var i = 0; i < 4; i++) {
const data = this.boundary[i] const data = this.boundary[i]
if(data) if (this.roiValues.length > 7) {
{ var _minx = this.roiValues[i*2]
const rect = [[data.minX, data.minY], [data.maxX, data.minY], [data.maxX, data.maxY], [data.minX, data.maxY], [data.minX, data.minY],] var _maxX = this.roiValues[i*2+1]
const rect = [[_minx, data.minY], [_maxX, data.minY], [_maxX, data.maxY], [_minx, data.maxY], [_minx, data.minY],]
this.twoDOption.series[i + 1].data = this.drawOneRect(rect, colors[i]).data this.twoDOption.series[i + 1].data = this.drawOneRect(rect, colors[i]).data
} }
} }
@ -632,7 +648,6 @@ export default {
this.twoDOption.yAxis.max = 4096 this.twoDOption.yAxis.max = 4096
// this.emitRangeChange([0, 256, 0, 256]) // this.emitRangeChange([0, 256, 0, 256])
this.reDrawRect()
this.buildScatterList() this.buildScatterList()
this.$nextTick(() => { this.$nextTick(() => {
const myChart = this.$refs.chartTwoDRef.getChartInstance() const myChart = this.$refs.chartTwoDRef.getChartInstance()
@ -728,8 +743,6 @@ export default {
}) })
// this.emitRangeChange([x1, x2, y1, y2]) // this.emitRangeChange([x1, x2, y1, y2])
// this.reDrawRect()
} }
this.clearBrush(chart) this.clearBrush(chart)
@ -750,7 +763,8 @@ export default {
// ROI // ROI
handleROI() { handleROI() {
this.showROI = !this.showROI this.showROI = !this.showROI
this.reDrawRect() },
handleLOG() {
}, },
// Update // Update
async handleUpdate() { async handleUpdate() {
@ -784,7 +798,6 @@ export default {
minY: 0, minY: 0,
maxY: 4096, maxY: 4096,
} }
// this.reDrawRect()
} else { } else {
this.$emit('update:isLoading', false) this.$emit('update:isLoading', false)
} }
@ -816,6 +829,7 @@ export default {
text-align: right; text-align: right;
overflow: auto; overflow: auto;
height: 26px; height: 26px;
font-size: 16px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 9px; gap: 9px;
@ -830,7 +844,8 @@ export default {
text-align: center; text-align: center;
height: 100%; height: 100%;
line-height: 26px; line-height: 26px;
width: 100px; min-width: 94px;
padding: 0 10px;
background-color: #406979; background-color: #406979;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;

View File

@ -4,16 +4,16 @@
<div class="beta-gamma-spectrum-chart-operators" ref="operatorsRef"> <div class="beta-gamma-spectrum-chart-operators" ref="operatorsRef">
<a-row> <a-row>
<a-col :span="4"> <a-col :span="4">
<div :style="{ background: colors[index], width: '80px', marginLeft: '60px', textAlign: 'center' }">{{ item }}</div> <div :style="{ background: colors[index] }" class="beta-gamma-spectrum-chart-operators-button">{{ item }}</div>
</a-col> </a-col>
<a-col :span="20"> <a-col :span="20">
<div style="float: right;width: 40px;"> <div style="float: right;width: 40px;">
<img v-show="!ismax[index]" src="@/assets/maximize.png" @click="maximize(true, index)" /> <img v-show="!ismax[index]" src="@/assets/maximize.png" @click="maximize(true, index)" />
<img v-show="ismax[index]" src="@/assets/normal.png" @click="maximize(false, index)" /> <img v-show="ismax[index]" src="@/assets/normal.png" @click="maximize(false, index)" />
</div> </div>
<div style="float: right;color:#AD4140;width: 150px;">{{ 'Ener gy:' + eValue[index] }}</div> <div style="float: right;color:#AD4140;width: 120px;">{{ 'Energy:' + eValue[index] }}</div>
<div style="float: right;color:#8EC0C8;width: 100px;">{{ 'Count:' + yValue[index] }}</div> <div style="float: right;color:#8EC0C8;width: 80px;">{{ 'Count:' + yValue[index] }}</div>
<div style="float: right;color:#8EC0C8;width: 120px;">{{ 'Channel:' + xValue[index] }}</div> <div style="float: right;color:#8EC0C8;width: 95px;">{{ 'Channel:' + xValue[index] }}</div>
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
@ -28,6 +28,7 @@
import CustomChart from '@/components/CustomChart/index.vue' import CustomChart from '@/components/CustomChart/index.vue'
const buttons = ['ROI1', 'ROI2', 'ROI3', 'ROI4'] const buttons = ['ROI1', 'ROI2', 'ROI3', 'ROI4']
const colors = ['#0CB4C1', '#1B88E5', '#43960C', '#D09324'] const colors = ['#0CB4C1', '#1B88E5', '#43960C', '#D09324']
// 线 // 线
export default { export default {
components: { components: {
@ -38,6 +39,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
ROIAnalyzeLists: {
type: Array,
default: () => [],
},
gammaEnergyData: { gammaEnergyData: {
type: Array, type: Array,
default: () => [], default: () => [],
@ -51,6 +56,13 @@ export default {
}, },
immediate: true, immediate: true,
}, },
ROIAnalyzeLists: {
handler(newVal) {
this.newAnalyzeVal = newVal
this.buildAnalyzeList()
},
immediate: false,
},
}, },
beforeDestroy() { beforeDestroy() {
// const myChart = this.$refs.roiLimitsRef.getChartInstance() // const myChart = this.$refs.roiLimitsRef.getChartInstance()
@ -65,7 +77,7 @@ export default {
yValue: ['', '', '', ''], yValue: ['', '', '', ''],
eValue: ['', '', '', ''], eValue: ['', '', '', ''],
ismax: [false, false, false, false], ismax: [false, false, false, false],
ismaxed:false, ismaxed: false,
roiLimitsOptions: [ roiLimitsOptions: [
this.createRoiLimitsOption(0), this.createRoiLimitsOption(0),
this.createRoiLimitsOption(1), this.createRoiLimitsOption(1),
@ -74,6 +86,7 @@ export default {
], ],
charts: [], charts: [],
newVal: [], newVal: [],
newAnalyzeVal: [],
opts: { opts: {
notMerge: true, notMerge: true,
}, },
@ -90,10 +103,33 @@ export default {
} }
} }
}, },
buildAnalyzeList() {
for (var i = 0; i < 4; i++) {
var val = this.newAnalyzeVal[i].allData
var newseries = []
var _series = this.roiLimitsOptions[i].series
newseries.push(_series)
val.forEach(item => {
if (item.name != 'Count') {
var _ser = {
type: 'line',
data: item.pointlist.map((item) => [item.x, item.y]),
color: item.color,
symbol: 'none'
}
newseries.push(_ser)
}
})
this.roiLimitsOptions[i].series = newseries
}
},
handleTooltipFormat(params, index) { handleTooltipFormat(params, index) {
if (Number.isInteger(params[0].value[0])) {
this.$set(this.xValue, index, params[0].value[0]); this.$set(this.xValue, index, params[0].value[0]);
this.$set(this.yValue, index, params[0].value[1]); this.$set(this.yValue, index, params[0].value[1]);
this.$set(this.eValue, index, this.gammaEnergyData[params[0].value[0]].toFixed(3)); this.$set(this.eValue, index, this.gammaEnergyData[params[0].value[0]].toFixed(3));
}
}, },
maximize(bl, index) { maximize(bl, index) {
this.$set(this.ismax, index, bl); this.$set(this.ismax, index, bl);
@ -124,25 +160,27 @@ export default {
trigger: 'axis', trigger: 'axis',
formatter: (params) => { formatter: (params) => {
self.handleTooltipFormat(params, index) self.handleTooltipFormat(params, index)
let content = '' // let content = ''
params.forEach((item) => { // params.forEach((item) => {
// // //
content += ` // content += `
<!-- 圆点样式 --> // <!-- -->
<span style="color: #424864;">Channel ${item.axisValueLabel}</span><br> // <span style="color: #424864;">Channel ${item.axisValueLabel}</span><br>
<span style="display: inline-block; margin-right: 10px; border-radius: 50%; width: 8px; height: 8px;background-color: ${item.color};"></span> // <span style="display: inline-block; margin-right: 10px; border-radius: 50%; width: 8px; height: 8px;background-color: ${item.color};"></span>
<span >${item.value[1]}</span> // <span >${item.value[1]}</span>
` // `
}) // })
return content // return content
}, },
}, },
xAxis: { xAxis: {
type: 'category', type: 'value',
min:0,
max:4096,
name: 'Gamma Channel', name: 'Gamma Channel',
nameTextStyle: { nameTextStyle: {
color: '#5b9cba', color: '#5b9cba',
fontSize: 16, fontSize: 14,
}, },
nameLocation: 'center', nameLocation: 'center',
nameGap: 30, nameGap: 30,
@ -172,7 +210,7 @@ export default {
name: 'Count', name: 'Count',
nameTextStyle: { nameTextStyle: {
color: '#5b9cba', color: '#5b9cba',
fontSize: 16, fontSize: 14,
}, },
nameLocation: 'center', nameLocation: 'center',
nameGap: 40, nameGap: 40,
@ -230,6 +268,13 @@ export default {
&-operators { &-operators {
overflow: auto; overflow: auto;
margin-bottom: -16px; margin-bottom: -16px;
font-size: 13px;
&-button {
width: 50px;
margin-left: 60px;
text-align: center;
}
.ant-space-item:first-child { .ant-space-item:first-child {
span { span {