feat: 完成Compare From DB和Strip From DB功能

This commit is contained in:
Xu Zhimeng 2023-12-12 10:27:42 +08:00
parent dca4b320d8
commit a538ae66b0
4 changed files with 38 additions and 30 deletions

View File

@ -8,7 +8,7 @@
</search-form> </search-form>
<custom-table <custom-table
size="middle" size="middle"
rowKey="analysitId" :rowKey="this.loadType == 'db' ? 'analysitId' : 'sampleId'"
:columns="columns" :columns="columns"
:list="dataSource" :list="dataSource"
:pagination="ipagination" :pagination="ipagination"
@ -225,6 +225,10 @@ export default {
this.loadType = loadType this.loadType = loadType
this.visible = true this.visible = true
this.columns = cloneDeep(columns) this.columns = cloneDeep(columns)
if (loadType !== this.loadType) {
this.dataSource = []
}
if (loadType != 'db') { if (loadType != 'db') {
this.columns.splice(10, 1) this.columns.splice(10, 1)
@ -232,13 +236,13 @@ export default {
this.queryParam.menuTypes = 'G' this.queryParam.menuTypes = 'G'
if (!this.queryParam.checkboxGroup.includes('AllUsers')) { if (!this.queryParam.checkboxGroup.includes('AllUsers')) {
// All Users
this.queryParam.checkboxGroup.push('AllUsers') this.queryParam.checkboxGroup.push('AllUsers')
} }
this.queryParam.detectorsName = undefined this.queryParam.detectorsName = undefined
this.queryParam.sampleType = sampleType this.queryParam.sampleType = sampleType
this.queryParam.dbName = 'auto' this.queryParam.dbName = 'auto'
this.dataSource = []
const index = inputFileName.indexOf('_') const index = inputFileName.indexOf('_')
setTimeout(() => { setTimeout(() => {
// AllUsersgetStationAndDetectorListstationName // AllUsersgetStationAndDetectorListstationName
@ -250,7 +254,7 @@ export default {
/** /**
* 加载 * 加载
*/ */
async handleLoad() { handleLoad() {
if (!this.selectedRowKeys.length) { if (!this.selectedRowKeys.length) {
this.$message.warn('Please Select Sample To Load') this.$message.warn('Please Select Sample To Load')
return return
@ -516,7 +520,7 @@ export default {
name: 'checkboxGroup', name: 'checkboxGroup',
props: { props: {
options: [ options: [
{ label: 'All User', value: 'AllUsers', disabled: true }, { label: 'All User', value: 'AllUsers', disabled: this.loadType !== 'db' },
{ label: 'Collect Stop', value: 'CollectStopB' }, { label: 'Collect Stop', value: 'CollectStopB' },
{ label: 'Acq.Start', value: 'AcqStartB' }, { label: 'Acq.Start', value: 'AcqStartB' },
], ],

View File

@ -6,7 +6,12 @@
<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" v-bind="child.attrs" @click="handleSubMenuClick(item, child)"> <a-menu-item
v-if="child.show !== false"
:key="child.key"
v-bind="child.attrs"
@click="handleSubMenuClick($event, item, child)"
>
{{ child.title }} {{ child.title }}
</a-menu-item> </a-menu-item>
</template> </template>
@ -35,7 +40,8 @@ export default {
this.$emit('menuClick', item) this.$emit('menuClick', item)
// } // }
}, },
handleSubMenuClick(item, child) { handleSubMenuClick(event, item, child) {
event.domEvent.stopPropagation()
this.$emit('submenuClick', { item, child }) this.$emit('submenuClick', { item, child })
}, },
}, },

View File

@ -1478,16 +1478,13 @@ export default {
}, },
// //
showCompareModal(isStrip, isOperating) { showCompareModal(isStrip) {
if (this.isLoading) { if (this.isLoading) {
this.$message.warn('Sample is Loading') this.$message.warn('Sample is Loading')
return return
} }
this.handleResetChart() this.handleResetChart()
this.clearCompareLine() this.clearCompareLine()
if (isOperating) {
return
}
this.isStrip = isStrip this.isStrip = isStrip
if (FilePicker.canUse()) { if (FilePicker.canUse()) {

View File

@ -516,19 +516,14 @@ export default {
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') { } else {
const sample = sampleList[0] const sample = sampleList[0]
this.isStriping = false if (loadType == 'compare') {
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 this.isStriping = false
this.$refs.gammaAnalysisRef.handleDBFileSelect(sample.sampleId, false)
} else if (loadType == 'strip') {
this.isComparing = false
this.$refs.gammaAnalysisRef.handleDBFileSelect(sample.sampleId, true)
} }
} }
}, },
@ -1077,6 +1072,18 @@ export default {
case 'loadFromFile': case 'loadFromFile':
this.loadFromFileModalVisible = true this.loadFromFileModalVisible = true
break break
case 'compare':
if(this.isComparing) {
this.$refs.gammaAnalysisRef.clearCompareLine()
this.isComparing = false
}
break
case 'strip':
if(this.isStriping) {
this.$refs.gammaAnalysisRef.clearCompareLine()
this.isStriping = false
}
break
case 'fTransit': case 'fTransit':
this.ftransltModalVisible = true this.ftransltModalVisible = true
break break
@ -1089,20 +1096,14 @@ export default {
switch (key) { switch (key) {
case 'compareFromFile': case 'compareFromFile':
this.isStriping = false this.isStriping = false
this.$refs.gammaAnalysisRef.showCompareModal(false, this.isComparing) this.$refs.gammaAnalysisRef.showCompareModal(false)
if (this.isComparing) {
this.isComparing = false
}
break break
case 'compareFromDB': case 'compareFromDB':
this.$refs.loadFromDBModalRef.show('compare') this.$refs.loadFromDBModalRef.show('compare')
break break
case 'stripFromFile': case 'stripFromFile':
this.isComparing = false this.isComparing = false
this.$refs.gammaAnalysisRef.showCompareModal(true, this.isStriping) this.$refs.gammaAnalysisRef.showCompareModal(true)
if (this.isStriping) {
this.isStriping = false
}
break break
case 'stripFromDB': case 'stripFromDB':
this.$refs.loadFromDBModalRef.show('strip') this.$refs.loadFromDBModalRef.show('strip')