Просмотр исходного кода

fix: 交通安全修复Bug(总览字体大小+交通事故操作列权限)

bxy 7 месяцев назад
Родитель
Сommit
7142cf8257

+ 6 - 12
src/views/traffic/accident/Accident.vue

@@ -91,8 +91,13 @@
             <template #action="scope">
             <template #action="scope">
               <div class="action-container--div">
               <div class="action-container--div">
                 <ActionButton text="查看" @click="handleViewDetail(scope.row.id)" />
                 <ActionButton text="查看" @click="handleViewDetail(scope.row.id)" />
-                <ActionButton text="编辑" @click="handleEditVehicleInfo(scope.row.id)" />
                 <ActionButton
                 <ActionButton
+                  text="编辑"
+                  v-if="accidentManagePermission"
+                  @click="handleEditVehicleInfo(scope.row.id)"
+                />
+                <ActionButton
+                  v-if="accidentManagePermission"
                   text="删除"
                   text="删除"
                   :popconfirm="{
                   :popconfirm="{
                     title: '是否删除该交通事故记录?',
                     title: '是否删除该交通事故记录?',
@@ -307,16 +312,6 @@
     tableConfig.loading = false;
     tableConfig.loading = false;
   };
   };
 
 
-  // 动态生成表格列配置
-  const getTableColumns = () => {
-    if (accidentManagePermission.value) {
-      return ACCIDENT_LIST_TABLE_COLUMNS;
-    } else {
-      // 过滤掉操作列
-      return ACCIDENT_LIST_TABLE_COLUMNS.filter((column) => column.prop !== 'action' && column.type !== 'selection');
-    }
-  };
-
   onMounted(() => {
   onMounted(() => {
     getTableData();
     getTableData();
     accidentManagePermission.value = Boolean(
     accidentManagePermission.value = Boolean(
@@ -325,7 +320,6 @@
     tableConfig.maxHeight = accidentManagePermission.value
     tableConfig.maxHeight = accidentManagePermission.value
       ? ACCIDENT_LIST_TABLE_MAX_HEIGHT_PERMISSION
       ? ACCIDENT_LIST_TABLE_MAX_HEIGHT_PERMISSION
       : ACCIDENT_LIST_TABLE_MAX_HEIGHT_DEFAULT;
       : ACCIDENT_LIST_TABLE_MAX_HEIGHT_DEFAULT;
-    tableConfig.columns = getTableColumns();
   });
   });
 </script>
 </script>
 
 

+ 1 - 1
src/views/traffic/overview/components/AccidentRecords.vue

@@ -14,7 +14,7 @@
         <el-table-column prop="accidentDescription" label="事故描述" />
         <el-table-column prop="accidentDescription" label="事故描述" />
         <el-table-column prop="action" label="操作" width="140px" align="center" fixed="right">
         <el-table-column prop="action" label="操作" width="140px" align="center" fixed="right">
           <template #default="scope">
           <template #default="scope">
-            <el-button link type="primary" size="small" @click="handleViewDetail(scope.row.id)"> 查看详情 </el-button>
+            <el-button link type="primary" @click="handleViewDetail(scope.row.id)"> 查看详情 </el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
       </el-table>
       </el-table>