修改摄像头计划设置功能
This commit is contained in:
parent
25e3af8504
commit
b9f6684b53
|
@ -109,6 +109,9 @@
|
|||
</a-tab-pane>-->
|
||||
</a-tabs>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="E" tab="录像设置" forceRender="true">
|
||||
<PlanAddForm ref="addForm" :initData="formData" :data="cameraData" @success="submitCallback" />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -128,6 +131,7 @@ import {ref, onMounted, reactive, onUnmounted} from "vue";
|
|||
import CameraSoundAlarmForm from './CameraSoundAlarmForm.vue';//声音报警
|
||||
import CameraRecordList from './CameraRecordList.vue';//录像列表
|
||||
import CameraUploadForm from './CameraUploadForm.vue';//上传FTP
|
||||
import PlanAddForm from '/@/views/iot/tplink/plan/components/PlanAddForm.vue';//录像设置
|
||||
import { useMessage } from "@/hooks/web/useMessage";
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
|
@ -208,6 +212,7 @@ import {ref, onMounted, reactive, onUnmounted} from "vue";
|
|||
|
||||
function edit(record) {
|
||||
formData.deviceIndex = record.deviceIndex;
|
||||
formData.deviceName = record.deviceName;
|
||||
formData.parentId = record.parentId;
|
||||
formData.multitrans = record.multitrans;
|
||||
formData.projectId = record.projectId;
|
||||
|
@ -215,6 +220,7 @@ function edit(record) {
|
|||
formData.ip = record.ip;
|
||||
|
||||
cameraData.value.deviceIndex = formData.deviceIndex;
|
||||
cameraData.value.deviceName = formData.deviceName;
|
||||
cameraData.value.projectId = formData.projectId;
|
||||
cameraData.value.regionId = formData.regionId;
|
||||
cameraData.value.multitrans = formData.multitrans;
|
||||
|
|
|
@ -155,14 +155,17 @@ function handleSuccess() {
|
|||
* 画面配置
|
||||
*/
|
||||
function handlePicConfig(record) {
|
||||
console.log("🚀 ~ handlePicConfig ~ record:", record)
|
||||
var params = {
|
||||
deviceIndex: record.deviceIndex,
|
||||
deviceName: record.deviceName,
|
||||
parentId: record.parentId,
|
||||
multitrans: record.multitrans,
|
||||
projectId: record.projectId,
|
||||
regionId: record.regionId,
|
||||
ip: record.ip
|
||||
}
|
||||
console.log("🚀 ~ handlePicConfig ~ params:", params)
|
||||
cameraPictureConfigModal.value.disableSubmit = true;
|
||||
cameraPictureConfigModal.value.edit(params);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<a-card :bordered="false" style="height: 100%">
|
||||
<div class="title">
|
||||
2.选择录像存储位置、码流、计划
|
||||
选择录像存储位置、码流、计划
|
||||
</div>
|
||||
<a-divider />
|
||||
<a-spin :spinning="loading">
|
||||
|
@ -25,6 +25,9 @@
|
|||
</a-select>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<div style="text-align: center;margin-bottom:20px;">
|
||||
<a-button @click="submitForm">确认</a-button>
|
||||
</div>
|
||||
</a-spin>
|
||||
</a-card>
|
||||
</template>
|
||||
|
@ -32,11 +35,12 @@
|
|||
<script lang="ts" setup>
|
||||
import { watch, computed, inject, ref, unref, onMounted } from 'vue';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { addRecordCfgs, getAllRecordPlans, getStorageDevice } from '../plan.api';
|
||||
import { list,addRecordCfgs, getAllRecordPlans, getStorageDevice } from '../plan.api';
|
||||
import { addFormSchema } from "../plan.data";
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import {propTypes} from "@/utils/propTypes";
|
||||
import { nextTick } from 'process';
|
||||
const { createMessage, createSuccessModal } = useMessage();
|
||||
const emit = defineEmits(['success']);
|
||||
const props = defineProps({
|
||||
|
@ -75,6 +79,13 @@
|
|||
// if(record.projectId!=''&&record.regionId!=''){
|
||||
await fetchStorageDev(record.projectId,record.regionId);
|
||||
await fetchPlan();
|
||||
const data111 = await list(record);
|
||||
var listInfo = data111.records;
|
||||
if(listInfo.length>0){
|
||||
setFieldsValue(listInfo[0]);
|
||||
}else{
|
||||
setFieldsValue(null);
|
||||
}
|
||||
// }
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
|
@ -96,29 +107,24 @@
|
|||
|
||||
// 提交事件
|
||||
async function submitForm() {
|
||||
if(treeModel.value!=null){
|
||||
if(treeModel.value.length == 0){
|
||||
createMessage.info('请选择监控点!');
|
||||
}else{
|
||||
try {
|
||||
loading.value = true;
|
||||
let values = await validate();
|
||||
console.log("🚀 ~ submitForm ~ values:", values)
|
||||
values = Object.assign({}, model.value, values);
|
||||
console.log(values);
|
||||
values["ids"] = treeModel.value.join(',');
|
||||
console.log("🚀 ~ submitForm ~ model:", model)
|
||||
values['ids'] = initModel.value.deviceIndex;
|
||||
console.log("🚀 ~ submitForm ~ values:", values)
|
||||
//提交表单
|
||||
await addRecordCfgs(values);
|
||||
//刷新列表
|
||||
emit('success');
|
||||
Object.assign(model.value, {});
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const fetchStorageDev = async (projectId,regionId) => {
|
||||
console.log("🚀 ~ fetchStorageDev ~ projectId,regionId:", projectId,regionId)
|
||||
storageDevOptions.value = [];
|
||||
const data = await getStorageDevice({ projectId : projectId, regionId: regionId });
|
||||
console.log(data);
|
||||
|
@ -128,7 +134,7 @@
|
|||
const fetchPlan = async () => {
|
||||
planOptions.value = [];
|
||||
const data = await getAllRecordPlans({});
|
||||
console.log(data);
|
||||
console.log("🚀 ~ fetchPlan ~ data:", data)
|
||||
Object.assign(planOptions.value, data);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,11 @@ export const formSchema: FormSchema[] = [
|
|||
field: 'storageDevName',
|
||||
component: 'Input',
|
||||
slot: 'storageDevInput',
|
||||
componentProps: {
|
||||
options: [
|
||||
{label:'默认存储位置' , value: 0},
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '录像码流',
|
||||
|
|
Loading…
Reference in New Issue