Merge branch 'master-dev' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
580c4fdfb7
|
@ -16,14 +16,14 @@
|
||||||
@change="handleTableChange"
|
@change="handleTableChange"
|
||||||
:selectedRowKeys.sync="selectedRowKeys"
|
:selectedRowKeys.sync="selectedRowKeys"
|
||||||
:selectionRows.sync="selectionRows"
|
:selectionRows.sync="selectionRows"
|
||||||
:multiple="true"
|
:multiple="loadType == 'db'"
|
||||||
:scroll="{ y: 'calc(100vh - 550px)' }"
|
:scroll="{ y: 'calc(100vh - 550px)' }"
|
||||||
>
|
>
|
||||||
</custom-table>
|
</custom-table>
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<template slot="custom-footer">
|
<template slot="custom-footer">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-radio-group v-model="queryParam.dbName">
|
<a-radio-group v-if="loadType == 'db'" v-model="queryParam.dbName">
|
||||||
<a-radio value="auto">From Auto DB</a-radio>
|
<a-radio value="auto">From Auto DB</a-radio>
|
||||||
<a-radio value="man">From Interactive DB</a-radio>
|
<a-radio value="man">From Interactive DB</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
|
@ -38,6 +38,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||||
import { getAction } from '../../../../api/manage'
|
import { getAction } from '../../../../api/manage'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
|
import SampleDataMixin from '../../SampleDataMixin'
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -112,19 +113,17 @@ const columns = [
|
||||||
]
|
]
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
mixins: [JeecgListMixin, SampleDataMixin],
|
||||||
value: {
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mixins: [JeecgListMixin],
|
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = cloneDeep(columns)
|
||||||
this.disableMixinCreated = true
|
this.disableMixinCreated = true
|
||||||
return {
|
return {
|
||||||
|
visible: false,
|
||||||
|
loadType: 'db',
|
||||||
queryParam: {
|
queryParam: {
|
||||||
menuTypes: 'G,B',
|
menuTypes: 'G,B',
|
||||||
sampleType: '',
|
sampleType: '',
|
||||||
|
stationName: '',
|
||||||
startDate: moment().add(-30, 'd').format('YYYY-MM-DD'),
|
startDate: moment().add(-30, 'd').format('YYYY-MM-DD'),
|
||||||
endDate: moment().format('YYYY-MM-DD'),
|
endDate: moment().format('YYYY-MM-DD'),
|
||||||
dbName: 'auto',
|
dbName: 'auto',
|
||||||
|
@ -136,9 +135,6 @@ export default {
|
||||||
|
|
||||||
stationList: [],
|
stationList: [],
|
||||||
detectorList: [],
|
detectorList: [],
|
||||||
url: {
|
|
||||||
list: '/spectrumAnalysis/getDBSpectrumList',
|
|
||||||
},
|
|
||||||
sampleTypeOption: [
|
sampleTypeOption: [
|
||||||
{
|
{
|
||||||
label: 'P',
|
label: 'P',
|
||||||
|
@ -159,6 +155,12 @@ export default {
|
||||||
this.getStationAndDetectorList()
|
this.getStationAndDetectorList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
searchQuery() {
|
||||||
|
this.loadData(1)
|
||||||
|
this.selectedRowKeys = []
|
||||||
|
this.selectionRows = []
|
||||||
|
},
|
||||||
|
|
||||||
loadData(arg) {
|
loadData(arg) {
|
||||||
const params = this.getQueryParams() //查询条件
|
const params = this.getQueryParams() //查询条件
|
||||||
const { startDate, endDate, menuTypes } = params
|
const { startDate, endDate, menuTypes } = params
|
||||||
|
@ -218,6 +220,33 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 显示弹窗
|
||||||
|
show(loadType) {
|
||||||
|
this.loadType = loadType
|
||||||
|
this.visible = true
|
||||||
|
this.columns = cloneDeep(columns)
|
||||||
|
if (loadType != 'db') {
|
||||||
|
this.columns.splice(10, 1)
|
||||||
|
|
||||||
|
const { inputFileName, sampleType } = this.sampleData
|
||||||
|
|
||||||
|
this.queryParam.menuTypes = 'G'
|
||||||
|
if (!this.queryParam.checkboxGroup.includes('AllUsers')) {
|
||||||
|
this.queryParam.checkboxGroup.push('AllUsers')
|
||||||
|
}
|
||||||
|
this.queryParam.detectorsName = undefined
|
||||||
|
this.queryParam.sampleType = sampleType
|
||||||
|
this.queryParam.dbName = 'auto'
|
||||||
|
this.dataSource = []
|
||||||
|
|
||||||
|
const index = inputFileName.indexOf('_')
|
||||||
|
setTimeout(() => {
|
||||||
|
// 防止AllUsers变化时触发getStationAndDetectorList方法导致stationName置空
|
||||||
|
this.queryParam.stationName = inputFileName.slice(0, index)
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载
|
* 加载
|
||||||
*/
|
*/
|
||||||
|
@ -228,7 +257,10 @@ export default {
|
||||||
}
|
}
|
||||||
this.selectedRowKeys = []
|
this.selectedRowKeys = []
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.$emit('loadSample', cloneDeep(this.selectionRows))
|
this.$emit('loadSample', {
|
||||||
|
sampleList: cloneDeep(this.selectionRows),
|
||||||
|
loadType: this.loadType,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取台站和探测器列表
|
// 获取台站和探测器列表
|
||||||
|
@ -264,13 +296,10 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
visible: {
|
url() {
|
||||||
get() {
|
return {
|
||||||
return this.value
|
list: this.loadType == 'db' ? '/spectrumAnalysis/getDBSpectrumList' : '/gamma/loadSampleData',
|
||||||
},
|
}
|
||||||
set(val) {
|
|
||||||
this.$emit('input', val)
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
formItems() {
|
formItems() {
|
||||||
return [
|
return [
|
||||||
|
@ -294,6 +323,7 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
|
disabled: this.loadType !== 'db',
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: '18%',
|
width: '18%',
|
||||||
|
@ -364,6 +394,7 @@ export default {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
filterOption: this.filterOption,
|
filterOption: this.filterOption,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
|
disabled: this.loadType !== 'db',
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: '19%',
|
width: '19%',
|
||||||
|
@ -390,6 +421,7 @@ export default {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
filterOption: this.filterOption,
|
filterOption: this.filterOption,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
|
disabled: this.loadType !== 'db',
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: '19%',
|
width: '19%',
|
||||||
|
@ -402,6 +434,7 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
options: this.sampleTypeOption,
|
options: this.sampleTypeOption,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
|
disabled: this.loadType !== 'db',
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: '14%',
|
width: '14%',
|
||||||
|
@ -483,7 +516,7 @@ export default {
|
||||||
name: 'checkboxGroup',
|
name: 'checkboxGroup',
|
||||||
props: {
|
props: {
|
||||||
options: [
|
options: [
|
||||||
{ label: 'All User', value: 'AllUsers' },
|
{ label: 'All User', value: 'AllUsers', disabled: true },
|
||||||
{ label: 'Collect Stop', value: 'CollectStopB' },
|
{ label: 'Collect Stop', value: 'CollectStopB' },
|
||||||
{ label: 'Acq.Start', value: 'AcqStartB' },
|
{ label: 'Acq.Start', value: 'AcqStartB' },
|
||||||
],
|
],
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<div v-if="item.children" :key="index">
|
<div v-if="item.children" :key="index">
|
||||||
<a-menu class="multi-level-menu-sub-menu">
|
<a-menu class="multi-level-menu-sub-menu">
|
||||||
<template v-for="child in item.children">
|
<template v-for="child in item.children">
|
||||||
<a-menu-item v-if="child.show !== false" :key="child.key" @click="handleSubMenuClick(item, child)">
|
<a-menu-item v-if="child.show !== false" :key="child.key" v-bind="child.attrs" @click="handleSubMenuClick(item, child)">
|
||||||
{{ child.title }}
|
{{ child.title }}
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1601,6 +1601,89 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 从DB选择的文件之间对比
|
||||||
|
async handleDBFileSelect(sampleId, isStrip, isOperating) {
|
||||||
|
if (this.isLoading) {
|
||||||
|
this.$message.warn('Sample is Loading')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.handleResetChart()
|
||||||
|
this.clearCompareLine()
|
||||||
|
if (isOperating) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const { inputFileName: fileName } = this.sample
|
||||||
|
|
||||||
|
const hide = this.$message.loading(isStrip ? 'Stripping...' : 'Comparing...', 0)
|
||||||
|
try {
|
||||||
|
let param = {
|
||||||
|
fileName,
|
||||||
|
sampleId,
|
||||||
|
},
|
||||||
|
url = '/gamma/CompareDB'
|
||||||
|
// 如果是Strip
|
||||||
|
if (isStrip) {
|
||||||
|
const ratio = await this.$refs.stripModal.getRatio()
|
||||||
|
|
||||||
|
param = {
|
||||||
|
fileName,
|
||||||
|
sampleId,
|
||||||
|
ratioRate: ratio || 1,
|
||||||
|
}
|
||||||
|
url = '/gamma/StripDB'
|
||||||
|
}
|
||||||
|
|
||||||
|
const { success, result, message } = await getAction(url, param)
|
||||||
|
if (success) {
|
||||||
|
if (isStrip) {
|
||||||
|
const { reference: referenceLine, result: compareLine } = result
|
||||||
|
|
||||||
|
this.channelCompareLine = compareLine[0]
|
||||||
|
this.energyCompareLine = compareLine[1]
|
||||||
|
this.redrawLineBySeriesName(
|
||||||
|
'Compare',
|
||||||
|
this.energyCompareLine,
|
||||||
|
this.channelCompareLine,
|
||||||
|
true,
|
||||||
|
this.channelCompareLine.color
|
||||||
|
)
|
||||||
|
|
||||||
|
this.channelStripReferenceLine = referenceLine[0]
|
||||||
|
this.energyStripReferenceLine = referenceLine[1]
|
||||||
|
this.redrawLineBySeriesName(
|
||||||
|
'StripReference',
|
||||||
|
this.energyStripReferenceLine,
|
||||||
|
this.channelStripReferenceLine,
|
||||||
|
true,
|
||||||
|
this.channelStripReferenceLine.color
|
||||||
|
)
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const [channelData, energyData] = result
|
||||||
|
this.channelCompareLine = channelData
|
||||||
|
this.energyCompareLine = energyData
|
||||||
|
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$emit('compareSuccess', isStrip)
|
||||||
|
} else {
|
||||||
|
this.$message.error(message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
hide()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 移除 Compare 线
|
// 移除 Compare 线
|
||||||
clearCompareLine() {
|
clearCompareLine() {
|
||||||
const compareLine = findSeriesByName(this.option.series, 'Compare')
|
const compareLine = findSeriesByName(this.option.series, 'Compare')
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
<!-- 频谱分析部分结束 -->
|
<!-- 频谱分析部分结束 -->
|
||||||
|
|
||||||
<!-- 从数据库加载开始 -->
|
<!-- 从数据库加载开始 -->
|
||||||
<load-from-db-modal v-model="loadFromDbModalVisible" @loadSample="handleLoadSampleFromDB" />
|
<load-from-db-modal ref="loadFromDBModalRef" @loadSample="handleLoadSampleFromDB" />
|
||||||
<!-- 从数据库加载结束 -->
|
<!-- 从数据库加载结束 -->
|
||||||
|
|
||||||
<!-- 从文件加载开始 -->
|
<!-- 从文件加载开始 -->
|
||||||
|
@ -340,7 +340,6 @@ export default {
|
||||||
|
|
||||||
sampleList: [],
|
sampleList: [],
|
||||||
|
|
||||||
loadFromDbModalVisible: false, // 从数据库加载弹窗
|
|
||||||
loadFromFileModalVisible: false, // 从文件加载弹窗
|
loadFromFileModalVisible: false, // 从文件加载弹窗
|
||||||
ftransltModalVisible: false, // Ftransit 弹窗
|
ftransltModalVisible: false, // Ftransit 弹窗
|
||||||
|
|
||||||
|
@ -511,11 +510,27 @@ export default {
|
||||||
* 从数据库加载-选择完成
|
* 从数据库加载-选择完成
|
||||||
* @param {any[]} sampleList
|
* @param {any[]} sampleList
|
||||||
*/
|
*/
|
||||||
handleLoadSampleFromDB(sampleList) {
|
handleLoadSampleFromDB({ sampleList, loadType }) {
|
||||||
|
if (loadType == 'db') {
|
||||||
const ids = this.sampleList.map((item) => item.sampleId) // 当前Sample列表中的所有id
|
const ids = this.sampleList.map((item) => item.sampleId) // 当前Sample列表中的所有id
|
||||||
const willAddList = sampleList.filter((item) => !ids.includes(item.sampleId))
|
const willAddList = sampleList.filter((item) => !ids.includes(item.sampleId))
|
||||||
this.callInitValue(willAddList)
|
this.callInitValue(willAddList)
|
||||||
this.sampleList = this.sampleList.concat(willAddList)
|
this.sampleList = this.sampleList.concat(willAddList)
|
||||||
|
} else if (loadType == 'compare') {
|
||||||
|
const sample = sampleList[0]
|
||||||
|
this.isStriping = false
|
||||||
|
this.$refs.gammaAnalysisRef.handleDBFileSelect(sample.sampleId, false, this.isComparing)
|
||||||
|
if (this.isComparing) {
|
||||||
|
this.isComparing = false
|
||||||
|
}
|
||||||
|
} else if (loadType == 'strip') {
|
||||||
|
const sample = sampleList[0]
|
||||||
|
this.isComparing = false
|
||||||
|
this.$refs.gammaAnalysisRef.handleDBFileSelect(sample.sampleId, true, this.isStriping)
|
||||||
|
if (this.isStriping) {
|
||||||
|
this.isStriping = false
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleLoadSampleFromFile(sampleList) {
|
handleLoadSampleFromFile(sampleList) {
|
||||||
let arr = sampleList.filter((item) => {
|
let arr = sampleList.filter((item) => {
|
||||||
|
@ -991,29 +1006,31 @@ export default {
|
||||||
title: 'SAMPLE',
|
title: 'SAMPLE',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'a-menu',
|
type: 'MultiLevelMenu',
|
||||||
|
attrs: {
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'a-menu-item',
|
|
||||||
title: 'Load From DB',
|
title: 'Load From DB',
|
||||||
handler: () => (this.loadFromDbModalVisible = true),
|
key: 'loadFromDB',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'a-menu-item',
|
|
||||||
title: 'Load From File',
|
title: 'Load From File',
|
||||||
handler: () => (this.loadFromFileModalVisible = true),
|
key: 'loadFromFile',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'a-menu-item',
|
|
||||||
title: 'Compare',
|
title: 'Compare',
|
||||||
|
key: 'compare',
|
||||||
show: this.isGamma,
|
show: this.isGamma,
|
||||||
handler: () => {
|
children: [
|
||||||
this.isStriping = false
|
{
|
||||||
this.$refs.gammaAnalysisRef.showCompareModal(false, this.isComparing)
|
title: 'From File',
|
||||||
if (this.isComparing) {
|
key: 'compareFromFile',
|
||||||
this.isComparing = false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'From DB',
|
||||||
|
key: 'compareFromDB',
|
||||||
|
},
|
||||||
|
],
|
||||||
attrs: {
|
attrs: {
|
||||||
style: {
|
style: {
|
||||||
color: this.isComparing ? 'red' : '#fff',
|
color: this.isComparing ? 'red' : '#fff',
|
||||||
|
@ -1021,16 +1038,19 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'a-menu-item',
|
|
||||||
title: 'Strip',
|
title: 'Strip',
|
||||||
|
key: 'strip',
|
||||||
show: this.isGamma,
|
show: this.isGamma,
|
||||||
handler: () => {
|
children: [
|
||||||
this.isComparing = false
|
{
|
||||||
this.$refs.gammaAnalysisRef.showCompareModal(true, this.isStriping)
|
title: 'From File',
|
||||||
if (this.isStriping) {
|
key: 'stripFromFile',
|
||||||
this.isStriping = false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'From DB',
|
||||||
|
key: 'stripFromDB',
|
||||||
|
},
|
||||||
|
],
|
||||||
attrs: {
|
attrs: {
|
||||||
style: {
|
style: {
|
||||||
color: this.isStriping ? 'red' : '#fff',
|
color: this.isStriping ? 'red' : '#fff',
|
||||||
|
@ -1038,19 +1058,59 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'a-menu-item',
|
|
||||||
title: 'Ftransit',
|
title: 'Ftransit',
|
||||||
handler: () => (this.ftransltModalVisible = true),
|
key: 'fTransit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'a-menu-item',
|
|
||||||
title: 'Clean All',
|
title: 'Clean All',
|
||||||
handler: () => {
|
key: 'cleanAll',
|
||||||
this.handleCleanAll()
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
on: {
|
||||||
|
menuClick: ({ key }) => {
|
||||||
|
switch (key) {
|
||||||
|
case 'loadFromDB':
|
||||||
|
this.$refs.loadFromDBModalRef.show('db')
|
||||||
|
break
|
||||||
|
case 'loadFromFile':
|
||||||
|
this.loadFromFileModalVisible = true
|
||||||
|
break
|
||||||
|
case 'fTransit':
|
||||||
|
this.ftransltModalVisible = true
|
||||||
|
break
|
||||||
|
case 'cleanAll':
|
||||||
|
this.handleCleanAll()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submenuClick: ({ child: { key } }) => {
|
||||||
|
switch (key) {
|
||||||
|
case 'compareFromFile':
|
||||||
|
this.isStriping = false
|
||||||
|
this.$refs.gammaAnalysisRef.showCompareModal(false, this.isComparing)
|
||||||
|
if (this.isComparing) {
|
||||||
|
this.isComparing = false
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case 'compareFromDB':
|
||||||
|
this.$refs.loadFromDBModalRef.show('compare')
|
||||||
|
break
|
||||||
|
case 'stripFromFile':
|
||||||
|
this.isComparing = false
|
||||||
|
this.$refs.gammaAnalysisRef.showCompareModal(true, this.isStriping)
|
||||||
|
if (this.isStriping) {
|
||||||
|
this.isStriping = false
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case 'stripFromDB':
|
||||||
|
this.$refs.loadFromDBModalRef.show('strip')
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'a-divider',
|
type: 'a-divider',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user