SampleType 下拉框选择之后过滤Sample下拉框数据

This commit is contained in:
任珮宇 2023-10-25 15:47:28 +08:00
parent 46c4dcd927
commit 9e29991152

View File

@ -43,68 +43,68 @@ const columns = [
{
title: 'SampleID',
align: 'left',
dataIndex: 'sampleId'
dataIndex: 'sampleId',
},
{
title: 'Station',
align: 'left',
dataIndex: 'stationName'
dataIndex: 'stationName',
},
{
title: 'Detector',
align: 'left',
dataIndex: 'detectorsName',
width: 130
width: 130,
},
{
title: 'Sample',
align: 'left',
dataIndex: 'sampleType'
dataIndex: 'sampleType',
},
{
title: 'DataType',
align: 'left',
dataIndex: 'dataType'
dataIndex: 'dataType',
},
{
title: 'Qualifier',
align: 'left',
dataIndex: 'spectralQualifie'
dataIndex: 'spectralQualifie',
},
{
title: 'Col.Stop',
align: 'left',
dataIndex: 'collectStop',
width: 170
width: 170,
},
{
title: 'Acq.Start',
align: 'left',
dataIndex: 'acquisitionStart',
width: 170
width: 170,
},
{
title: 'Acq.real',
align: 'left',
dataIndex: 'acquisitionRealSec'
dataIndex: 'acquisitionRealSec',
},
{
title: 'Acq.live',
align: 'left',
dataIndex: 'acquisitionLiveSec'
dataIndex: 'acquisitionLiveSec',
},
{
title: 'Status',
align: 'left',
dataIndex: 'status'
}
dataIndex: 'status',
},
]
export default {
props: {
value: {
type: Boolean
}
type: Boolean,
},
},
mixins: [JeecgListMixin],
data() {
@ -113,12 +113,10 @@ export default {
return {
queryParam: {
menuTypes: 'G,B',
startDate: moment()
.add(-7, 'd')
.format('YYYY-MM-DD'),
startDate: moment().add(-7, 'd').format('YYYY-MM-DD'),
endDate: moment().format('YYYY-MM-DD'),
dbName: 'auto',
spectralQualifie: 'FULL'
spectralQualifie: 'FULL',
},
selectedRowKeys: [],
selectionRows: [],
@ -126,8 +124,22 @@ export default {
stationList: [],
detectorList: [],
url: {
list: '/spectrumAnalysis/getDBSpectrumList'
}
list: '/spectrumAnalysis/getDBSpectrumList',
},
sampleTypeOption: [
{
label: 'P',
value: 'P',
},
{
label: 'B',
value: 'B',
},
{
label: 'G',
value: 'G',
},
],
}
},
created() {
@ -166,10 +178,10 @@ export default {
this.loading = true
getAction(this.url.list, params)
.then(res => {
.then((res) => {
if (res.success) {
const result = res.result.records || res.result
result.forEach(item => {
result.forEach((item) => {
const fileName = item.inputFileName
if (fileName) {
const arr = fileName.split('/')
@ -215,11 +227,11 @@ export default {
const { success, result, message } = await getAction('/spectrumAnalysis/getDBSearchList', {
menuTypes: value,
dbName: this.queryParam.dbName,
AllUsers: this.allUsersValue
AllUsers: this.allUsersValue,
})
if (success) {
this.stationList = result.stationCode.map(item => ({ label: item, value: item }))
this.detectorList = result.detectorCode.map(item => ({ label: item, value: item }))
this.stationList = result.stationCode.map((item) => ({ label: item, value: item }))
this.detectorList = result.detectorCode.map((item) => ({ label: item, value: item }))
} else {
this.$message.error(message)
}
@ -235,7 +247,7 @@ export default {
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
},
},
computed: {
visible: {
@ -244,7 +256,7 @@ export default {
},
set(val) {
this.$emit('input', val)
}
},
},
formItems() {
return [
@ -256,32 +268,64 @@ export default {
options: [
{
label: 'All',
value: 'G,B'
value: 'G,B',
},
{
label: 'Gamma',
value: 'G'
value: 'G',
},
{
label: 'Beta',
value: 'B'
}
value: 'B',
},
],
allowClear: true
allowClear: true,
},
style: {
width: '18%'
width: '18%',
},
on: {
change: event => {
change: (event) => {
console.log('event', event)
if (!event) {
this.stationList = []
this.detectorList = []
return
}
let arr_B = [
{
label: 'B',
value: 'B',
},
]
let arr_G = [
{
label: 'P',
value: 'P',
},
{
label: 'G',
value: 'G',
},
]
let arr_A = [
{
label: 'P',
value: 'P',
},
{
label: 'B',
value: 'B',
},
{
label: 'G',
value: 'G',
},
]
this.sampleTypeOption = event == 'B' ? arr_B : event == 'G' ? arr_G : arr_A
this.getStationAndDetectorList(event)
}
}
},
},
},
{
label: 'Station',
@ -291,11 +335,11 @@ export default {
options: this.stationList,
showSearch: true,
filterOption: this.filterOption,
allowClear: true
allowClear: true,
},
style: {
width: '19%'
}
width: '19%',
},
},
{
label: 'Detector',
@ -305,36 +349,23 @@ export default {
options: this.detectorList,
showSearch: true,
filterOption: this.filterOption,
allowClear: true
allowClear: true,
},
style: {
width: '19%'
}
width: '19%',
},
},
{
label: 'Sample',
type: 'custom-select',
name: 'sampleType',
props: {
options: [
{
label: 'P',
value: 'P'
},
{
label: 'B',
value: 'B'
},
{
label: 'G',
value: 'G'
}
],
allowClear: true
options: this.sampleTypeOption,
allowClear: true,
},
style: {
width: '14%'
}
width: '14%',
},
},
{
label: 'DataType',
@ -344,34 +375,34 @@ export default {
options: [
{
label: 'S',
value: 'S'
value: 'S',
},
{
label: 'G',
value: 'G'
value: 'G',
},
{
label: 'D',
value: 'D'
value: 'D',
},
{
label: 'Q',
value: 'Q'
value: 'Q',
},
{
label: 'B',
value: 'B'
value: 'B',
},
{
label: 'C',
value: 'C'
}
value: 'C',
},
],
allowClear: true
allowClear: true,
},
style: {
width: '14%'
}
width: '14%',
},
},
{
label: 'Qualifier',
@ -381,30 +412,30 @@ export default {
options: [
{
label: 'FULL',
value: 'FULL'
value: 'FULL',
},
{
label: 'PREL',
value: 'PREL'
}
value: 'PREL',
},
],
allowClear: true
allowClear: true,
},
style: {
width: '16%',
paddingRight: 0
}
paddingRight: 0,
},
},
{
label: 'SampleID',
type: 'a-input',
name: 'sampleId',
props: {
allowClear: true
allowClear: true,
},
style: {
width: '264px'
}
width: '264px',
},
},
{
label: '',
@ -414,13 +445,13 @@ export default {
options: [
{ label: 'All User', value: 'AllUsers' },
{ label: 'Collect Stop', value: 'CollectStopB' },
{ label: 'Acq.Start', value: 'AcqStartB' }
]
{ label: 'Acq.Start', value: 'AcqStartB' },
],
},
style: {
width: '305px',
paddingRight: 0
}
paddingRight: 0,
},
},
{
label: 'From',
@ -430,12 +461,12 @@ export default {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
style: {
minWidth: 'auto'
}
minWidth: 'auto',
},
},
style: {
width: '19%'
}
width: '19%',
},
},
{
label: 'To',
@ -445,15 +476,15 @@ export default {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
style: {
minWidth: 'auto'
}
minWidth: 'auto',
},
},
style: {
paddingRight: 0,
marginRight: '22px',
width: '19%'
}
}
width: '19%',
},
},
]
},
@ -470,7 +501,7 @@ export default {
acqStartValue() {
const checkboxGroup = this.queryParam.checkboxGroup
return !!(checkboxGroup && checkboxGroup.includes('AcqStartB'))
}
},
},
watch: {
// All User station detector
@ -480,8 +511,8 @@ export default {
this.detectorList = []
this.getStationAndDetectorList(this.queryParam.menuTypes)
}
}
}
},
},
}
</script>