| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <template>
- <div class="rule-type">
- <DialogCom
- title="告警处置"
- :visible.sync="isShow"
- @close="onHide"
- width="800px"
- >
- <div class="page-body">
- <el-descriptions class="margin-top" :column="2" size="medium" border :label-style="labelStyle" :contentStyle="content_style">
- <el-descriptions-item labelClassName="gx_info_label" label="机构名称">
- {{alarmData.orgName}}
- </el-descriptions-item>
- <el-descriptions-item labelClassName="gx_info_label" label="告警分类" >
- {{dataTypeText()}}
- </el-descriptions-item>
- <el-descriptions-item labelClassName="gx_info_label" label="告警类型" >
- {{alarmData.sourceTypeDes}}
- </el-descriptions-item>
- <el-descriptions-item labelClassName="gx_info_label" label="告警开始时间" >
- {{alarmData.time}}
- </el-descriptions-item>
- <el-descriptions-item labelClassName="gx_info_label" label="告警结束时间" >
- {{alarmData.endTime}}
- </el-descriptions-item>
- <el-descriptions-item labelClassName="gx_info_label" label="告警值" >
- {{valueText()}}
- </el-descriptions-item>
- <el-descriptions-item labelClassName="gx_info_label" label="告警内容" >
- {{alarmData.content}}
- </el-descriptions-item>
- </el-descriptions>
- <el-form
- :model="formData"
- :rules="formDataRules"
- size="small"
- ref="form"
- label-position="right"
- label-width="150px"
- label-prefix=":"
- >
- <!-- <el-form-item label="所属机构" prop="orgId">
- {{formData.orgName}}
- </el-form-item> -->
- <el-form-item label="处置类型" prop="doType">
- <el-select
- label="处置类型"
- v-model="formData.doType"
- placeholder="请选择告警处置类型"
- clearable
- style="width: 100%;"
- >
- <el-option
- v-for="dict in dict.type.alarm_deal_type"
- :key="dict.value"
- :label="dict.label"
- :value="parseInt(dict.value)"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="doContent" label="处置内容:">
- <el-input
- v-model="formData.doContent"
- :maxlength="50"
- name="doContent"
- placeholder="请输入处置内容"
- clearable
- />
- </el-form-item>
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="onSubmit">确定</el-button>
- <el-button @click="isShow = false">取消</el-button>
- </div>
- </DialogCom>
- </div>
- </template>
- <script>
- import { mapState, mapMutations, mapGetters } from "vuex";
- import {detail,dealAlarm} from "@/api/iot/alarmRule";
- import { listIdName } from "@/api/system/device";
- export default {
- dicts: ["alarm_deal_type"],
- data() {
- return {
- id: null,
- isShow: false,
- alarmData:null,
- formData: this.reset(),
- formDataRules: {
- doType: [{ required: true, message: "请选择处置类型" }],
- doContent: [{ required: true, message: "请输入处置内容" }],
- },
- };
- },
- props: {},
- watch: {
- // "formData.orgId":{
- // handler(v){
- // console.info("formData.orgId",v)
- // }
- // }
- },
- computed: {
- ...mapGetters(["orgId"]),
- },
- methods: {
- ...mapMutations([]),
- reset() {
- return {
- id: null,
- doType:null,
- doContent:null,
- };
- },
- async refresh(id, other) {
- this.alarmData = id ? (await detail(id)).data : this.reset(other);
- this.formData.id=id;
- },
- async show(id, other = {}) {
- this.id = id;
- await this.refresh(id, other);
- this.isShow = true;
- },
- valueText() {
- if (!this.alarmData || this.alarmData.valueText == null) {
- return ''
- }
- return `${this.alarmData.valueText}${this.alarmData.alarmValue ? this.alarmData.alarmValue : ''}`
- },
- dataTypeText() {
- if (!this.alarmData || this.alarmData.dataType == null) {
- return ''
- }
- if (this.alarmData.dataType == '0') {
- return '动环类告警'
- } else if (this.alarmData.dataType == '1') {
- return '视频类告警'
- } else {
- return '未知'
- }
- },
- // 事件
- onHide() {
- this.$refs.form.resetFields();
- this.formData = this.reset();
- },
- onSubmit() {
- this.$refs.form.validate(async (isValidate) => {
- if (!isValidate) return;
- await dealAlarm(this.formData);
- this.$emit("success");
- this.isShow = false;
- });
- },
- },
- created() {},
- mounted() {},
- components: { },
- };
- </script>
- <style lang="scss" scoped>
- .brand_info {
- .el-form {
- width: 600px;
- padding-top: 40px;
- }
- }
- </style>
|