From 22229c67d87f0fae4c4bc90db106b8a1e2c49b53 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 20 八月 2026 15:50:11 +0800
Subject: [PATCH] feat(permission): 为多个模块添加管理员权限控制功能

---
 src/views/safeProduction/dangerInvestigation/index.vue |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/src/views/safeProduction/dangerInvestigation/index.vue b/src/views/safeProduction/dangerInvestigation/index.vue
index fb148e6..68a8e93 100644
--- a/src/views/safeProduction/dangerInvestigation/index.vue
+++ b/src/views/safeProduction/dangerInvestigation/index.vue
@@ -111,13 +111,13 @@
         </el-table-column>
         <el-table-column fixed="right"
                          label="鎿嶄綔"
-                         min-width="250"
+                         min-width="150"
                          align="center">
           <template #default="scope">
-            <el-button link
+            <!-- <el-button link
                        type="primary"
                        size="small"
-                       @click="openForm('edit', scope.row)">缂栬緫</el-button>
+                       @click="openForm('edit', scope.row)">缂栬緫</el-button> -->
             <el-button link
                        type="primary"
                        size="small"
@@ -125,11 +125,12 @@
             <el-button link
                        type="primary"
                        size="small"
+                       :disabled="scope.row.isRectify || scope.row.rectifyActualTime"
                        @click="openForm('edit2', scope.row)">鏁存敼</el-button>
             <el-button link
                        type="primary"
                        size="small"
-                       :disabled="!scope.row.rectifyActualTime"
+                       :disabled="!scope.row.rectifyActualTime || scope.row.verifyTime"
                        @click="openForm('edit3', scope.row)">楠屾敹</el-button>
           </template>
         </el-table-column>
@@ -453,6 +454,9 @@
   import { get } from "@vueuse/core";
 
   const userStore = useUserStore();
+  const isAdminUser = computed(() =>
+    ["admin", "鏅��2", "鏈�楂�1"].some(r => (userStore.roles || []).includes(r))
+  );
   const { proxy } = getCurrentInstance();
   const tableData = ref([]);
   const selectedRows = ref([]);
@@ -658,6 +662,16 @@
         tableLoading.value = false;
         tableData.value = res.data.records;
         total.value = res.data.total;
+        tableData.value.forEach(item => {
+          // console.log(item.rectifyUserId, currentUserId.value, "=======");
+          if (isAdminUser.value) {
+            item.isRectify = false;
+          } else if (Number(item.rectifyUserId) != Number(currentUserId.value)) {
+            item.isRectify = true;
+          } else {
+            item.isRectify = false;
+          }
+        });
         return res;
       })
       .catch(() => {
@@ -892,6 +906,9 @@
         proxy.$modal.msg("宸插彇娑�");
       });
   };
+  const isPeople = rectifyUserId => {
+    return Number(rectifyUserId) == Number(currentUserId.value);
+  };
 
   /**
    * 鍒ゆ柇鏄惁鍙互鍙戣揣
@@ -972,11 +989,11 @@
   };
 
   onMounted(() => {
+    getCurrentFactoryName();
     getList();
     userListNoPage().then(res => {
       userList.value = res.data;
     });
-    getCurrentFactoryName();
   });
   // 涓婁紶闄勪欢
   const handleUpload = async () => {

--
Gitblit v1.9.3