From cf84543fb205993a0a20e0e420712f6f146cd09d Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 01 八月 2025 11:44:01 +0800
Subject: [PATCH] 故障报修新增hf编码

---
 src/views/mdc/base/AlarmManager.vue |  189 +++++++++++++++++++++++++++++++----------------
 1 files changed, 125 insertions(+), 64 deletions(-)

diff --git a/src/views/mdc/base/AlarmManager.vue b/src/views/mdc/base/AlarmManager.vue
index 2da413e..04620a2 100644
--- a/src/views/mdc/base/AlarmManager.vue
+++ b/src/views/mdc/base/AlarmManager.vue
@@ -7,33 +7,53 @@
         @keyup.enter.native="searchQuery"
       >
         <a-row :gutter="24">
+          <!--<a-col-->
+            <!--:xl="4"-->
+            <!--:lg="4"-->
+            <!--:md="4"-->
+            <!--:sm="24"-->
+          <!--&gt;-->
+            <!--<a-form-item label="璁惧缂栧彿">-->
+              <!--<a-input-->
+                <!--placeholder="璇疯緭鍏ヨ澶囩紪鍙�"-->
+                <!--v-model="queryParam.equipmentId"-->
+              <!--&gt;</a-input>-->
+            <!--</a-form-item>-->
+          <!--</a-col>-->
+          <!--<a-col-->
+            <!--:xl="4"-->
+            <!--:lg="4"-->
+            <!--:md="4"-->
+            <!--:sm="24"-->
+          <!--&gt;-->
+            <!--<a-form-item label="璁惧鍚嶇О">-->
+              <!--<a-input-->
+                <!--placeholder="璇疯緭鍏ヨ澶囧悕绉�"-->
+                <!--v-model="queryParam.equipmentName"-->
+              <!--&gt;</a-input>-->
+            <!--</a-form-item>-->
+          <!--</a-col>-->
           <a-col
-            :xl="4"
-            :lg="4"
-            :md="4"
+            :xl="6"
+            :lg="7"
+            :md="8"
             :sm="24"
           >
-            <a-form-item label="璁惧缂栧彿">
-              <a-input
-                placeholder="璇疯緭鍏ヨ澶囩紪鍙�"
-                v-model="queryParam.equipmentId"
-              ></a-input>
+            <a-form-item label="鎺у埗绯荤粺绫诲瀷">
+              <!--<j-dict-select-tag-->
+                <!--placeholder="璇烽�夋嫨鎺у埗绯荤粺绫诲瀷"-->
+                <!--v-model="queryParam.driveType"-->
+                <!--dictCode="mdc_driveType"-->
+              <!--/>-->
+              <a-auto-complete
+                v-model="queryParam.driveType"
+                :data-source="driveTypeList"
+                placeholder="璇烽�夋嫨鎺у埗绯荤粺绫诲瀷"
+                :filter-option="filterOption"
+                :allowClear="true"
+              />
             </a-form-item>
           </a-col>
-          <a-col
-            :xl="4"
-            :lg="4"
-            :md="4"
-            :sm="24"
-          >
-            <a-form-item label="璁惧鍚嶇О">
-              <a-input
-                placeholder="璇疯緭鍏ヨ澶囧悕绉�"
-                v-model="queryParam.equipmentName"
-              ></a-input>
-            </a-form-item>
-          </a-col>
-
             <a-col
               :xl="4"
               :lg="4"
@@ -53,10 +73,10 @@
               :md="4"
               :sm="24"
             >
-              <a-form-item label="鎶ヨ鎻忚堪">
+              <a-form-item label="鎶ヨ鍐呭">
                 <a-input
-                  placeholder="璇疯緭鍏ユ姤璀︽弿杩�"
-                  v-model="queryParam.alarmDescription"
+                  placeholder="璇疯緭鍏ユ姤璀﹀唴瀹�"
+                  v-model="queryParam.alarmContent"
                 ></a-input>
               </a-form-item>
             </a-col>
