jinlin
2024-07-26 bcd950216084a6208de0c636f9430e47601acc01
web/src/views/modules/taskReliability/SelectModelRbd.vue
@@ -1,21 +1,16 @@
<template>
  <zt-dialog ref="dialog" column="2" title="选择系统模型" append-to-body :editAble="false" :hasConfirm="false">
    <el-card shadow="never" class="aui-card--fill">
      <div class="mod-taskReliability-modelRbd}">
  <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="100px" v-adaptive="{bottomOffset:30}"
          <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>
      </div>
    </el-card>
  </zt-dialog>
</template>
@@ -25,12 +20,13 @@
    name: 'SelectModelRbd',
    data() {
      return {
        param: null,
        dataForm: {
          id: '',
          modelName: '',
          modelState: '',
          productId: '',
          phaseId: '',
          operatConditId: '',
          modelId: '',
        }
      }
@@ -41,19 +37,20 @@
    components: {},
    methods: {
      init(param) {
        this.dataForm.productId = param.row.productId
        this.dataForm.phaseId = param.phaseId
        this.dataForm.id = param.row.id
        console.log(param)
        this.param = param
        this.dataForm.productId = param.id
        this.dataForm.operatConditId = param.operatConditId
        this.dataForm.id = param.operatConditModelId
      },
      async selectModel(row) {
      async selectModel(selectRow) {
        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)
        this.dataForm.modelId = selectRow.id
        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/OperatConditModel/', this.dataForm)
        if (res.success) {
          await this.$tip.success()
          this.$refs.dialog.close()
          this.$emit('setModel')
          this.param.modelName = selectRow.modelName
        }
      }
    }