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