Browse Source

Merge branch 'dev_trial' of https://gitea.free-sun.vip/free-sun/FS-IOT into dev_trial

pull/3/head
deartibers 3 years ago
parent
commit
a1c20552b1
  1. 3
      code/VideoAccess-VCMP/api/.vscode/launch.json
  2. 2
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  3. 8
      code/VideoAccess-VCMP/api/app/lib/index.js
  4. 2
      code/VideoAccess-VCMP/api/app/lib/middlewares/api-log.js
  5. 1
      code/VideoAccess-VCMP/api/app/lib/middlewares/authenticator.js
  6. 50
      code/VideoAccess-VCMP/api/app/lib/middlewares/business-rest.js
  7. 21
      code/VideoAccess-VCMP/api/app/lib/middlewares/paasRequest.js
  8. 65
      code/VideoAccess-VCMP/api/app/lib/service/paasRequest.js
  9. 1
      code/VideoAccess-VCMP/api/app/lib/service/redis.js
  10. 7
      code/VideoAccess-VCMP/api/config.js
  11. 5
      code/VideoAccess-VCMP/web/.vscode/extensions.json
  12. 8
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx
  13. 463
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  14. 6
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  15. 7
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

3
code/VideoAccess-VCMP/api/.vscode/launch.json

@ -17,7 +17,8 @@
"-f http://localhost:4000", "-f http://localhost:4000",
"-g postgres://postgres:123@10.8.30.32:5432/video_access", "-g postgres://postgres:123@10.8.30.32:5432/video_access",
"--redisHost 127.0.0.1", "--redisHost 127.0.0.1",
"--redisPort 6379" "--redisPort 6379",
"--axyApiUrl http://127.0.0.1:4100"
] ]
}, },
{ {

2
code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js

@ -6,6 +6,8 @@ async function get (ctx, next) {
const { limit, page, orderBy, orderDirection } = ctx.query const { limit, page, orderBy, orderDirection } = ctx.query
const { userId } = ctx.fs.api const { userId } = ctx.fs.api
const aa = await ctx.app.fs.axyRequest.get('structures/types', { query: { token: 'b11b7e6d-032e-4e3e-8973-931c2c5ada5a' } })
let findOption = { let findOption = {
attributes: { exclude: ['delete', 'recycleTime',] }, attributes: { exclude: ['delete', 'recycleTime',] },
where: { where: {

8
code/VideoAccess-VCMP/api/app/lib/index.js

@ -3,9 +3,9 @@
const routes = require('./routes'); const routes = require('./routes');
const redisConnect = require('./service/redis') const redisConnect = require('./service/redis')
const socketConect = require('./service/socket') const socketConect = require('./service/socket')
const paasRequest = require('./service/paasRequest');
const authenticator = require('./middlewares/authenticator'); const authenticator = require('./middlewares/authenticator');
// const apiLog = require('./middlewares/api-log'); // const apiLog = require('./middlewares/api-log');
const businessRest = require('./middlewares/business-rest');
module.exports.entry = function (app, router, opts) { module.exports.entry = function (app, router, opts) {
app.fs.logger.log('info', '[FS-AUTH]', 'Inject auth and api mv into router.'); app.fs.logger.log('info', '[FS-AUTH]', 'Inject auth and api mv into router.');
@ -18,8 +18,12 @@ module.exports.entry = function (app, router, opts) {
redisConnect(app, opts) redisConnect(app, opts)
socketConect(app, opts) socketConect(app, opts)
// 实例其他平台请求方法
paasRequest(app, opts)
router.use(authenticator(app, opts)); router.use(authenticator(app, opts));
// router.use(businessRest(app, router, opts));
// 日志记录
// router.use(apiLog(app, opts)); // router.use(apiLog(app, opts));
router = routes(app, router, opts); router = routes(app, router, opts);

2
code/VideoAccess-VCMP/api/app/lib/middlewares/api-log.js

@ -71,7 +71,7 @@ function factory(app, opts) {
partition: 0 partition: 0
}]; }];
await sendToEsAsync(producer, payloads); // await sendToEsAsync(producer, payloads);
} catch (e) { } catch (e) {
ctx.fs.logger.error(`日志记录失败: ${e}`); ctx.fs.logger.error(`日志记录失败: ${e}`);

1
code/VideoAccess-VCMP/api/app/lib/middlewares/authenticator.js

@ -94,7 +94,6 @@ let isResourceAvailable = function (resources, options) {
let authCode = null; let authCode = null;
// authorize user by authorization attribute // authorize user by authorization attribute
const { authAttr, method, path } = options; const { authAttr, method, path } = options;
console.log(resources, options)
for (let prop in authAttr) { for (let prop in authAttr) {
let keys = []; let keys = [];
let re = pathToRegexp(prop.replace(/\:[A-Za-z_\-]+\b/g, '(\\d+)'), keys); let re = pathToRegexp(prop.replace(/\:[A-Za-z_\-]+\b/g, '(\\d+)'), keys);

50
code/VideoAccess-VCMP/api/app/lib/middlewares/business-rest.js

@ -1,50 +0,0 @@
'use strict';
const request = require('superagent');
const buildUrl = (url,token) => {
let connector = url.indexOf('?') === -1 ? '?' : '&';
return `${url}${connector}token=${token}`;
};
function factory(app, router, opts) {
return async function (ctx, next) {
const token = ctx.fs.api.token;
//console.log(username,password)
const req = {
get: (url, query) => {
return request
.get(buildUrl(url,token))
.query(query)
},
post: (url, data, query) => {
return request
.post(buildUrl(url,token))
.query(query)
//.set('Content-Type', 'application/json')
.send(data);
},
put: (url, data) => {
return request
.put(buildUrl(url,token))
//.set('Content-Type', 'application/json')
.send(data);
},
delete: (url) => {
return request
.del(buildUrl(url,token))
},
};
app.business = app.business || {};
app.business.request = req;
await next();
};
}
module.exports = factory;

21
code/VideoAccess-VCMP/api/app/lib/middlewares/paasRequest.js

@ -0,0 +1,21 @@
'use strict';
const request = require('../service/request')
function factory (app, opts) {
if (opts.pssaRequest) {
try {
for (let r of opts.pssaRequest) {
if (r.name && r.root) {
app.fs[r.name] = new request(r.root)
} else {
throw 'opts.pssaRequest 参数错误!'
}
}
} catch (error) {
console.error(error)
process.exit(-1);
}
}
}
module.exports = factory;

65
code/VideoAccess-VCMP/api/app/lib/service/paasRequest.js

@ -0,0 +1,65 @@
'use strict';
const request = require('superagent')
class paasRequest {
constructor(root) {
this.root = root;
}
#buildUrl = (url) => {
return `${this.root}/${url}`;
}
#resultHandler = (resolve, reject) => {
return (err, res) => {
if (err) {
reject(err);
} else {
resolve(res.body);
}
};
}
get = (url, { query, header = {} }) => {
return new Promise((resolve, reject) => {
request.get(this.#buildUrl(url)).set(header).query(query).end(this.#resultHandler(resolve, reject));
})
}
post = (url, data, query) => {
return new Promise((resolve, reject) => {
request.post(this.#buildUrl(url, this.root)).set(header).query(query).send(data).end(this.#resultHandler(resolve, reject));
})
}
put = (url, data) => {
return new Promise((resolve, reject) => {
request.put(this.#buildUrl(url)).set(setHeader()).send(data).end(this.#resultHandler(resolve, reject));
})
}
delete = (url) => {
return new Promise((resolve, reject) => {
request.delete(this.#buildUrl(url)).set(setHeader()).end(this.#resultHandler(resolve, reject));
})
}
}
function factory (app, opts) {
if (opts.pssaRequest) {
try {
for (let r of opts.pssaRequest) {
if (r.name && r.root) {
app.fs[r.name] = new paasRequest(r.root)
} else {
throw 'opts.pssaRequest 参数错误!'
}
}
} catch (error) {
console.error(error)
process.exit(-1);
}
}
}
module.exports = factory;

1
code/VideoAccess-VCMP/api/app/lib/service/redis.js

@ -1,7 +1,6 @@
'use strict'; 'use strict';
// https://github.com/luin/ioredis // https://github.com/luin/ioredis
const redis = require("ioredis") const redis = require("ioredis")
const moment = require('moment')
module.exports = async function factory (app, opts) { module.exports = async function factory (app, opts) {
let client = new redis(opts.redis.port, opts.redis.host); let client = new redis(opts.redis.port, opts.redis.host);

7
code/VideoAccess-VCMP/api/config.js

@ -14,6 +14,7 @@ args.option(['f', 'fileHost'], '文件中心本地化存储: WebApi 服务器地
args.option('redisHost', 'redisHost'); args.option('redisHost', 'redisHost');
args.option('redisPort', 'redisPort'); args.option('redisPort', 'redisPort');
args.option('redisPswd', 'redisPassword'); args.option('redisPswd', 'redisPassword');
args.option('axyApiUrl', 'axyApiUrl'); // 安心云 api
const flags = args.parse(process.argv); const flags = args.parse(process.argv);
@ -24,6 +25,8 @@ const IOTA_REDIS_SERVER_HOST = process.env.IOTA_REDIS_SERVER_HOST || flags.redis
const IOTA_REDIS_SERVER_PORT = process.env.IOTA_REDIS_SERVER_PORT || flags.redisPort || "6379";//redis 端口 const IOTA_REDIS_SERVER_PORT = process.env.IOTA_REDIS_SERVER_PORT || flags.redisPort || "6379";//redis 端口
const IOTA_REDIS_SERVER_PWD = process.env.IOTA_REDIS_SERVER_PWD || flags.redisPswd || "";//redis 密码 const IOTA_REDIS_SERVER_PWD = process.env.IOTA_REDIS_SERVER_PWD || flags.redisPswd || "";//redis 密码
const AXY_API_URL = process.env.AXY_API_URL || flags.axyApiUrl;
if (!IOT_VIDEO_ACCESS_DB || !IOTA_REDIS_SERVER_HOST || !IOTA_REDIS_SERVER_PORT) { if (!IOT_VIDEO_ACCESS_DB || !IOTA_REDIS_SERVER_HOST || !IOTA_REDIS_SERVER_PORT) {
console.log('缺少启动参数,异常退出'); console.log('缺少启动参数,异常退出');
args.showHelp(); args.showHelp();
@ -53,6 +56,10 @@ const product = {
port: IOTA_REDIS_SERVER_PORT, port: IOTA_REDIS_SERVER_PORT,
pwd: IOTA_REDIS_SERVER_PWD pwd: IOTA_REDIS_SERVER_PWD
}, },
pssaRequest: [{ // name 会作为一个 request 出现在 ctx.app.fs
name: 'axyRequest',
root: AXY_API_URL
}]
} }
} }
], ],

5
code/VideoAccess-VCMP/web/.vscode/extensions.json

@ -0,0 +1,5 @@
{
"recommendations": [
"formulahendry.code-runner"
]
}

8
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx

@ -24,12 +24,12 @@ function Setup(props) {
useEffect(() => { useEffect(() => {
// //
const ISgetItem1 = localStorage.getItem(SETUPS); const nvrItem = localStorage.getItem(SETUPS);
const ISgetItem2 = localStorage.getItem(CAMERAS); const cameraItem = localStorage.getItem(CAMERAS);
if (cameraSetup) { if (cameraSetup) {
setCheck(ISgetItem2 ? JSON.parse(ISgetItem2) : []); setCheck(cameraItem ? JSON.parse(cameraItem) : []);
} else { } else {
setCheck(ISgetItem1 ? JSON.parse(ISgetItem1) : []); setCheck(nvrItem ? JSON.parse(nvrItem) : []);
} }
ischeck(); ischeck();
}, []); }, []);

463
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx

@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { SideSheet, Tabs, TabPane } from "@douyinfe/semi-ui"; import { SideSheet, Tabs, TabPane, Button } from "@douyinfe/semi-ui";
import copy from "copy-to-clipboard"; import copy from "copy-to-clipboard";
function SideSheets(props) { function SideSheets(props) {
@ -19,25 +19,39 @@ function SideSheets(props) {
name: "项目名称", name: "项目名称",
a: "南昌县智慧环保", a: "南昌县智慧环保",
b: "南昌县智慧环保", b: "南昌县智慧环保",
c: "南昌市市政隧道综合管理平台cbj次哦爱吃此课程实地考察大检查的吃点【", c: "南昌市市政隧道综合管理 哦哦哦哦哦 哦哦哦哦 哦哦哦哦 哦哦哦哦哦哦哦哦哦 哦",
d: "C", d: "C",
}, },
{ name: "关联结构物", a: "a", b: "B", c: "C", d: "C" }, { name: "关联结构物", a: "a", b: "B", c: "C", d: "C" },
{ name: "关联测点", a: "a", b: "B", c: "C", d: "C" }, { name: "关联测点", a: "a", b: "B", c: "C", d: "C" },
{ name: "关联监测因素", a: "a", b: "B", c: "C", d: "C" }, { name: "关联监测因素", a: "a", b: "B", c: "C", d: "C" },
]; ];
const IFname = [ const information = {
nvr: [
{
name: "基础信息",
basics: [
{ name: "设备名称:", value: "消火栓呼呼呼呼" }, { name: "设备名称:", value: "消火栓呼呼呼呼" },
{ name: "设备编号:", value: "D50F2049010B" }, { name: "设备编号:", value: "D50F2049010B" },
{ name: "接入方式:", value: "NJBJ858G68H" }, { name: "接入方式:", value: "NJBJ858G68H" },
{ name: "厂商:", value: "哇哇哇哇哇" }, { name: "厂商:", value: "哇哇哇哇哇" },
{ name: "添加账号:", value: "Superadmin" }, { name: "添加账号:", value: "Superadmin" },
{ name: "添加时间:", value: "2022-09-09" }, { name: "添加时间:", value: "2022-09-09" },
{ name: "行政区别:", value: "江西省-南昌市-南昌县" }, {
name: "行政区别:",
value: "江西省-南昌市-南昌县",
difference: "difference",
},
{ {
name: "设备安装位置:", name: "设备安装位置:",
value: "江西省南昌县小蓝经开区江西飞尚科技有限公司", value: "江西省南昌县小蓝经开区江西飞尚科技有限公司",
difference: "line",
}, },
],
},
{
name: "接入信息",
access: [
{ name: "SIP服务编号:", value: "1111111111" }, { name: "SIP服务编号:", value: "1111111111" },
{ name: "SIP域:", value: "KGU876J87" }, { name: "SIP域:", value: "KGU876J87" },
{ name: "SIP端口号:", value: "KGU876J87" }, { name: "SIP端口号:", value: "KGU876J87" },
@ -47,14 +61,28 @@ function SideSheets(props) {
{ name: "注册密码:", value: "**********" }, { name: "注册密码:", value: "**********" },
{ name: "注册有效期::", value: "3600s" }, { name: "注册有效期::", value: "3600s" },
{ name: "接入识别模块:", value: "sssss" }, { name: "接入识别模块:", value: "sssss" },
],
},
{
name: "摄像头信息",
CameraInformation: [
{ {
name: "通道1", name: "通道1",
value1: "145641201564-1", value1: "145641201564-1",
value2: "哦哦哦我我我喔噢喔喔我", value2: "哦哦哦我我我喔噢喔喔我",
}, },
{ name: "通道2", value1: "145641201564-2", value2: "哦哦哦哦哦噢噢欧欧哦" }, {
]; name: "通道2",
const sewage = [ value1: "145641201564-2",
value2: "哦哦哦哦哦噢噢欧欧哦",
},
],
},
],
camera: [
{
name: "基础信息",
basics: [
{ name: "设备名称:", value: "消火栓呼呼呼呼" }, { name: "设备名称:", value: "消火栓呼呼呼呼" },
{ name: "SIP编号/设备编号:", value: "D50F2049010B" }, { name: "SIP编号/设备编号:", value: "D50F2049010B" },
{ name: "接入方式:", value: "NJBJ858G68H" }, { name: "接入方式:", value: "NJBJ858G68H" },
@ -64,80 +92,146 @@ function SideSheets(props) {
{ {
name: "设备安装位置:", name: "设备安装位置:",
value: "江西省南昌县小蓝经开区江西飞尚科技有限公司", value: "江西省南昌县小蓝经开区江西飞尚科技有限公司",
difference: "line",
}, },
],
},
{
name: "复制直播地址",
liveBroadcast: [
{ name: "HLS地址", value: "" }, { name: "HLS地址", value: "" },
{ name: "FLV地址", value: "" }, { name: "FLV地址", value: "" },
{ name: "RTMP地址", value: "" }, { name: "RTMP地址", value: "" },
{ name: "EZOPEN地址", value: "" }, { name: "EZOPEN地址", value: "" },
{ name: "ONVIF地址", value: "" }, { name: "ONVIF地址", value: "" },
],
},
{
name: "复制回收地址",
recovery: [
{ name: "云储存地址", value: "" }, { name: "云储存地址", value: "" },
{ name: "本地储存地址", value: "" }, { name: "本地储存地址", value: "" },
]; ],
function pp() { },
let str = []; ],
for (let i = 0; i < (cameraSetup ? sewage : IFname).length; i++) { };
if (i === 0) { const styles = {
str.push( width: 180,
height: 64,
textAlign: "center",
background: "url(/assets/images/background/backGround.png)",
backgroundSize: "100% 100%",
padding: "12px 17px 12px 17px",
margin: "30px 0 0 10px",
lineHeight: "24px",
overflow: "hidden",
textOverflow: "ellipsis",
display: "-webkit-box",
WebkitLineClamp: "2",
WebkitBoxOrient: "vertical",
zIndex: 5,
};
useEffect(() => {}, []);
return (
<SideSheet
visible={visible}
title={cameraSetup ? "污水管理出出口" : "智慧设备NVR"}
style={{ background: "#F9FBFF" }}
size="large"
onCancel={() => {
close();
}}
>
<Tabs type="line">
<TabPane tab="项目信息" itemKey="1">
<div style={{ display: "flex", justifyContent: "space-evenly" }}>
{list.map((item, index) => {
return (
<div <div
key="Basic_information" key={item.name}
style={{ style={{
fontWeight: "600", width: 200,
color: "#1859C1", margin: "12px 8px",
margin: "15px 0 0 40px",
}} }}
> >
基础信息
</div>
);
}
if (cameraSetup ? i == 7 : i == 8) {
str.push(
<div key="Access_information">
<img
src="/assets/images/background/straightline.png"
alt="1"
style={{ width: 872, display: "block", marginTop: 24 }}
/>
<div <div
style={{ style={{
fontWeight: "600", lineHeight: "32px",
color: "#1859C1", background: "#1859C1",
margin: "15px 0 0 40px", color: "#FFFFFF",
borderRadius: 3,
textAlign: "center",
}} }}
> >
{cameraSetup ? "复制直播地址" : "接入信息"} <img
src={`/assets/images/background/projectIcon${index}.png`}
style={{ marginRight: 10 }}
/>
{item.name}
</div> </div>
<div style={styles}>{item.a}</div>
<div style={styles}>{item.b}</div>
<div style={styles}>{item.c}</div>
<div style={styles}>{item.d}</div>
</div> </div>
); );
} })}
if (cameraSetup ? i == 12 : i == 17) { </div>
</TabPane>
<TabPane tab="设备信息" itemKey="2">
{(cameraSetup ? information.camera : information.nvr).map(
(item, index) => {
let str = [];
if (index > 0) {
str.push( str.push(
<div key="Camera_information">
<img <img
src="/assets/images/background/straightline.png" src="/assets/images/background/straightline.png"
alt="1" key={"img" + index}
alt="无法显示"
style={{ width: 872, display: "block", marginTop: 24 }} style={{ width: 872, display: "block", marginTop: 24 }}
/> />
);
}
str.push(
<div <div
key={"name" + index}
style={{ style={{
fontWeight: "600", fontWeight: "600",
color: "#1859C1", color: "#1859C1",
margin: "15px 0 0 40px", margin: "15px 0 12px 40px",
}} }}
> >
{cameraSetup ? "复制回收地址" : "摄像头信息"} {item.name}
{cameraSetup ? (
index == 1 ? (
<div
style={{
display: "inline-block",
float: "right",
marginRight: 20,
}}
>
<Button style={{ marginRight: 20 }} theme="solid">
高清
</Button>
<Button>标清</Button>
</div> </div>
) : (
""
)
) : (
""
)}
</div> </div>
); );
} //
if ( if (index == 0) {
cameraSetup ? 0 <= i && i < 6 : (0 <= i && i < 6) || (i > 7 && i <= 16) item.basics.map((item, index) => {
) { if (item.difference == "line") {
str.push( str.push(
<div <div key={"basics" + index} style={{ marginTop: 14 }}>
key={i}
style={{ width: "50%", display: "inline-block", marginTop: 20 }}
>
<span <span
style={{ style={{
width: 150, width: 150,
@ -147,17 +241,23 @@ function SideSheets(props) {
color: "rgba(0, 0, 0, 0.45)", color: "rgba(0, 0, 0, 0.45)",
}} }}
> >
{(cameraSetup ? sewage : IFname)[i].name} {item.name}
</span> </span>
<span style={{ fontWeight: "600", color: " #34383E" }}> <span style={{ fontWeight: "600", color: " #34383E" }}>
{(cameraSetup ? sewage : IFname)[i].value} {item.value}
</span> </span>
</div> </div>
); );
} } else {
if (cameraSetup ? i == 6 : i > 5 && i < 8) {
str.push( str.push(
<div key={i} style={{ marginTop: 14 }}> <div
key={"basics" + index}
style={{
width: "50%",
display: "inline-block",
marginTop: 20,
}}
>
<span <span
style={{ style={{
width: 150, width: 150,
@ -167,21 +267,26 @@ function SideSheets(props) {
color: "rgba(0, 0, 0, 0.45)", color: "rgba(0, 0, 0, 0.45)",
}} }}
> >
{(cameraSetup ? sewage : IFname)[i].name} {item.name}
</span> </span>
<span style={{ fontWeight: "600", color: " #34383E" }}> <span style={{ fontWeight: "600", color: " #34383E" }}>
{(cameraSetup ? sewage : IFname)[i].value} {item.value}
</span> </span>
</div> </div>
); );
} }
if (cameraSetup ? i > 6 && i < 14 : i > 16) { return str;
});
}
///
if (index == 1) {
(cameraSetup ? item.liveBroadcast : item.access).map(
(item, index) => {
if (cameraSetup) {
str.push( str.push(
<div <div
key={i} key={"liveBroadcast" + index}
style={ style={{
cameraSetup
? {
width: 120, width: 120,
height: 130, height: 130,
display: "inline-block", display: "inline-block",
@ -189,70 +294,29 @@ function SideSheets(props) {
border: "1px solid #D9D9D9", border: "1px solid #D9D9D9",
margin: "20px 0 0 40px", margin: "20px 0 0 40px",
textAlign: "center", textAlign: "center",
color: clickStyle == sewage[i].name ? "white" : "", color: clickStyle == item.name ? "white" : "",
background: clickStyle == sewage[i].name ? "#1859C1" : "", background:
} clickStyle == item.name ? "#1859C1" : "",
: { }}
width: "40%", onClick={() => {
display: "inline-block", copy(item.name);
borderRadius: 4,
border: "1px solid rgba(151, 151, 151, 0.2)",
margin: "16px 0 0 36px",
color: "rgba(0, 0, 0, 0.85)",
fontWeight: "600",
}
}
onClick={
cameraSetup
? (e) => {
copy(sewage[i].name);
// alert(""); // alert("");
setclickStyle(sewage[i].name); setclickStyle(item.name);
} }}
: ""
}
>
<div
style={
cameraSetup
? {}
: {
padding: "8px 10px",
borderBottom: "1px solid rgba(151, 151, 151, 0.2)",
}
}
> >
<img <img
src={`/assets/images/background/${ src={`/assets/images/background/${
cameraSetup clickStyle == item.name
? i < 12
? clickStyle == sewage[i].name
? "sewage_camera2" ? "sewage_camera2"
: "sewage_camera1" : "sewage_camera1"
: clickStyle == sewage[i].name
? "store2"
: "store1"
: "camera"
}.png`} }.png`}
style={ style={{ margin: "20px 0 8px 0" }}
cameraSetup ? { margin: "20px 0 8px 0" } : { marginRight: 10 }
}
/> />
<div <div>
style={ {item.name}
cameraSetup
? {}
: {
display: "inline-block",
}
}
>
{cameraSetup ? (
<>
{sewage[i].name}
<img <img
src={`/assets/images/background/${ src={`/assets/images/background/${
clickStyle == sewage[i].name ? "copy2" : "copy1" clickStyle == item.name ? "copy2" : "copy1"
}.png`} }.png`}
style={{ style={{
paddingBottom: 10, paddingBottom: 10,
@ -261,95 +325,140 @@ function SideSheets(props) {
height: 20, height: 20,
}} }}
/> />
</>
) : (
IFname[i].name
)}
</div> </div>
</div> </div>
{cameraSetup ? ( );
"" } else {
) : ( str.push(
<> <div
<p style={{ margin: "16px 0 0 30px " }}>{IFname[i].value1}</p> key={"access" + index}
<p style={{ margin: "16px 0 20px 30px " }}> style={{
{IFname[i].value2} width: "50%",
</p> display: "inline-block",
</> marginTop: 20,
)} }}
>
<span
style={{
width: 150,
display: "inline-block",
textAlign: "right",
fontWeight: "600",
color: "rgba(0, 0, 0, 0.45)",
}}
>
{item.name}
</span>
<span
style={{ fontWeight: "600", color: " #34383E" }}
>
{item.value}
</span>
</div> </div>
); );
} }
}
return str; return str;
} }
const styles = { );
width: 180, }
height: 64, ///
if (index == 2) {
(cameraSetup ? item.recovery : item.CameraInformation).map(
(item, index) => {
if (cameraSetup) {
str.push(
<div
key={"liveBroadcast" + index}
style={{
width: 120,
height: 130,
display: "inline-block",
borderRadius: 4,
border: "1px solid #D9D9D9",
margin: "20px 0 0 40px",
textAlign: "center", textAlign: "center",
background: "url(/assets/images/background/backGround.png)", color: clickStyle == item.name ? "white" : "",
backgroundSize: "100% 100%", background:
padding: "12px 17px 12px 17px", clickStyle == item.name ? "#1859C1" : "",
margin: "30px 0 0 10px", }}
lineHeight: "24px", onClick={() => {
overflow: "hidden", copy(item.name);
textOverflow: "ellipsis", // alert("");
display: "-webkit-box", setclickStyle(item.name);
WebkitLineClamp: "2",
WebkitBoxOrient: "vertical",
zIndex: 5,
};
useEffect(() => {}, []);
return (
<SideSheet
visible={visible}
title={cameraSetup ? "污水管理出出口" : "智慧设备NVR"}
style={{ background: "#F9FBFF" }}
size="large"
onCancel={() => {
close();
}} }}
> >
<Tabs type="line"> <img
<TabPane tab="项目信息" itemKey="1"> src={`/assets/images/background/${
<div style={{ display: "flex", justifyContent: "space-evenly" }}> clickStyle == item.name ? "store2" : "store1"
{list.map((item, index) => { }.png`}
return ( style={{ margin: "20px 0 8px 0" }}
/>
<div>
{item.name}
<img
src={`/assets/images/background/${
clickStyle == item.name ? "copy2" : "copy1"
}.png`}
style={{
paddingBottom: 10,
display: "inline-block",
width: 10,
height: 20,
}}
/>
</div>
</div>
);
} else {
str.push(
<div <div
key={item.name} key={"access" + index}
style={{ style={{
width: 200, width: "40%",
margin: "12px 8px", display: "inline-block",
borderRadius: 4,
border: "1px solid rgba(151, 151, 151, 0.2)",
margin: "16px 0 0 36px",
color: "rgba(0, 0, 0, 0.85)",
fontWeight: "600",
}} }}
> >
<div <div
style={{ style={{
lineHeight: "32px", padding: "8px 10px",
background: "#1859C1", borderBottom:
color: "#FFFFFF", "1px solid rgba(151, 151, 151, 0.2)",
borderRadius: 3,
textAlign: "center",
}} }}
> >
<img <img
src={`/assets/images/background/projectIcon${index}.png`} src={`/assets/images/background/camera.png`}
style={{ marginRight: 10 }} style={{ marginRight: 10 }}
/> />
<div
style={{
display: "inline-block",
}}
>
{item.name} {item.name}
</div> </div>
<div style={styles}>{item.a}</div>
<div style={styles}>{item.b}</div>
<div style={styles}>{item.c}</div>
<div style={styles}>{item.d}</div>
</div> </div>
); <p style={{ margin: "16px 0 0 30px " }}>
})} {item.value1}
</p>
<p style={{ margin: "16px 0 20px 30px " }}>
{item.value2}
</p>
</div> </div>
</TabPane> );
<TabPane tab="设备信息" itemKey="2"> }
{pp()} return str;
}
);
}
return str;
}
)}
</TabPane> </TabPane>
</Tabs> </Tabs>
</SideSheet> </SideSheet>

6
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

@ -26,10 +26,12 @@ const CameraHeader = (props) => {
setvenderList(res.payload.data); setvenderList(res.payload.data);
}); });
// //
localStorage.setItem( localStorage.getItem(CAMERAS) == null
? localStorage.setItem(
CAMERAS, CAMERAS,
JSON.stringify(["state", "type", "manufactor"]) JSON.stringify(["state", "type", "manufactor"])
); )
: "";
attribute(); attribute();
}, []); }, []);

7
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

@ -23,10 +23,12 @@ const NvrHeader = (props) => {
setvenderList(res.payload.data); setvenderList(res.payload.data);
}); });
// //
localStorage.setItem(SETUPS, JSON.stringify(["a", "c", "d", "e"])); localStorage.getItem(SETUPS) == null
? localStorage.setItem(SETUPS, JSON.stringify(["a", "c", "d", "e"]))
: "";
// ;
attribute(); attribute();
}, []); }, []);
useEffect(() => { useEffect(() => {
equipmentGetNvr(); equipmentGetNvr();
}, [query]); }, [query]);
@ -441,7 +443,6 @@ const NvrHeader = (props) => {
{equipmentWarehouseNvr.total}个设备 {equipmentWarehouseNvr.total}个设备
</span> </span>
<Pagination <Pagination
className="22"
total={equipmentWarehouseNvr.total} total={equipmentWarehouseNvr.total}
showSizeChanger showSizeChanger
currentPage={query.page + 1} currentPage={query.page + 1}

Loading…
Cancel
Save