核素字段接口联调

处理保存规则后,新增时表单不清空的问题
This commit is contained in:
renpy 2023-08-04 17:25:56 +08:00
parent f550c6cc51
commit c7bcfe1ff0

View File

@ -11,7 +11,7 @@
</a-button>
</a-col>
<a-col flex="265px">
<span class="item-label">Station</span>
<span class="item-label">Stations</span>
<a-select style="width:180px"
v-model="queryParams.station"
mode="multiple"
@ -26,9 +26,10 @@
</a-select>
</a-col>
<a-col flex="336px">
<span class="item-label">Data Sources</span>
<span class="item-label">Sources</span>
<DicSelect
v-model="queryParams.source"
placeholder="select..."
dictCode="alarm_analyse_rule_source"
/>
</a-col>
@ -266,7 +267,7 @@
v-decorator="[
'remark',
{
initialVale: this.formVal.desc
initialVale: this.formVal.remark
}
]"
/>
@ -335,7 +336,7 @@ export default {
qualifier: null,
condition: null,
contactGroup: undefined,
desc: ""
remark: ""
},
monitorList: [],
currId:"",
@ -343,6 +344,7 @@ export default {
},
created () {
this.getStationList();
this.getNuclideList();
this.getAlarmGroup();
this.getAlarmRulesPage()
},
@ -354,11 +356,30 @@ export default {
this.stationOptions = res.result.map(item => {
return {
label: item.stationCode,
value: item.stationId
value: `${item.stationId}`
}
})
console.log(this.stationOptions);
} else {
this.stationOptions=[]
}
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},
getNuclideList() {
getAction("/sys/defaultNuclide/allName",{useType:2}).then(res => {
if (res.success) {
if (res.result.length>0) {
this.nuclideOptions = res.result.map(item => {
return {
label: item,
value: item
}
})
} else {
this.stationOptions=[]
this.nuclideOptions=[]
}
} else {
this.$message.warning("This operation fails. Contact your system administrator")
@ -388,10 +409,9 @@ export default {
let params = {
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
// stations: this.queryParams.station,
// source: this.queryParams.source,
source: [1,2],
stations: [101,102],
stations: this.queryParams.station,
source: this.queryParams.source,
nuclides: this.queryParams.nuclide
}
getAction("/alarmAnalysisRule/findPage", params).then(res => {
this.spinning = false
@ -422,7 +442,7 @@ export default {
qualifier: res.result.qualifierChecked.join(','),
condition: res.result.conditionChecked.join(','),
contactGroup: res.result.contactGroup,
desc: res.result.remark
remark: res.result.remark
});
})
} else {
@ -489,7 +509,7 @@ export default {
},
onSave() {
this.form.validateFields((err, values) => {
// if (!err) {
if (!err) {
let params = {
conditions:values.condition,
name:values.name,
@ -497,8 +517,7 @@ export default {
stations:values.station.join(","),
source: values.source,
enabled: 1,
// nuclides:values.nuclide.join(","),
nuclides:"A406,Bu12",
nuclides:values.nuclide.join(","),
contactGroup:values.contactGroup,
spectralQualifier: values.qualifier,
}
@ -506,6 +525,7 @@ export default {
postAction("/alarmAnalysisRule/add", params).then(res => {
if (res.success) {
this.visible = false
this.form.resetFields()
this.$message.success("success")
this.getAlarmRulesPage()
} else {
@ -516,6 +536,7 @@ export default {
httpAction("/alarmAnalysisRule/edit", {...params,id: this.currId}, "put").then(res => {
if (res.success) {
this.visible = false
this.form.resetFields()
this.$message.success("success")
this.getAlarmRulesPage()
} else {
@ -523,7 +544,7 @@ export default {
}
})
}
// }
}
})
},
onCancel() {