WIP: load from db 接口对接

This commit is contained in:
Xu Zhimeng 2023-07-06 19:41:06 +08:00
parent 0482aebb12
commit f5715a0ad9

View File

@ -91,30 +91,32 @@ export default {
mixins: [JeecgListMixin],
data() {
this.columns = columns
this.disableMixinCreated = true
return {
selectedRowKeys: [],
stationList: [],
detectorList: [],
url: {
list: '/gardsSampleData/findPage'
list: '/spectrumAnalysis/getDBSpectrumList'
},
isLoadingSample: false //
}
},
created() {
this.getStationList()
this.getDetectorList()
},
methods: {
loadData(arg) {
const params = this.getQueryParams() //
if (!params.menuTypes || !params.menuTypes.length) {
this.$message.warn('Please Select MenuTypes First')
return
}
params.menuTypes = params.menuTypes.join(',')
// 1
if (arg === 1) {
this.ipagination.current = 1
}
this.onClearSelected()
const params = this.getQueryParams() //
if (params.checkboxGroup) {
params.checkboxGroup.forEach(item => {
params[item] = true
@ -122,6 +124,8 @@ export default {
delete params.checkboxGroup
}
this.onClearSelected()
this.loading = true
getAction(this.url.list, params)
.then(res => {
@ -156,11 +160,16 @@ export default {
this.visible = false
},
async getStationList() {
async getStationAndDetectorList() {
const params = this.getQueryParams() //
if (!params.menuTypes || !params.menuTypes.length) {
return
}
params.menuTypes = params.menuTypes.join(',')
try {
const { success, result, message } = await getAction('/gardsStations/findPage', {
pageIndex: 1,
pageSize: 10000
const { success, result, message } = await getAction('/spectrumAnalysis/getDBSearchList', {
menuTypes: []
})
if (success) {
this.stationList = result.records.map(record => ({ label: record.stationCode, value: record.stationId }))
@ -172,22 +181,6 @@ export default {
}
},
async getDetectorList() {
try {
const { success, result, message } = await getAction('/gardsDetectors/findPage', {
pageIndex: 1,
pageSize: 10000
})
if (success) {
this.detectorList = result.records.map(record => ({ label: record.detectorCode, value: record.detectorId }))
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
},
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
@ -204,14 +197,29 @@ export default {
formItems() {
return [
{
label: 'SampleID',
type: 'a-input',
name: 'sampleId',
label: 'MenuType',
type: 'custom-select',
name: 'menuTypes',
props: {
allowClear: true
mode: 'multiple',
options: [
{
label: 'Gamma',
value: 'G'
},
{
label: 'Beta',
value: 'B'
}
]
},
style: {
width: '20%'
width: '16.6%'
},
on: {
change: () => {
this.getStationAndDetectorList()
}
}
},
{
@ -231,7 +239,7 @@ export default {
allowClear: true
},
style: {
width: '18%'
width: '16.6%'
}
},
{
@ -251,13 +259,122 @@ export default {
allowClear: true
},
style: {
width: '18%'
width: '16.6%'
}
},
{
label: 'Sample',
type: 'custom-select',
name: 'sample',
props: {
options: [
{
label: 'P',
value: 'P'
},
{
label: 'B',
value: 'B'
},
{
label: 'G',
value: 'G'
}
],
allowClear: true
},
style: {
width: '16.6%'
}
},
{
label: 'DataType',
type: 'custom-select',
name: 'dataType',
props: {
options: [
{
label: 'S',
value: 'S'
},
{
label: 'G',
value: 'G'
},
{
label: 'D',
value: 'D'
},
{
label: 'Q',
value: 'Q'
},
{
label: 'B',
value: 'B'
},
{
label: 'C',
value: 'C'
}
],
allowClear: true
},
style: {
width: '16.6%'
}
},
{
label: 'Qualifier',
type: 'custom-select',
name: 'dataType',
props: {
options: [
{
label: 'FULL',
value: 'FULL'
},
{
label: 'PREL',
value: 'PREL'
}
],
allowClear: true
},
style: {
width: '16.6%'
}
},
{
label: 'SampleID',
type: 'a-input',
name: 'sampleId',
props: {
allowClear: true
},
style: {
width: '20%'
}
},
{
label: '',
type: 'a-checkbox-group',
name: 'checkboxGroup',
props: {
options: [
{ label: 'All User', value: 'allUser' },
{ label: 'Collect Stop', value: 'collectStop' },
{ label: 'Acq.Start', value: 'acqDotStart' }
]
},
style: {
width: '315px'
}
},
{
label: 'From',
type: 'custom-date-picker',
name: 'collectStart',
name: 'startDate',
props: {
showTime: { format: 'HH:mm' },
format: 'YYYY-MM-DD HH:mm',
@ -267,13 +384,13 @@ export default {
}
},
style: {
width: '22%'
width: '20%'
}
},
{
label: 'To',
type: 'custom-date-picker',
name: 'collectStop',
name: 'endDate',
props: {
showTime: { format: 'HH:mm' },
format: 'YYYY-MM-DD HH:mm',
@ -284,21 +401,8 @@ export default {
},
style: {
paddingRight: 0,
width: '22%'
}
},
{
label: '',
type: 'a-checkbox-group',
name: 'checkboxGroup',
props: {
options: [
{ label: 'Collect Stop', value: 'collectStop' },
{ label: 'Acq.Start', value: 'acqDotStart' }
]
},
style: {
width: '230px'
marginRight: '16px',
width: '20%'
}
}
]