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

This commit is contained in:
orgin 2023-10-07 08:46:47 +08:00
commit af6aa12959
26 changed files with 1507 additions and 658 deletions

View File

@ -6,7 +6,7 @@ import * as echarts from 'echarts'
import 'echarts-gl' import 'echarts-gl'
const events = ['click', 'brushEnd'] const events = ['click', 'brushEnd']
const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click'] const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick']
export default { export default {
props: { props: {
option: { option: {

View File

@ -63,8 +63,10 @@ export default {
if (this.okHandler instanceof Function) { if (this.okHandler instanceof Function) {
try { try {
this.confirmLoading = true this.confirmLoading = true
await this.okHandler() const success = await this.okHandler()
this.visible = false if(success !== false) {
this.visible = false
}
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} finally { } finally {

View File

@ -99,9 +99,20 @@ export function findSeriesByName(series, seriesName) {
* 限定数字在一定范围 * 限定数字在一定范围
* @param {Number} min * @param {Number} min
* @param {Number} max * @param {Number} max
* @returns {(num: number) => number }
*/ */
export function rangeNumber(min, max) { export function rangeNumber(min, max) {
return num => { return num => {
return num > max ? max : num < min ? min : 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]
} }

10
src/utils/number.js Normal file
View File

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

View File

@ -16,6 +16,7 @@
:options="SampleType" :options="SampleType"
@change="changeChartByType" @change="changeChartByType"
style="width: 246px" style="width: 246px"
class="sample-select"
></custom-select> ></custom-select>
</div> </div>
@ -132,6 +133,7 @@ import BetaGammaQcFlags from './components/SubOperators/BetaGammaQcFlags.vue'
import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue' import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue'
import Spectra from './components/SubOperators/Spectra.vue' import Spectra from './components/SubOperators/Spectra.vue'
import CustomSelect from '@/components/CustomSelect/index.vue' import CustomSelect from '@/components/CustomSelect/index.vue'
import axios from 'axios'
const StatisticsType = { const StatisticsType = {
'Collection Time': 'Colloc_Time', 'Collection Time': 'Colloc_Time',
@ -218,6 +220,9 @@ export default {
currSample: {}, currSample: {},
} }
}, },
destroyed() {
this.cancelLastRequest()
},
methods: { methods: {
handleGetFlag(val, obj) { handleGetFlag(val, obj) {
this.resultDisplay.forEach((item) => { this.resultDisplay.forEach((item) => {
@ -233,10 +238,16 @@ export default {
const { dbName, sampleId } = this.sample const { dbName, sampleId } = this.sample
try { try {
this.isLoading = true this.isLoading = true
const { success, result, message } = await getAction('/spectrumAnalysis/getDBSpectrumChart', { this.cancelLastRequest()
dbName, const cancelToken = this.createCancelToken()
sampleId, const { success, result, message } = await getAction(
}) '/spectrumAnalysis/getDBSpectrumChart',
{
dbName,
sampleId,
},
cancelToken
)
if (success) { if (success) {
this.sampleDetail = result this.sampleDetail = result
this.changeChartByType('sample') this.changeChartByType('sample')
@ -263,7 +274,13 @@ export default {
} }
try { try {
this.isLoading = true this.isLoading = true
const { success, result, message } = await getAction('/spectrumAnalysis/getFileSpectrumChart', params) this.cancelLastRequest()
const cancelToken = this.createCancelToken()
const { success, result, message } = await getAction(
'/spectrumAnalysis/getFileSpectrumChart',
params,
cancelToken
)
if (success) { if (success) {
this.sampleDetail = result this.sampleDetail = result
this.changeChartByType('sample') this.changeChartByType('sample')
@ -276,6 +293,19 @@ export default {
} }
}, },
cancelLastRequest() {
if (this._cancelToken && typeof this._cancelToken == 'function') {
this._cancelToken()
}
},
createCancelToken() {
const cancelToken = new axios.CancelToken((c) => {
this._cancelToken = c
})
return cancelToken
},
changeChartByType(val) { changeChartByType(val) {
if (val === 'qc' && !this.sample.qcFileStatus) { if (val === 'qc' && !this.sample.qcFileStatus) {
this.$message.warning('No qc spectrum file!') this.$message.warning('No qc spectrum file!')
@ -437,6 +467,15 @@ export default {
} }
} }
.sample-select {
::v-deep {
.ant-select-selection {
background-color: transparent !important;
color: #ade6ee;
}
}
}
&-main { &-main {
height: calc(100% - 51px); height: calc(100% - 51px);
display: flex; display: flex;

View File

@ -358,6 +358,8 @@ export default {
this.emitRangeChange([0, 256, 0, 256]) this.emitRangeChange([0, 256, 0, 256])
this.reDrawRect() this.reDrawRect()
this.rangeScatter()
}, },
// ROI // ROI
@ -436,11 +438,29 @@ export default {
this.emitRangeChange([x1, x2, y1, y2]) this.emitRangeChange([x1, x2, y1, y2])
this.reDrawRect() this.reDrawRect()
this.rangeScatter()
} }
this.clearBrush(chart) 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) { emitRangeChange(range) {
this.$emit('rangeChange', range) this.$emit('rangeChange', range)
@ -462,6 +482,7 @@ export default {
} }
this.reDrawRect() this.reDrawRect()
this.rangeScatter()
}, },
// //
@ -705,6 +726,7 @@ export default {
handler(newVal) { handler(newVal) {
this.active = 0 this.active = 0
this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 2D Scatter this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 2D Scatter
this.rangeScatter()
}, },
immediate: true immediate: true
}, },

View File

@ -407,6 +407,12 @@ const thumbnailOption = {
series: null series: null
} }
const nuclideIdentifyModal = {
possibleNuclide: '',
tolerance: 0.5,
identifiedNuclide: ''
}
// //
export const Operators = { export const Operators = {
ADD: 1, // ADD: 1, //
@ -442,6 +448,7 @@ export default {
energy: [], energy: [],
list: [], list: [],
BaseCtrls: {}, BaseCtrls: {},
FitBaseLine: '#fff',
sampleId: -1, sampleId: -1,
peakCommentModalVisible: false, // Comment peakCommentModalVisible: false, // Comment
@ -454,11 +461,7 @@ export default {
fitPeaksAndBaselineModalVisible: false, // Fit Peaks And Base Line fitPeaksAndBaselineModalVisible: false, // Fit Peaks And Base Line
nuclideReviewModalVisible: false, // Nuclide Review nuclideReviewModalVisible: false, // Nuclide Review
model: { model: cloneDeep(nuclideIdentifyModal),
possibleNuclide: '',
tolerance: 0.5,
identifiedNuclide: ''
},
currChannel: undefined, // currChannelchannel currChannel: undefined, // currChannelchannel
selectedTableItem: undefined, // selectedTableItem: undefined, //
@ -483,6 +486,9 @@ export default {
try { try {
this.isLoading = true this.isLoading = true
this.option.series = [] this.option.series = []
this.thumbnailOption.series = []
this.list = []
this.model = cloneDeep(nuclideIdentifyModal)
const { success, result, message } = await getAction('/gamma/InteractiveTool', { const { success, result, message } = await getAction('/gamma/InteractiveTool', {
sampleId: this.sampleId, sampleId: this.sampleId,
@ -501,7 +507,8 @@ export default {
channelPeakChart, channelPeakChart,
energy, energy,
table, table,
BaseCtrls BaseCtrls,
FitBaseLine
} = result } = result
console.log('%c [ ]-374', 'font-size:13px; background:pink; color:#bf2c9f;', result) console.log('%c [ ]-374', 'font-size:13px; background:pink; color:#bf2c9f;', result)
@ -512,6 +519,7 @@ export default {
this.channelPeakChart = channelPeakChart this.channelPeakChart = channelPeakChart
this.energy = energy this.energy = energy
this.BaseCtrls = BaseCtrls this.BaseCtrls = BaseCtrls
this.FitBaseLine = FitBaseLine
const series = [] const series = []
@ -1246,7 +1254,7 @@ export default {
const baseLineEditSeries = buildLineSeries( const baseLineEditSeries = buildLineSeries(
'BaseLine_Edit', 'BaseLine_Edit',
this._channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]), this._channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]),
'#fff', this.FitBaseLine,
{ {
zlevel: 21 zlevel: 21
} }
@ -1296,6 +1304,8 @@ export default {
buildGraphicRect(xAxis, yAxis) { buildGraphicRect(xAxis, yAxis) {
const chart = this.$refs.chartRef.getChartInstance() const chart = this.$refs.chartRef.getChartInstance()
const [xPix, yPix] = chart.convertToPixel('grid', [xAxis, yAxis]) const [xPix, yPix] = chart.convertToPixel('grid', [xAxis, yAxis])
const that = this
return { return {
type: 'rect', type: 'rect',
id: Math.random().toString(), id: Math.random().toString(),
@ -1312,12 +1322,12 @@ export default {
fill: 'transparent', fill: 'transparent',
lineWidth: 2 lineWidth: 2
}, },
draggable: false, draggable: this.isModifying,
ondrag: function() { ondrag: function() {
const [xPixel] = chart.convertToPixel('grid', [xAxis, yAxis]) const [xPixel] = chart.convertToPixel('grid', [xAxis, yAxis])
// x // x
this.position[0] = xPixel this.position[0] = xPixel
this.redrawBaseLine() that.redrawBaseLine()
}, },
ondragend: ({ offsetY }) => { ondragend: ({ offsetY }) => {
this.setGraphicDraggable(false) this.setGraphicDraggable(false)
@ -1351,7 +1361,7 @@ export default {
// 线 // 线
redrawBaseLine() { 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() { handleModifyCP() {
this.setGraphicDraggable(true) this.setGraphicDraggable(!this.isModifying)
}, },
// //
@ -1560,7 +1570,7 @@ export default {
this.channelBaseCPChart = this._channelBaseCPChart this.channelBaseCPChart = this._channelBaseCPChart
this.handleSwitchOperation() this.handleSwitchOperation()
this.$bus.$emit('accept') this.$bus.$emit('accept')
}, },

View File

@ -13,44 +13,40 @@
<a-form-model :colon="false" :labelCol="{ style: { width: '160px' } }"> <a-form-model :colon="false" :labelCol="{ style: { width: '160px' } }">
<a-form-model-item label="ECutAnalysis_Low"> <a-form-model-item label="ECutAnalysis_Low">
<div class="input-with-unit"> <div class="input-with-unit">
<a-input-number v-model="model.edit_ps_low"></a-input-number> <a-input v-model="model.edit_ps_low"></a-input>
KeV KeV
</div> </div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="ECutAnalysis_High"> <a-form-model-item label="ECutAnalysis_High">
<div class="input-with-unit"> <div class="input-with-unit">
<a-input-number v-model="model.edit_ps_high"></a-input-number> <a-input v-model="model.edit_ps_high"></a-input>
KeV KeV
</div> </div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="EnergyTolerance"> <a-form-model-item label="EnergyTolerance">
<div class="input-with-unit"> <div class="input-with-unit">
<a-input-number v-model="model.edit_energy"></a-input-number> <a-input v-model="model.edit_energy"></a-input>
KeV KeV
</div> </div>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="PSS_low"> <a-form-model-item label="PSS_low">
<a-input-number v-model="model.edit_pss_low"></a-input-number> <a-input v-model="model.edit_pss_low"></a-input>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</title-over-border> </title-over-border>
<title-over-border title="Calibration Peak Searching"> <title-over-border title="Calibration Peak Searching">
<a-form-model :colon="false" :labelCol="{ style: { width: '170px' } }"> <a-form-model :colon="false" :labelCol="{ style: { width: '170px' } }">
<a-form-model-item label="CalibrationPSS_low"> <a-form-model-item label="CalibrationPSS_low">
<a-input-number v-model="model.edit_cal_low" disabled></a-input-number> <a-input v-model="model.edit_cal_low" disabled></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="CalibrationPSS_high"> <a-form-model-item label="CalibrationPSS_high">
<a-input-number v-model="model.edit_cal_high" disabled></a-input-number> <a-input v-model="model.edit_cal_high" disabled></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item> <a-form-model-item>
<a-checkbox v-model="model.checkBox_updateCal" disabled> <a-checkbox v-model="model.checkBox_updateCal" disabled> Update Calibration </a-checkbox>
Update Calibration
</a-checkbox>
</a-form-model-item> </a-form-model-item>
<a-form-model-item> <a-form-model-item>
<a-checkbox v-model="model.checkBox_keepPeak" disabled> <a-checkbox v-model="model.checkBox_keepPeak" disabled> Keep Calibration Peak Search Peaks </a-checkbox>
Keep Calibration Peak Search Peaks
</a-checkbox>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</title-over-border> </title-over-border>
@ -61,13 +57,13 @@
<title-over-border title="Baseline Param"> <title-over-border title="Baseline Param">
<a-form-model :colon="false" :labelCol="{ style: { width: '90px' } }"> <a-form-model :colon="false" :labelCol="{ style: { width: '90px' } }">
<a-form-model-item label="k_back"> <a-form-model-item label="k_back">
<a-input-number v-model="model.edit_k_back"></a-input-number> <a-input v-model="model.edit_k_back"></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="k_alpha"> <a-form-model-item label="k_alpha">
<a-input-number v-model="model.edit_k_alpha"></a-input-number> <a-input v-model="model.edit_k_alpha"></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="k_beta"> <a-form-model-item label="k_beta">
<a-input-number v-model="model.edit_k_beta"></a-input-number> <a-input v-model="model.edit_k_beta"></a-input>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</title-over-border> </title-over-border>
@ -75,12 +71,12 @@
<a-form-model :colon="false" :labelCol="{ style: { width: '150px' } }"> <a-form-model :colon="false" :labelCol="{ style: { width: '150px' } }">
<title-over-border title="BaseImprove"> <title-over-border title="BaseImprove">
<a-form-model-item label="BaseImprovePSS"> <a-form-model-item label="BaseImprovePSS">
<a-input-number v-model="model.edit_bi_pss"></a-input-number> <a-input v-model="model.edit_bi_pss"></a-input>
</a-form-model-item> </a-form-model-item>
</title-over-border> </title-over-border>
<title-over-border title="LC Computing" style="margin-top: 20px"> <title-over-border title="LC Computing" style="margin-top: 20px">
<a-form-model-item label="RiskLevelK"> <a-form-model-item label="RiskLevelK">
<a-input-number v-model="model.edit_riskLevelK"></a-input-number> <a-input v-model="model.edit_riskLevelK"></a-input>
</a-form-model-item> </a-form-model-item>
</title-over-border> </title-over-border>
</a-form-model> </a-form-model>
@ -90,10 +86,20 @@
<!-- 第三行 --> <!-- 第三行 -->
<div class="analysis-settings-item"> <div class="analysis-settings-item">
<title-over-border title="Activity Reference Time"> <title-over-border title="Activity Reference Time">
<custom-date-picker show-time v-model="model.dateTime_Act"></custom-date-picker> <custom-date-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="model.dateTime_Act"
></custom-date-picker>
</title-over-border> </title-over-border>
<title-over-border title="Concentration Reference Time"> <title-over-border title="Concentration Reference Time">
<custom-date-picker show-time v-model="model.dateTime_Conc"></custom-date-picker> <custom-date-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="model.dateTime_Conc"
></custom-date-picker>
</title-over-border> </title-over-border>
</div> </div>
@ -106,10 +112,11 @@
</template> </template>
<script> <script>
import { getAction } from '@/api/manage' import { getAction, postAction } from '@/api/manage'
import TitleOverBorder from '../TitleOverBorder.vue' import TitleOverBorder from '../TitleOverBorder.vue'
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
import moment from 'moment'
export default { export default {
components: { TitleOverBorder }, components: { TitleOverBorder },
@ -117,7 +124,7 @@ export default {
data() { data() {
return { return {
isLoading: false, isLoading: false,
model: {} model: {},
} }
}, },
methods: { methods: {
@ -127,13 +134,18 @@ export default {
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/configure', { const { success, result, message } = await getAction('/gamma/configure', {
sampleId, sampleId,
fileName fileName,
}) })
this.isLoading = false this.isLoading = false
if (success) { if (success) {
this.model = result if (result.edit_ps_high == -9999) {
result.edit_ps_high = 'inf'
}
console.log('%c [ ]-137', 'font-size:13px; background:pink; color:#bf2c9f;', result) result.dateTime_Act = moment(result.dateTime_Act).format('YYYY/MM/DD HH:mm:ss')
result.dateTime_Conc = moment(result.dateTime_Conc).format('YYYY/MM/DD HH:mm:ss')
this.model = result
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
@ -145,10 +157,56 @@ export default {
beforeModalOpen() { beforeModalOpen() {
this.getInfo() this.getInfo()
}, },
handleOk() { async handleOk() {
console.log('%c [ handleOk ]-121', 'font-size:13px; background:pink; color:#bf2c9f;') try {
} const { inputFileName: fileName } = this.sampleData
}
const {
edit_ps_low,
edit_ps_high,
edit_energy,
edit_pss_low,
edit_cal_low,
edit_cal_high,
edit_k_back,
edit_k_alpha,
edit_k_beta,
edit_bi_pss,
edit_riskLevelK,
dateTime_Act,
dateTime_Conc,
} = this.model
const param = {
fileName,
ecutAnalysis_Low: edit_ps_low,
ecutAnalysis_High: edit_ps_high == 'inf' ? -9999 : edit_ps_high,
energyTolerance: edit_energy,
pss_low: edit_pss_low,
calibrationPSS_low: edit_cal_low,
calibrationPSS_high: edit_cal_high,
k_back: edit_k_back,
k_alpha: edit_k_alpha,
k_beta: edit_k_beta,
baseImprovePSS: edit_bi_pss,
riskLevelK: edit_riskLevelK,
refTime_act: dateTime_Act,
refTime_conc: dateTime_Conc,
}
const { success, message } = await postAction('/gamma/configureSave', param)
if (success) {
this.$message.success('Save Success')
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
return false
}
},
},
} }
</script> </script>
@ -198,7 +256,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
.ant-input-number { .ant-input {
margin-right: 10px; margin-right: 10px;
} }
} }

View File

@ -1,9 +1,9 @@
<template> <template>
<custom-modal v-model="visible" :width="1000" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'"> <custom-modal v-model="visible" :width="1200" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'">
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<pre>{{ content }}</pre> <pre>{{ content }}</pre>
</a-spin> </a-spin>
<div slot="custom-footer" style="text-align: center;"> <div slot="custom-footer" style="text-align: center">
<a-space :size="20"> <a-space :size="20">
<a-button type="primary" @click="handleOk">Export</a-button> <a-button type="primary" @click="handleOk">Export</a-button>
<a-button @click="visible = false">Cancel</a-button> <a-button @click="visible = false">Cancel</a-button>
@ -14,25 +14,25 @@
<script> <script>
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '../../../../api/manage' import { getAction, postAction } from '../../../../api/manage'
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
export default { export default {
mixins: [ModalMixin, SampleDataMixin], mixins: [ModalMixin, SampleDataMixin],
props: { props: {
type: { type: {
type: Number type: Number,
}, },
extraData: { extraData: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
} },
}, },
data() { data() {
return { return {
content: '', content: '',
isLoading: true, isLoading: true,
fileName: '' fileName: '',
} }
}, },
methods: { methods: {
@ -56,15 +56,22 @@ export default {
this.content = '' this.content = ''
this.isLoading = true this.isLoading = true
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
const res = await getAction(url, { const method = this.type == 4? postAction : getAction
const res = await method(url, {
sampleId, sampleId,
fileName, fileName,
...this.extraData ...this.extraData,
}) })
if (res.success) {
this.content = res.result if (typeof res == 'string') {
this.content = res
} else { } else {
this.content = "" const { success, result, message } = res
if (success) {
this.content = result
} else {
this.$message.error(message)
}
} }
} catch (error) { } catch (error) {
console.error(error) console.error(error)
@ -77,9 +84,9 @@ export default {
this.getContent() this.getContent()
}, },
handleOk() { handleOk() {
this.fileName="" this.fileName = ''
if (this.content) { if (this.content) {
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' }); let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' })
// if (this.type == 1 || this.type == 3) { // if (this.type == 1 || this.type == 3) {
// saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'} ARR.txt`) // saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'} ARR.txt`)
// } else { // } else {
@ -88,31 +95,31 @@ export default {
let _this = this let _this = this
this.$confirm({ this.$confirm({
title: 'Please enter file name', title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName} />, content: (h) => <a-input v-model={_this.fileName} />,
okText: 'Cancle', okText: 'Cancle',
cancelText: 'Save', cancelText: 'Save',
okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}}, okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}}, cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() { onOk() {
console.log('Cancel'); console.log('Cancel')
}, },
onCancel() { onCancel() {
if (_this.fileName) { if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`) saveAs(strData, `${_this.fileName}.txt`)
} }
}, },
}); })
} else { } else {
this.$message.warning("No data can be saved!") this.$message.warning('No data can be saved!')
} }
} },
} },
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
pre { pre {
height: 450px; height: calc(100vh - 350px);
padding: 5px; padding: 5px;
overflow: auto; overflow: auto;
background-color: #285367; background-color: #285367;

View File

@ -8,14 +8,18 @@
<div class="content"> <div class="content">
<div class="settings"> <div class="settings">
<div class="channel-and-width"> <div class="channel-and-width">
<span> Channel: {{ betaGammaInfo.channel }} </span> <div>
<span> <label>Channel:</label>
<span>{{ betaGammaInfo.channel }}</span>
</div>
<div>
Gamma Channel Width: Gamma Channel Width:
<a-input-number :min="1" v-model="gammaChannelWidth" size="small"></a-input-number> <a-input-number :min="1" v-model="gammaChannelWidth" size="small"></a-input-number>
</span> </div>
</div> </div>
<div class="energy"> <div class="energy">
Energy: <span>{{ betaGammaInfo.energy }}</span> <label>Energy:</label>
<span>{{ betaGammaInfo.energy }}</span>
</div> </div>
</div> </div>
<div class="beta-gamma-chart"> <div class="beta-gamma-chart">
@ -38,28 +42,30 @@
<div class="gamma-gated-beta-spectrum"> <div class="gamma-gated-beta-spectrum">
<p>Gamma-gated Beta Spectrum: QC</p> <p>Gamma-gated Beta Spectrum: QC</p>
<div class="content"> <div class="content">
<div class="gamma-gated-chart"> <a-spin :spinning="isLoadingGammaGated">
<custom-chart <div class="gamma-gated-chart">
ref="gammaGatedChartRef" <custom-chart
:option="gammaGatedChartOption" ref="gammaGatedChartRef"
@zr:click="handleGammaGatedSpectrumChartClick" :option="gammaGatedChartOption"
/> @zr:click="handleGammaGatedSpectrumChartClick"
<a-button type="primary" size="small" @click="handleSnapshot($refs.gammaGatedChartRef)" />
>Snapshot</a-button <a-button type="primary" size="small" @click="handleSnapshot($refs.gammaGatedChartRef)"
> >Snapshot</a-button
<!-- 自定义tooltip用于点击图表后的tooltip显示 --> >
<div <!-- 自定义tooltip用于点击图表后的tooltip显示 -->
v-if="tooltipVisible" <div
class="custom-tool-tip" v-if="tooltipVisible"
:style="{ class="custom-tool-tip"
top: tooltipPosition.top + 'px', :style="{
left: tooltipPosition.left + 'px', top: tooltipPosition.top + 'px',
}" left: tooltipPosition.left + 'px',
> }"
<div class="channel">Channel: {{ tooltipChannel }}</div> >
<div class="channel">Channel: {{ tooltipChannel }}</div>
</div>
<!-- tooltip结束 -->
</div> </div>
<!-- tooltip结束 --> </a-spin>
</div>
</div> </div>
<div class="content channel-and-energy"> <div class="content channel-and-energy">
<a-form-model layout="inline"> <a-form-model layout="inline">
@ -180,6 +186,7 @@ import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/
import { graphic } from 'echarts' import { graphic } from 'echarts'
import { isNullOrUndefined } from '@/utils/util' import { isNullOrUndefined } from '@/utils/util'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin' import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import axios from 'axios'
const initialBetaGammaChartOption = { const initialBetaGammaChartOption = {
grid: { grid: {
@ -538,11 +545,6 @@ const newCalibrationFuncModel = {
export default { export default {
mixins: [SampleDataMixin], mixins: [SampleDataMixin],
components: { CustomChart, TitleOverBorder }, components: { CustomChart, TitleOverBorder },
props: {
sampleId: {
type: Number,
},
},
data() { data() {
this.columns = columns this.columns = columns
@ -553,6 +555,7 @@ export default {
list: [], list: [],
isLoading: false, isLoading: false,
isLoadingGammaGated: false,
gammaEnergy: [], gammaEnergy: [],
gammaGatedBetaSpectrum: [], gammaGatedBetaSpectrum: [],
@ -596,9 +599,7 @@ export default {
} }
}, },
created() { created() {
// if (this.sampleId) {
this.getData() this.getData()
// }
}, },
methods: { methods: {
handleExit() { handleExit() {
@ -676,17 +677,27 @@ export default {
// //
async getGammaGated(gammaChannel) { async getGammaGated(gammaChannel) {
try { try {
this.cancelLastRequest()
const cancelToken = this.createCancelToken()
this.isLoadingGammaGated = true
const { sampleId, qcFileName } = this.newSampleData
const { const {
success, success,
result: { data }, result: { data },
message, message,
} = await getAction('/spectrumAnalysis/getGammaGated', { } = await getAction(
gammaChannel, '/spectrumAnalysis/getGammaGated',
sampleId: this.sampleId, {
chartHeight: this.gammaEnergy.length, gammaChannel,
channelWidth: this.gammaChannelWidth, sampleId,
}) chartHeight: this.gammaEnergy.length,
channelWidth: this.gammaChannelWidth,
qcFileName,
},
cancelToken
)
if (success) { if (success) {
this.isLoadingGammaGated = false
const max = Math.max(...data.map(({ y }) => y)) const max = Math.max(...data.map(({ y }) => y))
const { max: _max, interval } = splitAxis(max, 0, 4) const { max: _max, interval } = splitAxis(max, 0, 4)
@ -702,6 +713,19 @@ export default {
} }
}, },
cancelLastRequest() {
if (this._cancelToken && typeof this._cancelToken == 'function') {
this._cancelToken()
}
},
createCancelToken() {
const cancelToken = new axios.CancelToken((c) => {
this._cancelToken = c
})
return cancelToken
},
// 绿 // 绿
handleBetaGammaChartMouseMove(param) { handleBetaGammaChartMouseMove(param) {
const { offsetX, offsetY } = param const { offsetX, offsetY } = param
@ -974,6 +998,20 @@ p {
justify-content: space-between; justify-content: space-between;
} }
.energy {
span {
color: #f00;
}
}
.channel-and-width,
.energy {
label {
width: 60px;
display: inline-block;
}
}
.beta-gamma-chart { .beta-gamma-chart {
height: 353px; height: 353px;
position: relative; position: relative;

View File

@ -434,11 +434,6 @@ const newCalibrationFuncModel = {
export default { export default {
mixins: [SampleDataMixin], mixins: [SampleDataMixin],
components: { CustomChart, TitleOverBorder }, components: { CustomChart, TitleOverBorder },
props: {
sampleId: {
type: Number,
},
},
data() { data() {
this.columns = columns this.columns = columns
@ -475,9 +470,7 @@ export default {
} }
}, },
created() { created() {
// if (this.sampleId) {
this.getData() this.getData()
// }
}, },
methods: { methods: {
handleExit() { handleExit() {

View File

@ -9,10 +9,10 @@
> >
<a-tabs :animated="false" v-model="currTab"> <a-tabs :animated="false" v-model="currTab">
<a-tab-pane tab="Gamma Detector Calibration" key="gamma"> <a-tab-pane tab="Gamma Detector Calibration" key="gamma">
<gamma-detector-calibration :sampleId="sampleId" /> <gamma-detector-calibration />
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="Beta Detector Calibration" key="beta"> <a-tab-pane tab="Beta Detector Calibration" key="beta">
<beta-detector-calibration :sampleId="sampleId" /> <beta-detector-calibration />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<div class="footer"> <div class="footer">
@ -50,11 +50,6 @@ import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder
export default { export default {
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder }, components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
mixins: [ModalMixin], mixins: [ModalMixin],
props: {
sampleId: {
type: Number,
},
},
data() { data() {
return { return {
currTab: 'gamma', currTab: 'gamma',
@ -68,6 +63,10 @@ export default {
} }
}, },
methods: { methods: {
beforeModalOpen() {
this.currTab = 'gamma'
},
recalculateROICountsForChange(checkedVal) { recalculateROICountsForChange(checkedVal) {
this.recalculateROICountsFor = checkedVal this.recalculateROICountsFor = checkedVal
this.checkFlag.checkSample = checkedVal.includes('sample') ? true : false this.checkFlag.checkSample = checkedVal.includes('sample') ? true : false

View File

@ -451,6 +451,14 @@ export default {
methods: { methods: {
beforeModalOpen() { beforeModalOpen() {
this.customToolTip.visible = false this.customToolTip.visible = false
const gammaSeries = this.gammaSpectrumChartOption.series
gammaSeries[0].data = []
gammaSeries[1].data = []
const betaSeries = this.betaSpectrumChartOption.series
betaSeries[0].data = []
betaSeries[1].data = []
this.getDetail() this.getDetail()
}, },

View File

@ -0,0 +1,138 @@
<template>
<custom-modal v-model="visible" :width="1200" title="File List">
<search-form :items="formItems" v-model="queryParam" @search="searchQuery"></search-form>
<custom-table
:columns="columns"
:list="dataSource"
:loading="loading"
:pagination="ipagination"
:selectedRowKeys.sync="selectedRowKeys"
:selectionRows.sync="selectionRows"
:scroll="{ y: 440 }"
@change="handleTableChange"
></custom-table>
<div slot="custom-footer">
<a-button type="primary" :loading="isComparing" @click="handleOk">Compare</a-button>
<a-button @click="visible = false">Cancel</a-button>
</div>
</custom-modal>
</template>
<script>
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '../../SampleDataMixin'
const columns = [
{
title: 'Name',
dataIndex: 'name',
width: '45%',
align: 'left',
ellipsis: true
},
{
title: 'UpdateDate',
dataIndex: 'updateDate',
align: 'left'
},
{
title: 'Size',
dataIndex: 'size',
align: 'left'
}
]
const formItems = [
{
label: '',
type: 'a-input',
name: 'searchName',
props: {
placeholder: 'search...'
}
}
]
export default {
mixins: [ModalMixin, JeecgListMixin, SampleDataMixin],
data() {
this.columns = columns
this.formItems = formItems
return {
queryParam: {},
selectedRowKeys: [],
selectionRows: [],
isComparing: false
}
},
methods: {
beforeModalOpen() {
this.selectedRowKeys = []
},
loadData(arg) {
// 1
if (arg === 1) {
this.ipagination.current = 1
}
this.onClearSelected()
const params = this.getQueryParams() //
const searchName = this.queryParam.searchName
params.name = `${searchName ? `${searchName},` : ''}_S_`
this.loading = true
getAction('/spectrumFile/get', params)
.then(res => {
if (res.success) {
this.dataSource = res.result.records
this.dataSource.forEach((item, index) => {
item.id = index
})
if (res.result.total) {
this.ipagination.total = res.result.total
} else {
this.ipagination.total = 0
}
} else {
this.$message.warning(res.message)
}
})
.finally(() => {
this.loading = false
})
},
async handleOk() {
if (!this.selectedRowKeys.length) {
this.$message.warn('Please Select A File to Compare')
return
}
try {
const { inputFileName: fileName } = this.sampleData
const compareFileName = this.selectionRows[0].name
this.isComparing = true
const { success, result, message } = await getAction('/gamma/Compare', {
fileName,
compareFileName
})
if (success) {
this.visible = false
this.$emit('compareWithFile', result)
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isComparing = false
}
}
}
}
</script>
<style></style>

View File

@ -44,7 +44,7 @@
:pagination="false" :pagination="false"
size="small" size="small"
:class="list.length ? 'has-data' : ''" :class="list.length ? 'has-data' : ''"
:scroll="{ y: 182 }" :scroll="{ y: 193 }"
:selectedRowKeys.sync="selectedRowKeys" :selectedRowKeys.sync="selectedRowKeys"
:canDeselect="false" :canDeselect="false"
@rowClick="handleRowClick" @rowClick="handleRowClick"
@ -52,7 +52,16 @@
<!-- 表格结束 --> <!-- 表格结束 -->
<div class="operators"> <div class="operators">
<div> <div>
<a-button type="primary">Call</a-button> <label>
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
<input
ref="fileInput"
type="file"
accept=".ent"
style="display: none;"
@change="handleFileChange"
/>
</label>
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button> <a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
</div> </div>
<div> <div>
@ -107,7 +116,7 @@
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import TitleOverBorder from '../TitleOverBorder.vue' import TitleOverBorder from '../TitleOverBorder.vue'
import CustomChart from '@/components/CustomChart/index.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 { cloneDeep } from 'lodash'
import { buildLineSeries } from '@/utils/chartHelper' import { buildLineSeries } from '@/utils/chartHelper'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
@ -241,6 +250,7 @@ export default {
return { return {
isLoading: false, isLoading: false,
isCalling: false,
isSaving: false, isSaving: false,
equation: '', 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() { async handleApply() {
try { try {
@ -526,8 +573,20 @@ export default {
this.getData(item) this.getData(item)
}, },
handleSetToCurrent() { async handleSetToCurrent() {
this.appliedDataSource = this.currSelectedDataSource this.appliedDataSource = this.currSelectedDataSource
try {
const { inputFileName: fileName } = this.sampleData
const { success, message } = await putAction(
`/gamma/setCurrentEfficiency?fileName=${fileName}&currentName=${this.currSelectedDataSource}`
)
if (!success) {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
} }
} }
} }
@ -574,7 +633,7 @@ export default {
&.has-data { &.has-data {
::v-deep { ::v-deep {
.ant-table-body { .ant-table-body {
height: 182px; height: 193px;
background-color: #06282a; background-color: #06282a;
} }
} }
@ -582,7 +641,7 @@ export default {
::v-deep { ::v-deep {
.ant-table-placeholder { .ant-table-placeholder {
height: 183px; height: 194px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@ -44,7 +44,7 @@
:pagination="false" :pagination="false"
size="small" size="small"
:class="list.length ? 'has-data' : ''" :class="list.length ? 'has-data' : ''"
:scroll="{ y: 182 }" :scroll="{ y: 193 }"
:selectedRowKeys.sync="selectedRowKeys" :selectedRowKeys.sync="selectedRowKeys"
:canDeselect="false" :canDeselect="false"
@rowClick="handleRowClick" @rowClick="handleRowClick"
@ -52,7 +52,16 @@
<!-- 表格结束 --> <!-- 表格结束 -->
<div class="operators"> <div class="operators">
<div> <div>
<a-button type="primary">Call</a-button> <label>
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
<input
ref="fileInput"
type="file"
accept=".ent"
style="display: none;"
@change="handleFileChange"
/>
</label>
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button> <a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
</div> </div>
<div> <div>
@ -102,7 +111,7 @@
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import TitleOverBorder from '../TitleOverBorder.vue' import TitleOverBorder from '../TitleOverBorder.vue'
import CustomChart from '@/components/CustomChart/index.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 { cloneDeep } from 'lodash'
import { buildLineSeries } from '@/utils/chartHelper' import { buildLineSeries } from '@/utils/chartHelper'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
@ -203,6 +212,7 @@ export default {
this.columns = columns this.columns = columns
return { return {
isLoading: false, isLoading: false,
isCalling: false,
isSaving: false, isSaving: false,
equation: '', 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() { async handleApply() {
try { try {
@ -485,8 +532,20 @@ export default {
this.getData(item) this.getData(item)
}, },
handleSetToCurrent() { async handleSetToCurrent() {
this.appliedDataSource = this.currSelectedDataSource this.appliedDataSource = this.currSelectedDataSource
try {
const { inputFileName: fileName } = this.sampleData
const { success, message } = await putAction(
`/gamma/setCurrentEnergy?fileName=${fileName}&currentName=${this.currSelectedDataSource}`
)
if (!success) {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
} }
} }
} }
@ -533,7 +592,7 @@ export default {
&.has-data { &.has-data {
::v-deep { ::v-deep {
.ant-table-body { .ant-table-body {
height: 182px; height: 193px;
background-color: #06282a; background-color: #06282a;
} }
} }
@ -541,7 +600,7 @@ export default {
::v-deep { ::v-deep {
.ant-table-placeholder { .ant-table-placeholder {
height: 183px; height: 194px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@ -17,6 +17,7 @@
:selectedRowKeys.sync="selectedRowKeys" :selectedRowKeys.sync="selectedRowKeys"
:selectionRows.sync="selectionRows" :selectionRows.sync="selectionRows"
:multiple="true" :multiple="true"
:scroll="{ y: 'calc(100vh - 550px)' }"
> >
</custom-table> </custom-table>
<!-- 底部操作栏 --> <!-- 底部操作栏 -->
@ -36,6 +37,7 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '../../../../api/manage' import { getAction } from '../../../../api/manage'
import moment from 'moment' import moment from 'moment'
import { cloneDeep } from 'lodash'
const columns = [ const columns = [
{ {
@ -51,7 +53,8 @@ const columns = [
{ {
title: 'Detector', title: 'Detector',
align: 'left', align: 'left',
dataIndex: 'detectorsName' dataIndex: 'detectorsName',
width: 130
}, },
{ {
title: 'Sample', title: 'Sample',
@ -71,12 +74,14 @@ const columns = [
{ {
title: 'Col.Stop', title: 'Col.Stop',
align: 'left', align: 'left',
dataIndex: 'collectStop' dataIndex: 'collectStop',
width: 170
}, },
{ {
title: 'Acq.Start', title: 'Acq.Start',
align: 'left', align: 'left',
dataIndex: 'acquisitionStart' dataIndex: 'acquisitionStart',
width: 170
}, },
{ {
title: 'Acq.real', title: 'Acq.real',
@ -197,7 +202,7 @@ export default {
} }
this.selectedRowKeys = [] this.selectedRowKeys = []
this.visible = false this.visible = false
this.$emit('loadSample', this.selectionRows) this.$emit('loadSample', cloneDeep(this.selectionRows))
}, },
// //

View File

@ -47,7 +47,7 @@
:columns="daughterColumns" :columns="daughterColumns"
:list="daughterList" :list="daughterList"
:pagination="false" :pagination="false"
:scroll="{ y: 123 }" :scroll="{ y: 84 }"
rowKey="daughters" rowKey="daughters"
@rowDblClick="handleParentDBClick($event.daughters)" @rowDblClick="handleParentDBClick($event.daughters)"
></custom-table> ></custom-table>
@ -77,7 +77,7 @@
:columns="mainColumns" :columns="mainColumns"
:dataSource="nuclLinesLibs" :dataSource="nuclLinesLibs"
:pagination="false" :pagination="false"
:scroll="{ y: 175 }" :scroll="{ y: 330 }"
> >
<template slot="keyLine" slot-scope="text"> <template slot="keyLine" slot-scope="text">
<span v-if="text == 1" class="green-check-mark"> </span> <span v-if="text == 1" class="green-check-mark"> </span>
@ -115,6 +115,7 @@ import ModalMixin from '@/mixins/ModalMixin'
import TitleOverBorder from '../TitleOverBorder.vue' import TitleOverBorder from '../TitleOverBorder.vue'
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
import { toFixed } from '@/utils/number'
// //
const daughterColumns = [ const daughterColumns = [
@ -151,22 +152,34 @@ const mainColumns = [
{ {
title: 'Energy(keV)', title: 'Energy(keV)',
dataIndex: 'energy', dataIndex: 'energy',
width: 100 width: 100,
customRender: text => {
return toFixed(text, 3)
}
}, },
{ {
title: 'Energy Uncert(%)', title: 'Energy Uncert(%)',
dataIndex: 'energyUncert', dataIndex: 'energyUncert',
width: 120 width: 120,
customRender: text => {
return text ? toFixed(text * 100, 6) : ''
}
}, },
{ {
title: 'Yield', title: 'Yield',
dataIndex: 'yield', dataIndex: 'yield',
width: 80 width: 80,
customRender: text => {
return toFixed(text, 3)
}
}, },
{ {
title: 'Yield Uncert(%)', title: 'Yield Uncert(%)',
dataIndex: 'yieldUncert', dataIndex: 'yieldUncert',
width: 120 width: 120,
customRender: text => {
return toFixed(text, 3)
}
}, },
{ {
title: 'KeyLine', title: 'KeyLine',
@ -295,7 +308,7 @@ export default {
&-list { &-list {
padding: 5px; padding: 5px;
width: 150px; width: 150px;
height: 516px; height: 632px;
overflow: auto; overflow: auto;
background-color: #275466; background-color: #275466;
@ -339,7 +352,7 @@ export default {
} }
.content { .content {
height: 150px; height: 111px;
} }
.parents { .parents {
@ -364,7 +377,7 @@ export default {
&.has-data { &.has-data {
::v-deep { ::v-deep {
.ant-table-body { .ant-table-body {
height: 123px; height: 84px;
background-color: #06282a; background-color: #06282a;
} }
} }
@ -373,7 +386,7 @@ export default {
::v-deep { ::v-deep {
.ant-table { .ant-table {
&-placeholder { &-placeholder {
height: 124px; height: 85px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -400,7 +413,7 @@ export default {
&.has-data { &.has-data {
::v-deep { ::v-deep {
.ant-table-body { .ant-table-body {
height: 175px; height: 330px;
background-color: #06282a; background-color: #06282a;
} }
} }
@ -409,7 +422,7 @@ export default {
::v-deep { ::v-deep {
.ant-table { .ant-table {
&-placeholder { &-placeholder {
height: 176px; height: 331px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@ -44,7 +44,7 @@
:pagination="false" :pagination="false"
size="small" size="small"
:class="list.length ? 'has-data' : ''" :class="list.length ? 'has-data' : ''"
:scroll="{ y: 182 }" :scroll="{ y: 193 }"
:selectedRowKeys.sync="selectedRowKeys" :selectedRowKeys.sync="selectedRowKeys"
:canDeselect="false" :canDeselect="false"
@rowClick="handleRowClick" @rowClick="handleRowClick"
@ -52,7 +52,16 @@
<!-- 表格结束 --> <!-- 表格结束 -->
<div class="operators"> <div class="operators">
<div> <div>
<a-button type="primary">Call</a-button> <label>
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
<input
ref="fileInput"
type="file"
accept=".ent"
style="display: none;"
@change="handleFileChange"
/>
</label>
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button> <a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
</div> </div>
<div> <div>
@ -102,7 +111,7 @@
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import TitleOverBorder from '../TitleOverBorder.vue' import TitleOverBorder from '../TitleOverBorder.vue'
import CustomChart from '@/components/CustomChart/index.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 { cloneDeep } from 'lodash'
import { buildLineSeries } from '@/utils/chartHelper' import { buildLineSeries } from '@/utils/chartHelper'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
@ -203,6 +212,7 @@ export default {
this.columns = columns this.columns = columns
return { return {
isLoading: false, isLoading: false,
isCalling: false,
isSaving: false, isSaving: false,
equation: '', 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() { async handleApply() {
try { try {
@ -483,8 +530,20 @@ export default {
this.getData(item) this.getData(item)
}, },
handleSetToCurrent() { async handleSetToCurrent() {
this.appliedDataSource = this.currSelectedDataSource this.appliedDataSource = this.currSelectedDataSource
try {
const { inputFileName: fileName } = this.sampleData
const { success, message } = await putAction(
`/gamma/setCurrentResolution?fileName=${fileName}&currentName=${this.currSelectedDataSource}`
)
if (!success) {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
} }
} }
} }
@ -531,7 +590,7 @@ export default {
&.has-data { &.has-data {
::v-deep { ::v-deep {
.ant-table-body { .ant-table-body {
height: 182px; height: 193px;
background-color: #06282a; background-color: #06282a;
} }
} }
@ -539,7 +598,7 @@ export default {
::v-deep { ::v-deep {
.ant-table-placeholder { .ant-table-placeholder {
height: 183px; height: 194px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@ -2,15 +2,12 @@
<custom-modal v-model="visible" :width="750" title="Sample Infomation"> <custom-modal v-model="visible" :width="750" title="Sample Infomation">
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<div class="sample-infomation"> <div class="sample-infomation">
<a-form-model :labelCol="{ style: { width: '150px', textAlign: 'left' } }"> <a-row>
<a-row> <a-col class="sample-infomation-item" :span="12" v-for="(item, index) in columns" :key="index">
<a-col :span="12" v-for="(item, index) in columns" :key="index"> <div class="label">{{ item.title }}:</div>
<a-form-model-item :label="item.title"> <div class="value">{{ data[item.key] }}</div>
{{ data[item.key] }} </a-col>
</a-form-model-item> </a-row>
</a-col>
</a-row>
</a-form-model>
</div> </div>
</a-spin> </a-spin>
<div slot="custom-footer" style="text-align: center;"> <div slot="custom-footer" style="text-align: center;">
@ -25,7 +22,7 @@
<script> <script>
import { getAction, getFileAction } from '@/api/manage' import { getAction, getFileAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
const columns = [ const columns = [
@ -125,19 +122,19 @@ export default {
}, },
// Excel // Excel
handleExportToExcel() { handleExportToExcel() {
this.fileName = "" this.fileName = ''
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
if (Object.keys(this.data).length > 0) { if (Object.keys(this.data).length > 0) {
let _this = this let _this = this
this.$confirm({ this.$confirm({
title: 'Please enter file name', title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName} />, content: h => <a-input v-model={_this.fileName} />,
okText: 'Cancle', okText: 'Cancle',
cancelText: 'Save', cancelText: 'Save',
okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}}, okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}}, cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() { onOk() {
console.log('Cancel'); console.log('Cancel')
}, },
onCancel() { onCancel() {
if (_this.fileName) { if (_this.fileName) {
@ -147,17 +144,17 @@ export default {
} }
getFileAction('/gamma/exportSampleInformation', params).then(res => { getFileAction('/gamma/exportSampleInformation', params).then(res => {
if (res.code && res.code == 500) { if (res.code && res.code == 500) {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} else { } else {
const blob = new Blob([res], { type: "application/vnd.ms-excel" }) const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${_this.fileName}`) saveAs(blob, `${_this.fileName}`)
} }
}) })
} }
}, }
}); })
} else { } else {
this.$message.warning("No downloadable data") this.$message.warning('No downloadable data')
} }
} }
} }
@ -169,8 +166,14 @@ export default {
background-color: #143644; background-color: #143644;
padding: 20px; padding: 20px;
.ant-form-item { &-item {
margin-bottom: 0; display: flex;
height: 30px;
.label {
width: 150px;
color: #5b9cba;
}
} }
} }
</style> </style>

View File

@ -7,7 +7,7 @@
</template> </template>
<script> <script>
import { getAction } from '@/api/manage' import { getAction, putAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
@ -16,13 +16,13 @@ export default {
props: { props: {
isAdd: { isAdd: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
data() { data() {
return { return {
isLoading: false, isLoading: false,
comments: '' comments: '',
} }
}, },
methods: { methods: {
@ -30,18 +30,20 @@ export default {
beforeModalOpen() { beforeModalOpen() {
if (this.isAdd) { if (this.isAdd) {
this.comments = '' this.comments = ''
this.getTotalComment()
} else { } else {
this.getInfo() this.getInfo()
} }
}, },
// View
async getInfo() { async getInfo() {
try { try {
this.isLoading = true this.isLoading = true
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/viewComment', { const { success, result, message } = await getAction('/gamma/viewComment', {
sampleId, sampleId,
fileName fileName,
}) })
this.isLoading = false this.isLoading = false
if (success) { if (success) {
@ -53,10 +55,35 @@ export default {
console.error(error) console.error(error)
} }
}, },
handleOk() {
console.log('%c [ ]-26', 'font-size:13px; background:pink; color:#bf2c9f;', this.comments) // Add Comment
} async getTotalComment() {
} try {
this.isLoading = true
const { inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/viewGeneralComment', {
fileName,
})
this.isLoading = false
if (success) {
this.comments = result
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
},
async handleOk() {
const { inputFileName: fileName } = this.sampleData
const { success, message } = await putAction(`/gamma/addComment?fileName=${fileName}&comment=${this.comments}`)
if (!success) {
this.$message.error(message)
throw new Error(message)
}
},
},
} }
</script> </script>

View File

@ -1,11 +1,16 @@
<template> <template>
<a-menu class="spectra-list-in-menu"> <a-menu class="spectra-list-in-menu">
<a-menu-item class="spectra-list-in-menu-item" v-for="(item,index) in list" :key="`${item.sampleId}${index}`" @click="handleClick(item)"> <a-menu-item
class="spectra-list-in-menu-item"
v-for="(item, index) in list"
:key="`${item.sampleId}${index}`"
@click="handleClick(item)"
>
<span class="checkbox"> <span class="checkbox">
<a-icon v-if="item.checked" type="check" style="color: #0de30d" /> <a-icon v-if="item.checked" type="check" style="color: #0de30d" />
</span> </span>
<span class="name">{{ item.inputFileName }}</span> <span class="name">{{ item.inputFileName }}</span>
<a-icon type="delete" @click.stop="handleRemove(item)" /> <a-icon type="delete" @click.stop="handleRemove(item, index)" />
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
@ -26,25 +31,25 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}, },
handleRemove(spectraItem) { handleRemove(spectraItem, index) {
const index = this.list.findIndex(item => item == spectraItem)
this.list.splice(index, 1)
// //
if (spectraItem.checked) { if (spectraItem.checked) {
if (index == 0) { // //
// if (index == this.list.length - 1) {
this.handleClick(this.list[0])
} else {
//
this.handleClick(this.list[index - 1]) this.handleClick(this.list[index - 1])
} }
//
else {
this.handleClick(this.list[index + 1])
}
} }
this.list.splice(index, 1)
this.$forceUpdate() this.$forceUpdate()
} }
}, },
watch: { watch: {
list(newVal) { list(newVal) {
if (newVal.length) { if (newVal.length && !newVal.find(item => item.checked)) {
this.handleClick(newVal[0]) this.handleClick(newVal[0])
} }
} }

View File

@ -63,7 +63,7 @@ export default {
align-items: center; align-items: center;
width: 150px; width: 150px;
height: 30px; height: 30px;
cursor: default; cursor: pointer;
&:not(:last-child) { &:not(:last-child) {
margin-right: 2px; margin-right: 2px;

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
<a-button type="primary">{{ operation.title }}</a-button> <a-button type="primary">{{ operation.title }}</a-button>
<div slot="overlay"> <div slot="overlay">
<template v-for="(child, index) in operation.children"> <template v-for="(child, index) in operation.children">
<component :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on"> <component v-if="child.show !== false" :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
<template v-for="item in child.children"> <template v-for="item in child.children">
<component v-if="item.show !== false" :is="item.type" :key="item.title" @click="item.handler"> <component v-if="item.show !== false" :is="item.type" :key="item.title" @click="item.handler">
{{ item.title }} {{ item.title }}
@ -89,10 +89,6 @@
<korsum-modal v-model="korsumModalShow" /> <korsum-modal v-model="korsumModalShow" />
<!-- Korsum 弹窗结束 --> <!-- Korsum 弹窗结束 -->
<!-- ReProcessing 弹窗开始 -->
<re-processing-modal v-model="reprocessingModalVisible" />
<!-- ReProcessing 弹窗结束 -->
<!-- Zero Time 弹窗开始 --> <!-- Zero Time 弹窗开始 -->
<zero-time-modal v-model="zeroTimeModalVisible" :sampleId="sampleData.sampleId" /> <zero-time-modal v-model="zeroTimeModalVisible" :sampleId="sampleData.sampleId" />
<!-- Zero Time 弹窗结束 --> <!-- Zero Time 弹窗结束 -->
@ -162,7 +158,6 @@
<!-- Beta-Gamma 的Energy Calibration开始 --> <!-- Beta-Gamma 的Energy Calibration开始 -->
<beta-gamma-energy-calibration-modal <beta-gamma-energy-calibration-modal
v-model="betaGammaEnergyCalibrationModalVisible" v-model="betaGammaEnergyCalibrationModalVisible"
:sampleId="this.sampleData.sampleId"
@sendInfo="getCheckFlag" @sendInfo="getCheckFlag"
/> />
<!-- Beta-Gamma 的Energy Calibration结束 --> <!-- Beta-Gamma 的Energy Calibration结束 -->
@ -209,7 +204,6 @@ import SaveSettingModal from './components/Modals/SaveSettingModal.vue'
import AnalyzeSettingModal from './components/Modals/AnalyzeSettingModal.vue' import AnalyzeSettingModal from './components/Modals/AnalyzeSettingModal.vue'
import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveToolModal/index.vue' import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveToolModal/index.vue'
import KorsumModal from './components/Modals/KorsumModal.vue' import KorsumModal from './components/Modals/KorsumModal.vue'
import ReProcessingModal from './components/Modals/ReProcessingModal/index.vue'
import ZeroTimeModal from './components/Modals/ZeroTimeModal.vue' import ZeroTimeModal from './components/Modals/ZeroTimeModal.vue'
import EfficiencyCalibrationModal from './components/Modals/EfficiencyCalibrationModal.vue' import EfficiencyCalibrationModal from './components/Modals/EfficiencyCalibrationModal.vue'
import EnergyCalibrationModal from './components/Modals/EnergyCalibrationModal.vue' import EnergyCalibrationModal from './components/Modals/EnergyCalibrationModal.vue'
@ -235,6 +229,7 @@ import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals
import StripModal from './components/Modals/StripModal.vue' import StripModal from './components/Modals/StripModal.vue'
import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue' import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue' import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
import { getAction } from '@/api/manage'
// //
const ANALYZE_TYPE = { const ANALYZE_TYPE = {
@ -255,7 +250,6 @@ export default {
AnalyzeSettingModal, AnalyzeSettingModal,
AnalyzeInteractiveToolModal, AnalyzeInteractiveToolModal,
KorsumModal, KorsumModal,
ReProcessingModal,
ZeroTimeModal, ZeroTimeModal,
EfficiencyCalibrationModal, EfficiencyCalibrationModal,
EnergyCalibrationModal, EnergyCalibrationModal,
@ -313,7 +307,6 @@ export default {
saveSettingModalVisible: false, // saveSettingModalVisible: false, //
analyzeConfigureModalVisible: false, // analyzeConfigureModalVisible: false, //
reprocessingModalVisible: false, //
analyzeInteractiveToolModalVisible: false, // analyzeInteractiveToolModalVisible: false, //
zeroTimeModalVisible: false, // Zero Time zeroTimeModalVisible: false, // Zero Time
korsumModalShow: false, // Korsum korsumModalShow: false, // Korsum
@ -388,12 +381,12 @@ export default {
}, },
created() { created() {
this.$bus.$on('reanalyse', this.handleReanalyse) this.$bus.$on('reanalyse', this.handleReanalyse)
this.loadSelectedSample({ // this.loadSelectedSample({
sampleId: 426530, // sampleId: 426530,
sampleType: 'G', // sampleType: 'G',
dbName: 'auto', // dbName: 'auto',
inputFileName: 'CAX05_001-20230731_1528_S_FULL_37563.6.PHD', // inputFileName: 'CAX05_001-20230731_1528_S_FULL_37563.6.PHD',
}) // })
}, },
destroyed() { destroyed() {
@ -438,7 +431,7 @@ export default {
}) })
arr.forEach((item) => { arr.forEach((item) => {
item.dbName = '' item.dbName = ''
item.sampleId = '' item.sampleId = null
item.inputFileName = item.sampleFileName item.inputFileName = item.sampleFileName
item.sampleType = item.sampleSystemType item.sampleType = item.sampleSystemType
}) })
@ -475,10 +468,29 @@ export default {
* 保存结果到数据库 * 保存结果到数据库
* @param { 'all' | 'current' } type * @param { 'all' | 'current' } type
*/ */
handleSaveResultsToDB(type) { async handleSaveResultsToDB(type) {
console.log('%c [ saveResultsToDB ]-157', 'font-size:13px; background:pink; color:#bf2c9f;', type) if (this.isBetaGamma) {
if (type === 'current') { if (type === 'current') {
this.handleSaveResultsToDB_Cuurrent() 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() { handleSaveResultsToDB_Cuurrent() {
@ -623,8 +635,9 @@ export default {
}, },
{ {
type: 'a-menu-item', type: 'a-menu-item',
title: 'Clean All', title: 'Compare',
handler: this.handleCleanAll, show: this.isGamma,
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(),
}, },
{ {
type: 'a-menu-item', type: 'a-menu-item',
@ -638,6 +651,11 @@ export default {
show: this.isGamma, show: this.isGamma,
handler: () => (this.ftransltModalVisible = true), handler: () => (this.ftransltModalVisible = true),
}, },
{
type: 'a-menu-item',
title: 'Clean All',
handler: this.handleCleanAll,
},
], ],
}, },
{ {
@ -660,8 +678,7 @@ export default {
if (spectra) { if (spectra) {
this.loadSelectedSample(spectra) this.loadSelectedSample(spectra)
} else { } else {
this.analysisType = undefined this.handleCleanAll()
this.sampleData = {}
} }
}, },
}, },
@ -673,6 +690,7 @@ export default {
children: [ children: [
{ {
type: 'MultiLevelMenu', type: 'MultiLevelMenu',
show: this.isBetaGamma || this.isGamma,
attrs: { attrs: {
children: [ children: [
{ {
@ -736,9 +754,9 @@ export default {
}, },
{ {
type: 'a-menu-item', type: 'a-menu-item',
title: 'ReProcessing', title: 'Reprocessing',
show: this.isGamma, show: this.isGamma,
handler: () => (this.reprocessingModalVisible = true), handler: () => this.$refs.gammaAnalysisRef.reProcessing(),
}, },
{ {
type: 'a-menu-item', type: 'a-menu-item',
@ -824,7 +842,6 @@ export default {
}, },
{ {
title: 'NUCLIDELIBRARY', title: 'NUCLIDELIBRARY',
show: !this.isBetaGamma,
children: [ children: [
{ {
type: 'a-menu', type: 'a-menu',
@ -832,11 +849,13 @@ export default {
{ {
type: 'a-menu-item', type: 'a-menu-item',
title: 'Nuclide Library', title: 'Nuclide Library',
show: this.isGamma,
handler: () => (this.nuclideLibraryModalVisible = true), handler: () => (this.nuclideLibraryModalVisible = true),
}, },
{ {
type: 'a-menu-item', type: 'a-menu-item',
title: 'Config User Library', title: 'Config User Library',
show: this.isGamma,
handler: () => (this.configUserLibModalVisible = true), handler: () => (this.configUserLibModalVisible = true),
}, },
], ],
@ -1024,6 +1043,7 @@ export default {
{ {
type: 'a-menu-item', type: 'a-menu-item',
title: 'Automatic Analysis Log', title: 'Automatic Analysis Log',
show: this.isBetaGamma || this.isGamma,
handler: () => { handler: () => {
this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1 this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1
this.autoAnalysisMogModalVisible = true this.autoAnalysisMogModalVisible = true

View File

@ -0,0 +1,167 @@
import { buildLineSeries } from "@/utils/chartHelper"
export const GammaOptions = {
option: {
grid: {
top: 40,
left: 60,
right: 50,
containLabel: true
},
title: {
text: '',
left: 'center',
bottom: 10,
textStyle: {
color: '#8FD4F8',
rich: {
a: {
padding: [0, 20, 0, 0],
fontSize: 16
}
}
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
lineStyle: {
color: '#3CAEBB',
width: 1,
type: 'solid'
}
},
formatter: undefined,
className: 'figure-chart-option-tooltip'
},
xAxis: {
name: 'Channel',
nameTextStyle: {
color: '#8FD4F8',
fontSize: 16,
align: 'right',
verticalAlign: 'top',
padding: [30, 0, 0, 0]
},
axisLine: {
lineStyle: {
color: '#ade6ee'
}
},
splitLine: {
show: false
},
axisLabel: {
textStyle: {
color: '#ade6ee'
}
},
min: 1,
max: 'dataMax',
animation: false,
axisLabel: {
formatter: value => {
return parseInt(value)
}
}
},
yAxis: {
name: 'Counts',
type: 'value',
nameTextStyle: {
color: '#8FD4F8',
fontSize: 16
},
axisLine: {
show: true,
lineStyle: {
color: '#ade6ee'
}
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(173, 230, 238, .2)'
}
},
axisLabel: {
textStyle: {
color: '#ade6ee'
}
},
min: 1,
max: 'dataMax',
animation: false,
axisLabel: {
formatter: value => {
return value.toFixed(1)
}
}
},
series: [],
brush: {}
},
// 缩略图配置
thumbnailOption: {
grid: {
top: 0,
left: 5,
right: 5,
bottom: 0
},
xAxis: {
type: 'category',
axisLine: {
show: false
},
splitLine: {
show: false
},
axisLabel: {
show: false
},
min: 1,
max: 'dataMax'
},
yAxis: {
type: 'value',
axisLine: {
show: false
},
splitLine: {
show: false
},
axisLabel: {
show: false
},
min: 1,
max: 'dataMax'
},
series: [
buildLineSeries('Spectrum', [], '#fff', {
silent: true,
markLine: {
silent: true,
symbol: 'none',
label: {
show: false
},
lineStyle: {
type: 'solid',
color: '#1397a3',
width: 1
},
data: []
}
})
]
}
}
export const graphAssistance = {
axisType: 'Channel',
spectrumType: 'Lines',
Baseline: true,
SCAC: true,
Lc: true,
}