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

This commit is contained in:
xiaoguangbin 2023-10-25 18:38:15 +08:00
commit e105d4c8e0
9 changed files with 432 additions and 335 deletions

View File

@ -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: {

View File

@ -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

View File

@ -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
}

View File

@ -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)
}
}
}
},
},
}
</script>

View File

@ -4,14 +4,14 @@
<div class="graph-assistance-item" v-for="(item, index) in items" :key="index">
<!-- 两个Label来回切换的 -->
<template v-if="item.label.length > 1">
<span>{{ item.activeLabel }}</span>
<a-switch class="no-change" v-model="item.checked" @change="handleChangeLabel(item)"></a-switch>
<span>{{ value[item.key] }}</span>
<two-label-switch :items="item.label" v-model="value[item.key]" @change="handleChange(item.key)" />
</template>
<!-- 只有一个Label点击改变状态的 -->
<template v-else>
<span>{{ item.label[0] }}</span>
<a-switch v-model="item.checked" @change="handleChange(item)"></a-switch>
<a-switch v-model="value[item.key]" @change="handleChange(item.key)"></a-switch>
</template>
</div>
</div>
@ -21,72 +21,60 @@
<script>
import { cloneDeep } from 'lodash'
import TwoLabelSwitch from './TwoLabelSwitch.vue'
const items = [
{
label: ['Linear', 'Log10'],
checked: false,
activeLabel: 'Linear'
key: 'chartYAxisType',
},
{
label: ['Cursor'],
checked: true
key: 'Cursor',
},
{
label: ['Lc'],
checked: true
key: 'Lc',
},
{
label: ['Baseline'],
checked: true
key: 'Baseline',
},
{
label: ['Channel', 'Energy'],
checked: false,
activeLabel: 'Channel'
key: 'axisType',
},
{
label: ['Lines', 'Scatter'],
checked: false,
activeLabel: 'Lines'
key: 'spectrumType',
},
{
label: ['SCAC'],
checked: true
}
key: 'SCAC',
},
]
export default {
components: { TwoLabelSwitch },
props: {
value: {
type: Object,
default: () => ({}),
},
},
data() {
return {
items: cloneDeep(items)
items: cloneDeep(items),
}
},
methods: {
handleChangeLabel(item) {
if (item.activeLabel == item.label[0]) {
item.activeLabel = item.label[1]
} else {
item.activeLabel = item.label[0]
}
this.$emit('change', {
type: 'labelChange',
label: item.activeLabel
})
},
handleChange(item) {
this.$emit('change', {
type: 'valueChange',
label: item.label[0],
value: item.checked
})
handleChange(key) {
this.$emit('change', key)
},
handleReset() {
this.$emit('reset')
}
}
},
},
}
</script>
@ -122,10 +110,6 @@ export default {
}
}
.no-change {
background-color: @primary-color;
}
.ant-switch {
&::after {
background-color: #fff;

View File

@ -0,0 +1,54 @@
<template>
<div class="two-label-switch">
<a-switch class="no-change" v-model="checked" @change="handleChange"> </a-switch>
</div>
</template>
<script>
export default {
props: {
value: {
type: String,
},
items: {
type: Array,
default: () => [],
},
},
created() {
if (this.items.length !== 2) {
throw new Error('此组件需要两个值')
}
},
methods: {
handleChange() {
this.$emit('change')
}
},
computed: {
checked: {
set(val) {
this.$emit('input', val == true ? this.items[1] : this.items[0])
},
get() {
return this.value == this.items[1] ? true : false
},
},
},
}
</script>
<style lang="less" scoped>
.two-label-switch {
display: inline-block;
.no-change {
background-color: @primary-color;
}
.ant-switch {
&::after {
background-color: #fff;
}
}
}
</style>

View File

@ -14,8 +14,8 @@
<pop-over-with-icon>
Graph Assistance
<graph-assistance
v-if="!isLoading"
slot="content"
v-model="graphAssistance"
@change="handleGraphAssistanceChange"
@reset="handleResetChart"
/>
@ -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
// ChannelEnergy
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,

View File

@ -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
})

View File

@ -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,
}