MrShi
2026-01-13 3a154bdb0a5aaa2c0ac3eac95a6ba747068bd454
admin/src/views/business/warningPush.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,161 @@
<template>
  <TableLayout :permissions="['business:warningpush:query']">
    <!-- æœç´¢è¡¨å• -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
      <el-form-item label="报警分类" prop="warningType">
        <el-select v-model="searchForm.warningType" placeholder="请选择" clearable  @change="search">
          <el-option label="安防事件" value="0"></el-option>
          <el-option label="消防事件" value="1"></el-option>
          <el-option label="车载事件" value="2"></el-option>
          <el-option label="钥匙柜事件" value="3"></el-option>
          <el-option label="天气预警" value="4"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="报警标题" prop="title">
        <el-input v-model="searchForm.title" placeholder="请输入报警标题" clearable @keypress.enter.native="search" ></el-input>
      </el-form-item>
      <el-form-item label="报警内容" prop="content">
        <el-input v-model="searchForm.content" placeholder="请输入报警内容" clearable @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="通知人员" prop="content">
        <el-input v-model="searchForm.memberName" placeholder="请输入通知人员" clearable @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="通知状态 " prop="status">
        <el-select v-model="searchForm.status" placeholder="请选择"   clearable @change="search">
          <el-option label="未通知" value="0"></el-option>
          <el-option label="通知成功" value="1"></el-option>
          <el-option label="通知失败" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="发生时间" prop="date">
        <el-date-picker
            v-model="searchForm.queryStarttime"
            type="datetime"
            clearable
            value-format="yyyy-MM-dd HH:mm:ss"
            class="w200"
            placeholder="开始时间" /> è‡³
        <el-date-picker
            v-model="searchForm.queryEndtime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            class="w200"
            clearable
            placeholder="结束时间" />
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button type="primary" :loading="isWorking.export" v-permissions="['business:warningpush:exportExcel']" @click="exportExcel">导出</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
    <template v-slot:table-wrap>
<!--      <ul class="toolbar" v-permissions="['business:warningpush:create', 'business:warningpush:delete']">
        <li><el-button type="primary" @click="$refs.operaWarningPushWindow.open('新建报警推送记录')" icon="el-icon-plus" v-permissions="['business:warningpush:create']">新建</el-button></li>
        <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:warningpush:delete']">删除</el-button></li>
      </ul>-->
      <el-table
        :height="tableHeightNew"
        v-loading="isWorking.search"
        :data="tableData.list"
        stripe
        @selection-change="handleSelectionChange"
      >
         <el-table-column prop="createDate" label="发生时间" min-width="150px"></el-table-column>
        <el-table-column prop="warningName" label="报警类型" min-width="120px" show-tooltip-when-overflow></el-table-column>
        <el-table-column prop="warningType" label="报警分类" min-width="100px">
          <template slot-scope="{row}">
            <span v-if="row.warningType === 0">安防事件</span>
            <span v-if="row.warningType === 1"  >消防事件</span>
            <span v-if="row.warningType === 2"  >车载事件</span>
            <span v-if="row.warningType === 3"  >钥匙柜事件</span>
            <span v-if="row.warningType === 4"  >天气预警</span>
          </template>
        </el-table-column>
        <el-table-column prop="warningLevel" label="报警等级" min-width="100px">
          <template slot-scope="{row}">
            <span v-if="row.warningLevel === 0" class="status-grey">低</span>
            <span v-if="row.warningLevel === 1"  class="status-yellow" >中</span>
            <span v-if="row.warningLevel === 2"  class="status-red">高</span>
          </template>
        </el-table-column>
        <el-table-column prop="region" label="所在位置" min-width="120px" show-tooltip-when-overflow></el-table-column>
        <el-table-column prop="content" label="报警内容" min-width="180px" show-tooltip-when-overflow></el-table-column>
        <el-table-column prop="memberName" label="通知人员" min-width="100px" show-tooltip-when-overflow></el-table-column>
        <el-table-column prop="companyName" label="人员部门" min-width="100px" show-tooltip-when-overflow></el-table-column>
        <el-table-column prop="status" label="通知状态" min-width="100px">
          <template slot-scope="{row}">
            <span style="color: rgba(245, 154, 35, 0.996);" v-if="row.status === 0">未通知</span>
            <span v-if="row.status === 1" style="color: rgba(245, 154, 35, 0.996);">通知成功</span>
            <span v-if="row.status === 2" style="color: rgba(245, 154, 35, 0.996);">同志失败</span>
          </template>
        </el-table-column>
        <el-table-column
          v-if="containPermissions(['business:warningpush:update', 'business:warningpush:delete'])"
          label="操作"
          min-width="120"
          fixed="right"
        >
<!--          <template slot-scope="{row}">
            <el-button type="text" @click="$refs.operaWarningPushWindow.open('编辑报警推送记录', row)" icon="el-icon-edit" v-permissions="['business:warningpush:update']">编辑</el-button>
            <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:warningpush:delete']">删除</el-button>
          </template>-->
        </el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      >
      </pagination>
    </template>
    <!-- æ–°å»º/修改 -->
    <OperaWarningPushWindow ref="operaWarningPushWindow" @success="handlePageChange"/>
  </TableLayout>
</template>
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaWarningPushWindow from '@/components/business/OperaWarningPushWindow'
export default {
  name: 'WarningPush',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaWarningPushWindow },
  data () {
    return {
      // æœç´¢
      searchForm: {
        id: '',
        warningId: '',
        memberName: null,
        warningType: null,
        title: '',
        content: '',
        status: '',
        queryEndtime:null,
        queryStarttime:null
      }
    }
  },
  created () {
    this.config({
      module: '报警推送记录',
      api: '/business/warningPush',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods:{
    reset () {
      this.$refs.searchForm.resetFields()
      this.searchForm.queryStarttime = ''
      this.searchForm.queryEndtime = ''
      this.search()
    }
  }
}
</script>