fix: 修改arr和rrr页面,修改探测器表单

This commit is contained in:
orgin 2024-01-11 17:13:03 +08:00
parent 3add369ae1
commit 183c1e9683
3 changed files with 204 additions and 55 deletions

View File

@ -72,6 +72,16 @@ const columns = [
align: 'left', align: 'left',
dataIndex: 'sampleId', dataIndex: 'sampleId',
}, },
{
title: 'Qualifie',
align: 'left',
dataIndex: 'spectralQualifie',
},
{
title: 'Analyst',
align: 'left',
dataIndex: 'analyst',
}
] ]
import { compareDate } from '../../commom' import { compareDate } from '../../commom'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@ -210,6 +220,9 @@ export default {
this.queryParam.stationIds = [] this.queryParam.stationIds = []
} }
}, },
handleQualifieChange(val){
this.queryParam.qualifie = val
},
getBeforeDate(n) { getBeforeDate(n) {
var n = n var n = n
var d = new Date() var d = new Date()
@ -238,7 +251,7 @@ export default {
computed: { computed: {
formItems() { formItems() {
return [ return [
{ /*{
type: 'a-input', type: 'a-input',
label: '', label: '',
name: 'search', name: 'search',
@ -251,7 +264,7 @@ export default {
style: { style: {
width: 'auto', width: 'auto',
}, },
}, },*/
{ {
type: 'custom-all-select', type: 'custom-all-select',
label: 'Stations', label: 'Stations',
@ -307,6 +320,25 @@ export default {
width: 'auto', width: 'auto',
}, },
}, },
{
type: 'a-select',
label: 'Qualifie',
name: 'qualifie',
props: {
allowClear: true,
placeholder: 'Select qualifie',
options: [{label: 'FULL', value: "FULL"}, {label: 'PREL', value: "PREL"}],
style: {
width: '200px',
},
},
on: {
change: this.handleQualifieChange,
},
style: {
width: 'auto',
},
}
] ]
}, },
}, },

View File

@ -72,6 +72,16 @@ const columns = [
align: 'left', align: 'left',
dataIndex: 'sampleId', dataIndex: 'sampleId',
}, },
{
title: 'Qualifie',
align: 'left',
dataIndex: 'spectralQualifie',
},
{
title: 'Analyst',
align: 'left',
dataIndex: 'analyst',
}
] ]
import { compareDate } from '../../commom' import { compareDate } from '../../commom'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@ -93,6 +103,7 @@ export default {
startTime: dateFormat(new Date(), 'yyyy-MM-dd'), startTime: dateFormat(new Date(), 'yyyy-MM-dd'),
endTime: dateFormat(new Date(), 'yyyy-MM-dd'), endTime: dateFormat(new Date(), 'yyyy-MM-dd'),
stationIds: [], stationIds: [],
qualifie: ''
}, },
url: { url: {
list: '/radionuclide/findReviewedPage', list: '/radionuclide/findReviewedPage',
@ -194,7 +205,6 @@ export default {
}) })
}, },
handleSelectChange(val) { handleSelectChange(val) {
console.log(val)
let length = this.stationList.length let length = this.stationList.length
if (val.length === length) { if (val.length === length) {
this.allChecked = true this.allChecked = true
@ -210,6 +220,9 @@ export default {
this.queryParam.stationIds = [] this.queryParam.stationIds = []
} }
}, },
handleQualifieChange(val){
this.queryParam.qualifie = val
},
getBeforeDate(n) { getBeforeDate(n) {
var n = n var n = n
var d = new Date() var d = new Date()
@ -238,7 +251,7 @@ export default {
computed: { computed: {
formItems() { formItems() {
return [ return [
{ /*{
type: 'a-input', type: 'a-input',
label: '', label: '',
name: 'search', name: 'search',
@ -251,7 +264,7 @@ export default {
style: { style: {
width: 'auto', width: 'auto',
}, },
}, },*/
{ {
type: 'custom-all-select', type: 'custom-all-select',
label: 'Stations', label: 'Stations',
@ -307,6 +320,25 @@ export default {
width: 'auto', width: 'auto',
}, },
}, },
{
type: 'a-select',
label: 'Qualifie',
name: 'qualifie',
props: {
allowClear: true,
placeholder: 'Select qualifie',
options: [{label: 'FULL', value: "FULL"}, {label: 'PREL', value: "PREL"}],
style: {
width: '200px',
},
},
on: {
change: this.handleQualifieChange,
},
style: {
width: 'auto',
},
}
] ]
}, },
}, },

View File

@ -43,52 +43,92 @@
</div> </div>
<!-- 列表结束 --> <!-- 列表结束 -->
<!-- 新增/编辑 --> <!-- 新增/编辑 -->
<custom-modal :title="isAdd ? 'Add' : 'Edit'" v-model="visible" :width="475" :okHandler="submit"> <custom-modal :title="isAdd ? 'Add' : 'Edit'" v-model="visible" :width="650" :okHandler="submit">
<a-form-model <a-form-model
ref="form" ref="form"
layout="horizontal"
:model="model" :model="model"
:rules="rules" :rules="rules"
:colon="false" :colon="false"
:labelCol="{ style: { width: '115px' } }" :labelCol="{ style: { width: '115px' } }"
:wrapperCol="{ style: { width: '300px' } }" :wrapperCol="{ style: { width: '150px' } }"
> >
<a-form-model-item label="Detector Id" prop="detectorId"> <a-row :gutter="24">
<a-input v-model="model.detectorId" type="number"></a-input> <!-- <a-col :span="12">
</a-form-model-item> <a-form-model-item label="Detector Id" prop="detectorId">
<a-form-model-item label="Detector Code" prop="detectorCode"> <a-input :disabled='!isAdd' v-model="model.detectorId" type="number"></a-input>
<a-input v-model="model.detectorCode"></a-input> </a-form-model-item>
</a-form-model-item> </a-col>-->
<a-form-model-item label="Lon" prop="lon"> <a-col :span="12">
<a-input v-model="model.lon" type="number"></a-input> <a-form-model-item label="Station" prop="stationId">
</a-form-model-item> <a-select showSearch allowClear
<a-form-model-item label="Lat" prop="lat"> :disabled='!isAdd'
<a-input v-model="model.lat" type="number"></a-input> :filterOption = this.filterOption
</a-form-model-item> :options="stationOptions"
<a-form-model-item label="Type" prop="type"> v-model="model.stationId">
<a-input v-model="model.type"></a-input> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="Channels" prop="channels"> </a-col>
<a-input v-model="model.channels" type="number"></a-input> <a-col :span="12">
</a-form-model-item> <a-form-model-item label="Detector Code" prop="detectorCode">
<a-form-model-item label="Rated Efficiency" prop="ratedEfficiency"> <a-input :disabled='!isAdd' @input='enterCode' v-model="model.detectorCode"></a-input>
<a-input v-model="model.ratedEfficiency" type="number"></a-input> </a-form-model-item>
</a-form-model-item> </a-col>
<a-form-model-item label="Rated Resolution" prop="ratedResolution"> </a-row>
<a-input v-model="model.ratedResolution" type="number"></a-input> <a-row :gutter="24">
</a-form-model-item> <a-col :span="12">
<a-form-model-item label="Ecal Range Max" prop="ecalRangeMax"> <a-form-model-item label="Status" prop="status">
<a-input v-model="model.ecalRangeMax" type="number"></a-input> <j-dict-select-tag v-model="model.status" dictCode="STATION_STATUS"></j-dict-select-tag>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="Description" prop="description"> </a-col>
<a-textarea v-model="model.description" :rows="3"></a-textarea> <a-col :span="12">
</a-form-model-item> <a-form-model-item label="Type" prop="type">
<a-form-model-item label="Moddate" prop="moddate"> <a-input v-model="model.type"></a-input>
<a-date-picker v-model="model.moddate" :rows="3"></a-date-picker> </a-form-model-item>
</a-form-model-item> </a-col>
<a-form-model-item label="Status" prop="status"> </a-row>
<j-dict-select-tag v-model="model.status" dictCode="STATION_STATUS"></j-dict-select-tag> <a-row :gutter="24">
</a-form-model-item> <a-col :span="12">
<a-form-model-item label="Lon" prop="lon">
<a-input v-model="model.lon" type="number"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="Lat" prop="lat">
<a-input v-model="model.lat" type="number"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="Channels" prop="channels">
<a-input v-model="model.channels" type="number"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="Rated Efficiency" prop="ratedEfficiency">
<a-input v-model="model.ratedEfficiency" type="number"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="Rated Resolution" prop="ratedResolution">
<a-input v-model="model.ratedResolution" type="number"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="Ecal Range Max" prop="ecalRangeMax">
<a-input v-model="model.ecalRangeMax" type="number"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<a-form-model-item label="Description" prop="description" :wrapperCol="{ style: { width: '77%' } }">
<a-textarea v-model="model.description" :rows="2"></a-textarea>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model> </a-form-model>
</custom-modal> </custom-modal>
<!-- 新增/编辑 结束 --> <!-- 新增/编辑 结束 -->
@ -198,23 +238,28 @@ export default {
data() { data() {
this.columns = columns this.columns = columns
const validateDetectorCode = (_, value, callback) => { const validateDetectorCode = (_, value, callback) => {
if (!value) { if(this.model.stationId){
callback(new Error('Please Enter Detector Code')) if (value) {
} else { if (value.length > 9) {
if (value.length > 9) { callback(new Error('Detector Code Limit 9'))
callback(new Error('Detector Code Limit 9')) } else {
callback()
}
} else { } else {
callback() callback(new Error('Please Enter Code'))
} }
}else {
callback('Select Station First');
} }
} }
return { return {
queryParam: {}, queryParam: {},
rules: { rules: {
detectorId: [{ required: true, message: 'Please Enter Detector Id' }], // detectorId: [{ required: true, message: 'Please Enter Id' }, { validator: this.checkId }],
detectorCode: [{ required: true, validator: validateDetectorCode }], detectorCode: [{ required: true, validator: validateDetectorCode }],
moddate: [{ required: true, message: 'Please Select Moddate' }] stationId: [{ required: true, message: 'Please Select Station' }],
status: [{ required: true, message: 'Please Select Status' }]
}, },
url: { url: {
list: '/gardsDetectors/findPage', list: '/gardsDetectors/findPage',
@ -222,7 +267,8 @@ export default {
add: '/gardsDetectors/create', add: '/gardsDetectors/create',
edit: '/gardsDetectors/update' edit: '/gardsDetectors/update'
}, },
typeList: [] typeList: [],
stationOptions: [],
} }
}, },
created() { created() {
@ -231,7 +277,7 @@ export default {
methods: { methods: {
async getTypeList() { async getTypeList() {
try { try {
const res = await getAction('/gardsDetectors/findType') const res = await getAction( '/gardsDetectors/findType')
this.typeList = res.filter(item => item).map(item => ({ label: item, value: item })) this.typeList = res.filter(item => item).map(item => ({ label: item, value: item }))
} catch (error) { } catch (error) {
console.error(error) console.error(error)
@ -244,13 +290,15 @@ export default {
onAdd() { onAdd() {
this.isAdd = true this.isAdd = true
this.model = {} this.model = { status: 'Operating' }
this.getStationList()
this.visible = true this.visible = true
}, },
onEdit() { onEdit() {
if (this.selectedRowKeys && this.selectedRowKeys.length) { if (this.selectedRowKeys && this.selectedRowKeys.length) {
this.isAdd = false this.isAdd = false
this.visible = true this.visible = true
this.getStationList()
const find = this.dataSource.find(item => item.detectorId === this.selectedRowKeys[0]) const find = this.dataSource.find(item => item.detectorId === this.selectedRowKeys[0])
this.model = cloneDeep(find) this.model = cloneDeep(find)
} else { } else {
@ -274,6 +322,43 @@ export default {
beforeSubmit() { beforeSubmit() {
this.model.moddate = moment(this.model.moddate).format('yyyy-MM-DD HH:mm:ss') this.model.moddate = moment(this.model.moddate).format('yyyy-MM-DD HH:mm:ss')
},
async getStationList() {
await getAction('/webStatistics/findStationList', { menuName: '' }).then((res) => {
if (res.success) {
if (res.result.length > 0) {
this.stationOptions = res.result.map((item) => {
return {
label: item.stationCode,
value: item.stationId,
}
})
} else {
this.stationOptions = []
}
} else {
this.$message.warning('This operation fails. Contact your system administrator')
}
})
},
enterCode(){
let stationId = this.model.stationId
if (stationId){
let current = this.model.detectorCode
let stationCode = this.stationOptions.find(option => option.value === stationId).label;
let prefix = stationCode + "_"
if (!current.startsWith(prefix)){
this.model.detectorCode = prefix + current
}else {
if (prefix === current){
this.model.detectorCode = ''
}
}
}else {
this.model.detectorCode = ''
}
} }
}, },
computed: { computed: {