fix: 完善删除功能
This commit is contained in:
parent
ea08ccdf63
commit
ceefce8f9c
|
@ -1,7 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<search-form :items="formItems" v-model="queryParam" @search="searchQuery">
|
<search-form :items="formItems" v-model="queryParam" @search="searchQuery">
|
||||||
<div style="float: right" class="btn-group" slot="additional">
|
<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">
|
<a-button type="primary" @click="onDel">
|
||||||
<img src="@/assets/images/global/delete.png" alt="" />
|
<img src="@/assets/images/global/delete.png" alt="" />
|
||||||
Delete
|
Delete
|
||||||
|
@ -28,7 +33,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||||
import { getAction } from '../../api/manage'
|
import { deleteAction, getAction } from '../../api/manage'
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -36,125 +41,126 @@ const columns = [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
scopedSlots: {
|
scopedSlots: {
|
||||||
customRender: 'index'
|
customRender: 'index',
|
||||||
},
|
},
|
||||||
customHeaderCell: () => {
|
customHeaderCell: () => {
|
||||||
return {
|
return {
|
||||||
style: {
|
style: {
|
||||||
'padding-left': '26px !important'
|
'padding-left': '26px !important',
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
customCell: () => {
|
customCell: () => {
|
||||||
return {
|
return {
|
||||||
style: {
|
style: {
|
||||||
'padding-left': '26px !important'
|
'padding-left': '26px !important',
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'SITE DET CODE',
|
title: 'SITE DET CODE',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
dataIndex: 'siteDetCode',
|
dataIndex: 'siteDetCode',
|
||||||
width: 150
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'SAMPLE ID',
|
title: 'SAMPLE ID',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 120,
|
||||||
dataIndex: 'sampleId'
|
dataIndex: 'sampleId',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'STATION',
|
title: 'STATION',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: 'stationName'
|
dataIndex: 'stationName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'DETECTOR',
|
title: 'DETECTOR',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 120,
|
||||||
dataIndex: 'detectorsName'
|
dataIndex: 'detectorsName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'SAMPLE TYPE',
|
title: 'SAMPLE TYPE',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 140,
|
width: 140,
|
||||||
dataIndex: 'sampleType'
|
dataIndex: 'sampleType',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'DATA TYPE',
|
title: 'DATA TYPE',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 120,
|
||||||
dataIndex: 'dataType'
|
dataIndex: 'dataType',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'GEOMETRY',
|
title: 'GEOMETRY',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 160,
|
||||||
dataIndex: 'geometry'
|
dataIndex: 'geometry',
|
||||||
|
ellipsis: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'QUALIFIE',
|
title: 'QUALIFIE',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: 'spectralQualifie'
|
dataIndex: 'spectralQualifie',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'TRANSMIT DTG',
|
title: 'TRANSMIT DTG',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex: 'transmitDtg'
|
dataIndex: 'transmitDtg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'COLLECT START',
|
title: 'COLLECT START',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex: 'collectStart'
|
dataIndex: 'collectStart',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'COLLECT STOP',
|
title: 'COLLECT STOP',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex: 'collectStop'
|
dataIndex: 'collectStop',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ACQ.START',
|
title: 'ACQ.START',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex: 'acquisitionStart'
|
dataIndex: 'acquisitionStart',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ACQ.STOP',
|
title: 'ACQ.STOP',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex: 'acquisitionStop'
|
dataIndex: 'acquisitionStop',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ACQ.REAL(S)',
|
title: 'ACQ.REAL(S)',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 120,
|
||||||
dataIndex: 'acquisitionRealSec'
|
dataIndex: 'acquisitionRealSec',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ACQ.LIVE(S)',
|
title: 'ACQ.LIVE(S)',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 140,
|
width: 140,
|
||||||
dataIndex: 'acquisitionLiveSec'
|
dataIndex: 'acquisitionLiveSec',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'QUANTITY',
|
title: 'QUANTITY',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: 'quantity'
|
dataIndex: 'quantity',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'STATUS',
|
title: 'STATUS',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: 'status'
|
dataIndex: 'status',
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -164,14 +170,18 @@ export default {
|
||||||
return {
|
return {
|
||||||
queryParam: {
|
queryParam: {
|
||||||
station: '',
|
station: '',
|
||||||
detector: ''
|
detector: '',
|
||||||
|
},
|
||||||
|
delParams: {
|
||||||
|
sampleData: true,
|
||||||
|
rnAuto: true,
|
||||||
|
rnMan: true,
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
list: '/gardsSampleData/findPage',
|
list: '/gardsSampleData/findPage',
|
||||||
delete: '/gardsSampleData/deleteById'
|
|
||||||
},
|
},
|
||||||
stationList: [],
|
stationList: [],
|
||||||
detectorList: []
|
detectorList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -183,10 +193,10 @@ export default {
|
||||||
try {
|
try {
|
||||||
const { success, result, message } = await getAction('/gardsStations/findPage', {
|
const { success, result, message } = await getAction('/gardsStations/findPage', {
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10000
|
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 }))
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -199,10 +209,10 @@ export default {
|
||||||
try {
|
try {
|
||||||
const { success, result, message } = await getAction('/gardsDetectors/findPage', {
|
const { success, result, message } = await getAction('/gardsDetectors/findPage', {
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10000
|
pageSize: 10000,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.detectorList = result.records.map(record => ({ label: record.detectorCode, value: record.detectorId }))
|
this.detectorList = result.records.map((record) => ({ label: record.detectorCode, value: record.detectorId }))
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -215,20 +225,38 @@ export default {
|
||||||
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleCheckboxChange(name) {
|
||||||
|
if (!this.delParams[name]) {
|
||||||
|
this.delParams.sampleData = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onDel() {
|
onDel() {
|
||||||
if (this.selectedRowKeys && this.selectedRowKeys.length) {
|
if (this.selectedRowKeys && this.selectedRowKeys.length) {
|
||||||
this.$confirm({
|
this.$confirm({
|
||||||
title: 'Do You Want To Delete This Item?',
|
title: 'Do You Want To Delete This Item?',
|
||||||
okText: 'OK',
|
okText: 'OK',
|
||||||
cancelText: 'Cancel',
|
cancelText: 'Cancel',
|
||||||
onOk: () => {
|
onOk: async () => {
|
||||||
this.handleDelete(this.selectedRowKeys[0], 'sampleId')
|
try {
|
||||||
}
|
const { success, message } = await deleteAction('/gardsSampleData/deleteById', {
|
||||||
|
sampleId: this.selectedRowKeys[0],
|
||||||
|
...this.delParams,
|
||||||
|
})
|
||||||
|
if (success) {
|
||||||
|
this.$message.success('Delete Success!')
|
||||||
|
} else {
|
||||||
|
this.$message.error(message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.warn('Please Select An Item To Delete')
|
this.$message.warn('Please Select An Item To Delete')
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
formItems() {
|
formItems() {
|
||||||
|
@ -240,12 +268,12 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
style: {
|
style: {
|
||||||
width: '261px'
|
width: '190px',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: 'auto'
|
width: 'auto',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Station',
|
label: 'Station',
|
||||||
|
@ -255,20 +283,20 @@ export default {
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: 'ALL',
|
label: 'ALL',
|
||||||
value: ''
|
value: '',
|
||||||
},
|
},
|
||||||
...this.stationList
|
...this.stationList,
|
||||||
],
|
],
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
filterOption: this.filterOption,
|
filterOption: this.filterOption,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
style: {
|
style: {
|
||||||
width: '261px'
|
width: '190px',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: 'auto'
|
width: 'auto',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Detector',
|
label: 'Detector',
|
||||||
|
@ -278,20 +306,20 @@ export default {
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: 'ALL',
|
label: 'ALL',
|
||||||
value: ''
|
value: '',
|
||||||
},
|
},
|
||||||
...this.detectorList
|
...this.detectorList,
|
||||||
],
|
],
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
filterOption: this.filterOption,
|
filterOption: this.filterOption,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
style: {
|
style: {
|
||||||
width: '261px'
|
width: '190px',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: 'auto'
|
width: 'auto',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'From',
|
label: 'From',
|
||||||
|
@ -303,12 +331,12 @@ export default {
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
style: {
|
style: {
|
||||||
minWidth: 'auto',
|
minWidth: 'auto',
|
||||||
width: '350px'
|
width: '282px',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: 'auto'
|
width: 'auto',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'To',
|
label: 'To',
|
||||||
|
@ -320,13 +348,12 @@ export default {
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
style: {
|
style: {
|
||||||
minWidth: 'auto',
|
minWidth: 'auto',
|
||||||
width: '350px'
|
width: '282px',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
paddingRight: 0,
|
width: 'auto',
|
||||||
width: 'auto'
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '',
|
label: '',
|
||||||
|
@ -335,23 +362,35 @@ export default {
|
||||||
options: [
|
options: [
|
||||||
{ label: 'Collect Stop', value: 'collectStop' },
|
{ label: 'Collect Stop', value: 'collectStop' },
|
||||||
{ label: 'Acq.Start', value: 'acqDotStart' },
|
{ label: 'Acq.Start', value: 'acqDotStart' },
|
||||||
{ label: 'SampleData', value: 'sampleData' },
|
],
|
||||||
{ label: 'AutoResults', value: 'autoResults' },
|
|
||||||
{ label: 'Reviewed Results', value: 'reviewedResults' }
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: '610px'
|
width: '230px',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
watch: {
|
||||||
|
'delParams.sampleData': {
|
||||||
|
handler(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.delParams.rnAuto = true
|
||||||
|
this.delParams.rnMan = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.btn-group {
|
.btn-group {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user