diff --git a/src/components/CustomChart/index.vue b/src/components/CustomChart/index.vue
index 6fea3e9..c38f28c 100644
--- a/src/components/CustomChart/index.vue
+++ b/src/components/CustomChart/index.vue
@@ -6,7 +6,7 @@ import * as echarts from 'echarts'
import 'echarts-gl'
const events = ['click', 'brushEnd']
-const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click']
+const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick']
export default {
props: {
option: {
diff --git a/src/components/CustomModal/index.vue b/src/components/CustomModal/index.vue
index 6927dc4..a463199 100644
--- a/src/components/CustomModal/index.vue
+++ b/src/components/CustomModal/index.vue
@@ -63,8 +63,10 @@ export default {
if (this.okHandler instanceof Function) {
try {
this.confirmLoading = true
- await this.okHandler()
- this.visible = false
+ const success = await this.okHandler()
+ if(success !== false) {
+ this.visible = false
+ }
} catch (error) {
console.error(error)
} finally {
diff --git a/src/utils/chartHelper.js b/src/utils/chartHelper.js
index 6560aae..e6cb5f0 100644
--- a/src/utils/chartHelper.js
+++ b/src/utils/chartHelper.js
@@ -104,4 +104,14 @@ export function rangeNumber(min, max) {
return num => {
return num > max ? max : num < min ? min : num
}
+}
+
+/**
+ * 获取图表某条轴线的最大值
+ * @param {import("echarts").ECharts} chartInstance
+ * @param {'xAxis' | 'yAxis'} axis
+ * @returns
+ */
+export function getAxisMax(chartInstance, axis) {
+ return chartInstance.getModel().getComponent(axis).axis.scale._extent[1]
}
\ No newline at end of file
diff --git a/src/utils/number.js b/src/utils/number.js
new file mode 100644
index 0000000..19df3b6
--- /dev/null
+++ b/src/utils/number.js
@@ -0,0 +1,10 @@
+import { isNullOrUndefined } from './util'
+
+/**
+ * 保留小数
+ * @param { string | number } num 数字
+ * @param { number } digit 保留位数
+ */
+export const toFixed = (num, digit) => {
+ return isNullOrUndefined(num) ? '' : Number(num).toFixed(digit)
+}
diff --git a/src/views/spectrumAnalysis/beta-gamma-analysis.vue b/src/views/spectrumAnalysis/beta-gamma-analysis.vue
index b34e983..9eb80fb 100644
--- a/src/views/spectrumAnalysis/beta-gamma-analysis.vue
+++ b/src/views/spectrumAnalysis/beta-gamma-analysis.vue
@@ -16,6 +16,7 @@
:options="SampleType"
@change="changeChartByType"
style="width: 246px"
+ class="sample-select"
>
@@ -437,6 +438,15 @@ export default {
}
}
+ .sample-select {
+ ::v-deep {
+ .ant-select-selection {
+ background-color: transparent !important;
+ color: #ade6ee;
+ }
+ }
+ }
+
&-main {
height: calc(100% - 51px);
display: flex;
diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue
index d00bc10..3dc5eff 100644
--- a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue
+++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue
@@ -358,6 +358,8 @@ export default {
this.emitRangeChange([0, 256, 0, 256])
this.reDrawRect()
+
+ this.rangeScatter()
},
// 点击ROI
@@ -409,7 +411,8 @@ export default {
// 改为不可刷选状态
chart.dispatchAction({
- type: 'takeGlobalCursor'
+ type: 'takeGlobalCursor',
+ rushOption: false
})
},
@@ -436,11 +439,29 @@ export default {
this.emitRangeChange([x1, x2, y1, y2])
this.reDrawRect()
+
+ this.rangeScatter()
}
this.clearBrush(chart)
},
+ /**
+ * 因scatterGL 不受axis中max和min的控制,手动处理溢出部分
+ */
+ rangeScatter() {
+ const {
+ xAxis: { min: minX, max: maxX },
+ yAxis: { min: minY, max: maxY }
+ } = this.twoDOption
+
+ const data = this.histogramDataList
+ .filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY)
+ .map(({ b, g, c }) => [b, g, c])
+
+ this.twoDOption.series.data = data
+ },
+
// 通知上层范围改变
emitRangeChange(range) {
this.$emit('rangeChange', range)
@@ -462,6 +483,7 @@ export default {
}
this.reDrawRect()
+ this.rangeScatter()
},
// 重绘矩形框区域
@@ -705,6 +727,7 @@ export default {
handler(newVal) {
this.active = 0
this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 设置2D Scatter数据
+ this.rangeScatter()
},
immediate: true
},
diff --git a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue
index 40e8b85..88d85dd 100644
--- a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue
+++ b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue
@@ -407,6 +407,12 @@ const thumbnailOption = {
series: null
}
+const nuclideIdentifyModal = {
+ possibleNuclide: '',
+ tolerance: 0.5,
+ identifiedNuclide: ''
+}
+
// 操作类型
export const Operators = {
ADD: 1, // 新增
@@ -442,6 +448,7 @@ export default {
energy: [],
list: [],
BaseCtrls: {},
+ FitBaseLine: '#fff',
sampleId: -1,
peakCommentModalVisible: false, // Comment 弹窗是否显示
@@ -454,11 +461,7 @@ export default {
fitPeaksAndBaselineModalVisible: false, // Fit Peaks And Base Line 弹窗
nuclideReviewModalVisible: false, // Nuclide Review 弹窗
- model: {
- possibleNuclide: '',
- tolerance: 0.5,
- identifiedNuclide: ''
- },
+ model: cloneDeep(nuclideIdentifyModal),
currChannel: undefined, // 当currChannel前选中的channel
selectedTableItem: undefined, // 当前选中的表格项
@@ -483,6 +486,9 @@ export default {
try {
this.isLoading = true
this.option.series = []
+ this.thumbnailOption.series = []
+ this.list = []
+ this.model = cloneDeep(nuclideIdentifyModal)
const { success, result, message } = await getAction('/gamma/InteractiveTool', {
sampleId: this.sampleId,
@@ -501,7 +507,8 @@ export default {
channelPeakChart,
energy,
table,
- BaseCtrls
+ BaseCtrls,
+ FitBaseLine
} = result
console.log('%c [ ]-374', 'font-size:13px; background:pink; color:#bf2c9f;', result)
@@ -512,6 +519,7 @@ export default {
this.channelPeakChart = channelPeakChart
this.energy = energy
this.BaseCtrls = BaseCtrls
+ this.FitBaseLine = FitBaseLine
const series = []
@@ -1246,7 +1254,7 @@ export default {
const baseLineEditSeries = buildLineSeries(
'BaseLine_Edit',
this._channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]),
- '#fff',
+ this.FitBaseLine,
{
zlevel: 21
}
@@ -1296,6 +1304,8 @@ export default {
buildGraphicRect(xAxis, yAxis) {
const chart = this.$refs.chartRef.getChartInstance()
const [xPix, yPix] = chart.convertToPixel('grid', [xAxis, yAxis])
+ const that = this
+
return {
type: 'rect',
id: Math.random().toString(),
@@ -1312,12 +1322,12 @@ export default {
fill: 'transparent',
lineWidth: 2
},
- draggable: false,
+ draggable: this.isModifying,
ondrag: function() {
const [xPixel] = chart.convertToPixel('grid', [xAxis, yAxis])
// 保持x轴不变
this.position[0] = xPixel
- this.redrawBaseLine()
+ that.redrawBaseLine()
},
ondragend: ({ offsetY }) => {
this.setGraphicDraggable(false)
@@ -1351,7 +1361,7 @@ export default {
// 重新生成基线
redrawBaseLine() {
- console.log('%c [ 重新生成基线 ]-1355', 'font-size:13px; background:pink; color:#bf2c9f;', )
+ console.log('%c [ 重新生成基线 ]-1355', 'font-size:13px; background:pink; color:#bf2c9f;')
},
// 根据数据绘制 + 号
@@ -1472,7 +1482,7 @@ export default {
// 修改控制点
handleModifyCP() {
- this.setGraphicDraggable(true)
+ this.setGraphicDraggable(!this.isModifying)
},
// 编辑斜率
@@ -1560,7 +1570,7 @@ export default {
this.channelBaseCPChart = this._channelBaseCPChart
this.handleSwitchOperation()
-
+
this.$bus.$emit('accept')
},
diff --git a/src/views/spectrumAnalysis/components/Modals/AnalyzeSettingModal.vue b/src/views/spectrumAnalysis/components/Modals/AnalyzeSettingModal.vue
index dca474c..cc39cab 100644
--- a/src/views/spectrumAnalysis/components/Modals/AnalyzeSettingModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/AnalyzeSettingModal.vue
@@ -13,44 +13,40 @@
-
+
-
+
-
+
-
- Update Calibration
-
+ Update Calibration
-
- Keep Calibration Peak Search Peaks
-
+ Keep Calibration Peak Search Peaks
@@ -61,13 +57,13 @@
-
+
-
+
-
+
@@ -75,12 +71,12 @@
-
+
-
+
@@ -90,10 +86,20 @@
-
+
-
+
@@ -106,10 +112,11 @@
@@ -198,7 +256,7 @@ export default {
display: flex;
align-items: center;
- .ant-input-number {
+ .ant-input {
margin-right: 10px;
}
}
diff --git a/src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue b/src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue
index bdff574..bcda351 100644
--- a/src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue
@@ -1,5 +1,5 @@
-
+
{{ content }}
@@ -112,7 +112,7 @@ export default {
diff --git a/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue
index c018bf4..8b94e10 100644
--- a/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue
@@ -44,7 +44,7 @@
:pagination="false"
size="small"
:class="list.length ? 'has-data' : ''"
- :scroll="{ y: 182 }"
+ :scroll="{ y: 193 }"
:selectedRowKeys.sync="selectedRowKeys"
:canDeselect="false"
@rowClick="handleRowClick"
@@ -52,7 +52,16 @@
@@ -107,7 +116,7 @@
import ModalMixin from '@/mixins/ModalMixin'
import TitleOverBorder from '../TitleOverBorder.vue'
import CustomChart from '@/components/CustomChart/index.vue'
-import { getAction, postAction } from '@/api/manage'
+import { getAction, postAction, putAction } from '@/api/manage'
import { cloneDeep } from 'lodash'
import { buildLineSeries } from '@/utils/chartHelper'
import SampleDataMixin from '../../SampleDataMixin'
@@ -241,6 +250,7 @@ export default {
return {
isLoading: false,
+ isCalling: false,
isSaving: false,
equation: '',
@@ -491,6 +501,43 @@ export default {
}
},
+ // 点击call按钮
+ handleCall() {
+ this.$refs.fileInput.click()
+ },
+
+ async handleFileChange(event) {
+ const { files } = event.target
+ if (files.length) {
+ const file = files[0]
+ const { inputFileName: fileName } = this.sampleData
+ const formData = new FormData()
+ formData.append('file', file)
+ formData.append('sampleFileName', fileName)
+ formData.append('width', 922)
+ formData.append('currentText', this.currSelectedDataSource)
+
+ try {
+ this.isCalling = true
+ const { success, result, message } = await postAction('/gamma/callDataEfficiency', formData)
+ if (success) {
+ const { ECutAnalysis_Low, G_energy_span } = result
+ this.ECutAnalysis_Low = ECutAnalysis_Low
+ this.G_energy_span = G_energy_span
+
+ this.handleResult(result)
+ } else {
+ this.$message.error(message)
+ }
+ } catch (error) {
+ console.error(error)
+ } finally {
+ this.isCalling = false
+ }
+ }
+ event.target.value = ''
+ },
+
// 应用
async handleApply() {
try {
@@ -526,8 +573,20 @@ export default {
this.getData(item)
},
- handleSetToCurrent() {
+ async handleSetToCurrent() {
this.appliedDataSource = this.currSelectedDataSource
+ try {
+ const { inputFileName: fileName } = this.sampleData
+
+ const { success, message } = await putAction(
+ `/gamma/setCurrentEfficiency?fileName=${fileName}¤tName=${this.currSelectedDataSource}`
+ )
+ if (!success) {
+ this.$message.error(message)
+ }
+ } catch (error) {
+ console.error(error)
+ }
}
}
}
@@ -574,7 +633,7 @@ export default {
&.has-data {
::v-deep {
.ant-table-body {
- height: 182px;
+ height: 193px;
background-color: #06282a;
}
}
@@ -582,7 +641,7 @@ export default {
::v-deep {
.ant-table-placeholder {
- height: 183px;
+ height: 194px;
display: flex;
justify-content: center;
align-items: center;
diff --git a/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue
index b153218..0da4f10 100644
--- a/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue
@@ -44,7 +44,7 @@
:pagination="false"
size="small"
:class="list.length ? 'has-data' : ''"
- :scroll="{ y: 182 }"
+ :scroll="{ y: 193 }"
:selectedRowKeys.sync="selectedRowKeys"
:canDeselect="false"
@rowClick="handleRowClick"
@@ -52,7 +52,16 @@
@@ -102,7 +111,7 @@
import ModalMixin from '@/mixins/ModalMixin'
import TitleOverBorder from '../TitleOverBorder.vue'
import CustomChart from '@/components/CustomChart/index.vue'
-import { getAction, postAction } from '@/api/manage'
+import { getAction, postAction, putAction } from '@/api/manage'
import { cloneDeep } from 'lodash'
import { buildLineSeries } from '@/utils/chartHelper'
import SampleDataMixin from '../../SampleDataMixin'
@@ -203,6 +212,7 @@ export default {
this.columns = columns
return {
isLoading: false,
+ isCalling: false,
isSaving: false,
equation: '',
@@ -450,6 +460,43 @@ export default {
}
},
+ // 点击call按钮
+ handleCall() {
+ this.$refs.fileInput.click()
+ },
+
+ async handleFileChange(event) {
+ const { files } = event.target
+ if (files.length) {
+ const file = files[0]
+ const { inputFileName: fileName } = this.sampleData
+ const formData = new FormData()
+ formData.append('file', file)
+ formData.append('sampleFileName', fileName)
+ formData.append('width', 922)
+ formData.append('currentText', this.currSelectedDataSource)
+
+ try {
+ this.isCalling = true
+ const { success, result, message } = await postAction('/gamma/callDataEnergy', formData)
+ if (success) {
+ const { rg_high, rg_low } = result
+ this.rg_high = rg_high
+ this.rg_low = rg_low
+
+ this.handleResult(result)
+ } else {
+ this.$message.error(message)
+ }
+ } catch (error) {
+ console.error(error)
+ } finally {
+ this.isCalling = false
+ }
+ }
+ event.target.value = ''
+ },
+
// 应用
async handleApply() {
try {
@@ -485,8 +532,20 @@ export default {
this.getData(item)
},
- handleSetToCurrent() {
+ async handleSetToCurrent() {
this.appliedDataSource = this.currSelectedDataSource
+ try {
+ const { inputFileName: fileName } = this.sampleData
+
+ const { success, message } = await putAction(
+ `/gamma/setCurrentEnergy?fileName=${fileName}¤tName=${this.currSelectedDataSource}`
+ )
+ if (!success) {
+ this.$message.error(message)
+ }
+ } catch (error) {
+ console.error(error)
+ }
}
}
}
@@ -533,7 +592,7 @@ export default {
&.has-data {
::v-deep {
.ant-table-body {
- height: 182px;
+ height: 193px;
background-color: #06282a;
}
}
@@ -541,7 +600,7 @@ export default {
::v-deep {
.ant-table-placeholder {
- height: 183px;
+ height: 194px;
display: flex;
justify-content: center;
align-items: center;
diff --git a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
index be6b5ed..9ce3d5c 100644
--- a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
@@ -17,6 +17,7 @@
:selectedRowKeys.sync="selectedRowKeys"
:selectionRows.sync="selectionRows"
:multiple="true"
+ :scroll="{ y: 'calc(100vh - 550px)' }"
>
@@ -51,7 +52,8 @@ const columns = [
{
title: 'Detector',
align: 'left',
- dataIndex: 'detectorsName'
+ dataIndex: 'detectorsName',
+ width: 130
},
{
title: 'Sample',
@@ -71,12 +73,14 @@ const columns = [
{
title: 'Col.Stop',
align: 'left',
- dataIndex: 'collectStop'
+ dataIndex: 'collectStop',
+ width: 170
},
{
title: 'Acq.Start',
align: 'left',
- dataIndex: 'acquisitionStart'
+ dataIndex: 'acquisitionStart',
+ width: 170
},
{
title: 'Acq.real',
diff --git a/src/views/spectrumAnalysis/components/Modals/NuclideLibraryModal.vue b/src/views/spectrumAnalysis/components/Modals/NuclideLibraryModal.vue
index 2f0454d..0f19e19 100644
--- a/src/views/spectrumAnalysis/components/Modals/NuclideLibraryModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/NuclideLibraryModal.vue
@@ -47,7 +47,7 @@
:columns="daughterColumns"
:list="daughterList"
:pagination="false"
- :scroll="{ y: 123 }"
+ :scroll="{ y: 84 }"
rowKey="daughters"
@rowDblClick="handleParentDBClick($event.daughters)"
>
@@ -77,7 +77,7 @@
:columns="mainColumns"
:dataSource="nuclLinesLibs"
:pagination="false"
- :scroll="{ y: 175 }"
+ :scroll="{ y: 330 }"
>
@@ -115,6 +115,7 @@ import ModalMixin from '@/mixins/ModalMixin'
import TitleOverBorder from '../TitleOverBorder.vue'
import { getAction } from '@/api/manage'
import SampleDataMixin from '../../SampleDataMixin'
+import { toFixed } from '@/utils/number'
// 右上角表格配置
const daughterColumns = [
@@ -151,22 +152,34 @@ const mainColumns = [
{
title: 'Energy(keV)',
dataIndex: 'energy',
- width: 100
+ width: 100,
+ customRender: text => {
+ return toFixed(text, 3)
+ }
},
{
title: 'Energy Uncert(%)',
dataIndex: 'energyUncert',
- width: 120
+ width: 120,
+ customRender: text => {
+ return text ? toFixed(text * 100, 6) : ''
+ }
},
{
title: 'Yield',
dataIndex: 'yield',
- width: 80
+ width: 80,
+ customRender: text => {
+ return toFixed(text, 3)
+ }
},
{
title: 'Yield Uncert(%)',
dataIndex: 'yieldUncert',
- width: 120
+ width: 120,
+ customRender: text => {
+ return toFixed(text, 3)
+ }
},
{
title: 'KeyLine',
@@ -295,7 +308,7 @@ export default {
&-list {
padding: 5px;
width: 150px;
- height: 516px;
+ height: 632px;
overflow: auto;
background-color: #275466;
@@ -339,7 +352,7 @@ export default {
}
.content {
- height: 150px;
+ height: 111px;
}
.parents {
@@ -364,7 +377,7 @@ export default {
&.has-data {
::v-deep {
.ant-table-body {
- height: 123px;
+ height: 84px;
background-color: #06282a;
}
}
@@ -373,7 +386,7 @@ export default {
::v-deep {
.ant-table {
&-placeholder {
- height: 124px;
+ height: 85px;
display: flex;
justify-content: center;
align-items: center;
@@ -400,7 +413,7 @@ export default {
&.has-data {
::v-deep {
.ant-table-body {
- height: 175px;
+ height: 330px;
background-color: #06282a;
}
}
@@ -409,7 +422,7 @@ export default {
::v-deep {
.ant-table {
&-placeholder {
- height: 176px;
+ height: 331px;
display: flex;
justify-content: center;
align-items: center;
diff --git a/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue
index fef8cdd..a092112 100644
--- a/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue
@@ -44,7 +44,7 @@
:pagination="false"
size="small"
:class="list.length ? 'has-data' : ''"
- :scroll="{ y: 182 }"
+ :scroll="{ y: 193 }"
:selectedRowKeys.sync="selectedRowKeys"
:canDeselect="false"
@rowClick="handleRowClick"
@@ -52,7 +52,16 @@
@@ -102,7 +111,7 @@
import ModalMixin from '@/mixins/ModalMixin'
import TitleOverBorder from '../TitleOverBorder.vue'
import CustomChart from '@/components/CustomChart/index.vue'
-import { getAction, postAction } from '@/api/manage'
+import { getAction, postAction, putAction } from '@/api/manage'
import { cloneDeep } from 'lodash'
import { buildLineSeries } from '@/utils/chartHelper'
import SampleDataMixin from '../../SampleDataMixin'
@@ -203,6 +212,7 @@ export default {
this.columns = columns
return {
isLoading: false,
+ isCalling: false,
isSaving: false,
equation: '',
@@ -448,6 +458,43 @@ export default {
}
},
+ // 点击call按钮
+ handleCall() {
+ this.$refs.fileInput.click()
+ },
+
+ async handleFileChange(event) {
+ const { files } = event.target
+ if (files.length) {
+ const file = files[0]
+ const { inputFileName: fileName } = this.sampleData
+ const formData = new FormData()
+ formData.append('file', file)
+ formData.append('sampleFileName', fileName)
+ formData.append('width', 922)
+ formData.append('currentText', this.currSelectedDataSource)
+
+ try {
+ this.isCalling = true
+ const { success, result, message } = await postAction('/gamma/callDataResolution', formData)
+ if (success) {
+ const { ECutAnalysis_Low, G_energy_span } = result
+ this.ECutAnalysis_Low = ECutAnalysis_Low
+ this.G_energy_span = G_energy_span
+
+ this.handleResult(result)
+ } else {
+ this.$message.error(message)
+ }
+ } catch (error) {
+ console.error(error)
+ } finally {
+ this.isCalling = false
+ }
+ }
+ event.target.value = ''
+ },
+
// 应用
async handleApply() {
try {
@@ -483,8 +530,20 @@ export default {
this.getData(item)
},
- handleSetToCurrent() {
+ async handleSetToCurrent() {
this.appliedDataSource = this.currSelectedDataSource
+ try {
+ const { inputFileName: fileName } = this.sampleData
+
+ const { success, message } = await putAction(
+ `/gamma/setCurrentResolution?fileName=${fileName}¤tName=${this.currSelectedDataSource}`
+ )
+ if (!success) {
+ this.$message.error(message)
+ }
+ } catch (error) {
+ console.error(error)
+ }
}
}
}
@@ -531,7 +590,7 @@ export default {
&.has-data {
::v-deep {
.ant-table-body {
- height: 182px;
+ height: 193px;
background-color: #06282a;
}
}
@@ -539,7 +598,7 @@ export default {
::v-deep {
.ant-table-placeholder {
- height: 183px;
+ height: 194px;
display: flex;
justify-content: center;
align-items: center;
diff --git a/src/views/spectrumAnalysis/components/Modals/SampleInfomationModal.vue b/src/views/spectrumAnalysis/components/Modals/SampleInfomationModal.vue
index 52a16cf..95b8912 100644
--- a/src/views/spectrumAnalysis/components/Modals/SampleInfomationModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/SampleInfomationModal.vue
@@ -2,15 +2,12 @@
-
-
-
-
- {{ data[item.key] }}
-
-
-
-
+
+
+ {{ item.title }}:
+ {{ data[item.key] }}
+
+
@@ -25,7 +22,7 @@
diff --git a/src/views/spectrumAnalysis/gamma-analysis.vue b/src/views/spectrumAnalysis/gamma-analysis.vue
index 47a3b89..90d01f4 100644
--- a/src/views/spectrumAnalysis/gamma-analysis.vue
+++ b/src/views/spectrumAnalysis/gamma-analysis.vue
@@ -17,7 +17,7 @@
v-if="!isLoading"
slot="content"
@change="handleGraphAssistanceChange"
- @reset="handleReset"
+ @reset="handleResetChart"
/>
+
+
+
+
+
@@ -98,12 +104,20 @@ import QcFlags from './components/SubOperators/QcFlags.vue'
import GraphAssistance from './components/SubOperators/GraphAssistance.vue'
import NuclideLibrary from './components/SubOperators/NuclideLibrary.vue'
import ButtonWithSwitchIcon from './components/SubOperators/ButtonWithSwitchIcon.vue'
-import { getAction } from '@/api/manage'
+import { getAction, postAction } from '@/api/manage'
import Response from './response.json'
-import { buildLineSeries, findSeriesByName, getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper'
+import {
+ buildLineSeries,
+ findSeriesByName,
+ getAxisMax,
+ getXAxisAndYAxisByPosition,
+ rangeNumber,
+} from '@/utils/chartHelper'
import { cloneDeep } from 'lodash'
import axios from 'axios'
import NuclideReviewModal from './components/Modals/AnalyzeInteractiveToolModal/components/NuclideReviewModal.vue'
+import CompareFileListModal from './components/Modals/CompareFileListModal.vue'
+import ReProcessingModal from './components/Modals/ReProcessingModal/index.vue'
// 初始配置
const initialOption = {
@@ -248,6 +262,7 @@ const thumbnailOption = {
const graphAssistance = {
axisType: 'Channel',
+ spectrumType: 'Lines',
Baseline: true,
SCAC: true,
Lc: true,
@@ -268,6 +283,8 @@ export default {
NuclideLibrary,
ButtonWithSwitchIcon,
NuclideReviewModal,
+ CompareFileListModal,
+ ReProcessingModal,
},
data() {
return {
@@ -301,6 +318,10 @@ export default {
nuclide: '',
},
currChannel: -1,
+
+ compareFileListModalVisible: false, // Compare 弹窗
+ reprocessingModalVisible: false, // 重新分析弹窗
+ isProcessing: false, // 正在处理
}
},
created() {
@@ -323,7 +344,7 @@ export default {
try {
this.isLoading = true
- this.reset()
+ this.handleResetState()
// const { success, result, message } = Response
@@ -358,8 +379,7 @@ export default {
const { inputFileName: fileName } = this.sample
try {
this.isLoading = true
- this.option.series = []
- this.thumbnailOption.series = []
+ this.handleResetState()
// const { success, result, message } = Response
const { success, result, message } = await getAction('/gamma/gammaByFile', {
fileName,
@@ -438,11 +458,7 @@ export default {
this.shapeChannelData = shapeChannelData
this.shapeEnergyData = shapeEnergyData
- this.option.yAxis.max =
- shadowChannelChart.pointlist && Math.ceil(Math.max(...shadowChannelChart.pointlist.map((item) => item.y)) * 1.1)
- this.thumbnailOption.yAxis.max =
- shadowChannelChart.pointlist && Math.ceil(Math.max(...shadowChannelChart.pointlist.map((item) => item.y)) * 1.1)
-
+ this.resetThumbnailChartDataMax()
const series = []
// 推入Spectrum Line
@@ -452,6 +468,7 @@ export default {
shadowChannelChart.pointlist && shadowChannelChart.pointlist.map(({ x, y }) => [x, y]),
shadowChannelChart.color,
{
+ symbolSize: 2,
markLine: {
silent: true,
symbol: 'none',
@@ -565,6 +582,14 @@ export default {
)
})
series.push(...peakLines)
+
+ // 推入Compare Line
+ series.push(
+ buildLineSeries('Compare', [], '#fff', {
+ symbolSize: 2,
+ })
+ )
+
this.option.series = series
this.option.tooltip.formatter = this.tooltipFormatter
@@ -589,25 +614,29 @@ export default {
// Graph Assistance 操作
handleGraphAssistanceChange({ type, label, value }) {
+ const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
+ const thumbnailSpectrumLineSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
+ const compareLineSeries = findSeriesByName(this.option.series, 'Compare')
+
// 类型变化
if (type == 'labelChange') {
switch (label) {
case 'Linear':
this.option.yAxis.type = 'value'
this.thumbnailOption.yAxis.type = 'value'
- this.handleReset()
+ this.handleResetChart()
break
case 'Log10':
this.option.yAxis.type = 'log'
this.thumbnailOption.yAxis.type = 'log'
- this.handleReset()
+ this.handleResetChart()
break
case 'Channel':
case 'Energy':
this.graphAssistance.axisType = label
this.option.xAxis.name = label
- this.handleReset()
+ this.handleResetChart()
this.redrawLineBySeriesName(
'BaseLine',
@@ -628,20 +657,44 @@ export default {
this.redrawPeakLine()
this.redrawThumbnailChart()
+
+ if (this.channelCompareLine) {
+ this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
+ }
break
case 'Lines':
- this.option.series[0].type = 'line'
- this.option.series[0].symbol = 'none'
+ this.graphAssistance.spectrumType = 'Lines'
- this.thumbnailOption.series[0].type = 'line'
- this.thumbnailOption.series[0].symbol = 'none'
+ spectrumLineSeries.type = 'line'
+ spectrumLineSeries.symbol = 'none'
+
+ thumbnailSpectrumLineSeries.type = 'line'
+ thumbnailSpectrumLineSeries.symbol = 'none'
+
+ compareLineSeries.type = 'line'
+ compareLineSeries.symbol = 'none'
+
+ this.redrawLineBySeriesName('Spectrum', this.shadowEnergyChart, this.shadowChannelChart)
+
+ if (this.channelCompareLine) {
+ this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
+ }
break
case 'Scatter':
- this.option.series[0].type = 'scatter'
- this.option.series[0].symbol = 'circle'
+ this.graphAssistance.spectrumType = 'Scatter'
- this.thumbnailOption.series[0].type = 'scatter'
- this.thumbnailOption.series[0].symbol = 'circle'
+ spectrumLineSeries.type = 'scatterGL'
+ spectrumLineSeries.symbol = 'circle'
+
+ thumbnailSpectrumLineSeries.type = 'scatterGL'
+ thumbnailSpectrumLineSeries.symbol = 'circle'
+
+ compareLineSeries.type = 'scatterGL'
+ compareLineSeries.symbol = 'circle'
+
+ this.$nextTick(() => {
+ this.rangeScatter()
+ })
break
}
}
@@ -653,9 +706,9 @@ export default {
case 'Cursor':
// 显示红色竖线
if (value) {
- this.option.series[0].markLine.lineStyle.width = 2
+ spectrumLineSeries.markLine.lineStyle.width = 2
} else {
- this.option.series[0].markLine.lineStyle.width = 0
+ spectrumLineSeries.markLine.lineStyle.width = 0
}
break
case 'Baseline':
@@ -676,7 +729,7 @@ export default {
},
// 根据seriesName重绘线
- redrawLineBySeriesName(seriesName, energyData, channelData, isShow = true) {
+ redrawLineBySeriesName(seriesName, energyData, channelData, isShow = true, color) {
const series = findSeriesByName(this.option.series, seriesName)
if (isShow) {
const data = this.isEnergy() ? energyData : channelData
@@ -684,6 +737,9 @@ export default {
} else {
series.data = []
}
+ if (color) {
+ series.itemStyle.color = color
+ }
},
// 重绘控制点
@@ -728,7 +784,7 @@ export default {
// 重绘右上角的缩略图
redrawThumbnailChart() {
- const series = this.thumbnailOption.series[0]
+ const series = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
const data = this.isEnergy() ? this.shadowEnergyChart : this.shadowChannelChart
series.data = data.pointlist.map(({ x, y }) => [x, y])
},
@@ -736,10 +792,11 @@ export default {
// 点击图表,设置红线
handleChartClick(param) {
const { offsetX, offsetY } = param
- const point = getXAxisAndYAxisByPosition(this.$refs.chartRef.getChartInstance(), offsetX, offsetY)
+ const point = getXAxisAndYAxisByPosition(this.getChart(), offsetX, offsetY)
if (point) {
const xAxis = point[0]
- this.option.series[0].markLine.data[0].xAxis = xAxis
+ const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
+ spectrumLineSeries.markLine.data[0].xAxis = xAxis
const channel = this.isEnergy() ? this.getChannelByEnergy(xAxis) : parseInt(xAxis.toFixed())
const energy = this.isEnergy()
@@ -752,6 +809,11 @@ export default {
}
},
+ // 双击还原
+ handleChartDblClick() {
+ this.handleResetChart()
+ },
+
// 获取 Nuclide Library 数据
async getSelPosNuclide(channel) {
this.currChannel = channel
@@ -799,7 +861,8 @@ export default {
// 触发Peak Infomation
handleTogglePeak() {
- const xAxis = this.option.series[0].markLine.data[0].xAxis
+ const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
+ const xAxis = spectrumLineSeries.markLine.data[0].xAxis
const channel = this.isEnergy() ? this.getChannelByEnergy(xAxis) : parseInt(xAxis.toFixed())
const index = this.channelPeakGroup.findIndex((peakItem) => {
const allX = peakItem.pointlist.map((item) => item.x)
@@ -829,9 +892,7 @@ export default {
return prev && prev.y > curr.y ? prev : curr
})
- const chart = this.$refs.chartRef.getChartInstance()
-
- const [xPix, yPix] = chart.convertToPixel({ seriesIndex: 0 }, [x, y])
+ const [xPix, yPix] = this.getChart().convertToPixel({ seriesIndex: 0 }, [x, y])
this.peakInfomationTooltip.content = html
this.peakInfomationTooltip.visible = true
this.peakInfomationTooltip.left = xPix
@@ -854,7 +915,8 @@ export default {
* @param { 'left'| 'right' } direction
*/
moveMarkLine(direction) {
- const prevAxis = this.option.series[0].markLine.data[0].xAxis
+ const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
+ const prevAxis = spectrumLineSeries.markLine.data[0].xAxis
// 获取每一段 Channel 中的最大值
const maxXAxises = this.channelPeakGroup.map((item) => {
@@ -868,13 +930,13 @@ export default {
// 找到第一个比prevAxis大的xAxis
find = maxXAxises.find((xAxis) => xAxis > prevAxis)
if (find) {
- this.option.series[0].markLine.data[0].xAxis = find
+ spectrumLineSeries.markLine.data[0].xAxis = find
}
} else if (direction == 'left') {
// 找到第一个比prevAxis小的xAxis
find = maxXAxises.reverse().find((xAxis) => xAxis < prevAxis)
if (find) {
- this.option.series[0].markLine.data[0].xAxis = find
+ spectrumLineSeries.markLine.data[0].xAxis = find
}
}
@@ -885,8 +947,7 @@ export default {
// 鼠标按下时开启可刷选状态
handleMouseDown() {
- const chart = this.$refs.chartRef.getChartInstance()
- chart.dispatchAction({
+ this.getChart().dispatchAction({
type: 'takeGlobalCursor',
// 如果想变为“可刷选状态”,必须设置。不设置则会关闭“可刷选状态”。
key: 'brush',
@@ -898,13 +959,16 @@ export default {
},
handleMouseUp() {
- setTimeout(() => {
- const chart = this.$refs.chartRef.getChartInstance()
- this.clearBrush(chart)
+ if (this.timer) {
+ window.clearTimeout(this.timer)
+ }
+ this.timer = setTimeout(() => {
+ this.clearBrush()
}, 0)
},
- clearBrush(chart) {
+ clearBrush() {
+ const chart = this.getChart()
// 清理刷选的范围
chart.dispatchAction({
type: 'brush',
@@ -914,6 +978,7 @@ export default {
// 改为不可刷选状态
chart.dispatchAction({
type: 'takeGlobalCursor',
+ brushOption: false
})
},
@@ -930,13 +995,18 @@ export default {
const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).map((num) => parseInt(num.toFixed()))
const point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map((num) => parseInt(num.toFixed()))
- const xAxisMax = chart.getModel().getComponent('xAxis').axis.scale._extent[1]
- const yAxisMax = this.option.yAxis.max
+ // 拿到之前的最大值
+ const xAxisMax = getAxisMax(chart, 'xAxis')
+ const yAxisMax = getAxisMax(chart, 'yAxis')
+
+ // 拿到之前的最小值
+ const xAxisMin = this.option.xAxis.min
+ const yAxisMin = this.option.yAxis.min
let [x1, y2, x2, y1] = [...point1, ...point2] // 根据解析出的数据确定真实的范围
- const xAxisLimit = rangeNumber(1, xAxisMax)
- const yAxisLimit = rangeNumber(1, yAxisMax)
+ const xAxisLimit = rangeNumber(xAxisMin, xAxisMax)
+ const yAxisLimit = rangeNumber(yAxisMin, yAxisMax)
x1 = xAxisLimit(x1)
x2 = xAxisLimit(x2)
@@ -957,21 +1027,89 @@ export default {
this.setThumbnailChartRect(x1, y2, x2, y1)
}
- const thumbnailChart = this.$refs.thumbnailChartRef.getChartInstance()
+ const thumbnailChart = this.getThumbnailChart()
const [, maxYPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, y1]) // 方框的上下两条边的yAxis转为pix
const [, minYPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, y2])
const rectHeightPixel = maxYPixel - minYPixel // 计算方框的左右边长(pix)
this.halfHeightPixel = rectHeightPixel / 2
}
- this.clearBrush(chart)
+ this.$nextTick(() => {
+ this.rangeScatter()
+ })
+ },
+
+ /**
+ * 因scatterGL 不受axis中max和min的控制,手动处理溢出部分
+ * @param {Boolean} isReset 是否重置到初始状态
+ */
+ rangeScatter(isReset) {
+ if (!this.isScatter()) {
+ return
+ }
+
+ const {
+ xAxis: { min: x1 },
+ yAxis: { min: y1 },
+ } = this.option
+
+ const chart = this.getChart()
+ const x2 = getAxisMax(chart, 'xAxis')
+ const y2 = getAxisMax(chart, 'yAxis')
+
+ const channelSpectrumData = {
+ ...this.shadowChannelChart,
+ pointlist: isReset
+ ? this.pointlistLimitY(this.shadowChannelChart.pointlist)
+ : this.pointlistLimit(this.shadowChannelChart.pointlist, x1, x2, y1, y2),
+ }
+ const energySpectrumData = {
+ ...this.shadowEnergyChart,
+ pointlist: isReset
+ ? this.pointlistLimitY(this.shadowEnergyChart.pointlist)
+ : this.pointlistLimit(this.shadowEnergyChart.pointlist, x1, x2, y1, y2),
+ }
+ this.redrawLineBySeriesName('Spectrum', energySpectrumData, channelSpectrumData)
+
+ if (this.channelCompareLine) {
+ const channelCompareLine = {
+ ...this.channelCompareLine,
+ pointlist: isReset
+ ? this.pointlistLimitY(this.channelCompareLine.pointlist)
+ : this.pointlistLimit(this.channelCompareLine.pointlist, x1, x2, y1, y2),
+ }
+ const energyCompareLine = {
+ ...this.energyCompareLine,
+ pointlist: isReset
+ ? this.pointlistLimitY(this.energyCompareLine.pointlist)
+ : this.pointlistLimit(this.energyCompareLine.pointlist, x1, x2, y1, y2),
+ }
+ this.redrawLineBySeriesName('Compare', energyCompareLine, channelCompareLine)
+ }
+ },
+
+ /**
+ * 筛选范围内的点
+ * @param {*} pointlist
+ * @param {*} x1
+ * @param {*} x2
+ * @param {*} y1
+ * @param {*} y2
+ */
+ pointlistLimit(pointlist, x1, x2, y1, y2) {
+ return pointlist.filter(({ x, y }) => x >= x1 && x <= x2 && y >= y1 && y <= y2)
+ },
+
+ pointlistLimitY(pointlist) {
+ return pointlist.filter(({ y }) => y >= 1)
},
// 在右上角缩略图中设置范围
setThumbnailChartRect(x1, y2, x2, y1) {
this.thumbnailChartRect = [x1, y2, x2, y1]
- const { markLine } = this.thumbnailOption.series[0]
+ const thumbnailSpectrumLineSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
+ const { markLine } = thumbnailSpectrumLineSeries
const pointList = [
[
[x1, y1],
@@ -999,19 +1137,23 @@ export default {
// 缩略图点击
handleThumbnailChartClick(param) {
const { offsetX, offsetY } = param
- const thumbnailChart = this.$refs.thumbnailChartRef.getChartInstance()
+ const thumbnailChart = this.getThumbnailChart()
const point = getXAxisAndYAxisByPosition(thumbnailChart, offsetX, offsetY)
if (point && this.thumbnailChartRect && this.thumbnailChartRect.length) {
const [x1, y2, x2, y1] = this.thumbnailChartRect
const halfWidth = Math.ceil((x2 - x1) / 2)
- const [, maxYAxisPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, this.thumbnailOption.yAxis.max]) // 缩略图最大值转为pix
+ // 缩略图最大值转为pix
+ const [, maxYAxisPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [
+ 0,
+ getAxisMax(thumbnailChart, 'yAxis'),
+ ])
const [, minYAxisPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, 1])
let [xAxis, yAxis] = point
- const xAxisMax = thumbnailChart.getModel().getComponent('xAxis').axis.scale._extent[1]
+ const xAxisMax = getAxisMax(thumbnailChart, 'xAxis')
const xAxisLimit = rangeNumber(1 + halfWidth, xAxisMax - halfWidth)
@@ -1041,82 +1183,117 @@ export default {
this.option.yAxis.min = minYAxis
this.option.yAxis.max = maxYAxis
+
+ this.$nextTick(() => {
+ this.rangeScatter()
+ })
}
},
// 重置
- handleReset() {
+ handleResetChart() {
this.option.xAxis.min = 1
this.option.xAxis.max = 'dataMax'
this.option.yAxis.min = 1
- this.option.yAxis.max = Math.ceil(Math.max(...this.shadowChannelChart.pointlist.map((item) => item.y)) * 1.1)
+ this.option.yAxis.max = 'dataMax'
- this.thumbnailOption.series[0].markLine.data = []
+ const thumbnailSpectrumLineSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
+ thumbnailSpectrumLineSeries.markLine.data = []
this.thumbnailChartRect = []
this.closePeakInfomationTooltip()
+
+ this.$nextTick(() => {
+ this.rangeScatter(true)
+ })
},
// 从分析工具刷新部分数据
handleRefresh(data) {
- const { allData, shadowChannelChart, shadowEnergyChart, shapeChannelData, shapeEnergyData } = data
-
- const channelPeakGroup = allData.filter((item) => item.name == 'Peak' && item.group == 'channel')
- const energyPeakGroup = allData.filter((item) => item.name == 'Peak' && item.group == 'energy')
-
- const channelBaseLine = allData.find((item) => item.name == 'BaseLine' && item.group == 'channel')
- const energyBaseLine = allData.find((item) => item.name == 'BaseLine' && item.group == 'energy')
-
- const channelLcLine = allData.find((item) => item.name == 'Lc' && item.group == 'channel')
- const energyLcLine = allData.find((item) => item.name == 'Lc' && item.group == 'energy')
-
- const channelScacLine = allData.find((item) => item.name == 'Scac' && item.group == 'channel')
- const energyScacLine = allData.find((item) => item.name == 'Scac' && item.group == 'energy')
-
- this.allEnergy = allData.find((item) => item.name == 'Energy' && item.group == 'energy')
- this.allChannel = allData.find((item) => item.name == 'Count' && item.group == 'channel')
-
- // 保存Peak Line
- this.channelPeakGroup = channelPeakGroup
- this.energyPeakGroup = energyPeakGroup
-
- // 保存 Spectrum Line
- this.shadowChannelChart = shadowChannelChart
- this.shadowEnergyChart = shadowEnergyChart
-
- // 保存基线
- this.channelBaseLine = channelBaseLine
- this.energyBaseLine = energyBaseLine
-
- // 保存Lc
- this.channelLcLine = channelLcLine
- this.energyLcLine = energyLcLine
-
- // 保存Scac
- this.channelScacLine = channelScacLine
- this.energyScacLine = energyScacLine
-
- // 保存 基线控制点
- this.shapeChannelData = shapeChannelData
- this.shapeEnergyData = shapeEnergyData
-
- this.opts.notMerge = true
- this.redrawPeakLine()
- this.redrawCtrlPointBySeriesName()
-
- this.redrawLineBySeriesName('BaseLine', this.energyBaseLine, this.channelBaseLine, this.graphAssistance.Baseline)
- this.redrawLineBySeriesName('LcLine', this.energyLcLine, this.channelLcLine, this.graphAssistance.Lc)
- this.redrawLineBySeriesName('ScacLine', this.energyScacLine, this.channelScacLine, this.graphAssistance.SCAC)
- this.redrawLineBySeriesName('Spectrum', this.shadowEnergyChart, this.shadowChannelChart)
-
- this.redrawThumbnailChart()
- this.$nextTick(() => {
- this.resetChartOpts()
- })
+ this.handleResetState()
+ data.DetailedInformation = this.detailedInfomation
+ this.dataProsess(data)
},
// 分析工具Accept时刷新部分数据
handleAccept() {
console.log('%c [ 分析工具Accept时刷新部分数据 ]-1046', 'font-size:13px; background:pink; color:#bf2c9f;')
+ this.clearCompareLine()
+ },
+
+ // 显示比较弹窗
+ showCompareModal() {
+ if (this.isLoading) {
+ this.$message.warn('Sample is Loading')
+ return
+ }
+ this.handleResetChart()
+ this.clearCompareLine()
+ this.compareFileListModalVisible = true
+ },
+
+ // 文件之间对比
+ handleCompareWithFile([channelData, energyData]) {
+ this.channelCompareLine = channelData
+ this.energyCompareLine = energyData
+ this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
+
+ if (this.isScatter()) {
+ lineSeries.type = 'scatterGL'
+ }
+
+ this.$nextTick(() => {
+ this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
+ })
+ },
+
+ // 移除 Compare 线
+ clearCompareLine() {
+ const compareLine = findSeriesByName(this.option.series, 'Compare')
+ if (compareLine) {
+ compareLine.data = []
+ this.resetThumbnailChartDataMax()
+ }
+ this.channelCompareLine = undefined
+ this.energyCompareLine = undefined
+ },
+
+ // 重新分析
+ async reProcessing() {
+ if (this.isProcessing) {
+ return
+ }
+
+ if (this.isLoading) {
+ this.$message.warn('Sample is Loading')
+ return
+ }
+
+ try {
+ this.isLoading = true
+ this.handleResetState()
+
+ const { inputFileName: fileName } = this.sample
+ const { success, result, message } = await postAction(`/gamma/Reprocessing?fileName=${fileName}`)
+ if (success) {
+ result.DetailedInformation = this.detailedInfomation
+ this.dataProsess(result)
+ } else {
+ this.isLoading = false
+ const arr = message.split('\n')
+ this.$warning({
+ title: 'Warning',
+ content: () => arr.map((text) => {text}
),
+ })
+ }
+ } catch (error) {
+ console.error(error)
+ }
+ // this.reprocessingModalVisible = true
+ },
+
+ // 重置缩略图表y轴最大值
+ resetThumbnailChartDataMax() {
+ this.thumbnailOption.yAxis.max = 'dataMax'
},
// 重置图表配置
@@ -1159,7 +1336,7 @@ export default {
},
// 重置页面信息
- reset() {
+ handleResetState() {
this.selectedChannel = -1
this.nuclideLibraryList = []
this.closePeakInfomationTooltip()
@@ -1169,14 +1346,16 @@ export default {
this.option.yAxis.type = 'value'
if (this.option.series.length) {
- this.option.series[0].type = 'line'
- this.option.series[0].symbol = 'none'
- this.option.series[0].markLine.lineStyle.width = 2
+ const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
+ spectrumLineSeries.type = 'line'
+ spectrumLineSeries.symbol = 'none'
+ spectrumLineSeries.markLine.lineStyle.width = 2
}
if (this.thumbnailOption.series.length) {
- this.thumbnailOption.series[0].type = 'line'
- this.thumbnailOption.series[0].symbol = 'none'
+ const thumbnailSpectrumLineSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
+ thumbnailSpectrumLineSeries.type = 'line'
+ thumbnailSpectrumLineSeries.symbol = 'none'
}
this.graphAssistance = cloneDeep(graphAssistance)
},
@@ -1214,11 +1393,17 @@ export default {
this.channelScacLine.color = Color_Scac
this.energyScacLine.color = Color_Scac
+ if (this.channelCompareLine) {
+ this.channelCompareLine.color = Color_Compare
+ this.energyCompareLine.color = Color_Compare
+ }
+
this.changeColorBySeriesName('Spectrum', Color_Spec)
this.changePeakLineColor(Color_Peak)
this.changeColorBySeriesName('LcLine', Color_Lc)
this.changeColorBySeriesName('BaseLine', Color_Base)
this.changeColorBySeriesName('ScacLine', Color_Scac)
+ this.changeColorBySeriesName('Compare', Color_Compare)
const thumbnailChartSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
thumbnailChartSeries.itemStyle.color = Color_Spec
@@ -1242,6 +1427,18 @@ export default {
isEnergy() {
return this.graphAssistance.axisType == 'Energy'
},
+
+ isScatter() {
+ return this.graphAssistance.spectrumType == 'Scatter'
+ },
+
+ getChart() {
+ return this.$refs.chartRef.getChartInstance()
+ },
+
+ getThumbnailChart() {
+ return this.$refs.thumbnailChartRef.getChartInstance()
+ },
},
watch: {
sample: {
diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue
index 6f2d87a..ea7de82 100644
--- a/src/views/spectrumAnalysis/index.vue
+++ b/src/views/spectrumAnalysis/index.vue
@@ -89,10 +89,6 @@
-
-
-
-
@@ -209,7 +205,6 @@ import SaveSettingModal from './components/Modals/SaveSettingModal.vue'
import AnalyzeSettingModal from './components/Modals/AnalyzeSettingModal.vue'
import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveToolModal/index.vue'
import KorsumModal from './components/Modals/KorsumModal.vue'
-import ReProcessingModal from './components/Modals/ReProcessingModal/index.vue'
import ZeroTimeModal from './components/Modals/ZeroTimeModal.vue'
import EfficiencyCalibrationModal from './components/Modals/EfficiencyCalibrationModal.vue'
import EnergyCalibrationModal from './components/Modals/EnergyCalibrationModal.vue'
@@ -235,6 +230,7 @@ import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals
import StripModal from './components/Modals/StripModal.vue'
import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
+import { getAction } from '@/api/manage'
// 分析类型
const ANALYZE_TYPE = {
@@ -255,7 +251,6 @@ export default {
AnalyzeSettingModal,
AnalyzeInteractiveToolModal,
KorsumModal,
- ReProcessingModal,
ZeroTimeModal,
EfficiencyCalibrationModal,
EnergyCalibrationModal,
@@ -313,7 +308,6 @@ export default {
saveSettingModalVisible: false, // 保存设置弹窗
analyzeConfigureModalVisible: false, // 分析设置弹窗
- reprocessingModalVisible: false, // 重新分析弹窗
analyzeInteractiveToolModalVisible: false, // 分析工具弹窗
zeroTimeModalVisible: false, // Zero Time 弹窗
korsumModalShow: false, // Korsum 弹窗
@@ -475,10 +469,29 @@ export default {
* 保存结果到数据库
* @param { 'all' | 'current' } type
*/
- handleSaveResultsToDB(type) {
- console.log('%c [ saveResultsToDB ]-157', 'font-size:13px; background:pink; color:#bf2c9f;', type)
- if (type === 'current') {
- this.handleSaveResultsToDB_Cuurrent()
+ async handleSaveResultsToDB(type) {
+ if (this.isBetaGamma) {
+ if (type === 'current') {
+ this.handleSaveResultsToDB_Cuurrent()
+ }
+ } else if (this.isGamma) {
+ if (type == 'current') {
+ const hideLoading = this.$message.loading('Saving...', 0)
+ try {
+ const { success, message } = await getAction('/gamma/saveToDB', {
+ fileName: this.sampleData.inputFileName
+ })
+ if (success) {
+ this.$message.success('Save Success')
+ } else {
+ this.$message.error(message)
+ }
+ } catch (error) {
+ console.error(error)
+ } finally {
+ hideLoading()
+ }
+ }
}
},
handleSaveResultsToDB_Cuurrent() {
@@ -623,8 +636,9 @@ export default {
},
{
type: 'a-menu-item',
- title: 'Clean All',
- handler: this.handleCleanAll,
+ title: 'Compare',
+ show: this.isGamma,
+ handler: () => this.$refs.gammaAnalysisRef.showCompareModal(),
},
{
type: 'a-menu-item',
@@ -638,6 +652,11 @@ export default {
show: this.isGamma,
handler: () => (this.ftransltModalVisible = true),
},
+ {
+ type: 'a-menu-item',
+ title: 'Clean All',
+ handler: this.handleCleanAll,
+ },
],
},
{
@@ -736,9 +755,9 @@ export default {
},
{
type: 'a-menu-item',
- title: 'ReProcessing',
+ title: 'Reprocessing',
show: this.isGamma,
- handler: () => (this.reprocessingModalVisible = true),
+ handler: () => this.$refs.gammaAnalysisRef.reProcessing(),
},
{
type: 'a-menu-item',