duy 1 年之前
父節點
當前提交
168c41a7de
共有 1 個文件被更改,包括 10 次插入4 次删除
  1. 10 4
      src/views/project/debit/contract/components/unit/row-data.vue

+ 10 - 4
src/views/project/debit/contract/components/unit/row-data.vue

@@ -92,7 +92,7 @@
                     </template>
                 </hc-title>
                 <div style="height: 400px;">
-                    <hc-table :column="tableColumn" :datas="tableData" is-new :index-style="{ width: 60 }">
+                    <hc-table :column="tableColumn" :datas="tableData" is-new :index-style="{ width: 60 }" :row-style="tableRowStyle">
                         <template #poseNum="{ row }">
                             <hc-table-input v-model="row.poseNum" />
                         </template>
@@ -143,9 +143,15 @@ const ids = ref(props.ids)
 const curTreeData = ref(props.curTreeData)
 const isTable = ref(props.isTable)
 const formModel = ref({})
-const tableData = ref([
-   
-])
+const tableData = ref([])
+//设置某一行的样式
+const tableRowStyle = ({ row, rowIndex }) => {
+    if (row.poseNum > row.contractTotal) {
+        // --el-fill-color-lighter 是表格行的背景色
+        // --el-table-row-hover-bg-color 是鼠标放上去后的背景色
+        return '--el-fill-color-lighter: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
+    }
+}
 //监听
 watch(() => [
     props.ids,