diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/status/alarm.js b/code/VideoAccess-VCMP/api/app/lib/controllers/status/alarm.js
new file mode 100644
index 0000000..5b22be6
--- /dev/null
+++ b/code/VideoAccess-VCMP/api/app/lib/controllers/status/alarm.js
@@ -0,0 +1,57 @@
+'use strict';
+const moment = require('moment');
+
+async function record (ctx) {
+ try {
+ const { models } = ctx.fs.dc;
+ const { statusCode, description = '', cameraId, platform = 'yingshi' } = ctx.request.body;
+
+ let statusRes = await models.CameraStatus.findOne({
+ where: {
+ status: statusCode
+ }
+ })
+ let alarmRes = null;
+ if (!statusRes) {
+ statusRes = await models.CameraStatus.create({
+ platform: platform,
+ status: statusCode,
+ describe: description,
+ forbidden: false,
+ })
+ } else {
+ alarmRes = await models.CameraStatusAlarm.findOne({
+ where: {
+ statusId: statusRes.id,
+ description,
+ cameraId,
+ confirm: null
+ }
+ })
+ }
+ if (alarmRes) {
+ await models.CameraStatusAlarm.update({
+ updateTime: moment().format()
+ })
+ } else {
+ await models.CameraStatusAlarm.create({
+ statusId: statusRes.id,
+ description,
+ createTime: moment().format(),
+ cameraId,
+ })
+ }
+
+ ctx.status = 204;
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
+ ctx.status = 400;
+ ctx.body = {
+ message: typeof error == 'string' ? error : undefined
+ }
+ }
+}
+
+module.exports = {
+ record,
+};
\ No newline at end of file
diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/status/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/status/index.js
index 2df763e..1516892 100644
--- a/code/VideoAccess-VCMP/api/app/lib/controllers/status/index.js
+++ b/code/VideoAccess-VCMP/api/app/lib/controllers/status/index.js
@@ -264,6 +264,20 @@ async function statusCheck (ctx) {
}
}
+async function statusRecord (ctx) {
+ try {
+ const models = ctx.fs.dc.models;
+
+ ctx.status = 20;
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
+ ctx.status = 400;
+ ctx.body = {
+ message: typeof error == 'string' ? error : undefined
+ }
+ }
+}
+
module.exports = {
get,
getSimpleAll,
@@ -271,4 +285,5 @@ module.exports = {
paraphraseCustom,
resolveEdit,
statusCheck,
+ statusRecord,
};
\ No newline at end of file
diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/status/push.js b/code/VideoAccess-VCMP/api/app/lib/controllers/status/push.js
index c3625b2..92ef8d1 100644
--- a/code/VideoAccess-VCMP/api/app/lib/controllers/status/push.js
+++ b/code/VideoAccess-VCMP/api/app/lib/controllers/status/push.js
@@ -119,7 +119,7 @@ async function edit (ctx) {
}
}
-async function get (ctx) {
+async function getStatusPushList (ctx) {
try {
const models = ctx.fs.dc.models;
const { userId, token } = ctx.fs.api
@@ -397,5 +397,5 @@ async function pushLog (ctx) {
module.exports = {
- edit, get, banned, del, copy, pushLog
+ edit, getStatusPushList, banned, del, copy, pushLog
};
\ No newline at end of file
diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/vender/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/vender/index.js
index d77d4f5..2060f4f 100644
--- a/code/VideoAccess-VCMP/api/app/lib/controllers/vender/index.js
+++ b/code/VideoAccess-VCMP/api/app/lib/controllers/vender/index.js
@@ -1,23 +1,23 @@
'use strict';
-async function get (ctx) {
- const models = ctx.fs.dc.models;
- try {
- const res = await models.Vender.findAll({
- order: [
- ['id', 'ASC']
- ]
- })
+async function getVenderList (ctx) {
+ const models = ctx.fs.dc.models;
+ try {
+ const res = await models.Vender.findAll({
+ order: [
+ ['id', 'ASC']
+ ]
+ })
- ctx.status = 200;
- ctx.body = res
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {}
- }
+ ctx.status = 200;
+ ctx.body = res
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
+ ctx.status = 400;
+ ctx.body = {}
+ }
}
module.exports = {
- get,
+ getVenderList,
};
\ No newline at end of file
diff --git a/code/VideoAccess-VCMP/api/app/lib/models/camera_status_alarm.js b/code/VideoAccess-VCMP/api/app/lib/models/camera_status_alarm.js
new file mode 100644
index 0000000..32e7aa3
--- /dev/null
+++ b/code/VideoAccess-VCMP/api/app/lib/models/camera_status_alarm.js
@@ -0,0 +1,96 @@
+/* eslint-disable*/
+'use strict';
+
+module.exports = dc => {
+ const DataTypes = dc.ORM;
+ const sequelize = dc.orm;
+ const CameraStatusAlarm = sequelize.define("cameraStatusAlarm", {
+ id: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: true,
+ field: "id",
+ autoIncrement: true,
+ unique: "camera_status_alarm_id_uindex"
+ },
+ statusId: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "status_id",
+ autoIncrement: false,
+ references: {
+ key: "id",
+ model: "cameraStatus"
+ }
+ },
+ description: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: "描述",
+ primaryKey: false,
+ field: "description",
+ autoIncrement: false
+ },
+ confirm: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: "确认信息",
+ primaryKey: false,
+ field: "confirm",
+ autoIncrement: false
+ },
+ confirmTime: {
+ type: DataTypes.DATE,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "confirm_time",
+ autoIncrement: false
+ },
+ createTime: {
+ type: DataTypes.DATE,
+ allowNull: true,
+ defaultValue: null,
+ comment: "生成时间",
+ primaryKey: false,
+ field: "create_time",
+ autoIncrement: false
+ },
+ updateTime: {
+ type: DataTypes.DATE,
+ allowNull: true,
+ defaultValue: null,
+ comment: "更新时间",
+ primaryKey: false,
+ field: "update_time",
+ autoIncrement: false
+ },
+ cameraId: {
+ type: DataTypes.INTEGER,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "camera_id",
+ autoIncrement: false,
+ references: {
+ key: "id",
+ model: "camera"
+ }
+ }
+ }, {
+ tableName: "camera_status_alarm",
+ comment: "",
+ indexes: []
+ });
+ dc.models.CameraStatusAlarm = CameraStatusAlarm;
+ return CameraStatusAlarm;
+};
\ No newline at end of file
diff --git a/code/VideoAccess-VCMP/api/app/lib/routes/index.js b/code/VideoAccess-VCMP/api/app/lib/routes/index.js
index 39cbc75..e94f334 100644
--- a/code/VideoAccess-VCMP/api/app/lib/routes/index.js
+++ b/code/VideoAccess-VCMP/api/app/lib/routes/index.js
@@ -7,8 +7,13 @@ module.exports = function (app, router, opts) {
fs.readdirSync(__dirname).forEach((filename) => {
if (filename.indexOf('.') !== 0 && fs.lstatSync(path.join(__dirname, filename)).isDirectory()) {
fs.readdirSync(path.join(__dirname, filename)).forEach((api) => {
+ console.log('加载路由文件:' + filename + '/' + api);
if (api.indexOf('.') == 0 || api.indexOf('.js') == -1) return;
- require(`./${filename}/${api}`)(app, router, opts);
+ try {
+ require(`./${filename}/${api}`)(app, router, opts);
+ } catch (e) {
+ console.error(e);
+ }
});
}
});
diff --git a/code/VideoAccess-VCMP/api/app/lib/routes/status/index.js b/code/VideoAccess-VCMP/api/app/lib/routes/status/index.js
index dc1c7c7..07911a9 100644
--- a/code/VideoAccess-VCMP/api/app/lib/routes/status/index.js
+++ b/code/VideoAccess-VCMP/api/app/lib/routes/status/index.js
@@ -2,6 +2,7 @@
const status = require('../../controllers/status');
const push = require('../../controllers/status/push');
+const alarm = require('../../controllers/status/alarm');
module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/status'] = { content: '获取状态码', visible: false };
@@ -26,8 +27,8 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['PUT/status/push'] = { content: '编辑推送配置', visible: false };
router.put('/status/push', push.edit);
- app.fs.api.logAttr['GET/status/push'] = { content: '获取推送配置', visible: false };
- router.get('/status/push', push.get);
+ app.fs.api.logAttr['GET/status/push_list'] = { content: '获取推送配置', visible: false };
+ router.get('/status/push_list', push.getStatusPushList);
app.fs.api.logAttr['PUT/status/push/banned'] = { content: '禁用推送配置', visible: false };
router.put('/status/push/banned', push.banned);
@@ -41,4 +42,8 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/status/push/:configId/detail'] = { content: '获取推送记录', visible: false };
router.get('/status/push/:configId/log', push.pushLog);
// 信鸽推送 END
+
+ // 状态告警
+ app.fs.api.logAttr['POST/status/alarm'] = { content: '保存或更新告警信息', visible: false };
+ router.post('/status/alarm', alarm.record);
};
diff --git a/code/VideoAccess-VCMP/api/app/lib/routes/vender/index.js b/code/VideoAccess-VCMP/api/app/lib/routes/vender/index.js
index 3eda838..007b8dc 100644
--- a/code/VideoAccess-VCMP/api/app/lib/routes/vender/index.js
+++ b/code/VideoAccess-VCMP/api/app/lib/routes/vender/index.js
@@ -4,5 +4,5 @@ const vender = require('../../controllers/vender');
module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/vender'] = { content: '获取设备厂商', visible: false };
- router.get('/vender', vender.get);
+ router.get('/vender', vender.getVenderList);
};
diff --git a/code/VideoAccess-VCMP/api/config.js b/code/VideoAccess-VCMP/api/config.js
index 1106420..68bf66a 100644
--- a/code/VideoAccess-VCMP/api/config.js
+++ b/code/VideoAccess-VCMP/api/config.js
@@ -94,6 +94,7 @@ const product = {
exclude: [
{ p: '/camera', o: 'GET' }, // 暂时滴
{ p: '/application/check', o: 'GET' }, // 暂时滴
+ { p: '/status/alarm', o: 'POST' },
], // 不做认证的路由,也可以使用 exclude: ["*"] 跳过所有路由
redis: {
host: IOTA_REDIS_SERVER_HOST,
diff --git a/code/VideoAccess-VCMP/api/sequelize-automate.config.js b/code/VideoAccess-VCMP/api/sequelize-automate.config.js
index 5ebd0fc..9a97578 100644
--- a/code/VideoAccess-VCMP/api/sequelize-automate.config.js
+++ b/code/VideoAccess-VCMP/api/sequelize-automate.config.js
@@ -26,7 +26,7 @@ module.exports = {
dir: './app/lib/models', // 指定输出 models 文件的目录
typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义
emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
- tables: ['mirror',], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
+ tables: ['camera_status_alarm',], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性
tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中
ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面
diff --git a/code/VideoAccess-VCMP/script/1.3.3/schema/1.create_camera_status_alarm.sql b/code/VideoAccess-VCMP/script/1.3.3/schema/1.create_camera_status_alarm.sql
new file mode 100644
index 0000000..f7bc4ae
--- /dev/null
+++ b/code/VideoAccess-VCMP/script/1.3.3/schema/1.create_camera_status_alarm.sql
@@ -0,0 +1,29 @@
+create table if not exists camera_status_alarm
+(
+ id serial not null,
+ status_id integer not null,
+ description varchar(1024),
+ confirm varchar(1024),
+ confirm_time timestamp with time zone,
+ create_time timestamp with time zone,
+ update_time timestamp with time zone,
+ camera_id integer,
+ constraint camera_status_alarm_pk
+ primary key (id),
+ constraint camera_status_alarm_camera_status_id_fk
+ foreign key (status_id) references camera_status,
+ constraint camera_status_alarm_camera_id_fk
+ foreign key (camera_id) references camera
+);
+
+comment on column camera_status_alarm.description is '描述';
+
+comment on column camera_status_alarm.confirm is '确认信息';
+
+comment on column camera_status_alarm.create_time is '生成时间';
+
+comment on column camera_status_alarm.update_time is '更新时间';
+
+create unique index if not exists camera_status_alarm_id_uindex
+ on camera_status_alarm (id);
+
diff --git a/code/VideoAccess-VCMP/web/client/src/layout/index.jsx b/code/VideoAccess-VCMP/web/client/src/layout/index.jsx
index dfddebf..4f52436 100644
--- a/code/VideoAccess-VCMP/web/client/src/layout/index.jsx
+++ b/code/VideoAccess-VCMP/web/client/src/layout/index.jsx
@@ -202,7 +202,7 @@ const Root = props => {
}
// setMicroAppWaiting(false)
- if (props.location.pathname == '/video_play_status') {
+ if (props.location && props.location.pathname == '/video_play_status') {
setAuthCrossLoading(false)
setMicroAppWaiting(false)
}
diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
index d671b79..8e8806d 100644
--- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
+++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
@@ -3,15 +3,15 @@ import { connect } from "react-redux";
import moment from "moment";
import qs from "qs";
import {
- Button,
- Form,
- Table,
- Pagination,
- Popover,
- Tag,
- Skeleton,
- Popconfirm,
- Row,
+ Button,
+ Form,
+ Table,
+ Pagination,
+ Popover,
+ Tag,
+ Skeleton,
+ Popconfirm,
+ Row,
} from "@douyinfe/semi-ui";
import { SimpleFileDownButton, VideoPlayModal, SkeletonScreen } from "$components";
import "../style.less";
@@ -22,632 +22,632 @@ import SideSheets from "../components/sideSheet";
import { accessType } from "./nvr";
const CameraHeader = (props) => {
- const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props;
- const [cameraModal, setCameraModal] = useState(false);
- const [remarksModal, setRemarksModal] = useState(false);
- const [videoPlay, setVideoPlay] = useState(false);
- const [modalName, setModalName] = useState("");
- const [setup, setSetup] = useState(false);
- const [sideSheet, setSideSheet] = useState(false);
- const [cameraSetup, setcameraSetup] = useState(false);
- const [setupp, setSetupp] = useState([]);
- const [venderList, setvenderList] = useState([]); //厂商信息
- const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [search, setSearch] = useState({}); //搜索条件
- const [rowId, setRowId] = useState(); //表格数据id
- const [cameraData, setCameraData] = useState({}); //表格传递数据
- const [modify, setModify] = useState(false); //修改
- const [parentCamera, setParentCamera] = useState(""); //级联摄像头父级设备
- const [addNvr, setAddNvr] = useState(false); //nvr页面传递参数打开NVR摄像头添加弹框
- const [nvrNumber, setNvrNumber] = useState();
- const [videoObj, setVideoObj] = useState(); //播放条件
- const [axyData, setAxyData] = useState();
- const [cameraRemarks, setCameraRemarks] = useState([]);//备注
- const { equipmentWarehouse } = actions;
- const api = useRef();
- const searchData = useRef({})
- const limits = useRef(); //每页实际条数
- const page = useRef(query.page);
- const deviceClickb = useRef(true)
- const CAMERAS = "cameras";
- const tableList = [//表格属性
- {
- title: '设备信息',
- list: [
- { name: "设备厂家", value: "manufactor" },
- { name: "接入类型", value: "type" },
- { name: "设备状态", value: "state" },
- { name: "云台支持", value: "support" },
- { name: "内存卡信息", value: "memoryCard" },
- { name: "设备创建时间", value: "time" },
- { name: "设备添加账号", value: "account" },
- ]
- },
- {
- title: '项目信息',
- list: [
- { name: "项目名称", value: "name" },
- { name: "pcode", value: "pcode" },
- { name: "结构物", value: "structure" },
- { name: "测点", value: "measuringPoint" },
- { name: "监测因素", value: "factor" },
- ]
- },
- ];
- useEffect(() => {
- //安心云传参
- let isAxyData = props.location.search
- if (isAxyData) {
- setAxyData(qs.parse(isAxyData.slice(1)))
- setCameraModal(true)
- }
- //NVR传来的参数
- if (props.location.query) {
- setAddNvr(props.location.query.addNvr)
- setNvrNumber(props.location.query.serialNo)
- setCameraModal(true);
- }
- dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
- setvenderList(res.payload.data);
- attribute(res.payload.data);
- });
- //初始化表格显示设置
- localStorage.getItem(CAMERAS) == null
- ? localStorage.setItem(
- CAMERAS,
- JSON.stringify(["state", "type", "manufactor"])
- )
- : "";
- }, []);
+ const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props;
+ const [cameraModal, setCameraModal] = useState(false);
+ const [remarksModal, setRemarksModal] = useState(false);
+ const [videoPlay, setVideoPlay] = useState(false);
+ const [modalName, setModalName] = useState("");
+ const [setup, setSetup] = useState(false);
+ const [sideSheet, setSideSheet] = useState(false);
+ const [cameraSetup, setcameraSetup] = useState(false);
+ const [setupp, setSetupp] = useState([]);
+ const [venderList, setvenderList] = useState([]); //厂商信息
+ const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
+ const [search, setSearch] = useState({}); //搜索条件
+ const [rowId, setRowId] = useState(); //表格数据id
+ const [cameraData, setCameraData] = useState({}); //表格传递数据
+ const [modify, setModify] = useState(false); //修改
+ const [parentCamera, setParentCamera] = useState(""); //级联摄像头父级设备
+ const [addNvr, setAddNvr] = useState(false); //nvr页面传递参数打开NVR摄像头添加弹框
+ const [nvrNumber, setNvrNumber] = useState();
+ const [videoObj, setVideoObj] = useState(); //播放条件
+ const [axyData, setAxyData] = useState();
+ const [cameraRemarks, setCameraRemarks] = useState([]);//备注
+ const { equipmentWarehouse } = actions;
+ const api = useRef();
+ const searchData = useRef({})
+ const limits = useRef(); //每页实际条数
+ const page = useRef(query.page);
+ const deviceClickb = useRef(true)
+ const CAMERAS = "cameras";
+ const tableList = [//表格属性
+ {
+ title: '设备信息',
+ list: [
+ { name: "设备厂家", value: "manufactor" },
+ { name: "接入类型", value: "type" },
+ { name: "设备状态", value: "state" },
+ { name: "云台支持", value: "support" },
+ { name: "内存卡信息", value: "memoryCard" },
+ { name: "设备创建时间", value: "time" },
+ { name: "设备添加账号", value: "account" },
+ ]
+ },
+ {
+ title: '项目信息',
+ list: [
+ { name: "项目名称", value: "name" },
+ { name: "pcode", value: "pcode" },
+ { name: "结构物", value: "structure" },
+ { name: "测点", value: "measuringPoint" },
+ { name: "监测因素", value: "factor" },
+ ]
+ },
+ ];
+ useEffect(() => {
+ //安心云传参
+ let isAxyData = props.location.search
+ if (isAxyData) {
+ setAxyData(qs.parse(isAxyData.slice(1)))
+ setCameraModal(true)
+ }
+ //NVR传来的参数
+ if (props.location.query) {
+ setAddNvr(props.location.query.addNvr)
+ setNvrNumber(props.location.query.serialNo)
+ setCameraModal(true);
+ }
+ dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
+ setvenderList(res.payload.data);
+ attribute(res.payload.data);
+ });
+ //初始化表格显示设置
+ localStorage.getItem(CAMERAS) == null
+ ? localStorage.setItem(
+ CAMERAS,
+ JSON.stringify(["state", "type", "manufactor"])
+ )
+ : "";
+ }, []);
- useEffect(() => {
- equipmentGetCamera();
- }, [query, search]);
+ useEffect(() => {
+ equipmentGetCamera();
+ }, [query, search]);
- const equipmentGetCamera = () => {
- searchData.current = { ...query, ...search }
- dispatch(equipmentWarehouse.getCamera(searchData.current)).then((res) => {
- limits.current = res.payload.data.data.length
- });
- }
- function equipmentStatus (data) {
- switch (data) {
- case "ON":
- return "在线"
- case "ONLINE":
- return "在线"
- case "OFF":
- return "离线"
- default:
- return "未知"
- }
- }
+ const equipmentGetCamera = () => {
+ searchData.current = { ...query, ...search }
+ dispatch(equipmentWarehouse.getCamera(searchData.current)).then((res) => {
+ limits.current = res.payload.data.data.length
+ });
+ }
+ function equipmentStatus (data) {
+ switch (data) {
+ case "ON":
+ return "在线"
+ case "ONLINE":
+ return "在线"
+ case "OFF":
+ return "离线"
+ default:
+ return "未知"
+ }
+ }
- function colorStatus (data) {
- switch (data) {
- case "ON":
- return "#04B234"
- case "ONLINE":
- return "#04B234"
- case "OFF":
- return "rgba(0, 0, 0, 0.45)"
- default:
- return "#1859C1"
- }
- }
- const columns = [
- {
- title: "序号",
- dataIndex: "",
- render: (text, r, index) => {
- return index + 1;
- },
- },
- {
- title: "设备名称",
- dataIndex: "name",
- render: (_, row) => {
- return (
-
- {row.name}
- {
- if (deviceClickb.current) {
- if (row.type == "nvr") {
- setSearch({ ...search, nvrId: row.nvr.id })
- } else {
- setSearch({ ...search, externalDomain: row.externalDomain })
- }
- deviceClickb.current = false
- } else {
- if (row.type == "nvr") {
- setSearch({ ...search, nvrId: null })
- } else {
- setSearch({ ...search, externalDomain: null })
- }
- deviceClickb.current = true
- }
- }}
- >
- {row.type == "nvr" ? `@${row.nvr.name}` : row.type == "cascade" ? `@${row.externalDomain}` : ""}
-
-
- );
- },
- },
- {
- title: "操作",
- width: "20%",
- dataIndex: "",
- render: (_, row) => {
- return (
-
-
+ );
+ },
+ },
+ ];
- //获取表格属性设置
- function attribute (data) {
- const arr = localStorage.getItem(CAMERAS)
- ? JSON.parse(localStorage.getItem(CAMERAS))
- : [];
+ //获取表格属性设置
+ function attribute (data) {
+ const arr = localStorage.getItem(CAMERAS)
+ ? JSON.parse(localStorage.getItem(CAMERAS))
+ : [];
- const column = [
- {
- title: "设备厂家",
- dataIndex: "venderId",
- key: "manufactor",
- render: (_, r, index) => {
- let manufactorName = data.find((item) => item.id == r.venderId);
- return manufactorName ? manufactorName.name : "未知";
- },
- },
- {
- title: "接入类型",
- dataIndex: "cameraAbility.type",
- key: "type",
- render: (_, r, index) => {
- let access = accessType.find((item) => item.key == r.type);
- return access ? access.name : "";
- },
+ const column = [
+ {
+ title: "设备厂家",
+ dataIndex: "venderId",
+ key: "manufactor",
+ render: (_, r, index) => {
+ let manufactorName = (data || []).find((item) => item.id == r.venderId);
+ return manufactorName ? manufactorName.name : "未知";
},
- {
- title: "设备状态",
- dataIndex: "channelCount",
- key: "state",
- render: (_, r, index) => {
- let status = r.gbCamera;
- return (
-
-
- {r.forbidden ? "禁用" : status ? equipmentStatus(status.online) : ""}
-
- );
- },
+ },
+ {
+ title: "接入类型",
+ dataIndex: "cameraAbility.type",
+ key: "type",
+ render: (_, r, index) => {
+ let access = accessType.find((item) => item.key == r.type);
+ return access ? access.name : "";
},
- {
- title: "云台支持",
- dataIndex: "cloudControl",
- key: "support",
- render: (text, r, index) => {
- return r.cloudControl ? "支持" : "不支持";
- },
-
+ },
+ {
+ title: "设备状态",
+ dataIndex: "channelCount",
+ key: "state",
+ render: (_, r, index) => {
+ let status = r.gbCamera;
+ return (
+
+
+ {r.forbidden ? "禁用" : status ? equipmentStatus(status.online) : ""}
+
+ );
},
- {
- title: "内存卡信息",
- dataIndex: "memoryCard",
- key: "memoryCard",
+ },
+ {
+ title: "云台支持",
+ dataIndex: "cloudControl",
+ key: "support",
+ render: (text, r, index) => {
+ return r.cloudControl ? "支持" : "不支持";
},
- {
- title: "设备创建时间",
- dataIndex: "createTime",
- key: "time",
- render: (_, r, index) => {
- return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS");
- },
+
+ },
+ {
+ title: "内存卡信息",
+ dataIndex: "memoryCard",
+ key: "memoryCard",
+ },
+ {
+ title: "设备创建时间",
+ dataIndex: "createTime",
+ key: "time",
+ render: (_, r, index) => {
+ return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS");
},
- {
- title: "设备添加账号",
- dataIndex: "size",
- key: "account",
- render: (text, r, index) => {
- return r.createUser?.namePresent
- },
+ },
+ {
+ title: "设备添加账号",
+ dataIndex: "size",
+ key: "account",
+ render: (text, r, index) => {
+ return r.createUser?.namePresent
},
- {
- title: "项目名称",
- dataIndex: "updateTime",
- key: "name",
- render: (_, r, index) => {
- return r.station.length == 0
- ? ""
- : station(r, "name", _, "projects")
- },
+ },
+ {
+ title: "项目名称",
+ dataIndex: "updateTime",
+ key: "name",
+ render: (_, r, index) => {
+ return r.station.length == 0
+ ? ""
+ : station(r, "name", _, "projects")
},
- {
- title: "pcode",
- dataIndex: "updateTime",
- key: "pcode",
- render: (_, r, index) => {
- return r.station.length == 0
- ? ""
- : station(r, "url", _, "projects")
- },
+ },
+ {
+ title: "pcode",
+ dataIndex: "updateTime",
+ key: "pcode",
+ render: (_, r, index) => {
+ return r.station.length == 0
+ ? ""
+ : station(r, "url", _, "projects")
},
- {
- title: "结构物",
- dataIndex: "",
- key: "structure",
- render: (_, r, index) => {
- return r.station.length == 0
- ? ""
- : station(r, "name", r.station[0].structure.name, _, "structure")
- },
+ },
+ {
+ title: "结构物",
+ dataIndex: "",
+ key: "structure",
+ render: (_, r, index) => {
+ return r.station.length == 0
+ ? ""
+ : station(r, "name", r.station[0].structure.name, _, "structure")
},
- {
- title: "测点",
- dataIndex: "updateTime",
- key: "measuringPoint",
- render: (_, r, index) => {
- return r.station.length == 0
- ? ""
- : station(r, "name", r.station[0].name, _, "point")
- },
+ },
+ {
+ title: "测点",
+ dataIndex: "updateTime",
+ key: "measuringPoint",
+ render: (_, r, index) => {
+ return r.station.length == 0
+ ? ""
+ : station(r, "name", r.station[0].name, _, "point")
},
- {
- title: "监测因素",
- dataIndex: "updateTime",
- key: "factor",
- render: (_, r, index) => {
- return r.station.length == 0
- ? ""
- : station(r, "name", r.station[0].factor.name)
- },
+ },
+ {
+ title: "监测因素",
+ dataIndex: "updateTime",
+ key: "factor",
+ render: (_, r, index) => {
+ return r.station.length == 0
+ ? ""
+ : station(r, "name", r.station[0].factor.name)
},
- ];
- for (let i = 0; i < arr.length; i++) {
- let colum = column.filter((item) => {
- return item.key === arr[i];
- });
- columns.splice(i + 2, 0, colum[0]);
- }
- setSetupp(columns);
- }
+ },
+ ];
+ for (let i = 0; i < arr.length; i++) {
+ let colum = column.filter((item) => {
+ return item.key === arr[i];
+ });
+ columns.splice(i + 2, 0, colum[0]);
+ }
+ setSetupp(columns);
+ }
- //表格请求数据中station属性数据的展示
- function station (r, name, data, projects, exhibition) {
- let datas = []
- if (projects == "projects") {
- r.station.map((v) => {
- if (v.structure.projects.length > 0) {
- v.structure.projects.map((item) => datas.push(item[name]))
- }
- })
- } else {
- r.station.map((v) => {
- if (exhibition == "structure") {
- datas.push(v.structure.name)
- } else {
- if (exhibition == "point") {
- datas.push(v.name)
- } else {
- datas.push(v.factor.name)
- }
- }
- })
- }
- let dataSet = [...(new Set(datas))]
- return dataSet.length > 0 ? 1 ?
-
- {dataSet.map((v, index) => {v}
)}
-
- : ""
+ //表格请求数据中station属性数据的展示
+ function station (r, name, data, projects, exhibition) {
+ let datas = []
+ if (projects == "projects") {
+ r.station.map((v) => {
+ if (v.structure.projects.length > 0) {
+ v.structure.projects.map((item) => datas.push(item[name]))
+ }
+ })
+ } else {
+ r.station.map((v) => {
+ if (exhibition == "structure") {
+ datas.push(v.structure.name)
+ } else {
+ if (exhibition == "point") {
+ datas.push(v.name)
+ } else {
+ datas.push(v.factor.name)
+ }
}
- >
- {dataSet.length > 1 ? `${dataSet[0]}...` : dataSet.length > 0 ? dataSet[0] : ""}
- : ""
+ })
+ }
+ let dataSet = [...(new Set(datas))]
+ return dataSet.length > 0 ? 1 ?
+
+ {dataSet.map((v, index) => {v}
)}
+
+ : ""
+ }
+ >
+ {dataSet.length > 1 ? `${dataSet[0]}...` : dataSet.length > 0 ? dataSet[0] : ""}
+ : ""
- }
- //条件赛选样式
- const screen = {
- width: 193,
- marginRight: 20,
- marginBottom: 16,
- color: "rgba(0, 0, 0, 0.65)",
- };
+ }
+ //条件赛选样式
+ const screen = {
+ width: 193,
+ marginRight: 20,
+ marginBottom: 16,
+ color: "rgba(0, 0, 0, 0.65)",
+ };
- return (
- <>
-
-
-
-
- 摄像头管理
-
-
- 对监控摄像设备设备添加、修改、删除的硬件管理页面。
-
-
{
- setModalName("add");
- setCameraModal(true);
- }}
- >
- 添加摄像头
-
-
+ return (
+ <>
+
+
+
+
+ 摄像头管理
+
+
+ 对监控摄像设备设备添加、修改、删除的硬件管理页面。
+
+
{
+ setModalName("add");
+ setCameraModal(true);
+ }}
+ >
+ 添加摄像头
+
+
+
-
- 筛选条件
-
-
-
-
- {accessType.map((item) => {
- return (
-
- {item.name}
-
- );
- })}
-
-
- {venderList.map((item) => {
- return (
-
- {item.name}
-
- );
- })}
-
-
- 在线
- 离线
- 未知
- 禁用
-
- {/*
+
+
+
+ {accessType.map((item) => {
+ return (
+
+ {item.name}
+
+ );
+ })}
+
+
+ {venderList && venderList.map((item) => {
+ return (
+
+ {item.name}
+
+ );
+ })}
+
+
+ 在线
+ 离线
+ 未知
+ 禁用
+
+ {/*
{
飞尚科技2
*/}
-
-
- {
- api.current.validate().then((v) => {
- setSearch(v);
- setQuery({ limit: 10, page: 0 })
- });
- }}
- >
- 搜索
-
- {
- api.current.reset();
- setSearch({});
- setQuery({ limit: 10, page: 0 })
- }}
- >
- 重置
-
-
-
+
+
+ {
+ api.current.validate().then((v) => {
+ setSearch(v);
+ setQuery({ limit: 10, page: 0 })
+ });
+ }}
+ >
+ 搜索
+
+ {
+ api.current.reset();
+ setSearch({});
+ setQuery({ limit: 10, page: 0 })
+ }}
+ >
+ 重置
+
+
-
-
-
- 设备列表
-
-
-
{
- setSetup(true);
- setcameraSetup(true);
- }}
- >
-
-
-
-
-
-
- s)}
- dataSource={equipmentWarehouseCamera.data}
- bordered={false}
- empty="暂无数据"
- style={{
- padding: "0px 20px",
- }}
- pagination={false}
- />
-
-
-
- 共{equipmentWarehouseCamera.total}个设备
-
-
{
- setQuery({ limit: pageSize, page: currentPage - 1 });
- page.current = currentPage - 1
- }}
- />
-
-
- {setup ? (
- {
- setSetup(false);
- attribute(venderList);
- setcameraSetup(false);
- }}
- />
- ) : (
- ""
- )}
-
- {sideSheet ? (
- {
- setSideSheet(false);
- setcameraSetup(false);
- }}
- />
- ) : (
- []
- )}
+
+
+
+
+ 设备列表
+
+
+
{
+ setSetup(true);
+ setcameraSetup(true);
+ }}
+ >
+
+
+
+
+
+
+ s)}
+ dataSource={equipmentWarehouseCamera.data}
+ bordered={false}
+ empty="暂无数据"
+ style={{
+ padding: "0px 20px",
+ }}
+ pagination={false}
+ />
+
+
+
+ 共{equipmentWarehouseCamera.total}个设备
+
+
{
+ setQuery({ limit: pageSize, page: currentPage - 1 });
+ page.current = currentPage - 1
+ }}
+ />
- {cameraModal ? (
- {
- setCameraModal(false);
- setCameraData({});
- setModify(false)
- setParentCamera("")
- setAddNvr(false)
- setNvrNumber("")
- setAxyData("")
- equipmentGetCamera()
- }}
- modalName={modalName}
- />
+ {setup ? (
+ {
+ setSetup(false);
+ attribute(venderList);
+ setcameraSetup(false);
+ }}
+ />
) : (
- ""
+ ""
)}
- {videoPlay ?
- {
- setVideoPlay(false)
- }} />
- : ""
- }
- {
- remarksModal ?
- {
- setRemarksModal(false);
- setRowId();
- equipmentGetCamera();
- }} >
- : ''
- }
- >
- );
+
+ {sideSheet ? (
+ {
+ setSideSheet(false);
+ setcameraSetup(false);
+ }}
+ />
+ ) : (
+ []
+ )}
+
+
+ {cameraModal ? (
+ {
+ setCameraModal(false);
+ setCameraData({});
+ setModify(false)
+ setParentCamera("")
+ setAddNvr(false)
+ setNvrNumber("")
+ setAxyData("")
+ equipmentGetCamera()
+ }}
+ modalName={modalName}
+ />
+ ) : (
+ ""
+ )}
+ {videoPlay ?
+ {
+ setVideoPlay(false)
+ }} />
+ : ""
+ }
+ {
+ remarksModal ?
+ {
+ setRemarksModal(false);
+ setRowId();
+ equipmentGetCamera();
+ }} >
+ : ''
+ }
+ >
+ );
};
function mapStateToProps (state) {
- const { auth, global, members, equipmentWarehouseCamera } = state;
- return {
- loading:
- equipmentWarehouseCamera.isRequesting && !equipmentWarehouseCamera.data,
- user: auth.user,
- actions: global.actions,
- members: members.data,
- equipmentWarehouseCamera: equipmentWarehouseCamera.data || [],
- };
+ const { auth, global, members, equipmentWarehouseCamera } = state;
+ return {
+ loading:
+ equipmentWarehouseCamera.isRequesting && !equipmentWarehouseCamera.data,
+ user: auth.user,
+ actions: global.actions,
+ members: members.data,
+ equipmentWarehouseCamera: equipmentWarehouseCamera.data || [],
+ };
}
export default connect(mapStateToProps)(CameraHeader);
diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
index 6dc8212..ae0cb3c 100644
--- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
+++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
@@ -5,443 +5,443 @@ import { Button, Form, Table, Pagination, Skeleton, Popconfirm, Popover, Tag, }
import "../style.less";
import { ApiTable } from "$utils";
import NvrModal from "../components/nvrModal";
-import {Setup} from "$components";
+import { Setup } from "$components";
import SideSheets from "../components/sideSheet";
import { ReminderBox } from "../../../components/index";
-import { SimpleFileDownButton,SkeletonScreen } from "$components";
+import { SimpleFileDownButton, SkeletonScreen } from "$components";
export const accessType = [
- { name: "萤石云", key: "yingshi" },
- { name: "NVR", key: "nvr" },
- { name: "IPC", key: "ipc" },
- { name: "级联", key: "cascade" },
+ { name: "萤石云", key: "yingshi" },
+ { name: "NVR", key: "nvr" },
+ { name: "IPC", key: "ipc" },
+ { name: "级联", key: "cascade" },
];
const NvrHeader = (props) => {
- const { history, dispatch, actions, user, loading, equipmentWarehouseNvr } = props;
- const { equipmentWarehouse } = actions;
- const [setup, setSetup] = useState(false);
- const [sideSheet, setSideSheet] = useState(false);
- const [setupp, setSetupp] = useState([]);
- const [venderList, setvenderList] = useState([]); //厂商信息
- const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [search, setearch] = useState({}); //搜索条件
- const [rowId, setRowId] = useState(); //表格数据id
- const [reminder, setReminder] = useState(false); //提醒弹框
- const api = useRef();
- const searchData = useRef(search)
- const limits = useRef(); //每页实际条数
- const page = useRef(query.page);
- const SETUPS = "setups";
- const USER = "user" + props.user.id
- const nvrRef = useRef(); //获取子组件的设备编号
- const tableList = [//表格属性
- {
- title:'设备信息',
- list:[
- { name: "设备厂家", value: "manufactor" },
- { name: "添加账号", value: "accountNumber" },
- { name: "通道数", value: "passageway" },
- { name: "端口", value: "port" },
- { name: "设备状态", value: "state" },
- { name: "创建时间", value: "time" },
- ]
- },
- {
- title:'项目信息',
- list:[
- { name: "项目名称", value: "name" },
- { name: "pcode", value: "pcode" },
- { name: "结构物", value: "structure" },
- ]
- },
- ];
+ const { history, dispatch, actions, user, loading, equipmentWarehouseNvr } = props;
+ const { equipmentWarehouse } = actions;
+ const [setup, setSetup] = useState(false);
+ const [sideSheet, setSideSheet] = useState(false);
+ const [setupp, setSetupp] = useState([]);
+ const [venderList, setvenderList] = useState([]); //厂商信息
+ const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
+ const [search, setearch] = useState({}); //搜索条件
+ const [rowId, setRowId] = useState(); //表格数据id
+ const [reminder, setReminder] = useState(false); //提醒弹框
+ const api = useRef();
+ const searchData = useRef(search)
+ const limits = useRef(); //每页实际条数
+ const page = useRef(query.page);
+ const SETUPS = "setups";
+ const USER = "user" + props.user.id
+ const nvrRef = useRef(); //获取子组件的设备编号
+ const tableList = [//表格属性
+ {
+ title: '设备信息',
+ list: [
+ { name: "设备厂家", value: "manufactor" },
+ { name: "添加账号", value: "accountNumber" },
+ { name: "通道数", value: "passageway" },
+ { name: "端口", value: "port" },
+ { name: "设备状态", value: "state" },
+ { name: "创建时间", value: "time" },
+ ]
+ },
+ {
+ title: '项目信息',
+ list: [
+ { name: "项目名称", value: "name" },
+ { name: "pcode", value: "pcode" },
+ { name: "结构物", value: "structure" },
+ ]
+ },
+ ];
- useEffect(() => {
- dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
- setvenderList(res.payload.data);
- attribute(res.payload.data);
- });
- //初始化表格显示设置
- localStorage.getItem(SETUPS) == null
- ? localStorage.setItem(
- SETUPS,
- JSON.stringify(["manufactor", "passageway", "port", "state"])
- )
- : "";
- }, []);
+ useEffect(() => {
+ dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
+ setvenderList(res.payload.data);
+ attribute(res.payload.data);
+ });
+ //初始化表格显示设置
+ localStorage.getItem(SETUPS) == null
+ ? localStorage.setItem(
+ SETUPS,
+ JSON.stringify(["manufactor", "passageway", "port", "state"])
+ )
+ : "";
+ }, []);
- useEffect(() => {
- equipmentGetNvr();
- }, [query, search]);
+ useEffect(() => {
+ equipmentGetNvr();
+ }, [query, search]);
- const equipmentGetNvr = () => {
- searchData.current = { ...query, ...search }
- dispatch(equipmentWarehouse.getNvr(searchData.current)).then((res) => {
- limits.current = res.payload.data.data.length
- });
- }
+ const equipmentGetNvr = () => {
+ searchData.current = { ...query, ...search }
+ dispatch(equipmentWarehouse.getNvr(searchData.current)).then((res) => {
+ limits.current = res.payload.data.data.length
+ });
+ }
- function equipmentStatus (data) {
- switch (data) {
- case "ON":
- return "在线"
- case "ONLINE":
- return "在线"
- case "OFF":
- return "离线"
- default:
- return "未知"
- }
- }
+ function equipmentStatus (data) {
+ switch (data) {
+ case "ON":
+ return "在线"
+ case "ONLINE":
+ return "在线"
+ case "OFF":
+ return "离线"
+ default:
+ return "未知"
+ }
+ }
- function colorStatus (data) {
- switch (data) {
- case "ON":
- return "#04B234"
- case "ONLINE":
- return "#04B234"
- case "OFF":
- return "rgba(0, 0, 0, 0.45)"
- default:
- return "#1859C1"
- }
- }
- const columns = [
- {
- title: "序号",
- render: (_, record, index) => {
- return index + 1;
- },
- },
- {
- title: "设备名称",
- dataIndex: "name",
- render: (_, r, index) => {
- return r.name
- },
- },
- {
- title: "SIP地址",
- dataIndex: "owner",
- render: (_, r, index) => {
- return r?.gbNvr?.sipip
- },
- },
- {
- title: "操作",
- width: "20%",
- dataIndex: "",
- render: (_, row) => {
- return (
-
-
- {
- dispatch(equipmentWarehouse.getNvr(searchData.current));
- }}
- />
-
-
{
- setSideSheet(true);
- setRowId(row.id);
- }}
- >
- 查看
-
-
{
- dispatch(equipmentWarehouse.delNvr(row.id)).then(() => {
- if (page.current > 0 && limits.current < 2) {
- setQuery({ limit: 10, page: page.current - 1 })
- } else {
- setQuery({ limit: 10, page: page.current })
- }
- });
- }}
- >
- 删除
-
-
- );
- },
- },
- ];
+ function colorStatus (data) {
+ switch (data) {
+ case "ON":
+ return "#04B234"
+ case "ONLINE":
+ return "#04B234"
+ case "OFF":
+ return "rgba(0, 0, 0, 0.45)"
+ default:
+ return "#1859C1"
+ }
+ }
+ const columns = [
+ {
+ title: "序号",
+ render: (_, record, index) => {
+ return index + 1;
+ },
+ },
+ {
+ title: "设备名称",
+ dataIndex: "name",
+ render: (_, r, index) => {
+ return r.name
+ },
+ },
+ {
+ title: "SIP地址",
+ dataIndex: "owner",
+ render: (_, r, index) => {
+ return r?.gbNvr?.sipip
+ },
+ },
+ {
+ title: "操作",
+ width: "20%",
+ dataIndex: "",
+ render: (_, row) => {
+ return (
+
+
+ {
+ dispatch(equipmentWarehouse.getNvr(searchData.current));
+ }}
+ />
+
+
{
+ setSideSheet(true);
+ setRowId(row.id);
+ }}
+ >
+ 查看
+
+
{
+ dispatch(equipmentWarehouse.delNvr(row.id)).then(() => {
+ if (page.current > 0 && limits.current < 2) {
+ setQuery({ limit: 10, page: page.current - 1 })
+ } else {
+ setQuery({ limit: 10, page: page.current })
+ }
+ });
+ }}
+ >
+ 删除
+
+
+ );
+ },
+ },
+ ];
- //获取表格属性设置
- function attribute (data) {
- const arr = localStorage.getItem(SETUPS)
- ? JSON.parse(localStorage.getItem(SETUPS))
- : [];
+ //获取表格属性设置
+ function attribute (data) {
+ const arr = localStorage.getItem(SETUPS)
+ ? JSON.parse(localStorage.getItem(SETUPS))
+ : [];
- const column = [
- {
- title: "设备厂家",
- dataIndex: "venderId",
- key: "manufactor",
- render: (_, r, index) => {
- let manufactorName = data.find((item) => item.id == r.venderId);
- return manufactorName ? manufactorName.name : "";
- },
- },
- {
- title: "添加账号",
- dataIndex: "createUserId",
- key: "accountNumber",
- render: (_, r, index) => {
- return r?.createUser?.name
- },
- },
- {
- title: "通道数",
- dataIndex: "channelCount",
- key: "passageway",
+ const column = [
+ {
+ title: "设备厂家",
+ dataIndex: "venderId",
+ key: "manufactor",
+ render: (_, r, index) => {
+ let manufactorName = (data || []).find((item) => item.id == r.venderId);
+ return manufactorName ? manufactorName.name : "";
},
- {
- title: "端口",
- dataIndex: "port",
- key: "port",
+ },
+ {
+ title: "添加账号",
+ dataIndex: "createUserId",
+ key: "accountNumber",
+ render: (_, r, index) => {
+ return r?.createUser?.name
},
- {
- title: "设备状态",
- dataIndex: "size",
- key: "state",
- render: (_, r, index) => {
- let status = r.gbNvr;
- return (
-
-
- {status ? equipmentStatus(status.online) : ""}
-
- );
- },
+ },
+ {
+ title: "通道数",
+ dataIndex: "channelCount",
+ key: "passageway",
+ },
+ {
+ title: "端口",
+ dataIndex: "port",
+ key: "port",
+ },
+ {
+ title: "设备状态",
+ dataIndex: "size",
+ key: "state",
+ render: (_, r, index) => {
+ let status = r.gbNvr;
+ return (
+
+
+ {status ? equipmentStatus(status.online) : ""}
+
+ );
},
- {
- title: "创建时间",
- dataIndex: "createTime",
- key: "time",
- render: (_, r, index) => {
- return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS");
- },
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createTime",
+ key: "time",
+ render: (_, r, index) => {
+ return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS");
},
- {
- title: "项目名称",
- dataIndex: "",
- key: "name",
- render: (_, r, index) => {
- return r.station.length == 0
- ? ""
- : station(r, "name", "projects")
- },
+ },
+ {
+ title: "项目名称",
+ dataIndex: "",
+ key: "name",
+ render: (_, r, index) => {
+ return r.station.length == 0
+ ? ""
+ : station(r, "name", "projects")
},
- {
- title: "pcode",
- dataIndex: "",
- key: "pcode",
- render: (_, r, index) => {
- return r.station.length == 0
- ? ""
- : station(r, "url", "projects")
- },
+ },
+ {
+ title: "pcode",
+ dataIndex: "",
+ key: "pcode",
+ render: (_, r, index) => {
+ return r.station.length == 0
+ ? ""
+ : station(r, "url", "projects")
},
- {
- title: "结构物",
- dataIndex: "",
- key: "structure",
- render: (_, r, index) => {
- return r.station.length == 0
- ? ""
- : station(r, "name")
- },
+ },
+ {
+ title: "结构物",
+ dataIndex: "",
+ key: "structure",
+ render: (_, r, index) => {
+ return r.station.length == 0
+ ? ""
+ : station(r, "name")
},
- ];
- for (let i = 0; i < arr.length; i++) {
- let colum = column.filter((item) => {
- return item.key === arr[i];
- });
- columns.splice(i + 2, 0, colum[0]);
- }
- setSetupp(columns);
- }
+ },
+ ];
+ for (let i = 0; i < arr.length; i++) {
+ let colum = column.filter((item) => {
+ return item.key === arr[i];
+ });
+ columns.splice(i + 2, 0, colum[0]);
+ }
+ setSetupp(columns);
+ }
- //表格请求数据中station属性数据的展示
- function station (r, name, projects) {
- let data = []
- if (projects == "projects") {
- r.station.map((v) => {
- if (v.structure.projects.length > 0) {
- v.structure.projects.map((item) => data.push(item[name]))
- }
- })
- } else {
- r.station.map((v, index) => data.push(v.structure[name]))
- }
- let dataSet = [...(new Set(data))]
- return dataSet.length > 0 ? 1 ? {dataSet.map((v, index) => {v}
)} : ""
+ //表格请求数据中station属性数据的展示
+ function station (r, name, projects) {
+ let data = []
+ if (projects == "projects") {
+ r.station.map((v) => {
+ if (v.structure.projects.length > 0) {
+ v.structure.projects.map((item) => data.push(item[name]))
}
- >
- {dataSet.length > 1 ? `${dataSet[0]}...` : dataSet.length > 0 ? dataSet[0] : ""}
- : ""
+ })
+ } else {
+ r.station.map((v, index) => data.push(v.structure[name]))
+ }
+ let dataSet = [...(new Set(data))]
+ return dataSet.length > 0 ? 1 ? {dataSet.map((v, index) => {v}
)} : ""
+ }
+ >
+ {dataSet.length > 1 ? `${dataSet[0]}...` : dataSet.length > 0 ? dataSet[0] : ""}
+ : ""
- }
+ }
- //条件赛选样式
- const screen = {
- width: 193,
- marginRight: 20,
- marginBottom: 16,
- color: "rgba(0, 0, 0, 0.65)",
- };
+ //条件赛选样式
+ const screen = {
+ width: 193,
+ marginRight: 20,
+ marginBottom: 16,
+ color: "rgba(0, 0, 0, 0.65)",
+ };
- return (
- <>
-
-
-
-
- NVR管理
-
-
- 对NVR(网络硬盘录像机)设备节点的管理
-
-
- {
- const remind = localStorage.getItem(USER);
- if (!remind) {
- setReminder(true)
- }
- equipmentGetNvr();
- }}
- />
-
-
+ return (
+ <>
+
+
+
+
+ NVR管理
+
+
+ 对NVR(网络硬盘录像机)设备节点的管理
+
+
+ {
+ const remind = localStorage.getItem(USER);
+ if (!remind) {
+ setReminder(true)
+ }
+ equipmentGetNvr();
+ }}
+ />
+
+
+
-
- 筛选条件
-
-
-
-
- {venderList.map((item) => {
- return (
-
- {item.name}
-
- );
- })}
-
-
- 在线
- 离线
- 未知
-
- {/*
+
+
+
+ {venderList && venderList.map((item) => {
+ return (
+
+ {item.name}
+
+ );
+ })}
+
+
+ 在线
+ 离线
+ 未知
+
+ {/*
{
飞尚科技2
*/}
-
-
- {
- api.current.validate().then((v) => {
- setearch(v);
- setQuery({ limit: 10, page: 0 })
- });
- }}
- >
- 搜索
-
- {
- api.current.reset();
- setearch({});
- setQuery({ limit: 10, page: 0 })
- }}
- >
- 重置
-
-
-
+
+
+ {
+ api.current.validate().then((v) => {
+ setearch(v);
+ setQuery({ limit: 10, page: 0 })
+ });
+ }}
+ >
+ 搜索
+
+ {
+ api.current.reset();
+ setearch({});
+ setQuery({ limit: 10, page: 0 })
+ }}
+ >
+ 重置
+
+
-
-
-
- 设备列表
-
-
-
{
- setSetup(true);
- }}
- >
-
-
-
-
-
-
- s)}
- dataSource={equipmentWarehouseNvr.data}
- bordered={false}
- empty="暂无数据"
- style={{
- padding: "0px 20px",
- }}
- pagination={false}
- />
-
+
+
+
+
+ 设备列表
+
+
+
{
+ setSetup(true);
+ }}
+ >
+
+
+
+
+
+
+ s)}
+ dataSource={equipmentWarehouseNvr.data}
+ bordered={false}
+ empty="暂无数据"
+ style={{
+ padding: "0px 20px",
+ }}
+ pagination={false}
+ />
+
-
-
- 共{equipmentWarehouseNvr.total}个设备
-
-
{
- setQuery({ limit: pageSize, page: currentPage - 1 });
- page.current = currentPage - 1
- }}
- />
-
+
+
+ 共{equipmentWarehouseNvr.total}个设备
+
+
{
+ setQuery({ limit: pageSize, page: currentPage - 1 });
+ page.current = currentPage - 1
+ }}
+ />
+
- {setup ? (
- {
- setSetup(false);
- attribute(venderList);
- }}
- />
- ) : (
- ""
- )}
+ {setup ? (
+ {
+ setSetup(false);
+ attribute(venderList);
+ }}
+ />
+ ) : (
+ ""
+ )}
- {sideSheet ? (
- {
- setSideSheet(false);
- }}
- />
- ) : (
- []
- )}
- {
- history.push({ pathname: '/equipmentWarehouse/camera', query: { addNvr: true, serialNo: nvrRef.current.nvrNumber() } });
- localStorage.setItem('vcmp_selected_sider', JSON.stringify("camera"))
- setReminder(false)
- }}
- close={() => {
- setReminder(false)
- }}
- />
-
- >
- );
+ {sideSheet ? (
+ {
+ setSideSheet(false);
+ }}
+ />
+ ) : (
+ []
+ )}
+ {
+ history.push({ pathname: '/equipmentWarehouse/camera', query: { addNvr: true, serialNo: nvrRef.current.nvrNumber() } });
+ localStorage.setItem('vcmp_selected_sider', JSON.stringify("camera"))
+ setReminder(false)
+ }}
+ close={() => {
+ setReminder(false)
+ }}
+ />
+
+ >
+ );
};
function mapStateToProps (state) {
- const { auth, global, members, equipmentWarehouseNvr } = state;
- return {
- loading: equipmentWarehouseNvr.isRequesting && !equipmentWarehouseNvr.data,
- user: auth.user,
- actions: global.actions,
- members: members.data,
- equipmentWarehouseNvr: equipmentWarehouseNvr.data || {},
- };
+ const { auth, global, members, equipmentWarehouseNvr } = state;
+ return {
+ loading: equipmentWarehouseNvr.isRequesting && !equipmentWarehouseNvr.data,
+ user: auth.user,
+ actions: global.actions,
+ members: members.data,
+ equipmentWarehouseNvr: equipmentWarehouseNvr.data || {},
+ };
}
export default connect(mapStateToProps)(NvrHeader);
diff --git a/code/VideoAccess-VCMP/web/client/src/utils/webapi.js b/code/VideoAccess-VCMP/web/client/src/utils/webapi.js
index 7359ab8..b12f0c2 100644
--- a/code/VideoAccess-VCMP/web/client/src/utils/webapi.js
+++ b/code/VideoAccess-VCMP/web/client/src/utils/webapi.js
@@ -54,7 +54,7 @@ export const ApiTable = {
postStatusCustom: 'status/custom',//自定义状态码释义
getStatusSimpleAll: 'status/simple_all',//获取全部状态码简略信息
getCameraListAll: 'camera/listAll',//获取所有摄像头信息
- getStatusPush: 'status/push',//获取推送配置
+ getStatusPush: 'status/push_list',//获取推送配置
putSasdtatusPush: 'status/push',//编辑推送配置
delPush: 'status/push/{configId}',//删除推送配置
putPushBanned: 'status/push/banned',//禁用推送配置