wente
2024-11-05 1696a5ccc97a923f65eaf3a554eabce2436bc510
web/src/views/modules/taskReliability/OperatCondit.vue
@@ -9,23 +9,23 @@
                         @change="onProductSelected"/>
            </div>
            <zt-table-wraper ref="tableObj" query-url="/taskReliability/OperatCondit/page" defaultNotQuery="true"
                             delete-url="/taskReliability/OperatCondit"
                             delete-url="/taskReliability/OperatCondit/"
                             v-slot="{ table }" :paging='false'>
              <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
                <el-form-item>
                  <zt-button v-if="dataForm.productId" type="query" @click="table.query()"/>
                  <!--<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"
                        :highlight-current-row="isSelect"
                        :row-class-name="tableRowClassName"
                        v-adaptive="{bottomOffset:70}"
                        border @row-click="selectOperatCondit" @selection-change="table.selectionChangeHandle">
                <el-table-column type="selection" width="40" align="center"/>
                <el-table-column prop="name" label="工况名称"/>
                <el-table-column prop="remark" label="备注"
                /
                />
                <zt-table-column-handle :table="table"
                                        delete-perm="taskReliability::delete"/>
              </el-table>
@@ -56,6 +56,7 @@
          productId: '',
        },
        isSelect: false,
        currentId: ''
      }
    },
    mounted() {
@@ -65,7 +66,6 @@
      OperaConditModel,
      AddOrUpdate
    },
    methods: {
      add() {
        this.$refs.AddOrUpdate.$refs.dialog.init(null, {productId: this.dataForm.productId})
@@ -78,8 +78,14 @@
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        console.log(this.productList, ' async getTaskProductList()')
        this.onProductSelected(this.productList[0])
      },
      selectOperatCondit(row) {
        if (this.$refs.model.isChange) {
          this.$alert("有未保存的工况模型")
          return;
        }
        this.currentId = row.id
        this.$emit('selectOperatCondit', row)
        let param = {
          row: row,
@@ -87,6 +93,18 @@
        }
        this.$refs.model.init(param)
      },
      tableRowClassName({row, rowIndex}) {
        if (row.id === this.currentId) {
          return 'select-row';
        } else {
          return 'not-select-row';
        }
      }
    }
  }
</script>
<style>
  .el-table .select-row {
    background: rgba(23, 179, 163, 0.2) !important;
  }
</style>