|
|
@@ -5,7 +5,7 @@ import { useNotification, useModal, NButton } from 'naive-ui'
|
|
|
import { h } from 'vue'
|
|
|
import { useOutsideHomeStore } from './home'
|
|
|
import AlarmVideo from '../../views/VideoBox/components/AlarmVideo.vue'
|
|
|
-import { getAutofitScale } from '@/utils'
|
|
|
+import { hasPermission } from '@/utils'
|
|
|
import { Events } from '@/utils/enum'
|
|
|
import mqtt from 'mqtt'
|
|
|
|
|
|
@@ -101,6 +101,9 @@ export const useSystemStore = defineStore('systemStore', {
|
|
|
},
|
|
|
// 连接报警信息
|
|
|
async connectAlarmWS() {
|
|
|
+ if (this.permissions && !hasPermission(['mralarmMessageList'], this.permissions)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
const useHomeStore = useOutsideHomeStore()
|
|
|
const notification = useNotification()
|
|
|
const alarmModel = useModal()
|
|
|
@@ -171,33 +174,35 @@ export const useSystemStore = defineStore('systemStore', {
|
|
|
dayjs(parseInt(`${data.time}`.padEnd(13, '0'))).format('YYYY-MM-DD HH:mm:ss')
|
|
|
)
|
|
|
]),
|
|
|
- h(
|
|
|
- NButton,
|
|
|
- {
|
|
|
- text: true,
|
|
|
- onClick: () => {
|
|
|
- alarmModel.create({
|
|
|
- title: d.eventTypes,
|
|
|
- preset: 'card',
|
|
|
- maskClosable: false,
|
|
|
- style: {
|
|
|
- width: '50%',
|
|
|
- marginTop: '10%'
|
|
|
- },
|
|
|
- content: () =>
|
|
|
- h(AlarmVideo, {
|
|
|
- alarm: d
|
|
|
+ that.permissions && !hasPermission(['mralarmVideoShow'], this.permissions)
|
|
|
+ ? null
|
|
|
+ : h(
|
|
|
+ NButton,
|
|
|
+ {
|
|
|
+ text: true,
|
|
|
+ onClick: () => {
|
|
|
+ alarmModel.create({
|
|
|
+ title: d.eventTypes,
|
|
|
+ preset: 'card',
|
|
|
+ maskClosable: false,
|
|
|
+ style: {
|
|
|
+ width: '50%',
|
|
|
+ marginTop: '10%'
|
|
|
+ },
|
|
|
+ content: () =>
|
|
|
+ h(AlarmVideo, {
|
|
|
+ alarm: d
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- () =>
|
|
|
- // h('div', {
|
|
|
- // class: 'i-fluent-eye-48-regular',
|
|
|
- // style: { width: '28px', height: '28px', padding: '5px' }
|
|
|
- // })
|
|
|
- '查看'
|
|
|
- )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ () =>
|
|
|
+ // h('div', {
|
|
|
+ // class: 'i-fluent-eye-48-regular',
|
|
|
+ // style: { width: '28px', height: '28px', padding: '5px' }
|
|
|
+ // })
|
|
|
+ '查看'
|
|
|
+ )
|
|
|
])
|
|
|
})
|
|
|
}
|