jinlin
2024-10-28 79eab76ac1b4b77696c92d72cfbde1e122c4c28f
web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -24,6 +24,9 @@
        <zt-form-item style="margin-left: 20px">
          <zt-button @click="analyze()">仿真分析</zt-button>
        </zt-form-item>
        <zt-form-item style="margin-left: 20px">
          <zt-button @click="displayProcess()">查看算法库进程</zt-button>
        </zt-form-item>
      </el-form>
      <el-progress v-if="isShow" :percentage="percentage"></el-progress>
          <el-col :span="4">
@@ -55,18 +58,20 @@
        <el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
      </div>
    </el-dialog>
    <Process ref="process"></Process>
  </div>
</template>
<script>
  import SimulatCurve from "./SimulatCurve";
  import ProductModelTree from "../basicInfo/ProductModelTree";
  import Process from "./Process";
  export default {
    data() {
      return {
        timers: '',
        timers: null,
        isSelect: false,
        isShow: false,
        percentage: 0,
@@ -94,15 +99,16 @@
      this.getProductList()
    },
    watch: {
      percentage() {
        if (this.percentage === 100) {
          this.$refs.SimulatCurve.initEcharts(this.dataForm);
        }
      }
      // percentage() {
      //   if (this.percentage === 100) {
      //     this.$refs.SimulatCurve.initEcharts(this.dataForm);
      //   }
      // }
    },
    components: {
      ProductModelTree,
      SimulatCurve,
      Process,
    },
    methods: {
@@ -141,18 +147,20 @@
        console.log(res.data)
        this.taskList = res.data
      },
      getStroke() {
        if (this.percentage < 100) {
          let param = {
            taskList: [this.dataForm.id]
          }
          this.$http.get(`/taskReliability/SimulatAssess/getCalcProgress`, {params: param}).then(
            res => {
              if (res.data) {
                this.percentage = parseFloat(res.data)
              }
      async getStroke() {
        let param = {
          taskList: [this.dataForm.id]
        }
        let res = await this.$http.get(`/taskReliability/SimulatAssess/getCalcProgress`, {params: param})
        if (res.success) {
          if (res.data) {
            this.percentage = parseFloat(res.data)
            if (this.percentage >= 100) {
              clearInterval(this.timers)
              this.percentage = 0
              this.$refs.SimulatCurve.initEcharts(this.dataForm);
            }
          )
          }
        } else {
          clearInterval(this.timers)
          this.percentage = 0
@@ -164,9 +172,10 @@
        this.isShow = true
        let result = await this.$http.get(`/basicInfo/TyProductModel/getUuid`)
        this.dataForm.id = result.data
        this.percentage = 0
        let res = await this.$http.post('/taskReliability/SimulatAssess/analyze', this.dataForm)
        if (res.success) {
          console.log(res.data)
          console.log(res.data, 'res.data')
          if (res.data && res.data.length > 0) {
            this.modelCheckResult = res.data
            this.dialogVisible = true
@@ -174,6 +183,9 @@
            this.timers = window.setInterval(this.getStroke, 1000)
          }
        }
      },
      displayProcess() {
        this.$refs.process.$refs.dialog.init()
      }
    }
  }