|
@@ -119,8 +119,12 @@
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { reactive, ref, onMounted } from 'vue'
|
|
import { reactive, ref, onMounted } from 'vue'
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
|
|
-import { getVideoEncodePara, putVideoEncodePara } from '@/api/setting'
|
|
|
|
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
+import { getVideoEncodePara, putVideoEncodePara, cameraReset } from '@/api/setting'
|
|
|
|
|
+import { useUserStore } from '@/stores/modules/user'
|
|
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
|
|
+
|
|
|
|
|
+const router = useRouter()
|
|
|
|
|
|
|
|
// 主码流参数
|
|
// 主码流参数
|
|
|
const mainStream = reactive({
|
|
const mainStream = reactive({
|
|
@@ -129,7 +133,7 @@ const mainStream = reactive({
|
|
|
MainFps: 25,
|
|
MainFps: 25,
|
|
|
MainBitRate: 3072,
|
|
MainBitRate: 3072,
|
|
|
MainEcdFmat: 0,
|
|
MainEcdFmat: 0,
|
|
|
- MainFrameTime: 100
|
|
|
|
|
|
|
+ MainFrameTime: 150
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 子码流参数
|
|
// 子码流参数
|
|
@@ -139,7 +143,7 @@ const subStream = reactive({
|
|
|
SecondFps: 25,
|
|
SecondFps: 25,
|
|
|
SecondBitRate: 3072,
|
|
SecondBitRate: 3072,
|
|
|
SecondEcdFmat: 0,
|
|
SecondEcdFmat: 0,
|
|
|
- SecondFrameTime: 100
|
|
|
|
|
|
|
+ SecondFrameTime: 150
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 实时模式
|
|
// 实时模式
|
|
@@ -153,7 +157,7 @@ const mainResolutionOptions = [
|
|
|
{ value: 3, label: '2304*1296 (3M)' },
|
|
{ value: 3, label: '2304*1296 (3M)' },
|
|
|
{ value: 2, label: '1920*1080 (1080P)' },
|
|
{ value: 2, label: '1920*1080 (1080P)' },
|
|
|
{ value: 1, label: '1280*720 (720P)' },
|
|
{ value: 1, label: '1280*720 (720P)' },
|
|
|
- { value: 0, label: '640*360' },
|
|
|
|
|
|
|
+ // { value: 0, label: '640*360' },
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
// 子码流分辨率选项
|
|
// 子码流分辨率选项
|
|
@@ -202,14 +206,14 @@ async function resetDefaults() {
|
|
|
mainStream.MainFps = 25
|
|
mainStream.MainFps = 25
|
|
|
mainStream.MainBitRate = 3072
|
|
mainStream.MainBitRate = 3072
|
|
|
mainStream.MainEcdFmat = 0
|
|
mainStream.MainEcdFmat = 0
|
|
|
- mainStream.MainFrameTime = 100
|
|
|
|
|
|
|
+ mainStream.MainFrameTime = 150
|
|
|
// 子码流
|
|
// 子码流
|
|
|
subStream.SecondResolution = 0
|
|
subStream.SecondResolution = 0
|
|
|
subStream.encodeType = 0
|
|
subStream.encodeType = 0
|
|
|
subStream.SecondFps = 25
|
|
subStream.SecondFps = 25
|
|
|
subStream.SecondBitRate = 3072
|
|
subStream.SecondBitRate = 3072
|
|
|
subStream.SecondEcdFmat = 0
|
|
subStream.SecondEcdFmat = 0
|
|
|
- subStream.SecondFrameTime = 100
|
|
|
|
|
|
|
+ subStream.SecondFrameTime = 150
|
|
|
|
|
|
|
|
// realtimeMode.value = false
|
|
// realtimeMode.value = false
|
|
|
|
|
|
|
@@ -246,25 +250,42 @@ async function fetchParams() {
|
|
|
|
|
|
|
|
// 保存参数
|
|
// 保存参数
|
|
|
async function saveParams() {
|
|
async function saveParams() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 保存前提示用户需要重启才能生效
|
|
|
|
|
+ await ElMessageBox.confirm(
|
|
|
|
|
+ 'Changing the video settings will restart the device.',
|
|
|
|
|
+ 'Note',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: 'OK',
|
|
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ confirmButtonClass: 'el-button--danger'
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ // 用户取消,不执行保存
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
const data = {
|
|
const data = {
|
|
|
MainResolution: mainStream.MainResolution,
|
|
MainResolution: mainStream.MainResolution,
|
|
|
- // mainEncodeType: mainStream.encodeType,
|
|
|
|
|
MainFps: mainStream.MainFps,
|
|
MainFps: mainStream.MainFps,
|
|
|
MainBitRate: mainStream.MainBitRate,
|
|
MainBitRate: mainStream.MainBitRate,
|
|
|
MainEcdFmat: mainStream.MainEcdFmat,
|
|
MainEcdFmat: mainStream.MainEcdFmat,
|
|
|
MainFrameTime: mainStream.MainFrameTime,
|
|
MainFrameTime: mainStream.MainFrameTime,
|
|
|
SecondResolution: subStream.SecondResolution,
|
|
SecondResolution: subStream.SecondResolution,
|
|
|
- // subEncodeType: subStream.encodeType,
|
|
|
|
|
SecondFps: subStream.SecondFps,
|
|
SecondFps: subStream.SecondFps,
|
|
|
SecondBitRate: subStream.SecondBitRate,
|
|
SecondBitRate: subStream.SecondBitRate,
|
|
|
SecondEcdFmat: subStream.SecondEcdFmat,
|
|
SecondEcdFmat: subStream.SecondEcdFmat,
|
|
|
SecondFrameTime: subStream.SecondFrameTime,
|
|
SecondFrameTime: subStream.SecondFrameTime,
|
|
|
- // realtimeMode: realtimeMode.value ? 1 : 0
|
|
|
|
|
}
|
|
}
|
|
|
const res = await putVideoEncodePara(data)
|
|
const res = await putVideoEncodePara(data)
|
|
|
if (res.data === 'ok\n') {
|
|
if (res.data === 'ok\n') {
|
|
|
- ElMessage.success('Save Successful')
|
|
|
|
|
|
|
+ await cameraReset({ reboot: 1 }) // 保存成功后执行重启
|
|
|
|
|
+ ElMessage.success('Operation successful. Please wait a moment...')
|
|
|
|
|
+ useUserStore().logout()
|
|
|
|
|
+ router.push('/login')
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
ElMessage.warning('Save Failed')
|
|
ElMessage.warning('Save Failed')
|