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