diff --git a/src/api/media/playback.ts b/src/api/media/playback.ts new file mode 100644 index 00000000..10b88c55 --- /dev/null +++ b/src/api/media/playback.ts @@ -0,0 +1,49 @@ +import server from '@/utils/request'; +import { LocalStore } from '@/utils/comm'; +import { BASE_API_PATH, TOKEN_KEY } from '@/utils/variable'; +import { recordsItemType } from '@/views/media/Device/Playback/typings'; + +export default { + // 开始直播 + ptzStart: (deviceId: string, channelId: string, type: string) => + `${BASE_API_PATH}/media/device/${deviceId}/${channelId}/live.${type}?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}`, + + // 查询设备通道详情 + queryDetail: (deviceId: string, data: any) => server.post(`/media/device/${deviceId}/channel/_query`, data), + + // 查询本地回放记录 + queryRecordLocal: (deviceId: string, channelId: string, data?: any) => + server.post(`/media/device/${deviceId}/${channelId}/records/in-local`, data), + + // 下载到云端 + downloadRecord: (deviceId: string, channelId: string, data: any) => + server.post(`/media/device/${deviceId}/${channelId}/_record`, data), + + // 播放本地回放 + playbackLocal: ( + deviceId: string, + channelId: string, + suffix: string, + startTime: string, + endTime: string, + speed: number = 1 + ) => + `${BASE_API_PATH}/media/device/${deviceId}/${channelId}/playback.${suffix}?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}&startTime=${startTime}&endTime=${endTime}&speed=${speed}`, + + // 本地录像播放控制 + playbackControl: (deviceId: string, channelId: string) => + server.post(`/media/device/${deviceId}/${channelId}/stream-control`), + + // 查询云端回放记录 + recordsInServer: (deviceId: string, channelId: string, data: any) => + server.post(`/media/device/${deviceId}/${channelId}/records/in-server`, data), + + // 查询云端回放文件信息 + recordsInServerFiles: (deviceId: string, channelId: string, data: any) => + server.post(`/media/device/${deviceId}/${channelId}/records/in-server/files`, data), + + // 播放云端回放 + playbackStart: (recordId: string) => `${BASE_API_PATH}/record/${recordId}.mp4?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}`, + + downLoadFile: (recordId: string) => `${BASE_API_PATH}/record/${recordId}.mp4?download=true&:X_Access_Token=${LocalStore.get(TOKEN_KEY)}` +} \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index dd5e389f..7ff28560 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -73,7 +73,9 @@ const iconKeys = [ 'BellOutlined', 'UserOutlined', 'LogoutOutlined', - 'ReadIconOutlined' + 'ReadIconOutlined', + 'CloudDownloadOutlined', + 'PauseCircleOutlined', ] const Icon = (props: {type: string}) => { diff --git a/src/components/BadgeStatus/index.vue b/src/components/BadgeStatus/index.vue index 6929f8bb..403cbbe6 100644 --- a/src/components/BadgeStatus/index.vue +++ b/src/components/BadgeStatus/index.vue @@ -28,5 +28,4 @@ const props = defineProps({ */ statusNames: { type: Object }, }); - diff --git a/src/components/JUpload/index.vue b/src/components/JUpload/index.vue index 03ee6536..18def1a3 100644 --- a/src/components/JUpload/index.vue +++ b/src/components/JUpload/index.vue @@ -1,7 +1,7 @@ - +
diff --git a/src/components/Player/ScreenPlayer.vue b/src/components/Player/ScreenPlayer.vue index 1e8e38f4..cbff2af4 100644 --- a/src/components/Player/ScreenPlayer.vue +++ b/src/components/Player/ScreenPlayer.vue @@ -5,7 +5,7 @@
@@ -208,9 +208,7 @@ const formData = ref({ // 全屏元素 const fullscreenRef = ref(null); -const { isFullscreen, enter, exit, toggle } = useFullscreen( - fullscreenRef.value, -); +const { isFullscreen, enter, exit, toggle } = useFullscreen(fullscreenRef); /** * 刷新视频 diff --git a/src/components/Player/index.vue b/src/components/Player/index.vue index ef5d2bcf..b5d20225 100644 --- a/src/components/Player/index.vue +++ b/src/components/Player/index.vue @@ -30,7 +30,7 @@ const options = reactive({ muted: false, //静音 webFullScreen: false, speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //播放倍速 - autoPlay: true, //自动播放 + autoPlay: false, //自动播放 loop: false, //循环播放 mirror: false, //镜像画面 ligthOff: false, //关灯模式 diff --git a/src/components/RadioCard/index.vue b/src/components/RadioCard/index.vue index 676cc94e..eb07f433 100644 --- a/src/components/RadioCard/index.vue +++ b/src/components/RadioCard/index.vue @@ -26,7 +26,7 @@
- + - - - + -
- +
\ No newline at end of file diff --git a/src/views/device/Instance/Detail/Diagnose/Message/index.vue b/src/views/device/Instance/Detail/Diagnose/Message/index.vue index bac6d51c..f5bed24d 100644 --- a/src/views/device/Instance/Detail/Diagnose/Message/index.vue +++ b/src/views/device/Instance/Detail/Diagnose/Message/index.vue @@ -1,20 +1,20 @@ - +
- - + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Event/index.vue b/src/views/device/Instance/Detail/Running/Event/index.vue index a9e169ad..3059d3bf 100644 --- a/src/views/device/Instance/Detail/Running/Event/index.vue +++ b/src/views/device/Instance/Detail/Running/Event/index.vue @@ -1,28 +1,30 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue b/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue index 57c25647..6b7f6571 100644 --- a/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue +++ b/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue @@ -1,36 +1,36 @@ \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Property/index.vue b/src/views/device/Instance/Detail/Running/Property/index.vue index f0d6036a..fd9db835 100644 --- a/src/views/device/Instance/Detail/Running/Property/index.vue +++ b/src/views/device/Instance/Detail/Running/Property/index.vue @@ -2,7 +2,8 @@ - @@ -107,6 +88,7 @@ import { message } from 'ant-design-vue'; import { getWebSocket } from '@/utils/websocket'; import { map } from 'rxjs/operators'; import { queryDashboard } from '@/api/comm'; + const columns = [ { title: '名称', @@ -142,9 +124,6 @@ const _data = defineProps({ const value = ref(''); const dataSource = ref([]); const _dataSource = ref([]); -const pageIndex = ref(0); -const pageSize = ref(8); -const total = ref(0); const editVisible = ref(false); // 编辑 const detailVisible = ref(false); // 详情 const currentInfo = ref>({}); @@ -152,6 +131,9 @@ const instanceStore = useInstanceStore(); const indicatorVisible = ref(false); // 指标 const loading = ref(false); const propertyValue = ref>({}); +const _params = reactive({ + name: '', +}); const subRef = ref(); @@ -309,39 +291,35 @@ const getDashboard = async () => { loading.value = false; }; -const query = (page: number, size: number, value: string) => { - pageIndex.value = page || 0; - pageSize.value = size || 8; - const _from = pageIndex.value * pageSize.value; - const _to = (pageIndex.value + 1) * pageSize.value; - const arr = _.cloneDeep(_dataSource.value); - if (unref(value)) { - const li = arr.filter((i: any) => { - return i?.name.indexOf(unref(value)) !== -1; +const query = (params: Record) => + new Promise((resolve) => { + const _from = params.pageIndex * params.pageSize; + const _to = (params.pageIndex + 1) * params.pageSize; + let arr = _.cloneDeep(_dataSource.value); + if (params?.name) { + const li = _dataSource.value.filter((i: any) => { + return i?.name.indexOf(params.name) !== -1; + }); + arr = _.cloneDeep(li); + } + resolve({ + result: { + data: arr.slice(_from, _to), + pageIndex: params.pageIndex || 0, + pageSize: params.pageSize || 12, + total: arr.length, + }, + status: 200, }); - dataSource.value = li.slice(_from, _to); - total.value = li.length; - } else { - dataSource.value = arr.slice(_from, _to); - total.value = arr.length; - } - getDashboard(); -}; - -const pageChange = (page: number, size: number) => { - if (size === pageSize.value) { - query(page - 1, size, value.value); - } else { - query(0, size, value.value); - } -}; + getDashboard(); + }); watch( () => _data.data, (newVal) => { if (newVal.length) { _dataSource.value = newVal as PropertyData[]; - query(0, 8, value.value); + _params.name = ''; } }, { @@ -351,7 +329,7 @@ watch( ); const onSearch = () => { - query(0, 8, value.value); + _params.name = value.value; }; onUnmounted(() => { diff --git a/src/views/device/Instance/Detail/components/BindParentDevice/index.vue b/src/views/device/Instance/Detail/components/BindParentDevice/index.vue new file mode 100644 index 00000000..4d2a4cd6 --- /dev/null +++ b/src/views/device/Instance/Detail/components/BindParentDevice/index.vue @@ -0,0 +1,175 @@ + + + + + + diff --git a/src/views/device/Instance/Detail/components/EditTable/PatchMapping.vue b/src/views/device/Instance/Detail/components/EditTable/PatchMapping.vue index 2597cd04..add45b11 100644 --- a/src/views/device/Instance/Detail/components/EditTable/PatchMapping.vue +++ b/src/views/device/Instance/Detail/components/EditTable/PatchMapping.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/src/views/device/Instance/Import/index.vue b/src/views/device/Instance/Import/index.vue index 899cdb61..c939386e 100644 --- a/src/views/device/Instance/Import/index.vue +++ b/src/views/device/Instance/Import/index.vue @@ -1,36 +1,35 @@ \ No newline at end of file diff --git a/src/views/device/Instance/Process/index.vue b/src/views/device/Instance/Process/index.vue index 7dda3761..05b405ac 100644 --- a/src/views/device/Instance/Process/index.vue +++ b/src/views/device/Instance/Process/index.vue @@ -1,12 +1,12 @@ diff --git a/src/views/device/Instance/typings.d.ts b/src/views/device/Instance/typings.d.ts index e00c9319..035c56f0 100644 --- a/src/views/device/Instance/typings.d.ts +++ b/src/views/device/Instance/typings.d.ts @@ -83,4 +83,17 @@ type InstanceModel = { params: Set; // 处理无限循环Card active?: string; // 当前编辑的Card selectedRows: Map; +} + +export interface ActionsType { + key: string; + text?: string; + disabled?: boolean; + permission?: boolean; + onClick?: (data: any) => void; + style?: CSSProperties; + tooltip?: TooltipProps; + popConfirm?: PopconfirmProps; + icon?: string; + children?: ActionsType[]; } \ No newline at end of file diff --git a/src/views/media/Cascade/Channel/BindChannel/index.vue b/src/views/media/Cascade/Channel/BindChannel/index.vue index 137a0b19..18145a37 100644 --- a/src/views/media/Cascade/Channel/BindChannel/index.vue +++ b/src/views/media/Cascade/Channel/BindChannel/index.vue @@ -10,7 +10,7 @@ @cancel="_vis = false" :confirmLoading="loading" > -