소스 검색

feat: 基础页面、业务数据管理、质量管理

Rmengdi 9 달 전
부모
커밋
f3d21c7371

+ 1 - 1
.env.development

@@ -6,4 +6,4 @@ ENV = 'development'
 
 VUE_APP_BASE_API ='/api'
 
-VUE_APP_BASE_API_target ='http://127.0.0.1:8080'
+VUE_APP_BASE_API_target ='http://127.0.0.1:8081'

+ 38 - 0
src/api/als/aircraft.js

@@ -24,3 +24,41 @@ export const removeAircraft = async (id) => {
 export const getAircaftTypeAndModelTree = async (data) => {
   return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
 }
+/**
+ * @name 查询机型机号下拉树结构
+ * @returns returns
+ */
+export const treeSelectApi = async () => {
+  return await get('/als/aircraft/tree')
+}
+
+/**
+ * @name 查询机型机号详细
+ * @param id id
+ * @returns returns
+ */
+export const getAircraftApi = (id) => {
+  return http.get(`/als/aircraft/${id}`)
+}
+/**
+ * @name 获取机型列表(不分页)
+ * @param 
+ * "aircaftTypeCode": "",//机种编号
+  "aircaftTypeId": "",//机种id 
+  "queryParam": ""//搜索条件:机型名称/机型编号
+ * @returns returns
+ */
+export const getAircaftModelAll = async (data) => {
+  return await post('/basicdata/aircaftModel/getAircaftModelAll', data)
+}
+
+/**
+ * @name 获取飞机编目列表(不分页)
+ * @param 
+ *  "keyWord": "",//搜索条件字段:飞机编号/厂家/出厂编号
+  "aircaftModelIdList": [ ]//选中的机型ID集合
+ * @returns returns
+ */
+export const getAircaftCatalogAll = async (data) => {
+  return await post('/basicdata/aircaftCatalog/getAircaftCatalogAll', data)
+}

+ 5 - 0
src/api/als/dataImport.js

@@ -24,3 +24,8 @@ export const removeDataImport = async (id) => {
 export const getAircaftTypeAndModelTree = async (data) => {
   return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
 }
+
+// 导出下载数据
+// export const exportDownApi = (data) => {
+//   return http.downloadPost('/system/user/export', data, { loading: false })
+// }

+ 26 - 0
src/api/als/maintenanceRecord.js

@@ -0,0 +1,26 @@
+import { get, put, post, deletes } from '@/http/index'
+
+// 查询维修记录列表
+export const getMaintenanceRecord = async (data) => {
+  return await get('/als/maintenanceRecord/list', data)
+}
+
+// 新增维修记录
+export const addMaintenanceRecord = async (data) => {
+  return await post('/als/maintenanceRecord', data)
+}
+
+// 修改维修记录
+export const updateMaintenanceRecord = async (data) => {
+  return await put('/als/maintenanceRecord', data)
+}
+
+// 删除维修记录
+export const removeMaintenanceRecord = async (id) => {
+  return await deletes('/als/maintenanceRecord/' + id)
+}
+
+//  获取机种和机型树
+export const getAircaftTypeAndModelTree = async (data) => {
+  return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
+}

+ 0 - 26
src/api/als/repairRecord.js

@@ -1,26 +0,0 @@
-import { get, put, post, deletes } from '@/http/index'
-
-// 查询维修记录列表
-export const getRepairRecord = async (data) => {
-  return await get('/als/repairRecord/list', data)
-}
-
-// 新增维修记录
-export const addRepairRecord = async (data) => {
-  return await post('/als/repairRecord', data)
-}
-
-// 修改维修记录
-export const updateRepairRecord = async (data) => {
-  return await put('/als/repairRecord', data)
-}
-
-// 删除维修记录
-export const removeRepairRecord = async (id) => {
-  return await deletes('/als/repairRecord/' + id)
-}
-
-//  获取机种和机型树
-export const getAircaftTypeAndModelTree = async (data) => {
-  return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
-}

+ 15 - 0
src/api/als/sideTree.js

@@ -0,0 +1,15 @@
+import { get } from '@/http/index'
+//  获取机种树
+export const getAircaftTypeTree = async (data) => {
+  return await get('/basicdata/aircaftType/getAircaftTypeTree', data)
+}
+
+//  获取机型树
+export const getAircaftTypeAndModelTree = async (data) => {
+  return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
+}
+
+//  获取编目树
+export const getAircaftCatalogTree = async (data) => {
+  return await get('/basicdata/aircaftCatalog/getAircaftCatalogTree', data)
+}

+ 84 - 1
src/http/axios.js

@@ -95,8 +95,91 @@ const myAxios = (axiosConfig, scustomOptions, loadingOptions) => {
 
   return service(axiosConfig)
 }
+const newAxios = (axiosConfig, scustomOptions, loadingOptions) => {
+  const service = axios.create({
+    baseURL: '/als',
+    timeout: 1000000
+  })
 
-export default myAxios
+  // 自定义配置
+  let customOptions = Object.assign(
+    {
+      repeatRequestCancel: true, // 是否开启取消重复请求, 默认为 true
+      loading: false, // 是否开启loading层效果, 默认为false
+      reductDataFormat: true, // 是否开启简洁的数据结构响应, 默认为true
+      errorMessageShow: true, // 是否开启接口错误信息展示,默认为true
+      codeMessageShow: true // 是否开启code不为0时的信息提示, 默认为false
+    },
+    scustomOptions
+  )
+
+  // 请求拦截
+  service.interceptors.request.use(
+    (config) => {
+      removePending(config)
+      customOptions.repeatRequestCancel && addPending(config)
+      // 创建loading实例
+      if (customOptions.loading) {
+        loadingInstance.count++
+        if (loadingInstance.count === 1) {
+          loadingInstance.target = Loading.service(loadingOptions)
+        }
+      }
+      // 自动携带token
+      if (getItem('token')) {
+        // 主动处理登录超时
+        if (isCheckTimeout()) {
+          store.dispatch('user/loginOut')
+          Message({
+            type: 'error',
+            message: '登录超时'
+          })
+        }
+        config.headers.Authorization = getItem('token')
+      }
+
+      return config
+    },
+    (error) => {
+      return Promise.reject(error)
+    }
+  )
+
+  // 响应拦截
+  service.interceptors.response.use(
+    (response) => {
+      removePending(response.config)
+      customOptions.loading && closeLoading(customOptions) // 关闭loading
+      // 处理流文件
+      if (response.request.responseType == 'blob') {
+        const { data, status, headers } = response
+        return { data, headers }
+      }
+
+      if (customOptions.codeMessageShow && response.data && response.data.code != 200) {
+        Message({
+          type: 'error',
+          message: response.data.message || response.data.msg
+        })
+        if (response.data.code == 401) {
+          store.dispatch('user/loginOut')
+        }
+        return Promise.reject(response.data) // code不等于200, 页面具体逻辑就不执行了
+      }
+
+      return customOptions.reductDataFormat ? response.data : response
+    },
+    (error) => {
+      error.config && removePending(error.config)
+      customOptions.loading && closeLoading(customOptions) // 关闭loading
+      customOptions.errorMessageShow && httpErrorStatusHandle(error) // 处理错误状态码
+      return Promise.reject(error)
+    }
+  )
+
+  return service(axiosConfig)
+}
+export { myAxios, newAxios }
 
 /**
  * 处理异常

+ 71 - 11
src/http/index.js

@@ -1,5 +1,4 @@
-import myAxios from './axios'
-
+import { myAxios, newAxios } from './axios'
 /**
  * post方法,对应post请求
  * @param {String} url [请求的url地址]
@@ -7,7 +6,14 @@ import myAxios from './axios'
  */
 
 export function getFile(url, formData) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+
+  return axiosInstance({
     url: url,
     method: 'get',
     params: formData,
@@ -19,7 +25,13 @@ export function getFile(url, formData) {
 }
 
 export function postFile(url, formData) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+  return axiosInstance({
     url: url,
     method: 'post',
     data: formData,
@@ -31,7 +43,13 @@ export function postFile(url, formData) {
 }
 
 export function post(url, formData) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+  return axiosInstance({
     url: url,
     method: 'post',
     data: formData,
@@ -42,7 +60,13 @@ export function post(url, formData) {
 }
 
 export function getPost(url, formData) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+  return axiosInstance({
     url: url,
     method: 'post',
     params: formData,
@@ -53,7 +77,13 @@ export function getPost(url, formData) {
 }
 
 export function parmasPost(url, formData) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+  return axiosInstance({
     url: url,
     method: 'post',
     params: formData
@@ -66,20 +96,38 @@ export function parmasPost(url, formData) {
  * @param {Object} params [请求时携带的参数]
  */
 export function get(url, parameter) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+  return axiosInstance({
     url: url,
     method: 'get',
     params: parameter
   })
 }
 export function upost(url, formData) {
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
   return myAxios({
     url: url + formData,
     method: 'post'
   })
 }
 export function uget(url, parameter) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+  return axiosInstance({
     url: url + parameter,
     method: 'get'
   })
@@ -91,7 +139,13 @@ export function uget(url, parameter) {
  * @param {Object} params [请求时携带的参数]
  */
 export function deletes(url, data) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+  return axiosInstance({
     url: url,
     method: 'delete',
     data: data
@@ -104,7 +158,13 @@ export function deletes(url, data) {
  * @param {Object} data [请求时携带的参数]
  */
 export function put(url, data) {
-  return myAxios({
+  let axiosInstance = null
+  if (url.indexOf('/als') === -1) {
+    axiosInstance = myAxios
+  } else {
+    axiosInstance = newAxios
+  }
+  return axiosInstance({
     url: url,
     method: 'put',
     data: data

+ 4 - 0
src/main.js

@@ -11,6 +11,8 @@ import 'element-ui/lib/theme-chalk/index.css'
 import '@/assets/font/iconfont.css'
 import './pemission'
 import { resolveBlob } from '@/utils'
+// 文件上传组件
+import FileUpload from '@/views/als/components/FileUpload'
 
 // 全局设置消息框 点击屏幕外部不能关闭
 ElementUI.MessageBox.setDefaults({ closeOnClickModal: false })
@@ -45,6 +47,8 @@ Vue.prototype.$resolveBlob = resolveBlob
 
 Vue.prototype.resetForm = resetForm
 Vue.prototype.popupduration = popupduration
+
+Vue.component('FileUpload', FileUpload)
 Vue.use(ElementUI)
 Vue.use(dataV)
 

+ 12 - 11
src/router/modules/als/dataManage.js

@@ -14,7 +14,8 @@ export const flightData = {
       path: '/dataManage/flightData',
       component: () => import('@/views/als/flightData/index.vue'),
       meta: {
-        title: '飞参数据'
+        title: '飞参数据',
+        noCache: true
       }
     }
   ]
@@ -76,10 +77,10 @@ export const maintainRecord = {
     }
   ]
 }
-export const repairRecord = {
+export const maintenanceRecord = {
   path: '/dataManage',
-  redirect: '/dataManage/repairRecord',
-  name: 'RepairRecord',
+  redirect: '/dataManage/maintenanceRecord',
+  name: 'MaintenanceRecord',
   component: Layout,
   meta: {
     title: '业务数据管理',
@@ -87,8 +88,8 @@ export const repairRecord = {
   },
   children: [
     {
-      path: '/dataManage/repairRecord',
-      component: () => import('@/views/als/repairRecord/index.vue'),
+      path: '/dataManage/maintenanceRecord',
+      component: () => import('@/views/als/maintenanceRecord/index.vue'),
       meta: {
         title: '维修记录'
       }
@@ -114,10 +115,10 @@ export const partReplacement = {
     }
   ]
 }
-export const dataAircraftConfiguration = {
+export const airConfiguration = {
   path: '/dataManage',
-  redirect: '/dataManage/dataAircraftConfiguration',
-  name: 'DataAircraftConfiguration',
+  redirect: '/dataManage/airConfiguration',
+  name: 'AirConfiguration',
   component: Layout,
   meta: {
     title: '业务数据管理',
@@ -125,8 +126,8 @@ export const dataAircraftConfiguration = {
   },
   children: [
     {
-      path: '/dataManage/dataAircraftConfiguration',
-      component: () => import('@/views/als/dataAircraftConfiguration/index.vue'),
+      path: '/dataManage/airConfiguration',
+      component: () => import('@/views/als/airConfiguration/index.vue'),
       meta: {
         title: '构型管理'
       }

+ 7 - 0
src/router/modules/als/qualityManage.js

@@ -16,6 +16,13 @@ export const preProcessing = {
       meta: {
         title: '数据预处理'
       }
+      // children: [
+      //   {
+      //     path: '/qualityManage/preProcessing/preResult',
+      //     component: () => import('@/views/als/preProcessing/preResult.vue'),
+      //     hidden: true
+      //   }
+      // ]
     }
   ]
 }

+ 16 - 0
src/router/public-routes.js

@@ -36,5 +36,21 @@ export const publicRoutes = [
         component: () => import('@/views/err-page/401.vue')
       }
     ]
+  },
+  {
+    path: '/preResult',
+    redirect: '/qualityManage/preProcessing/preResult',
+    name: 'preProcessResult',
+    component: Layout,
+    children: [
+      {
+        path: '/qualityManage/preProcessing/preResult',
+        component: () => import('@/views/als/preProcessing/preResult.vue'),
+        name: 'PreResult',
+        meta: {
+          title: '预处理结果'
+        }
+      }
+    ]
   }
 ]

+ 390 - 6
src/views/als/MDCData/index.vue

@@ -1,17 +1,401 @@
 <template>
-  <div class="view-MDCData">总线数据</div>
+  <div class="view-table-content">
+    <div class="view-dataSpecies-left">
+      <MenuTree :currentNodeKey="currentNodeKey" nodeKey="id" :treedata="menuTreeData" @TreeNodeclick="treeNodeClick" v-bind="treeObj"> </MenuTree>
+    </div>
+    <div class="view-dataSpecies-right">
+      <div class="view-dataType-title">
+        <div class="view-dataType-title-btn">
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
+          <el-button type="primary">导入</el-button>
+          <el-button type="primary" @click="downloadFile">导出</el-button>
+        </div>
+        <div class="view-dataType-title-search">
+          <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          </el-input>
+        </div>
+      </div>
+      <div class="view-dataType-table">
+        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
+      </div>
+      <!-- 添加或修改飞参数据信息对话框 -->
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
+        <el-form ref="form" :model="form" label-width="80px">
+          <!-- <el-form-item label="文件编号" prop="ossId">
+            <el-input v-model="form.ossId" placeholder="请输入文件编号" />
+          </el-form-item> -->
+          <el-form-item label="数据源" prop="source">
+            <el-input v-model="form.source" placeholder="请输入数据源" disabled />
+          </el-form-item>
+          <el-form-item label="机型" prop="aircaftModel">
+            <el-select v-model="form.aircaftModel" placeholder="请选择机型" disabled>
+              <el-option v-for="item in aircaftModelAll" :key="item.aircaftModelId" :label="item.aircaftModelName" :value="item.aircaftModelId"> </el-option>
+            </el-select>
+          </el-form-item>
+          <!-- 编目 = 机号 -->
+          <el-form-item label="编目" prop="aircraftId">
+            <el-select v-model="form.aircraftId" placeholder="请选择编目" disabled>
+              <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="架次号" prop="sortieNo">
+            <el-input v-model="form.sortieNo" placeholder="请输入架次号" />
+          </el-form-item>
+          <el-form-item label="飞行日期" prop="flightDate">
+            <el-date-picker v-model="form.flightDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择飞行日期"> </el-date-picker>
+            <!-- <el-date-picker v-model="form.flightDate" type="datetime" value-format="YYYY-MM-DD HH:MM:SS" placeholder="请选择飞行日期"> </el-date-picker> -->
+          </el-form-item>
+          <el-form-item label="数据导入" prop="ossId">
+            <FileUpload :fileSize="500" :fileType="['xls', 'xlsx']" />
+          </el-form-item>
+        </el-form>
+
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose">取 消</el-button>
+          <el-button type="primary" @click="submit">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
+  </div>
 </template>
 
 <script>
+import { getDataImport, addDataImport, updateDataImport, removeDataImport } from '@/api/als/dataImport'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
+import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'MDCData',
+  components: {},
   data() {
-    return {}
+    // 这里存放数据
+    return {
+      dialogTitle: '新增',
+      dialogVisible: false,
+      keyWordData: '',
+      aircaftModelIdList: [],
+      currentNodeKey: '',
+      currentNode: {},
+      menuTreeData: [],
+      treeObj: {
+        title: '所属机种',
+        activityheight: '275px',
+        searchIcon: false,
+        configure: {
+          children: 'children',
+          label: 'label'
+        }
+      },
+      typeTree: {
+        children: 'children',
+        label: 'label'
+      },
+      searchValue: '',
+      columns: [
+        { prop: 'id', label: '唯一编号' },
+        {
+          prop: 'ossId',
+          label: '文件编号'
+        },
+
+        {
+          prop: 'source',
+          label: '数据源'
+        },
+        {
+          prop: 'aircraftId',
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
+        },
+        {
+          prop: 'sortieNo',
+          label: '架次号'
+        },
+        {
+          prop: 'flightDate',
+          label: '飞行日期'
+        },
+        {
+          prop: 'status',
+          label: '状态'
+        },
+        {
+          button: true,
+          label: '操作',
+          width: '240px',
+          group: [
+            {
+              name: '编辑',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.handUpdate(row)
+              }
+            },
+            {
+              name: '删除',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.remove([row])
+              }
+            }
+          ]
+        }
+      ],
+      options: {
+        stripe: true, // 斑马纹
+        mutiSelect: true, // 多选框
+        index: false, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: 'calc(100vh - 300px)'
+      },
+      tableCheckItems: [],
+      tableData: [],
+      tableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      form: {
+        id: '',
+        ossId: '',
+        source: '2',
+        aircaftModel: '',
+        aircraftId: '',
+        sortieNo: '',
+        flightDate: '',
+        status: '',
+        tenantId: '',
+        version: '',
+        delFlag: '',
+        createBy: '',
+        createTime: '',
+        updateBy: '',
+        updateTime: ''
+      },
+      debounceFn: debounce(this.fetch, 500),
+      aircaftModelAll: [],
+      aircaftCatalogAll: []
+    }
+  },
+  watch: {
+    keyWord() {
+      this.tableRequset.pageIndex = 1
+      this.debounceFn()
+    }
   },
-  watch: {},
-  created() {},
-  methods: {}
+  mounted() {
+    this.getAircaftCatalogTreeAPI()
+  },
+  methods: {
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
+      this.menuTreeData = data
+      const getAircaftModelAllParams = {
+        aircaftTypeCode: '',
+        aircaftTypeId: '',
+        queryParam: ''
+      }
+      const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
+      this.aircaftModelAll = data1
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
+      if (data.length) {
+        this.currentNodeKey = data[0].value
+        this.currentNode = data[0]
+        this.getDataImportAPI()
+      }
+    },
+
+    async removeDataImportAPI(params) {
+      try {
+        const { code } = await removeDataImport(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          await this.getDataImportAPI(this.currentNodeKey === 'quanbu' ? null : this.currentNodeKey)
+          this.handleClose()
+        }
+      } catch (error) {}
+    },
+
+    getTreeLeafData(list) {
+      const newArr = []
+      function getLeaf(data, arr) {
+        data.forEach((e) => {
+          if (e.type === 1) {
+            arr.push(e)
+          }
+          if (e.children.length) {
+            getLeaf(e.children, arr)
+          }
+        })
+      }
+      getLeaf(list, newArr)
+      return newArr
+    },
+
+    async getDataImportAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, totalCount }
+      } = await getDataImport({ pageSize, pageIndex, aircraftId: params, source: 2 })
+      this.tableData = list
+      this.tableRequset.total = totalCount
+    },
+
+    fetch() {
+      this.getDataImportAPI(this.currentNodeKey)
+    },
+
+    async searchClick() {
+      if (this.keyWordData) {
+        const {
+          data: { list, totalCount }
+        } = await getDataImport({ aircraftId: this.currentNodeKey, sortieNo: this.keyWordData, source: 2 })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getDataImportAPI(this.currentNodeKey)
+      }
+    },
+
+    async addDataImportAPI() {
+      try {
+        delete this.form.aircaftModelName
+        const { code } = await addDataImport({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.getDataImportAPI(this.currentNodeKey)
+        }
+      } catch (error) {}
+    },
+
+    async updateDataImportAPI() {
+      try {
+        const { code } = await updateDataImport({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.getDataImportAPI(this.currentNodeKey)
+        }
+      } catch (error) {}
+    },
+
+    treeNodeClick(data) {
+      this.$refs.table.clearSelection()
+      this.currentNodeKey = this.form.aircraftId = data.id
+      this.currentNode = data
+      this.form.aircaftModel = data.parentId
+      this.getDataImportAPI(this.currentNodeKey)
+    },
+
+    openDialog() {
+      this.dialogTitle = '新增'
+      this.dialogVisible = true
+      this.form.aircraftId = this.currentNodeKey
+      this.form.aircaftModel = this.currentNode.parentId
+    },
+
+    handleClose() {
+      this.dialogVisible = false
+      this.form = {
+        id: '',
+        ossId: '',
+        source: '2',
+        aircaftModel: '',
+        sortieNo: '',
+        aircraftId: '',
+        flightDate: '',
+        status: '',
+        tenantId: '',
+        version: '',
+        delFlag: '',
+        createBy: '',
+        createTime: '',
+        updateBy: '',
+        updateTime: ''
+      }
+    },
+
+    handUpdate(row) {
+      this.dialogTitle = '编辑'
+      this.form = deepClone(row)
+      this.dialogVisible = true
+    },
+
+    submit() {
+      switch (this.dialogTitle) {
+        case '编辑':
+          this.updateDataImportAPI()
+          this.handleClose()
+          break
+        case '新增':
+          this.addDataImportAPI()
+          this.handleClose()
+          break
+      }
+    },
+
+    selection(val) {
+      this.tableCheckItems = val
+    },
+
+    remove(row) {
+      this.$confirm('是否删除该机种', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeDataImportAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    },
+    async downloadFile() {
+      this.$confirm('确认导出飞参数据?', '温馨提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          //       exportDownApi(proTable.value?.searchParam)
+          // taskDialogRef.value?.openExportDialog()
+        })
+        .catch(() => {})
+    }
+  }
 }
 </script>
 
-<style lang="scss"></style>
+<style lang="scss" scoped>
+@import '../index.scss';
+</style>

+ 28 - 28
src/views/als/airConfiguration/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.parentId == 0">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
           <el-button type="primary">导入模板</el-button>
           <el-button type="primary">导出模板</el-button>
@@ -41,7 +41,7 @@
           <el-form-item label="描述" prop="remarks">
             <el-input v-model="form.remarks" placeholder="请输入描述" />
           </el-form-item>
-          <el-form-item label="创建人" prop="createdBy">
+          <!-- <el-form-item label="创建人" prop="createdBy">
             <el-input v-model="form.createdBy" placeholder="请输入创建人" />
           </el-form-item>
           <el-form-item label="创建时间" prop="createdTime">
@@ -52,7 +52,7 @@
           </el-form-item>
           <el-form-item label="更新时间" prop="updatedTime">
             <el-date-picker clearable v-model="form.updatedTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择更新时间"> </el-date-picker>
-          </el-form-item>
+          </el-form-item> -->
         </el-form>
 
         <span slot="footer" class="dialog-footer">
@@ -65,7 +65,8 @@
 </template>
 
 <script>
-import { getAirConfiguration, getAircaftTypeAndModelTree, addAirConfiguration, updateAirConfiguration, removeAirConfiguration } from '@/api/als/airConfiguration'
+import { getAirConfiguration, addAirConfiguration, updateAirConfiguration, removeAirConfiguration } from '@/api/als/airConfiguration'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'AirConfiguration',
@@ -77,8 +78,8 @@ export default {
       dialogVisible: false,
       keyWord: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -210,29 +211,28 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
+    async getAircaftCatalogTreeAPI(params) {
       const { data } = await getAircaftTypeAndModelTree(params)
       this.menuTreeData = data
       if (data.length) {
-        this.currentNodeKey = data[0].value
+        this.currentNodeKey = data[0].id
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getAirConfigurationAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        this.getAirConfigurationAPI()
       }
     },
 
     async removeAirConfigurationAPI(params) {
       try {
-        const { success } = await removeAirConfiguration(params)
-        if (success) {
+        const { code } = await removeAirConfiguration(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getAirConfigurationAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getAirConfigurationAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -260,59 +260,59 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getAirConfiguration({ pageSize, pageIndex, keyWord, ...params })
+      } = await getAirConfiguration({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getAirConfigurationAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getAirConfigurationAPI(this.currentNodeKey)
     },
 
     searchClick() {
-      this.getAirConfigurationAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getAirConfigurationAPI(this.currentNodeKey)
     },
 
     async addAirConfigurationAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addAirConfiguration({ ...this.form })
-        if (success) {
+        const { code } = await addAirConfiguration({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getAirConfigurationAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getAirConfigurationAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     async updateAirConfigurationAPI() {
       try {
-        const { success } = await updateAirConfiguration({ ...this.form })
-        if (success) {
+        const { code } = await updateAirConfiguration({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getAirConfigurationAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getAirConfigurationAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
+      this.currentNodeKey = this.form.aircraftId = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getAirConfigurationAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.form.aircraftType = data.label
+      this.getAirConfigurationAPI(this.currentNodeKey)
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircaftModelName = this.currentNode.label
-      this.form.aircaftModelId = this.currentNode.id
+      this.form.aircraftId = this.currentNodeKey
+      this.form.aircraftType = this.currentNode.label
     },
 
     handleClose() {

+ 38 - 45
src/views/als/airInstall/index.vue

@@ -6,10 +6,10 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
+          <el-button type="primary">导入</el-button>
+          <el-button type="primary">导出</el-button>
         </div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
@@ -42,32 +42,24 @@
             <el-input v-model="form.quantity" placeholder="请输入装机数量" />
           </el-form-item>
           <el-form-item label="装机时间" prop="installTime">
-            <el-input v-model="form.installTime" placeholder="请输入装机时间" />
+            <!-- <el-input v-model="form.installTime" placeholder="请输入装机时间" /> -->
+            <el-date-picker v-model="form.installTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择装机时间"></el-date-picker>
           </el-form-item>
           <el-form-item label="是否可修" prop="repairable">
-            <el-input v-model="form.repairable" placeholder="请输入是否可修" />
+            <el-radio v-model="form.repairable" label="0">否</el-radio>
+            <el-radio v-model="form.repairable" label="1">是</el-radio>
           </el-form-item>
           <el-form-item label="是否成套" prop="completeSet">
-            <el-input v-model="form.completeSet" placeholder="请输入是否成套" />
+            <el-radio v-model="form.completeSet" label="0">否</el-radio>
+            <el-radio v-model="form.completeSet" label="1">是</el-radio>
           </el-form-item>
           <el-form-item label="是否有寿" prop="serviceLife">
-            <el-input v-model="form.serviceLife" placeholder="请输入是否有寿" />
+            <el-radio v-model="form.serviceLife" label="0">否</el-radio>
+            <el-radio v-model="form.serviceLife" label="1">是</el-radio>
           </el-form-item>
           <el-form-item label="备注" prop="remarks">
             <el-input v-model="form.remarks" placeholder="请输入备注" />
           </el-form-item>
-          <el-form-item label="创建人" prop="createdBy">
-            <el-input v-model="form.createdBy" placeholder="请输入创建人" />
-          </el-form-item>
-          <el-form-item label="创建时间" prop="createdTime">
-            <el-date-picker clearable v-model="form.createdTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择创建时间"> </el-date-picker>
-          </el-form-item>
-          <el-form-item label="更新人" prop="updatedBy">
-            <el-input v-model="form.updatedBy" placeholder="请输入更新人" />
-          </el-form-item>
-          <el-form-item label="更新时间" prop="updatedTime">
-            <el-date-picker clearable v-model="form.updatedTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择更新时间"> </el-date-picker>
-          </el-form-item>
         </el-form>
 
         <span slot="footer" class="dialog-footer">
@@ -80,7 +72,9 @@
 </template>
 
 <script>
-import { getAirInstall, getAircaftTypeAndModelTree, addAirInstall, updateAirInstall, removeAirInstall } from '@/api/als/airInstall'
+import { getAirInstall, addAirInstall, updateAirInstall, removeAirInstall } from '@/api/als/airInstall'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'AirInstall',
@@ -92,8 +86,8 @@ export default {
       dialogVisible: false,
       keyWord: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -223,9 +217,9 @@ export default {
         category: '',
         quantity: '',
         installTime: '',
-        repairable: '',
-        completeSet: '',
-        serviceLife: '',
+        repairable: '0',
+        completeSet: '0',
+        serviceLife: '0',
         remarks: '',
         tenantId: '',
         delFlag: '',
@@ -245,17 +239,16 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
       if (data.length) {
-        this.currentNodeKey = data[0].value
+        this.currentNodeKey = data[0].id
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getAirInstallAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        this.getAirInstallAPI()
       }
     },
 
@@ -267,7 +260,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          await this.getAirInstallAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getAirInstallAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -295,17 +288,17 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getAirInstall({ pageSize, pageIndex, keyWord, ...params })
+      } = await getAirInstall({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getAirInstallAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getAirInstallAPI(this.currentNodeKey)
     },
 
     searchClick() {
-      this.getAirInstallAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getAirInstallAPI(this.currentNodeKey)
     },
 
     async addAirInstallAPI() {
@@ -317,7 +310,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getAirInstallAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getAirInstallAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
@@ -330,24 +323,24 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getAirInstallAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getAirInstallAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
+      this.currentNodeKey = this.form.aircraftId = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getAirInstallAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.form.aircraftType = data.label
+      this.getAirInstallAPI(this.currentNodeKey)
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircaftModelName = this.currentNode.label
-      this.form.aircaftModelId = this.currentNode.id
+      this.form.aircraftId = this.currentNodeKey
+      this.form.aircraftType = this.currentNode.label
     },
 
     handleClose() {
@@ -361,9 +354,9 @@ export default {
         category: '',
         quantity: '',
         installTime: '',
-        repairable: '',
-        completeSet: '',
-        serviceLife: '',
+        repairable: '0',
+        completeSet: '0',
+        serviceLife: '0',
         remarks: '',
         tenantId: '',
         delFlag: '',

+ 241 - 0
src/views/als/components/FileUpload/index.vue

@@ -0,0 +1,241 @@
+<template>
+  <div class="upload-file">
+    <el-upload
+      multiple
+      :action="uploadFileUrl"
+      :before-upload="handleBeforeUpload"
+      :file-list="fileList"
+      :limit="limit"
+      :on-error="handleUploadError"
+      :on-exceed="handleExceed"
+      :on-success="handleUploadSuccess"
+      :show-file-list="false"
+      :headers="headers"
+      class="upload-file-uploader"
+      ref="fileUpload"
+    >
+      <!-- 上传按钮 -->
+      <el-button size="mini" type="primary">选取文件</el-button>
+      <!-- 上传提示 -->
+      <div class="el-upload__tip" slot="tip" v-if="showTip">
+        请上传
+        <template v-if="fileSize">
+          大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
+        </template>
+        <template v-if="fileType">
+          格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
+        </template>
+        的文件
+      </div>
+    </el-upload>
+
+    <!-- 文件列表 -->
+    <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
+      <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
+        <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
+          <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
+        </el-link>
+        <div class="ele-upload-list__item-content-action">
+          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+        </div>
+      </li>
+    </transition-group>
+  </div>
+</template>
+
+<script>
+import { getToken } from '@/utils/auth'
+import { getItem } from '@/utils/index'
+
+export default {
+  name: 'FileUpload',
+  props: {
+    // 值
+    value: [String, Object, Array],
+    // 数量限制
+    limit: {
+      type: Number,
+      default: 5
+    },
+    // 大小限制(MB)
+    fileSize: {
+      type: Number,
+      default: 100
+    },
+    // 文件类型, 例如['png', 'jpg', 'jpeg']
+    fileType: {
+      type: Array
+    },
+    // 是否显示提示
+    isShowTip: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data() {
+    return {
+      number: 0,
+      uploadList: [],
+      baseUrl: '/api',
+      uploadFileUrl: '/api' + '/common/upload', // 上传文件服务器地址
+      // headers: {
+      //   Authorization: 'Bearer ' + getToken()
+      // },
+      headers: { Authorization: getItem('token') },
+      fileList: [],
+      loading: null
+    }
+  },
+  watch: {
+    value: {
+      handler(val) {
+        if (val) {
+          let temp = 1
+          // 首先将值转为数组
+          const list = Array.isArray(val) ? val : this.value.split(',')
+          // 然后将数组转为对象数组
+          this.fileList = list.map((item) => {
+            if (typeof item === 'string') {
+              item = { name: item, url: item }
+            }
+            item.uid = item.uid || new Date().getTime() + temp++
+            return item
+          })
+        } else {
+          this.fileList = []
+          return []
+        }
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  computed: {
+    // 是否显示提示
+    showTip() {
+      return this.isShowTip && (this.fileType || this.fileSize)
+    }
+  },
+  methods: {
+    // 上传前校检格式和大小
+    handleBeforeUpload(file) {
+      // 校检文件类型
+      if (this.fileType) {
+        const fileName = file.name.split('.')
+        const fileExt = fileName[fileName.length - 1]
+        const isTypeOk = this.fileType.indexOf(fileExt) >= 0
+        if (!isTypeOk) {
+          this.$message({
+            type: 'error',
+            message: `文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`
+          })
+          return false
+        }
+      }
+      // 校检文件大小
+      if (this.fileSize) {
+        const isLt = file.size / 1024 / 1024 < this.fileSize
+        if (!isLt) {
+          this.$message({
+            type: 'error',
+            message: `上传文件大小不能超过 ${this.fileSize} MB!`
+          })
+          return false
+        }
+      }
+      this.loading = this.$loading({
+        lock: true,
+        text: '正在上传文件,请稍候...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      this.number++
+      return true
+    },
+    // 文件个数超出
+    handleExceed() {
+      this.$message({
+        type: 'error',
+        message: `上传文件数量不能超过 ${this.limit} 个!`
+      })
+    },
+    // 上传失败
+    handleUploadError(err) {
+      this.$message({
+        type: 'error',
+        message: '上传文件失败,请重试'
+      })
+      this.loading.close()
+    },
+    // 上传成功回调
+    handleUploadSuccess(res, file) {
+      if (res.code === 200) {
+        this.uploadList.push({ name: res.fileName, url: res.fileName })
+        this.uploadedSuccessfully()
+      } else {
+        this.number--
+        this.loading.close()
+        this.$message({
+          type: 'error',
+          message: res.msg
+        })
+        this.$refs.fileUpload.handleRemove(file)
+        this.uploadedSuccessfully()
+      }
+    },
+    // 删除文件
+    handleDelete(index) {
+      this.fileList.splice(index, 1)
+      this.$emit('input', this.listToString(this.fileList))
+    },
+    // 上传结束处理
+    uploadedSuccessfully() {
+      if (this.number > 0 && this.uploadList.length === this.number) {
+        this.fileList = this.fileList.concat(this.uploadList)
+        this.uploadList = []
+        this.number = 0
+        this.$emit('input', this.listToString(this.fileList))
+        this.loading.close()
+      }
+    },
+    // 获取文件名称
+    getFileName(name) {
+      if (name.lastIndexOf('/') > -1) {
+        return name.slice(name.lastIndexOf('/') + 1)
+      } else {
+        return ''
+      }
+    },
+    // 对象转成指定字符串分隔
+    listToString(list, separator) {
+      let strs = ''
+      separator = separator || ','
+      for (let i in list) {
+        strs += list[i].url + separator
+      }
+      return strs != '' ? strs.substr(0, strs.length - 1) : ''
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.upload-file-uploader {
+  margin-bottom: 5px;
+}
+.upload-file-list .el-upload-list__item {
+  border: 1px solid #e4e7ed;
+  line-height: 2;
+  margin-bottom: 10px;
+  position: relative;
+}
+.upload-file-list .ele-upload-list__item-content {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  color: inherit;
+}
+.ele-upload-list__item-content-action .el-link {
+  margin-right: 10px;
+}
+</style>

+ 146 - 48
src/views/als/falseAlarm/index.vue

@@ -5,15 +5,10 @@
     </div>
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
-        <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
-          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
-        </div>
+        <div class="view-dataType-title-btn"></div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          <el-input placeholder="请输入关键字" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
           </el-input>
         </div>
       </div>
@@ -45,12 +40,41 @@
           <el-button type="primary" @click="submit">确 定</el-button>
         </span>
       </el-dialog>
+      <!-- 算法执行页面 -->
+      <el-dialog title="选择算法" :visible.sync="executeVisible" width="800px" :before-close="handleClose">
+        <el-form :inline="true" :model="agloForm" class="demo-form-inline">
+          <el-form-item label="算法类型">
+            <el-select v-model="agloForm.agloType" placeholder="请选择算法类型" @change="changeAgloType(agloForm.agloType)">
+              <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="算法名称">
+            <el-select v-model="agloForm.agloName" placeholder="算法名称">
+              <el-option v-for="item in algoNameList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="选择参数">
+            <el-transfer v-model="agloForm.paramsList" :data="transferData"></el-transfer>
+          </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose">取 消</el-button>
+          <el-button type="primary" @click="beginExecute">开始执行</el-button>
+        </span>
+      </el-dialog>
+      <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px" :before-close="handleClose">
+        <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getFalseAlarm, getAircaftTypeAndModelTree, addFalseAlarm, updateFalseAlarm, removeFalseAlarm } from '@/api/als/falseAlarm'
+import { getFalseAlarm, addFalseAlarm, updateFalseAlarm, removeFalseAlarm } from '@/api/als/falseAlarm'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftCatalogAll } from '@/api/als/aircraft'
+import { getDataImport } from '@/api/als/dataImport'
+import { getModel } from '@/api/als/model'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'FalseAlarm',
@@ -60,10 +84,12 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      executeVisible: false,
+      progressVisible: false,
+      keyWordData: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -87,7 +113,15 @@ export default {
         },
         {
           prop: 'aircraftId',
-          label: '机号'
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'modelType',
@@ -115,12 +149,21 @@ export default {
           width: '240px',
           group: [
             {
-              name: '编辑',
+              name: '查看',
               type: 'text',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.checkResultList(row)
+              }
+            },
+            {
+              name: '执行',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.executeAglo(row)
               }
             },
             {
@@ -129,7 +172,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -152,6 +195,13 @@ export default {
         pageSize: 10,
         searchValue: ''
       },
+      agloForm: {
+        sortieNo: '',
+        aircraftId: '',
+        agloType: '',
+        agloName: '',
+        paramsList: []
+      },
       form: {
         id: '',
         sortieNo: '',
@@ -169,7 +219,12 @@ export default {
         updateBy: '',
         updateTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      aircaftCatalogAll: [],
+      transferData: [],
+      algoTypeList: [{ id: 4, name: '虚警抑制' }],
+      algoNameList: [],
+      percentage: 0
     }
   },
   watch: {
@@ -179,17 +234,23 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
       if (data.length) {
         this.currentNodeKey = data[0].value
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getFalseAlarmAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        // this.getFalseAlarmAPI()
+        this.getDataImportAPI()
       }
     },
 
@@ -201,7 +262,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          await this.getFalseAlarmAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getFalseAlarmAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -229,17 +290,35 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getFalseAlarm({ pageSize, pageIndex, keyWord, ...params })
+      } = await getFalseAlarm({ pageSize, pageIndex, aircraftId: params })
+      this.tableData = list
+      this.tableRequset.total = totalCount
+    },
+    async getDataImportAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, totalCount }
+      } = await getDataImport({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getFalseAlarmAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getFalseAlarmAPI(this.currentNodeKey)
     },
 
-    searchClick() {
-      this.getFalseAlarmAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      // this.getFalseAlarmAPI(this.currentNodeKey)
+      if (this.keyWordData && this.currentNodeKey !== 'quanbu') {
+        const {
+          data: { list, totalCount }
+        } = await getDataImport({ aircraftId: this.currentNodeKey, sortieNo: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getDataImportAPI(this.currentNodeKey)
+      }
     },
 
     async addFalseAlarmAPI() {
@@ -251,7 +330,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getFalseAlarmAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getFalseAlarmAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
@@ -264,7 +343,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getFalseAlarmAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getFalseAlarmAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
@@ -273,8 +352,7 @@ export default {
       this.$refs.table.clearSelection()
       this.currentNodeKey = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getFalseAlarmAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getDataImportAPI(this.currentNodeKey)
     },
 
     openDialog() {
@@ -285,23 +363,11 @@ export default {
     },
 
     handleClose() {
-      this.dialogVisible = false
-      this.form = {
-        id: '',
-        sortieNo: '',
-        aircraftId: '',
-        modelType: '',
-        param: '',
-        columnData: '',
-        ossId: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+      this.executeVisible = false
+      this.agloForm = {
+        agloType: '',
+        agloName: '',
+        paramsList: []
       }
     },
 
@@ -310,7 +376,39 @@ export default {
       this.form = deepClone(row)
       this.dialogVisible = true
     },
+    checkResultList(row) {
+      this.agloForm.sortieNo = row.sortieNo
+      this.agloForm.aircraftId = row.aircraftId
+      // this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
+    },
+    executeAglo(row) {
+      this.executeVisible = true
+      this.agloForm.sortieNo = row.sortieNo
+      this.agloForm.aircraftId = row.aircraftId
+    },
+    beginExecute() {
+      // 调用算法接口
 
+      this.executeVisible = false
+      this.progressVisible = true
+      const myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          this.percentage += 1
+        } else {
+          this.progressVisible = false
+          this.percentage = 0
+          clearInterval(myTimer)
+          // this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
+          this.handleClose()
+        }
+      }, 30)
+    },
+    async changeAgloType(type) {
+      const {
+        data: { list }
+      } = await getModel({ type })
+      this.algoNameList = list
+    },
     submit() {
       switch (this.dialogTitle) {
         case '编辑':

+ 42 - 30
src/views/als/faultCase/index.vue

@@ -6,13 +6,13 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="currentNode && !currentNode.type == 1">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
+          <el-button type="primary">导入</el-button>
+          <el-button type="primary">导出</el-button>
         </div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
+          <el-input placeholder="请输入故障名称" v-model="keyWordData" class="input1">
             <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
@@ -56,7 +56,8 @@
 </template>
 
 <script>
-import { getFaultCase, getAircaftTypeAndModelTree, addFaultCase, updateFaultCase, removeFaultCase } from '@/api/als/faultCase'
+import { getFaultCase, addFaultCase, updateFaultCase, removeFaultCase } from '@/api/als/faultCase'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'FaultCase',
@@ -66,7 +67,7 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      keyWordData: '',
       aircaftModelIdList: [],
       currentNodeKey: null,
       currentNode: null,
@@ -130,7 +131,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.handUpdate(row)
               }
             },
             {
@@ -139,7 +140,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -190,29 +191,28 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
+    async getAircaftCatalogTreeAPI(params) {
       const { data } = await getAircaftTypeAndModelTree(params)
       this.menuTreeData = data
       if (data.length) {
-        this.currentNodeKey = data[0].value
+        this.currentNodeKey = data[0].id
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getFaultCaseAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        this.getFaultCaseAPI()
       }
     },
 
     async removeFaultCaseAPI(params) {
       try {
-        const { success } = await removeFaultCase(params)
-        if (success) {
+        const { code } = await removeFaultCase(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getFaultCaseAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getFaultCaseAPI(this.currentNode.label)
           this.handleClose()
         }
       } catch (error) {}
@@ -240,42 +240,51 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getFaultCase({ pageSize, pageIndex, keyWord, ...params })
+      } = await getFaultCase({ pageSize, pageIndex, aircraftType: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getFaultCaseAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getFaultCaseAPI(this.currentNode.label)
     },
 
-    searchClick() {
-      this.getFaultCaseAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      // this.getFaultCaseAPI(this.currentNode.label)
+      if (this.keyWordData) {
+        const {
+          data: { list, totalCount }
+        } = await getFaultCase({ faultName: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getFaultCaseAPI()
+      }
     },
 
     async addFaultCaseAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addFaultCase({ ...this.form })
-        if (success) {
+        const { code } = await addFaultCase({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getFaultCaseAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getFaultCaseAPI(this.currentNode.label)
         }
       } catch (error) {}
     },
 
     async updateFaultCaseAPI() {
       try {
-        const { success } = await updateFaultCase({ ...this.form })
-        if (success) {
+        const { code } = await updateFaultCase({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getFaultCaseAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getFaultCaseAPI(this.currentNode.label)
         }
       } catch (error) {}
     },
@@ -284,15 +293,18 @@ export default {
       this.$refs.table.clearSelection()
       this.currentNodeKey = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getFaultCaseAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.aircraftType = data.label
+      if (data.value === 'quanbu') {
+        this.getFaultCaseAPI()
+      } else {
+        this.getFaultCaseAPI(this.currentNode.label)
+      }
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircaftModelName = this.currentNode.label
-      this.form.aircaftModelId = this.currentNode.id
+      this.form.aircraftType = this.currentNode.label
     },
 
     handleClose() {

+ 153 - 58
src/views/als/faultDiagnosis/index.vue

@@ -5,15 +5,10 @@
     </div>
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
-        <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
-          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
-        </div>
+        <div class="view-dataType-title-btn"></div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
           </el-input>
         </div>
       </div>
@@ -57,13 +52,41 @@
           <el-button type="primary" @click="submit">确 定</el-button>
         </span>
       </el-dialog>
+      <el-dialog title="选择算法" :visible.sync="executeVisible" width="800px" :before-close="handleClose">
+        <el-form :inline="true" :model="agloForm" class="demo-form-inline">
+          <el-form-item label="算法类型">
+            <el-select v-model="agloForm.agloType" placeholder="请选择算法类型" @change="changeAgloType(agloForm.agloType)">
+              <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="算法名称">
+            <el-select v-model="agloForm.agloName" placeholder="算法名称">
+              <el-option v-for="item in algoNameList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="选择参数">
+            <el-transfer v-model="agloForm.paramsList" :data="transferData"></el-transfer>
+          </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose">取 消</el-button>
+          <el-button type="primary" @click="beginExecute">开始执行</el-button>
+        </span>
+      </el-dialog>
+      <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px" :before-close="handleClose">
+        <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getFaultDiagnosis, getAircaftTypeAndModelTree, addFaultDiagnosis, updateFaultDiagnosis, removeFaultDiagnosis } from '@/api/als/faultDiagnosis'
+import { getFaultDiagnosis, addFaultDiagnosis, updateFaultDiagnosis, removeFaultDiagnosis } from '@/api/als/faultDiagnosis'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
 import { deepClone, debounce } from '@/utils/index'
+import { getAircaftCatalogAll } from '@/api/als/aircraft'
+import { getDataImport } from '@/api/als/dataImport'
+import { getModel } from '@/api/als/model'
 export default {
   name: 'FaultDiagnosis',
   components: {},
@@ -72,10 +95,12 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      executeVisible: false,
+      progressVisible: false,
+      keyWordData: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -99,7 +124,15 @@ export default {
         },
         {
           prop: 'aircraftId',
-          label: '机号'
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'modelType',
@@ -143,12 +176,21 @@ export default {
           width: '240px',
           group: [
             {
-              name: '编辑',
+              name: '查看',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.checkResultList(row)
+              }
+            },
+            {
+              name: '执行',
               type: 'text',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.executeAglo(row)
               }
             },
             {
@@ -157,7 +199,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -201,7 +243,19 @@ export default {
         param1: '',
         columnData1: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      agloForm: {
+        sortieNo: '',
+        aircraftId: '',
+        agloType: '',
+        agloName: '',
+        paramsList: []
+      },
+      aircaftCatalogAll: [],
+      transferData: [],
+      algoTypeList: [{ id: 5, name: '故障诊断' }],
+      algoNameList: [],
+      percentage: 0
     }
   },
   watch: {
@@ -211,29 +265,35 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
       if (data.length) {
         this.currentNodeKey = data[0].value
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getFaultDiagnosisAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        // this.getFaultDiagnosisAPI()
+        this.getDataImportAPI()
       }
     },
 
     async removeFaultDiagnosisAPI(params) {
       try {
-        const { success } = await removeFaultDiagnosis(params)
-        if (success) {
+        const { code } = await removeFaultDiagnosis(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getFaultDiagnosisAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getFaultDiagnosisAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -261,42 +321,60 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getFaultDiagnosis({ pageSize, pageIndex, keyWord, ...params })
+      } = await getFaultDiagnosis({ pageSize, pageIndex, aircraftId: params })
+      this.tableData = list
+      this.tableRequset.total = totalCount
+    },
+    async getDataImportAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, totalCount }
+      } = await getDataImport({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getFaultDiagnosisAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getFaultDiagnosisAPI(this.currentNodeKey)
     },
 
-    searchClick() {
-      this.getFaultDiagnosisAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      // this.getFaultDiagnosisAPI(this.currentNodeKey)
+      if (this.keyWordData && this.currentNodeKey !== 'quanbu') {
+        const {
+          data: { list, totalCount }
+        } = await getDataImport({ aircraftId: this.currentNodeKey, sortieNo: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getDataImportAPI(this.currentNodeKey)
+      }
     },
 
     async addFaultDiagnosisAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addFaultDiagnosis({ ...this.form })
-        if (success) {
+        const { code } = await addFaultDiagnosis({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getFaultDiagnosisAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getFaultDiagnosisAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     async updateFaultDiagnosisAPI() {
       try {
-        const { success } = await updateFaultDiagnosis({ ...this.form })
-        if (success) {
+        const { code } = await updateFaultDiagnosis({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getFaultDiagnosisAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getFaultDiagnosisAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
@@ -305,8 +383,7 @@ export default {
       this.$refs.table.clearSelection()
       this.currentNodeKey = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getFaultDiagnosisAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getDataImportAPI(this.currentNodeKey)
     },
 
     openDialog() {
@@ -317,27 +394,11 @@ export default {
     },
 
     handleClose() {
-      this.dialogVisible = false
-      this.form = {
-        id: '',
-        sortieNo: '',
-        aircraftId: '',
-        modelType: '',
-        param: '',
-        columnData: '',
-        ossId: '',
-        resultContent: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: '',
-        modelType1: '',
-        param1: '',
-        columnData1: ''
+      this.executeVisible = false
+      this.agloForm = {
+        agloType: '',
+        agloName: '',
+        paramsList: []
       }
     },
 
@@ -347,6 +408,40 @@ export default {
       this.dialogVisible = true
     },
 
+    checkResultList(row) {
+      this.agloForm.sortieNo = row.sortieNo
+      this.agloForm.aircraftId = row.aircraftId
+      this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
+    },
+    executeAglo(row) {
+      this.executeVisible = true
+      this.agloForm.sortieNo = row.sortieNo
+      this.agloForm.aircraftId = row.aircraftId
+    },
+    beginExecute() {
+      // 调用算法接口
+
+      this.executeVisible = false
+      this.progressVisible = true
+      const myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          this.percentage += 1
+        } else {
+          this.progressVisible = false
+          this.percentage = 0
+          clearInterval(myTimer)
+          this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
+          this.handleClose()
+        }
+      }, 30)
+    },
+    async changeAgloType(type) {
+      const {
+        data: { list }
+      } = await getModel({ type })
+      this.algoNameList = list
+    },
+
     submit() {
       switch (this.dialogTitle) {
         case '编辑':

+ 342 - 27
src/views/als/flightData/index.vue

@@ -1,27 +1,84 @@
 <template>
-  <div class="view-fightManage">
+  <div class="view-table-content">
     <div class="view-dataSpecies-left">
       <MenuTree :currentNodeKey="currentNodeKey" nodeKey="id" :treedata="menuTreeData" @TreeNodeclick="treeNodeClick" v-bind="treeObj"> </MenuTree>
     </div>
-    <div class="view-dataSpecies-right"></div>
+    <div class="view-dataSpecies-right">
+      <div class="view-dataType-title">
+        <div class="view-dataType-title-btn">
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
+          <el-button type="primary">导入</el-button>
+          <el-button type="primary" @click="downloadFile">导出</el-button>
+        </div>
+        <div class="view-dataType-title-search">
+          <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          </el-input>
+        </div>
+      </div>
+      <div class="view-dataType-table">
+        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
+      </div>
+      <!-- 添加或修改飞参数据信息对话框 -->
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
+        <el-form ref="form" :model="form" label-width="80px">
+          <!-- <el-form-item label="文件编号" prop="ossId">
+            <el-input v-model="form.ossId" placeholder="请输入文件编号" />
+          </el-form-item> -->
+          <el-form-item label="数据源" prop="source">
+            <el-input v-model="form.source" placeholder="请输入数据源" disabled />
+          </el-form-item>
+          <el-form-item label="机型" prop="aircaftModel">
+            <el-select v-model="form.aircaftModel" placeholder="请选择机型" disabled>
+              <el-option v-for="item in aircaftModelAll" :key="item.aircaftModelId" :label="item.aircaftModelName" :value="item.aircaftModelId"> </el-option>
+            </el-select>
+          </el-form-item>
+          <!-- 编目 = 机号 -->
+          <el-form-item label="编目" prop="aircraftId">
+            <el-select v-model="form.aircraftId" placeholder="请选择编目" disabled>
+              <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="架次号" prop="sortieNo">
+            <el-input v-model="form.sortieNo" placeholder="请输入架次号" />
+          </el-form-item>
+          <el-form-item label="飞行日期" prop="flightDate">
+            <el-date-picker v-model="form.flightDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择飞行日期"> </el-date-picker>
+            <!-- <el-date-picker v-model="form.flightDate" type="datetime" value-format="YYYY-MM-DD HH:MM:SS" placeholder="请选择飞行日期"> </el-date-picker> -->
+          </el-form-item>
+          <el-form-item label="数据导入" prop="ossId">
+            <FileUpload :fileSize="500" :fileType="['xls', 'xlsx']" />
+          </el-form-item>
+        </el-form>
+
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose">取 消</el-button>
+          <el-button type="primary" @click="submit">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
   </div>
 </template>
 
 <script>
-import { getAircaftCatalog, getAircaftTypeAndModelTree, addAircaftCatalog, updateAircaftCatalog, removeAircaftCatalog } from '@/api/basicData/dataAircraftCataloging'
+import { getDataImport, addDataImport, updateDataImport, removeDataImport } from '@/api/als/dataImport'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
+import { deepClone, debounce } from '@/utils/index'
 export default {
-  name: 'FlightManage',
+  name: 'DataImport',
+  components: {},
   data() {
+    // 这里存放数据
     return {
-      currentNodeKey: null,
-      currentNode: null,
+      dialogTitle: '新增',
+      dialogVisible: false,
+      keyWordData: '',
+      aircaftModelIdList: [],
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
-      tableRequset: {
-        total: 0,
-        pageIndex: 1,
-        pageSize: 10,
-        searchValue: ''
-      },
       treeObj: {
         title: '所属机种',
         activityheight: '275px',
@@ -30,30 +87,159 @@ export default {
           children: 'children',
           label: 'label'
         }
-      }
+      },
+      typeTree: {
+        children: 'children',
+        label: 'label'
+      },
+      searchValue: '',
+      columns: [
+        { prop: 'id', label: '唯一编号' },
+        {
+          prop: 'ossId',
+          label: '文件编号'
+        },
+
+        {
+          prop: 'source',
+          label: '数据源'
+        },
+        {
+          prop: 'aircraftId',
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
+        },
+        {
+          prop: 'sortieNo',
+          label: '架次号'
+        },
+        {
+          prop: 'flightDate',
+          label: '飞行日期'
+        },
+        {
+          prop: 'status',
+          label: '状态'
+        },
+        {
+          button: true,
+          label: '操作',
+          width: '240px',
+          group: [
+            {
+              name: '编辑',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.handUpdate(row)
+              }
+            },
+            {
+              name: '删除',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.remove([row])
+              }
+            }
+          ]
+        }
+      ],
+      options: {
+        stripe: true, // 斑马纹
+        mutiSelect: true, // 多选框
+        index: false, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: 'calc(100vh - 300px)'
+      },
+      tableCheckItems: [],
+      tableData: [],
+      tableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      form: {
+        id: '',
+        ossId: '',
+        source: '1',
+        aircaftModel: '',
+        aircraftId: '',
+        sortieNo: '',
+        flightDate: '',
+        status: '',
+        tenantId: '',
+        version: '',
+        delFlag: '',
+        createBy: '',
+        createTime: '',
+        updateBy: '',
+        updateTime: ''
+      },
+      debounceFn: debounce(this.fetch, 500),
+      aircaftModelAll: [],
+      aircaftCatalogAll: []
+    }
+  },
+  watch: {
+    keyWord() {
+      this.tableRequset.pageIndex = 1
+      this.debounceFn()
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const getAircaftModelAllParams = {
+        aircaftTypeCode: '',
+        aircaftTypeId: '',
+        queryParam: ''
+      }
+      const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
+      this.aircaftModelAll = data1
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
       if (data.length) {
         this.currentNodeKey = data[0].value
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getAircaftCatalogAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        this.getDataImportAPI()
       }
     },
-    treeNodeClick(data) {
-      this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
-      this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getAircaftCatalogAPI({ aircaftModelIdList: this.aircaftModelIdList })
+
+    async removeDataImportAPI(params) {
+      try {
+        const { code } = await removeDataImport(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          await this.getDataImportAPI(this.currentNodeKey === 'quanbu' ? null : this.currentNodeKey)
+          this.handleClose()
+        }
+      } catch (error) {}
     },
+
     getTreeLeafData(list) {
       const newArr = []
       function getLeaf(data, arr) {
@@ -69,18 +255,147 @@ export default {
       getLeaf(list, newArr)
       return newArr
     },
-    async getAircaftCatalogAPI(params) {
+
+    async getDataImportAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getAircaftCatalog({ pageSize, pageIndex, keyWord, ...params })
+      } = await getDataImport({ pageSize, pageIndex, aircraftId: params, source: 1 })
       this.tableData = list
       this.tableRequset.total = totalCount
+    },
+
+    fetch() {
+      this.getDataImportAPI(this.currentNodeKey)
+    },
+
+    async searchClick() {
+      if (this.keyWordData) {
+        const {
+          data: { list, totalCount }
+        } = await getDataImport({ aircraftId: this.currentNodeKey, sortieNo: this.keyWordData, source: 1 })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getDataImportAPI(this.currentNodeKey)
+      }
+    },
+
+    async addDataImportAPI() {
+      try {
+        delete this.form.aircaftModelName
+        const { code } = await addDataImport({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.getDataImportAPI(this.currentNodeKey)
+        }
+      } catch (error) {}
+    },
+
+    async updateDataImportAPI() {
+      try {
+        const { code } = await updateDataImport({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.getDataImportAPI(this.currentNodeKey)
+        }
+      } catch (error) {}
+    },
+
+    treeNodeClick(data) {
+      this.$refs.table.clearSelection()
+      this.currentNodeKey = this.form.aircraftId = data.id
+      this.currentNode = data
+      this.form.aircaftModel = data.parentId
+      this.getDataImportAPI(this.currentNodeKey)
+    },
+
+    openDialog() {
+      this.dialogTitle = '新增'
+      this.dialogVisible = true
+      this.form.aircraftId = this.currentNodeKey
+      this.form.aircaftModel = this.currentNode.parentId
+    },
+
+    handleClose() {
+      this.dialogVisible = false
+      this.form = {
+        id: '',
+        ossId: '',
+        source: '1',
+        aircaftModel: '',
+        sortieNo: '',
+        aircraftId: '',
+        flightDate: '',
+        status: '',
+        tenantId: '',
+        version: '',
+        delFlag: '',
+        createBy: '',
+        createTime: '',
+        updateBy: '',
+        updateTime: ''
+      }
+    },
+
+    handUpdate(row) {
+      this.dialogTitle = '编辑'
+      this.form = deepClone(row)
+      this.dialogVisible = true
+    },
+
+    submit() {
+      switch (this.dialogTitle) {
+        case '编辑':
+          this.updateDataImportAPI()
+          this.handleClose()
+          break
+        case '新增':
+          this.addDataImportAPI()
+          this.handleClose()
+          break
+      }
+    },
+
+    selection(val) {
+      this.tableCheckItems = val
+    },
+
+    remove(row) {
+      this.$confirm('是否删除该机种', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeDataImportAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    },
+    async downloadFile() {
+      this.$confirm('确认导出飞参数据?', '温馨提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          //       exportDownApi(proTable.value?.searchParam)
+          // taskDialogRef.value?.openExportDialog()
+        })
+        .catch(() => {})
     }
   }
 }
 </script>
 
-<style lang="scss"></style>
+<style lang="scss" scoped>
+@import '../index.scss';
+</style>

+ 3 - 0
src/views/als/index.scss

@@ -22,3 +22,6 @@
 .view-dataType-table {
   margin-top: 30px;
 }
+::-webkit-scrollbar{
+  display: none;
+}

+ 153 - 54
src/views/als/lifePrediction/index.vue

@@ -5,15 +5,10 @@
     </div>
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
-        <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
-          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
-        </div>
+        <div class="view-dataType-title-btn"></div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          <el-input placeholder="请输入关键字" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
           </el-input>
         </div>
       </div>
@@ -45,13 +40,42 @@
           <el-button type="primary" @click="submit">确 定</el-button>
         </span>
       </el-dialog>
+
+      <el-dialog title="选择算法" :visible.sync="executeVisible" width="800px" :before-close="handleClose">
+        <el-form :inline="true" :model="agloForm" class="demo-form-inline">
+          <el-form-item label="算法类型">
+            <el-select v-model="agloForm.agloType" placeholder="请选择算法类型" @change="changeAgloType(agloForm.agloType)">
+              <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="算法名称">
+            <el-select v-model="agloForm.agloName" placeholder="算法名称">
+              <el-option v-for="item in algoNameList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="选择参数">
+            <el-transfer v-model="agloForm.paramsList" :data="transferData"></el-transfer>
+          </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose">取 消</el-button>
+          <el-button type="primary" @click="beginExecute">开始执行</el-button>
+        </span>
+      </el-dialog>
+      <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px" :before-close="handleClose">
+        <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getLifePrediction, getAircaftTypeAndModelTree, addLifePrediction, updateLifePrediction, removeLifePrediction } from '@/api/als/lifePrediction'
+import { getLifePrediction, addLifePrediction, updateLifePrediction, removeLifePrediction } from '@/api/als/lifePrediction'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
 import { deepClone, debounce } from '@/utils/index'
+import { getDataImport } from '@/api/als/dataImport'
+import { getModel } from '@/api/als/model'
+import { getAircaftCatalogAll } from '@/api/als/aircraft'
 export default {
   name: 'LifePrediction',
   components: {},
@@ -60,10 +84,12 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      executeVisible: false,
+      progressVisible: false,
+      keyWordData: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -81,9 +107,21 @@ export default {
       searchValue: '',
       columns: [
         { prop: 'id', label: '编号' },
+        {
+          prop: 'sortieNo',
+          label: '架次号'
+        },
         {
           prop: 'aircraftId',
-          label: '机号'
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'name',
@@ -115,12 +153,21 @@ export default {
           width: '240px',
           group: [
             {
-              name: '编辑',
+              name: '查看',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.checkResultList(row)
+              }
+            },
+            {
+              name: '执行',
               type: 'text',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.executeAglo(row)
               }
             },
             {
@@ -129,7 +176,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -169,7 +216,19 @@ export default {
         updateBy: '',
         updateTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      agloForm: {
+        sortieNo: '',
+        aircraftId: '',
+        agloType: '',
+        agloName: '',
+        paramsList: []
+      },
+      aircaftCatalogAll: [],
+      transferData: [],
+      algoTypeList: [{ id: 6, name: '寿命预测' }],
+      algoNameList: [],
+      percentage: 0
     }
   },
   watch: {
@@ -179,29 +238,35 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
       if (data.length) {
         this.currentNodeKey = data[0].value
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getLifePredictionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        // this.getLifePredictionAPI()
+        this.getDataImportAPI()
       }
     },
 
     async removeLifePredictionAPI(params) {
       try {
-        const { success } = await removeLifePrediction(params)
-        if (success) {
+        const { code } = await removeLifePrediction(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getLifePredictionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getLifePredictionAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -229,42 +294,61 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getLifePrediction({ pageSize, pageIndex, keyWord, ...params })
+      } = await getLifePrediction({ pageSize, pageIndex, aircraftId: params })
+      this.tableData = list
+      this.tableRequset.total = totalCount
+    },
+
+    async getDataImportAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, totalCount }
+      } = await getDataImport({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getLifePredictionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getLifePredictionAPI(this.currentNodeKey)
     },
 
-    searchClick() {
-      this.getLifePredictionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      // this.getLifePredictionAPI(this.currentNodeKey)
+      if (this.keyWordData && this.currentNodeKey !== 'quanbu') {
+        const {
+          data: { list, totalCount }
+        } = await getDataImport({ aircraftId: this.currentNodeKey, sortieNo: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getDataImportAPI(this.currentNodeKey)
+      }
     },
 
     async addLifePredictionAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addLifePrediction({ ...this.form })
-        if (success) {
+        const { code } = await addLifePrediction({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getLifePredictionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getLifePredictionAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     async updateLifePredictionAPI() {
       try {
-        const { success } = await updateLifePrediction({ ...this.form })
-        if (success) {
+        const { code } = await updateLifePrediction({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getLifePredictionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getLifePredictionAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
@@ -273,8 +357,7 @@ export default {
       this.$refs.table.clearSelection()
       this.currentNodeKey = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getLifePredictionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getDataImportAPI(this.currentNodeKey)
     },
 
     openDialog() {
@@ -285,26 +368,42 @@ export default {
     },
 
     handleClose() {
-      this.dialogVisible = false
-      this.form = {
-        id: '',
-        aircraftId: '',
-        name: '',
-        model: '',
-        system: '',
-        methodType: '',
-        remainTiem: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+      this.executeVisible = false
+      this.agloForm = {
+        agloType: '',
+        agloName: '',
+        paramsList: []
       }
     },
 
+    checkResultList(row) {
+      this.agloForm.sortieNo = row.sortieNo
+      this.agloForm.aircraftId = row.aircraftId
+      this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
+    },
+    executeAglo(row) {
+      this.executeVisible = true
+      this.agloForm.sortieNo = row.sortieNo
+      this.agloForm.aircraftId = row.aircraftId
+    },
+    beginExecute() {
+      // 调用算法接口
+
+      this.executeVisible = false
+      this.progressVisible = true
+      const myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          this.percentage += 1
+        } else {
+          this.progressVisible = false
+          this.percentage = 0
+          clearInterval(myTimer)
+          this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
+          this.handleClose()
+        }
+      }, 30)
+    },
+
     handUpdate(row) {
       this.dialogTitle = '编辑'
       this.form = deepClone(row)

+ 28 - 27
src/views/als/maintainRecord/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.parentId == 0">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
           <el-button type="primary">导入模板</el-button>
           <el-button type="primary">导出模板</el-button>
@@ -22,7 +22,7 @@
       </div>
       <!-- 添加或修改维护记录对话框 -->
       <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px">
+        <el-form ref="form" :model="form" label-width="80px" style="height: 50vh; overflow-y: scroll">
           <el-form-item label="机号" prop="aircraftId">
             <el-input v-model="form.aircraftId" placeholder="请输入机号" />
           </el-form-item>
@@ -35,7 +35,7 @@
           <el-form-item label="系统" prop="systemName">
             <el-input v-model="form.systemName" placeholder="请输入系统" />
           </el-form-item>
-          <el-form-item label="发动机号码" prop="engineSerialNumber">
+          <el-form-item label="发动机号码" label-width="90px" prop="engineSerialNumber">
             <el-input v-model="form.engineSerialNumber" placeholder="请输入发动机号码" />
           </el-form-item>
           <el-form-item label="单位" prop="unitName">
@@ -44,22 +44,22 @@
           <el-form-item label="故障现象" prop="faultPhenomenon">
             <el-input v-model="form.faultPhenomenon" placeholder="请输入故障现象" />
           </el-form-item>
-          <el-form-item label="故障发生地点" prop="locationFault">
+          <el-form-item label="故障发生地点" label-width="110px" prop="locationFault">
             <el-input v-model="form.locationFault" placeholder="请输入故障发生地点" />
           </el-form-item>
           <el-form-item label="发现时机" prop="discoveryTime">
             <el-input v-model="form.discoveryTime" placeholder="请输入发现时机" />
           </el-form-item>
-          <el-form-item label="故障件名称" prop="itemName">
+          <el-form-item label="故障件名称" label-width="90px" prop="itemName">
             <el-input v-model="form.itemName" placeholder="请输入故障件名称" />
           </el-form-item>
-          <el-form-item label="故换件号码" prop="partNumber">
+          <el-form-item label="故换件号码" label-width="90px" prop="partNumber">
             <el-input v-model="form.partNumber" placeholder="请输入故换件号码" />
           </el-form-item>
-          <el-form-item label="故障失常码" prop="faultCode">
+          <el-form-item label="故障失常码" label-width="90px" prop="faultCode">
             <el-input v-model="form.faultCode" placeholder="请输入故障失常码" />
           </el-form-item>
-          <el-form-item label="故障件装机日期" prop="installationDate">
+          <el-form-item label="故障件装机日期" label-width="120px" prop="installationDate">
             <el-date-picker clearable v-model="form.installationDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择故障件装机日期"> </el-date-picker>
           </el-form-item>
           <el-form-item label="故障原因" prop="causeFault">
@@ -110,7 +110,8 @@
 </template>
 
 <script>
-import { getMaintainRecord, getAircaftTypeAndModelTree, addMaintainRecord, updateMaintainRecord, removeMaintainRecord } from '@/api/als/maintainRecord'
+import { getMaintainRecord, addMaintainRecord, updateMaintainRecord, removeMaintainRecord } from '@/api/als/maintainRecord'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'MaintainRecord',
@@ -349,17 +350,16 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
       if (data.length) {
-        this.currentNodeKey = data[0].value
+        this.currentNodeKey = data[0].id
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getMaintainRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        this.getMaintainRecordAPI()
       }
     },
 
@@ -371,7 +371,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          await this.getMaintainRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getMaintainRecordAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -399,17 +399,17 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getMaintainRecord({ pageSize, pageIndex, keyWord, ...params })
+      } = await getMaintainRecord({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getMaintainRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getMaintainRecordAPI(this.currentNodeKey)
     },
 
     searchClick() {
-      this.getMaintainRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getMaintainRecordAPI(this.currentNodeKey)
     },
 
     async addMaintainRecordAPI() {
@@ -421,7 +421,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getMaintainRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getMaintainRecordAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
@@ -434,24 +434,26 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getMaintainRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getMaintainRecordAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
+      this.currentNodeKey = this.form.aircraftId = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getMaintainRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.form.aircraftType = data.label
+      this.getMaintainRecordAPI(this.currentNodeKey)
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircaftModelName = this.currentNode.label
-      this.form.aircaftModelId = this.currentNode.id
+      this.form.aircraftId = this.currentNodeKey
+      this.form.aircraftType = this.currentNode.label
+      // this.form.aircaftModelName = this.currentNode.label
+      // this.form.aircaftModelId = this.currentNode.id
     },
 
     handleClose() {
@@ -538,4 +540,3 @@ export default {
 <style lang="scss" scoped>
 @import '../index.scss';
 </style>
-@/api/als/maintainRecord

+ 133 - 59
src/views/als/maintenanceDecision/index.vue

@@ -5,14 +5,9 @@
     </div>
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
-        <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
-          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
-        </div>
+        <div class="view-dataType-title-btn"></div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
+          <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
             <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
@@ -21,8 +16,8 @@
         <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
       </div>
       <!-- 添加或修改辅助维修决策对话框 -->
-      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px">
+      <el-dialog :title="dialogTitle" :visible.sync="resultVisible" width="1000px" :before-close="handleClose">
+        <el-form ref="form" :model="form" :inline="true" label-width="80px">
           <el-form-item label="架次号" prop="sortieNo">
             <el-input v-model="form.sortieNo" placeholder="请输入架次号" />
           </el-form-item>
@@ -48,19 +43,26 @@
             <el-input v-model="form.proposal" placeholder="请输入维修建议" />
           </el-form-item>
         </el-form>
-
+        <div style="height: 200px">维修决策结果及派遣内容</div>
         <span slot="footer" class="dialog-footer">
-          <el-button @click="handleClose">取 消</el-button>
-          <el-button type="primary" @click="submit">确 定</el-button>
+          <el-button @click="handleClose">派 遣</el-button>
+          <el-button type="primary" @click="handleDispatch">确 定</el-button>
         </span>
       </el-dialog>
+      <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px" :before-close="handleClose">
+        <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getMaintenanceDecision, getAircaftTypeAndModelTree, addMaintenanceDecision, updateMaintenanceDecision, removeMaintenanceDecision } from '@/api/als/maintenanceDecision'
+import { getMaintenanceDecision, addMaintenanceDecision, updateMaintenanceDecision, removeMaintenanceDecision } from '@/api/als/maintenanceDecision'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
 import { deepClone, debounce } from '@/utils/index'
+import { getAircaftCatalogAll } from '@/api/als/aircraft'
+import { getDataImport } from '@/api/als/dataImport'
+import { getModel } from '@/api/als/model'
 export default {
   name: 'MaintenanceDecision',
   components: {},
@@ -69,10 +71,12 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      resultVisible: false,
+      progressVisible: false,
+      keyWordData: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -96,7 +100,15 @@ export default {
         },
         {
           prop: 'aircraftId',
-          label: '机号'
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'resultId',
@@ -132,12 +144,21 @@ export default {
           width: '240px',
           group: [
             {
-              name: '编辑',
+              name: '查看',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.checkResult(row)
+              }
+            },
+            {
+              name: '执行',
               type: 'text',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.executeAglo(row)
               }
             },
             {
@@ -146,7 +167,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -188,7 +209,19 @@ export default {
         updateBy: '',
         updateTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      agloForm: {
+        sortieNo: '',
+        aircraftId: '',
+        agloType: '',
+        agloName: '',
+        paramsList: []
+      },
+      aircaftCatalogAll: [],
+      transferData: [],
+      algoTypeList: [{ id: 5, name: '故障诊断' }],
+      algoNameList: [],
+      percentage: 0
     }
   },
   watch: {
@@ -198,29 +231,35 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
       if (data.length) {
         this.currentNodeKey = data[0].value
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getMaintenanceDecisionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        // this.getMaintenanceDecisionAPI(this.currentNodeKey)
+        this.getDataImportAPI()
       }
     },
 
     async removeMaintenanceDecisionAPI(params) {
       try {
-        const { success } = await removeMaintenanceDecision(params)
-        if (success) {
+        const { code } = await removeMaintenanceDecision(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getMaintenanceDecisionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getMaintenanceDecisionAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -248,42 +287,60 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getMaintenanceDecision({ pageSize, pageIndex, keyWord, ...params })
+      } = await getMaintenanceDecision({ pageSize, pageIndex, aircraftId: params })
+      this.tableData = list
+      this.tableRequset.total = totalCount
+    },
+    async getDataImportAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, totalCount }
+      } = await getDataImport({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getMaintenanceDecisionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getMaintenanceDecisionAPI(this.currentNodeKey)
     },
 
-    searchClick() {
-      this.getMaintenanceDecisionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      // this.getMaintenanceDecisionAPI(this.currentNodeKey)
+      if (this.keyWordData && this.currentNodeKey !== 'quanbu') {
+        const {
+          data: { list, totalCount }
+        } = await getDataImport({ aircraftId: this.currentNodeKey, sortieNo: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getDataImportAPI(this.currentNodeKey)
+      }
     },
 
     async addMaintenanceDecisionAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addMaintenanceDecision({ ...this.form })
-        if (success) {
+        const { code } = await addMaintenanceDecision({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getMaintenanceDecisionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getMaintenanceDecisionAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     async updateMaintenanceDecisionAPI() {
       try {
-        const { success } = await updateMaintenanceDecision({ ...this.form })
-        if (success) {
+        const { code } = await updateMaintenanceDecision({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getMaintenanceDecisionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getMaintenanceDecisionAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
@@ -292,8 +349,9 @@ export default {
       this.$refs.table.clearSelection()
       this.currentNodeKey = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getMaintenanceDecisionAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      // this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
+      // this.getMaintenanceDecisionAPI(this.currentNodeKey)
+      this.getDataImportAPI(this.currentNodeKey)
     },
 
     openDialog() {
@@ -304,25 +362,13 @@ export default {
     },
 
     handleClose() {
-      this.dialogVisible = false
-      this.form = {
-        id: '',
+      this.resultVisible = false
+      this.agloForm = {
         sortieNo: '',
         aircraftId: '',
-        resultId: '',
-        code: '',
-        systemName: '',
-        unitName: '',
-        faultPart: '',
-        proposal: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        agloType: '',
+        agloName: '',
+        paramsList: []
       }
     },
 
@@ -332,6 +378,33 @@ export default {
       this.dialogVisible = true
     },
 
+    checkResult(row) {
+      this.dialogTitle = '维修决策'
+      this.form = deepClone(row)
+      this.resultVisible = true
+    },
+    executeAglo(row) {
+      this.resultVisible = false
+      this.progressVisible = true
+      const myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          this.percentage += 1
+        } else {
+          this.progressVisible = false
+          this.percentage = 0
+          clearInterval(myTimer)
+          this.resultVisible = true
+          // this.handleClose()
+        }
+      }, 30)
+    },
+    async changeAgloType(type) {
+      const {
+        data: { list }
+      } = await getModel({ type })
+      this.algoNameList = list
+    },
+
     submit() {
       switch (this.dialogTitle) {
         case '编辑':
@@ -359,7 +432,8 @@ export default {
           this.removeMaintenanceDecisionAPI(row.map((e) => e.id))
         })
         .catch(() => {})
-    }
+    },
+    handleDispatch() {}
   }
 }
 </script>

+ 100 - 52
src/views/als/repairRecord/index.vue → src/views/als/maintenanceRecord/index.vue

@@ -6,10 +6,10 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
+          <el-button type="primary">导入</el-button>
+          <el-button type="primary">导出</el-button>
         </div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
@@ -22,9 +22,16 @@
       </div>
       <!-- 添加或修改维修记录对话框 -->
       <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px">
-          <el-form-item label="机号" prop="aircraftId">
-            <el-input v-model="form.aircraftId" placeholder="请输入机号" />
+        <el-form ref="form" :model="form" label-width="80px" style="height: 50vh; overflow-y: scroll">
+          <el-form-item label="机型" prop="aircraftType">
+            <el-select v-model="form.aircraftType" placeholder="请选择机型" disabled>
+              <el-option v-for="item in aircaftModelAll" :key="item.aircaftModelId" :label="item.aircaftModelName" :value="item.aircaftModelId"> </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="编目" prop="aircraftId">
+            <el-select v-model="form.aircraftId" placeholder="请选择编目" disabled>
+              <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="出厂号码" prop="serialNumber">
             <el-input v-model="form.serialNumber" placeholder="请输入出厂号码" />
@@ -35,7 +42,10 @@
           <el-form-item label="系统" prop="systemName">
             <el-input v-model="form.systemName" placeholder="请输入系统" />
           </el-form-item>
-          <el-form-item label="发动机号码" prop="engineSerialNumber">
+          <el-form-item label="发动机型别" prop="engineType" label-width="90px">
+            <el-input v-model="form.engineType" placeholder="请输入发动机型别" />
+          </el-form-item>
+          <el-form-item label="发动机号码" prop="engineSerialNumber" label-width="90px">
             <el-input v-model="form.engineSerialNumber" placeholder="请输入发动机号码" />
           </el-form-item>
           <el-form-item label="单位" prop="unitName">
@@ -44,23 +54,29 @@
           <el-form-item label="故障现象" prop="faultPhenomenon">
             <el-input v-model="form.faultPhenomenon" placeholder="请输入故障现象" />
           </el-form-item>
-          <el-form-item label="故障发生地点" prop="locationFault">
+          <el-form-item label="故障发生地点" prop="locationFault" label-width="110px">
             <el-input v-model="form.locationFault" placeholder="请输入故障发生地点" />
           </el-form-item>
           <el-form-item label="发现时机" prop="discoveryTime">
             <el-input v-model="form.discoveryTime" placeholder="请输入发现时机" />
           </el-form-item>
-          <el-form-item label="故障件名称" prop="itemName">
+          <el-form-item label="故障件名称" prop="itemName" label-width="90px">
             <el-input v-model="form.itemName" placeholder="请输入故障件名称" />
           </el-form-item>
-          <el-form-item label="故换件号码" prop="partNumber">
+          <el-form-item label="故障件型别" prop="itemType" label-width="90px">
+            <el-input v-model="form.itemType" placeholder="请输入故障件型别" />
+          </el-form-item>
+          <el-form-item label="故换件号码" prop="partNumber" label-width="90px">
             <el-input v-model="form.partNumber" placeholder="请输入故换件号码" />
           </el-form-item>
-          <el-form-item label="故障失常码" prop="faultCode">
+          <el-form-item label="故换件型别" prop="partType" label-width="90px">
+            <el-input v-model="form.partType" placeholder="请输入故换件型别" />
+          </el-form-item>
+          <el-form-item label="故障失常码" prop="faultCode" label-width="90px">
             <el-input v-model="form.faultCode" placeholder="请输入故障失常码" />
           </el-form-item>
-          <el-form-item label="故障件装机日期" prop="installationDate">
-            <el-date-picker clearable v-model="form.installationDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择故障件装机日期"> </el-date-picker>
+          <el-form-item label="故障件装机日期" prop="installationDate" label-width="120px">
+            <el-date-picker v-model="form.installationDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择发生日期"> </el-date-picker>
           </el-form-item>
           <el-form-item label="故障原因" prop="causeFault">
             <el-input v-model="form.causeFault" placeholder="请输入故障原因" />
@@ -75,7 +91,7 @@
             <el-input v-model="form.consequencesFault" placeholder="请输入故障后果" />
           </el-form-item>
           <el-form-item label="发生日期" prop="occurDate">
-            <el-date-picker clearable v-model="form.occurDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期"> </el-date-picker>
+            <el-date-picker v-model="form.occurDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择发生日期"> </el-date-picker>
           </el-form-item>
           <el-form-item label="判明方法" prop="methodDetermination">
             <el-input v-model="form.methodDetermination" placeholder="请输入判明方法" />
@@ -110,10 +126,12 @@
 </template>
 
 <script>
-import { getRepairRecord, getAircaftTypeAndModelTree, addRepairRecord, updateRepairRecord, removeRepairRecord } from '@/api/als/repairRecord'
+import { getMaintenanceRecord, addMaintenanceRecord, updateMaintenanceRecord, removeMaintenanceRecord } from '@/api/als/maintenanceRecord'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftCatalogAll, getAircaftModelAll } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 export default {
-  name: 'RepairRecord',
+  name: 'MaintenanceRecord',
   components: {},
   data() {
     // 这里存放数据
@@ -122,8 +140,8 @@ export default {
       dialogVisible: false,
       keyWord: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -143,11 +161,28 @@ export default {
         { prop: 'id', label: '编号' },
         {
           prop: 'aircraftType',
-          label: '机型'
+          label: '机型',
+          render: (h, params) => {
+            const matchedItem = this.aircaftModelAll.find((item) => params.row.aircraftType.trim() === item.aircaftModelId.trim())
+            console.log(params.row.aircraftType.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftModelName)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'aircraftId',
-          label: '机号'
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'serialNumber',
@@ -339,7 +374,9 @@ export default {
         updateBy: '',
         updateTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      aircaftCatalogAll: [],
+      aircaftModelAll: []
     }
   },
   watch: {
@@ -349,29 +386,41 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const getAircaftModelAllParams = {
+        aircaftTypeCode: '',
+        aircaftTypeId: '',
+        queryParam: ''
+      }
+      const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
+      this.aircaftModelAll = data1
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
       if (data.length) {
-        this.currentNodeKey = data[0].value
+        this.currentNodeKey = data[0].id
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getRepairRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        this.getMaintenanceRecordAPI()
       }
     },
 
-    async removeRepairRecordAPI(params) {
+    async removeMaintenanceRecordAPI(params) {
       try {
-        const { success } = await removeRepairRecord(params)
-        if (success) {
+        const { code } = await removeMaintenanceRecord(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getRepairRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getMaintenanceRecordAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -393,65 +442,65 @@ export default {
       return newArr
     },
 
-    async getRepairRecordAPI(params) {
+    async getMaintenanceRecordAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getRepairRecord({ pageSize, pageIndex, keyWord, ...params })
+      } = await getMaintenanceRecord({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getRepairRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getMaintenanceRecordAPI(this.currentNodeKey)
     },
 
     searchClick() {
-      this.getRepairRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getMaintenanceRecordAPI(this.currentNodeKey)
     },
 
-    async addRepairRecordAPI() {
+    async addMaintenanceRecordAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addRepairRecord({ ...this.form })
-        if (success) {
+        const { code } = await addMaintenanceRecord({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getRepairRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getMaintenanceRecordAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
-    async updateRepairRecordAPI() {
+    async updateMaintenanceRecordAPI() {
       try {
-        const { success } = await updateRepairRecord({ ...this.form })
-        if (success) {
+        const { code } = await updateMaintenanceRecord({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getRepairRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getMaintenanceRecordAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
+      this.currentNodeKey = this.form.aircraftId = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getRepairRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.form.aircraftType = data.parentId
+      this.getMaintenanceRecordAPI(this.currentNodeKey)
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircaftModelName = this.currentNode.label
-      this.form.aircaftModelId = this.currentNode.id
+      this.form.aircraftId = this.currentNodeKey
+      this.form.aircraftType = this.currentNode.parentId
     },
 
     handleClose() {
@@ -506,11 +555,11 @@ export default {
     submit() {
       switch (this.dialogTitle) {
         case '编辑':
-          this.updateRepairRecordAPI()
+          this.updateMaintenanceRecordAPI()
           this.handleClose()
           break
         case '新增':
-          this.addRepairRecordAPI()
+          this.addMaintenanceRecordAPI()
           this.handleClose()
           break
       }
@@ -527,7 +576,7 @@ export default {
         type: 'warning'
       })
         .then(() => {
-          this.removeRepairRecordAPI(row.map((e) => e.id))
+          this.removeMaintenanceRecordAPI(row.map((e) => e.id))
         })
         .catch(() => {})
     }
@@ -538,4 +587,3 @@ export default {
 <style lang="scss" scoped>
 @import '../index.scss';
 </style>
-@/api/als/repairRecord

+ 66 - 82
src/views/als/model/index.vue

@@ -1,18 +1,13 @@
 <template>
   <div class="view-table-content">
-    <div class="view-dataSpecies-left">
-      <MenuTree :currentNodeKey="currentNodeKey" nodeKey="id" :treedata="menuTreeData" @TreeNodeclick="treeNodeClick" v-bind="treeObj"> </MenuTree>
-    </div>
-    <div class="view-dataSpecies-right">
+    <div style="width: 100%">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <el-button type="success" @click="openDialog()">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
         </div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
+          <el-input placeholder="请输入名称" v-model="keyWordData" class="input1">
             <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
@@ -26,6 +21,11 @@
           <el-form-item label="模型名称" prop="name">
             <el-input v-model="form.name" placeholder="请输入模型名称" />
           </el-form-item>
+          <el-form-item label="模型类型" prop="type">
+            <el-select v-model="form.type" placeholder="请选择模型类型">
+              <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
           <el-form-item label="模型链接" prop="url">
             <el-input v-model="form.url" placeholder="请输入模型链接" />
           </el-form-item>
@@ -35,6 +35,12 @@
           <el-form-item label="数据列" prop="columnData">
             <el-input v-model="form.columnData" placeholder="请输入数据列" />
           </el-form-item>
+          <el-form-item label="状态" prop="status">
+            <el-select v-model="form.status" placeholder="请选择状态">
+              <el-option label="成功" value="0"></el-option>
+              <el-option label="失败" value="1"></el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item label="备注" prop="remark">
             <el-input v-model="form.remark" placeholder="请输入备注" />
           </el-form-item>
@@ -50,7 +56,7 @@
 </template>
 
 <script>
-import { getModel, getAircaftTypeAndModelTree, addModel, updateModel, removeModel } from '@/api/als/model'
+import { getModel, addModel, updateModel, removeModel } from '@/api/als/model'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'Model',
@@ -60,24 +66,8 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      keyWordData: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
-      menuTreeData: [],
-      treeObj: {
-        title: '所属机种',
-        activityheight: '275px',
-        searchIcon: false,
-        configure: {
-          children: 'children',
-          label: 'label'
-        }
-      },
-      typeTree: {
-        children: 'children',
-        label: 'label'
-      },
       searchValue: '',
       columns: [
         { prop: 'id', label: '编号' },
@@ -87,7 +77,15 @@ export default {
         },
         {
           prop: 'type',
-          label: '模型类型'
+          label: '模型类型',
+          render: (h, params) => {
+            const matchedItem = this.algoTypeList.find((item) => params.row.type == item.id)
+            if (matchedItem) {
+              return h('span', matchedItem.name)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'url',
@@ -103,7 +101,14 @@ export default {
         },
         {
           prop: 'status',
-          label: '状态'
+          label: '状态',
+          render: (h, params) => {
+            if (params.row.status == 0) {
+              return h('span', { class: 'success-state' }, '成功')
+            } else {
+              return h('span', { class: 'warning-state' }, '失败')
+            }
+          }
         },
         {
           prop: 'remark',
@@ -120,7 +125,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.handUpdate(row)
               }
             },
             {
@@ -129,7 +134,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -169,7 +174,15 @@ export default {
         updateBy: '',
         updateTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      algoTypeList: [
+        { id: 1, name: '去噪' },
+        { id: 2, name: '扩充' },
+        { id: 3, name: '补全' },
+        { id: 4, name: '虚警抑制' },
+        { id: 5, name: '故障诊断' },
+        { id: 6, name: '寿命预测' }
+      ]
     }
   },
   watch: {
@@ -179,50 +192,23 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getModelAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
-      this.menuTreeData = data
-      if (data.length) {
-        this.currentNodeKey = data[0].value
-        this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getModelAPI({ aircaftModelIdList: this.aircaftModelIdList })
-      }
-    },
-
     async removeModelAPI(params) {
       try {
-        const { success } = await removeModel(params)
-        if (success) {
+        const { code } = await removeModel(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getModelAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getModelAPI()
           this.handleClose()
         }
       } catch (error) {}
     },
 
-    getTreeLeafData(list) {
-      const newArr = []
-      function getLeaf(data, arr) {
-        data.forEach((e) => {
-          if (e.type === 1) {
-            arr.push(e)
-          }
-          if (e.children.length) {
-            getLeaf(e.children, arr)
-          }
-        })
-      }
-      getLeaf(list, newArr)
-      return newArr
-    },
-
     async getModelAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
@@ -235,53 +221,51 @@ export default {
     },
 
     fetch() {
-      this.getModelAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getModelAPI()
     },
 
-    searchClick() {
-      this.getModelAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      if (this.keyWordData) {
+        const {
+          data: { list, totalCount }
+        } = await getModel({ name: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getModelAPI()
+      }
     },
 
     async addModelAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addModel({ ...this.form })
-        if (success) {
+        const { code } = await addModel({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getModelAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getModelAPI()
         }
       } catch (error) {}
     },
 
     async updateModelAPI() {
       try {
-        const { success } = await updateModel({ ...this.form })
-        if (success) {
+        const { code } = await updateModel({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getModelAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getModelAPI()
         }
       } catch (error) {}
     },
 
-    treeNodeClick(data) {
-      this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
-      this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getModelAPI({ aircaftModelIdList: this.aircaftModelIdList })
-    },
-
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircaftModelName = this.currentNode.label
-      this.form.aircaftModelId = this.currentNode.id
     },
 
     handleClose() {
@@ -329,7 +313,7 @@ export default {
     },
 
     remove(row) {
-      this.$confirm('是否删除该机种', '提示', {
+      this.$confirm('是否删除该模型', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'

+ 73 - 44
src/views/als/partReplacement/index.vue

@@ -6,13 +6,13 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
+          <el-button type="primary">导入</el-button>
+          <el-button type="primary">导出</el-button>
         </div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
+          <el-input placeholder="请输入换件前器材名称" v-model="keyWordData" class="input1">
             <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
@@ -22,26 +22,31 @@
       </div>
       <!-- 添加或修改换件记录对话框 -->
       <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px">
-          <el-form-item label="飞机编码" prop="aircraftCode">
+        <el-form ref="form" :model="form" label-width="80px" style="height: 50vh; overflow-y: scroll">
+          <!-- <el-form-item label="飞机编码" prop="aircraftCode">
             <el-input v-model="form.aircraftCode" placeholder="请输入飞机编码" />
+          </el-form-item> -->
+          <el-form-item label="编目" prop="aircraftCode">
+            <el-select v-model="form.aircraftCode" placeholder="请选择编目" disabled>
+              <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
+            </el-select>
           </el-form-item>
-          <el-form-item label="换件前器材编码" prop="beforeEquipmentCode">
+          <el-form-item label="换件前器材编码" label-width="120px" prop="beforeEquipmentCode">
             <el-input v-model="form.beforeEquipmentCode" placeholder="请输入换件前器材编码" />
           </el-form-item>
-          <el-form-item label="换件前器材名称" prop="beforeEquipmentName">
+          <el-form-item label="换件前器材名称" label-width="120px" prop="beforeEquipmentName">
             <el-input v-model="form.beforeEquipmentName" placeholder="请输入换件前器材名称" />
           </el-form-item>
-          <el-form-item label="换件前规格型号" prop="beforeModelNumber">
+          <el-form-item label="换件前规格型号" label-width="120px" prop="beforeModelNumber">
             <el-input v-model="form.beforeModelNumber" placeholder="请输入换件前规格型号" />
           </el-form-item>
-          <el-form-item label="换件后器材编码" prop="afterEquipmentCode">
+          <el-form-item label="换件后器材编码" label-width="120px" prop="afterEquipmentCode">
             <el-input v-model="form.afterEquipmentCode" placeholder="请输入换件后器材编码" />
           </el-form-item>
-          <el-form-item label="换件后器材名称" prop="afterEquipmentName">
+          <el-form-item label="换件后器材名称" label-width="120px" prop="afterEquipmentName">
             <el-input v-model="form.afterEquipmentName" placeholder="请输入换件后器材名称" />
           </el-form-item>
-          <el-form-item label="换件后规格型号" prop="afterModelNumber">
+          <el-form-item label="换件后规格型号" label-width="120px" prop="afterModelNumber">
             <el-input v-model="form.afterModelNumber" placeholder="请输入换件后规格型号" />
           </el-form-item>
           <el-form-item label="更换数量" prop="quantity">
@@ -62,7 +67,9 @@
 </template>
 
 <script>
-import { getPartReplacement, getAircaftTypeAndModelTree, addPartReplacement, updatePartReplacement, removePartReplacement } from '@/api/als/partReplacement'
+import { getPartReplacement, addPartReplacement, updatePartReplacement, removePartReplacement } from '@/api/als/partReplacement'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'PartReplacement',
@@ -72,10 +79,10 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      keyWordData: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -95,7 +102,15 @@ export default {
         { prop: 'id', label: '编号' },
         {
           prop: 'aircraftCode',
-          label: '飞机编码'
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftCode.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'beforeEquipmentCode',
@@ -140,7 +155,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.handUpdate(row)
               }
             },
             {
@@ -149,7 +164,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -191,7 +206,8 @@ export default {
         updateBy: '',
         updateTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      aircaftCatalogAll: []
     }
   },
   watch: {
@@ -201,29 +217,34 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
       if (data.length) {
-        this.currentNodeKey = data[0].value
+        this.currentNodeKey = data[0].id
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getPartReplacementAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        this.getPartReplacementAPI()
       }
     },
 
     async removePartReplacementAPI(params) {
       try {
-        const { success } = await removePartReplacement(params)
-        if (success) {
+        const { code } = await removePartReplacement(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getPartReplacementAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getPartReplacementAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -251,59 +272,67 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getPartReplacement({ pageSize, pageIndex, keyWord, ...params })
+      } = await getPartReplacement({ pageSize, pageIndex, aircraftCode: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getPartReplacementAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getPartReplacementAPI(this.currentNodeKey)
     },
 
-    searchClick() {
-      this.getPartReplacementAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      if (this.keyWordData) {
+        const {
+          data: { list, totalCount }
+        } = await getPartReplacement({ aircraftCode: this.currentNodeKey, beforeEquipmentName: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getPartReplacementAPI(this.currentNodeKey)
+      }
     },
 
     async addPartReplacementAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addPartReplacement({ ...this.form })
-        if (success) {
+        const { code } = await addPartReplacement({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getPartReplacementAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getPartReplacementAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     async updatePartReplacementAPI() {
       try {
-        const { success } = await updatePartReplacement({ ...this.form })
-        if (success) {
+        const { code } = await updatePartReplacement({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getPartReplacementAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getPartReplacementAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
+      this.currentNodeKey = this.form.aircraftCode = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getPartReplacementAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.form.aircraftType = data.label
+      this.getPartReplacementAPI(this.currentNodeKey)
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircaftModelName = this.currentNode.label
-      this.form.aircaftModelId = this.currentNode.id
+      this.form.aircraftCode = this.currentNodeKey
+      this.form.aircraftType = this.currentNode.label
     },
 
     handleClose() {

+ 160 - 52
src/views/als/preProcessing/index.vue

@@ -6,14 +6,14 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <!-- <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
+          <el-button type="primary">导入</el-button>
+          <el-button type="primary">导出</el-button> -->
         </div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          <el-input placeholder="请输入关键字" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
           </el-input>
         </div>
       </div>
@@ -48,12 +48,41 @@
           <el-button type="primary" @click="submit">确 定</el-button>
         </span>
       </el-dialog>
+      <!-- 算法执行页面 -->
+      <el-dialog title="选择算法" :visible.sync="executeVisible" width="800px" :before-close="handleClose">
+        <el-form :inline="true" :model="agloForm" class="demo-form-inline">
+          <el-form-item label="算法类型">
+            <el-select v-model="agloForm.agloType" placeholder="请选择算法类型" @change="changeAgloType(agloForm.agloType)">
+              <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="算法名称">
+            <el-select v-model="agloForm.agloName" placeholder="算法名称">
+              <el-option v-for="item in algoNameList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="选择参数">
+            <el-transfer v-model="agloForm.paramsList" :data="transferData"></el-transfer>
+          </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose">取 消</el-button>
+          <el-button type="primary" @click="beginExecute">开始执行</el-button>
+        </span>
+      </el-dialog>
+      <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px" :before-close="handleClose">
+        <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getPreProcessing, getAircaftTypeAndModelTree, addPreProcessing, updatePreProcessing, removePreProcessing } from '@/api/als/preProcessing'
+import { getPreProcessing, addPreProcessing, updatePreProcessing, removePreProcessing } from '@/api/als/preProcessing'
+import { getAircaftCatalogAll } from '@/api/als/aircraft'
+import { getAircaftCatalogTree } from '@/api/als/sideTree'
+import { getDataImport } from '@/api/als/dataImport'
+import { getModel } from '@/api/als/model'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'PreProcessing',
@@ -63,10 +92,12 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      executeVisible: false,
+      progressVisible: false,
+      keyWordData: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -90,7 +121,15 @@ export default {
         },
         {
           prop: 'aircraftId',
-          label: '机号'
+          label: '编目',
+          render: (h, params) => {
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.aircaftCatalogCode)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'modelType',
@@ -122,12 +161,21 @@ export default {
           width: '240px',
           group: [
             {
-              name: '编辑',
+              name: '查看',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.checkResultList(row)
+              }
+            },
+            {
+              name: '执行',
               type: 'text',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.executeAglo(row)
               }
             },
             {
@@ -136,7 +184,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -177,7 +225,23 @@ export default {
         updateBy: '',
         updateTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      agloForm: {
+        sortieNo: '',
+        aircraftId: '',
+        agloType: '',
+        agloName: '',
+        paramsList: []
+      },
+      debounceFn: debounce(this.fetch, 500),
+      aircaftCatalogAll: [],
+      transferData: [],
+      algoTypeList: [
+        { id: 1, name: '去噪' },
+        { id: 2, name: '扩充' },
+        { id: 3, name: '补全' }
+      ],
+      algoNameList: [],
+      percentage: 0
     }
   },
   watch: {
@@ -187,29 +251,35 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const getAircaftCatalogAllParams = {
+        keyWord: '',
+        aircaftModelIdList: []
+      }
+      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+      this.aircaftCatalogAll = data2
       if (data.length) {
         this.currentNodeKey = data[0].value
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getPreProcessingAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        // this.getPreProcessingAPI(this.currentNodeKey)
+        this.getDataImportAPI()
       }
     },
 
     async removePreProcessingAPI(params) {
       try {
-        const { success } = await removePreProcessing(params)
-        if (success) {
+        const { code } = await removePreProcessing(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getPreProcessingAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getPreProcessingAPI(this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -237,42 +307,61 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getPreProcessing({ pageSize, pageIndex, keyWord, ...params })
+      } = await getPreProcessing({ pageSize, pageIndex, aircraftId: params })
+      this.tableData = list
+      this.tableRequset.total = totalCount
+    },
+
+    async getDataImportAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, totalCount }
+      } = await getDataImport({ pageSize, pageIndex, aircraftId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getPreProcessingAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getPreProcessingAPI(this.currentNodeKey)
     },
 
-    searchClick() {
-      this.getPreProcessingAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      // this.getPreProcessingAPI(this.currentNodeKey)
+      if (this.keyWordData && this.currentNodeKey !== 'quanbu') {
+        const {
+          data: { list, totalCount }
+        } = await getDataImport({ aircraftId: this.currentNodeKey, sortieNo: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getDataImportAPI(this.currentNodeKey)
+      }
     },
 
     async addPreProcessingAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addPreProcessing({ ...this.form })
-        if (success) {
+        const { code } = await addPreProcessing({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getPreProcessingAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getPreProcessingAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     async updatePreProcessingAPI() {
       try {
-        const { success } = await updatePreProcessing({ ...this.form })
-        if (success) {
+        const { code } = await updatePreProcessing({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getPreProcessingAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getPreProcessingAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
@@ -281,8 +370,7 @@ export default {
       this.$refs.table.clearSelection()
       this.currentNodeKey = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getPreProcessingAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getDataImportAPI(this.currentNodeKey)
     },
 
     openDialog() {
@@ -293,24 +381,11 @@ export default {
     },
 
     handleClose() {
-      this.dialogVisible = false
-      this.form = {
-        id: '',
-        sortieNo: '',
-        aircraftId: '',
-        modelType: '',
-        param: '',
-        columnData: '',
-        ossId: '',
-        result: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+      this.executeVisible = false
+      this.agloForm = {
+        agloType: '',
+        agloName: '',
+        paramsList: []
       }
     },
 
@@ -319,6 +394,39 @@ export default {
       this.form = deepClone(row)
       this.dialogVisible = true
     },
+    checkResultList(row) {
+      this.agloForm.sortieNo = row.sortieNo
+      this.agloForm.aircraftId = row.aircraftId
+      this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
+    },
+    executeAglo(row) {
+      this.executeVisible = true
+      this.agloForm.sortieNo = row.sortieNo
+      this.agloForm.aircraftId = row.aircraftId
+    },
+    beginExecute() {
+      // 调用算法接口
+
+      this.executeVisible = false
+      this.progressVisible = true
+      const myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          this.percentage += 1
+        } else {
+          this.progressVisible = false
+          this.percentage = 0
+          clearInterval(myTimer)
+          this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
+          this.handleClose()
+        }
+      }, 30)
+    },
+    async changeAgloType(type) {
+      const {
+        data: { list }
+      } = await getModel({ type })
+      this.algoNameList = list
+    },
 
     submit() {
       switch (this.dialogTitle) {

+ 237 - 0
src/views/als/preProcessing/preResult.vue

@@ -0,0 +1,237 @@
+<template>
+  <div class="view-table-content">
+    <div style="width: 100%">
+      <div class="view-dataType-title">
+        <div class="view-dataType-title-btn">
+          <el-button type="success" @click="backPage()">返回</el-button>
+          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
+        </div>
+        <div class="view-dataType-title-search">
+          <el-input placeholder="请输入名称" v-model="keyWordData" class="input1">
+            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
+          </el-input>
+        </div>
+      </div>
+      <div class="view-dataType-table">
+        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
+      </div>
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="1000px" :before-close="handleClose">
+        <el-form ref="form" :inline="true" :model="form" label-width="80px">
+          <el-form-item label="架次号" prop="sortieNo">
+            <el-input v-model="form.sortieNo" placeholder="请输入架次号" />
+          </el-form-item>
+          <el-form-item label="编目" prop="aircraftId">
+            <el-input v-model="form.aircraftId" placeholder="请输入编目" />
+          </el-form-item>
+          <el-form-item label="模型类型" prop="modelType">
+            <el-input v-model="form.modelType" placeholder="请输入模型类型" />
+          </el-form-item>
+          <el-form-item label="模型名称" prop="modelName">
+            <el-input v-model="form.modelName" placeholder="请输入模型名称" />
+          </el-form-item>
+          <el-form-item label="参数" prop="dataParams">
+            <el-input v-model="form.dataParams" placeholder="请输入参数" />
+          </el-form-item>
+        </el-form>
+        <div style="height: 200px">虚警抑制结果</div>
+        <span slot="footer" class="dialog-footer">
+          <el-button type="primary">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getModel, removeModel } from '@/api/als/model'
+import { deepClone, debounce } from '@/utils/index'
+export default {
+  name: 'PreResult',
+  components: {},
+  data() {
+    // 这里存放数据
+    return {
+      dialogTitle: '新增',
+      dialogVisible: false,
+      keyWordData: '',
+      aircaftModelIdList: [],
+      searchValue: '',
+      columns: [
+        {
+          prop: 'sortieNo',
+          label: '架次号'
+        },
+        {
+          prop: 'aircraftId',
+          label: '编目'
+        },
+        {
+          prop: 'modelType',
+          label: '模型类型'
+        },
+        {
+          prop: 'modelName',
+          label: '模型名称'
+        },
+        {
+          prop: 'dataParams',
+          label: '参数'
+        },
+        {
+          button: true,
+          label: '操作',
+          width: '240px',
+          group: [
+            {
+              name: '查看结果',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.checkResult(row)
+              }
+            },
+            {
+              name: '删除',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.remove([row])
+              }
+            }
+          ]
+        }
+      ],
+      options: {
+        stripe: true, // 斑马纹
+        mutiSelect: true, // 多选框
+        index: false, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: 'calc(100vh - 300px)'
+      },
+      tableCheckItems: [],
+      tableData: [
+        {
+          id: '11',
+          aircraftId: '34345345',
+          sortieNo: '001',
+          modelType: '去噪',
+          modelName: '11',
+          dataParams: '参数1、参数2...'
+        }
+      ],
+      tableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      form: {
+        id: '',
+        sortieNo: '',
+        aircraftId: '',
+        modelType: '',
+        modelName: '',
+        paramsList: ''
+      },
+      debounceFn: debounce(this.fetch, 500),
+      agloForm: []
+    }
+  },
+  watch: {
+    keyWord() {
+      this.tableRequset.pageIndex = 1
+      this.debounceFn()
+    }
+  },
+  mounted() {
+    // this.getModelAPI()
+    this.agloForm = this.$route.params
+  },
+  methods: {
+    async removeModelAPI(params) {
+      try {
+        const { code } = await removeModel(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          await this.getModelAPI()
+          this.handleClose()
+        }
+      } catch (error) {}
+    },
+
+    async getModelAPI(params) {
+      if (this.$refs.table) this.$refs.table.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, totalCount }
+      } = await getModel({ pageSize, pageIndex, keyWord, ...params })
+      this.tableData = list
+      this.tableRequset.total = totalCount
+    },
+
+    fetch() {
+      this.getModelAPI()
+    },
+
+    async searchClick() {
+      if (this.keyWordData) {
+        const {
+          data: { list, totalCount }
+        } = await getModel({ name: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getModelAPI()
+      }
+    },
+    checkResult(row) {
+      this.dialogTitle = '结果'
+      this.form = deepClone(row)
+      this.dialogVisible = true
+    },
+
+    handleClose() {
+      this.dialogVisible = false
+      this.agloForm = {
+        id: '',
+        sortieNo: '',
+        aircraftId: '',
+        modelType: '',
+        modelName: '',
+        paramsList: ''
+      }
+    },
+
+    selection(val) {
+      this.tableCheckItems = val
+    },
+
+    remove(row) {
+      this.$confirm('是否删除该模型', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeModelAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    },
+    backPage() {
+      this.$router.go(-1)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import '../index.scss';
+</style>

+ 63 - 32
src/views/als/trainingData/index.vue

@@ -6,13 +6,13 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="currentNode && !currentNode.type == 1">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-          <el-button type="primary">导入模板</el-button>
-          <el-button type="primary">导出模板</el-button>
+          <el-button type="primary">导入</el-button>
+          <el-button type="primary">导出</el-button>
         </div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
+          <el-input placeholder="请输入关键字" v-model="keyWordData" class="input1">
             <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
@@ -30,10 +30,19 @@
             <el-input v-model="form.author" placeholder="请输入作者" />
           </el-form-item>
           <el-form-item label="出版时间" prop="publicationDate">
-            <el-date-picker clearable v-model="form.publicationDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择出版时间"> </el-date-picker>
+            <el-date-picker clearable v-model="form.publicationDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择出版时间"> </el-date-picker>
+          </el-form-item>
+          <el-form-item label="资料类型" prop="type">
+            <el-input v-model="form.type" placeholder="请输入资料类型" />
+          </el-form-item>
+          <el-form-item label="机型" prop="aircaftModel">
+            <el-select v-model="form.aircaftModelId" placeholder="请选择机型" disabled>
+              <el-option v-for="item in aircaftModelAll" :key="item.aircaftModelId" :label="item.aircaftModelName" :value="item.aircaftModelId"> </el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="文件Id" prop="ossId">
-            <el-input v-model="form.ossId" placeholder="请输入文件Id" />
+            <!-- <el-input v-model="form.ossId" placeholder="请输入文件Id" /> -->
+            <FileUpload :fileSize="500" :fileType="['pdf', 'docx']" />
           </el-form-item>
         </el-form>
 
@@ -47,7 +56,9 @@
 </template>
 
 <script>
-import { getTechnicalDoc, getAircaftTypeAndModelTree, addTechnicalDoc, updateTechnicalDoc, removeTechnicalDoc } from '@/api/als/technicalDoc'
+import { getTechnicalDoc, addTechnicalDoc, updateTechnicalDoc, removeTechnicalDoc } from '@/api/als/technicalDoc'
+import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftModelAll } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 export default {
   name: 'TrainingData',
@@ -57,7 +68,7 @@ export default {
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      keyWordData: '',
       aircaftModelIdList: [],
       currentNodeKey: null,
       currentNode: null,
@@ -94,6 +105,10 @@ export default {
           prop: 'type',
           label: '资料类型'
         },
+        {
+          prop: 'aircaftModelId',
+          label: '所属机型'
+        },
         {
           prop: 'ossId',
           label: '文件Id'
@@ -109,7 +124,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.handUpdate(row)
+                this.handUpdate(row)
               }
             },
             {
@@ -118,7 +133,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                _this.remove([row])
+                this.remove([row])
               }
             }
           ]
@@ -146,6 +161,7 @@ export default {
         name: '',
         author: '',
         publicationDate: '',
+        aircaftModelId: '',
         type: '',
         ossId: '',
         tenantId: '',
@@ -156,7 +172,8 @@ export default {
         updateBy: '',
         updateTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      aircaftModelAll: []
     }
   },
   watch: {
@@ -172,23 +189,29 @@ export default {
     async getAircaftTypeAndModelTreeAPI(params) {
       const { data } = await getAircaftTypeAndModelTree(params)
       this.menuTreeData = data
+      const getAircaftModelAllParams = {
+        aircaftTypeCode: '',
+        aircaftTypeId: '',
+        queryParam: ''
+      }
+      const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
+      this.aircaftModelAll = data1
       if (data.length) {
-        this.currentNodeKey = data[0].value
+        this.currentNodeKey = data[0].id
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getTechnicalDocAPI({ aircaftModelIdList: this.aircaftModelIdList })
+        this.getTechnicalDocAPI()
       }
     },
 
     async removeTechnicalDocAPI(params) {
       try {
-        const { success } = await removeTechnicalDoc(params)
-        if (success) {
+        const { code } = await removeTechnicalDoc(params)
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          await this.getTechnicalDocAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          await this.getTechnicalDocAPI(this.currentNodeKey === 'quanbu' ? null : this.currentNodeKey)
           this.handleClose()
         }
       } catch (error) {}
@@ -216,59 +239,66 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, totalCount }
-      } = await getTechnicalDoc({ pageSize, pageIndex, keyWord, ...params })
+      } = await getTechnicalDoc({ pageSize, pageIndex, aircaftModelId: params })
       this.tableData = list
       this.tableRequset.total = totalCount
     },
 
     fetch() {
-      this.getTechnicalDocAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getTechnicalDocAPI(this.currentNodeKey)
     },
 
-    searchClick() {
-      this.getTechnicalDocAPI({ aircaftModelIdList: this.aircaftModelIdList })
+    async searchClick() {
+      // this.getTechnicalDocAPI(this.currentNodeKey)
+      if (this.keyWordData) {
+        const {
+          data: { list, totalCount }
+        } = await getTechnicalDoc({ aircaftModelId: this.currentNodeKey, name: this.keyWordData })
+        this.tableData = list
+        this.tableRequset.total = totalCount
+      } else {
+        this.getTechnicalDocAPI(this.currentNodeKey)
+      }
     },
 
     async addTechnicalDocAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addTechnicalDoc({ ...this.form })
-        if (success) {
+        const { code } = await addTechnicalDoc({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getTechnicalDocAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getTechnicalDocAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     async updateTechnicalDocAPI() {
       try {
-        const { success } = await updateTechnicalDoc({ ...this.form })
-        if (success) {
+        const { code } = await updateTechnicalDoc({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getTechnicalDocAPI({ aircaftModelIdList: this.aircaftModelIdList })
+          this.getTechnicalDocAPI(this.currentNodeKey)
         }
       } catch (error) {}
     },
 
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
+      this.currentNodeKey = this.form.aircaftModelId = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getTechnicalDocAPI({ aircaftModelIdList: this.aircaftModelIdList })
+      this.getTechnicalDocAPI(this.currentNodeKey)
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircaftModelName = this.currentNode.label
-      this.form.aircaftModelId = this.currentNode.id
+      this.form.aircaftModelId = this.currentNodeKey
     },
 
     handleClose() {
@@ -280,6 +310,7 @@ export default {
         publicationDate: '',
         type: '',
         ossId: '',
+        aircaftModelId: '',
         tenantId: '',
         version: '',
         delFlag: '',

+ 4 - 7
src/views/home/index.vue

@@ -77,10 +77,7 @@ export default {
       bottomRightOptions
     }
   },
-  mounted() {
-    this.getTreeList()
-    this.initChart()
-  },
+  mounted() {},
   methods: {
     initChart() {
       this.fetchTermChart()
@@ -89,9 +86,9 @@ export default {
       // this.extension(echartTop)
     },
     async fetchTableData() {
-      const { data } = await getHomeLastMission()
-      this.tableData = data
-      this.fetchIndexAnalysis()
+      // const { data } = await getHomeLastMission()
+      // this.tableData = data
+      // this.fetchIndexAnalysis()
     },
     handleChange(item) {
       switch (item) {

+ 2 - 2
vue.config.js

@@ -8,11 +8,11 @@ module.exports = defineConfig({
     open: true, //值为 true的话,项目启动时自动打开到浏览器里边, false不会打开
     proxy: {
       ['/als']: {
-        target: 'http://127.0.0.1:9090',
+        target: 'http://localhost:9090',
         ws: false, //也可以忽略不写,不写不会影响跨域
         changeOrigin: true, //是否开启跨域,值为 true 就是开启, false 不开启
         pathRewrite: {
-          ['^' + '/als']: '/als'
+          ['^' + '/als']: ''
         }
       },
       [process.env.VUE_APP_BASE_API]: {