diff --git a/src/store/index.js b/src/store/index.js
index 5936c50..b77f9bd 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -6,6 +6,7 @@ import user from './modules/user'
import permission from './modules/permission'
import enhance from './modules/enhance'
import online from './modules/online'
+import sample from './modules/sample'
import getters from './getters'
Vue.use(Vuex)
@@ -17,6 +18,7 @@ export default new Vuex.Store({
permission,
enhance,
online,
+ sample
},
state: {
diff --git a/src/store/modules/sample.js b/src/store/modules/sample.js
new file mode 100644
index 0000000..0630a0c
--- /dev/null
+++ b/src/store/modules/sample.js
@@ -0,0 +1,30 @@
+const sample = {
+ state: {
+ sampleList: []
+ },
+ mutations: {
+ SET_SAMPLE_LIST: (state, sampleList) => {
+ state.sampleList = sampleList
+ },
+
+ ADD_SAMPLE_DATA: (state, sampleData) => {
+ state.sampleList.push(sampleData)
+ },
+
+ GET_SAMPLE_DATA: (state, inputFileName) => {
+ const find = state.sampleList.find(item => item.inputFileName == inputFileName)
+ return find
+ },
+
+ REMOVE_SAMPLE_DATA: (state, inputFileName) => {
+ const findIndex = state.sampleList.findIndex(item => item.inputFileName == inputFileName)
+ state.sampleList.splice(findIndex, 1)
+ },
+
+ CLEAR_SAMPLE_DATA: () => {
+ state.sampleList = []
+ }
+ }
+}
+
+export default sample
diff --git a/src/utils/chartHelper.js b/src/utils/chartHelper.js
index 86c1e8f..affe08c 100644
--- a/src/utils/chartHelper.js
+++ b/src/utils/chartHelper.js
@@ -114,5 +114,5 @@ export function rangeNumber(min, max) {
* @returns
*/
export function getAxisMax(chartInstance, axis) {
- return chartInstance.getModel().getComponent(axis).axis.scale._extent[1]
+ return chartInstance.getModel().getComponent(axis).axis.scale.rawExtentInfo._dataMax
}
\ No newline at end of file
diff --git a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
index 8465ffd..b126a86 100644
--- a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
@@ -43,68 +43,68 @@ const columns = [
{
title: 'SampleID',
align: 'left',
- dataIndex: 'sampleId'
+ dataIndex: 'sampleId',
},
{
title: 'Station',
align: 'left',
- dataIndex: 'stationName'
+ dataIndex: 'stationName',
},
{
title: 'Detector',
align: 'left',
dataIndex: 'detectorsName',
- width: 130
+ width: 130,
},
{
title: 'Sample',
align: 'left',
- dataIndex: 'sampleType'
+ dataIndex: 'sampleType',
},
{
title: 'DataType',
align: 'left',
- dataIndex: 'dataType'
+ dataIndex: 'dataType',
},
{
title: 'Qualifier',
align: 'left',
- dataIndex: 'spectralQualifie'
+ dataIndex: 'spectralQualifie',
},
{
title: 'Col.Stop',
align: 'left',
dataIndex: 'collectStop',
- width: 170
+ width: 170,
},
{
title: 'Acq.Start',
align: 'left',
dataIndex: 'acquisitionStart',
- width: 170
+ width: 170,
},
{
title: 'Acq.real',
align: 'left',
- dataIndex: 'acquisitionRealSec'
+ dataIndex: 'acquisitionRealSec',
},
{
title: 'Acq.live',
align: 'left',
- dataIndex: 'acquisitionLiveSec'
+ dataIndex: 'acquisitionLiveSec',
},
{
title: 'Status',
align: 'left',
- dataIndex: 'status'
- }
+ dataIndex: 'status',
+ },
]
export default {
props: {
value: {
- type: Boolean
- }
+ type: Boolean,
+ },
},
mixins: [JeecgListMixin],
data() {
@@ -113,11 +113,10 @@ export default {
return {
queryParam: {
menuTypes: 'G,B',
- startDate: moment()
- .add(-7, 'd')
- .format('YYYY-MM-DD'),
+ startDate: moment().add(-7, 'd').format('YYYY-MM-DD'),
endDate: moment().format('YYYY-MM-DD'),
- dbName: 'auto'
+ dbName: 'auto',
+ spectralQualifie: 'FULL',
},
selectedRowKeys: [],
selectionRows: [],
@@ -125,8 +124,22 @@ export default {
stationList: [],
detectorList: [],
url: {
- list: '/spectrumAnalysis/getDBSpectrumList'
- }
+ list: '/spectrumAnalysis/getDBSpectrumList',
+ },
+ sampleTypeOption: [
+ {
+ label: 'P',
+ value: 'P',
+ },
+ {
+ label: 'B',
+ value: 'B',
+ },
+ {
+ label: 'G',
+ value: 'G',
+ },
+ ],
}
},
created() {
@@ -165,12 +178,12 @@ export default {
this.loading = true
getAction(this.url.list, params)
- .then(res => {
+ .then((res) => {
if (res.success) {
const result = res.result.records || res.result
- result.forEach(item => {
+ result.forEach((item) => {
const fileName = item.inputFileName
- if(fileName) {
+ if (fileName) {
const arr = fileName.split('/')
item.inputFileName = arr[arr.length - 1]
}
@@ -214,11 +227,11 @@ export default {
const { success, result, message } = await getAction('/spectrumAnalysis/getDBSearchList', {
menuTypes: value,
dbName: this.queryParam.dbName,
- AllUsers: this.allUsersValue
+ AllUsers: this.allUsersValue,
})
if (success) {
- this.stationList = result.stationCode.map(item => ({ label: item, value: item }))
- this.detectorList = result.detectorCode.map(item => ({ label: item, value: item }))
+ this.stationList = result.stationCode.map((item) => ({ label: item, value: item }))
+ this.detectorList = result.detectorCode.map((item) => ({ label: item, value: item }))
} else {
this.$message.error(message)
}
@@ -234,7 +247,7 @@ export default {
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
- }
+ },
},
computed: {
visible: {
@@ -243,7 +256,7 @@ export default {
},
set(val) {
this.$emit('input', val)
- }
+ },
},
formItems() {
return [
@@ -255,32 +268,64 @@ export default {
options: [
{
label: 'All',
- value: 'G,B'
+ value: 'G,B',
},
{
label: 'Gamma',
- value: 'G'
+ value: 'G',
},
{
label: 'Beta',
- value: 'B'
- }
+ value: 'B',
+ },
],
- allowClear: true
+ allowClear: true,
},
style: {
- width: '18%'
+ width: '18%',
},
on: {
- change: event => {
+ change: (event) => {
+ console.log('event', event)
if (!event) {
this.stationList = []
this.detectorList = []
return
}
+ let arr_B = [
+ {
+ label: 'B',
+ value: 'B',
+ },
+ ]
+ let arr_G = [
+ {
+ label: 'P',
+ value: 'P',
+ },
+ {
+ label: 'G',
+ value: 'G',
+ },
+ ]
+ let arr_A = [
+ {
+ label: 'P',
+ value: 'P',
+ },
+ {
+ label: 'B',
+ value: 'B',
+ },
+ {
+ label: 'G',
+ value: 'G',
+ },
+ ]
+ this.sampleTypeOption = event == 'B' ? arr_B : event == 'G' ? arr_G : arr_A
this.getStationAndDetectorList(event)
- }
- }
+ },
+ },
},
{
label: 'Station',
@@ -290,11 +335,11 @@ export default {
options: this.stationList,
showSearch: true,
filterOption: this.filterOption,
- allowClear: true
+ allowClear: true,
},
style: {
- width: '19%'
- }
+ width: '19%',
+ },
},
{
label: 'Detector',
@@ -304,36 +349,23 @@ export default {
options: this.detectorList,
showSearch: true,
filterOption: this.filterOption,
- allowClear: true
+ allowClear: true,
},
style: {
- width: '19%'
- }
+ width: '19%',
+ },
},
{
label: 'Sample',
type: 'custom-select',
name: 'sampleType',
props: {
- options: [
- {
- label: 'P',
- value: 'P'
- },
- {
- label: 'B',
- value: 'B'
- },
- {
- label: 'G',
- value: 'G'
- }
- ],
- allowClear: true
+ options: this.sampleTypeOption,
+ allowClear: true,
},
style: {
- width: '14%'
- }
+ width: '14%',
+ },
},
{
label: 'DataType',
@@ -343,34 +375,34 @@ export default {
options: [
{
label: 'S',
- value: 'S'
+ value: 'S',
},
{
label: 'G',
- value: 'G'
+ value: 'G',
},
{
label: 'D',
- value: 'D'
+ value: 'D',
},
{
label: 'Q',
- value: 'Q'
+ value: 'Q',
},
{
label: 'B',
- value: 'B'
+ value: 'B',
},
{
label: 'C',
- value: 'C'
- }
+ value: 'C',
+ },
],
- allowClear: true
+ allowClear: true,
},
style: {
- width: '14%'
- }
+ width: '14%',
+ },
},
{
label: 'Qualifier',
@@ -380,30 +412,30 @@ export default {
options: [
{
label: 'FULL',
- value: 'FULL'
+ value: 'FULL',
},
{
label: 'PREL',
- value: 'PREL'
- }
+ value: 'PREL',
+ },
],
- allowClear: true
+ allowClear: true,
},
style: {
width: '16%',
- paddingRight: 0
- }
+ paddingRight: 0,
+ },
},
{
label: 'SampleID',
type: 'a-input',
name: 'sampleId',
props: {
- allowClear: true
+ allowClear: true,
},
style: {
- width: '264px'
- }
+ width: '264px',
+ },
},
{
label: '',
@@ -413,13 +445,13 @@ export default {
options: [
{ label: 'All User', value: 'AllUsers' },
{ label: 'Collect Stop', value: 'CollectStopB' },
- { label: 'Acq.Start', value: 'AcqStartB' }
- ]
+ { label: 'Acq.Start', value: 'AcqStartB' },
+ ],
},
style: {
width: '305px',
- paddingRight: 0
- }
+ paddingRight: 0,
+ },
},
{
label: 'From',
@@ -429,12 +461,12 @@ export default {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
style: {
- minWidth: 'auto'
- }
+ minWidth: 'auto',
+ },
},
style: {
- width: '19%'
- }
+ width: '19%',
+ },
},
{
label: 'To',
@@ -444,15 +476,15 @@ export default {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
style: {
- minWidth: 'auto'
- }
+ minWidth: 'auto',
+ },
},
style: {
paddingRight: 0,
marginRight: '22px',
- width: '19%'
- }
- }
+ width: '19%',
+ },
+ },
]
},
@@ -469,7 +501,7 @@ export default {
acqStartValue() {
const checkboxGroup = this.queryParam.checkboxGroup
return !!(checkboxGroup && checkboxGroup.includes('AcqStartB'))
- }
+ },
},
watch: {
// All User 变化时重新获取station 和detector
@@ -479,8 +511,8 @@ export default {
this.detectorList = []
this.getStationAndDetectorList(this.queryParam.menuTypes)
}
- }
- }
+ },
+ },
}
diff --git a/src/views/spectrumAnalysis/components/SubOperators/GraphAssistance.vue b/src/views/spectrumAnalysis/components/SubOperators/GraphAssistance/GraphAssistance.vue
similarity index 60%
rename from src/views/spectrumAnalysis/components/SubOperators/GraphAssistance.vue
rename to src/views/spectrumAnalysis/components/SubOperators/GraphAssistance/GraphAssistance.vue
index a388db6..1fb81bd 100644
--- a/src/views/spectrumAnalysis/components/SubOperators/GraphAssistance.vue
+++ b/src/views/spectrumAnalysis/components/SubOperators/GraphAssistance/GraphAssistance.vue
@@ -4,14 +4,14 @@
- {{ item.activeLabel }}
-
+ {{ value[item.key] }}
+
{{ item.label[0] }}
-
+
@@ -21,72 +21,60 @@
@@ -122,10 +110,6 @@ export default {
}
}
-.no-change {
- background-color: @primary-color;
-}
-
.ant-switch {
&::after {
background-color: #fff;
diff --git a/src/views/spectrumAnalysis/components/SubOperators/GraphAssistance/TwoLabelSwitch.vue b/src/views/spectrumAnalysis/components/SubOperators/GraphAssistance/TwoLabelSwitch.vue
new file mode 100644
index 0000000..23e8136
--- /dev/null
+++ b/src/views/spectrumAnalysis/components/SubOperators/GraphAssistance/TwoLabelSwitch.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/spectrumAnalysis/gamma-analysis.vue b/src/views/spectrumAnalysis/gamma-analysis.vue
index d2b833e..d7b0d48 100644
--- a/src/views/spectrumAnalysis/gamma-analysis.vue
+++ b/src/views/spectrumAnalysis/gamma-analysis.vue
@@ -14,8 +14,8 @@
Graph Assistance
@@ -114,7 +114,7 @@ import CustomChart from '@/components/CustomChart/index.vue'
import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue'
import DetailedInfomation from './components/SubOperators/DetailedInfomation.vue'
import QcFlags from './components/SubOperators/QcFlags.vue'
-import GraphAssistance from './components/SubOperators/GraphAssistance.vue'
+import GraphAssistance from './components/SubOperators/GraphAssistance/GraphAssistance.vue'
import NuclideLibrary from './components/SubOperators/NuclideLibrary.vue'
import ButtonWithSwitchIcon from './components/SubOperators/ButtonWithSwitchIcon.vue'
import { getAction, postAction } from '@/api/manage'
@@ -140,6 +140,7 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
import StripModal from './components/Modals/StripModal.vue'
import { FilePicker } from '@/utils/FilePicker'
import { zipFile } from '@/utils/file'
+import { mapMutations } from 'vuex'
export default {
props: {
@@ -298,9 +299,6 @@ export default {
const { dbName, sampleId } = this.sample
try {
this.isLoading = true
-
- this.handleResetState()
-
// const { success, result, message } = Response
this.cancelLastRequest()
const cancelToken = this.createCancelToken()
@@ -330,7 +328,6 @@ export default {
const { inputFileName: fileName } = this.sample
try {
this.isLoading = true
- this.handleResetState()
// const { success, result, message } = Response
this.cancelLastRequest()
@@ -435,107 +432,47 @@ export default {
}
this.resetThumbnailChartDataMax()
- const series = []
- // 推入Spectrum Line
- series.push(
- buildLineSeries(
- 'Spectrum',
- this.transformPointListData(shadowChannelChart.pointlist),
- shadowChannelChart.color,
- {
- symbolSize: 2,
- markLine: {
- silent: true,
- symbol: 'none',
- label: {
- show: false,
- },
- lineStyle: {
- color: 'red',
- width: 1,
- },
- data: [{ xAxis: -1 }],
- },
- }
- )
+ // 设置 Spectrum Line
+ this.redrawLineBySeriesName('Spectrum', shadowEnergyChart, shadowChannelChart, true, shadowChannelChart.color)
+
+ // 设置 BaseLine
+ this.setSeriesData(
+ this.option.series,
+ 'BaseLine',
+ this.transformPointListData(channelBaseLine.pointlist),
+ channelBaseLine.color
)
- // 右上角缩略图设置Spectrum Line 数据
+ // 设置 LcLine
+ this.setSeriesData(
+ this.option.series,
+ 'LcLine',
+ this.transformPointListData(channelLcLine.pointlist),
+ channelLcLine.color
+ )
+
+ // 设置 ScacLine
+ this.setSeriesData(
+ this.option.series,
+ 'ScacLine',
+ this.transformPointListData(channelScacLine.pointlist),
+ channelScacLine.color
+ )
+
+ // 设置 基线控制点
+ this.redrawCtrlPointBySeriesName()
+
+ // 设置 Peak Line
+ this.redrawPeakLine()
+
+ // 设置右上角缩略图 Spectrum Line 数据
this.setSeriesData(
this.thumbnailOption.series,
'Spectrum',
this.transformPointListData(shadowChannelChart.pointlist),
shadowChannelChart.color
)
-
- // 推入BaseLine
- series.push(
- buildLineSeries('BaseLine', this.transformPointListData(channelBaseLine.pointlist), channelBaseLine.color, {
- z: 2,
- })
- )
-
- // 推入LcLine线
- series.push(
- buildLineSeries('LcLine', this.transformPointListData(channelLcLine.pointlist), channelLcLine.color, {
- z: 3,
- })
- )
-
- // 推入Scac线
- series.push(
- buildLineSeries('ScacLine', this.transformPointListData(channelScacLine.pointlist), channelScacLine.color, {
- z: 4,
- })
- )
-
- // 推入基线控制点
- series.push({
- name: 'BaseLine_Ctrl_Point',
- type: 'scatter',
- data: shapeChannelData.map(({ size, color, point: { x, y } }) => {
- return {
- value: [x, y],
- itemStyle: {
- color: 'transparent',
- borderColor: color,
- borderWidth: size / 2,
- },
- }
- }),
- emphasis: {
- disabled: true,
- },
- animation: false,
- z: 5,
- })
-
- // 推入Peak Line
- const peakLines = []
- channelPeakGroup.forEach((item, index) => {
- peakLines.push(
- buildLineSeries(`Peak_${index}`, this.transformPointListData(item.pointlist), item.color, {
- z: 6,
- })
- )
- })
- series.push(...peakLines)
-
- // 推入Compare Line
- series.push(
- buildLineSeries('Compare', [], '#fff', {
- symbolSize: 2,
- z: 7,
- })
- )
-
- this.opts.notMerge = true
- this.option.series = series
-
- this.$nextTick(() => {
- this.resetChartOpts()
- })
},
// chart 的 tooltip
@@ -559,68 +496,93 @@ export default {
},
// Graph Assistance 操作
- handleGraphAssistanceChange({ type, label, value }) {
+ handleGraphAssistanceChange(key) {
+ const value = this.graphAssistance[key]
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':
+ switch (key) {
+ // 折线y轴类型变化
+ case 'chartYAxisType':
+ if (value == 'Linear') {
this.option.yAxis.type = 'value'
this.thumbnailOption.yAxis.type = 'value'
- this.handleResetChart()
- break
- case 'Log10':
+ } else {
this.option.yAxis.type = 'log'
this.thumbnailOption.yAxis.type = 'log'
- this.handleResetChart()
- break
- case 'Channel':
- case 'Energy':
- // 如果Energy没有值,则不进行切换
- if (!this.energyData.all.pointlist) {
- return
+ }
+ this.handleResetChart()
+ break
+
+ // 红色竖线是否显示
+ case 'Cursor':
+ if (value) {
+ spectrumLineSeries.markLine.lineStyle.width = 2
+ } else {
+ spectrumLineSeries.markLine.lineStyle.width = 0
+ }
+ break
+
+ // 基线是否显示
+ case 'Baseline':
+ this.redrawLineBySeriesName('BaseLine', this.energyData.baseLine, this.channelData.baseLine, value)
+ break
+
+ // Lc 线是否显示
+ case 'Lc':
+ this.redrawLineBySeriesName('LcLine', this.energyData.lcLine, this.channelData.lcLine, value)
+ break
+
+ // Channel和Energy的切换
+ case 'axisType':
+ // 如果Energy没有值,则不进行切换
+ if (!this.energyData.all.pointlist) {
+ if (value == 'Energy') {
+ this.graphAssistance[key] = 'Channel'
}
+ this.$message.warn('Has No Energy Yet')
+ return
+ }
- this.graphAssistance.axisType = label
- this.option.xAxis.name = label
+ this.option.xAxis.name = value
- this.handleResetChart()
+ this.handleResetChart()
- this.redrawLineBySeriesName(
- 'BaseLine',
- this.energyData.baseLine,
- this.channelData.baseLine,
- this.graphAssistance.Baseline
- )
- this.redrawLineBySeriesName(
- 'LcLine',
- this.energyData.lcLine,
- this.channelData.lcLine,
- this.graphAssistance.Lc
- )
- this.redrawLineBySeriesName(
- 'ScacLine',
- this.energyData.scacLine,
- this.channelData.scacLine,
- this.graphAssistance.SCAC
- )
+ this.redrawLineBySeriesName(
+ 'BaseLine',
+ this.energyData.baseLine,
+ this.channelData.baseLine,
+ this.graphAssistance.Baseline
+ )
+ this.redrawLineBySeriesName(
+ 'LcLine',
+ this.energyData.lcLine,
+ this.channelData.lcLine,
+ this.graphAssistance.Lc
+ )
+ this.redrawLineBySeriesName(
+ 'ScacLine',
+ this.energyData.scacLine,
+ this.channelData.scacLine,
+ this.graphAssistance.SCAC
+ )
- this.redrawLineBySeriesName('Spectrum', this.energyData.spectrumLine, this.channelData.spectrumLine)
- this.redrawCtrlPointBySeriesName()
- this.redrawPeakLine()
+ this.redrawLineBySeriesName('Spectrum', this.energyData.spectrumLine, this.channelData.spectrumLine)
+ this.redrawCtrlPointBySeriesName()
+ this.redrawPeakLine()
- this.redrawThumbnailChart()
+ this.redrawThumbnailChart()
- if (this.channelCompareLine) {
- this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
- }
- break
- case 'Lines':
- this.graphAssistance.spectrumType = 'Lines'
+ if (this.channelCompareLine) {
+ this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
+ }
+ break
+
+ // Lines 和 Scatter 的切换
+ case 'spectrumType':
+ if (value == 'Lines') {
spectrumLineSeries.type = 'line'
spectrumLineSeries.symbol = 'none'
@@ -635,10 +597,7 @@ export default {
if (this.channelCompareLine) {
this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
}
- break
- case 'Scatter':
- this.graphAssistance.spectrumType = 'Scatter'
-
+ } else {
spectrumLineSeries.type = 'scatterGL'
spectrumLineSeries.symbol = 'circle'
@@ -651,35 +610,18 @@ export default {
this.$nextTick(() => {
this.rangeScatter()
})
- break
- }
- }
- // 值变化
- else if (type == 'valueChange') {
- this.graphAssistance[label] = value
+ }
+ break
- switch (label) {
- case 'Cursor':
- // 显示红色竖线
- if (value) {
- spectrumLineSeries.markLine.lineStyle.width = 2
- } else {
- spectrumLineSeries.markLine.lineStyle.width = 0
- }
- break
- case 'Baseline':
- this.redrawLineBySeriesName('BaseLine', this.energyData.baseLine, this.channelData.baseLine, value)
- break
- case 'Lc':
- this.redrawLineBySeriesName('LcLine', this.energyData.lcLine, this.channelData.lcLine, value)
- break
- case 'SCAC':
- this.redrawLineBySeriesName('ScacLine', this.energyData.scacLine, this.channelData.scacLine, value)
- break
- }
+ // SCAC 线是否显示
+ case 'SCAC':
+ this.redrawLineBySeriesName('ScacLine', this.energyData.scacLine, this.channelData.scacLine, value)
+ break
}
},
+ changeSeriesType() {},
+
handleChangeNuclideVisible() {
this.nuclideLibraryVisible = !this.nuclideLibraryVisible
},
@@ -710,11 +652,17 @@ export default {
})
},
+ clearPeakLine() {
+ this.opts.notMerge = true
+ this.option.series.splice(6)
+ this.$nextTick(() => {
+ this.resetChartOpts()
+ })
+ },
+
// 重绘Peak Line
redrawPeakLine() {
- this.option.series = this.option.series.filter((item) => {
- return !item.name.includes('Peak_')
- })
+ this.clearPeakLine()
const data = this.isEnergy() ? this.energyData.peakGroup : this.channelData.peakGroup
const peakLines = []
@@ -1179,9 +1127,9 @@ export default {
// 从分析工具刷新部分数据
handleRefresh(data) {
- this.handleResetState()
data.DetailedInformation = this.detailedInfomation
this.clearCompareLine()
+ this.redrawPeakLine()
this.dataProcess(data)
},
@@ -1416,23 +1364,10 @@ export default {
this.selectedChannel = -1
this.nuclideLibraryList = []
this.closePeakInfomationTooltip()
- this.option.series = []
+ this.clearPeakLine()
this.option.xAxis.name = 'Channel'
- this.option.yAxis.type = 'value'
- this.thumbnailOption.yAxis.type = 'value'
-
- if (this.option.series.length) {
- const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
- spectrumLineSeries.type = 'line'
- spectrumLineSeries.symbol = 'none'
- spectrumLineSeries.markLine.lineStyle.width = 2
- }
-
- const thumbnailSpectrumLineSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
- thumbnailSpectrumLineSeries.type = 'line'
- thumbnailSpectrumLineSeries.symbol = 'none'
-
- this.graphAssistance = cloneDeep(graphAssistance)
+ this.option.yAxis.type = 'log'
+ this.thumbnailOption.yAxis.type = 'log'
},
/**
@@ -1554,6 +1489,8 @@ export default {
const arrFunc = isList ? Array.prototype.filter : Array.prototype.find
return arrFunc.call(allData, (item) => item.name == name && item.group == group) || {}
},
+
+ ...mapMutations(['ADD_SAMPLE_DATA', 'GET_SAMPLE_DATA']),
},
watch: {
currStep: {
@@ -1568,10 +1505,17 @@ export default {
sample: {
handler(newVal, oldVal) {
console.log('newValnewVal', newVal)
- if (newVal.sampleId) {
- this.getSampleDetail()
+ this.graphAssistance.axisType = 'Channel'
+ this.handleResetState()
+ const sampleData = this.GET_SAMPLE_DATA(newVal.inputFileName)
+ if (sampleData) {
+ console.log('%c [ ]-1521', 'font-size:13px; background:pink; color:#bf2c9f;', sampleData)
} else {
- this.getSampleDetail_file()
+ if (newVal.sampleId) {
+ this.getSampleDetail()
+ } else {
+ this.getSampleDetail_file()
+ }
}
},
immediate: true,
diff --git a/src/views/spectrumAnalysis/seriesBuilder.js b/src/views/spectrumAnalysis/seriesBuilder.js
new file mode 100644
index 0000000..e011769
--- /dev/null
+++ b/src/views/spectrumAnalysis/seriesBuilder.js
@@ -0,0 +1,46 @@
+import { buildLineSeries } from '@/utils/chartHelper'
+
+export const spectrumSeries = buildLineSeries('Spectrum', [], '#fff', {
+ symbolSize: 2,
+ markLine: {
+ silent: true,
+ symbol: 'none',
+ label: {
+ show: false
+ },
+ lineStyle: {
+ color: 'red',
+ width: 1
+ },
+ data: [{ xAxis: -1 }]
+ },
+ z: 1
+})
+
+export const baseLineSeries = buildLineSeries('BaseLine', [], '#fff', {
+ z: 2
+})
+
+export const lcLineSeries = buildLineSeries('LcLine', [], '#fff', {
+ z: 3
+})
+
+export const scacLineSeries = buildLineSeries('ScacLine', [], '#fff', {
+ z: 4
+})
+
+export const baseLineCtrlPoint = {
+ name: 'BaseLine_Ctrl_Point',
+ type: 'scatter',
+ data: [],
+ emphasis: {
+ disabled: true
+ },
+ animation: false,
+ z: 5
+}
+
+export const compareLineSeries = buildLineSeries('Compare', [], '#fff', {
+ symbolSize: 2,
+ z: 7
+})
diff --git a/src/views/spectrumAnalysis/settings.js b/src/views/spectrumAnalysis/settings.js
index 3a89271..b039cf6 100644
--- a/src/views/spectrumAnalysis/settings.js
+++ b/src/views/spectrumAnalysis/settings.js
@@ -1,4 +1,5 @@
import { buildLineSeries } from "@/utils/chartHelper"
+import { baseLineCtrlPoint, baseLineSeries, compareLineSeries, lcLineSeries, scacLineSeries, spectrumSeries } from "./seriesBuilder"
export const GammaOptions = {
option: {
@@ -98,7 +99,7 @@ export const GammaOptions = {
}
}
},
- series: [],
+ series: [spectrumSeries, baseLineSeries, lcLineSeries, scacLineSeries, baseLineCtrlPoint, compareLineSeries],
brush: {}
},
// 缩略图配置
@@ -158,10 +159,14 @@ export const GammaOptions = {
}
}
+console.log('%c [ ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', GammaOptions.option)
+
export const graphAssistance = {
+ chartYAxisType: 'Log10',
+ Cursor: true,
+ Baseline: true,
+ Lc: true,
axisType: 'Channel',
spectrumType: 'Lines',
- Baseline: true,
SCAC: true,
- Lc: true,
}
\ No newline at end of file