Commit bbe8167d56ed540d409db7bce80ebadc411ba83f

Authored by loveumiko
1 parent 7b3faf2d

feat: 增加GBT 28181协议的新功能

@@ -77,7 +77,9 @@ @@ -77,7 +77,9 @@
77 </BasicTable> 77 </BasicTable>
78 </PageWrapper> 78 </PageWrapper>
79 <CameraDrawer @register="registerDrawer" @success="handleSuccess" /> 79 <CameraDrawer @register="registerDrawer" @success="handleSuccess" />
80 - <VideoPreviewModal @register="registerModal" /> 80 + <!-- <VideoPreviewModal @register="registerModal" /> -->
  81 +
  82 + <VideoModal @register="registerModal" />
81 </div> 83 </div>
82 </template> 84 </template>
83 85
@@ -90,12 +92,13 @@ @@ -90,12 +92,13 @@
90 import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; 92 import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree';
91 import { cameraPage, deleteCameraManage } from '/@/api/camera/cameraManager'; 93 import { cameraPage, deleteCameraManage } from '/@/api/camera/cameraManager';
92 import { searchFormSchema, columns, AccessMode, PageMode, CameraPermission } from './config.data'; 94 import { searchFormSchema, columns, AccessMode, PageMode, CameraPermission } from './config.data';
93 - import VideoPreviewModal from './DialogPreviewVideo.vue'; 95 + // import VideoPreviewModal from './DialogPreviewVideo.vue';
94 import { useModal } from '/@/components/Modal'; 96 import { useModal } from '/@/components/Modal';
95 import { Authority } from '/@/components/Authority'; 97 import { Authority } from '/@/components/Authority';
96 import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; 98 import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
97 import { Popconfirm } from 'ant-design-vue'; 99 import { Popconfirm } from 'ant-design-vue';
98 import { Tag } from 'ant-design-vue'; 100 import { Tag } from 'ant-design-vue';
  101 + import VideoModal from '/@/views/device/list/cpns/tabs/VideoChannel/videoModal.vue';
99 102
100 export default defineComponent({ 103 export default defineComponent({
101 components: { 104 components: {
@@ -104,7 +107,8 @@ @@ -104,7 +107,8 @@
104 BasicTable, 107 BasicTable,
105 TableAction, 108 TableAction,
106 CameraDrawer, 109 CameraDrawer,
107 - VideoPreviewModal, 110 + // VideoPreviewModal,
  111 + VideoModal,
108 TableImg, 112 TableImg,
109 Authority, 113 Authority,
110 Popconfirm, 114 Popconfirm,
@@ -13,10 +13,11 @@ @@ -13,10 +13,11 @@
13 PauseOutlined, 13 PauseOutlined,
14 CaretDownOutlined, 14 CaretDownOutlined,
15 CaretLeftOutlined, 15 CaretLeftOutlined,
16 - PlusOutlined,  
17 - MinusOutlined, 16 + ZoomInOutlined,
  17 + ZoomOutOutlined,
18 } from '@ant-design/icons-vue'; 18 } from '@ant-design/icons-vue';
19 import { Button } from 'ant-design-vue'; 19 import { Button } from 'ant-design-vue';
  20 + import { nextTick } from 'vue';
20 const { prefixCls } = useDesign('basic-video-play'); 21 const { prefixCls } = useDesign('basic-video-play');
21 22
22 const props = defineProps<{ 23 const props = defineProps<{
@@ -31,8 +32,6 @@ @@ -31,8 +32,6 @@
31 32
32 const videoPlayEl = ref<HTMLVideoElement>(); 33 const videoPlayEl = ref<HTMLVideoElement>();
33 34
34 - const isPlay = ref<Boolean>(true); //是否是播放状态  
35 -  
36 const videoPlayInstance = ref<Nullable<VideoJsPlayer>>(); 35 const videoPlayInstance = ref<Nullable<VideoJsPlayer>>();
37 36
38 const getOptions = computed(() => { 37 const getOptions = computed(() => {
@@ -82,19 +81,29 @@ @@ -82,19 +81,29 @@
82 81
83 //type 1:上 2:右 3:下 4:左 5:暂停 82 //type 1:上 2:右 3:下 4:左 5:暂停
84 const handleClick = (type: number) => { 83 const handleClick = (type: number) => {
85 - console.log(type, 'type');  
86 if (type == 5) { 84 if (type == 5) {
87 - isPlay.value = !unref(isPlay); 85 + // if (unref(isPlay)) {
  86 + // unref(videoPlayInstance)?.play();
  87 + // } else {
  88 + // unref(videoPlayInstance)?.pause();
  89 + // }
  90 + isPlay.value = !isPlay.value;
88 } 91 }
89 }; 92 };
90 93
91 // type 1:放大 2:缩小 94 // type 1:放大 2:缩小
92 const handleScale = (type: number) => { 95 const handleScale = (type: number) => {
93 - console.log(type, 'type'); 96 + if (type == 1) {
  97 + } else {
  98 + }
94 }; 99 };
95 100
96 - onMounted(() => { 101 + const isPlay = ref<Boolean | null | undefined>(true);
  102 +
  103 + onMounted(async () => {
97 init(); 104 init();
  105 + await nextTick();
  106 + isPlay.value = unref(videoPlayInstance)?.paused();
98 }); 107 });
99 108
100 onUnmounted(() => { 109 onUnmounted(() => {
@@ -127,7 +136,9 @@ @@ -127,7 +136,9 @@
127 <CaretLeftOutlined class="front-sty-left child-icon" @click="handleClick(3)" /> 136 <CaretLeftOutlined class="front-sty-left child-icon" @click="handleClick(3)" />
128 137
129 <Button class="front-sty-center child center" shape="circle" @click="handleClick(5)"> 138 <Button class="front-sty-center child center" shape="circle" @click="handleClick(5)">
130 - <PauseOutlined v-if="isPlay" class="child-icon" style="color: #fffbfb" /> 139 + <!-- 暂停 -->
  140 + <PauseOutlined v-if="!isPlay" class="child-icon" style="color: #fffbfb" />
  141 + <!-- 播放 -->
131 <CaretRightOutlined v-else class="child-icon" style="color: #fffbfb" /> 142 <CaretRightOutlined v-else class="child-icon" style="color: #fffbfb" />
132 </Button> 143 </Button>
133 144
@@ -154,10 +165,10 @@ @@ -154,10 +165,10 @@
154 </div> 165 </div>
155 <div class="flex justify-center mt-8"> 166 <div class="flex justify-center mt-8">
156 <Button shape="circle" class="button-icon" @click="handleScale(1)"> 167 <Button shape="circle" class="button-icon" @click="handleScale(1)">
157 - <PlusOutlined style="color: #315a9c; font-size: 1.5rem" /> 168 + <ZoomInOutlined style="color: #315a9c; font-size: 1.5rem" />
158 </Button> 169 </Button>
159 <Button shape="circle" class="ml-10 button-icon" @click="handleScale(2)"> 170 <Button shape="circle" class="ml-10 button-icon" @click="handleScale(2)">
160 - <MinusOutlined style="color: #315a9c; font-size: 1.5rem" /> 171 + <ZoomOutOutlined style="color: #315a9c; font-size: 1.5rem" />
161 </Button> 172 </Button>
162 </div> 173 </div>
163 </div> 174 </div>