核素字段接口联调

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