Pārlūkot izejas kodu

feat(ship): 更新船信息和列表展示

- 修改 ShipInfo 组件中的认证按钮文本为"船舶认证"
- 在 ShipList 和 ShipOwnerList 组件中添加未认证行的样式
- 优化表格数据的展示效果
wzg 6 mēneši atpakaļ
vecāks
revīzija
6f3c7f15f1

+ 1 - 1
src/components/ShipInfo.vue

@@ -83,7 +83,7 @@
             type="primary"
             @click="authShip()"
           >
-            船认证
+            船认证
           </el-button>
         </div>
       </div>

+ 19 - 1
src/views/shipManage/shipList.vue

@@ -15,7 +15,13 @@
       <div class="c6 fs16">所有船舶总数量: {{ total }}</div>
     </div>
     <div style="margin-top: 24px">
-      <el-table border :data="tableData" stripe style="width: 100%">
+      <el-table
+        border
+        :data="tableData"
+        stripe
+        style="width: 100%"
+        :row-class-name="tableRowClassName"
+      >
         <el-table-column label="序号" width="50" align="center">
           <template v-slot="scope">
             {{ scope.$index + 1 + 10 * (currentPage - 1) }}
@@ -183,6 +189,14 @@ async function shipDetail(shipCode) {
     },
   });
 }
+
+const tableRowClassName = ({ row, rowIndex }) => {
+  if (row.hhdAuthStatus === 0) {
+    return "unauthenticated-row";
+  }
+  return "";
+};
+
 function pageChange(e) {
   currentPage.value = e;
   getShipList();
@@ -254,4 +268,8 @@ onMounted(() => {
   font-weight: 400;
   color: #0094fe;
 }
+
+:deep().unauthenticated-row {
+  color: red !important;
+}
 </style>

+ 18 - 1
src/views/shipOwnerManage/shipOwnerList.vue

@@ -61,7 +61,13 @@
       </el-dialog>
     </div>
     <div style="margin-top: 24px">
-      <el-table border :data="tableData" stripe style="width: 100%">
+      <el-table
+        border
+        :data="tableData"
+        stripe
+        style="width: 100%"
+        :row-class-name="tableRowClassName"
+      >
         <el-table-column
           type="index"
           label="序号"
@@ -206,6 +212,13 @@ async function shipOwnerDetail(shipOwnerId) {
     },
   });
 }
+
+const tableRowClassName = ({ row, rowIndex }) => {
+  if (row.hhdAuthStatus === 0) {
+    return "unauthenticated-row";
+  }
+  return "";
+};
 function pageChange(e) {
   currentPage.value = e;
   getShipOwnerList();
@@ -257,4 +270,8 @@ onMounted(() => {
   font-weight: 400;
   color: #0094fe;
 }
+
+:deep().unauthenticated-row {
+  color: red !important;
+}
 </style>