浏览代码

feat: 故障案例优化

wanggaokun 10 月之前
父节点
当前提交
54fcb3641b
共有 2 个文件被更改,包括 146 次插入205 次删除
  1. 10 0
      src/utils/websocket.ts
  2. 136 205
      src/views/manage/faultCase/index.vue

+ 10 - 0
src/utils/websocket.ts

@@ -150,6 +150,16 @@ export const websocketOnmessage = () => {
       playSound()
       return
     }
+    if (e.data.indexOf('机载PHM指令') >= 0) {
+      ElNotification({
+        title,
+        message: e.data,
+        type: 'success',
+        duration: 3000
+      })
+      playSound()
+      return
+    }
     useNoticeStore().addNotice({
       message: e.data,
       read: false,

+ 136 - 205
src/views/manage/faultCase/index.vue

@@ -134,123 +134,23 @@ const openDialog = async (type: number, title: string, row?: any) => {
 // 表格配置项
 const columns = reactive<ColumnProps<any>[]>([
   { type: 'selection', fixed: 'left', width: 70 },
-  {
-    prop: 'aircraftType',
-    label: '机型',
-    search: {
-      el: 'input'
-    },
-    width: 100
-  },
-  {
-    prop: 'unitName',
-    label: '单位',
-    width: 100
-  },
   {
     prop: 'itemName',
-    label: '故障名称',
+    label: '故障名称',
     search: {
       el: 'input'
-    },
-    width: 150
-  },
-  {
-    prop: 'specialty',
-    label: '专业',
-    width: 100
+    }
   },
   {
     prop: 'faultPhenomenon',
-    label: '故障现象',
-    search: {
-      el: 'input'
-    },
-    width: 240
-  },
-  {
-    prop: 'engineType',
-    label: '发动机型别',
-    search: {
-      el: 'input'
-    },
-    width: 100
-  },
-  {
-    prop: 'locationFault',
-    label: '故障发生地点',
+    label: '故障状态',
     search: {
       el: 'input'
-    },
-    width: 100
-  },
-  {
-    prop: 'itemType',
-    label: '故障件型别',
-    search: {
-      el: 'input'
-    },
-    width: 100
+    }
   },
   {
     prop: 'occurDate',
-    label: '发生日期',
-    width: 100
-  },
-  {
-    prop: 'systemName',
-    label: '系统',
-    search: {
-      el: 'input'
-    },
-    width: 100
-  },
-  {
-    prop: 'causeFault',
-    label: '故障原因',
-    search: {
-      el: 'input'
-    },
-    width: 200
-  },
-  {
-    prop: 'natureFault',
-    label: '故障性质',
-    search: {
-      el: 'input'
-    },
-    width: 100
-  },
-  {
-    prop: 'methodDetermination',
-    label: '判明方法',
-    search: {
-      el: 'input'
-    },
-    width: 100
-  },
-  {
-    prop: 'methodRectification',
-    label: '排除方法',
-    search: {
-      el: 'input'
-    },
-    width: 100
-  },
-  {
-    prop: 'remarks',
-    label: '备注',
-    width: 100
-  },
-  {
-    prop: 'createBy',
-    label: '创建人',
-    width: 100
-  },
-  {
-    prop: 'updateTime',
-    label: '更新时间',
-    width: 100
+    label: '发生日期'
   },
   { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
 ])
@@ -259,69 +159,22 @@ let itemsOptions: ProForm.ItemsOptions[] = []
 const setItemsOptions = () => {
   itemsOptions = [
     {
-      label: '机型',
-      prop: 'aircraftType',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入机型'
-      }
-    },
-    {
-      label: '单位',
-      prop: 'unitName',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入单位'
-      }
-    },
-    {
-      label: '故障件名称',
+      label: '故障名称',
       prop: 'itemName',
       span: 12,
       compOptions: {
-        placeholder: '请输入故障名称'
+        placeholder: '请输入故障名称'
       }
     },
     {
-      label: '专业',
-      prop: 'specialty',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入专业'
-      }
-    },
-    {
-      label: '故障现象',
+      label: '故障状态',
       prop: 'faultPhenomenon',
       compOptions: {
         type: 'textarea',
-        placeholder: '请输入故障现象'
-      }
-    },
-    {
-      label: '发动机型别',
-      prop: 'engineType',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入发动机型别'
-      }
-    },
-    {
-      label: '故障发生地点',
-      prop: 'locationFault',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入故障发生地点'
-      }
-    },
-    {
-      label: '故障件型别',
-      prop: 'itemType',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入故障件型别'
+        placeholder: '请输入故障状态'
       }
     },
