查看规则详情及修改规则状态的接口调试

This commit is contained in:
renpy 2023-08-04 15:52:59 +08:00
parent 1363296e95
commit a9ac8b8bbb

View File

@ -116,9 +116,9 @@
<div class="monitor-list-item-footer-actions"> <div class="monitor-list-item-footer-actions">
<span title="Edit" class="actions-edit" @click="editItem(item.id)"></span> <span title="Edit" class="actions-edit" @click="editItem(item.id)"></span>
<span title="Delete" class="actions-delete" @click="deleteItem(item.id)"></span> <span title="Delete" class="actions-delete" @click="deleteItem(item.id)"></span>
<span v-if="1==1" title="Enable" class="actions-enable" @click="changeItemStatus(item.id,item.enabled)"> <span v-if="item.enabled==1" title="Enable" class="actions-enable" @click="changeItemStatus(item.id,item.enabled)">
</span> </span>
<span v-if="1==0" title="Disabled" class="actions-disable" @click="changeItemStatus(item.id,item.enabled)"> <span v-if="item.enabled==0" title="Disabled" class="actions-disable" @click="changeItemStatus(item.id,item.enabled)">
</span> </span>
</div> </div>
</div> </div>
@ -283,8 +283,7 @@
</template> </template>
<script> <script>
import { ajaxGetDictItems } from '@/api/api' import { getAction, postAction, httpAction, deleteAction, putAction } from '@/api/manage'
import { getAction, postAction, httpAction, deleteAction } from '@/api/manage'
import DicSelect from '../../components/dicSelect.vue'; import DicSelect from '../../components/dicSelect.vue';
export default { export default {
components: { components: {
@ -330,11 +329,11 @@ export default {
contactGroupOptions: [], contactGroupOptions: [],
formVal: { formVal: {
name: "", name: "",
source: [], source: null,
station: [], station: undefined,
nuclide: [], nuclide: undefined,
qualifier: [], qualifier: null,
condition: [], condition: null,
contactGroup: undefined, contactGroup: undefined,
desc: "" desc: ""
}, },
@ -409,6 +408,27 @@ export default {
}, },
editItem(id) { editItem(id) {
this.currId = id this.currId = id
getAction("/alarmAnalysisRule/finInfo", { id }).then( res => {
if (res.success) {
console.log(res.result.sourceChecked.join(','));
this.isAdd = false
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue({
name: res.result.name,
source: res.result.sourceChecked.join(','),
station: res.result.stationChecked,
nuclide: res.result.nuclidesChecked,
qualifier: res.result.qualifierChecked.join(','),
condition: res.result.conditionChecked.join(','),
contactGroup: res.result.contactGroup,
desc: res.result.remark
});
})
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}
})
}, },
deleteItem(id) { deleteItem(id) {
let _this = this let _this = this
@ -429,7 +449,16 @@ export default {
}, },
}); });
}, },
changeItemStatus(id, isEnabled) { }, changeItemStatus(id, isEnabled) {
putAction(`/alarmAnalysisRule/updateStatus?id=${id}&enabled=${isEnabled==1?0:1}`).then(res => {
if (res.success) {
this.$message.success("success")
this.getAlarmRulesPage()
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},
handlePageChange(page, pageSize) { handlePageChange(page, pageSize) {
this.ipagination.current = page this.ipagination.current = page
this.ipagination.pageSize = pageSize this.ipagination.pageSize = pageSize