Rmengdi 7 months ago
parent
commit
3747e76f55

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

@@ -62,3 +62,8 @@ export const getAircaftModelAll = async (data) => {
 export const getAircaftCatalogAll = async (data) => {
   return await post('/basicdata/aircaftCatalog/getAircaftCatalogAll', data)
 }
+
+// 获取所有飞行任务(包含子任务)
+export const getflyTaskAll = async (data) => {
+  return await post('/carryingtask/flyTask/queryFlyTaskTree', data)
+}

+ 10 - 0
src/api/als/algorithm.js

@@ -5,6 +5,16 @@ export const getColumnDataAPI = async (ossId) => {
   return await get('/als/algorithm/' + ossId)
 }
 
+// 获取数据根据OssId
+export const getOssIdDataAPI = async (ossId) => {
+  return await get('/als/algorithm/data/' + ossId)
+}
+
+// 根据OssId获取数据曲线
+export const getOssIdPlaybackDataAPI = async (ossId) => {
+  return await get('/als/algorithm/playback/data/' + ossId)
+}
+
 // 执行预处理算法
 export const executePreProcessing = async (data) => {
   return await post('/als/algorithm/execute/pro', data)

+ 6 - 0
src/components/LTable/index.vue

@@ -14,6 +14,7 @@
       @select-all="selectAll"
       @row-click="handleRowClick"
       @selection-change="handleSelectionChange"
+      @current-change="handleCurrentChange"
       highlight-current-row
       default-expand-all
       :cell-style="cellStyle"
@@ -292,6 +293,11 @@ export default {
       this.$emit('selection-change', selection)
     },
 
+    // 单选框
+    handleCurrentChange(selection) {
+      this.$emit('current-change', selection)
+    },
+
     // 点击table某一行时触发事件
     handleRowClick(row, event, column) {
       this.$emit('handleRowClick', row, event, column)

+ 37 - 26
src/views/als/MDCData/index.vue

@@ -43,6 +43,9 @@
           </el-form-item>
           <el-form-item label="架次号" prop="sortieNo">
             <el-input v-model="form.sortieNo" placeholder="请输入架次号" />
+            <!-- <el-select v-model="form.sortieNo" placeholder="请选择架次号">
+              <el-option v-for="item in flyTaskTree" :key="item.taskId" :label="item.taskName" :value="item.taskId"> </el-option>
+            </el-select> -->
           </el-form-item>
           <el-form-item label="飞行日期" prop="flightDate">
             <el-date-picker v-model="form.flightDate" type="date" value-format="yyyy-MM-dd" placement="bottom-start" placeholder="请选择飞行日期"> </el-date-picker>
@@ -80,7 +83,7 @@
 <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 { getAircaftModelAll, getAircaftCatalogAll, getflyTaskAll } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 import { getItem } from '@/utils/index'
 import FileUpload from '@/views/als/components/FileUpload'
@@ -114,7 +117,7 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '唯一编号' },
+        // { prop: 'id', label: '唯一编号' },
         {
           prop: 'ossId',
           label: '文件编号'
@@ -210,6 +213,7 @@ export default {
       debounceFn: debounce(this.fetch, 500),
       aircaftModelAll: [],
       aircaftCatalogAll: [],
+      flyTaskTree: [],
       upload: {
         open: false,
         title: '',
@@ -236,29 +240,36 @@ export default {
   },
   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].id
-        this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
-          .map((e) => e.id)
-          .toString()
-        this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
-      }
+      try {
+        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].id
+          this.currentNode = data[0]
+          this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
+            .map((e) => e.id)
+            .toString()
+          this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
+        }
+        const res = await getflyTaskAll({
+          status: null, //状态
+          queryParam: '' //查询条件
+        })
+        this.flyTaskTree = res.data
+      } catch (error) {}
     },
 
     async removeDataImportAPI(params) {
@@ -298,7 +309,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getDataImport({ pageSize, pageIndex, ...params, source: 2 })
+      } = await getDataImport({ pageSize, pageNum: pageIndex, ...params, source: 2 })
       this.tableData = list
       this.tableRequset.total = total
     },

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

