Kaynağa Gözat

实警时曲线标出、缩放的bug、故障统计导入的结果提示

Rmengdi 2 ay önce
ebeveyn
işleme
c9ab6f7274

+ 3 - 3
src/views/als/components/Charts/playBackChart.vue

@@ -4,7 +4,6 @@
 
 <script>
 import * as echarts from 'echarts'
-import { debounce } from '@/utils/index'
 export default {
   name: 'PlayBackChart',
   props: {
@@ -26,7 +25,7 @@ export default {
      * legendData:[]
      * xAxisData:{}
      * yAxisData:{}
-     * seriesData:{}
+     * seriesData:{},
      */
     chartData: {
       type: Object,
@@ -91,7 +90,8 @@ export default {
           const startPercent = params.start
           const endPercent = params.end
           startValue = this.chartData.xAxisData[Math.ceil((xAxisLength * startPercent) / 100)]
-          endValue = this.chartData.xAxisData[Math.floor((xAxisLength * endPercent) / 100)]
+          const end = Math.floor((xAxisLength * endPercent) / 100)
+          endValue = this.chartData.xAxisData[end == xAxisLength ? end - 1 : end]
         }
         if (this.timer) {
           clearTimeout(this.timer)

+ 23 - 1
src/views/als/falseAlarm/index.vue

@@ -310,6 +310,8 @@ export default {
         yAxisData: [],
         seriesData: []
       },
+      timeFlag: null,
+      timeFlagPos: null,
       form: {
         id: '',
         sortieNo: '',
@@ -515,6 +517,7 @@ export default {
       this.warningForm = deepClone(row)
       this.mathParams.code = row.code
       this.mathParams.sortieNo = row.sortieNo
+      this.timeFlag = row.attribute2
       try {
         const { code, data } = await getCurveData(row.code, row.sortieNo)
         if (code === 200) {
@@ -537,6 +540,11 @@ export default {
     },
 
     resetTime() {
+      //     chart.dispatchAction({
+      //   type: 'dataZoom',
+      //   start: 0, // 起始位置
+      //   end: 100, // 终止位置
+      // });
       this.mathTime = this.backupsTime
       this.handleMathTime(this.mathTime)
       this.getExecuteMathAPI()
@@ -572,9 +580,12 @@ export default {
       const contentData = JSON.parse(data)
       const headData = Object.keys(contentData)
       this.chartData.legendData = headData
+      const timeList = contentData['时间']
+      this.timeFlagPos = timeList.findIndex((item) => {
+        return item == this.timeFlag
+      })
       for (var key in contentData) {
         if (key === '时间') {
-          const timeList = contentData['时间']
           const time = [timeList[0], timeList[timeList.length - 1]]
           this.mathTime = this.backupsTime = time
           this.chartData.xAxisData = timeList
@@ -582,6 +593,17 @@ export default {
           this.chartData.seriesData.push({
             name: key,
             type: 'line',
+            markLine: {
+              symbol: 'none',
+              data: [{ xAxis: this.timeFlagPos }],
+              lineStyle: {
+                color: '#f00'
+              },
+              label: {
+                formatter: this.timeFlag,
+                color: '#f00'
+              }
+            },
             data: contentData[key],
             connectNulls: true
           })

+ 60 - 13
src/views/als/faultStatistics/importDialog/index.vue

@@ -1,18 +1,27 @@
 <template>
-  <el-dialog :title="dialogtitle" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center>
-    <div class="upload">
-      <div class="upload-left">导入文件</div>
-      <el-upload class="upload-right" ref="upload" accept=".xls,.xlsx" :action="fileApi" :file-list="fileList" :data="fileData" :auto-upload="false" :on-success="onSuccess" :limit="1">
-        <el-button slot="trigger" style="margin-right: 30px" size="small" type="primary">选择文件</el-button>
-        <el-button size="small" type="success" @click="submitUpload">导入数据</el-button>
-        <div slot="tip" class="el-upload__tip" style="margin-left: 10px; margin-top: 10px; font-size: 14px">只能导入 xls / xlsx 文件</div>
-      </el-upload>
-    </div>
-  </el-dialog>
+  <div>
+    <el-dialog :title="dialogtitle" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center>
+      <div class="upload">
+        <div class="upload-left">导入文件</div>
+        <el-upload class="upload-right" ref="upload" accept=".xls,.xlsx" :action="fileApi" :file-list="fileList" :data="fileData" :auto-upload="false" :on-success="onSuccess" :limit="1">
+          <el-button slot="trigger" style="margin-right: 30px" size="small" type="primary">选择文件</el-button>
+          <el-button size="small" type="success" :loading="importLoading" @click="submitUpload">{{ importLoading ? '导入中' : '导入数据' }}</el-button>
+          <div slot="tip" class="el-upload__tip" style="margin-left: 10px; margin-top: 10px; font-size: 14px">只能导入 xls / xlsx 文件</div>
+        </el-upload>
+      </div>
+    </el-dialog>
+    <el-dialog title="导入结果" class="reaultDialog" :visible.sync="visible" width="800px" :before-close="visibleClose" center>
+      <div class="markdown" v-html="renderMarkdown()"></div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="visibleClose">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
 import { useMessage } from '@/utils/element-ui'
+import * as marked from 'marked'
 export default {
   data() {
     return {
@@ -22,7 +31,10 @@ export default {
       fileList: [],
       fileData: {
         userName: ''
-      }
+      },
+      visible: false,
+      reaultMsg: '',
+      importLoading: false
     }
   },
   methods: {
@@ -36,6 +48,7 @@ export default {
 
     // 上传
     submitUpload() {
+      this.importLoading = true
       const userInfo = this.$store.state.user.userInfo.user
       this.fileData.userName = userInfo.userName
       this.$refs.upload.submit()
@@ -46,10 +59,31 @@ export default {
       this.$refs.upload.clearFiles()
       this.fileList = []
       const { msg, code } = result
-      useMessage(code == 200 ? 'success' : 'warning', msg, 2000)
-      if (code !== 200) return
+      if (code == 200) {
+        this.reaultMsg = msg
+        this.visible = true
+        this.importLoading = false
+      } else {
+        this.$message({
+          type: 'warning',
+          message: msg
+        })
+        return
+      }
+      // useMessage(code == 200 ? 'success' : 'warning', msg, 2000)
+      // if (code !== 200) return
       this.handleClose()
       this.$emit('submitCallBack')
+    },
+
+    visibleClose() {
+      this.visible = false
+      this.reaultMsg = ''
+    },
+
+    renderMarkdown() {
+      const html = marked.parse(this.reaultMsg)
+      return html
     }
   }
 }
@@ -66,4 +100,17 @@ export default {
     margin-right: 40px;
   }
 }
+
+::v-deep .reaultDialog .el-dialog__body {
+  color: #fff !important;
+}
+.markdown {
+  height: 500px;
+  overflow: auto;
+  -ms-overflow-style: none; /* 适用于 Internet Explorer 和旧版 Edge */
+  scrollbar-width: none; /* 适用于 Firefox */
+}
+.markdown::-webkit-scrollbar {
+  display: none;
+}
 </style>

+ 3 - 5
src/views/als/model/index.vue

@@ -29,7 +29,7 @@
           <el-form-item label="模型链接" prop="url">
             <el-input v-model="form.url" placeholder="请输入模型链接" />
           </el-form-item>
-          <el-form-item v-show="['5'].includes(form.type)" label="参数特征" prop="paramType">
+          <el-form-item v-if="['5'].includes(form.type)" label="参数特征" prop="paramType">
             <el-select v-model="form.paramType" filterable allow-create default-first-option placeholder="请选择参数特征">
               <el-option v-for="item in paramTypeData" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"> </el-option>
             </el-select>
@@ -388,7 +388,6 @@ export default {
     handUpdate(row) {
       this.dialogTitle = '编辑'
       this.form = deepClone(row)
-      console.log('this.form', this.form)
       if (['5', '6'].includes(this.form.type)) {
         const item = this.allAirConfig.find((item) => item.id === this.form.partId)
         this.form.aircraftType = item.aircraftType
@@ -399,11 +398,10 @@ export default {
     },
 
     submit() {
-      console.log('this.form.paramType', this.form.paramType)
       const isExist = this.paramTypeData.find((item) => {
         return item.dictLabel === this.form.paramType
       })
-      if (!isExist) {
+      if (this.form.paramType && !isExist) {
         const sortData = Math.max.apply(
           Math,
           this.paramTypeData.map((item) => {
@@ -418,7 +416,7 @@ export default {
           status: '0'
         }
         addData(data).then((response) => {
-          if (response.code !== 200) {
+          if (response.code !== '200') {
             this.$message({
               type: 'warning',
               message: '模型参数特征未保存成功'