diff --git a/src/views/spectrumAnalysis/beta-analysis.vue b/src/views/spectrumAnalysis/beta-analysis.vue index 32bad47..74d4bb6 100644 --- a/src/views/spectrumAnalysis/beta-analysis.vue +++ b/src/views/spectrumAnalysis/beta-analysis.vue @@ -11,13 +11,40 @@ QC Flags - + +
+
ROI1
+ + + + + +
+
+
ROI2
+ + + + + +
+
+
ROI3
+ + + + + +
+
+
ROI4
+ + + + + +
+
Update
@@ -28,22 +55,14 @@
- +
+ - +
@@ -53,12 +72,6 @@
-
@@ -81,6 +94,7 @@ import BetaGammaSpectrum from './components/BetaGammaSpectrum.vue' import RoiLimits from './components/RoiLimits.vue' import RoiParam from './components/RoiParam.vue' import axios from 'axios' +import store from '@/store/' import { getAction, postAction, deleteAction } from '../../api/manage' import { addSampleData, getSampleData } from '@/utils/SampleStore' const SampleType = [ @@ -121,18 +135,20 @@ export default { gammaEnergyData: [], betaEnergyData: [], ROILists: [], + ROIAnalyzeLists: [], roiParamList: [], boundaryList: [], sampleDetail: {}, qcFlags: {}, resultDisplay: [], currIdx: 0, + roiValues:[], + timerStamp: Date.now(), } }, watch: { sample: { async handler(newVal, oldVal) { - // this.resultDisplay = [] const sampleData = getSampleData(newVal.inputFileName) if (sampleData) { const { data, from } = sampleData @@ -157,7 +173,20 @@ export default { }, }, 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 = [ { sampleId: null, @@ -273,6 +302,10 @@ export default { this.roiParamList.splice(this.currIdx, 1, currRoiParam) this.boundaryList.splice(this.currIdx, 1, currBoundary) }, + reDrawRectOri(){ + this.$refs.betaChartRef.reDrawRect() + + }, getIndex(val) { this.currIdx = val }, @@ -380,7 +413,7 @@ export default { } }) }, - resize() {}, + resize() { }, }, destroyed() { this.cancelLastRequest() @@ -391,6 +424,7 @@ export default { \ No newline at end of file + +// 二级操作栏结束 \ No newline at end of file diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue index f7a0a97..d6428ef 100644 --- a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue +++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue @@ -6,7 +6,7 @@ Unzoom ROI - Update + Log
@@ -22,8 +22,8 @@
--> - - + + @@ -34,7 +34,7 @@ import ColorPalette from './ColorPalette.vue' import { getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper.js' import { putAction } from '../../../api/manage' import SampleDataMixin from '../SampleDataMixin' -const buttons = ['Beta-Gamma', 'Gamma', 'Beta'] +const buttons = ['Gamma', 'Beta'] // Beta-Gamma 的配置 const twoDOption = { grid: { @@ -389,6 +389,10 @@ export default { type: Array, default: () => [], }, + roiValues: { + type: Array, + default: () => [], + }, currIdx: { type: Number, }, @@ -433,7 +437,7 @@ export default { currIdx: { handler(newVal) { // this.boundaryData = this.boundary[newVal] - this.reDrawRect() + this.initDrawRectOri() }, // immediate: true, }, @@ -501,7 +505,7 @@ export default { data() { this.buttons = buttons return { - active: 0, + active: -1, twoDOption, dragOption, gammaOption, @@ -589,17 +593,29 @@ 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() { + console.log(this.roiValues) if (this.showROI) { // rect 遵循 左下 右下 右上 左上 左下 的顺序 const colors = ['#0CB4C1', '#1B88E5', '#43960C', '#D09324'] for (var i = 0; i < 4; i++) { const data = this.boundary[i] - if(data) - { - const rect = [[data.minX, data.minY], [data.maxX, data.minY], [data.maxX, data.maxY], [data.minX, data.maxY], [data.minX, data.minY],] - this.twoDOption.series[i + 1].data = this.drawOneRect(rect, colors[i]).data + if (this.roiValues.length > 7) { + var _minx = this.roiValues[i*2] + 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 } } // lineSeries2.data = this.drawOneRect(rect2, color2).data @@ -632,7 +648,6 @@ export default { this.twoDOption.yAxis.max = 4096 // this.emitRangeChange([0, 256, 0, 256]) - this.reDrawRect() this.buildScatterList() this.$nextTick(() => { const myChart = this.$refs.chartTwoDRef.getChartInstance() @@ -728,8 +743,6 @@ export default { }) // this.emitRangeChange([x1, x2, y1, y2]) - - // this.reDrawRect() } this.clearBrush(chart) @@ -750,7 +763,8 @@ export default { // 点击ROI handleROI() { this.showROI = !this.showROI - this.reDrawRect() + }, + handleLOG() { }, // 点击Update async handleUpdate() { @@ -784,7 +798,6 @@ export default { minY: 0, maxY: 4096, } - // this.reDrawRect() } else { this.$emit('update:isLoading', false) } @@ -816,6 +829,7 @@ export default { text-align: right; overflow: auto; height: 26px; + font-size: 16px; display: flex; justify-content: flex-end; gap: 9px; @@ -830,7 +844,8 @@ export default { text-align: center; height: 100%; line-height: 26px; - width: 100px; + min-width: 94px; + padding: 0 10px; background-color: #406979; cursor: pointer; user-select: none; diff --git a/src/views/spectrumAnalysis/components/RoiLimits.vue b/src/views/spectrumAnalysis/components/RoiLimits.vue index c28eec4..03a1ddf 100644 --- a/src/views/spectrumAnalysis/components/RoiLimits.vue +++ b/src/views/spectrumAnalysis/components/RoiLimits.vue @@ -1,273 +1,316 @@ \ No newline at end of file