From 9d411034f6a01569cbf4df72f98a1c8d0ef90ff0 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Mon, 6 Mar 2023 15:43:15 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=E5=9B=9E=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/media/playback.ts | 49 ++++ src/components/AIcon/index.tsx | 4 +- src/views/media/Device/Playback/iconNode.vue | 76 ++++++ src/views/media/Device/Playback/index.less | 120 +++++++++ src/views/media/Device/Playback/index.vue | 202 +++++++++++++- src/views/media/Device/Playback/timeLine.vue | 262 +++++++++++++++++++ 6 files changed, 709 insertions(+), 4 deletions(-) create mode 100644 src/api/media/playback.ts create mode 100644 src/views/media/Device/Playback/iconNode.vue create mode 100644 src/views/media/Device/Playback/index.less create mode 100644 src/views/media/Device/Playback/timeLine.vue 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/views/media/Device/Playback/iconNode.vue b/src/views/media/Device/Playback/iconNode.vue new file mode 100644 index 00000000..501c7861 --- /dev/null +++ b/src/views/media/Device/Playback/iconNode.vue @@ -0,0 +1,76 @@ + + + + + + diff --git a/src/views/media/Device/Playback/index.less b/src/views/media/Device/Playback/index.less new file mode 100644 index 00000000..dfa44d81 --- /dev/null +++ b/src/views/media/Device/Playback/index.less @@ -0,0 +1,120 @@ +@borderColor: #d9d9d9; + +.playback-warp { + display: flex; + padding: 24px; + background-color: #fff; + + .playback-left { + display: flex; + flex-direction: column; + flex-grow: 1; + width: 0; + + .playback-media { + width: 100%; + } + } + + .playback-right { + width: 300px; + margin-left: 24px; + + .playback-calendar { + margin-top: 16px; + border: 1px solid @borderColor; + border-radius: 2px; + + .ant-picker-calendar-header { + justify-content: space-between; + + > div:nth-child(3) { + display: none; + } + } + } + + .playback-list { + display: flex; + height: 300px; + margin-top: 16px; + overflow-y: auto; + border: 1px solid @borderColor; + + &.no-list { + align-items: center; + justify-content: center; + } + + .playback-list-items { + width: 100%; + + .ant-list-item { + padding-left: 12px; + } + } + } + } + + .time-line-warp { + padding: 10px 0; + + .time-line-clock { + display: flex; + align-items: stretch; + justify-content: space-between; + width: 100%; + + > div { + color: #666; + font-size: 12px; + } + } + + .time-line-content { + position: relative; + padding-bottom: 20px; + + .time-line-progress { + position: relative; + height: 16px; + overflow: hidden; + background-color: #d9d9d9; + border-radius: 2px; + + > div { + position: absolute; + top: 0; + left: 0; + height: 100%; + background-color: #52c41a; + cursor: pointer; + } + } + .time-line-btn { + position: absolute; + top: -2px; + left: 0; + width: 3px; + height: 19px; + background-color: @primary-color; + border-radius: 2px; + visibility: hidden; + } + + .time-line { + position: absolute; + bottom: -8px; + left: -30px; + width: 60px; + padding: 2px 0; + font-size: 12px; + text-align: center; + background-color: #d9d9d9; + border-radius: 2px; + box-shadow: 0 0 12px rgba(#000, 0.15); + visibility: hidden; + } + } + } +} diff --git a/src/views/media/Device/Playback/index.vue b/src/views/media/Device/Playback/index.vue index e0d2ef94..321a7127 100644 --- a/src/views/media/Device/Playback/index.vue +++ b/src/views/media/Device/Playback/index.vue @@ -1,7 +1,203 @@ + - + + + diff --git a/src/views/media/Device/Playback/timeLine.vue b/src/views/media/Device/Playback/timeLine.vue new file mode 100644 index 00000000..e77c014d --- /dev/null +++ b/src/views/media/Device/Playback/timeLine.vue @@ -0,0 +1,262 @@ + + + + + + From c032832ea7c886c48ace0a3718e71d3dc99056df Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Mon, 6 Mar 2023 17:34:33 +0800 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20=E8=A7=86=E9=A2=91=E4=B8=AD?= =?UTF-8?q?=E5=BF=83-=E5=9B=9E=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RadioCard/index.vue | 3 +- src/views/media/Device/Playback/iconNode.vue | 10 +- src/views/media/Device/Playback/index.vue | 160 ++++++++++++++++++- src/views/media/Device/Playback/timeLine.vue | 2 + 4 files changed, 166 insertions(+), 9 deletions(-) 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 @@
(); // type 为local时有效,0:未下载; 1:下载中:2:已下载 -// const status = ref(props.item?.isServer ? 2 : 0); -const status = computed({ - get: () => (props.item?.isServer ? 2 : 0), - set: (val: number) => {}, -}); +const status = ref(props.item?.isServer ? 2 : 0); +// const status = computed({ +// get: () => (props.item?.isServer ? 2 : 0), +// set: (val: number) => {}, +// }); const getLocalIcon = (s: number) => { if (s === 0) { diff --git a/src/views/media/Device/Playback/index.vue b/src/views/media/Device/Playback/index.vue index 321a7127..cc225d39 100644 --- a/src/views/media/Device/Playback/index.vue +++ b/src/views/media/Device/Playback/index.vue @@ -3,7 +3,12 @@
- +
- - + + +
类型:
+ +
+ +
+
+ + + +
+
+
@@ -34,6 +150,7 @@ import TimeLine from './timeLine.vue'; import IconNode from './iconNode.vue'; import type { recordsItemType } from './typings'; import LivePlayer from '@/components/Player/index.vue'; +import { getImage } from '@/utils/comm'; const route = useRoute(); @@ -196,6 +313,43 @@ const handleTimeLineChange = (times: any) => { url.value = ''; } }; + +watch( + () => type.value, + (val: string) => { + if (val === 'cloud') { + queryServiceRecords(time.value!); + } else { + queryLocalRecords(time.value!); + } + }, +); + +const handlePanelChange = (date: any) => { + // time.value = date; + if (type.value === 'cloud') { + queryServiceRecords(date); + } else { + queryLocalRecords(date); + } +}; + +// 播放暂停 +const handlePlay = (_startTime: any) => { + if (playStatus.value === 0 || _startTime !== playNowTime.value) { + if (playTimeNode.value) { + playTimeNode.value.playByStartTime(_startTime); + } + } else if (playStatus.value == 1 && _startTime === playNowTime.value) { + if (player.value.getVueInstance) { + // player.value.getVueInstance().pause(); + } + } else if (playStatus.value == 2 && _startTime === playNowTime.value) { + if (player.value.getVueInstance) { + // player.value.getVueInstance().play(); + } + } +}; \ 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/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/yarn.lock b/yarn.lock index 1bda2b9a..40dff6cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3903,8 +3903,8 @@ jetlinks-store@^0.0.3: jetlinks-ui-components@^1.0.4: version "1.0.4" - resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.4.tgz#31f6879f83d394ba45bfd6e94ce0b20de817d490" - integrity sha512-5X26+GsqsduCUSmlaYOAw/MDwKRsZFnifzzRqHcm5qbCi0KrrkID9aKatsMRaeTVEEca1/nzPaPGgXAo6bEpfQ== + resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.4.tgz#418d9218c2d0076b4a16606eb87ea755db303409" + integrity sha512-7c509Xx4YVamM/R6Xg62iIOxh2gWz8ASKCN2Pa8lU2CP1n+Vn5Xi5Q0fpd0AiFdi1QadssGaGUkpzbqCqWXLsQ== dependencies: "@vueuse/core" "^9.12.0" ant-design-vue "^3.2.15" From 1cf4a3f8b02c70be614cc1b3dab7eaa4e842e189 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Mon, 6 Mar 2023 18:03:51 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20dueros=E6=9B=BF=E6=8D=A2=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DuerOS/Detail/command/EditTable.vue | 4 +- .../DuerOS/Detail/command/index.vue | 74 +++--- src/views/Northbound/DuerOS/Detail/doc.vue | 8 +- src/views/Northbound/DuerOS/Detail/index.vue | 226 +++++++++--------- src/views/Northbound/DuerOS/index.vue | 34 ++- .../Diagnose/Message/Function/EditTable.vue | 5 +- .../Detail/Info/components/Tags/Save.vue | 2 +- yarn.lock | 4 +- 8 files changed, 177 insertions(+), 180 deletions(-) diff --git a/src/views/Northbound/DuerOS/Detail/command/EditTable.vue b/src/views/Northbound/DuerOS/Detail/command/EditTable.vue index 975d91fd..a080b038 100644 --- a/src/views/Northbound/DuerOS/Detail/command/EditTable.vue +++ b/src/views/Northbound/DuerOS/Detail/command/EditTable.vue @@ -1,5 +1,5 @@ - +