WIP: load from db 接口对接
This commit is contained in:
parent
0482aebb12
commit
f5715a0ad9
|
@ -91,30 +91,32 @@ export default {
|
||||||
mixins: [JeecgListMixin],
|
mixins: [JeecgListMixin],
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
|
this.disableMixinCreated = true
|
||||||
return {
|
return {
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
stationList: [],
|
stationList: [],
|
||||||
detectorList: [],
|
detectorList: [],
|
||||||
url: {
|
url: {
|
||||||
list: '/gardsSampleData/findPage'
|
list: '/spectrumAnalysis/getDBSpectrumList'
|
||||||
},
|
},
|
||||||
|
|
||||||
isLoadingSample: false // 正在加载样例
|
isLoadingSample: false // 正在加载样例
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.getStationList()
|
|
||||||
this.getDetectorList()
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
loadData(arg) {
|
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则加载第一页的内容
|
//加载数据 若传入参数1则加载第一页的内容
|
||||||
if (arg === 1) {
|
if (arg === 1) {
|
||||||
this.ipagination.current = 1
|
this.ipagination.current = 1
|
||||||
}
|
}
|
||||||
this.onClearSelected()
|
|
||||||
|
|
||||||
const params = this.getQueryParams() //查询条件
|
|
||||||
if (params.checkboxGroup) {
|
if (params.checkboxGroup) {
|
||||||
params.checkboxGroup.forEach(item => {
|
params.checkboxGroup.forEach(item => {
|
||||||
params[item] = true
|
params[item] = true
|
||||||
|
@ -122,6 +124,8 @@ export default {
|
||||||
delete params.checkboxGroup
|
delete params.checkboxGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.onClearSelected()
|
||||||
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getAction(this.url.list, params)
|
getAction(this.url.list, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
@ -156,11 +160,16 @@ export default {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
},
|
},
|
||||||
|
|
||||||
async getStationList() {
|
async getStationAndDetectorList() {
|
||||||
|
const params = this.getQueryParams() //查询条件
|
||||||
|
if (!params.menuTypes || !params.menuTypes.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
params.menuTypes = params.menuTypes.join(',')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { success, result, message } = await getAction('/gardsStations/findPage', {
|
const { success, result, message } = await getAction('/spectrumAnalysis/getDBSearchList', {
|
||||||
pageIndex: 1,
|
menuTypes: []
|
||||||
pageSize: 10000
|
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.stationList = result.records.map(record => ({ label: record.stationCode, value: record.stationId }))
|
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) {
|
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
|
||||||
}
|
}
|
||||||
|
@ -204,14 +197,29 @@ export default {
|
||||||
formItems() {
|
formItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: 'SampleID',
|
label: 'MenuType',
|
||||||
type: 'a-input',
|
type: 'custom-select',
|
||||||
name: 'sampleId',
|
name: 'menuTypes',
|
||||||
props: {
|
props: {
|
||||||
allowClear: true
|
mode: 'multiple',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'Gamma',
|
||||||
|
value: 'G'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Beta',
|
||||||
|
value: 'B'
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: '20%'
|
width: '16.6%'
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
change: () => {
|
||||||
|
this.getStationAndDetectorList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -231,7 +239,7 @@ export default {
|
||||||
allowClear: true
|
allowClear: true
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: '18%'
|
width: '16.6%'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -251,13 +259,122 @@ export default {
|
||||||
allowClear: true
|
allowClear: true
|
||||||
},
|
},
|
||||||
style: {
|
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',
|
label: 'From',
|
||||||
type: 'custom-date-picker',
|
type: 'custom-date-picker',
|
||||||
name: 'collectStart',
|
name: 'startDate',
|
||||||
props: {
|
props: {
|
||||||
showTime: { format: 'HH:mm' },
|
showTime: { format: 'HH:mm' },
|
||||||
format: 'YYYY-MM-DD HH:mm',
|
format: 'YYYY-MM-DD HH:mm',
|
||||||
|
@ -267,13 +384,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: '22%'
|
width: '20%'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'To',
|
label: 'To',
|
||||||
type: 'custom-date-picker',
|
type: 'custom-date-picker',
|
||||||
name: 'collectStop',
|
name: 'endDate',
|
||||||
props: {
|
props: {
|
||||||
showTime: { format: 'HH:mm' },
|
showTime: { format: 'HH:mm' },
|
||||||
format: 'YYYY-MM-DD HH:mm',
|
format: 'YYYY-MM-DD HH:mm',
|
||||||
|
@ -284,21 +401,8 @@ export default {
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
paddingRight: 0,
|
paddingRight: 0,
|
||||||
width: '22%'
|
marginRight: '16px',
|
||||||
}
|
width: '20%'
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
type: 'a-checkbox-group',
|
|
||||||
name: 'checkboxGroup',
|
|
||||||
props: {
|
|
||||||
options: [
|
|
||||||
{ label: 'Collect Stop', value: 'collectStop' },
|
|
||||||
{ label: 'Acq.Start', value: 'acqDotStart' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
width: '230px'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user