fix:初始化查询条件,初始化stations下拉多选

This commit is contained in:
orgin 2023-06-12 14:29:57 +08:00
parent 109efad6f3
commit e69e2ad877

View File

@ -52,50 +52,82 @@ const columns = [
{ {
title: 'STATION', title: 'STATION',
align: 'left', align: 'left',
dataIndex: 'siteDetCode', dataIndex: 'stationName',
width: 130, width: 130,
}, },
{ {
title: 'DETECTOR CODE', title: 'DETECTOR CODE',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'sampleId', dataIndex: 'siteDetCode',
}, },
{ {
title: 'SPECTRAL QUALIFIER', title: 'SPECTRAL QUALIFIER',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'stationName', dataIndex: 'spectralQualifie',
}, },
{ {
title: 'ACQUISITION START TIME', title: 'ACQUISITION START TIME',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'detectorsName', dataIndex: 'acquisitionStart',
}, },
{ {
title: 'ACQUISITION STOP TIME', title: 'ACQUISITION STOP TIME',
align: 'left', align: 'left',
width: 120, width: 120,
dataIndex: 'sampleType', dataIndex: 'acquisitionStop',
}, },
] ]
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '../../api/manage'
import dateFormat from '../../components/jeecg/JEasyCron/format-date'
export default { export default {
name: 'menuTree', name: 'menuTree',
mixins: [JeecgListMixin], mixins: [JeecgListMixin],
data() { data() {
return { return {
columns, columns,
url: { queryParam: {
list: '/gardsSampleData/findPage', dataType: 'B',
delete: '/gardsSampleData/deleteById', startTime: dateFormat(new Date(), 'yyyy-MM-dd'),
endTime: dateFormat(new Date(), 'yyyy-MM-dd'),
}, },
url: {
list: '/webStatistics/findParticulatePage',
delete: '/gardsSampleData/deleteById',
findStationList: '/webStatistics/findStationList',
findParticulatePage: '/jeecg-web-statistics/webStatistics/findParticulatePage',
},
stationList: [],
} }
}, },
created() {}, mounted() {
this.queryParam.dataType = this.$route.meta.title
},
created() {
this.findStationList()
},
watch: {
'$route.meta.title'(val) {
if(val === 'SPHDF'){
this.queryParam.dataType = 'FULL'
} else if(val === 'SPHDP'){
this.queryParam.dataType = 'PREL'
} else{
this.queryParam.dataType = val.substring(0, 1)
}
this.searchQuery()
},
},
methods: { methods: {
handleTableChange() {}, handleTableChange() {},
findStationList() {
getAction(this.url.findStationList, { menuName: 'Particulate' }).then((res) => {
this.stationList = res.result.map((res) => ({ label: res.stationCode, value: res.stationId }))
})
},
}, },
computed: { computed: {
formItems() { formItems() {
@ -103,8 +135,9 @@ export default {
{ {
type: 'a-input', type: 'a-input',
label: '', label: '',
name: 'username', name: 'search',
props: { props: {
placeholder: 'search...',
style: { style: {
width: '166px', width: '166px',
}, },
@ -116,9 +149,18 @@ export default {
{ {
type: 'custom-select', type: 'custom-select',
label: 'Stations', label: 'Stations',
name: 'roleId', name: 'stationIds',
props: { props: {
options: this.roleOptions, placeholder: 'select stations',
mode: 'multiple',
maxTagCount: 1,
options: [
{
label: 'ALL',
value: '',
},
...this.stationList,
],
style: { style: {
width: '200px', width: '200px',
}, },
@ -130,11 +172,11 @@ export default {
{ {
label: 'Start date', label: 'Start date',
type: 'custom-date-picker', type: 'custom-date-picker',
name: 'collectStart', name: 'startTime',
props: { props: {
showTime: { format: 'HH:mm' }, showTime: { format: 'HH:mm' },
format: 'YYYY-MM-DD HH:mm', format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD:ss',
style: { style: {
minWidth: 'auto', minWidth: 'auto',
width: '200px', width: '200px',
@ -147,11 +189,11 @@ export default {
{ {
label: 'End date', label: 'End date',
type: 'custom-date-picker', type: 'custom-date-picker',
name: 'collectStop', name: 'endTime',
props: { props: {
showTime: { format: 'HH:mm' }, showTime: { format: 'HH:mm' },
format: 'YYYY-MM-DD HH:mm', format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD:ss',
style: { style: {
minWidth: 'auto', minWidth: 'auto',
width: '200px', width: '200px',