From 1b765e3dfdf8ab0d38e587a0a8beaee47a60e32c Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期五, 26 七月 2024 14:08:58 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/taskReliability/OperatCondit.vue |   35 +++++++++++++++++++++++++++++------
 1 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/web/src/views/modules/taskReliability/OperatCondit.vue b/web/src/views/modules/taskReliability/OperatCondit.vue
index 73f3ee5..e0f9934 100644
--- a/web/src/views/modules/taskReliability/OperatCondit.vue
+++ b/web/src/views/modules/taskReliability/OperatCondit.vue
@@ -5,9 +5,11 @@
         <div class="mod-taskReliability-operatCondit}">
           <div class="fa-card-a">
             <div style="margin-top: 10px">
-              <zt-select v-model="dataForm.productId" placeholder="璇烽�夋嫨浜у搧鑺傜偣"  :datas="productList" @change="onProductSelected"/>
+              <zt-select v-model="dataForm.productId" placeholder="璇烽�夋嫨浜у搧鑺傜偣" :datas="productList"
+                         @change="onProductSelected"/>
             </div>
-            <zt-table-wraper ref="tableObj" query-url="/taskReliability/OperatCondit/page" defaultNotQuery="true"  delete-url="/taskReliability/OperatCondit"
+            <zt-table-wraper ref="tableObj" query-url="/taskReliability/OperatCondit/page" defaultNotQuery="true"
+                             delete-url="/taskReliability/OperatCondit/"
                              v-slot="{ table }" :paging='false'>
               <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
                 <el-form-item>
@@ -17,11 +19,13 @@
                 </el-form-item>
               </el-form>
               <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px"
+                        :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="澶囨敞"/>
+                <el-table-column prop="remark" label="澶囨敞"
+                />
                 <zt-table-column-handle :table="table"
                                         delete-perm="taskReliability::delete"/>
               </el-table>
@@ -50,7 +54,9 @@
         productList: [],
         dataForm: {
           productId: '',
-        }
+        },
+        isSelect: false,
+        currentId: ''
       }
     },
     mounted() {
@@ -60,10 +66,9 @@
       OperaConditModel,
       AddOrUpdate
     },
-
     methods: {
       add() {
-        this.$refs.AddOrUpdate.$refs.dialog.init(null,{productId: this.dataForm.productId})
+        this.$refs.AddOrUpdate.$refs.dialog.init(null, {productId: this.dataForm.productId})
       },
       onProductSelected(data) {
         this.dataForm.productId = data.id
@@ -73,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,
@@ -82,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>

--
Gitblit v1.9.1