Explorar el Código

故障诊断(到执行模型)

Rmengdi hace 1 año
padre
commit
87d91a19c3

+ 36 - 0
PHM-web/src/api/manage/data.js

@@ -50,3 +50,39 @@ export function delSortieParameter(ID) {
     method: 'delete'
   })
 }
+
+// 执行模型
+export function beginModel(data) {
+  return request({
+    url: '/model_api/execute',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询所有该架次的数据
+export function listSortieParameterAll(query) {
+  return request({
+    url: '/manage/sortieParameter/list/all',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询该类型所有模型信息
+export function modelListAll(query) {
+  return request({
+    url: '/manage/model/list/all',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询单个模型
+export function modelList(query) {
+  return request({
+    url: '/manage/model/list',
+    method: 'get',
+    params: query
+  })
+}

+ 8 - 0
PHM-web/src/api/manage/sortie.js

@@ -34,6 +34,14 @@ export function getSortieDataName(id) {
   })
 }
 
+// 查询架次参数
+export function getSortieParams(id) {
+  return request({
+    url: '/manage/sortieParameter/dataParams/' + id,
+    method: 'get'
+  })
+}
+
 // 新增架次信息
 export function addSortie(data) {
   return request({

+ 1 - 1
PHM-web/src/router/index.js

@@ -142,7 +142,7 @@ export const dynamicRoutes = [
     permissions: ['manage:sortie:edit'],
     children: [
       {
-        path: 'sortieDetail',
+        path: 'sortieDetail/:sortieId',
         component: () => import('@/views/manage/sortie/sortieDetail'),
         name: 'SortieDetail',
         meta: { title: '架次详情', activeMenu: '/integratedDataManage/sortie' }

+ 19 - 0
PHM-web/src/views/manage/faultDiagnosis/falseAlarmResult.vue

@@ -0,0 +1,19 @@
+<template>
+  <div>
+    123
+    <!-- <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div> -->
+  </div>
+</template>
+
+<script>
+  export default {
+    name:'falseAlarmResult'
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 394 - 0
PHM-web/src/views/manage/faultDiagnosis/index.vue

@@ -0,0 +1,394 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="机号" prop="aircraftNumber">
+        <el-input v-model="queryParams.aircraftNumber" placeholder="请输入机号" clearable
+          @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="架次号" prop="sortieNumber">
+        <el-input v-model="queryParams.sortieNumber" placeholder="请输入架次号" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" border :data="sortieList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="机号" align="center" prop="aircraftNumber" />
+      <el-table-column label="架次号" align="center" prop="sortieNumber" />
+      <el-table-column label="开始时间" align="center" width="180">
+        <template slot-scope="scope">
+          <span>{{
+            parseTime(scope.row.startTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="结束时间" align="center" width="180">
+        <template slot-scope="scope">
+          <span>{{
+            parseTime(scope.row.endTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="飞行时长" align="center" prop="duration" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" @click="handle(scope.row)"
+            v-hasPermi="['manage:faultDiagnosis:edit']">故障诊断</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+
+    <!-- 故障诊断对话框 -->
+    <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="诊断类型">
+          <el-radio v-model="radio" label="0">全选</el-radio>
+          <el-radio v-model="radio" label="3">虚警抑制</el-radio>
+          <el-radio v-model="radio" label="4">深度隔离</el-radio>
+          <el-radio v-model="radio" label="5">地面诊断</el-radio>
+        </el-form-item>
+        <el-row :gutter="20">
+          <el-col :span="10">
+            <el-form-item label="机号" prop="aircraftNumber">
+              <el-input v-model="form.aircraftNumber" placeholder="请输入机号" disabled />
+            </el-form-item>
+          </el-col>
+          <el-col :span="10">
+            <el-form-item label="步长" prop="step">
+              <el-select v-model="form.step" placeholder="请选择步长">
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="10">
+            <el-form-item label="架次号" prop="sortieNumber">
+              <el-input v-model="form.sortieNumber" placeholder="请输入架次号" disabled />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="架次数据:" class="clearMargin" />
+        <el-table :data="sortieParameterAllList" style="width: 93%;margin-left:30px" highlight-current-row
+          @current-change="handleSortieData" max-height="250">
+          <el-table-column prop="sortieNo" label="架次号" align="center" />
+          <el-table-column prop="batchNo" label="批次号" align="center" />
+          <el-table-column prop="type" label="数据类型" align="center">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.data_type" :value="scope.row.type" />
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 进度条 -->
+    <el-dialog :title="title" :visible.sync="dialogProgress" class="progress" width="800" :close-on-click-modal="false"
+      append-to-body>
+      <el-progress :text-inside="true" :stroke-width="24" :percentage="percentageVal" status="success"></el-progress>
+    </el-dialog>
+    <!-- 选择模型 -->
+    <el-dialog :title="title" :visible.sync="dialogSelectModel" width="800" :close-on-click-modal="false"
+      append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="模型选择">
+          <!-- <el-input v-model="form.sortieNumber" placeholder="请输入架次号" disabled/> -->
+          <el-select v-model="selectModelVal" placeholder="请选择模型" @change="modelSelectHandel">
+            <el-option v-for="item in modelOptions" :key="item.id" :label="item.name" :value="item">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="参数选择" v-if="!(selectModelVal==='')">
+          <el-transfer v-model="selectSortieParams"
+            :props="{ key: 'value', label: 'desc' }" 
+            :data="parameterList"
+            filterable
+            filter-placeholder="请输入参数名称"
+            :titles="['所有参数', '展示参数']"
+          >
+          </el-transfer>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="back">返回</el-button>
+        <el-button type="primary" :disabled="selectModelVal===''" @click="begin">开始执行</el-button>
+        <el-button @click="cancelSelectModel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 虚警抑制清单 -->
+    <el-dialog :title="title" :visible.sync="dialogFalseAlarmResult" width="800" :close-on-click-modal="false" append-to-body>
+      <falseAlarmResult />
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="next">下一步</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listSortie, getSortie,getSortieParams, } from '@/api/manage/sortie'
+import {
+  beginModel,
+  listSortieParameterAll,
+  modelList,
+  modelListAll,
+} from '@/api/manage/data'
+import falseAlarmResult from '@/views/manage/faultDiagnosis/falseAlarmResult'
+export default {
+  name: 'faultDiagnosis',
+  components: {
+    falseAlarmResult,
+  },
+  dicts: ['data_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      //选中的架次号
+      sortieIds: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 架次信息表格数据
+      sortieList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      startTime: '',
+      endTime: '',
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        aircraftNumber: null,
+        sortieNumber: null,
+        startTime: '',
+        endTime: '',
+        duration: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+      options: [
+        {
+          value: '1',
+          label: '1帧/秒',
+        },
+        {
+          value: '2',
+          label: '2帧/秒',
+        },
+        {
+          value: '5',
+          label: '5帧/秒',
+        },
+        {
+          value: '10',
+          label: '10帧/秒',
+        },
+      ],
+      selectSortieId: '',
+      radio: '0',
+      // 进度条是否显示弹出框
+      dialogProgress: false,
+      percentageVal: 65,
+      timer: null,
+      dialogSelectModel: false,
+      // 虚警抑制弹出框
+      dialogFalseAlarmResult: false,
+      modelOptions: [],
+      // 步长
+      // step: '',
+      selectModelVal: '',
+      sortieParameterAllList: [],
+      selectedSortieDataType: '',
+      modelListAll: [],
+      parameterList:[],
+      selectSortieParams:[],
+      modelId:null,
+      batchNo:''
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    /** 查询架次信息列表 */
+    getList() {
+      this.loading = true
+      listSortie(this.queryParams).then(response => {
+        this.sortieList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.sortieIds = selection.map(item => item.sortieNumber)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 故障诊断操作 */
+    handle(row) {
+      console.log('故障诊断', row)
+      this.reset()
+      const id = row.id
+      getSortie(id).then(response => {
+        this.form = response.data
+        this.open = true
+        this.title = '故障诊断信息'
+      })
+      listSortieParameterAll({ sortieNo: row.sortieNumber }).then(response => {
+        this.sortieParameterAllList = response.data
+        this.loading = false
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+      this.radio=0
+      this.selectedSortieDataType = ''
+      this.batchNo = ''
+    },
+    cancelSelectModel(){
+      this.dialogSelectModel=false
+      this.cancel()
+      this.selectModelVal=''
+      this.parameterList=[]
+      this.selectSortieParams=[]
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        aircraftNumber: null,
+        sortieNumber: null,
+        startTime: null,
+        endTime: null,
+        duration: null,
+        isDelete: null,
+        step:null
+      }
+      this.resetForm('form')
+    },
+    handleSortieData(value) {
+      console.log('value', value)
+      this.selectSortieId=value.id
+      this.selectedSortieDataType = value.type
+      this.batchNo=value.batchNo
+    },
+    // 确定诊断按钮
+    submitForm() {
+      if (this.selectedSortieDataType === '') {
+        this.$message.error(`请选择架次数据`)
+      } else {
+        const data = {
+          pageNum: 1,
+          pageSize: 10,
+          type: this.radio,
+        }
+        modelListAll(data).then(response => {
+          this.modelOptions = response.data
+          this.loading = false
+        })
+        this.open = false
+        this.dialogSelectModel = true
+        this.title = '请选择虚警抑制模型'
+      }
+    },
+    modelSelectHandel(val){
+      this.selectModelVal = val.name
+      this.selectSortieParams = JSON.parse(val.dataParams)
+      this.modelId=val.id
+      getSortieParams(this.selectSortieId).then(response => {
+        response.data.forEach(item => {
+          this.parameterList.push({
+            value: item,
+            desc: item
+          });
+        })
+      })
+    },
+    back() {
+      this.dialogSelectModel = false
+      this.open = true
+      this.title = '故障诊断信息'
+      this.selectModelVal=''
+      this.parameterList=[]
+      this.selectSortieParams=[]
+    },
+    begin() {
+      this.dialogSelectModel = false
+      this.dialogProgress = true
+      const data={
+        modelId:this.modelId,
+        sortieNo:this.form.sortieNumber,
+        batchNo: this.batchNo,
+        dataType: this.radio,
+        dataId : this.selectSortieId,
+        dataParams: this.selectSortieParams
+      }
+      console.log("data",data);
+      beginModel(data).then(response => {
+        console.log(response);
+      })
+    },
+    next() {
+      // 先选择深度隔离模型
+      // this.dialogProgress = true
+      // this.title = '深度隔离诊断过程中'
+      // this.timer = setInterval(() => {
+      //   this.percentageVal=100
+      //   this.dialogProgress = false
+      //   this.dialogFalseAlarmResult = true
+      //   this.title = '深度隔离结果'
+      //   clearInterval(this.timer)
+      //   this.timer = null
+      // },2000)
+    },
+  },
+}
+</script>
+
+<style scoped>
+.progress {
+  top: 35%;
+}
+::v-deep .clearMargin {
+  margin-bottom: 0;
+}
+.back {
+  margin-left: -100px;
+  margin-top: -25px;
+}
+</style>

+ 2 - 2
PHM-web/src/views/manage/sortie/index.vue

@@ -298,11 +298,11 @@ export default {
     },
     // 架次详情
     detail(row){
-      const sortieNumber = row.sortieNumber
+      const sortieId = row.id
       this.$router.push({
         name: 'SortieDetail',
         params: {
-          sortieNumber: sortieNumber
+          id: sortieId
         },
       })
     },

+ 31 - 9
PHM-web/src/views/manage/sortie/sortieDetail.vue

@@ -2,29 +2,51 @@
   <div class="app-container">
     <el-button type="text" @click="back" class="backBtn">⇦返回</el-button>
     <el-descriptions title="用户信息" class="sortieDetail"  :contentStyle="{'font-weight': '700'}">
-        <el-descriptions-item label="飞机编号">1234</el-descriptions-item>
+        <el-descriptions-item label="飞机编号">{{ sortieDetail.aircraftNumber }}</el-descriptions-item>
+        <el-descriptions-item label="架次号">{{ sortieDetail.sortieNumber }}</el-descriptions-item>
         <el-descriptions-item label="日期">2023/05/19</el-descriptions-item>
         <el-descriptions-item label="任务类型">xx</el-descriptions-item>
         <el-descriptions-item label="起落次数">5</el-descriptions-item>
-        <el-descriptions-item label="开始时间">xxxxx</el-descriptions-item>
-        <el-descriptions-item label="结束时间">xxxxx</el-descriptions-item>
-        <el-descriptions-item label="持续时间">xxxxx</el-descriptions-item>
+        <el-descriptions-item label="开始时间">{{ sortieDetail.startTime }}</el-descriptions-item>
+        <el-descriptions-item label="结束时间">{{ sortieDetail.endTime }}</el-descriptions-item>
+        <el-descriptions-item label="持续时间">{{ sortieDetail.duration }}</el-descriptions-item>
         <el-descriptions-item label="开车前油量">xxxxx</el-descriptions-item>
     </el-descriptions>
   </div>
 </template>
 
 <script>
-  export default {
-    name:'SortieDetail',
-    methods: {
+import {
+  getSortie,
+} from '@/api/manage/sortie'
+export default {
+  name:'SortieDetail',
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      sortieId:null,
+      sortieDetail:{}
+    };
+  },
+  mounted(){
+    this.init()
+  },
+  methods: {
+    init(){
+      this.sortieId=this.$route.params.id
+      getSortie(this.sortieId).then(response => {
+        // console.log("response",sortieDetail);
+        this.sortieDetail=response.data
+      })
+    },
     back(){
       this.$router.push({
         name: 'Sortie'
       })
     }
-  }
-  }
+}
+}
 </script>
 
 <style scoped>