123 1 سال پیش
والد
کامیت
262d600191
1فایلهای تغییر یافته به همراه12 افزوده شده و 1 حذف شده
  1. 12 1
      src/views/runData/components/systemData/index.vue

+ 12 - 1
src/views/runData/components/systemData/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="container-app systemData">
-    <vxe-grid v-bind="gridOptions">
+    <vxe-grid v-bind="gridOptions" :row-class-name="rowClassName">
       <template #toolbar_buttons>
         <div class="flex">
           <t-input
@@ -98,6 +98,14 @@ const getTableList = async () => {
   gridOptions.loading = false;
   gridOptions.data = res.data;
 };
+
+const rowClassName = ({ row, rowIndex }) => {
+  if (String(row.online) === '0') {
+    return 'warningClass';
+  } else {
+    return '';
+  }
+};
 // 编辑
 const handleButton = (row, type) => {
   //编辑
@@ -111,6 +119,9 @@ const handleButton = (row, type) => {
 defineExpose({ init });
 </script>
 <style lang="less" scoped>
+::v-deep(.vxe-table .vxe-body--row.warningClass) {
+  color: red;
+}
 .systemData {
   padding: 15px;
   height: 78vh;