jinlin
2024-04-02 5c1e5b08d28251186e99cf5e24c5114c404dc968
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
<template>
    <div class="mod-taskReliability-operatConditModel}">
      <zt-table-wraper ref="tableObj" :paging='false' defaultNotQuery="true" query-url="/taskReliability/OperatConditModel/page" delete-url="/taskReliability/OperatConditModel/" v-slot="{ table }">
        <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
          <el-form-item>
          </el-form-item>
        </el-form>
        <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px"
                  v-adaptive="{bottomOffset:70}" border @selection-change="table.selectionChangeHandle"
                  row-key="id"
                  :cell-style="cellStyle"
                  :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
                  :default-expand-all="true">
          <el-table-column prop="product" label="产品节点" width="160"/>
          <el-table-column prop="modelName" label="产品模型"/>
          <zt-table-column-handle :table="table" edit-perm="taskReliability:update"
                                  delete-perm="taskReliability::delete" :has-view="false">
            <template v-slot="{ row }">
              <zt-table-button @click="openSelectModel(row)">选择模型</zt-table-button>
            </template>
          </zt-table-column-handle>
        </el-table>
        <select-model-rbd ref="SelectModelRbd" ></select-model-rbd>
      </zt-table-wraper>
    </div>
</template>
 
<script>
  import SelectModelRbd from "./SelectModelRbd";
  export default {
    name: 'OperaConditModel',
    data() {
      return {
        dataForm: {
          operatConditId:'',
          productId:'',
        }
      }
    },
    components: {
      SelectModelRbd
    },
    methods:{
      init(param) {
        console.log(param, '')
        this.dataForm.operatConditId = param.row.id
        this.dataForm.productId = param.productId
        this.$refs.tableObj.query()
      },
      cellStyle({column}) {
        if (column.label === '系统') {
          return 'text-align: left !important;'
        }
      },
      openSelectModel(row) {
        console.log(row, 'selectModel');
        if (!row.operatConditId)
          row.operatConditId = this.dataForm.operatConditId
        this.$refs.SelectModelRbd.$refs.dialog.init(row)
      }
    }
  }
</script>