@@ -102,12 +122,12 @@
         @click="handleAddTRype"
         type="primary"
         icon="plus"
-      >椹卞姩鏂板</a-button>
-      <a-button
-        @click="handleAdd"
-        type="primary"
-        icon="plus"
-      >璁惧鏂板</a-button>
+      >鏂板</a-button>
+      <!--<a-button-->
+        <!--@click="handleAdd"-->
+        <!--type="primary"-->
+        <!--icon="plus"-->
+      <!--&gt;璁惧鏂板</a-button>-->
       <!--<a-upload-->
         <!--name="file"-->
         <!--:showUploadList="false"-->
@@ -152,7 +172,7 @@
       <a-table
         ref="table"
         size="middle"
-        :scroll="{x:true}"
+        :scroll="{x:'max-content',y:465}"
         bordered
         rowKey="id"
         :columns="columns"
@@ -164,10 +184,9 @@
         @change="handleTableChange"
       >
 
-
         <span
           slot="action"
-          slot-scope="text, record"
+        slot-scope="text, record"
         >
           <a @click="handleEdit(record)">缂栬緫</a>
 
@@ -183,8 +202,8 @@
       </a-table>
     </div>
 
-    <alarm-manager-modal ref="modalForm" @ok="modalFormOk"></alarm-manager-modal>
-    <alarm-manager-form ref="modalFormType" @ok="modalFormOk"></alarm-manager-form>
+    <!--<alarm-manager-modal ref="modalForm" @ok="modalFormOk"></alarm-manager-modal>-->
+    <alarm-manager-form ref="modalFormType" @ok="modalFormOk" :driveTypeList="driveTypeList" :filterOption="filterOption"></alarm-manager-form>
     <alarm-manager-edit ref="modalFormEdit" @ok="modalFormOk"></alarm-manager-edit>
   </a-card>
 </template>
@@ -200,6 +219,7 @@
   import AlarmManagerEdit from './modules/alarmManager/alarmManagerEdit'
   import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
   import { filterObj } from '@/utils/util';
