소스 검색

feat: 历史视频下载功能通过权限控制

lfeish 1 년 전
부모
커밋
b4cb1a360b

+ 0 - 2
src/hooks/setting/index.ts

@@ -20,7 +20,6 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
     VITE_GLOB_DISABLE_DEPARTMENT_EDIT,
     VITE_GLOB_HIDE_REPORT_MESSAGE_TABS,
     VITE_GLOB_NOTICE_CHANNEL,
-    VITE_GLOB_Historical_Retrospective_DOWLOAD_BUTTON,
     ...rest
   } = getAppEnvConfig();
 
@@ -41,7 +40,6 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
     disableDepartmentEdit: VITE_GLOB_DISABLE_DEPARTMENT_EDIT,
     hideReportMessageTabs: VITE_GLOB_HIDE_REPORT_MESSAGE_TABS,
     noticeChannel: VITE_GLOB_NOTICE_CHANNEL,
-    flvDowloadButton:VITE_GLOB_Historical_Retrospective_DOWLOAD_BUTTON,
     ...rest,
   };
   return glob as Readonly<GlobConfig>;

+ 6 - 2
src/types/permission/constants.ts

@@ -19,7 +19,6 @@ export enum PERM_DEVICE {
   NVR_DELETE = 'device_admin_module:nvr_delete', // NVR设备删除
 }
 
-
 /**
  * 算法管理模块
  */
@@ -48,6 +47,11 @@ export enum PERM_DATA {
    */
   VIOLATION_FAKE_ADD = 'data_admin_module:violation_fake_add', // 添加数据
   VIOLATION_FAKE_DELETE = 'data_admin_module:violation_fake_delete', // 删除数据
+
+  /**
+   * 历史视频(视频回看)
+   */
+  PLAYBACK_DOWNLOAD = 'data_admin_module:playback_download', // 视频下载
 }
 
 /**
@@ -57,7 +61,7 @@ export enum PERM_NOTICE {
   /**
    * 报表消息
    */
-  REPORT_ADD = 'notice_admin_module:report_add', 
+  REPORT_ADD = 'notice_admin_module:report_add',
   REPORT_EDIT = 'notice_admin_module:report_edit',
   REPORT_DELETE = 'notice_admin_module:report_delete',
   REPORT_ENABLE = 'notice_admin_module:report_enable',

+ 7 - 4
src/views/datamanager/playback/components/NvrCameraView.vue

@@ -37,7 +37,12 @@
     </div>
     <div class="nvr-setting-bar">
       <NvrVioCheckbox :available="confirmDate" :camera-id="cameraId" @check-tags="handleVioTags" />
-      <NvrTimeSelect ref="nvrTimeSelectRef" @set-Time="handleSetTime" @download-nvr="handleDownloadNvr" v-if="flvDowloadButton" />
+      <NvrTimeSelect
+        ref="nvrTimeSelectRef"
+        @set-Time="handleSetTime"
+        @download-nvr="handleDownloadNvr"
+        v-permission="{ action: [PERM_DATA.PLAYBACK_DOWNLOAD] }"
+      />
     </div>
     <a ref="downloadRef" style="display: none" href="" download />
   </div>
@@ -65,9 +70,7 @@
   } from '@/api/datamanagement/playback';
   import useCameraAlgoStore from '@/views/cameras/preview/store/useCameraAlgoStore';
   import { useFullscreen } from 'vue-hooks-plus';
-  import { useGlobSetting } from '@/hooks/setting';
-
-  const { flvDowloadButton } = useGlobSetting();
+  import { PERM_DATA } from '@/types/permission/constants';
 
   const cameraAlgoStore = useCameraAlgoStore();
   defineProps<{ cameraId: number }>();

+ 0 - 3
types/config.d.ts

@@ -100,8 +100,6 @@ export interface GlobEnvConfig {
 
   // 消息管理可选择的推送渠道
   VITE_GLOB_NOTICE_CHANNEL: NoticeChannelAppConfig[];
-  // 是否隐藏下载按钮
-  VITE_GLOB_Historical_Retrospective_DOWLOAD_BUTTON: boolean;
 }
 export interface GlobConfig {
   // 标题
@@ -122,5 +120,4 @@ export interface GlobConfig {
   tenantCode: string;
 
   minifyImgUrl?: string;
-  flvDowloadButton?: boolean;
 }

+ 0 - 2
utils/devProxy/shangfei/app.config.js

@@ -18,8 +18,6 @@ window.__PRODUCTION__SKYEYEADMIN__CONF__ = {
   VITE_GLOB_DISABLE_DEPARTMENT_EDIT: true,
   // 消息管理可选择的推送渠道
   VITE_GLOB_NOTICE_CHANNEL: ['lanxin', 'platform'],
-  // 是否显示历史回溯下载按钮
-  VITE_GLOB_Historical_Retrospective_DOWLOAD_BUTTON: true,
 };
 
 Object.freeze(window.__PRODUCTION__SKYEYEADMIN__CONF__);