Merge branch 'feature/spectrum-analysis' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into feature-analysis-RLR-renpy
# Conflicts: # src/views/spectrumAnalysis/components/Modals/ArrRrrModal.vue # src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue # src/views/spectrumAnalysis/components/Modals/NuclideActivityAndMDCModal.vue # src/views/spectrumAnalysis/components/Modals/QcResultsModal.vue # src/views/spectrumAnalysis/components/Modals/RLRModal/index.vue # src/views/spectrumAnalysis/components/Modals/SampleInfomationModal.vue # src/views/spectrumAnalysis/components/PeakInfomation.vue
This commit is contained in:
commit
6ba65075be
|
@ -94,3 +94,14 @@ export function buildLineSeries(name, data, color, extra = {}) {
|
|||
export function findSeriesByName(series, seriesName) {
|
||||
return series.find(item => item.name == seriesName)
|
||||
}
|
||||
|
||||
/**
|
||||
* 限定数字在一定范围
|
||||
* @param {Number} min
|
||||
* @param {Number} max
|
||||
*/
|
||||
export function rangeNumber(min, max) {
|
||||
return num => {
|
||||
return num > max ? max : num < min ? min : num
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@ let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
|
|||
const service = axios.create({
|
||||
//baseURL: '/jeecg-boot',
|
||||
baseURL: apiBaseUrl, // api base_url
|
||||
timeout: 60 * 1000 // 请求超时时间
|
||||
timeout: 2 * 60 * 1000 // 请求超时时间
|
||||
})
|
||||
|
||||
const err = (error) => {
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<script>
|
||||
import Custom3DChart from '@/components/Custom3DChart/index.vue'
|
||||
import ColorPalette from './ColorPalette.vue'
|
||||
import { getXAxisAndYAxisByPosition } from '@/utils/chartHelper.js'
|
||||
import { getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper.js'
|
||||
|
||||
const buttons = ['2D', '3D Surface', '3D Scatter']
|
||||
|
||||
|
@ -426,7 +426,7 @@ export default {
|
|||
|
||||
const [x1, y2, x2, y1] = [...point1, ...point2] // 根据解析出的数据确定真实的范围
|
||||
|
||||
const rangeNumberFunc = this.rangeNumber(0, 256)
|
||||
const rangeNumberFunc = rangeNumber(0, 256)
|
||||
|
||||
this.twoDOption.xAxis.min = rangeNumberFunc(x1)
|
||||
this.twoDOption.xAxis.max = rangeNumberFunc(x2)
|
||||
|
@ -441,17 +441,6 @@ export default {
|
|||
this.clearBrush(chart)
|
||||
},
|
||||
|
||||
/**
|
||||
* 限定数字在一定范围
|
||||
* @param {Number} min
|
||||
* @param {Number} max
|
||||
*/
|
||||
rangeNumber(min, max) {
|
||||
return num => {
|
||||
return num > max ? max : num < min ? min : num
|
||||
}
|
||||
},
|
||||
|
||||
// 通知上层范围改变
|
||||
emitRangeChange(range) {
|
||||
this.$emit('rangeChange', range)
|
||||
|
|
|
@ -1,39 +1,49 @@
|
|||
<template>
|
||||
<custom-modal centered v-model="visible" :width="1200" title="Fit Peaks and Baseline">
|
||||
<custom-table :columns="columns" :list="list">
|
||||
<a-spin :spinning="isLoading">
|
||||
<custom-table :columns="columns" :list="list" :canSelect="false">
|
||||
<template v-for="(slot, index) in slots" :slot="slot.slotName" slot-scope="{ record }">
|
||||
<a-checkbox v-if="slot.isCheckbox" :key="index" v-model="record[slot.dataIndex]">
|
||||
Fixed
|
||||
</a-checkbox>
|
||||
<a-input v-else :key="index" v-model="record[slot.dataIndex]"></a-input>
|
||||
<a-input v-else :key="index" v-model="record[slot.dataIndex]" :readOnly="slot.isStatic"></a-input>
|
||||
</template>
|
||||
</custom-table>
|
||||
</a-spin>
|
||||
<div slot="custom-footer">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="handlePeaks">Peaks</a-button>
|
||||
<a-button @click="visible = false">Cancel</a-button>
|
||||
<a-button type="primary" :disabled="isCanceling || isLoading" :loading="isAcceptting" @click="handlePeaks">
|
||||
Peaks
|
||||
</a-button>
|
||||
<a-button :disabled="isAcceptting || isLoading" :loading="isCanceling" @click="handleCancel">Cancel</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</custom-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Peak',
|
||||
dataIndex: 'peak',
|
||||
dataIndex: 'lab',
|
||||
width: 100,
|
||||
scopedSlots: {
|
||||
customRender: 'Peak'
|
||||
}
|
||||
customRender: 'lab'
|
||||
},
|
||||
isStatic: true
|
||||
},
|
||||
{
|
||||
title: 'Nuclide',
|
||||
dataIndex: 'nuclide',
|
||||
width: 100,
|
||||
scopedSlots: {
|
||||
customRender: 'Nuclide'
|
||||
}
|
||||
customRender: 'nuclide'
|
||||
},
|
||||
isStatic: true
|
||||
},
|
||||
{
|
||||
title: 'Energy',
|
||||
|
@ -45,23 +55,23 @@ const columns = [
|
|||
},
|
||||
{
|
||||
title: 'NetArea',
|
||||
dataIndex: 'netAreaInput',
|
||||
dataIndex: 'netArea',
|
||||
width: 100,
|
||||
scopedSlots: {
|
||||
customRender: 'NetAreaInput'
|
||||
customRender: 'netArea'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'FWHM',
|
||||
dataIndex: 'fwhmInput',
|
||||
dataIndex: 'fwhm',
|
||||
width: 100,
|
||||
scopedSlots: {
|
||||
customRender: 'FWHMInput'
|
||||
customRender: 'fwhm'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Step',
|
||||
dataIndex: 'Step',
|
||||
dataIndex: 'step',
|
||||
width: 100,
|
||||
scopedSlots: {
|
||||
customRender: 'Step'
|
||||
|
@ -77,10 +87,10 @@ const columns = [
|
|||
},
|
||||
{
|
||||
title: 'NetArea',
|
||||
dataIndex: 'netAreaCheckbox',
|
||||
dataIndex: 'netAreaB',
|
||||
width: 100,
|
||||
scopedSlots: {
|
||||
customRender: 'NetAreaCheckbox'
|
||||
customRender: 'netAreaB'
|
||||
},
|
||||
isCheckbox: true
|
||||
},
|
||||
|
@ -95,48 +105,113 @@ const columns = [
|
|||
},
|
||||
{
|
||||
title: 'FWHM',
|
||||
dataIndex: 'fwhmCheckbox',
|
||||
dataIndex: 'fwhmB',
|
||||
width: 100,
|
||||
scopedSlots: {
|
||||
customRender: 'FWHMCheckbox'
|
||||
customRender: 'fwhmB'
|
||||
},
|
||||
isCheckbox: true
|
||||
}
|
||||
]
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
value: {
|
||||
type: Boolean
|
||||
curChan: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
list: []
|
||||
list: [],
|
||||
isAcceptting: false,
|
||||
isCanceling: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handlePeaks() {
|
||||
console.log('%c [ ]-134', 'font-size:13px; background:pink; color:#bf2c9f;', this.list)
|
||||
// 接收
|
||||
async handlePeaks() {
|
||||
try {
|
||||
this.isAcceptting = true
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/acceptResults', {
|
||||
fileName,
|
||||
accept: true
|
||||
})
|
||||
if (success) {
|
||||
this.visible = false
|
||||
this.$emit('result', result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isAcceptting = false
|
||||
}
|
||||
},
|
||||
|
||||
// 取消
|
||||
async handleCancel() {
|
||||
try {
|
||||
this.isCanceling = true
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/acceptResults', {
|
||||
fileName,
|
||||
accept: false,
|
||||
oldPeak: this.oldPeaks
|
||||
})
|
||||
if (success) {
|
||||
this.visible = false
|
||||
this.$emit('cancel', result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isCanceling = false
|
||||
}
|
||||
},
|
||||
|
||||
async getData() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/insertPeak', {
|
||||
sampleId,
|
||||
fileName: inputFileName,
|
||||
curChan: Math.ceil(this.curChan)
|
||||
})
|
||||
if (success) {
|
||||
const { oldPeaks, tablePeaksList } = result
|
||||
tablePeaksList.forEach(item => {
|
||||
item.energy = Number(item.energy).toPrecision(6)
|
||||
item.netArea = Number(item.netArea).toPrecision(6)
|
||||
item.fwhm = Number(item.fwhm).toPrecision(6)
|
||||
})
|
||||
this.list = tablePeaksList
|
||||
this.oldPeaks = oldPeaks
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
beforeModalOpen() {
|
||||
this.getData()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
visible: {
|
||||
get() {
|
||||
if (this.value) {
|
||||
this.content = ''
|
||||
}
|
||||
return this.value
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val)
|
||||
}
|
||||
},
|
||||
slots() {
|
||||
return columns.map(column => {
|
||||
return {
|
||||
isCheckbox: column.isCheckbox,
|
||||
isStatic: column.isStatic,
|
||||
dataIndex: column.dataIndex,
|
||||
slotName: column.scopedSlots.customRender
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<a-form-model-item label="Tolerance">
|
||||
<a-input-number v-model="model.tolerance"></a-input-number>
|
||||
</a-form-model-item>
|
||||
<a-button type="primary">Search</a-button>
|
||||
<a-button type="primary" @click="handleSearch">Search</a-button>
|
||||
</a-form-model>
|
||||
<span @click="handleNuclideChange('next')">></span>
|
||||
</div>
|
||||
|
@ -252,20 +252,33 @@ export default {
|
|||
async getInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName } = this.sampleData
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/nuclideReview', {
|
||||
sampleId: sampleId,
|
||||
channel: this.channel,
|
||||
fileName: inputFileName
|
||||
fileName
|
||||
})
|
||||
if (success) {
|
||||
const { chart, energy, halfLife, halfLifeErr, lines, list, name, table } = result
|
||||
|
||||
this.model = {
|
||||
energy,
|
||||
energy: result.energy,
|
||||
tolerance: 0.5
|
||||
}
|
||||
|
||||
this.handleResData(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// 处理返回的数据
|
||||
handleResData(result) {
|
||||
const { chart, halfLife, halfLifeErr, lines, list, name, table } = result
|
||||
|
||||
this.info = {
|
||||
halfLife,
|
||||
halfLifeErr,
|
||||
|
@ -281,14 +294,6 @@ export default {
|
|||
|
||||
this.currNuclide = this.nuclideList[0]
|
||||
this.selectTableRow(table.length > 1 ? 1 : 0)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// 点击左侧Nuclide切换
|
||||
|
@ -329,6 +334,28 @@ export default {
|
|||
|
||||
beforeModalOpen() {
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
// 搜索
|
||||
async handleSearch() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/searchNuclide', {
|
||||
sampleId,
|
||||
fileName,
|
||||
...this.model
|
||||
})
|
||||
if (success) {
|
||||
this.handleResData(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,15 @@
|
|||
<div class="interactive-analysis-tools">
|
||||
<div class="interactive-analysis-tools-left">
|
||||
<div class="chart">
|
||||
<CustomChart ref="chartRef" :option="option" :opts="opts" @zr:click="handleChartClick" />
|
||||
<CustomChart
|
||||
ref="chartRef"
|
||||
:option="option"
|
||||
:opts="opts"
|
||||
@zr:mousedown="handleMouseDown"
|
||||
@zr:mouseup="handleMouseUp"
|
||||
@brushEnd="handleBrushEnd"
|
||||
@zr:click="handleChartClick"
|
||||
/>
|
||||
</div>
|
||||
<!-- 缩略图 -->
|
||||
<div class="thumbnail">
|
||||
|
@ -70,10 +78,10 @@
|
|||
<a-button type="primary" @click="handleAddCP">(A)dd CP</a-button>
|
||||
</div>
|
||||
<div class="peak-box-item">
|
||||
<a-button type="primary">(R)emove CP</a-button>
|
||||
<a-button type="primary" @click="handleRemoveCP">(R)emove CP</a-button>
|
||||
</div>
|
||||
<div class="peak-box-item">
|
||||
<a-button type="primary">(M)odify CP</a-button>
|
||||
<a-button type="primary" @click="handleModifyCP">(M)odify CP</a-button>
|
||||
</div>
|
||||
<div class="peak-box-item">
|
||||
<a-button type="primary">Edit (S)lope</a-button>
|
||||
|
@ -94,7 +102,7 @@
|
|||
</div>
|
||||
</title-over-border>
|
||||
<div class="reset-btn-box">
|
||||
<a-button type="primary">Reset Chart</a-button>
|
||||
<a-button type="primary" @click="handleResetChart">Reset Chart</a-button>
|
||||
</div>
|
||||
<div class="identify-box">
|
||||
<title-over-border title="Nuclide Identify">
|
||||
|
@ -154,7 +162,12 @@
|
|||
<comment-modal v-model="commentModalVisible" :type="commentType" />
|
||||
<!-- Comment弹窗 结束 -->
|
||||
<!-- Fit Peaks and Baseline弹窗 开始 -->
|
||||
<fit-peaks-and-base-line-modal v-model="fitPeaksAndBaselineModalVisible" />
|
||||
<fit-peaks-and-base-line-modal
|
||||
v-model="fitPeaksAndBaselineModalVisible"
|
||||
:curChan="currChannel"
|
||||
@result="handleInsertSuccess"
|
||||
@cancel="handleCancelSuccess"
|
||||
/>
|
||||
<!-- Fit Peaks and Baseline弹窗 结束 -->
|
||||
<!-- Nuclide Review 弹窗开始 -->
|
||||
<nuclide-review-modal v-model="nuclideReviewModalVisible" :sampleId="sampleId" :channel="currChannel" />
|
||||
|
@ -172,7 +185,7 @@ import ModalMixin from '@/mixins/ModalMixin'
|
|||
import { getAction } from '@/api/manage'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import Response from './Response.json'
|
||||
import { findSeriesByName, getXAxisAndYAxisByPosition } from '@/utils/chartHelper'
|
||||
import { findSeriesByName, getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
|
||||
// 初始配置
|
||||
|
@ -206,11 +219,7 @@ const initialOption = {
|
|||
width: 1
|
||||
}
|
||||
},
|
||||
formatter: params => {
|
||||
const [channel] = params[0].value
|
||||
return `<div class="channel">Channel: ${channel}</div>
|
||||
<div class="energy">Energy: ${(0).toFixed(2)}</div>`
|
||||
},
|
||||
formatter: undefined,
|
||||
className: 'figure-chart-option-tooltip'
|
||||
},
|
||||
xAxis: {
|
||||
|
@ -232,6 +241,7 @@ const initialOption = {
|
|||
animation: false
|
||||
},
|
||||
yAxis: {
|
||||
type: 'log',
|
||||
name: 'Counts',
|
||||
nameLocation: 'center',
|
||||
nameGap: 40,
|
||||
|
@ -256,12 +266,13 @@ const initialOption = {
|
|||
color: '#ade6ee'
|
||||
}
|
||||
},
|
||||
min: 'dataMin',
|
||||
min: 0.1,
|
||||
max: 'dataMax',
|
||||
animation: false
|
||||
},
|
||||
series: [],
|
||||
brush: {}
|
||||
brush: {},
|
||||
graphic: []
|
||||
}
|
||||
|
||||
const columns = [
|
||||
|
@ -275,31 +286,46 @@ const columns = [
|
|||
{
|
||||
title: 'Energy (keV)',
|
||||
dataIndex: 'energy',
|
||||
width: 120
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return text.toFixed(3)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Centroid (C)',
|
||||
dataIndex: 'peakCentroid',
|
||||
width: 120
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return text.toFixed(3)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'FWHM (keV)',
|
||||
dataIndex: 'fwhm',
|
||||
width: 120
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return text.toFixed(3)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Area',
|
||||
dataIndex: 'area',
|
||||
width: 120
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return text.toFixed(3)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Detectability',
|
||||
dataIndex: 'detectability',
|
||||
width: 120
|
||||
dataIndex: 'significance',
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return text.toFixed(3)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Cmnt',
|
||||
dataIndex: 'cmnt',
|
||||
title: '#Cmnt',
|
||||
dataIndex: 'comments',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
|
@ -345,9 +371,10 @@ const thumbnailOption = {
|
|||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
min: 1
|
||||
min: 0.1,
|
||||
max: 'dataMax'
|
||||
},
|
||||
series: []
|
||||
series: null
|
||||
}
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
|
@ -366,6 +393,12 @@ export default {
|
|||
thumbnailOption: cloneDeep(thumbnailOption),
|
||||
|
||||
isLoading: false,
|
||||
|
||||
channelBaseCPChart: [],
|
||||
channelBaseLineChart: [],
|
||||
channelCountChart: [],
|
||||
channelPeakChart: [],
|
||||
energy: [],
|
||||
list: [],
|
||||
sampleId: -1,
|
||||
|
||||
|
@ -386,7 +419,17 @@ export default {
|
|||
},
|
||||
|
||||
currChannel: undefined, // 当currChannel前选中的channel
|
||||
selectedTableItem: undefined // 当前选中的表格项
|
||||
selectedTableItem: undefined, // 当前选中的表格项
|
||||
|
||||
isModifying: false // 正在修改控制点
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.option.tooltip.formatter = params => {
|
||||
const channel = parseInt(params[0].value[0])
|
||||
const energy = this.energy[channel - 1]
|
||||
return `<div class="channel">Channel: ${channel}</div>
|
||||
<div class="energy">Energy: ${energy.toFixed(2)}</div>`
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -395,25 +438,30 @@ export default {
|
|||
this.isLoading = true
|
||||
this.option.series = []
|
||||
|
||||
const { success, result, message } = Response
|
||||
// const { success, result, message } = await getAction('/gamma/InteractiveTool', {
|
||||
// sampleId: this.sampleId,
|
||||
// fileName: this.fileName
|
||||
// })
|
||||
// const { success, result, message } = Response
|
||||
const { success, result, message } = await getAction('/gamma/InteractiveTool', {
|
||||
sampleId: this.sampleId,
|
||||
fileName: this.fileName
|
||||
})
|
||||
if (success) {
|
||||
this.isLoading = false
|
||||
const {
|
||||
barChart,
|
||||
channelBaseCPChart,
|
||||
channelBaseLineChart,
|
||||
channelCountChart,
|
||||
channelPeakChart,
|
||||
energy,
|
||||
table
|
||||
} = result
|
||||
this.isLoading = false
|
||||
|
||||
console.log('%c [ ]-374', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
||||
|
||||
this.channelBaseCPChart = channelBaseCPChart
|
||||
this.channelBaseLineChart = channelBaseLineChart
|
||||
this.channelCountChart = channelCountChart
|
||||
this.channelPeakChart = channelPeakChart
|
||||
this.energy = energy
|
||||
|
||||
const series = []
|
||||
|
||||
|
@ -476,15 +524,12 @@ export default {
|
|||
}
|
||||
}
|
||||
}),
|
||||
emphasis: {
|
||||
disabled: true
|
||||
},
|
||||
silent: true,
|
||||
animation: false,
|
||||
zlevel: 20
|
||||
})
|
||||
|
||||
this.thumbnailOption.series.push(
|
||||
this.buildSeriesOption(
|
||||
this.thumbnailOption.series = this.buildSeriesOption(
|
||||
'BarChart',
|
||||
barChart.map(({ x, y }) => [x, y]),
|
||||
'#fff',
|
||||
|
@ -492,7 +537,6 @@ export default {
|
|||
silent: true
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
this.list = table
|
||||
this.option.series = series
|
||||
|
@ -521,6 +565,7 @@ export default {
|
|||
emphasis: {
|
||||
disabled: true
|
||||
},
|
||||
silent: true,
|
||||
animation: false,
|
||||
...extra
|
||||
}
|
||||
|
@ -537,6 +582,8 @@ export default {
|
|||
this.getInfo()
|
||||
this.opts.notMerge = false
|
||||
|
||||
this.option.graphic = []
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.option.brush = { toolbox: [] }
|
||||
this.selectedKeys = []
|
||||
|
@ -652,15 +699,206 @@ export default {
|
|||
|
||||
// 显示comment弹窗
|
||||
handleAddComment(type) {
|
||||
if (type == 'Peak' && !this.selectedKeys.length) {
|
||||
this.$message.warn('Please Select a Peak that You Want to Add Comment!')
|
||||
return
|
||||
}
|
||||
this.commentType = type
|
||||
this.commentModalVisible = true
|
||||
},
|
||||
|
||||
// Insert按钮
|
||||
handleInsert() {
|
||||
const xAxises = this.channelBaseCPChart.map(({ point: { x } }) => x)
|
||||
const min = xAxises[0]
|
||||
const max = xAxises[xAxises.length - 1]
|
||||
if (!this.currChannel || this.currChannel < min || this.currChannel > max) {
|
||||
this.$message.warn("Couldn't insert peak, maybe out of range")
|
||||
return
|
||||
}
|
||||
|
||||
this.fitPeaksAndBaselineModalVisible = true
|
||||
},
|
||||
|
||||
// 点击 Fit Peak XXX 弹窗中的 Peaks 按钮
|
||||
handleInsertSuccess(result) {
|
||||
const {
|
||||
allData,
|
||||
barChart,
|
||||
channelBaseLineChart,
|
||||
channelPeakChart,
|
||||
shadowChannelChart,
|
||||
shadowEnergyChart,
|
||||
shapeChannelData,
|
||||
shapeEnergyData,
|
||||
table
|
||||
} = result
|
||||
|
||||
this.$emit('refresh', {
|
||||
allData,
|
||||
channelPeakChart,
|
||||
shadowChannelChart,
|
||||
shadowEnergyChart,
|
||||
shapeChannelData,
|
||||
shapeEnergyData
|
||||
})
|
||||
|
||||
this.channelPeakChart = channelPeakChart
|
||||
this.channelBaseLineChart = channelBaseLineChart
|
||||
|
||||
const series = []
|
||||
|
||||
// 推入BaseLine
|
||||
series.push({
|
||||
...this.buildSeriesOption(
|
||||
'BaseLine',
|
||||
channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${channelBaseLineChart.color})`
|
||||
),
|
||||
markLine: {
|
||||
silent: true,
|
||||
symbol: 'none',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
lineStyle: {
|
||||
color: 'red',
|
||||
width: 1
|
||||
},
|
||||
data: [{ xAxis: -1 }]
|
||||
},
|
||||
zlevel: 10
|
||||
})
|
||||
|
||||
// 推入旧的Count
|
||||
series.push(
|
||||
this.buildSeriesOption(
|
||||
'CountChart',
|
||||
this.channelCountChart.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${this.channelCountChart.color})`
|
||||
)
|
||||
)
|
||||
|
||||
// 推入Peak
|
||||
const peakSeries = []
|
||||
channelPeakChart.forEach((item, index) => {
|
||||
peakSeries.push(
|
||||
this.buildSeriesOption(
|
||||
'Peak_' + (index + 1),
|
||||
item.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${item.color})`
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
series.push(...peakSeries)
|
||||
|
||||
// 推入旧的基线控制点
|
||||
series.push({
|
||||
name: 'BaseLine_Ctrl_Point',
|
||||
type: 'scatter',
|
||||
data: this.channelBaseCPChart.map(({ size, color, point: { x, y } }) => {
|
||||
return {
|
||||
value: [x, y],
|
||||
itemStyle: {
|
||||
color: 'transparent',
|
||||
borderColor: color,
|
||||
borderWidth: size / 2
|
||||
}
|
||||
}
|
||||
}),
|
||||
silent: true,
|
||||
animation: false,
|
||||
zlevel: 20
|
||||
})
|
||||
|
||||
this.thumbnailOption.series = this.buildSeriesOption(
|
||||
'BarChart',
|
||||
barChart.map(({ x, y }) => [x, y]),
|
||||
'#fff',
|
||||
{
|
||||
silent: true
|
||||
}
|
||||
)
|
||||
|
||||
this.list = table
|
||||
this.option.series = series
|
||||
},
|
||||
|
||||
// 点击 Fit Peak XXX 弹窗中的 Cancel 按钮
|
||||
handleCancelSuccess(result) {
|
||||
const { channelPeakChart, table } = result
|
||||
this.channelPeakChart = channelPeakChart
|
||||
const series = []
|
||||
|
||||
// 推入旧的BaseLine
|
||||
series.push({
|
||||
...this.buildSeriesOption(
|
||||
'BaseLine',
|
||||
this.channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${this.channelBaseLineChart.color})`
|
||||
),
|
||||
markLine: {
|
||||
silent: true,
|
||||
symbol: 'none',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
lineStyle: {
|
||||
color: 'red',
|
||||
width: 1
|
||||
},
|
||||
data: [{ xAxis: -1 }]
|
||||
},
|
||||
zlevel: 10
|
||||
})
|
||||
|
||||
// 推入旧的Count
|
||||
series.push(
|
||||
this.buildSeriesOption(
|
||||
'CountChart',
|
||||
this.channelCountChart.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${this.channelCountChart.color})`
|
||||
)
|
||||
)
|
||||
|
||||
// 推入Peak
|
||||
const peakSeries = []
|
||||
channelPeakChart.forEach((item, index) => {
|
||||
peakSeries.push(
|
||||
this.buildSeriesOption(
|
||||
'Peak_' + (index + 1),
|
||||
item.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${item.color})`
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
series.push(...peakSeries)
|
||||
|
||||
// 推入旧的基线控制点
|
||||
series.push({
|
||||
name: 'BaseLine_Ctrl_Point',
|
||||
type: 'scatter',
|
||||
data: this.channelBaseCPChart.map(({ size, color, point: { x, y } }) => {
|
||||
return {
|
||||
value: [x, y],
|
||||
itemStyle: {
|
||||
color: 'transparent',
|
||||
borderColor: color,
|
||||
borderWidth: size / 2
|
||||
}
|
||||
}
|
||||
}),
|
||||
silent: true,
|
||||
animation: false,
|
||||
zlevel: 20
|
||||
})
|
||||
|
||||
this.list = table
|
||||
this.option.series = series
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDel() {
|
||||
if (!this.selectedKeys.length) {
|
||||
|
@ -671,28 +909,134 @@ export default {
|
|||
this.$warning({
|
||||
title: 'Warning',
|
||||
content: 'Are you sure to delete this peak?',
|
||||
onOk: () => {
|
||||
onOk: async () => {
|
||||
const [willDelKey] = this.selectedKeys
|
||||
const findIndex = this.list.findIndex(item => item.index == willDelKey)
|
||||
this.list.splice(findIndex, 1)
|
||||
this.selectedKeys = []
|
||||
// this.list.splice(findIndex, 1)
|
||||
// this.selectedKeys = []
|
||||
|
||||
const seriesIndex = this.option.series.findIndex(item => {
|
||||
return item.name == 'Peak_' + willDelKey
|
||||
// const seriesIndex = this.option.series.findIndex(item => {
|
||||
// return item.name == 'Peak_' + willDelKey
|
||||
// })
|
||||
|
||||
// this.opts.notMerge = true
|
||||
// this.option.series.splice(seriesIndex, 1)
|
||||
// this.channelPeakChart.splice(findIndex, 1)
|
||||
|
||||
// this.$nextTick(() => {
|
||||
// this.resetChartOpts()
|
||||
// })
|
||||
try {
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/deletePeak', {
|
||||
fileName,
|
||||
curRow: findIndex
|
||||
})
|
||||
if (success) {
|
||||
console.log('%c [ ]-935', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
||||
const {
|
||||
allData,
|
||||
channelPeakChart,
|
||||
shadowChannelChart,
|
||||
shadowEnergyChart,
|
||||
shapeChannelData,
|
||||
shapeEnergyData,
|
||||
table
|
||||
} = result
|
||||
|
||||
this.$emit('refresh', {
|
||||
allData,
|
||||
channelPeakChart,
|
||||
shadowChannelChart,
|
||||
shadowEnergyChart,
|
||||
shapeChannelData,
|
||||
shapeEnergyData
|
||||
})
|
||||
|
||||
this.opts.notMerge = true
|
||||
this.option.series.splice(seriesIndex, 1)
|
||||
this.channelPeakChart.splice(findIndex, 1)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.opts.notMerge = false
|
||||
this.option.brush = { toolbox: [] }
|
||||
this.channelPeakChart = channelPeakChart
|
||||
const series = []
|
||||
// 推入旧的BaseLine
|
||||
series.push({
|
||||
...this.buildSeriesOption(
|
||||
'BaseLine',
|
||||
this.channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${this.channelBaseLineChart.color})`
|
||||
),
|
||||
markLine: {
|
||||
silent: true,
|
||||
symbol: 'none',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
lineStyle: {
|
||||
color: 'red',
|
||||
width: 1
|
||||
},
|
||||
data: [{ xAxis: -1 }]
|
||||
},
|
||||
zlevel: 10
|
||||
})
|
||||
|
||||
// 推入旧的Count
|
||||
series.push(
|
||||
this.buildSeriesOption(
|
||||
'CountChart',
|
||||
this.channelCountChart.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${this.channelCountChart.color})`
|
||||
)
|
||||
)
|
||||
|
||||
// 推入Peak
|
||||
const peakSeries = []
|
||||
channelPeakChart.forEach((item, index) => {
|
||||
peakSeries.push(
|
||||
this.buildSeriesOption(
|
||||
'Peak_' + (index + 1),
|
||||
item.pointlist.map(({ x, y }) => [x, y]),
|
||||
`rgb(${item.color})`
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
series.push(...peakSeries)
|
||||
|
||||
// 推入旧的基线控制点
|
||||
series.push({
|
||||
name: 'BaseLine_Ctrl_Point',
|
||||
type: 'scatter',
|
||||
data: this.channelBaseCPChart.map(({ size, color, point: { x, y } }) => {
|
||||
return {
|
||||
value: [x, y],
|
||||
itemStyle: {
|
||||
color: 'transparent',
|
||||
borderColor: color,
|
||||
borderWidth: size / 2
|
||||
}
|
||||
}
|
||||
}),
|
||||
silent: true,
|
||||
animation: false,
|
||||
zlevel: 20
|
||||
})
|
||||
|
||||
this.list = table
|
||||
this.option.series = series
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 重置图表配置
|
||||
resetChartOpts() {
|
||||
this.opts.notMerge = false
|
||||
this.option.brush = { toolbox: [] }
|
||||
},
|
||||
|
||||
// 匹配
|
||||
handleFit() {
|
||||
if (!this.list.length) {
|
||||
|
@ -719,6 +1063,10 @@ export default {
|
|||
|
||||
// 鼠标按下时开启可刷选状态
|
||||
handleMouseDown() {
|
||||
if (this.isModifying) {
|
||||
return
|
||||
}
|
||||
|
||||
const chart = this.$refs.chartRef.getChartInstance()
|
||||
chart.dispatchAction({
|
||||
type: 'takeGlobalCursor',
|
||||
|
@ -731,6 +1079,86 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
handleMouseUp() {
|
||||
setTimeout(() => {
|
||||
const chart = this.$refs.chartRef.getChartInstance()
|
||||
this.clearBrush(chart)
|
||||
}, 0)
|
||||
},
|
||||
|
||||
clearBrush(chart) {
|
||||
// 清理刷选的范围
|
||||
chart.dispatchAction({
|
||||
type: 'brush',
|
||||
areas: []
|
||||
})
|
||||
|
||||
// 改为不可刷选状态
|
||||
chart.dispatchAction({
|
||||
type: 'takeGlobalCursor'
|
||||
})
|
||||
},
|
||||
|
||||
// 刷选完毕时
|
||||
handleBrushEnd(param) {
|
||||
const chart = this.$refs.chartRef.getChartInstance()
|
||||
const areas = param.areas[0]
|
||||
if (areas) {
|
||||
const range = areas.range
|
||||
const [[minX, maxX], [minY, maxY]] = range
|
||||
const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).map(num => parseInt(num.toFixed()))
|
||||
const point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map(num => parseInt(num.toFixed()))
|
||||
const xAxisMax = chart.getModel().getComponent('xAxis').axis.scale._extent[1]
|
||||
const yAxisMax = this.option.yAxis.max
|
||||
let [x1, y2, x2, y1] = [...point1, ...point2] // 根据解析出的数据确定真实的范围
|
||||
const xAxisLimit = rangeNumber(1, xAxisMax)
|
||||
const yAxisLimit = rangeNumber(0.1, yAxisMax)
|
||||
x1 = xAxisLimit(x1)
|
||||
x2 = xAxisLimit(x2)
|
||||
y1 = yAxisLimit(y1)
|
||||
y2 = yAxisLimit(y2)
|
||||
this.option.xAxis.min = x1
|
||||
this.option.xAxis.max = x2
|
||||
this.option.yAxis.min = y1
|
||||
this.option.yAxis.max = y2
|
||||
|
||||
this.thumbnailOption.xAxis.min = x1
|
||||
this.thumbnailOption.xAxis.max = x2
|
||||
this.thumbnailOption.yAxis.min = y1
|
||||
this.thumbnailOption.yAxis.max = y2
|
||||
|
||||
if (this.btnGroupType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.option.graphic = this._channelBaseCPChart.map(({ point: { x, y } }, dataIndex) => {
|
||||
return this.buildGraphicPoint(chart, x, y, dataIndex)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
this.clearBrush(chart)
|
||||
},
|
||||
|
||||
handleResetChart() {
|
||||
this.option.xAxis.min = 1
|
||||
this.option.xAxis.max = 'dataMax'
|
||||
this.option.yAxis.min = 0.1
|
||||
this.option.yAxis.max = 'dataMax'
|
||||
|
||||
this.thumbnailOption.xAxis.min = 1
|
||||
this.thumbnailOption.xAxis.max = 'dataMax'
|
||||
this.thumbnailOption.yAxis.min = 0.1
|
||||
this.thumbnailOption.yAxis.max = 'dataMax'
|
||||
|
||||
if (this.btnGroupType == 2) {
|
||||
const chart = this.$refs.chartRef.getChartInstance()
|
||||
this.$nextTick(() => {
|
||||
this.option.graphic = this._channelBaseCPChart.map(({ point: { x, y } }, dataIndex) => {
|
||||
return this.buildGraphicPoint(chart, x, y, dataIndex)
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 切换操作
|
||||
handleSwitchOperation() {
|
||||
// 切换到Base Line 和 Control Point 操作
|
||||
|
@ -738,29 +1166,153 @@ export default {
|
|||
this.btnGroupType = 2
|
||||
|
||||
const originalCPSeries = findSeriesByName(this.option.series, 'BaseLine')
|
||||
this.option.series.push(
|
||||
this.buildSeriesOption('Edit_BaseLine', originalCPSeries.data, '#fff', {
|
||||
|
||||
const baseLineEditSeries = this.buildSeriesOption('BaseLine_Edit', cloneDeep(originalCPSeries.data), '#fff', {
|
||||
zlevel: 21
|
||||
})
|
||||
)
|
||||
|
||||
this.option.series.push(baseLineEditSeries)
|
||||
|
||||
const chart = this.$refs.chartRef.getChartInstance()
|
||||
|
||||
this.option.graphic = this.channelBaseCPChart.map(({ point: { x, y } }, dataIndex) => {
|
||||
return this.buildGraphicPoint(chart, x, y, dataIndex)
|
||||
})
|
||||
|
||||
this._channelBaseCPChart = cloneDeep(this.channelBaseCPChart)
|
||||
}
|
||||
// 切换回 Peak 操作
|
||||
else {
|
||||
this.btnGroupType = 1
|
||||
this.opts.notMerge = true
|
||||
this.option.series.splice(this.option.series.length - 1, 1)
|
||||
this.option.graphic = []
|
||||
this.$nextTick(() => {
|
||||
this.resetChartOpts()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
buildGraphicPoint(chart, x, y, dataIndex) {
|
||||
const [xPix, yPix] = chart.convertToPixel('grid', [x, y])
|
||||
return {
|
||||
type: 'rect',
|
||||
position: [xPix, yPix],
|
||||
shape: {
|
||||
x: -4,
|
||||
y: -4,
|
||||
width: 8,
|
||||
height: 8
|
||||
},
|
||||
style: {
|
||||
stroke: 'red',
|
||||
fill: 'transparent',
|
||||
lineWidth: 2
|
||||
},
|
||||
draggable: false,
|
||||
ondrag: function() {
|
||||
const [xPixel] = chart.convertToPixel('grid', [x, y])
|
||||
this.position[0] = xPixel
|
||||
},
|
||||
ondragend: ({ offsetY }) => {
|
||||
this.option.graphic[dataIndex].position = [xPix, offsetY]
|
||||
this.setGraphicDraggable(false)
|
||||
|
||||
const [xAxis, yAxis] = getXAxisAndYAxisByPosition(chart, xPix, offsetY)
|
||||
|
||||
const baseLineEditSeries = findSeriesByName(this.option.series, 'BaseLine_Edit')
|
||||
|
||||
baseLineEditSeries.data[parseInt(xAxis) - 1] = [x, yAxis]
|
||||
|
||||
this._channelBaseCPChart[dataIndex].point.y = yAxis
|
||||
},
|
||||
zlevel: 100
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置小方块可拖拽
|
||||
*/
|
||||
setGraphicDraggable(draggable) {
|
||||
this.option.graphic.forEach(item => {
|
||||
item.draggable = draggable
|
||||
})
|
||||
this.isModifying = draggable
|
||||
},
|
||||
|
||||
// 在当前选中的红线位置新增控制点
|
||||
handleAddCP() {
|
||||
const xAxis = this.option.series[0].markLine.data[0].xAxis
|
||||
|
||||
if (xAxis == -1) {
|
||||
const xAxises = this.channelBaseCPChart.map(({ point: { x } }) => x)
|
||||
const min = xAxises[0]
|
||||
const max = xAxises[xAxises.length - 1]
|
||||
if (!this.currChannel || this.currChannel < min || this.currChannel > max) {
|
||||
this.$message.warn("Can't insert Control Point out of range")
|
||||
return
|
||||
}
|
||||
|
||||
console.log('%c [ ]-735', 'font-size:13px; background:pink; color:#bf2c9f;', xAxis)
|
||||
const chart = this.$refs.chartRef.getChartInstance()
|
||||
|
||||
const controlPointList = this.option.graphic
|
||||
const find = controlPointList.find(item => {
|
||||
return item.position[0] == xPix
|
||||
})
|
||||
if (find) {
|
||||
return
|
||||
}
|
||||
|
||||
let i = 0 // 记录新控制点在列表中的位置
|
||||
const [xPix] = chart.convertToPixel('grid', [this.currChannel, 0])
|
||||
for (; i < controlPointList.length; ++i) {
|
||||
const currCP = controlPointList[i].position[0]
|
||||
if (currCP >= xPix) {
|
||||
if (currCP == xPix) {
|
||||
this.$message.warn(`The new control point in channel ${this.currChannel} exists, can't introduce twice`)
|
||||
return
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const baseLineEditSeries = findSeriesByName(this.option.series, 'BaseLine_Edit')
|
||||
|
||||
const yAxis = baseLineEditSeries.data[this.currChannel - 1][1]
|
||||
this.option.graphic.splice(
|
||||
i,
|
||||
0,
|
||||
this.buildGraphicPoint(chart, this.currChannel, yAxis, this.option.graphic.length)
|
||||
)
|
||||
|
||||
this._channelBaseCPChart.splice(i, 0, { point: { x: this.currChannel, y: yAxis } })
|
||||
},
|
||||
|
||||
// 移除控制点
|
||||
handleRemoveCP() {
|
||||
// find nearest control-point
|
||||
const chart = this.$refs.chartRef.getChartInstance()
|
||||
const controlPointList = this.option.graphic
|
||||
let i = 1
|
||||
for (; i < controlPointList.length; ++i) {
|
||||
const [currX, currY] = controlPointList[i].position
|
||||
const [currXAxis] = getXAxisAndYAxisByPosition(chart, currX, currY)
|
||||
if (currXAxis >= this.currChannel) {
|
||||
const [prevX, prevY] = controlPointList[i - 1].position
|
||||
const [prevXAxis] = getXAxisAndYAxisByPosition(chart, prevX, prevY)
|
||||
if (currXAxis - this.currChannel > this.currChannel - prevXAxis) --i
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0 || i >= controlPointList.length - 1) {
|
||||
this.$message.warn("Can't remove first/last control point")
|
||||
return
|
||||
}
|
||||
|
||||
controlPointList.splice(i, 1)
|
||||
},
|
||||
|
||||
// 修改控制点
|
||||
handleModifyCP() {
|
||||
this.setGraphicDraggable(true)
|
||||
},
|
||||
|
||||
// 确定对Control Point 的操作
|
||||
|
|
|
@ -109,15 +109,11 @@
|
|||
import { getAction } from '@/api/manage'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder },
|
||||
mixins: [ModalMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
|
@ -128,8 +124,10 @@ export default {
|
|||
async getInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/configure', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
|
|
|
@ -16,15 +16,13 @@
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import { saveAs } from 'file-saver';
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
export default {
|
||||
mixins: [ModalMixin],
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
type: {
|
||||
type: Number
|
||||
},
|
||||
sampleId: {
|
||||
type: Number
|
||||
},
|
||||
extraData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
|
@ -40,8 +38,6 @@ export default {
|
|||
methods: {
|
||||
async getContent() {
|
||||
let url = ''
|
||||
|
||||
console.log('%c [ ]-42', 'font-size:13px; background:pink; color:#bf2c9f;', this.type)
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
url = '/gamma/viewARR'
|
||||
|
@ -59,7 +55,12 @@ export default {
|
|||
try {
|
||||
this.content = ''
|
||||
this.isLoading = true
|
||||
const res = await getAction(url, { sampleId: this.sampleId, ...this.extraData })
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const res = await getAction(url, {
|
||||
sampleId,
|
||||
fileName,
|
||||
...this.extraData
|
||||
})
|
||||
if (res.success) {
|
||||
this.content = res.result
|
||||
} else {
|
||||
|
@ -73,11 +74,7 @@ export default {
|
|||
},
|
||||
|
||||
beforeModalOpen() {
|
||||
|
||||
console.log('%c [ ]-75', 'font-size:13px; background:pink; color:#bf2c9f;', this.sampleId)
|
||||
if (this.sampleId) {
|
||||
this.getContent()
|
||||
}
|
||||
},
|
||||
handleOk() {
|
||||
this.fileName=""
|
||||
|
|
|
@ -22,16 +22,15 @@
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../../TitleOverBorder.vue'
|
||||
import { getAction } from '../../../../../api/manage'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder },
|
||||
mixins: [ModalMixin],
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -48,8 +47,10 @@ export default {
|
|||
async getCommets() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const res = await getAction('/spectrumAnalysis/viewComment', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
if (res.success) {
|
||||
this.comments = res.result
|
||||
|
|
|
@ -163,7 +163,8 @@ export default {
|
|||
},
|
||||
// 导出到Excel
|
||||
handleExportToExcel() {
|
||||
this.fileName_excel=""
|
||||
this.fileName_excel = ""
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
if (this.list.length>0) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
|
@ -178,10 +179,9 @@ export default {
|
|||
},
|
||||
onCancel() {
|
||||
if (_this.fileName_excel) {
|
||||
_this.visible = false
|
||||
let params = {
|
||||
sampleId: _this.sampleData.sampleId||"",
|
||||
fileName: _this.sampleData.fileName
|
||||
sampleId: sampleId || "",
|
||||
fileName
|
||||
}
|
||||
getFileAction('/spectrumAnalysis/exportQCResult', params).then(res => {
|
||||
if (res.code && res.code == 500) {
|
||||
|
|
|
@ -90,7 +90,8 @@ export default {
|
|||
},
|
||||
// 导出到Excel
|
||||
handleExportToExcel() {
|
||||
this.fileName_excel=""
|
||||
this.fileName_excel = ""
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
if (this.content) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
|
@ -105,10 +106,9 @@ export default {
|
|||
},
|
||||
onCancel() {
|
||||
if (_this.fileName_excel) {
|
||||
_this.visible = false
|
||||
let params = {
|
||||
sampleId: _this.sampleData.sampleId||"",
|
||||
fileName: _this.sampleData.fileName
|
||||
sampleId: sampleId || "",
|
||||
fileName
|
||||
}
|
||||
getFileAction('/spectrumAnalysis/exportSampleInformation', params).then(res => {
|
||||
if (res.code && res.code == 500) {
|
||||
|
|
|
@ -34,13 +34,9 @@
|
|||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import { getAction } from '@/api/manage'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
export default {
|
||||
mixins: [ModalMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
|
@ -56,8 +52,10 @@ export default {
|
|||
async getInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/configUserLibrary', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
if (success) {
|
||||
this.isLoading = false
|
||||
|
|
|
@ -16,14 +16,9 @@
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { saveAs } from 'file-saver';
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
export default {
|
||||
mixins: [ModalMixin,SampleDataMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
data() {
|
||||
return {
|
||||
text: "",
|
||||
|
@ -37,9 +32,10 @@ export default {
|
|||
},
|
||||
getViewGammaviewerLog() {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
let params = {
|
||||
sampleId: this.sampleId,
|
||||
fileName: this.sampleData.fileName
|
||||
sampleId,
|
||||
fileName
|
||||
}
|
||||
getAction("/gamma/viewGammaViewerLog", params).then(res => {
|
||||
this.isLoading = false
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
}"
|
||||
>
|
||||
<a-form-model-item label="Channel">
|
||||
<a-input v-model="model.channel"></a-input>
|
||||
<a-input type="number" v-model="model.channel"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Energy">
|
||||
<a-input v-model="model.energy"></a-input>
|
||||
<a-input type="number" v-model="model.energy"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleInsert">Insert</a-button>
|
||||
|
@ -78,7 +78,7 @@
|
|||
<div class="content">
|
||||
<div
|
||||
class="item"
|
||||
:class="item == currSelectedDataSource? 'active': ''"
|
||||
:class="item == currSelectedDataSource ? 'active' : ''"
|
||||
v-for="(item, index) in dataSourceList"
|
||||
:key="index"
|
||||
@click="handleDataSourceClick(item)"
|
||||
|
@ -105,6 +105,7 @@ import CustomChart from '@/components/CustomChart/index.vue'
|
|||
import { getAction } from '@/api/manage'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { buildLineSeries } from '@/utils/chartHelper'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
|
@ -185,12 +186,7 @@ const initialOption = {
|
|||
|
||||
export default {
|
||||
components: { TitleOverBorder, CustomChart },
|
||||
mixins: [ModalMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
|
@ -209,8 +205,10 @@ export default {
|
|||
async getData() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/energyCalibration', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
|
@ -274,7 +272,38 @@ export default {
|
|||
},
|
||||
|
||||
// 插入
|
||||
handleInsert() {},
|
||||
handleInsert() {
|
||||
const centroid = parseFloat(this.model.channel)
|
||||
const energy = parseFloat(this.model.energy)
|
||||
|
||||
if (Number.isNaN(centroid) || Number.isNaN(energy)) {
|
||||
this.$message.warn('Format is invalid.')
|
||||
return
|
||||
}
|
||||
|
||||
if (centroid <= 100 || centroid >= 16342) {
|
||||
this.$message.warn('Centroid must be in the range of analysis!')
|
||||
return
|
||||
}
|
||||
|
||||
let i,
|
||||
num = this.list.length
|
||||
for (i = 0; i < num; ++i) {
|
||||
const channel = this.list[i].channel
|
||||
if (Math.abs(channel - centroid) < 0.01) {
|
||||
this.$message.warn('The centroid has already existed!')
|
||||
return
|
||||
} else if (channel > centroid) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
console.log('%c [ 在位置插入 ]-297', 'font-size:13px; background:pink; color:#bf2c9f;', i)
|
||||
this.list.splice(i, 0, {
|
||||
channel: centroid,
|
||||
energy
|
||||
})
|
||||
},
|
||||
|
||||
// 修改
|
||||
handleModify() {},
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
<script>
|
||||
import { getAction, getFileAction } from '@/api/manage'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
import { saveAs } from 'file-saver';
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
|
@ -116,11 +116,6 @@ const columns = [
|
|||
]
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
|
@ -145,8 +140,10 @@ export default {
|
|||
async getInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/radionuclideActivity', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
if (success) {
|
||||
const { dateTime_act_ref, dateTime_con_ref, table } = result
|
||||
|
@ -170,7 +167,8 @@ export default {
|
|||
|
||||
// 导出到Excel
|
||||
handleExportToExcel() {
|
||||
this.fileName=""
|
||||
this.fileName = ""
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
if (this.list.length > 0) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
|
@ -185,12 +183,9 @@ export default {
|
|||
},
|
||||
onCancel() {
|
||||
if (_this.fileName) {
|
||||
_this.visible = false
|
||||
let params = {
|
||||
// sampleId: "426530",
|
||||
// fileName: "CAX05_001-20230731_1528_S_FULL_37563.6.PHD"
|
||||
sampleId: _this.sampleId,
|
||||
fileName: _this.sampleData.fileName
|
||||
sampleId,
|
||||
fileName
|
||||
}
|
||||
getFileAction('/gamma/exportRadionuclideActivity', params).then(res => {
|
||||
if (res.code && res.code == 500) {
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
:list="daughterList"
|
||||
:pagination="false"
|
||||
:scroll="{ y: 123 }"
|
||||
rowKey="daughters"
|
||||
@rowDblClick="handleParentDBClick($event.daughters)"
|
||||
></custom-table>
|
||||
</div>
|
||||
|
@ -113,6 +114,7 @@
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import { getAction } from '@/api/manage'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
// 右上角表格配置
|
||||
const daughterColumns = [
|
||||
|
@ -178,15 +180,10 @@ const mainColumns = [
|
|||
]
|
||||
|
||||
export default {
|
||||
mixins: [ModalMixin],
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
components: {
|
||||
TitleOverBorder
|
||||
},
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.daughterColumns = daughterColumns
|
||||
this.mainColumns = mainColumns
|
||||
|
@ -210,8 +207,10 @@ export default {
|
|||
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/NuclideLibrary', {
|
||||
sampleId: this.sampleId,
|
||||
sampleId,
|
||||
fileName,
|
||||
...this.model
|
||||
})
|
||||
if (success) {
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
<script>
|
||||
import { getAction, getFileAction } from '@/api/manage'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
import { saveAs } from 'file-saver';
|
||||
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
const columns = [
|
||||
{
|
||||
title: 'Name',
|
||||
|
@ -61,11 +60,6 @@ const columns = [
|
|||
]
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
|
@ -78,8 +72,10 @@ export default {
|
|||
async getData() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/viewQCResult', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
if (success) {
|
||||
this.list = result
|
||||
|
@ -98,7 +94,8 @@ export default {
|
|||
},
|
||||
// 导出到Excel
|
||||
handleExportToExcel() {
|
||||
this.fileName=""
|
||||
this.fileName = ""
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
if (this.list.length > 0) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
|
@ -113,12 +110,9 @@ export default {
|
|||
},
|
||||
onCancel() {
|
||||
if (_this.fileName) {
|
||||
_this.visible = false
|
||||
let params = {
|
||||
// sampleId: "426530",
|
||||
// fileName: "CAX05_001-20230731_1528_S_FULL_37563.6.PHD"
|
||||
sampleId: _this.sampleId,
|
||||
fileName: _this.sampleData.fileName
|
||||
sampleId,
|
||||
fileName
|
||||
}
|
||||
getFileAction('/gamma/exportQCResult', params).then(res => {
|
||||
if (res.code && res.code == 500) {
|
||||
|
|
|
@ -97,6 +97,7 @@ import Conclusions from './components/Conclusions.vue'
|
|||
import Comment from './components/Comment.vue'
|
||||
import { getAction } from '@/api/manage'
|
||||
import Custom from '@/views/account/settings/Custom.vue'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
|
||||
const tabs = [
|
||||
'Header',
|
||||
|
@ -118,7 +119,7 @@ const tabs = [
|
|||
]
|
||||
|
||||
export default {
|
||||
mixins: [ModalMixin],
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
components: {
|
||||
CHeader,
|
||||
Objective,
|
||||
|
@ -138,11 +139,6 @@ export default {
|
|||
Comment,
|
||||
Custom
|
||||
},
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.tabs = tabs
|
||||
return {
|
||||
|
@ -181,8 +177,10 @@ export default {
|
|||
},
|
||||
getGammaViewRLR() {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
let params = {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
}
|
||||
getAction("/gamma/viewRLR", params).then(res => {
|
||||
this.isLoading = false
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<a-row>
|
||||
<a-col :span="12" v-for="(item, index) in columns" :key="index">
|
||||
<a-form-model-item :label="item.title">
|
||||
{{ item.key == 'sampleId' && !isLoading ? sampleId : data[item.key] }}
|
||||
{{ data[item.key] }}
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
@ -25,8 +25,8 @@
|
|||
<script>
|
||||
import { getAction, getFileAction } from '@/api/manage'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
import { saveAs } from 'file-saver';
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
|
@ -89,11 +89,6 @@ const columns = [
|
|||
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
|
@ -106,10 +101,13 @@ export default {
|
|||
async getInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/sampleInformation', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
if (success) {
|
||||
result.sampleId = sampleId
|
||||
this.data = result
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
|
@ -127,7 +125,8 @@ export default {
|
|||
},
|
||||
// 导出到Excel
|
||||
handleExportToExcel() {
|
||||
this.fileName=""
|
||||
this.fileName = ""
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
if (Object.keys(this.data).length > 0) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
|
@ -142,12 +141,9 @@ export default {
|
|||
},
|
||||
onCancel() {
|
||||
if (_this.fileName) {
|
||||
_this.visible = false
|
||||
let params = {
|
||||
// sampleId: "426530",
|
||||
// fileName: "CAX05_001-20230731_1528_S_FULL_37563.6.PHD"
|
||||
sampleId: this.sampleId,
|
||||
fileName: this.sampleData.fileName
|
||||
sampleId,
|
||||
fileName
|
||||
}
|
||||
getFileAction('/gamma/exportSampleInformation', params).then(res => {
|
||||
if (res.code && res.code == 500) {
|
||||
|
|
|
@ -9,15 +9,14 @@
|
|||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
export default {
|
||||
mixins: [ModalMixin],
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -39,8 +38,10 @@ export default {
|
|||
async getInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/viewComment', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
|
|
|
@ -11,13 +11,9 @@
|
|||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import { getAction } from '@/api/manage'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
export default {
|
||||
mixins: [ModalMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
data() {
|
||||
return {
|
||||
content: '',
|
||||
|
@ -28,8 +24,10 @@ export default {
|
|||
async getContent() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/Spectrum', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
if (success) {
|
||||
this.content = result
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</title-over-border>
|
||||
<!-- Result of Zero Time -->
|
||||
<title-over-border class="mt-20" title="Result of Zero Time">
|
||||
<div class="result-of-zero-time">{{ dateTime }}</div>
|
||||
<div class="result-of-zero-time">{{ result.zeroTime }}</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
<!-- 左侧结束 -->
|
||||
|
@ -106,7 +106,7 @@
|
|||
Analysis
|
||||
</a-button>
|
||||
<a-button type="primary">Save</a-button>
|
||||
<a-button type="primary">Exit</a-button>
|
||||
<a-button type="primary" @click="visible = false">Exit</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧结束 -->
|
||||
|
@ -134,10 +134,11 @@ export default {
|
|||
fissionProductList1: [],
|
||||
fissionProductList2: [],
|
||||
|
||||
dateTime: '',
|
||||
model: {},
|
||||
|
||||
isAnalyzing: false
|
||||
isAnalyzing: false,
|
||||
|
||||
result: { }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -184,7 +185,9 @@ export default {
|
|||
time: undefined
|
||||
}
|
||||
|
||||
this.dateTime = '2015-05-30 17:30:60'
|
||||
this.result = {
|
||||
zeroTime: '2015-05-30 17:30:60'
|
||||
}
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
|
@ -199,7 +202,7 @@ export default {
|
|||
this.isAnalyzing = true
|
||||
const { success, result, message } = await getAction('/gamma/ZeroTimeAnalyse', this.model)
|
||||
if (success) {
|
||||
this.dateTime = result
|
||||
this.result = result
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
@ -319,7 +322,7 @@ export default {
|
|||
justify-content: space-between;
|
||||
|
||||
.ant-btn {
|
||||
padding: 0 45px;
|
||||
width: 150px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
|
||||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
import { getAction, getFileAction } from '@/api/manage'
|
||||
import { saveAs } from 'file-saver';
|
||||
import SampleDataMixin from '../SampleDataMixin'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
|
@ -83,11 +83,6 @@ const columns = [
|
|||
]
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
|
@ -107,8 +102,10 @@ export default {
|
|||
async getInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/peakInformation', {
|
||||
sampleId: this.sampleId
|
||||
sampleId,
|
||||
fileName
|
||||
})
|
||||
if (success) {
|
||||
this.list = result
|
||||
|
@ -129,7 +126,8 @@ export default {
|
|||
|
||||
// 导出到Excel
|
||||
handleExportToExcel() {
|
||||
this.fileName=""
|
||||
this.fileName = ""
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
if (this.list.length > 0) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
|
@ -144,12 +142,9 @@ export default {
|
|||
},
|
||||
onCancel() {
|
||||
if (_this.fileName) {
|
||||
_this.visible = false
|
||||
let params = {
|
||||
// sampleId: "426530",
|
||||
// fileName: "CAX05_001-20230731_1528_S_FULL_37563.6.PHD"
|
||||
sampleId: _this.sampleId,
|
||||
fileName: _this.sampleData.fileName
|
||||
sampleId,
|
||||
fileName
|
||||
}
|
||||
getFileAction('/gamma/exportPeakInformation', params).then(res => {
|
||||
if (res.code && res.code == 500) {
|
||||
|
|
|
@ -70,7 +70,7 @@ import NuclearLibrary from './components/SubOperators/NuclearLibrary.vue'
|
|||
import ButtonWithSwitchIcon from './components/SubOperators/ButtonWithSwitchIcon.vue'
|
||||
import { getAction } from '@/api/manage'
|
||||
import Response from './response.json'
|
||||
import { getXAxisAndYAxisByPosition } from '@/utils/chartHelper'
|
||||
import { getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper'
|
||||
import { cloneDeep } from 'lodash'
|
||||
|
||||
// 初始配置
|
||||
|
@ -166,7 +166,7 @@ const initialOption = {
|
|||
max: 'dataMax',
|
||||
animation: false,
|
||||
axisLabel: {
|
||||
formatter: (value) => {
|
||||
formatter: value => {
|
||||
return value.toFixed(1)
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ const thumbnailOption = {
|
|||
show: false
|
||||
},
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
max: 'dataMax'
|
||||
},
|
||||
series: []
|
||||
}
|
||||
|
@ -326,7 +326,9 @@ export default {
|
|||
this.shapeEnergyData = shapeEnergyData
|
||||
|
||||
this.option.yAxis.max = Math.ceil(Math.max(...shadowChannelChart.pointlist.map(item => item.y)) * 1.1)
|
||||
this.thumbnailOption.yAxis.max = Math.ceil(Math.max(...shadowChannelChart.pointlist.map(item => item.y)) * 1.1)
|
||||
this.thumbnailOption.yAxis.max = Math.ceil(
|
||||
Math.max(...shadowChannelChart.pointlist.map(item => item.y)) * 1.1
|
||||
)
|
||||
|
||||
const series = []
|
||||
|
||||
|
@ -766,8 +768,8 @@ export default {
|
|||
|
||||
let [x1, y2, x2, y1] = [...point1, ...point2] // 根据解析出的数据确定真实的范围
|
||||
|
||||
const xAxisLimit = this.rangeNumber(1, xAxisMax)
|
||||
const yAxisLimit = this.rangeNumber(1, yAxisMax)
|
||||
const xAxisLimit = rangeNumber(1, xAxisMax)
|
||||
const yAxisLimit = rangeNumber(1, yAxisMax)
|
||||
|
||||
x1 = xAxisLimit(x1)
|
||||
x2 = xAxisLimit(x2)
|
||||
|
@ -844,17 +846,16 @@ export default {
|
|||
|
||||
const xAxisMax = thumbnailChart.getModel().getComponent('xAxis').axis.scale._extent[1]
|
||||
|
||||
const xAxisLimit = this.rangeNumber(1 + halfWidth, xAxisMax - halfWidth)
|
||||
const xAxisLimit = rangeNumber(1 + halfWidth, xAxisMax - halfWidth)
|
||||
|
||||
const halfHeightPixel = this.halfHeightPixel
|
||||
const yAxisLimit = this.rangeNumber(maxYAxisPixel + halfHeightPixel, minYAxisPixel - halfHeightPixel)
|
||||
const yAxisLimit = rangeNumber(maxYAxisPixel + halfHeightPixel, minYAxisPixel - halfHeightPixel)
|
||||
|
||||
xAxis = xAxisLimit(xAxis)
|
||||
|
||||
let [,yAxisPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, yAxis])
|
||||
let [, yAxisPixel] = thumbnailChart.convertToPixel({ seriesIndex: 0 }, [0, yAxis])
|
||||
yAxisPixel = yAxisLimit(yAxisPixel)
|
||||
|
||||
|
||||
const minYAxis = thumbnailChart.convertFromPixel({ seriesIndex: 0 }, [0, yAxisPixel + halfHeightPixel])[1] // 再把y轴最小值从pix转为yAxis
|
||||
const maxYAxis = thumbnailChart.convertFromPixel({ seriesIndex: 0 }, [0, yAxisPixel - halfHeightPixel])[1]
|
||||
|
||||
|
@ -887,6 +888,61 @@ export default {
|
|||
this.thumbnailChartRect = []
|
||||
},
|
||||
|
||||
// 从分析工具刷新部分数据
|
||||
refresh(data) {
|
||||
console.log('%c [ data ]-892', 'font-size:13px; background:pink; color:#bf2c9f;', data)
|
||||
const { allData, shadowChannelChart, shadowEnergyChart, shapeChannelData, shapeEnergyData } = data
|
||||
|
||||
const channelPeakGroup = allData.filter(item => item.name == 'Peak' && item.group == 'channel')
|
||||
const energyPeakGroup = allData.filter(item => item.name == 'Peak' && item.group == 'energy')
|
||||
|
||||
const channelBaseLine = allData.find(item => item.name == 'BaseLine' && item.group == 'channel')
|
||||
const energyBaseLine = allData.find(item => item.name == 'BaseLine' && item.group == 'energy')
|
||||
|
||||
const channelLcLine = allData.find(item => item.name == 'Lc' && item.group == 'channel')
|
||||
const energyLcLine = allData.find(item => item.name == 'Lc' && item.group == 'energy')
|
||||
|
||||
const channelScacLine = allData.find(item => item.name == 'Scac' && item.group == 'channel')
|
||||
const energyScacLine = allData.find(item => item.name == 'Scac' && item.group == 'energy')
|
||||
|
||||
this.allEnergy = allData.find(item => item.name == 'Energy' && item.group == 'energy')
|
||||
this.allChannel = allData.find(item => item.name == 'Count' && item.group == 'channel')
|
||||
|
||||
// 保存Peak Line
|
||||
this.channelPeakGroup = channelPeakGroup
|
||||
this.energyPeakGroup = energyPeakGroup
|
||||
|
||||
// 保存 Spectrum Line
|
||||
this.shadowChannelChart = shadowChannelChart
|
||||
this.shadowEnergyChart = shadowEnergyChart
|
||||
|
||||
// 保存基线
|
||||
this.channelBaseLine = channelBaseLine
|
||||
this.energyBaseLine = energyBaseLine
|
||||
|
||||
// 保存Lc
|
||||
this.channelLcLine = channelLcLine
|
||||
this.energyLcLine = energyLcLine
|
||||
|
||||
// 保存Scac
|
||||
this.channelScacLine = channelScacLine
|
||||
this.energyScacLine = energyScacLine
|
||||
|
||||
// 保存 基线控制点
|
||||
this.shapeChannelData = shapeChannelData
|
||||
this.shapeEnergyData = shapeEnergyData
|
||||
|
||||
this.redrawPeakLine()
|
||||
this.redrawCtrlPointBySeriesName()
|
||||
|
||||
this.redrawLineBySeriesName('BaseLine', this.energyBaseLine, this.channelBaseLine, this.graphAssistance.Baseline)
|
||||
this.redrawLineBySeriesName('LcLine', this.energyLcLine, this.channelLcLine, this.graphAssistance.Lc)
|
||||
this.redrawLineBySeriesName('ScacLine', this.energyScacLine, this.channelScacLine, this.graphAssistance.SCAC)
|
||||
this.redrawLineBySeriesName('Spectrum', this.shadowEnergyChart, this.shadowChannelChart)
|
||||
|
||||
this.redrawThumbnailChart()
|
||||
},
|
||||
|
||||
// 根据name查找series
|
||||
findSeriesByName(seriesName) {
|
||||
return this.option.series.find(item => item.name == seriesName)
|
||||
|
@ -908,17 +964,6 @@ export default {
|
|||
]
|
||||
},
|
||||
|
||||
/**
|
||||
* 限定数字在一定范围
|
||||
* @param {Number} min
|
||||
* @param {Number} max
|
||||
*/
|
||||
rangeNumber(min, max) {
|
||||
return num => {
|
||||
return num > max ? max : num < min ? min : num
|
||||
}
|
||||
},
|
||||
|
||||
getChannelByEnergy(energy) {
|
||||
let channel = 0
|
||||
for (let index = 1; index < this.allEnergy.pointlist.length; index++) {
|
||||
|
|
|
@ -60,11 +60,11 @@
|
|||
<!-- Ftransit 弹窗结束 -->
|
||||
|
||||
<!-- Peak Infomation 弹窗开始 -->
|
||||
<peak-infomation v-model="peakInfomationModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<peak-infomation v-model="peakInfomationModalVisible" />
|
||||
<!-- Peak Infomation 弹窗结束 -->
|
||||
|
||||
<!-- Nuclide Activity and MDC 弹窗开始 -->
|
||||
<nuclide-activity-and-mdc-modal v-model="nuclideActivityAndMDCModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<nuclide-activity-and-mdc-modal v-model="nuclideActivityAndMDCModalVisible" />
|
||||
<!-- Nuclide Activity and MDC 弹窗结束 -->
|
||||
|
||||
<!-- Save Setting 弹窗开始 -->
|
||||
|
@ -76,7 +76,7 @@
|
|||
<!-- 分析-设置弹窗结束 -->
|
||||
|
||||
<!-- 分析工具弹窗开始 -->
|
||||
<analyze-interactive-tool-modal v-model="analyzeInteractiveToolModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<analyze-interactive-tool-modal v-model="analyzeInteractiveToolModalVisible" :sampleId="sampleData.sampleId" @refresh="handleRefreshGamma" />
|
||||
<!-- 分析工具弹窗结束 -->
|
||||
|
||||
<!-- Korsum 弹窗开始 -->
|
||||
|
@ -96,7 +96,7 @@
|
|||
<!-- Efficiency Calibration 弹窗结束 -->
|
||||
|
||||
<!-- Energy Calibration 弹窗开始 -->
|
||||
<energy-calibration-modal v-model="energyCalibrationModalShow" :sampleId="sampleData.sampleId" />
|
||||
<energy-calibration-modal v-model="energyCalibrationModalShow" />
|
||||
<!-- Energy Calibration 弹窗结束 -->
|
||||
|
||||
<!-- Resolution Calibration 弹窗开始 -->
|
||||
|
@ -107,7 +107,6 @@
|
|||
<spectrum-comments-modal
|
||||
v-model="gammaCommentsModalVisible"
|
||||
:isAdd="isGammaCommentsAdd"
|
||||
:sampleId="sampleData.sampleId"
|
||||
/>
|
||||
<!-- SpectrumComments 弹窗结束 -->
|
||||
|
||||
|
@ -120,36 +119,35 @@
|
|||
<!-- Data Processing Log 弹窗结束 -->
|
||||
|
||||
<!-- Config User Library 弹窗开始 -->
|
||||
<config-user-library-modal v-model="configUserLibModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<config-user-library-modal v-model="configUserLibModalVisible" />
|
||||
<!-- Config User Library 弹窗结束 -->
|
||||
|
||||
<!-- Nuclide Library 弹窗开始 -->
|
||||
<nuclide-library-modal v-model="nuclideLibraryModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<nuclide-library-modal v-model="nuclideLibraryModalVisible" />
|
||||
<!-- Nuclide Library 弹窗结束 -->
|
||||
|
||||
<!-- Arr 和 RRR 弹窗开始 -->
|
||||
<arr-rrr-modal
|
||||
v-model="arrOrRRRModalVisible"
|
||||
:type="arrOrRRRModalType"
|
||||
:sampleId="this.sampleData.sampleId"
|
||||
:extraData="this.arrOrRRRModalExtraData"
|
||||
/>
|
||||
<!-- Arr 弹窗结束 -->
|
||||
|
||||
<!-- Spectrum 弹窗开始 -->
|
||||
<spectrum-modal v-model="spectrumModalVisible" :sampleId="this.sampleData.sampleId" />
|
||||
<spectrum-modal v-model="spectrumModalVisible" />
|
||||
<!-- Spectrum 弹窗结束 -->
|
||||
|
||||
<!-- SampleInfo 弹窗开始 -->
|
||||
<sample-infomation-modal v-model="sampleInfomationModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<sample-infomation-modal v-model="sampleInfomationModalVisible" />
|
||||
<!-- SampleInfo 弹窗结束 -->
|
||||
|
||||
<!-- Qc Results 弹窗开始 -->
|
||||
<qc-results-modal v-model="qcResultsModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<qc-results-modal v-model="qcResultsModalVisible" />
|
||||
<!-- Qc Results 弹窗结束 -->
|
||||
|
||||
<!-- RLR 弹窗开始 -->
|
||||
<rlr-modal v-model="rlrModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<rlr-modal v-model="rlrModalVisible" />
|
||||
<!-- RLR 弹窗结束 -->
|
||||
|
||||
<automatic-analysis-log-modal v-model="autoAnalysisMogModalVisible" :type="autoAnalysisMogModalType" />
|
||||
|
@ -158,7 +156,6 @@
|
|||
<beta-gamma-comments-modal
|
||||
v-model="betaGammaCommentsModalVisible"
|
||||
:isAdd="isBetaGammaCommentsAdd"
|
||||
:sampleId="this.sampleData.sampleId"
|
||||
/>
|
||||
<!-- Beta-Gamma 的Comments 结束 -->
|
||||
|
||||
|
@ -483,6 +480,11 @@ export default {
|
|||
this.$refs.betaGammaAnalysisRef && this.$refs.betaGammaAnalysisRef.resize()
|
||||
},
|
||||
|
||||
// 从分析工具刷新gamma图表
|
||||
handleRefreshGamma(data) {
|
||||
this.$refs.gammaAnalysisRef.refresh(data)
|
||||
},
|
||||
|
||||
// Beta-Gamma Energy Calibration 的重新分析
|
||||
handleReanalyse(...data) {
|
||||
this.$refs.betaGammaAnalysisRef.reanalyse(data)
|
||||
|
|
Loading…
Reference in New Issue
Block a user