jinlin
2024-03-19 bbb7b9dd4919e1026ed75d5f0f1dc37b5593b522
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
<template>
  <zt-dialog ref="dialog" column="1" title="选择系统模型" append-to-body :editAble="false" :hasConfirm="false">
        <zt-table-wraper ref="tableObj" query-url="/taskReliability/ModelRbd/page"
                         :paging='false'
                         v-slot="{ table }">
          <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"></el-form>
          <el-table v-loading="table.dataLoading" :data="table.dataList" height="300"
                    border @row-dblclick="selectModel"
                    @selection-change="table.selectionChangeHandle">
            <el-table-column prop="modelName" label="模型名称"/>
          </el-table>
          <!-- 弹窗, 新增 / 修改 -->
        </zt-table-wraper>
  </zt-dialog>
</template>
 
<script>
 
  export default {
    name: 'SelectModelRbd',
    data() {
      return {
        dataForm: {
          id: '',
          modelName: '',
          modelState: '',
          productId: '',
          phaseId: '',
          modelId: '',
        }
      }
    },
    mounted() {
 
    },
    components: {},
    methods: {
      init(param) {
        this.dataForm.productId = param.row.productId
        this.dataForm.phaseId = param.phaseId
        this.dataForm.id = param.row.id
      },
      async selectModel(row) {
        console.log(this.dataForm)
        this.dataForm.modelId = row.id
        this.dataForm.productId = row.productId
        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/TaskPhaseModel/', this.dataForm)
        if (res.success) {
          await this.$tip.success()
          this.$refs.dialog.close()
          this.$emit('setModel')
        }
      }
    }
  }
</script>