AnalysisSystemForRadionucli.../src/views/system/DataBase.vue

429 lines
9.5 KiB
Vue
Raw Normal View History

<template>
<div>
2023-05-12 19:10:18 +08:00
<search-form :items="formItems" v-model="queryParam" @search="searchQuery">
2023-11-03 11:12:52 +08:00
<div class="btn-group" slot="additional">
<div>
<a-checkbox v-model="delParams.sampleData"> SampleData </a-checkbox>
<a-checkbox v-model="delParams.rnAuto" @change="handleCheckboxChange('rnAuto')"> AutoResults </a-checkbox>
<a-checkbox v-model="delParams.rnMan" @change="handleCheckboxChange('rnMan')"> Reviewed Results </a-checkbox>
</div>
<a-button type="primary" @click="onDel">
<img src="@/assets/images/global/delete.png" alt="" />
Delete
</a-button>
</div>
2023-05-12 19:10:18 +08:00
</search-form>
<custom-table
size="middle"
2023-05-16 19:45:54 +08:00
rowKey="sampleId"
2023-05-12 19:10:18 +08:00
:columns="columns"
:list="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange"
:selectedRowKeys.sync="selectedRowKeys"
:scroll="{ x: true, y: 'calc(100vh - 415px)' }"
2023-05-12 19:10:18 +08:00
>
<template slot="index" slot-scope="{ index }">
{{ index + 1 }}
</template>
</custom-table>
</div>
</template>
<script>
2023-05-12 19:10:18 +08:00
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
2023-11-03 11:12:52 +08:00
import { deleteAction, getAction } from '../../api/manage'
import dateFormat from '@/components/jeecg/JEasyCron/format-date'
2023-05-12 19:10:18 +08:00
const columns = [
{
title: 'NO',
align: 'left',
2023-05-12 19:10:18 +08:00
width: 100,
scopedSlots: {
2023-11-03 11:12:52 +08:00
customRender: 'index',
},
customHeaderCell: () => {
return {
style: {
2023-11-03 11:12:52 +08:00
'padding-left': '26px !important',
},
}
},
customCell: () => {
return {
style: {
2023-11-03 11:12:52 +08:00
'padding-left': '26px !important',
},
}
2023-11-03 11:12:52 +08:00
},
2023-05-12 19:10:18 +08:00
},
{
title: 'SITE DET CODE',
align: 'left',
2023-05-12 19:10:18 +08:00
dataIndex: 'siteDetCode',
2023-11-03 11:12:52 +08:00
width: 150,
2023-05-12 19:10:18 +08:00
},
{
2023-05-16 19:45:54 +08:00
title: 'SAMPLE ID',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 120,
2023-11-03 11:12:52 +08:00
dataIndex: 'sampleId',
2023-05-12 19:10:18 +08:00
},
{
title: 'STATION',
align: 'left',
2023-05-12 19:10:18 +08:00
width: 100,
2023-11-03 11:12:52 +08:00
dataIndex: 'stationName',
2023-05-12 19:10:18 +08:00
},
{
title: 'DETECTOR',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 120,
2023-11-03 11:12:52 +08:00
dataIndex: 'detectorsName',
2023-05-12 19:10:18 +08:00
},
{
title: 'SAMPLE TYPE',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 140,
2023-11-03 11:12:52 +08:00
dataIndex: 'sampleType',
2023-05-12 19:10:18 +08:00
},
{
title: 'DATA TYPE',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 120,
2023-11-03 11:12:52 +08:00
dataIndex: 'dataType',
2023-05-12 19:10:18 +08:00
},
{
title: 'GEOMETRY',
align: 'left',
2023-11-03 11:12:52 +08:00
width: 160,
dataIndex: 'geometry',
ellipsis: true,
2023-05-12 19:10:18 +08:00
},
{
title: 'QUALIFIE',
align: 'left',
2023-05-12 19:10:18 +08:00
width: 100,
2023-11-03 11:12:52 +08:00
dataIndex: 'spectralQualifie',
2023-05-12 19:10:18 +08:00
},
{
title: 'TRANSMIT DTG',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 180,
2023-11-03 11:12:52 +08:00
dataIndex: 'transmitDtg',
2023-05-16 19:45:54 +08:00
},
{
title: 'COLLECT START',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 180,
2023-11-03 11:12:52 +08:00
dataIndex: 'collectStart',
2023-05-16 19:45:54 +08:00
},
{
title: 'COLLECT STOP',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 180,
2023-11-03 11:12:52 +08:00
dataIndex: 'collectStop',
2023-05-16 19:45:54 +08:00
},
{
title: 'ACQ.START',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 180,
2023-11-03 11:12:52 +08:00
dataIndex: 'acquisitionStart',
2023-05-16 19:45:54 +08:00
},
{
title: 'ACQ.STOP',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 180,
2023-11-03 11:12:52 +08:00
dataIndex: 'acquisitionStop',
2023-05-16 19:45:54 +08:00
},
{
title: 'ACQ.REAL(S)',
align: 'left',
width: 120,
2023-11-03 11:12:52 +08:00
dataIndex: 'acquisitionRealSec',
2023-05-16 19:45:54 +08:00
},
{
title: 'ACQ.LIVE(S)',
align: 'left',
2023-06-07 16:08:07 +08:00
width: 140,
2023-11-03 11:12:52 +08:00
dataIndex: 'acquisitionLiveSec',
2023-05-16 19:45:54 +08:00
},
{
title: 'QUANTITY',
align: 'left',
2023-05-16 19:45:54 +08:00
width: 100,
2023-11-03 11:12:52 +08:00
dataIndex: 'quantity',
2023-05-16 19:45:54 +08:00
},
{
title: 'STATUS',
align: 'left',
2023-05-16 19:45:54 +08:00
width: 100,
2023-11-03 11:12:52 +08:00
dataIndex: 'status',
},
2023-05-12 19:10:18 +08:00
]
2023-05-12 19:10:18 +08:00
export default {
mixins: [JeecgListMixin],
data() {
this.columns = columns
return {
queryParam: {
collectStart: this.getBeforeDate(6),
collectStop: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
2023-11-03 11:12:52 +08:00
},
delParams: {
sampleData: true,
rnAuto: true,
rnMan: true,
2023-05-12 19:10:18 +08:00
},
url: {
2023-05-16 19:45:54 +08:00
list: '/gardsSampleData/findPage',
},
stationList: [],
2023-11-03 11:12:52 +08:00
detectorList: [],
}
},
2023-05-16 19:45:54 +08:00
created() {
// this.queryParam.collectStart = this.getBeforeDate(6)
2023-05-16 19:45:54 +08:00
this.getStationList()
this.getDetectorList()
},
methods: {
// 获取n天前的日期
getBeforeDate(n) {
var n = n
var d = new Date()
var year = d.getFullYear()
var mon = d.getMonth() + 1
var day = d.getDate()
if (day <= n) {
if (mon > 1) {
mon = mon - 1
} else {
year = year - 1
mon = 12
}
}
d.setDate(d.getDate() - n)
year = d.getFullYear()
mon = d.getMonth() + 1
day = d.getDate()
var s = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day) + ' 00:00:00'
return s
},
2023-05-16 19:45:54 +08:00
async getStationList() {
try {
const { success, result, message } = await getAction('/gardsStations/findPage', {
pageIndex: 1,
2023-11-03 11:12:52 +08:00
pageSize: 10000,
2023-05-16 19:45:54 +08:00
})
if (success) {
2023-11-03 11:12:52 +08:00
this.stationList = result.records.map((record) => ({ label: record.stationCode, value: record.stationId }))
2023-05-16 19:45:54 +08:00
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
},
async getDetectorList() {
try {
const { success, result, message } = await getAction('/gardsDetectors/findPage', {
pageIndex: 1,
2023-11-03 11:12:52 +08:00
pageSize: 10000,
2023-05-16 19:45:54 +08:00
})
if (success) {
2023-11-03 11:12:52 +08:00
this.detectorList = result.records.map((record) => ({ label: record.detectorCode, value: record.detectorId }))
2023-05-16 19:45:54 +08:00
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
},
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
2023-11-03 11:12:52 +08:00
handleCheckboxChange(name) {
if (!this.delParams[name]) {
this.delParams.sampleData = false
}
},
onDel() {
let that = this
if (this.selectedRowKeys && this.selectedRowKeys.length) {
this.$confirm({
title: 'Do You Want To Delete This Item?',
okText: 'OK',
cancelText: 'Cancel',
2023-11-03 11:12:52 +08:00
onOk: async () => {
try {
const { success, message } = await deleteAction('/gardsSampleData/deleteById', {
sampleId: this.selectedRowKeys[0],
...this.delParams,
})
if (success) {
this.$message.success('Delete Success!')
that.loadData()
2023-11-03 11:12:52 +08:00
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
}
},
})
} else {
this.$message.warn('Please Select An Item To Delete')
2023-05-12 19:10:18 +08:00
}
2023-11-03 11:12:52 +08:00
},
2023-05-16 19:45:54 +08:00
},
computed: {
formItems() {
return [
{
label: 'SampleID',
type: 'a-input',
name: 'sampleId',
props: {
allowClear: true,
style: {
width: '187px',
2023-11-03 11:12:52 +08:00
},
},
style: {
2023-11-03 11:12:52 +08:00
width: 'auto',
},
2023-05-16 19:45:54 +08:00
},
{
label: 'Station',
type: 'custom-select',
name: 'stationId',
props: {
options: [
{
label: 'ALL',
2023-11-03 11:12:52 +08:00
value: '',
2023-05-16 19:45:54 +08:00
},
2023-11-03 11:12:52 +08:00
...this.stationList,
2023-05-16 19:45:54 +08:00
],
showSearch: true,
filterOption: this.filterOption,
allowClear: true,
style: {
width: '187px',
2023-11-03 11:12:52 +08:00
},
2023-05-16 19:45:54 +08:00
},
style: {
2023-11-03 11:12:52 +08:00
width: 'auto',
},
2023-05-16 19:45:54 +08:00
},
{
label: 'Detector',
type: 'custom-select',
name: 'detectorId',
props: {
options: [
{
label: 'ALL',
2023-11-03 11:12:52 +08:00
value: '',
2023-05-16 19:45:54 +08:00
},
2023-11-03 11:12:52 +08:00
...this.detectorList,
2023-05-16 19:45:54 +08:00
],
showSearch: true,
filterOption: this.filterOption,
allowClear: true,
style: {
width: '187px',
2023-11-03 11:12:52 +08:00
},
2023-05-16 19:45:54 +08:00
},
style: {
2023-11-03 11:12:52 +08:00
width: 'auto',
},
2023-05-16 19:45:54 +08:00
},
{
label: 'From',
2023-05-26 15:07:08 +08:00
type: 'custom-date-picker',
name: 'collectStart',
2023-05-16 19:45:54 +08:00
props: {
showTime: { format: 'HH:mm' },
format: 'YYYY-MM-DD HH:mm',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
style: {
minWidth: 'auto',
width: '279px',
2023-11-03 11:12:52 +08:00
},
},
style: {
2023-11-03 11:12:52 +08:00
width: 'auto',
},
2023-05-16 19:45:54 +08:00
},
{
label: 'To',
2023-05-26 15:07:08 +08:00
type: 'custom-date-picker',
name: 'collectStop',
2023-05-16 19:45:54 +08:00
props: {
showTime: { format: 'HH:mm' },
format: 'YYYY-MM-DD HH:mm',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
style: {
minWidth: 'auto',
width: '279px',
2023-11-03 11:12:52 +08:00
},
2023-05-16 19:45:54 +08:00
},
style: {
2023-11-03 11:12:52 +08:00
width: 'auto',
},
2023-05-16 19:45:54 +08:00
},
{
type: 'a-checkbox',
name: 'collectStopCheck',
innerLabel: 'Collect Stop',
style: {
width: '132px',
2023-05-16 19:45:54 +08:00
},
},
{
type: 'a-checkbox',
name: 'acqDotStartCheck',
innerLabel: 'Acq.Start',
2023-05-16 19:45:54 +08:00
style: {
width: '113px',
2023-11-03 11:12:52 +08:00
},
},
2023-05-16 19:45:54 +08:00
]
2023-11-03 11:12:52 +08:00
},
},
watch: {
'delParams.sampleData': {
handler(newVal) {
if (newVal) {
this.delParams.rnAuto = true
this.delParams.rnMan = true
}
},
},
},
}
</script>
<style lang="less" scoped>
.btn-group {
2023-11-03 11:12:52 +08:00
display: flex;
align-items: center;
margin-left: 10px;
margin-bottom: 8px;
img {
margin-right: 12px;
height: 18px;
}
}
</style>