浏览代码

优化监控

master
wwp 4 个月前
父节点
当前提交
ce1a0ec803
共有 3 个文件被更改,包括 89 次插入24 次删除
  1. +18
    -13
      SafeCampus.WEB/src/views/monitor/live/components/form.vue
  2. +69
    -9
      SafeCampus.WEB/src/views/monitor/live/index.vue
  3. +2
    -2
      SafeCampus.WEB/src/views/sysconfig/ability/index.vue

+ 18
- 13
SafeCampus.WEB/src/views/monitor/live/components/form.vue 查看文件

@@ -15,17 +15,20 @@
label-width="auto"
label-suffix=" :"
>
<s-form-item label="摄像头名称" prop="name">
<s-input v-model="orgProps.record.name"></s-input>
<s-form-item label="摄像头名称" prop="sensorName">
<s-input v-model="orgProps.record.sensorName"></s-input>
</s-form-item>
<s-form-item label="所属学校" prop="parentId">
<org-selector v-model:org-value="orgProps.record.parentId" :org-tree-api="bizOrgApi.tree" :show-all="false" />
<s-form-item label="所属学校" prop="fieldName">
<org-selector v-model:org-value="orgProps.record.fieldName" :org-tree-api="bizOrgApi.tree" :show-all="false" />
</s-form-item>
<s-form-item label="设备IP" prop="codeip">
<s-input v-model="orgProps.record.codeip" clearable></s-input>
<s-form-item label="设备IP" prop="directUrlIp">
<s-input v-model="orgProps.record.directUrlIp" clearable></s-input>
</s-form-item>
<s-form-item label="分辨率" prop="status">
<s-input v-model="orgProps.record.status" clearable></s-input>
<s-form-item label="分辨率(width)" prop="resWidth">
<s-input v-model="orgProps.record.resWidth" clearable></s-input>
</s-form-item>
<s-form-item label="分辨率(height)" prop="resHeight">
<s-input v-model="orgProps.record.resHeight" clearable></s-input>
</s-form-item>
</el-form>
<template #footer>
@@ -58,10 +61,11 @@ const orgProps = reactive<FormProps.Base<any>>({

// 表单验证规则
const rules = reactive({
name: [required("请输入摄像头名称")],
parentId: [required("请选择所属学校")],
codeip: [required("请选择设备IP")],
status: [required("请输入分辨率")]
sensorName: [required("请输入摄像头名称")],
fieldName: [required("请选择所属学校")],
directUrlIp: [required("请选择设备IP")],
resWidth: [required("请输入分辨率(width)")],
resHeight: [required("请输入分辨率(height)")]
});

/**
@@ -72,11 +76,12 @@ function onOpen(props: FormProps.Base<SysOrg.SysOrgInfo>) {
Object.assign(orgProps, props); //合并参数
if (props.opt == FormOptEnum.ADD) {
//如果是新增,设置默认值
orgProps.record.sortCode = 99;
// orgProps.record.sortCode = 99;
// orgProps.record.status = statusOptions[0].value;
}
visible.value = true; //显示表单
if (props.record.id) {
orgProps.record = props.record;
//如果传了id,就去请求api获取record
return;
bizOrgApi.detail({ id: props.record.id }).then(res => {


+ 69
- 9
SafeCampus.WEB/src/views/monitor/live/index.vue 查看文件

@@ -11,7 +11,7 @@
<el-button icon="CirclePlus" @click="append('add', {})" type="primary">添加分组</el-button>
</div>
<div class="treeContent">
<el-input v-model="filterText" style="width: 240px" placeholder="请输入关键字" />
<el-input clearable v-model="filterText" style="width: 100%" placeholder="请输入关键字" />
<el-tree
style="max-width: 600px"
ref="treeRef"
@@ -60,11 +60,25 @@
<!-- 表格 菜单类型 按钮 -->
<!-- 操作 -->
<template #operation="scope">
<s-button link :opt="FormOptEnum.EDIT" @click="onOpen(FormOptEnum.EDIT, scope.row)">编辑</s-button>
<s-button link :opt="FormOptEnum.VIEW" @click="onDetail(scope.row)"> 查看 </s-button>
<s-button link :opt="FormOptEnum.DELETE" @click="onDelete([scope.row.id], `确定删除该摄像头吗?`)" />
<!-- <el-button link type="primary" :icon="Avatar" /> -->
<s-button link :opt="FormOptEnum.VIEW" @click="pushPerson(FormOptEnum.VideoPushPerson, scope.row)"> 推送人 </s-button>
<el-space>
<s-button link :opt="FormOptEnum.EDIT" @click="onOpen(FormOptEnum.EDIT, scope.row)">编辑</s-button>
<s-button link :opt="FormOptEnum.VIEW" @click="onDetail(scope.row)"> 查看 </s-button>
<!-- <s-button link :opt="FormOptEnum.DELETE" @click="onDelete([scope.row.id], `确定删除该摄像头吗?`)" />
<s-button link :opt="FormOptEnum.VIEW" @click="pushPerson(FormOptEnum.VideoPushPerson, scope.row)"> 推送人 </s-button> -->
<el-dropdown @command="handleCommand">
<el-link type="primary" :underline="false" :icon="ArrowDown"> 更多 </el-link>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item :command="command(scope.row, cmdEnum.Delete)">
{{ cmdEnum.Delete }}
</el-dropdown-item>
<el-dropdown-item :command="command(scope.row, cmdEnum.pushPerson)">
{{ cmdEnum.pushPerson }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-space>
</template>
</ProTable>
<!-- 添加分组弹框 -->
@@ -114,11 +128,12 @@
</div>
</div>
</template>
<script setup lang="tsx" name="sysSpa">
<script setup lang="tsx" name="live">
import VideoPlay from "@/components/VideoPlay/videoplay.vue";
import { ElMessage, ElMessageBox, ElTree } from "element-plus";
import { ArrowDown,More } from "@element-plus/icons-vue";
import type Node from "element-plus/es/components/tree/src/model/node";
import { monitorLIVEApi, monitorLiveButtonCode } from "@/api";
import { monitorLIVEApi, monitorLiveButtonCode,SysOrg,SysUserPersonnel } from "@/api";
import { sysCamera } from "@/api/interface";
import { useHandleData } from "@/hooks/useHandleData";
import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
@@ -147,6 +162,50 @@ enum FormOptEnum {
// 分组
GROUP = "分组"
}
/** 更多下拉菜单命令枚举 */
enum cmdEnum {
Delete = "删除",
pushPerson = "推送人"
}
/** 下拉菜单参数接口 */
interface Command {
row: SysUserPersonnel.SysUserPerInfo;
command: cmdEnum;
}

/**配置command的参数 */
function command(row: SysUserPersonnel.SysUserPerInfo, command: cmdEnum): Command {
return {
row: row,
command: command
};
}
function handleCommand(command: Command) {
switch (command.command) {
case cmdEnum.Delete:
ElMessageBox.confirm(`确定要删除此数据吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
onDelete([command.row.id])
})
.catch(() => {
})
break
case cmdEnum.pushPerson:
pushPerson(FormOptEnum.VideoPushPerson, command.row)
// userManagePersonnelApi.personUnBindDfie({
// personId:command.row.personId,
// personSetId: command.row.personSets[0].personSetId
// }).then(res=>{
// ElMessage.success('底库解绑成功');
// RefreshTable()
// })
break;
}
}
// 分组字段配置
const defaultProps = {
children: "children",
@@ -299,6 +358,7 @@ function omMove(opt: FormOptEnum, record: {} | SysOrg.SysOrgInfo = {}) {
* @param ids id数组
*/
async function onDelete(ids: string[], msg: string) {
console.log(1)
return;
// 二次确认 => 请求api => 刷新表格
await useHandleData(monitorLIVEApi.delete, { ids }, msg);
@@ -417,7 +477,7 @@ function getvideo2() {
source: detailData.videoUrl + "&subaudio=no&jitterbuffer=6000",
// "rtsFallbackSource": "降级地址,如HLS",
width: "100%",
height: "600px",
height: "500px",
autoplay: true,
isLive: true,
playsinline: true,


+ 2
- 2
SafeCampus.WEB/src/views/sysconfig/ability/index.vue 查看文件

@@ -68,7 +68,7 @@
import { ref, watch, provide, onMounted, unref, computed, reactive } from "vue";
import TreeFilter from "@/components/TreeFilter/index.vue";
import { ElMessage } from "element-plus";
import { abilityApi, userManageClassManageApi, monitorLIVEApi } from "@/api";
import { abilityApi, userManageClassManageApi, monitorLIVEApi,SysOrg } from "@/api";
// import { FormOptEnum, SysDictEnum, MenuTypeDictEnum } from "@/enums";
import userForm from "./components/userForm.vue";

@@ -132,7 +132,7 @@ function getwarnGroup() {
});
});
}
const userFormRef = ref<InstanceType<typeof Form> | null>(null);
const userFormRef = ref<any>(null);
function pushPerson(opt: FormOptEnum, record: {} | SysOrg.SysOrgInfo = {}) {
userFormRef.value?.onOpen({ opt: opt, record: record, successful: getwarnGroup });
}


正在加载...
取消
保存