xyc
2025-02-21 664db98c9e8595ce4dd636a27f480e3a08b81ff5
web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -8,6 +8,9 @@
        <zt-form-item label="总体任务" prop="taskModelId">
          <zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/>
        </zt-form-item>
        <zt-form-item label="仿真名称" prop="name">
          <el-input v-model="dataForm.name" placeholder="请输入名称" clearable></el-input>
        </zt-form-item>
        <zt-form-item label="时间分片" prop="samplPeriod">
          <el-input type="number" :min="1" v-model="dataForm.samplPeriod"
                    style="width: 150px;vertical-align: baseline;">
@@ -26,15 +29,6 @@
        <zt-form-item style="margin-left: 10px">
          <zt-button @click="analyze()">仿真分析</zt-button>
          <zt-button @click="displayProcess()">算法库进程</zt-button>
          <el-dropdown style="margin-left: 10px" @command="download">
            <el-button type="primary">
              下载xml<i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="1">输入xml</el-dropdown-item>
              <el-dropdown-item command="2">输出xml</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </zt-form-item>
      </el-form>
      <el-progress v-if="isShow" :percentage="percentage"></el-progress>
@@ -76,7 +70,6 @@
  import SimulatCurve from "./SimulatCurve";
  import ProductModelTree from "../basicInfo/ProductModelTree";
  import Process from "./Process";
  import qs from "qs";
  import Cookies from "js-cookie";
@@ -94,6 +87,7 @@
        dataForm: {
          id: '',
          pid: '',
          name:'',
          productId: '',
          showProductId: '',
          taskModelId: '',
@@ -109,13 +103,6 @@
    },
    mounted() {
      this.getProductList()
    },
    watch: {
      // percentage() {
      //   if (this.percentage === 100) {
      //     this.$refs.SimulatCurve.initEcharts(this.dataForm);
      //   }
      // }
    },
    components: {
      ProductModelTree,
@@ -170,6 +157,9 @@
            if (this.percentage >= 100) {
              clearInterval(this.timers)
              this.percentage = 0
              Cookies.set('productId', this.dataForm.productId)
              Cookies.set('taskModelId', this.dataForm.taskModelId)
              Cookies.set('fzId', this.dataForm.id)
              this.$refs.SimulatCurve.initEcharts(this.dataForm);
            }
          }
@@ -195,21 +185,6 @@
            this.timers = window.setInterval(this.getStroke, 1000)
          }
        }
      },
      async download(selsect) {
        if(this.dataForm.id){
          let param = qs.stringify({
            'token': Cookies.get('token'),
            type: 'fz',
            xml:selsect,
            id: this.dataForm.id
          })
          let apiURL = `/taskReliability/SimulatAssess/downloadXml`
          window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${param}`
        }else{
          this.$alert('还未进行仿真操作')
        }
      },
      displayProcess() {
        this.$refs.process.$refs.dialog.init()