@@ -276,7 +276,7 @@ export default {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
       const { pageSize, pageIndex } = this.tableRequset
-      const { data, code } = await getAirConfiguration({ pageSize, pageIndex, ...params })
+      const { data, code } = await getAirConfiguration({ pageSize, pageNum: pageIndex, ...params })
       if (code === 200) {
         this.tableData = []
         if (!(this.currentNode.type == 1 && this.currentNode.children.length == 0)) {

+ 1 - 1
src/views/als/airInstall/index.vue

@@ -327,7 +327,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getAirInstall({ pageSize, pageIndex, ...params })
+      } = await getAirInstall({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 104 - 0
src/views/als/components/Charts/playBackChart.vue

@@ -0,0 +1,104 @@
+<template>
+  <div :ref="chartRef" :style="{ height: height, width: width }"></div>
+</template>
+
+<script>
+import * as echarts from 'echarts'
+export default {
+  name: 'PlayBackChart',
+  props: {
+    chartRef: {
+      type: String,
+      required: true
+    },
+    width: {
+      type: String,
+      default: '100%'
+    },
+    height: {
+      type: String,
+      default: '400px'
+    },
+    /**
+     * chartData包括:
+     * title:''
+     * legendData:[]
+     * xAxisData:{}
+     * yAxisData:{}
+     * seriesData:{}
+     */
+    chartData: {
+      type: Object,
+      required: true
+    }
+  },
+  data() {
+    return {
+      chart: null
+    }
+  },
+  watch: {
+    chartData: {
+      deep: true,
+      handler(val) {
+        this.setOptions(val)
+      }
+    }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.initChart()
+    })
+  },
+  beforeDestroy() {
+    if (!this.chart) {
+      return
+    }
+    this.chart.dispose()
+    this.chart = null
+  },
+  computed: {},
+  methods: {
+    initChart() {
+      if (!this.chart) {
+        return
+      }
+      this.chart.dispose()
+      this.chart = null
+      this.chart = echarts.init(this.$refs.chartRef)
+      this.setOptions(this.chartData)
+    },
+    setOptions({ title, legendData, xAxisData, yAxisData, seriesData } = {}) {
+      this.chart.setOption({
+        title: {
+          text: title
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: legendData,
+          textStyle: {
+            //图例文字的样式
+            color: '#fff'
+          }
+        },
+        color: color,
+        xAxis: {
+          type: 'category',
+          data: xAxisData,
+          name: 'Index'
+        },
+        yAxis: {
+          type: 'value',
+          name: 'Value',
+          data: yAxisData
+        },
+        // series: series
+        series: seriesData
+      })
+    }
+  }
+}
+</script>
+<style lang="scss" scoped></style>

+ 1 - 6
src/views/als/components/FileUpload/index.vue

@@ -77,13 +77,8 @@ export default {
     return {
       number: 0,
       uploadList: [],
-      baseUrl: '/als',
-      uploadFileUrl: '/als/common/upload',
       // baseUrl: '/api',
-      // uploadFileUrl: '/api' + '/common/upload', // 上传文件服务器地址
-      // headers: {
-      //   Authorization: 'Bearer ' + getToken()
-      // },
+      uploadFileUrl: '/api/als/common/upload',
       headers: { Authorization: getItem('token') },
       fileList: [],
       loading: null

+ 2 - 2
src/views/als/falseAlarm/index.vue

@@ -408,7 +408,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getFalseAlarm({ pageSize, pageIndex, ...params })
+      } = await getFalseAlarm({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },
@@ -419,7 +419,7 @@ export default {
       const { pageSize, pageIndex } = this.resultTableRequset
       const {
         data: { list, total }
-      } = await getFalseAlarmResult({ pageSize, pageIndex, ...params })
+      } = await getFalseAlarmResult({ pageSize, pageNum: pageIndex, ...params })
       this.resultTableData = list
       this.resultTableRequset.total = total
     },

+ 1 - 1
src/views/als/falseAlarmResult/index.vue

@@ -118,7 +118,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getFalseAlarmResult({ pageSize, pageIndex, ...params })
+      } = await getFalseAlarmResult({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 1 - 1
src/views/als/faultCase/index.vue

@@ -356,7 +356,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getFaultCase({ pageSize, pageIndex, ...params })
+      } = await getFaultCase({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 1 - 1
src/views/als/faultDiagnosis/index.vue

@@ -356,7 +356,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getFaultDiagnosis({ pageSize, pageIndex, ...params })
+      } = await getFaultDiagnosis({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 1 - 1
src/views/als/flightData/index.vue

@@ -267,7 +267,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getDataImport({ pageSize, pageIndex, ...params, source: 1 })
+      } = await getDataImport({ pageSize, pageNum: pageIndex, ...params, source: 1 })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 1 - 1
src/views/als/lifePrediction/index.vue

@@ -291,7 +291,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getLifePrediction({ pageSize, pageIndex, ...params })
+      } = await getLifePrediction({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 1 - 1
src/views/als/maintenanceDecision/index.vue

@@ -319,7 +319,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getMaintenanceDecision({ pageSize, pageIndex, ...params })
+      } = await getMaintenanceDecision({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 1 - 1
src/views/als/maintenanceRecord/index.vue

@@ -452,7 +452,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getMaintenanceRecord({ pageSize, pageIndex, ...params })
+      } = await getMaintenanceRecord({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 1 - 1
src/views/als/maintenanceask/index.vue

@@ -307,7 +307,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getMaintenanceask({ pageSize, pageIndex, ...params })
+      } = await getMaintenanceask({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 2 - 2
src/views/als/maintenanceask/viewDetails.vue

@@ -345,7 +345,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getResourceAllocation({ pageSize, pageIndex, ...params })
+      } = await getResourceAllocation({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },
@@ -356,7 +356,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset2
       const {
         data: { list, totalCount }
-      } = await getPersonnelAllocation({ pageSize, pageIndex, ...params })
+      } = await getPersonnelAllocation({ pageSize, pageNum: pageIndex, ...params })
       this.tableData2 = list
       this.tableRequset2.total = totalCount
     },

+ 2 - 10
src/views/als/model/index.vue

@@ -205,7 +205,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getModel({ pageSize, pageIndex, keyWord, ...params })
+      } = await getModel({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },
@@ -215,15 +215,7 @@ export default {
     },
 
     async searchClick() {
-      if (this.keyWordData) {
-        const {
-          data: { list, total }
-        } = await getModel({ name: this.keyWordData })
-        this.tableData = list
-        this.tableRequset.total = total
-      } else {
-        this.getModelAPI()
-      }
+      this.getModelAPI({ name: keyWordData })
     },
 
     async addModelAPI() {

+ 1 - 1
src/views/als/partReplacement/index.vue

@@ -276,7 +276,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getPartReplacement({ pageSize, pageIndex, ...params })
+      } = await getPartReplacement({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 28 - 7
src/views/als/preProcessing/index.vue

@@ -70,7 +70,7 @@
         <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
       </el-dialog>
       <el-dialog title="结果展示" :visible.sync="resultVisible" width="800px">
-        展示结果
+        <PlayBackChart chartRef="preResultRef" :chartData="chartData" />
         <span slot="footer" class="dialog-footer">
           <el-button @click="resultVisible = false">取 消</el-button>
           <el-button type="primary" @click="resultVisible = false">确 定</el-button>
@@ -82,16 +82,17 @@
 
 <script>
 import { getPreProcessing, addPreProcessing, updatePreProcessing, removePreProcessing } from '@/api/als/preProcessing'
-import { getColumnDataAPI, executePreProcessing } from '@/api/als/algorithm'
+import { getColumnDataAPI, executePreProcessing, getOssIdPlaybackDataAPI } from '@/api/als/algorithm'
 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'
+import PlayBackChart from '@/views/als/components/Charts/playBackChart.vue'
 
 export default {
   name: 'PreProcessing',
-  components: {},
+  components: { PlayBackChart },
   data() {
     // 这里存放数据
     return {
@@ -294,7 +295,8 @@ export default {
       transferRightData: [],
       modelList: [],
       percentage: 0,
-      sortieNoList: []
+      sortieNoList: [],
+      chartData: {}
     }
   },
   watch: {
@@ -365,7 +367,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getPreProcessing({ pageSize, pageIndex, ...params })
+      } = await getPreProcessing({ pageSize, pageNum: pageIndex, ...params })
 
       this.tableData = list
       this.tableRequset.total = total
@@ -475,7 +477,7 @@ export default {
       })
     },
 
-    checkResultList(row) {
+    async checkResultList(row) {
       if (row.status === '0') {
         this.$message({
           type: 'warning',
@@ -483,9 +485,28 @@ export default {
         })
         return
       }
-      // this.getPreProcessingAPI({ falseAlarmId: row.id })
+      try {
+        const { data } = await getOssIdPlaybackDataAPI(row.ossId)
+        this.handleResultData(JSON.parse(data))
+      } catch (error) {}
       this.resultVisible = true
     },
+    handleResultData(resultData) {
+      const headData = Object.keys(resultData[0])
+      const contentData = {}
+      headData.forEach((headItem) => {
+        contentData[headItem] = []
+      })
+      // const contentData = Array.from({ length: headData.length }, () => [])
+      resultData.forEach((item) => {
+        for (var key in item) {
+          contentData[key].push(item[key])
+        }
+      })
+      console.log('contentData', contentData)
+      console.log('headData', headData)
+      // return { contentData, headData }
+    },
     executeAglo(row) {
       // this.executeVisible = true
       // this.agloForm.sortieNo = row.sortieNo

+ 2 - 2
src/views/als/smTask/SMTaskDetails.vue

@@ -348,7 +348,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getResourceAllocation({ pageSize, pageIndex, ...params })
+      } = await getResourceAllocation({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },
@@ -359,7 +359,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset2
       const {
         data: { list, total }
-      } = await getPersonnelAllocation({ pageSize, pageIndex, ...params })
+      } = await getPersonnelAllocation({ pageSize, pageNum: pageIndex, ...params })
       this.tableData2 = list
       this.tableRequset2.total = total
     },

+ 1 - 1
src/views/als/smTask/index.vue

@@ -353,7 +353,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getSmTask({ pageSize, pageIndex, ...params })
+      } = await getSmTask({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },

+ 4 - 2
src/views/als/warning/index.vue

@@ -89,7 +89,7 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
+        // { prop: 'id', label: '编号' },
         {
           prop: 'sortieNo',
           label: '架次号'
@@ -251,7 +251,7 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getWarning({ pageSize, pageIndex, ...params })
+      } = await getWarning({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
       this.tableRequset.total = total
     },
@@ -344,6 +344,8 @@ export default {
           this.handleClose()
           break
         case '新增':
+          console.log('this.form ', this.form)
+          debugger
           this.addWarningAPI()
           this.handleClose()
           break