+  import api from '@/api/mdc'
   export default {
     name: 'AlarmManager',
     mixins: [JeecgListMixin, mixinDevice],
@@ -211,6 +231,18 @@
     data() {
       return {
         description: '鎶ヨ鍙风鐞嗙晫闈�',
+        /* 鍒嗛〉鍙傛暟 */
+        ipagination:{
+          current: 1,
+          pageSize: 30,
+          pageSizeOptions: ['30', '50', '100'],
+          showTotal: (total, range) => {
+            return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0
+        },
         // 琛ㄥご
         columns: [
           {
@@ -223,66 +255,78 @@
               return parseInt(index) + 1;
             }
           },
-          {
-            title: '璁惧缂栧彿',
-            align: "center",
-            // sorter: true,
-            dataIndex: 'equipmentId'
-          },
-          {
-            title: '璁惧鍚嶇О',
-            align: "center",
-            // sorter: true,
-            dataIndex: 'equipmentName'
-          },
+          // {
+          //   title: '璁惧缂栧彿',
+          //   align: "center",
+          //   // sorter: true,
+          //   dataIndex: 'equipmentId'
+          // },
+          // {
+          //   title: '璁惧鍚嶇О',
+          //   align: "center",
+          //   // sorter: true,
+          //   dataIndex: 'equipmentName'
+          // },
           {
             title: '鎶ヨ鍙�',
             align: "center",
             // sorter: true,
-            dataIndex: 'alarmCode'
+            dataIndex: 'alarmCode',
+            width:400
           },
           {
-            title: '鎶ヨ鎻忚堪',
+            title: '鎶ヨ鍐呭',
             align: "center",
             // sorter: true,
-            dataIndex: 'alarmDescription'
+            dataIndex: 'alarmContent',
+            width:400
           },
 
           {
             title: '璁惧椹卞姩绫诲瀷',
             align: "center",
             // sorter: true,
-            dataIndex: 'driveType'
+            dataIndex: 'driveType',
+            width:400
           },
+          // {
+          //   title: '鏄惁杩囨护',
+          //   align: "center",
+          //   dataIndex: 'isUse',
+          //   customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isUse'], text) : ''),
+          // },
           {
-            title: '鏄惁杩囨护',
+            dataIndex:'isUse_dictText',
+            title: '鏄惁鍚敤',
             align: "center",
-            dataIndex: 'isUse',
-            customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isUse'], text) : ''),
+            width:380
+           // dictCode:'alarm_is_use'
           },
           {
             title: '鎿嶄綔',
             dataIndex: 'action',
             align: "center",
             fixed: "right",
-            width: 147,
+            width: 150,
             scopedSlots: { customRender: 'action' }
           }
         ],
         url: {
-          list: "/mdc/alarmInfo/page",
-          delete: "/mdc/alarmInfo/delete",
-          deleteBatch: "/mdc/alarmInfo/deleteBatch",
+          list: "/mdc/mdcAlarmInfo/list",
+          delete: "/mdc/mdcAlarmInfo/delete",
+          deleteBatch: "/mdc/mdcAlarmInfo/deleteBatch",
           importExcelUrl: "mdc/mdcDriveTypeParamConfig/importExcel",
 
         },
         dictOptions: {},
         superFieldList: [],
+        driveTypeList:[]
       }
     },
     created() {
-      this.$set(this.dictOptions, 'isUse', [{ text: '鏄�', value: '1' }, { text: '鍚�', value: '2' }])
+      this.$set(this.dictOptions, 'isUse', [{ text: '鏄�', value: '0' }, { text: '鍚�', value: '-1' }])
       this.getSuperFieldList();
+      this.getDriveTypeByApi()
     },
     computed: {
       // importExcelUrl: function () {
@@ -294,7 +338,6 @@
         this.$refs.modalFormEdit.edit(record);
         this.$refs.modalFormEdit.title = "缂栬緫";
         this.$refs.modalFormEdit.disableSubmit = false;
-        this.$refs.modalFormEdit.isUse = record.isUse === '1' ? true : false
       },
       handleAddTRype(){
         this.$refs.modalFormType.add();
@@ -305,11 +348,10 @@
       },
       getSuperFieldList() {
         let fieldList = [];
-        fieldList.push({ type: 'string', value: 'equipmentId', text: '璁惧缂栧彿', dictCode: '' })
         fieldList.push({ type: 'string', value: 'alarmCode', text: '鎶ヨ鍙�', dictCode: '' })
-        fieldList.push({ type: 'string', value: 'alarmDescription', text: '鎶ヨ鎻忚堪', dictCode: '' })
+        fieldList.push({ type: 'string', value: 'alarmDescription', text: '鎶ヨ鍐呭', dictCode: '' })
         fieldList.push({ type: 'int', value: 'driveType', text: '璁惧椹卞姩绫诲瀷', dictCode: '' })
-        fieldList.push({ type: 'switch', value: 'isUse', text: '鏄惁杩囨护' })
+        fieldList.push({ type: 'switch', value: 'isUse', text: '鏄惁鍚敤' })
         this.superFieldList = fieldList
       },
 
@@ -326,6 +368,25 @@
         param.pageSize = this.ipagination.pageSize
         return filterObj(param)
       },
+      /**
+       * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷
+       */
+      getDriveTypeByApi(){
+        api.getDriveTypeApi().then((res)=>{
+          this.driveTypeList=res.result.map(item=>item.value)
+        })
+      },
+      /**
+       * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳�
+       * @param input 杈撳叆鐨勫唴瀹�
+       * @param option 閰嶇疆
+       * @returns {boolean} 鍒ゆ柇鏄惁绛涢��
+       */
+      filterOption(input, option) {
+        return (
+          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
+        );
+      },
 
     }
   }

--
Gitblit v1.9.3