Commit 043628e0ab5555bdfed9a647a71197cafb65a3bd
1 parent
95e6bb26
fix: DEFECT-984 button not set auth key
Showing
3 changed files
with
20 additions
and
8 deletions
... | ... | @@ -11,10 +11,10 @@ |
11 | 11 | > |
12 | 12 | <template #toolbar> |
13 | 13 | <a-button type="primary" @click="handleSwitchMode">分屏模式</a-button> |
14 | - <Authority value="api:yt:video:post"> | |
14 | + <Authority :value="CameraPermission.CREATE"> | |
15 | 15 | <a-button type="primary" @click="handleCreateOrEdit(null)"> 新增视频 </a-button> |
16 | 16 | </Authority> |
17 | - <Authority value="api:yt:video:delete"> | |
17 | + <Authority :value="CameraPermission.DELETE"> | |
18 | 18 | <Popconfirm |
19 | 19 | title="您确定要批量删除数据" |
20 | 20 | ok-text="确定" |
... | ... | @@ -50,12 +50,12 @@ |
50 | 50 | { |
51 | 51 | label: '预览', |
52 | 52 | icon: 'clarity:note-edit-line', |
53 | - auth: 'api:yt:video:get', | |
53 | + auth: CameraPermission.PREVIEW, | |
54 | 54 | onClick: handleViewVideo.bind(null, record), |
55 | 55 | }, |
56 | 56 | { |
57 | 57 | label: '编辑', |
58 | - auth: 'api:yt:video:update', | |
58 | + auth: CameraPermission.UPDATE, | |
59 | 59 | icon: 'clarity:note-edit-line', |
60 | 60 | onClick: handleCreateOrEdit.bind(null, record), |
61 | 61 | }, |
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 | :drop-down-actions="[ |
64 | 64 | { |
65 | 65 | label: '删除', |
66 | - auth: 'api:yt:video:delete', | |
66 | + auth: CameraPermission.DELETE, | |
67 | 67 | icon: 'ant-design:delete-outlined', |
68 | 68 | color: 'error', |
69 | 69 | popConfirm: { |
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 | import CameraDrawer from './CameraDrawer.vue'; |
90 | 90 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; |
91 | 91 | import { cameraPage, deleteCameraManage } from '/@/api/camera/cameraManager'; |
92 | - import { searchFormSchema, columns, AccessMode, PageMode } from './config.data'; | |
92 | + import { searchFormSchema, columns, AccessMode, PageMode, CameraPermission } from './config.data'; | |
93 | 93 | import VideoPreviewModal from './DialogPreviewVideo.vue'; |
94 | 94 | import { useModal } from '/@/components/Modal'; |
95 | 95 | import { Authority } from '/@/components/Authority'; |
... | ... | @@ -199,6 +199,7 @@ |
199 | 199 | registerModal, |
200 | 200 | AccessMode, |
201 | 201 | handleSwitchMode, |
202 | + CameraPermission, | |
202 | 203 | }; |
203 | 204 | }, |
204 | 205 | }); | ... | ... |
... | ... | @@ -8,13 +8,14 @@ |
8 | 8 | import { useFullscreen } from '@vueuse/core'; |
9 | 9 | import CameraDrawer from './CameraDrawer.vue'; |
10 | 10 | import { useDrawer } from '/@/components/Drawer'; |
11 | - import { AccessMode, PageMode } from './config.data'; | |
11 | + import { AccessMode, CameraPermission, PageMode } from './config.data'; | |
12 | 12 | import SvgIcon from '/@/components/Icon/src/SvgIcon.vue'; |
13 | 13 | import { getStreamingPlayUrl } from '/@/api/camera/cameraManager'; |
14 | 14 | import { buildUUID } from '/@/utils/uuid'; |
15 | 15 | import { BasicVideoPlay, getVideoTypeByUrl } from '/@/components/Video'; |
16 | 16 | import { VideoJsPlayerOptions } from 'video.js'; |
17 | 17 | import { getBoundingClientRect } from '/@/utils/domUtils'; |
18 | + import { Authority } from '/@/components/Authority'; | |
18 | 19 | |
19 | 20 | type CameraRecordItem = CameraRecord & { |
20 | 21 | canPlay?: boolean; |
... | ... | @@ -220,7 +221,9 @@ |
220 | 221 | </div> |
221 | 222 | <div class="flex items-center gap-4"> |
222 | 223 | <div class="flex"> |
223 | - <Button type="primary" @click="handleAddCamera">新增视频</Button> | |
224 | + <Authority :value="CameraPermission.CREATE"> | |
225 | + <Button type="primary" @click="handleAddCamera">新增视频</Button> | |
226 | + </Authority> | |
224 | 227 | </div> |
225 | 228 | <Space> |
226 | 229 | <Button type="primary" @click="handleChangeMode(PageMode.SPLIT_SCREEN_MODE)"> | ... | ... |
... | ... | @@ -6,6 +6,14 @@ import type { FormSchema as QFormSchema } from '/@/components/Form/index'; |
6 | 6 | import { CameraVideoUrl, CameraMaxLength, MediaTypeValidate } from '/@/utils/rules'; |
7 | 7 | import { h } from 'vue'; |
8 | 8 | import SnHelpMessage from './SnHelpMessage.vue'; |
9 | + | |
10 | +export enum CameraPermission { | |
11 | + PREVIEW = 'api:yt:video:get', | |
12 | + CREATE = 'api:yt:video:post', | |
13 | + UPDATE = 'api:yt:video:update', | |
14 | + DELETE = 'api:yt:video:delete', | |
15 | +} | |
16 | + | |
9 | 17 | export enum AccessMode { |
10 | 18 | ManuallyEnter = 0, |
11 | 19 | Streaming = 1, | ... | ... |