+
     {
       label: '发生日期',
       prop: 'occurDate',
@@ -331,55 +184,133 @@ const setItemsOptions = () => {
         type: 'date',
         placeholder: '请选择发生日期'
       }
-    },
-    {
-      label: '系统',
-      prop: 'systemName',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入系统'
-      }
-    },
-    {
-      label: '故障原因',
-      prop: 'causeFault',
-      compOptions: {
-        type: 'textarea',
-        placeholder: '请输入故障原因'
-      }
-    },
-    {
-      label: '故障性质',
-      prop: 'natureFault',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入故障性质'
-      }
-    },
-    {
-      label: '判明方法',
-      prop: 'methodDetermination',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入判明方法'
-      }
-    },
-    {
-      label: '排除方法',
-      prop: 'methodRectification',
-      span: 12,
-      compOptions: {
-        placeholder: '请输入排除方法'
-      }
-    },
-    {
-      label: '备注',
-      prop: 'remarks',
-      compOptions: {
-        type: 'textarea',
-        placeholder: '请输入备注'
-      }
     }
   ]
 }
+// const setItemsOptions = () => {
+//   itemsOptions = [
+//     {
+//       label: '机型',
+//       prop: 'aircraftType',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入机型'
+//       }
+//     },
+//     {
+//       label: '单位',
+//       prop: 'unitName',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入单位'
+//       }
+//     },
+//     {
+//       label: '故障件名称',
+//       prop: 'itemName',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入故障件名称'
+//       }
+//     },
+//     {
+//       label: '专业',
+//       prop: 'specialty',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入专业'
+//       }
+//     },
+//     {
+//       label: '故障现象',
+//       prop: 'faultPhenomenon',
+//       compOptions: {
+//         type: 'textarea',
+//         placeholder: '请输入故障现象'
+//       }
+//     },
+//     {
+//       label: '发动机型别',
+//       prop: 'engineType',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入发动机型别'
+//       }
+//     },
+//     {
+//       label: '故障发生地点',
+//       prop: 'locationFault',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入故障发生地点'
+//       }
+//     },
+//     {
+//       label: '故障件型别',
+//       prop: 'itemType',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入故障件型别'
+//       }
+//     },
+//     {
+//       label: '发生日期',
+//       prop: 'occurDate',
+//       span: 12,
+//       compOptions: {
+//         elTagName: 'date-picker',
+//         type: 'date',
+//         placeholder: '请选择发生日期'
+//       }
+//     },
+//     {
+//       label: '系统',
+//       prop: 'systemName',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入系统'
+//       }
+//     },
+//     {
+//       label: '故障原因',
+//       prop: 'causeFault',
+//       compOptions: {
+//         type: 'textarea',
+//         placeholder: '请输入故障原因'
+//       }
+//     },
+//     {
+//       label: '故障性质',
+//       prop: 'natureFault',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入故障性质'
+//       }
+//     },
+//     {
+//       label: '判明方法',
+//       prop: 'methodDetermination',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入判明方法'
+//       }
+//     },
+//     {
+//       label: '排除方法',
+//       prop: 'methodRectification',
+//       span: 12,
+//       compOptions: {
+//         placeholder: '请输入排除方法'
+//       }
+//     },
+//     {
+//       label: '备注',
+//       prop: 'remarks',
+//       compOptions: {
+//         type: 'textarea',
+//         placeholder: '请输入备注'
+//       }
+//     }
+//   ]
+// }
 </script>