瀏覽代碼

feat: 故障诊断/故障诊断结果

wanggaokun 11 月之前
父節點
當前提交
afe8f8848c

+ 71 - 0
src/api/interface/als/faultDiagnosis.ts

@@ -0,0 +1,71 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface FaultDiagnosisVO extends BaseEntity {
+  /**
+   * 架次号
+   */
+  sortieNo: string
+
+  /**
+   * 机号
+   */
+  aircraftNo: string
+
+  /**
+   * 创建人
+   */
+  createBy: number
+
+  /**
+   * 创建时间
+   */
+  createTime: string
+
+  /**
+   * 更新人
+   */
+  updateBy: number
+
+  /**
+   * 更新时间
+   */
+  updateTime: string
+}
+
+export interface FaultDiagnosisForm {
+  /**
+   * 编号
+   */
+  id?: string | number
+
+  /**
+   * 架次号
+   */
+  sortieNo?: string
+
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 状态(1正常)
+   */
+  status?: string
+}
+
+export interface FaultDiagnosisQuery extends PageQuery {
+  /**
+   * 架次号
+   */
+  sortieNo?: string
+
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 96 - 0
src/api/interface/als/faultDiagnosisResult.ts

@@ -0,0 +1,96 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface FaultDiagnosisResultVO extends BaseEntity {
+  /**
+   * 故障诊断编号
+   */
+  diagnosisId: string | number
+
+  /**
+   * 架次号
+   */
+  sortieNo: string
+
+  /**
+   * 机号
+   */
+  aircraftNo: string
+
+  /**
+   * 状态(1正常)
+   */
+  status: string
+
+  /**
+   * 创建人
+   */
+  createBy: number
+
+  /**
+   * 创建时间
+   */
+  createTime: string
+
+  /**
+   * 更新人
+   */
+  updateBy: number
+
+  /**
+   * 更新时间
+   */
+  updateTime: string
+}
+
+export interface FaultDiagnosisResultForm {
+  /**
+   * 编号
+   */
+  id?: string | number
+
+  /**
+   * 故障诊断编号
+   */
+  diagnosisId?: string | number
+
+  /**
+   * 架次号
+   */
+  sortieNo?: string
+
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 状态(1正常)
+   */
+  status?: string
+}
+
+export interface FaultDiagnosisResultQuery extends PageQuery {
+  /**
+   * 故障诊断编号
+   */
+  diagnosisId?: string | number
+
+  /**
+   * 架次号
+   */
+  sortieNo?: string
+
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 状态(1正常)
+   */
+  status?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 54 - 0
src/api/modules/als/faultDiagnosis.ts

@@ -0,0 +1,54 @@
+import http from '@/api'
+import { FaultDiagnosisVO, FaultDiagnosisForm, FaultDiagnosisQuery } from '@/api/interface/als/faultDiagnosis'
+/**
+ * @name 查询故障诊断列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listFaultDiagnosisApi = (query: FaultDiagnosisQuery) => {
+  return http.get<FaultDiagnosisVO[]>('/als/faultDiagnosis/list', query, { loading: true })
+}
+
+/**
+ * @name 查询故障诊断详细
+ * @param id id
+ * @returns returns
+ */
+export const getFaultDiagnosisApi = (id: string | number) => {
+  return http.get<FaultDiagnosisVO>(`/als/faultDiagnosis/${id}`)
+}
+
+/**
+ * @name 新增故障诊断
+ * @param data data
+ * @returns returns
+ */
+export const addFaultDiagnosisApi = (data: FaultDiagnosisForm) => {
+  return http.post<any>('/als/faultDiagnosis', data, { loading: false })
+}
+
+/**
+ * @name 修改故障诊断
+ * @param data data
+ * @returns returns
+ */
+export const updateFaultDiagnosisApi = (data: FaultDiagnosisForm) => {
+  return http.put<any>('/als/faultDiagnosis', data, { loading: false })
+}
+
+/**
+ * @name 删除故障诊断
+ * @param id id
+ * @returns returns
+ */
+export const delFaultDiagnosisApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/als/faultDiagnosis/${id}`)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportFaultDiagnosisApi = (data: any) => {
+  return http.post('/als/faultDiagnosis/export', data)
+}

+ 54 - 0
src/api/modules/als/faultDiagnosisResult.ts

@@ -0,0 +1,54 @@
+import http from '@/api'
+import { FaultDiagnosisResultVO, FaultDiagnosisResultForm, FaultDiagnosisResultQuery } from '@/api/interface/als/faultDiagnosisResult'
+/**
+ * @name 查询故障诊断结果列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listFaultDiagnosisResultApi = (query: FaultDiagnosisResultQuery) => {
+  return http.get<FaultDiagnosisResultVO[]>('/als/faultDiagnosisResult/list', query, { loading: true })
+}
+
+/**
+ * @name 查询故障诊断结果详细
+ * @param id id
+ * @returns returns
+ */
+export const getFaultDiagnosisResultApi = (id: string | number) => {
+  return http.get<FaultDiagnosisResultVO>(`/als/faultDiagnosisResult/${id}`)
+}
+
+/**
+ * @name 新增故障诊断结果
+ * @param data data
+ * @returns returns
+ */
+export const addFaultDiagnosisResultApi = (data: FaultDiagnosisResultForm) => {
+  return http.post<any>('/als/faultDiagnosisResult', data, { loading: false })
+}
+
+/**
+ * @name 修改故障诊断结果
+ * @param data data
+ * @returns returns
+ */
+export const updateFaultDiagnosisResultApi = (data: FaultDiagnosisResultForm) => {
+  return http.put<any>('/als/faultDiagnosisResult', data, { loading: false })
+}
+
+/**
+ * @name 删除故障诊断结果
+ * @param id id
+ * @returns returns
+ */
+export const delFaultDiagnosisResultApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/als/faultDiagnosisResult/${id}`)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportFaultDiagnosisResultApi = (data: any) => {
+  return http.post('/als/faultDiagnosisResult/export', data)
+}

+ 0 - 16
src/api/modules/als/preProcessing.ts

@@ -45,22 +45,6 @@ export const delPreProcessingApi = (id: string | number | Array<string | number>
   return http.delete<any>(`/als/preProcessing/${id}`)
 }
 
-/**
- * @name 下载模板
- * @returns returns
- */
-export const importTemplateApi = () => {
-  return http.downloadPost('/als/preProcessing/importTemplate', {})
-}
-
-/**
- * @name 导入数据
- * @returns returns
- */
-export const importPreProcessingDataApi = (data: any) => {
-  return http.post('/als/preProcessing/importData', data)
-}
-
 /**
  * @name 导出数据
  * @returns returns

+ 164 - 0
src/views/als/faultDiagnosis/index.vue

@@ -0,0 +1,164 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listFaultDiagnosisApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['als:faultDiagnosis:add']" icon="CirclePlus" @click="openDialog(1, '故障诊断新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['als:faultDiagnosis:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['als:faultDiagnosis:remove']"
+          icon="Delete"
+          plain
+          :disabled="!scope.isSelected"
+          @click="batchDelete(scope.selectedListIds)"
+        >
+          批量删除
+        </el-button>
+      </template>
+      <!-- 表格操作 -->
+      <template #operation="scope">
+        <el-button type="primary" link icon="View" v-auth="['als:faultDiagnosis:query']" @click="openDialog(3, '故障诊断查看', scope.row)">
+          查看
+        </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['als:faultDiagnosis:edit']" @click="openDialog(2, '故障诊断编辑', scope.row)">
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['als:faultDiagnosis:remove']" @click="deleteFaultDiagnosis(scope.row)">
+          删除
+        </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
+    <TaskDialog ref="taskDialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="FaultDiagnosis">
+import { useHandleData } from '@/hooks/useHandleData'
+import { ElMessageBox } from 'element-plus'
+import TaskDialog from '@/components/TaskDialog/index.vue'
+import FormDialog from '@/components/FormDialog/index.vue'
+import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
+import {
+  listFaultDiagnosisApi,
+  delFaultDiagnosisApi,
+  addFaultDiagnosisApi,
+  updateFaultDiagnosisApi,
+  exportFaultDiagnosisApi,
+  getFaultDiagnosisApi
+} from '@/api/modules/als/faultDiagnosis'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+// 表单model
+const model = ref({})
+// 删除故障诊断信息
+const deleteFaultDiagnosis = async (params: any) => {
+  await useHandleData(delFaultDiagnosisApi, params.id, '删除【' + params.id + '】故障诊断')
+  proTable.value?.getTableList()
+}
+
+// 批量删除故障诊断信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delFaultDiagnosisApi, ids, '删除所选故障诊断信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+const taskDialogRef = ref<InstanceType<typeof TaskDialog> | null>(null)
+// 导出故障诊断列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出故障诊断数据?', '温馨提示', { type: 'warning' }).then(async () => {
+    exportFaultDiagnosisApi(proTable.value?.searchParam)
+    taskDialogRef.value?.openExportDialog()
+  })
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getFaultDiagnosisApi(row?.id || null)
+  }
+  model.value = type == 1 ? {} : res.data
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    api: type == 1 ? addFaultDiagnosisApi : updateFaultDiagnosisApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  { prop: 'id', label: '编号' },
+  {
+    prop: 'sortieNo',
+    label: '架次号',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'aircraftNo',
+    label: '机号',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'createByName',
+    label: '创建人'
+  },
+  {
+    prop: 'createTime',
+    label: '创建时间'
+  },
+  {
+    prop: 'updateByName',
+    label: '更新人'
+  },
+  {
+    prop: 'updateTime',
+    label: '更新时间'
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '架次号',
+      prop: 'sortieNo',
+      rules: [{ required: true, message: '架次号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入架次号'
+      }
+    },
+    {
+      label: '机号',
+      prop: 'aircraftNo',
+      rules: [{ required: true, message: '机号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机号'
+      }
+    },
+    {
+      label: '状态',
+      prop: 'status',
+      rules: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入状态'
+      }
+    }
+  ]
+}
+</script>

+ 200 - 0
src/views/als/faultDiagnosisResult/index.vue

@@ -0,0 +1,200 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listFaultDiagnosisResultApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['als:faultDiagnosisResult:add']" icon="CirclePlus" @click="openDialog(1, '故障诊断结果新增')">
+          新增
+        </el-button>
+        <el-button type="primary" v-auth="['als:faultDiagnosisResult:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['als:faultDiagnosisResult:remove']"
+          icon="Delete"
+          plain
+          :disabled="!scope.isSelected"
+          @click="batchDelete(scope.selectedListIds)"
+        >
+          批量删除
+        </el-button>
+      </template>
+      <!-- 表格操作 -->
+      <template #operation="scope">
+        <el-button type="primary" link icon="View" v-auth="['als:faultDiagnosisResult:query']" @click="openDialog(3, '故障诊断结果查看', scope.row)">
+          查看
+        </el-button>
+        <el-button
+          type="primary"
+          link
+          icon="EditPen"
+          v-auth="['als:faultDiagnosisResult:edit']"
+          @click="openDialog(2, '故障诊断结果编辑', scope.row)"
+        >
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['als:faultDiagnosisResult:remove']" @click="deleteFaultDiagnosisResult(scope.row)">
+          删除
+        </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
+    <TaskDialog ref="taskDialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="FaultDiagnosisResult">
+import { useHandleData } from '@/hooks/useHandleData'
+import { ElMessageBox } from 'element-plus'
+import TaskDialog from '@/components/TaskDialog/index.vue'
+import FormDialog from '@/components/FormDialog/index.vue'
+import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
+import {
+  listFaultDiagnosisResultApi,
+  delFaultDiagnosisResultApi,
+  addFaultDiagnosisResultApi,
+  updateFaultDiagnosisResultApi,
+  exportFaultDiagnosisResultApi,
+  getFaultDiagnosisResultApi
+} from '@/api/modules/als/faultDiagnosisResult'
+const { proxy } = getCurrentInstance() as ComponentInternalInstance
+const { common_type } = toRefs<any>(proxy?.useDict('common_type'))
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+// 表单model
+const model = ref({})
+// 删除故障诊断结果信息
+const deleteFaultDiagnosisResult = async (params: any) => {
+  await useHandleData(delFaultDiagnosisResultApi, params.id, '删除【' + params.id + '】故障诊断结果')
+  proTable.value?.getTableList()
+}
+
+// 批量删除故障诊断结果信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delFaultDiagnosisResultApi, ids, '删除所选故障诊断结果信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+const taskDialogRef = ref<InstanceType<typeof TaskDialog> | null>(null)
+// 导出故障诊断结果列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出故障诊断结果数据?', '温馨提示', { type: 'warning' }).then(async () => {
+    exportFaultDiagnosisResultApi(proTable.value?.searchParam)
+    taskDialogRef.value?.openExportDialog()
+  })
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getFaultDiagnosisResultApi(row?.id || null)
+  }
+  model.value = type == 1 ? {} : res.data
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    api: type == 1 ? addFaultDiagnosisResultApi : updateFaultDiagnosisResultApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  { prop: 'id', label: '编号' },
+  {
+    prop: 'diagnosisId',
+    label: '故障诊断编号',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'sortieNo',
+    label: '架次号',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'aircraftNo',
+    label: '机号',
+    search: {
+      el: 'input'
+    }
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    tag: true,
+    enum: common_type,
+    search: {
+      el: 'tree-select'
+    }
+  },
+  {
+    prop: 'createByName',
+    label: '创建人'
+  },
+  {
+    prop: 'createTime',
+    label: '创建时间'
+  },
+  {
+    prop: 'updateByName',
+    label: '更新人'
+  },
+  {
+    prop: 'updateTime',
+    label: '更新时间'
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '故障诊断编号',
+      prop: 'diagnosisId',
+      rules: [{ required: true, message: '故障诊断编号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入故障诊断编号'
+      }
+    },
+    {
+      label: '架次号',
+      prop: 'sortieNo',
+      rules: [{ required: true, message: '架次号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入架次号'
+      }
+    },
+    {
+      label: '机号',
+      prop: 'aircraftNo',
+      rules: [{ required: true, message: '机号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机号'
+      }
+    },
+    {
+      label: '状态',
+      prop: 'status',
+      rules: [{ required: true, message: '状态不能为空', trigger: 'change' }],
+      compOptions: {
+        elTagName: 'radio-group',
+        enum: common_type.value,
+        placeholder: '请选择状态'
+      }
+    }
+  ]
+}
+</script>

+ 0 - 17
src/views/als/preProcessing/index.vue

@@ -4,7 +4,6 @@
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
         <el-button type="primary" v-auth="['als:preProcessing:add']" icon="CirclePlus" @click="openDialog(1, '预处理新增')"> 新增 </el-button>
-        <el-button type="primary" v-auth="['als:preProcessing:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
         <el-button type="primary" v-auth="['als:preProcessing:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
@@ -29,7 +28,6 @@
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
-    <ImportExcel ref="dialogRef" />
     <TaskDialog ref="taskDialogRef" />
   </div>
 </template>
@@ -37,7 +35,6 @@
 <script setup lang="tsx" name="PreProcessing">
 import { useHandleData } from '@/hooks/useHandleData'
 import { ElMessageBox } from 'element-plus'
-import ImportExcel from '@/components/ImportExcel/index.vue'
 import TaskDialog from '@/components/TaskDialog/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
@@ -46,8 +43,6 @@ import {
   delPreProcessingApi,
   addPreProcessingApi,
   updatePreProcessingApi,
-  importTemplateApi,
-  importPreProcessingDataApi,
   exportPreProcessingApi,
   getPreProcessingApi
 } from '@/api/modules/als/preProcessing'
@@ -80,18 +75,6 @@ const downloadFile = async () => {
   })
 }
 
-// 批量添加预处理
-const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
-const batchAdd = () => {
-  const params = {
-    title: '预处理',
-    tempApi: importTemplateApi,
-    importApi: importPreProcessingDataApi,
-    getTableList: proTable.value?.getTableList
-  }
-  dialogRef.value?.acceptParams(params)
-}
-
 const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
 // 打开弹框的功能
 const openDialog = async (type: number, title: string, row?: any) => {