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