Sfoglia il codice sorgente

更新 移除管理员操作权限

wzg 2 anni fa
parent
commit
7adf8352f2

+ 1 - 1
src/apis/config.js

@@ -24,7 +24,7 @@ export const $http = async function (url, data) {
   });
   if (result.data.status != 0) {
     ElNotification.error({
-      title: "错误",
+      title: "error",
       duration: 3000,
       message: result.data.msg,
     });

+ 13 - 2
src/components/ShipInfo.vue

@@ -21,7 +21,11 @@
       <div></div>
       <div class="df">
         <div class="df" v-if="shipInfos[currentIndex].code">
-          <el-button v-if="shipInfoDisabled" type="primary" @click="showUpdate">
+          <el-button
+            v-if="shipInfoDisabled && store.state.isSuperuser == 0"
+            type="primary"
+            @click="showUpdate"
+          >
             更新船舶基础信息
           </el-button>
           <el-button
@@ -207,6 +211,7 @@
           >
             <div class="mr10">{{ item1.typeName }}</div>
             <el-date-picker
+              :disabled="store.state.isSuperuser == 1"
               style="width: 140px; font-size: 13px"
               v-model="item1.startValidTime"
               @change="changeDate($event, item, item1)"
@@ -217,6 +222,7 @@
             />
             <div style="margin: 0 4px">-</div>
             <el-date-picker
+              :disabled="store.state.isSuperuser == 1"
               style="width: 140px; font-size: 13px"
               v-model="item1.endValidTime"
               @change="changeDate($event, item, item1)"
@@ -257,7 +263,12 @@
         class="p30 mb30 df jcfe"
         style="background: #fff"
       >
-        <el-button :loading="isSubmitLoading" @click="submit" type="primary">
+        <el-button
+          v-if="store.state.isSuperuser == 0"
+          :loading="isSubmitLoading"
+          @click="submit"
+          type="primary"
+        >
           {{ isSubmitLoading ? "正在添加" : "添加船舶" }}
         </el-button>
       </div>

+ 2 - 1
src/components/Uploader.vue

@@ -9,7 +9,7 @@
       @mouseleave="item.hover = false"
     >
       <div
-        v-if="!disabled"
+        v-if="!disabled && store.state.isSuperuser == 0"
         class="delete-box pointer"
         @click="remove(item, index)"
       >
@@ -54,6 +54,7 @@
       ></el-image>
     </div>
     <el-upload
+      v-if="store.state.isSuperuser == 0"
       :class="{ hide: disabled || fileList.length == limit }"
       :id="uploaderId"
       drag

+ 8 - 3
src/layout/Aside.vue

@@ -27,7 +27,7 @@
   </el-menu>
 </template>
 <script setup>
-import { ref } from "vue";
+import { onMounted, ref } from "vue";
 import store from "../store";
 
 let defaultActive = ref();
@@ -35,7 +35,7 @@ function changeIndex(path) {
   store.commit("clearAlive");
   defaultActive.value = path;
 }
-let menu = [
+let menu = ref([
   {
     icon: "Fold",
     title: "海事总台",
@@ -112,7 +112,12 @@ let menu = [
       },
     ],
   },
-];
+]);
+onMounted(() => {
+  if (store.state.isSuperuser == 1) {
+    menu.value[5].items.length = 1;
+  }
+});
 </script>
 <style scoped>
 .el-sub-menu__title i {

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

@@ -109,6 +109,7 @@
         <el-table-column label="操作" min-width="160" align="center">
           <template v-slot="scope">
             <el-button
+              v-if="store.state.isSuperuser == 0"
               @click="deleteShip(scope.row.code)"
               type="primary"
               text

+ 6 - 2
src/views/shipOwnerManage/shipOwnerDetail.vue

@@ -13,7 +13,7 @@
   <div class="line-container-p24">
     <div class="df jcfe" v-if="shipOwnerDetail.code">
       <el-button
-        v-if="unchangeableShipOwner"
+        v-if="unchangeableShipOwner && store.state.isSuperuser == 0"
         type="primary"
         @click="showUpdate"
       >
@@ -106,7 +106,11 @@
         {{ isAddShipOwnerLoading ? "正在提交" : "确定" }}
       </el-button>
       <el-button
-        v-if="shipOwnerDetail.code && shipOwnerDetail.shipInfo.length == 0"
+        v-if="
+          shipOwnerDetail.code &&
+          shipOwnerDetail.shipInfo.length == 0 &&
+          store.state.isSuperuser == 0
+        "
         type="primary"
         @click="addShip()"
       >

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

@@ -13,6 +13,7 @@
         <el-button type="primary" @click="getShipOwnerList(1)">查询</el-button>
       </div>
       <el-button
+        v-if="store.state.isSuperuser == 0"
         type="primary"
         @click="router.push('/shipOwnerManage/shipOwnerDetail')"
       >

+ 2 - 0
src/views/shipSecurityManage/checkShipExamine.vue

@@ -105,6 +105,7 @@
             class="ml10"
             size="small"
             type="primary"
+            v-if="store.state.isSuperuser == 0"
             :disabled="!item.viewUrl"
           >
             通过
@@ -113,6 +114,7 @@
             @click="checkSecurityItem(item.id, 2)"
             size="small"
             type="danger"
+            v-if="store.state.isSuperuser == 0"
             :disabled="!item.viewUrl"
           >
             不通过

+ 7 - 1
src/views/shipSecurityManage/checkShipExamineList.vue

@@ -28,7 +28,13 @@
           查询
         </el-button>
       </div>
-      <el-button type="primary" @click="goToAdd">发起船舶安检</el-button>
+      <el-button
+        type="primary"
+        v-if="store.state.isSuperuser == 0"
+        @click="goToAdd"
+      >
+        发起船舶安检
+      </el-button>
     </div>
     <div style="margin-top: 24px">
       <el-table border :data="tableData" stripe style="width: 100%">

+ 7 - 1
src/views/shipSecurityManage/checkShipList.vue

@@ -14,7 +14,13 @@
           查询
         </el-button>
       </div>
-      <el-button type="primary" @click="goToAdd">发起船舶安检</el-button>
+      <el-button
+        type="primary"
+        v-if="store.state.isSuperuser == 0"
+        @click="goToAdd"
+      >
+        发起船舶安检
+      </el-button>
     </div>
     <div style="margin-top: 24px">
       <el-table border :data="tableData" stripe style="width: 100%">

+ 13 - 2
src/views/shipSecurityManage/shipCheckTemplateList.vue

@@ -14,7 +14,13 @@
           查询
         </el-button>
       </div>
-      <el-button type="primary" @click="showDialog">创建安检模板</el-button>
+      <el-button
+        type="primary"
+        v-if="store.state.isSuperuser == 0"
+        @click="showDialog"
+      >
+        创建安检模板
+      </el-button>
     </div>
     <div style="margin-top: 24px">
       <el-table border :data="tableData" stripe style="width: 100%">
@@ -46,7 +52,12 @@
             {{ subTimeStr(scope.row.createTime) }}
           </template>
         </el-table-column>
-        <el-table-column label="操作" min-width="80" align="center">
+        <el-table-column
+          v-if="store.state.isSuperuser == 0"
+          label="操作"
+          min-width="80"
+          align="center"
+        >
           <template v-slot="scope">
             <el-button
               @click="getSecurityTemplateDetail(scope.row.id)"