jinlin
2024-07-26 1b765e3dfdf8ab0d38e587a0a8beaee47a60e32c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<template>
  <div class="fa-card-a">
    <el-row :gutter="5">
      <div class="mod-taskReliability-simulatAssess">
        <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="80px">
          <zt-form-item label="产品节点" prop="productId">
            <zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/>
          </zt-form-item>
          <zt-form-item label="总体任务" prop="taskModelId">
            <zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/>
          </zt-form-item>
          <zt-form-item label="仿真记录" prop="simulatHis">
            <zt-select v-model="dataForm.id" :datas="simulatList" @change="onSimulatSelected"/>
          </zt-form-item>
          <zt-form-item label="采样周期" prop="samplPeriod">
            <el-input v-model="dataForm.samplPeriod" >
            </el-input>
          </zt-form-item>
          <zt-form-item label="仿真总时长" prop="taskDuration">
            <el-input v-model="dataForm.taskDuration" >
            </el-input>
          </zt-form-item>
        </el-form>
        <div>
          <el-col :span="4">
            <div style="margin-right: 5px;height: calc(88vh - 100px)" v-if="isSelect">
              <product-model-tree @on-selected="onTreeSelected" showXdy="false"
                                  ref="ProductModelTree" :isShow="false"/>
            </div>
          </el-col>
          <el-col :span="20">
            <div style="margin-top: 20px">
              <div>
                <SimulatCurve ref="SimulatCurve"></SimulatCurve>
              </div>
            </div>
          </el-col>
        </div>
      </div>
    </el-row>
  </div>
</template>
 
<script>
  import SimulatCurve from "./SimulatCurve";
  import SimulatData from "./SimulatData";
  import ProductModelTree from "../basicInfo/ProductModelTree";
 
 
  export default {
    data() {
      return {
        timers: '',
        isSelect: false,
        isShow: false,
        productList: [],
        simulatList: [],
        taskList: [],
        MTBF: '',
        MTTR: '',
        dataForm: {
          id: '',
          taskDuration:'',
          pid: '',
          productId: '',
          showProductId: '',
          taskModelId: '',
          dataType: 'his',
          samplPeriod: '',
          simulatFrequency: '',
          simulatTime: ''
        }
      }
    },
    mounted() {
      this.getProductList()
    },
    components: {
      ProductModelTree,
      SimulatCurve,
      SimulatData
    },
 
    methods: {
      async getProductList() {
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
      },
      async getTaskList() {
        let params = {
          productId: this.dataForm.productId
        }
        let res = await this.$http.get('/taskReliability/Task/getTaskList', {params: params})
        console.log(res.data)
        this.taskList = res.data
      },
      async getSimulatList() {
        let params = {
          productId: this.dataForm.productId,
          taskModelId: this.dataForm.taskModelId
        }
        let res = await this.$http.get('/taskReliability/SimulatAssess/getSimulatList', {params: params})
        console.log(res.data)
        this.simulatList = res.data
      },
      onTreeSelected(data) {
        console.log(data, 'onProductSelected')
        this.dataForm.showProductId = data.id
        this.$refs.SimulatCurve.getProductEcharts(this.dataForm);
      },
      // 获取信息
      onProductSelected(data) {
        this.isSelect = true
        console.log(data, ' onProductSelected(data)')
        this.dataForm.productId = data.id
        this.getTaskList()
        this.dataForm.taskModelId = ''
      },
      onTaskSelected(data) {
        console.log(data, ' onProductSelected(data)')
        this.dataForm.taskModelId = data.id
        this.getSimulatList()
        this.dataForm.id = ''
      },
      onSimulatSelected(data) {
        this.dataForm.id = data.id
        this.dataForm.samplPeriod = data.samplPeriod
        this.getSimulatParams()
        this.$refs.SimulatCurve.initEcharts(this.dataForm)
      },
      async getSimulatParams() {
        let params = {
          id: this.dataForm.id,
          taskModelId: this.dataForm.taskModelId
        }
        let res = await this.$http.get('/taskReliability/SimulatAssess/getSimulatParams', {params: params})
        this.dataForm.taskDuration = res.data.taskDuration
        this.dataForm.samplPeriod = res.data.samplPeriod
      }
    }
  }
</script>
<style>
 
</style>