From 3a154bdb0a5aaa2c0ac3eac95a6ba747068bd454 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 13 一月 2026 10:00:37 +0800
Subject: [PATCH] 优化

---
 admin/src/views/business/warningEvent.vue |  144 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 144 insertions(+), 0 deletions(-)

diff --git a/admin/src/views/business/warningEvent.vue b/admin/src/views/business/warningEvent.vue
new file mode 100644
index 0000000..18dc2bf
--- /dev/null
+++ b/admin/src/views/business/warningEvent.vue
@@ -0,0 +1,144 @@
+<template>
+  <TableLayout :permissions="['business:warningevent: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="warningLevel" >
+        <el-select v-model="searchForm.warningLevel" 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="region">
+        <el-input v-model="searchForm.region" placeholder="璇疯緭鍏ユ墍鍦ㄤ綅缃�" @keypress.enter.native="search"></el-input>
+      </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:warningevent:exportExcel']" @click="exportExcel">瀵煎嚭</el-button>
+        <el-button @click="reset">閲嶇疆</el-button>
+      </section>
+    </el-form>
+    <!-- 琛ㄦ牸鍜屽垎椤� -->
+    <template v-slot:table-wrap>
+      <el-table
+          :height="tableHeightNew"
+        v-loading="isWorking.search"
+        :data="tableData.list"
+        stripe
+        @selection-change="handleSelectionChange"
+      >
+<!--        <el-table-column type="selection" width="55"></el-table-column>-->
+        <el-table-column prop="happenTime" label="鍙戠敓鏃堕棿" min-width="100px"></el-table-column>
+        <el-table-column prop="title" label="浜嬩欢绫诲瀷" min-width="100px"></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="100px"></el-table-column>
+        <el-table-column prop="srcName" label="浜嬩欢婧愬悕绉�" min-width="150px" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="eventType" label="浜嬩欢缂栫爜" min-width="100px"></el-table-column>
+        <el-table-column
+          v-if="containPermissions(['business:warningevent:update', 'business:warningevent:delete'])"
+          label="鎿嶄綔"
+          min-width="120"
+          fixed="right"
+        >
+          <template slot-scope="{row}">
+            <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:warningevent:delete']">鍒犻櫎</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        @size-change="handleSizeChange"
+        @current-change="handlePageChange"
+        :pagination="tableData.pagination"
+      >
+      </pagination>
+    </template>
+    <!-- 鏂板缓/淇敼 -->
+    <OperaWarningEventWindow ref="operaWarningEventWindow" @success="handlePageChange"/>
+  </TableLayout>
+</template>
+
+<script>
+import BaseTable from '@/components/base/BaseTable'
+import TableLayout from '@/layouts/TableLayout'
+import Pagination from '@/components/common/Pagination'
+import OperaWarningEventWindow from '@/components/business/OperaWarningEventWindow'
+export default {
+  name: 'WarningEvent',
+  extends: BaseTable,
+  components: { TableLayout, Pagination, OperaWarningEventWindow },
+  data () {
+    return {
+      // 鎼滅储
+      searchForm: {
+        warningType: null,
+        title: '',
+        region: '',
+        eventType: '',
+        warningLevel: '',
+        queryStarttime:null,
+        queryEndtime:null
+      }
+    }
+  },
+  created () {
+    this.config({
+      module: '鎶ヨ浜嬩欢璁板綍鏃ュ織琛�',
+      api: '/business/warningEvent',
+      'field.id': 'id',
+      'field.main': 'id'
+    })
+    this.search()
+  },
+  methods:{
+    reset () {
+      this.$refs.searchForm.resetFields()
+      this.searchForm.queryStarttime = ''
+      this.searchForm.queryEndtime = ''
+      this.search()
+    }
+  }
+}
+</script>

--
Gitblit v1.9.3