diff --git a/package.json b/package.json index 387d6753..c3cc14ad 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", - "jetlinks-ui-components": "^1.0.1", + "jetlinks-ui-components": "^1.0.3", "js-cookie": "^3.0.1", "less": "^4.1.3", "less-loader": "^11.1.0", diff --git a/src/api/media/cascade.ts b/src/api/media/cascade.ts index c8ba0a56..9881f689 100644 --- a/src/api/media/cascade.ts +++ b/src/api/media/cascade.ts @@ -35,8 +35,12 @@ export default { // 更改国标ID updateGbChannelId: (id: string, data: any): any => server.put(`/media/gb28181-cascade/binding/${id}`, data), // 查询通道分页列表 - queryChannelList: (data: any): any => server.post(`media/channel/_query`, data), + queryChannelList: (data: any): any => server.post(`/media/channel/_query`, data), // 推送 - publish: (id: string, params: any) => server.get(`/media/gb28181-cascade/${id}/bindings/publish`, params) + publish: (id: string, params: any) => server.get(`/media/gb28181-cascade/${id}/bindings/publish`, params), + + // 分屏展示接口 + // 设备树 + getMediaTree: (data?: any) => server.post(`/media/device/_query/no-paging`, data), } \ No newline at end of file diff --git a/src/components/Player/ScreenPlayer.vue b/src/components/Player/ScreenPlayer.vue new file mode 100644 index 00000000..d89f55f8 --- /dev/null +++ b/src/components/Player/ScreenPlayer.vue @@ -0,0 +1,400 @@ + + + + + + diff --git a/src/components/Player/index.less b/src/components/Player/index.less new file mode 100644 index 00000000..b199fe65 --- /dev/null +++ b/src/components/Player/index.less @@ -0,0 +1,82 @@ +.live-player-warp { + display: flex; + + .live-player-content { + display: flex; + flex: 1; + flex-direction: column; + + .player-screen-tool { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; + + .ant-radio-button-wrapper { + height: auto; + padding: 4px 20px; + } + } + + .player-body { + flex: 1; + + .player-screen { + position: relative; + display: grid; + box-sizing: border-box; + + &.screen-1 { + grid-template-columns: 1fr; + } + + &.screen-4 { + grid-template-rows: 1fr 1fr; + grid-template-columns: 1fr 1fr; + } + + &.screen-9 { + grid-template-rows: 1fr 1fr 1fr; + grid-template-columns: 1fr 1fr 1fr; + } + + &.screen-4, + &.screen-9 { + grid-gap: 12px; + } + + .active { + border: 2px solid red; + } + + .full-screen { + border: 1px solid #fff; + } + + .player-screen-item { + position: relative; + + .media-btn-refresh { + position: absolute; + top: 4px; + right: 4px; + z-index: 2; + padding: 2px 4px; + font-size: 12px; + background-color: #f0f0f0; + border-radius: 2px; + cursor: pointer; + + &:hover { + background-color: #d9d9d9; + } + + &:active { + background-color: #bfbfbf; + } + } + } + } + } + } +} diff --git a/src/components/Player/index.vue b/src/components/Player/index.vue index 1eff1f56..ef5d2bcf 100644 --- a/src/components/Player/index.vue +++ b/src/components/Player/index.vue @@ -10,6 +10,8 @@ import vue3videoPlay from 'vue3-video-play'; const props = defineProps({ src: { type: String, default: '' }, type: { type: String, default: 'mp4' }, + width: { type: String, default: '500px' }, + height: { type: String, default: '280px' }, }); watch( @@ -21,8 +23,6 @@ watch( const options = reactive({ ...props, - width: '500px', //播放器高度 - height: '280px', //播放器高度 color: '#409eff', //主题色 title: '', //视频名称 // src: props.src, diff --git a/src/views/media/SplitScreen/index.less b/src/views/media/SplitScreen/index.less new file mode 100644 index 00000000..f09f26c3 --- /dev/null +++ b/src/views/media/SplitScreen/index.less @@ -0,0 +1,85 @@ +@padding: 20px; + +.split-screen { + display: flex; + + .left-content { + width: 300px; + padding-right: @padding; + border-right: 1px solid #f0f0f0; + + .online { + color: rgba(82, 196, 26, 1); + } + + .offline { + color: rgba(0, 0, 0, 0.25); + } + + .left-search { + margin-bottom: 12px; + } + } + + .right-content { + display: flex; + flex-direction: column; + flex-grow: 1; + padding-left: @padding; + + .top { + display: flex; + flex-basis: 30px; + justify-content: center; + padding-bottom: 12px; + } + + .live-player { + display: flex; + flex: 1; + + .live-player-content { + position: relative; + flex-grow: 1; + + .player-screen { + display: grid; + + &.screen-1 { + grid-template-columns: 1fr; + } + + &.screen-4 { + grid-template-rows: 1fr 1fr; + grid-template-columns: 1fr 1fr; + } + + &.screen-9 { + grid-template-rows: 1fr 1fr 1fr; + grid-template-columns: 1fr 1fr 1fr; + } + + &.screen-4, + &.screen-9 { + grid-gap: 12px; + } + } + } + + .player-tools { + flex-basis: 280px; + padding: 50px 12px 0 12px; + } + } + } +} + +@media screen { + @media (min-width: 1300px) { + .split-screen { + .left-content { + width: 200px; + } + } + } +} diff --git a/src/views/media/SplitScreen/index.vue b/src/views/media/SplitScreen/index.vue new file mode 100644 index 00000000..0c27f885 --- /dev/null +++ b/src/views/media/SplitScreen/index.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/views/media/SplitScreen/tree.vue b/src/views/media/SplitScreen/tree.vue new file mode 100644 index 00000000..2b1eceb2 --- /dev/null +++ b/src/views/media/SplitScreen/tree.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/yarn.lock b/yarn.lock index e006eebb..4fad3a08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3901,7 +3901,7 @@ jetlinks-store@^0.0.3: resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz" integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q== -jetlinks-ui-components@^1.0.1: +jetlinks-ui-components@^1.0.3: version "1.0.3" resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.3.tgz#08a35ebfa016574affcfd11204359cdccf8e139f" integrity sha512-kA/AxzdfNy+Sl8En8raMwIh3stofgElkUuJ+oRJMpQVTGbrOk29DifRsHJJFNvtEvclmLdKZkOkthOuEdG2mnw==