2023-07-06 14:05:43 +08:00
|
|
|
<template>
|
2023-07-07 17:44:20 +08:00
|
|
|
<custom-modal v-model="visible" :width="1280" title="Load From Database" class="load-from-db-modal">
|
|
|
|
<search-form ref="searchFormRef" :items="formItems" v-model="queryParam">
|
|
|
|
<a-space slot="additional">
|
|
|
|
<a-button @click="handleReset">Reset</a-button>
|
|
|
|
<a-button type="primary" @click="searchQuery">Search</a-button>
|
|
|
|
</a-space>
|
|
|
|
</search-form>
|
2023-07-06 14:05:43 +08:00
|
|
|
<custom-table
|
|
|
|
size="middle"
|
|
|
|
rowKey="sampleId"
|
|
|
|
:columns="columns"
|
|
|
|
:list="dataSource"
|
|
|
|
:pagination="ipagination"
|
|
|
|
:loading="loading"
|
|
|
|
@change="handleTableChange"
|
|
|
|
:selectedRowKeys.sync="selectedRowKeys"
|
2023-07-07 17:44:20 +08:00
|
|
|
:selectionRows.sync="selectionRows"
|
2023-07-06 14:05:43 +08:00
|
|
|
:multiple="true"
|
2023-09-21 19:41:16 +08:00
|
|
|
:scroll="{ y: 'calc(100vh - 550px)' }"
|
2023-07-06 14:05:43 +08:00
|
|
|
>
|
|
|
|
</custom-table>
|
|
|
|
<!-- 底部操作栏 -->
|
|
|
|
<template slot="custom-footer">
|
2023-07-07 17:44:20 +08:00
|
|
|
<a-space>
|
|
|
|
<a-radio-group v-model="queryParam.dbName">
|
|
|
|
<a-radio value="auto">From Auto DB</a-radio>
|
|
|
|
<a-radio value="man">From Interactive DB</a-radio>
|
|
|
|
</a-radio-group>
|
2023-07-11 19:35:18 +08:00
|
|
|
<a-button type="primary" @click="handleLoad">Load</a-button>
|
2023-07-07 17:44:20 +08:00
|
|
|
</a-space>
|
2023-07-06 14:05:43 +08:00
|
|
|
</template>
|
|
|
|
</custom-modal>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
|
import { getAction } from '../../../../api/manage'
|
2023-07-07 17:44:20 +08:00
|
|
|
import moment from 'moment'
|
2023-09-27 15:38:36 +08:00
|
|
|
import { cloneDeep } from 'lodash'
|
2023-07-06 14:05:43 +08:00
|
|
|
|
|
|
|
const columns = [
|
|
|
|
{
|
|
|
|
title: 'SampleID',
|
|
|
|
align: 'left',
|
|
|
|
dataIndex: 'sampleId'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Station',
|
|
|
|
align: 'left',
|
|
|
|
dataIndex: 'stationName'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Detector',
|
|
|
|
align: 'left',
|
2023-09-21 19:41:16 +08:00
|
|
|
dataIndex: 'detectorsName',
|
|
|
|
width: 130
|
2023-07-06 14:05:43 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Sample',
|
|
|
|
align: 'left',
|
|
|
|
dataIndex: 'sampleType'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'DataType',
|
|
|
|
align: 'left',
|
|
|
|
dataIndex: 'dataType'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Qualifier',
|
|
|
|
align: 'left',
|
|
|
|
dataIndex: 'spectralQualifie'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Col.Stop',
|
|
|
|
align: 'left',
|
2023-09-21 19:41:16 +08:00
|
|
|
dataIndex: 'collectStop',
|
|
|
|
width: 170
|
2023-07-06 14:05:43 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Acq.Start',
|
|
|
|
align: 'left',
|
2023-09-21 19:41:16 +08:00
|
|
|
dataIndex: 'acquisitionStart',
|
|
|
|
width: 170
|
2023-07-06 14:05:43 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Acq.real',
|
|
|
|
align: 'left',
|
|
|
|
dataIndex: 'acquisitionRealSec'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Acq.live',
|
|
|
|
align: 'left',
|
|
|
|
dataIndex: 'acquisitionLiveSec'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Status',
|
|
|
|
align: 'left',
|
|
|
|
dataIndex: 'status'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
value: {
|
|
|
|
type: Boolean
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mixins: [JeecgListMixin],
|
|
|
|
data() {
|
|
|
|
this.columns = columns
|
2023-07-06 19:41:06 +08:00
|
|
|
this.disableMixinCreated = true
|
2023-07-06 14:05:43 +08:00
|
|
|
return {
|
2023-07-07 17:44:20 +08:00
|
|
|
queryParam: {
|
2023-07-26 10:12:39 +08:00
|
|
|
menuTypes: 'G,B',
|
2023-07-07 17:44:20 +08:00
|
|
|
startDate: moment()
|
|
|
|
.add(-7, 'd')
|
|
|
|
.format('YYYY-MM-DD'),
|
|
|
|
endDate: moment().format('YYYY-MM-DD'),
|
|
|
|
dbName: 'auto'
|
|
|
|
},
|
2023-07-06 14:05:43 +08:00
|
|
|
selectedRowKeys: [],
|
2023-07-07 17:44:20 +08:00
|
|
|
selectionRows: [],
|
|
|
|
|
2023-07-06 14:05:43 +08:00
|
|
|
stationList: [],
|
|
|
|
detectorList: [],
|
|
|
|
url: {
|
2023-07-06 19:41:06 +08:00
|
|
|
list: '/spectrumAnalysis/getDBSpectrumList'
|
2023-07-11 19:35:18 +08:00
|
|
|
}
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
},
|
2023-07-26 19:35:36 +08:00
|
|
|
created() {
|
|
|
|
this.getStationAndDetectorList(this.queryParam.menuTypes)
|
|
|
|
},
|
2023-07-06 14:05:43 +08:00
|
|
|
methods: {
|
|
|
|
loadData(arg) {
|
2023-07-06 19:41:06 +08:00
|
|
|
const params = this.getQueryParams() //查询条件
|
2023-07-25 20:01:55 +08:00
|
|
|
const { startDate, endDate, menuTypes } = params
|
2023-07-11 09:10:34 +08:00
|
|
|
if (!menuTypes) {
|
2023-07-07 17:44:20 +08:00
|
|
|
this.$message.warn('Please Select SampleType First')
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:01:55 +08:00
|
|
|
if (!startDate || !endDate) {
|
2023-07-07 17:44:20 +08:00
|
|
|
this.$message.warn(`'From' Date And 'To' Date Cannot Be Null`)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:01:55 +08:00
|
|
|
if (moment(startDate).isAfter(moment(endDate))) {
|
2023-07-07 17:44:20 +08:00
|
|
|
this.$message.warn(`'From' Date Cannot Be Late Than 'To' Date`)
|
2023-07-06 19:41:06 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-07-06 14:05:43 +08:00
|
|
|
//加载数据 若传入参数1则加载第一页的内容
|
|
|
|
if (arg === 1) {
|
|
|
|
this.ipagination.current = 1
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:01:55 +08:00
|
|
|
params.AllUsers = this.allUsersValue
|
2023-07-27 18:42:51 +08:00
|
|
|
params.CollectStopB = this.collectStopValue
|
|
|
|
params.AcqStartB = this.acqStartValue
|
2023-07-25 20:01:55 +08:00
|
|
|
delete params.checkboxGroup
|
2023-07-06 14:05:43 +08:00
|
|
|
|
2023-07-06 19:41:06 +08:00
|
|
|
this.onClearSelected()
|
|
|
|
|
2023-07-06 14:05:43 +08:00
|
|
|
this.loading = true
|
|
|
|
getAction(this.url.list, params)
|
|
|
|
.then(res => {
|
|
|
|
if (res.success) {
|
2023-09-04 19:40:13 +08:00
|
|
|
const result = res.result.records || res.result
|
|
|
|
result.forEach(item => {
|
|
|
|
const fileName = item.inputFileName
|
|
|
|
if(fileName) {
|
|
|
|
const arr = fileName.split('/')
|
|
|
|
item.inputFileName = arr[arr.length - 1]
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
this.dataSource = result
|
|
|
|
|
2023-07-06 14:05:43 +08:00
|
|
|
if (res.result.total) {
|
|
|
|
this.ipagination.total = res.result.total
|
|
|
|
} else {
|
|
|
|
this.ipagination.total = 0
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.$message.warning(res.message)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.finally(() => {
|
|
|
|
this.loading = false
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 加载
|
|
|
|
*/
|
|
|
|
async handleLoad() {
|
|
|
|
if (!this.selectedRowKeys.length) {
|
|
|
|
this.$message.warn('Please Select Databases To Load')
|
|
|
|
return
|
|
|
|
}
|
2023-07-07 17:44:20 +08:00
|
|
|
this.selectedRowKeys = []
|
2023-07-06 14:05:43 +08:00
|
|
|
this.visible = false
|
2023-09-27 15:38:36 +08:00
|
|
|
this.$emit('loadSample', cloneDeep(this.selectionRows))
|
2023-07-06 14:05:43 +08:00
|
|
|
},
|
|
|
|
|
2023-07-07 17:44:20 +08:00
|
|
|
// 获取台站和探测器列表
|
|
|
|
async getStationAndDetectorList(value) {
|
2023-07-06 14:05:43 +08:00
|
|
|
try {
|
2023-08-29 19:54:09 +08:00
|
|
|
this.stationList = []
|
|
|
|
this.detectorList = []
|
|
|
|
|
2023-07-06 19:41:06 +08:00
|
|
|
const { success, result, message } = await getAction('/spectrumAnalysis/getDBSearchList', {
|
2023-07-25 20:01:55 +08:00
|
|
|
menuTypes: value,
|
|
|
|
dbName: this.queryParam.dbName,
|
|
|
|
AllUsers: this.allUsersValue
|
2023-07-06 14:05:43 +08:00
|
|
|
})
|
|
|
|
if (success) {
|
2023-07-07 17:44:20 +08:00
|
|
|
this.stationList = result.stationCode.map(item => ({ label: item, value: item }))
|
|
|
|
this.detectorList = result.detectorCode.map(item => ({ label: item, value: item }))
|
2023-07-06 14:05:43 +08:00
|
|
|
} else {
|
|
|
|
this.$message.error(message)
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2023-07-07 17:44:20 +08:00
|
|
|
// 重置搜索栏
|
|
|
|
handleReset() {
|
|
|
|
this.$refs.searchFormRef.$refs.form.resetFields()
|
|
|
|
},
|
|
|
|
|
2023-07-06 14:05:43 +08:00
|
|
|
filterOption(input, option) {
|
|
|
|
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
visible: {
|
|
|
|
get() {
|
|
|
|
return this.value
|
|
|
|
},
|
|
|
|
set(val) {
|
|
|
|
this.$emit('input', val)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
formItems() {
|
|
|
|
return [
|
|
|
|
{
|
2023-07-07 17:44:20 +08:00
|
|
|
label: 'SampleType',
|
2023-07-06 19:41:06 +08:00
|
|
|
type: 'custom-select',
|
|
|
|
name: 'menuTypes',
|
2023-07-06 14:05:43 +08:00
|
|
|
props: {
|
2023-07-06 19:41:06 +08:00
|
|
|
options: [
|
2023-07-11 09:10:34 +08:00
|
|
|
{
|
|
|
|
label: 'All',
|
|
|
|
value: 'G,B'
|
|
|
|
},
|
2023-07-06 19:41:06 +08:00
|
|
|
{
|
|
|
|
label: 'Gamma',
|
|
|
|
value: 'G'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Beta',
|
|
|
|
value: 'B'
|
|
|
|
}
|
2023-07-07 17:44:20 +08:00
|
|
|
],
|
2023-07-11 09:10:34 +08:00
|
|
|
allowClear: true
|
2023-07-06 14:05:43 +08:00
|
|
|
},
|
|
|
|
style: {
|
2023-07-11 09:10:34 +08:00
|
|
|
width: '18%'
|
2023-07-06 19:41:06 +08:00
|
|
|
},
|
|
|
|
on: {
|
2023-07-07 17:44:20 +08:00
|
|
|
change: event => {
|
2023-07-25 20:01:55 +08:00
|
|
|
if (!event) {
|
|
|
|
this.stationList = []
|
|
|
|
this.detectorList = []
|
|
|
|
return
|
|
|
|
}
|
2023-07-07 17:44:20 +08:00
|
|
|
this.getStationAndDetectorList(event)
|
2023-07-06 19:41:06 +08:00
|
|
|
}
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Station',
|
|
|
|
type: 'custom-select',
|
2023-07-07 17:44:20 +08:00
|
|
|
name: 'stationName',
|
2023-07-06 14:05:43 +08:00
|
|
|
props: {
|
2023-07-07 17:44:20 +08:00
|
|
|
options: this.stationList,
|
2023-07-06 14:05:43 +08:00
|
|
|
showSearch: true,
|
|
|
|
filterOption: this.filterOption,
|
|
|
|
allowClear: true
|
|
|
|
},
|
|
|
|
style: {
|
2023-07-11 09:10:34 +08:00
|
|
|
width: '19%'
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Detector',
|
|
|
|
type: 'custom-select',
|
2023-07-07 17:44:20 +08:00
|
|
|
name: 'detectorsName',
|
2023-07-06 14:05:43 +08:00
|
|
|
props: {
|
2023-07-07 17:44:20 +08:00
|
|
|
options: this.detectorList,
|
2023-07-06 14:05:43 +08:00
|
|
|
showSearch: true,
|
|
|
|
filterOption: this.filterOption,
|
|
|
|
allowClear: true
|
|
|
|
},
|
|
|
|
style: {
|
2023-07-11 09:10:34 +08:00
|
|
|
width: '19%'
|
2023-07-06 19:41:06 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Sample',
|
|
|
|
type: 'custom-select',
|
2023-07-07 17:44:20 +08:00
|
|
|
name: 'sampleType',
|
2023-07-06 19:41:06 +08:00
|
|
|
props: {
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: 'P',
|
|
|
|
value: 'P'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'B',
|
|
|
|
value: 'B'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'G',
|
|
|
|
value: 'G'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
allowClear: true
|
|
|
|
},
|
|
|
|
style: {
|
2023-07-11 09:10:34 +08:00
|
|
|
width: '14%'
|
2023-07-06 19:41:06 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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: {
|
2023-07-11 09:10:34 +08:00
|
|
|
width: '14%'
|
2023-07-06 19:41:06 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Qualifier',
|
|
|
|
type: 'custom-select',
|
2023-07-07 17:44:20 +08:00
|
|
|
name: 'spectralQualifie',
|
2023-07-06 19:41:06 +08:00
|
|
|
props: {
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: 'FULL',
|
|
|
|
value: 'FULL'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'PREL',
|
|
|
|
value: 'PREL'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
allowClear: true
|
|
|
|
},
|
|
|
|
style: {
|
2023-07-11 09:10:34 +08:00
|
|
|
width: '16%',
|
|
|
|
paddingRight: 0
|
2023-07-06 19:41:06 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'SampleID',
|
|
|
|
type: 'a-input',
|
|
|
|
name: 'sampleId',
|
|
|
|
props: {
|
|
|
|
allowClear: true
|
|
|
|
},
|
|
|
|
style: {
|
2023-07-11 09:10:34 +08:00
|
|
|
width: '264px'
|
2023-07-06 19:41:06 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '',
|
|
|
|
type: 'a-checkbox-group',
|
|
|
|
name: 'checkboxGroup',
|
|
|
|
props: {
|
|
|
|
options: [
|
2023-07-25 20:01:55 +08:00
|
|
|
{ label: 'All User', value: 'AllUsers' },
|
2023-07-27 18:42:51 +08:00
|
|
|
{ label: 'Collect Stop', value: 'CollectStopB' },
|
|
|
|
{ label: 'Acq.Start', value: 'AcqStartB' }
|
2023-07-06 19:41:06 +08:00
|
|
|
]
|
|
|
|
},
|
|
|
|
style: {
|
2023-07-11 09:10:34 +08:00
|
|
|
width: '305px',
|
|
|
|
paddingRight: 0
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'From',
|
|
|
|
type: 'custom-date-picker',
|
2023-07-06 19:41:06 +08:00
|
|
|
name: 'startDate',
|
2023-07-06 14:05:43 +08:00
|
|
|
props: {
|
2023-07-07 17:44:20 +08:00
|
|
|
format: 'YYYY-MM-DD',
|
|
|
|
valueFormat: 'YYYY-MM-DD',
|
2023-07-06 14:05:43 +08:00
|
|
|
style: {
|
|
|
|
minWidth: 'auto'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
style: {
|
2023-07-07 17:44:20 +08:00
|
|
|
width: '19%'
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'To',
|
|
|
|
type: 'custom-date-picker',
|
2023-07-06 19:41:06 +08:00
|
|
|
name: 'endDate',
|
2023-07-06 14:05:43 +08:00
|
|
|
props: {
|
2023-07-07 17:44:20 +08:00
|
|
|
format: 'YYYY-MM-DD',
|
|
|
|
valueFormat: 'YYYY-MM-DD',
|
2023-07-06 14:05:43 +08:00
|
|
|
style: {
|
|
|
|
minWidth: 'auto'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
style: {
|
|
|
|
paddingRight: 0,
|
2023-07-07 17:44:20 +08:00
|
|
|
marginRight: '22px',
|
|
|
|
width: '19%'
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2023-07-25 20:01:55 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
allUsersValue() {
|
|
|
|
const checkboxGroup = this.queryParam.checkboxGroup
|
|
|
|
return !!(checkboxGroup && checkboxGroup.includes('AllUsers'))
|
2023-07-27 18:42:51 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
collectStopValue() {
|
|
|
|
const checkboxGroup = this.queryParam.checkboxGroup
|
|
|
|
return !!(checkboxGroup && checkboxGroup.includes('CollectStopB'))
|
|
|
|
},
|
|
|
|
|
|
|
|
acqStartValue() {
|
|
|
|
const checkboxGroup = this.queryParam.checkboxGroup
|
|
|
|
return !!(checkboxGroup && checkboxGroup.includes('AcqStartB'))
|
2023-07-25 20:01:55 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
// All User 变化时重新获取station 和detector
|
|
|
|
allUsersValue() {
|
|
|
|
if (this.queryParam.menuTypes) {
|
|
|
|
this.stationList = []
|
|
|
|
this.detectorList = []
|
|
|
|
this.getStationAndDetectorList(this.queryParam.menuTypes)
|
|
|
|
}
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.load-from-db-modal {
|
2023-07-07 17:44:20 +08:00
|
|
|
::v-deep {
|
|
|
|
.search-btn {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
</style>
|