diff --git a/src/views/spectrumAnalysis/components/Modals/CompareFromDBModal.vue b/src/views/spectrumAnalysis/components/Modals/CompareFromDBModal.vue
new file mode 100644
index 0000000..e42f966
--- /dev/null
+++ b/src/views/spectrumAnalysis/components/Modals/CompareFromDBModal.vue
@@ -0,0 +1,610 @@
+
+
+
+
+ Reset
+ Search
+
+
+
+
+
+
+
+ Load
+
+
+
+
+
+
+
+
diff --git a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
index 457c723..fcd58b1 100644
--- a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
+++ b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue
@@ -8,7 +8,7 @@
-
+
From Auto DB
From Interactive DB
@@ -38,7 +38,6 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '../../../../api/manage'
import moment from 'moment'
import { cloneDeep } from 'lodash'
-import SampleDataMixin from '../../SampleDataMixin'
const columns = [
{
@@ -113,17 +112,20 @@ const columns = [
]
export default {
- mixins: [JeecgListMixin, SampleDataMixin],
+ props: {
+ value: {
+ type: Boolean,
+ },
+ },
+ mixins: [JeecgListMixin],
data() {
- this.columns = cloneDeep(columns)
+ this.columns = columns
this.disableMixinCreated = true
return {
visible: false,
- loadType: 'db',
queryParam: {
menuTypes: 'G,B',
sampleType: '',
- stationName: '',
startDate: moment().add(-30, 'd').format('YYYY-MM-DD'),
endDate: moment().format('YYYY-MM-DD'),
dbName: 'auto',
@@ -135,6 +137,9 @@ export default {
stationList: [],
detectorList: [],
+ url: {
+ list: '/spectrumAnalysis/getDBSpectrumList',
+ },
sampleTypeOption: [
{
label: 'P',
@@ -155,12 +160,6 @@ export default {
this.getStationAndDetectorList()
},
methods: {
- searchQuery() {
- this.loadData(1)
- this.selectedRowKeys = []
- this.selectionRows = []
- },
-
loadData(arg) {
const params = this.getQueryParams() //查询条件
const { startDate, endDate, menuTypes } = params
@@ -220,53 +219,21 @@ export default {
})
},
- // 显示弹窗
- show(loadType) {
- if (loadType !== this.loadType) {
- this.dataSource = []
- this.ipagination.total = 0
- }
-
- this.loadType = loadType
+ show() {
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')) {
- // 选中All Users
- this.queryParam.checkboxGroup.push('AllUsers')
- }
-
- this.queryParam.detectorsName = undefined
- this.queryParam.sampleType = sampleType
- this.queryParam.dbName = 'auto'
- const index = inputFileName.indexOf('_')
- setTimeout(() => {
- // 防止AllUsers变化时触发getStationAndDetectorList方法导致stationName置空
- this.queryParam.stationName = inputFileName.slice(0, index)
- }, 100)
- }
},
/**
* 加载
*/
- handleLoad() {
+ async handleLoad() {
if (!this.selectedRowKeys.length) {
this.$message.warn('Please Select Sample To Load')
return
}
this.selectedRowKeys = []
this.visible = false
- this.$emit('loadSample', {
- sampleList: cloneDeep(this.selectionRows),
- loadType: this.loadType,
- })
+ this.$emit('loadSample', cloneDeep(this.selectionRows))
},
// 获取台站和探测器列表
@@ -302,11 +269,6 @@ export default {
},
},
computed: {
- url() {
- return {
- list: this.loadType == 'db' ? '/spectrumAnalysis/getDBSpectrumList' : '/gamma/loadSampleData',
- }
- },
formItems() {
return [
{
@@ -329,7 +291,6 @@ export default {
},
],
allowClear: true,
- disabled: this.loadType !== 'db',
},
style: {
width: '18%',
@@ -400,7 +361,6 @@ export default {
showSearch: true,
filterOption: this.filterOption,
allowClear: true,
- disabled: this.loadType !== 'db',
},
style: {
width: '19%',
@@ -427,7 +387,6 @@ export default {
showSearch: true,
filterOption: this.filterOption,
allowClear: true,
- disabled: this.loadType !== 'db',
},
style: {
width: '19%',
@@ -440,7 +399,6 @@ export default {
props: {
options: this.sampleTypeOption,
allowClear: true,
- disabled: this.loadType !== 'db',
},
style: {
width: '14%',
@@ -522,7 +480,7 @@ export default {
name: 'checkboxGroup',
props: {
options: [
- { label: 'All User', value: 'AllUsers', disabled: this.loadType !== 'db' },
+ { label: 'All User', value: 'AllUsers' },
{ label: 'Collect Stop', value: 'CollectStopB' },
{ label: 'Acq.Start', value: 'AcqStartB' },
],
diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue
index 96cfea0..441d873 100644
--- a/src/views/spectrumAnalysis/index.vue
+++ b/src/views/spectrumAnalysis/index.vue
@@ -74,6 +74,10 @@
+
+
+
+
@@ -272,6 +276,7 @@ import { fetchAndDownload } from '@/utils/file'
import BGLogViewer from './components/Modals/BetaGammaModals/BGLogViewer.vue'
import { saveAs } from 'file-saver'
+import CompareFromDbModal from './components/Modals/CompareFromDBModal.vue'
// 分析类型
const ANALYZE_TYPE = {
@@ -319,6 +324,7 @@ export default {
AutomaticAnalysisLogModal,
BetaGammaExtrapolationModal,
BgLogViewer: BGLogViewer,
+ CompareFromDbModal,
},
provide() {
@@ -510,21 +516,24 @@ export default {
* 从数据库加载-选择完成
* @param {any[]} sampleList
*/
- handleLoadSampleFromDB({ sampleList, loadType }) {
- if (loadType == 'db') {
- const ids = this.sampleList.map((item) => item.sampleId) // 当前Sample列表中的所有id
- const willAddList = sampleList.filter((item) => !ids.includes(item.sampleId))
- this.callInitValue(willAddList)
- this.sampleList = this.sampleList.concat(willAddList)
- } else {
- const sample = sampleList[0]
- if (loadType == 'compare') {
- this.isStriping = false
- this.$refs.gammaAnalysisRef.handleDBFileSelect(sample.sampleId, false)
- } else if (loadType == 'strip') {
- this.isComparing = false
- this.$refs.gammaAnalysisRef.handleDBFileSelect(sample.sampleId, true)
- }
+ handleLoadSampleFromDB(sampleList) {
+ const ids = this.sampleList.map((item) => item.sampleId) // 当前Sample列表中的所有id
+ const willAddList = sampleList.filter((item) => !ids.includes(item.sampleId))
+ this.callInitValue(willAddList)
+ this.sampleList = this.sampleList.concat(willAddList)
+ },
+ /**
+ * 从数据库比较-选择完成
+ * @param {any[]} sampleList
+ */
+ handleCompareSampleFromDB({ sampleList, loadType }) {
+ const sample = sampleList[0]
+ if (loadType == 'compare') {
+ this.isStriping = false
+ this.$refs.gammaAnalysisRef.handleDBFileSelect(sample.sampleId, false)
+ } else if (loadType == 'strip') {
+ this.isComparing = false
+ this.$refs.gammaAnalysisRef.handleDBFileSelect(sample.sampleId, true)
}
},
handleLoadSampleFromFile(sampleList) {
@@ -607,6 +616,7 @@ export default {
this.sampleList = []
this.analysisType = undefined
this.sampleData = {}
+ this.resetCompareStripState()
},
// 保存结果到文件, 服务端生成文件,前端下载
@@ -992,6 +1002,15 @@ export default {
this.isComparing = true
}
},
+
+ // 重置compare和strip的状态
+ resetCompareStripState() {
+ this.isComparing = false
+ this.isStriping = false
+ if (this.$refs.gammaAnalysisRef) {
+ this.$refs.gammaAnalysisRef.clearCompareLine()
+ }
+ },
},
computed: {
// 顶部菜单栏配置
@@ -1067,19 +1086,19 @@ export default {
menuClick: ({ key }) => {
switch (key) {
case 'loadFromDB':
- this.$refs.loadFromDBModalRef.show('db')
+ this.$refs.loadFromDBModalRef.show()
break
case 'loadFromFile':
this.loadFromFileModalVisible = true
break
case 'compare':
- if(this.isComparing) {
+ if (this.isComparing) {
this.$refs.gammaAnalysisRef.clearCompareLine()
this.isComparing = false
}
break
case 'strip':
- if(this.isStriping) {
+ if (this.isStriping) {
this.$refs.gammaAnalysisRef.clearCompareLine()
this.isStriping = false
}
@@ -1099,14 +1118,14 @@ export default {
this.$refs.gammaAnalysisRef.showCompareModal(false)
break
case 'compareFromDB':
- this.$refs.loadFromDBModalRef.show('compare')
+ this.$refs.compareFromDBModalRef.show('compare')
break
case 'stripFromFile':
this.isComparing = false
this.$refs.gammaAnalysisRef.showCompareModal(true)
break
case 'stripFromDB':
- this.$refs.loadFromDBModalRef.show('strip')
+ this.$refs.compareFromDBModalRef.show('strip')
break
}
},
@@ -1130,6 +1149,7 @@ export default {
on: {
change: (spectra) => {
if (spectra) {
+ this.resetCompareStripState()
this.loadSelectedSample(spectra)
} else {
this.analysisType = undefined