From 9e299911528f4a88677f7f0b056c7504e49059a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Wed, 25 Oct 2023 15:47:28 +0800 Subject: [PATCH] =?UTF-8?q?SampleType=20=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=B9=8B=E5=90=8E=E8=BF=87=E6=BB=A4Sample?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Modals/LoadFromDBModal.vue | 221 ++++++++++-------- 1 file changed, 126 insertions(+), 95 deletions(-) diff --git a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue index c3c0723..b126a86 100644 --- a/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/LoadFromDBModal.vue @@ -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,12 +178,12 @@ 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) { + if (fileName) { const arr = fileName.split('/') item.inputFileName = arr[arr.length - 1] } @@ -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) } - } - } + }, + }, }