From ca9ea4595953e62276c4cebc5114b77fdf4a4b66 Mon Sep 17 00:00:00 2001
From: hejianhao <15708179461@qq.com>
Date: 星期四, 29 一月 2026 10:21:45 +0800
Subject: [PATCH] feat(clientInfo, accidentMessageSetting): 为筛选器添加清空功能并支持按事故类型筛选

---
 estate-frontend-v2024/src/views/screenSetting/accidentMessageSetting.jsx |   44 ++++++++++++++++++++++++++++++++++++++++++--
 estate-frontend-v2024/src/views/common/crud-view-base.jsx                |   12 ++++++------
 estate-frontend-v2024/src/views/business/clientInfo.jsx                  |    2 ++
 3 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/estate-frontend-v2024/src/views/business/clientInfo.jsx b/estate-frontend-v2024/src/views/business/clientInfo.jsx
index a6b5be8..32fd0fe 100644
--- a/estate-frontend-v2024/src/views/business/clientInfo.jsx
+++ b/estate-frontend-v2024/src/views/business/clientInfo.jsx
@@ -98,6 +98,7 @@
                             width: 250,
                         }}
                         defaultValue={''}
+                        allowClear
                         onChange={
                             (value) => {
                                 this.handleListBodyChange('clientType', value)
@@ -115,6 +116,7 @@
                             width: 250,
                         }}
                         defaultValue={''}
+                        allowClear
                         onChange={
                             (value) => {
                                 this.handleListBodyChange('creatorId', value)
diff --git a/estate-frontend-v2024/src/views/common/crud-view-base.jsx b/estate-frontend-v2024/src/views/common/crud-view-base.jsx
index 25f5b73..efa26d5 100644
--- a/estate-frontend-v2024/src/views/common/crud-view-base.jsx
+++ b/estate-frontend-v2024/src/views/common/crud-view-base.jsx
@@ -139,7 +139,7 @@
         this.setState(prevState => ({
             listBody: {
                 ...prevState.listBody,
-                [key]: value
+                [key]: value ? value : ''
             }
         }), () => {
             this.reloadEntities()
@@ -161,7 +161,7 @@
 
     // 处理启用禁用实体
     handleEnableDisableEntity = (row) => {
-        
+
     };
 
     // 处理参数设置实体
@@ -288,7 +288,7 @@
 
     // 处理删除实体
     handleDeleteEntity = (rows) => {
-        
+
         // 如果传入的是单个对象,将其放入数组中
         if (!Array.isArray(rows)) {
             rows = [rows];
@@ -296,7 +296,7 @@
 
         const ids = rows.map(row => row.id);
         console.log(ids);
-        
+
         this.deleteEntities({
             ids: ids
         }).then(res => {
@@ -325,7 +325,7 @@
             let formState = this.editFormRef.state
             let action = formState.isEdit ? '编辑' : '添加';
             this.editEntity(formState.editableData, formState.isEdit).then((response) => {
-                
+
                 if (response.data.status === 'OK') {
                     form.resetFields();
                     message.success(action + "成功!")
@@ -388,7 +388,7 @@
         );
     }
 
-      // 渲染参数设置按钮
+    // 渲染参数设置按钮
     renderParameterSettingButton(row, permission = null, disable = false) {
         return (
             <Button title="参数设置" onClick={this.handleParameterSettingEntity.bind(null, row)}
diff --git a/estate-frontend-v2024/src/views/screenSetting/accidentMessageSetting.jsx b/estate-frontend-v2024/src/views/screenSetting/accidentMessageSetting.jsx
index 6232a36..9b98b4d 100644
--- a/estate-frontend-v2024/src/views/screenSetting/accidentMessageSetting.jsx
+++ b/estate-frontend-v2024/src/views/screenSetting/accidentMessageSetting.jsx
@@ -5,7 +5,8 @@
   addAccidentBrief,
   editAccidentBrief,
   deleteAccidentBrief,
-  enableAccidentBrief
+  enableAccidentBrief,
+  getAccidentClassificationList
 } from "@/api/screenSetting";
 import EditAccidentMessageForm from "./forms/edit-accidentMessage-form";
 import "./style/index.less";
@@ -13,21 +14,44 @@
 import moment from "moment";
 
 const { Column } = Table;
+const { Option } = Select;
 const inputLongStyle = {
   padding: "1px 10px",
   width: "250px",
 };
 
 class AccidentMessageSetting extends CrudViewBase {
+  constructor(props) {
+    super(props);
+    this.state = {
+      ...this.state,
+      classificationOptions: []
+    };
+  }
+
+  initView() {
+    this.loadClassificationOptions();
+  }
+
+  loadClassificationOptions = () => {
+    getAccidentClassificationList({ page: 0, size: 9999 }, {}).then(res => {
+      if (res && res.data && res.data.data && res.data.data.records) {
+        this.setState({ classificationOptions: res.data.data.records });
+      }
+    });
+  };
+
   initListBody() {
     return {
       title: "",
+      classifyId: undefined
     };
   }
 
   getEntityList(pageInfo, listBody) {
     const params = {
-      title: listBody.title
+      title: listBody.title,
+      classifyId: listBody.classifyId
     };
     return getAccidentBriefList(pageInfo, params);
   }
@@ -114,6 +138,22 @@
             prefix={<Icon style={{ marginLeft: "4px" }} type="search" />}
             allowClear
           />
+          &nbsp; &nbsp;
+          <Select
+            style={inputLongStyle}
+            placeholder="请选择事故类型"
+            value={this.state.listBody ? this.state.listBody.classifyId : undefined}
+            onChange={(value) => {
+              this.handleListBodyChange("classifyId", value);
+            }}
+            allowClear
+          >
+            {this.state.classificationOptions.map(option => (
+              <Option key={option.id} value={option.id}>
+                {option.name}
+              </Option>
+            ))}
+          </Select>
         </div>
         &nbsp; &nbsp;
         <div className="right">{this.renderAddButton("device:add")}</div>

--
Gitblit v1.7.1