Kaynağa Gözat

fix(bugs): 添加超级管理员和平台管理员操作权限

tangning 3 yıl önce
ebeveyn
işleme
8711213eb1
2 değiştirilmiş dosya ile 33 ekleme ve 28 silme
  1. 6 2
      src/views/scenes/list.vue
  2. 27 26
      src/views/scenes/live.vue

+ 6 - 2
src/views/scenes/list.vue

@@ -42,7 +42,9 @@
                   {
                     color: 'error',
                     label: t('routes.scenes.makeLiveCover'),
-                    ifShow: record.lived !== true && getEquity([1, 2]),
+                    ifShow:
+                      (record.lived !== true && getEquity([1, 2])) ||
+                      (record.lived !== true && getCheckRole(['super', 'plat_admin'])),
                     onClick: generateDefaultLiveRoom.bind(null, record),
                   },
                 ]
@@ -182,7 +184,8 @@
           title: t('common.operation'),
           dataIndex: '',
           slots: { customRender: 'action' },
-          ifShow: !getCheckRole('tourist') && getEquity(1),
+          ifShow:
+            (!getCheckRole('tourist') && getEquity(1)) || getCheckRole(['super', 'plat_admin']),
           width: 330,
           fixed: 'right',
         },
@@ -319,6 +322,7 @@
         generateDefaultLiveRoom,
         openSceneEditorModal,
         getEquity,
+        getCheckRole,
       };
     },
   });

+ 27 - 26
src/views/scenes/live.vue

@@ -4,7 +4,10 @@
       <template #toolbar>
         <a-button
           type="primary"
-          v-show="!getCheckRole(['host', 'tourist', 'company_viewer']) && getEquity([1, 2])"
+          v-show="
+            getCheckRole(['super', 'plat_admin']) ||
+            (!getCheckRole(['host', 'tourist', 'company_viewer']) && getEquity([1, 2]))
+          "
           @click="handleAddLiveScene"
         >
           新增</a-button
@@ -25,30 +28,26 @@
 
       <template #action="{ record }">
         <TableAction
-          :actions="
-            permList.includes(2)
-              ? [
-                  {
-                    label: t('routes.scenes.bindAnchor'),
-                    color: 'success',
-                    onClick: handleBindAnchor.bind(null, record),
-                  },
-                  {
-                    color: 'warning',
-                    label: '编辑',
-                    onClick: handleEditLiveScene.bind(null, record),
-                  },
-                  {
-                    color: 'error',
-                    label: '删除',
-                    popConfirm: {
-                      title: '是否确认删除',
-                      confirm: handleDeleteLiveScene.bind(null, record),
-                    },
-                  },
-                ]
-              : []
-          "
+          :actions="[
+            {
+              label: t('routes.scenes.bindAnchor'),
+              color: 'success',
+              onClick: handleBindAnchor.bind(null, record),
+            },
+            {
+              color: 'warning',
+              label: '编辑',
+              onClick: handleEditLiveScene.bind(null, record),
+            },
+            {
+              color: 'error',
+              label: '删除',
+              popConfirm: {
+                title: '是否确认删除',
+                confirm: handleDeleteLiveScene.bind(null, record),
+              },
+            },
+          ]"
         />
       </template>
     </BasicTable>
@@ -167,7 +166,9 @@
           title: t('common.operation'),
           dataIndex: '',
           slots: { customRender: 'action' },
-          ifShow: !getCheckRole(['host', 'tourist']) && getEquity(2),
+          ifShow:
+            (!getCheckRole(['host', 'tourist']) && getEquity(2)) ||
+            getCheckRole(['super', 'plat_admin']),
           width: 220,
           fixed: 'right',
         },