Sfoglia il codice sorgente

虚警抑制可重复执行、曲线选择时间后时间框同步

Rmengdi 2 mesi fa
parent
commit
0973d337b3

+ 1 - 1
.env.development

@@ -5,4 +5,4 @@ ENV = 'development'
 # 开发环境
 VUE_APP_BASE_API ='/api'
 
-VUE_APP_BASE_API_target ='http://192.168.2.10:9091'
+VUE_APP_BASE_API_target ='http://localhost:9091'

+ 1 - 1
.env.production

@@ -6,4 +6,4 @@ ENV = 'production'
 
 VUE_APP_BASE_API ='/api'
 
-VUE_APP_BASE_API_target ='http://192.168.2.10:8080' # 生产环境地址
+VUE_APP_BASE_API_target ='http://localhost:8080' # 生产环境地址

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

@@ -70,6 +70,12 @@ export default {
       }
       // console.log('66', this.chartRef)
       this.chart = echarts.init(this.$refs.preResultRef)
+      // 监听 dataZoom 事件
+      this.chart.on('dataZoom', (params) => {
+        const startValue = this.chartData.xAxisData[params.batch[0].startValue]
+        const endValue = this.chartData.xAxisData[params.batch[0].endValue]
+        this.$emit('data-zoom', [startValue, endValue])
+      })
       this.setOptions(this.chartData)
     },
     setOptions({ title, legendData, xAxisData, yAxisData, seriesData } = {}) {

+ 22 - 8
src/views/als/falseAlarm/index.vue

@@ -32,13 +32,13 @@
         </el-form>
         <LTable ref="warningTable" @selection-change="selection" :defaultFetch="false" :showColumnSetting="false" :columns="warningColumns" :dataSource="warningTableData" :options="warningOptions" :pagination="warningTableRequset"></LTable>
         <el-dialog width="80%" title="飞参数据曲线" :visible.sync="innerVisible" :before-close="innerDialogClose" append-to-body>
-          <PlayBackChart :chartData="chartData" />
+          <PlayBackChart @data-zoom="handleDataZoom" :chartData="chartData" />
           <div style="margin-top: 20px">
             <span style="color: #fff; margin-left: 30px">请选择时间区间:</span>
             <el-time-picker is-range v-model="mathTime" placement="bottom-start" value-format="HH:mm:ss.SSS" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" @change="handleMathTime" :clearable="false"></el-time-picker>
-            <el-button icon="el-icon-refresh" circle class="refresh" @click="resetTime"></el-button>
+            <el-button class="refresh" @click="resetTime">重 置</el-button>
             <el-button type="success" @click="getExecuteMathAPI" style="margin-left: 15px">确 定</el-button>
-            <LTable ref="mathTable" :defaultFetch="false" :columns="mathColumns" :dataSource="mathTableData" :options="mathOptions"></LTable>
+            <LTable ref="mathTable" style="margin-top: 20px" :showColumnSetting="false" :defaultFetch="false" :columns="mathColumns" :dataSource="mathTableData" :options="mathOptions"></LTable>
           </div>
           <div style="width: 100%; color: #fff; text-align: center">
             <el-radio-group class="isFalseAlarm" v-model="isFalseAlarm" size="small">
@@ -142,8 +142,8 @@ export default {
             {
               name: '虚警判断',
               type: 'text',
-              statusKey: 'dataStatus',
-              disableKey: '2',
+              // statusKey: 'dataStatus',
+              // disableKey: '2',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
@@ -492,6 +492,7 @@ export default {
     async getWarningResultAPI(params) {
       if (this.$refs.warningTable) this.$refs.warningTable.clearSelection()
       const { pageSize, pageIndex } = this.warningTableRequset
+      this.warningTableData = []
       const {
         data: { list, total }
       } = await getWarningResult({ pageSize, pageNum: pageIndex, ...params })
@@ -514,11 +515,11 @@ export default {
       this.warningForm = deepClone(row)
       this.mathParams.code = row.code
       this.mathParams.sortieNo = row.sortieNo
-      this.getExecuteMathAPI()
       try {
         const { code, data } = await getCurveData(row.code, row.sortieNo)
         if (code === 200) {
           if (data) {
+            this.getExecuteMathAPI()
             this.getResultData(data)
           } else {
             this.$message({
@@ -537,14 +538,18 @@ export default {
 
     resetTime() {
       this.mathTime = this.backupsTime
+      this.handleMathTime(this.mathTime)
+      this.getExecuteMathAPI()
     },
 
     // 获取数学数据
     async getExecuteMathAPI() {
+      this.mathOptions.loading = true
       try {
         const { data, code } = await executeMath(this.mathParams)
         if (code === 200) {
           this.mathTableData = []
+          this.mathOptions.loading = false
           Object.keys(data).forEach((item) => {
             this.mathTableData.push({
               params: item,
@@ -635,6 +640,17 @@ export default {
         this.progressVisible = false
         this.percentage = 0
       }
+    },
+
+    handleDataZoom(val) {
+      if (val[0] && val[0]) {
+        this.mathTime = val
+      } else {
+        this.mathTime = this.backupsTime
+        // this.getExecuteMathAPI()
+      }
+      this.handleMathTime(this.mathTime)
+      this.getExecuteMathAPI()
     }
   }
 }
@@ -651,8 +667,6 @@ export default {
   z-index: 9999;
 }
 .refresh {
-  padding: 5px !important;
-  border-radius: 50% !important;
   margin-left: 10px;
 }
 </style>

+ 1 - 1
vue.config.js

@@ -8,7 +8,7 @@ module.exports = defineConfig({
     open: true, //值为 true的话,项目启动时自动打开到浏览器里边, false不会打开
     proxy: {
       ['/api/als']: {
-        target: 'http://192.168.2.10:9090',
+        target: 'http://localhost:9090',
         ws: false,
         changeOrigin: true,
         pathRewrite: {