jinlin
2024-09-05 aa4a6ed94ea6861a6ce634550d2f05f528529098
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
<template>
  <div>
    <el-row :gutter="5">
      <el-col :span="5">
        <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
          <product-model-tree ref="ProductModelTree" @on-selected="onProductSelected" @on-default="onDefault" showXdy="true" :isShow="false"/>
        </div>
      </el-col>
      <el-col :span="19">
        <div class="mod-taskReliability-modelRbd fa-card-a" style="margin-left: 5px;">
          <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/taskReliability/ModelRbd/page"
                           delete-url="/taskReliability/ModelRbd/"
                           :paging='false'
                           v-slot="{ table }">
            <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
              <el-form-item>
                <el-input v-model="dataForm.modelName" placeholder="请输入模型名称" clearable></el-input>
              </el-form-item>
              <el-form-item>
                <el-input v-model="dataForm.modelTag" placeholder="请输入模型标识" clearable></el-input>
              </el-form-item>
              <el-form-item>
                <zt-button v-if="dataForm.productId" type="query" @click="table.query()"/>
                <zt-button v-if="dataForm.productId" type="add" @click="add()"/>
                <zt-button v-if="dataForm.productId" type="delete" @click="table.deleteHandle()"/>
              </el-form-item>
            </el-form>
            <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}"
                      border @selection-change="table.selectionChangeHandle"
                      :header-cell-style="{'text-align':'center'}">
              <el-table-column type="selection" width="40" align="center"/>
              <el-table-column prop="modelName" label="模型名称"/>
              <el-table-column prop="modelTag" label="模型标识"/>
              <el-table-column prop="quoteNum" label="被引用数" align="center"/>
              <el-table-column prop="modelState" label="模型状态" align="center"/>
              <el-table-column prop="modelDataState" label="模型数据状态" align="center"/>
              <el-table-column prop="remark" label="备注"/>
              <zt-table-column-handle :table="table"
                                      delete-perm="taskReliability::delete" :has-view="false" width="180px">
                <template v-slot="{ row }">
                  <zt-table-button  @click="drawRBD(row)">模型设计</zt-table-button>
                </template>
              </zt-table-column-handle>
            </el-table>
            <!-- 弹窗, 新增 / 修改 -->
            <add-or-update @refreshDataList="table.query" ref="AddOrUpdate"/>
            <el-dialog v-dialogDrag :title="title" top="1vh" width='95%' :visible.sync="dialogVisible2" v-if="dialogVisible2">
              <RBDEditImg ref="rbdEditImg" @refreshDataList="table.query"></RBDEditImg>
            </el-dialog>
          </zt-table-wraper>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
 
<script>
  import AddOrUpdate from './ModelRbd-AddOrUpdate'
  import ProductModelTree from "../basicInfo/ProductModelTree";
  import RBDEditImg from './RBD-edit-img'
 
  export default {
    data() {
      return {
        dialogVisible2: false,
        title:'',
        dataForm: {
          modelName: '',
          modelState:'',
          productId: '',
          modelTag: '',
        }
      }
    },
    mounted() {
      this.$refs.ProductModelTree.getProductList()
    },
    components: {
      ProductModelTree,
      AddOrUpdate,
      RBDEditImg
    },
    methods: {
      add() {
        this.$refs.AddOrUpdate.$refs.dialog.init(null, this.dataForm.productId)
      },
      onProductSelected(data) {
        this.dataForm.productId = data.id
        console.log(data, 'onProductSelected(data)')
        this.$refs.tableObj.query()
      },
      onDefault(defaultId){
        this.dataForm.productId = defaultId
        this.$refs.tableObj.query()
      },
      drawRBD(row) {
        this.dialogVisible2 = true
        this.title=row.modelName + '模型设计'
        this.$nextTick(() => {
          this.$refs.rbdEditImg.init(row)
        })
        this.$refs.tableObj.query()
      }
    }
  }
</script>