Browse Source

冲突更改

release_0.0.1
wenlele 3 years ago
parent
commit
b6ed892275
  1. 18
      code/VideoAccess-VCMP/api/app/lib/index.js
  2. 257
      code/VideoAccess-VCMP/api/app/lib/models/camera.js
  3. 34
      code/VideoAccess-VCMP/api/app/lib/models/camera_ability.js
  4. 34
      code/VideoAccess-VCMP/api/app/lib/models/camera_kind.js
  5. 96
      code/VideoAccess-VCMP/api/app/lib/models/nvr.js
  6. 34
      code/VideoAccess-VCMP/api/app/lib/models/vender.js
  7. 8
      code/VideoAccess-VCMP/api/sequelize-automate.config.js
  8. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/location.png
  9. BIN
      code/VideoAccess-VCMP/web/client/assets/video/camera_banner.mp4
  10. BIN
      code/VideoAccess-VCMP/web/client/assets/video/nvr_banner.mp4
  11. BIN
      code/VideoAccess-VCMP/web/client/assets/video/recycle_banner.mp4
  12. 112
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx
  13. 92
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

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

@ -20,17 +20,9 @@ module.exports.entry = function (app, router, opts) {
}; };
module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Sequelize, models: {} } module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Sequelize, models: {} }
require('./models/user')(dc); require('./models/camera_ability')(dc);
require('./models/user_token')(dc); require('./models/camera_kind')(dc);
require('./models/department')(dc); require('./models/camera')(dc);
require('./models/resource')(dc); require('./models/nvr')(dc);
require('./models/user_resource')(dc); require('./models/vender')(dc);
require('./models/places')(dc);
require('./models/user_placeSecurityRecord')(dc);
require('./models/report_type')(dc);
require('./models/report_downManage')(dc);
require('./models/department')(dc);
require('./models/report_configition')(dc);
require('./models/report_collection')(dc);
require('./models/report_rectify')(dc);
}; };

257
code/VideoAccess-VCMP/api/app/lib/models/camera.js

@ -0,0 +1,257 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Camera = sequelize.define("camera", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "camera_id_uindex"
},
type: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "设备类型:yingshi - 萤石;nvr - NVR摄像头;ipc - IPC 网络摄像头;cascade - 级联摄像头",
primaryKey: false,
field: "type",
autoIncrement: false
},
name: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "设备名称/安装位置",
primaryKey: false,
field: "name",
autoIncrement: false
},
channelName: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "通道名称",
primaryKey: false,
field: "channel_name",
autoIncrement: false
},
externalDomain: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "外域名称",
primaryKey: false,
field: "external_domain",
autoIncrement: false
},
rtmp: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "rtmp",
autoIncrement: false
},
serialNo: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "设备编号",
primaryKey: false,
field: "serial_no",
autoIncrement: false
},
cloudControl: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: "云台控制",
primaryKey: false,
field: "cloud_control",
autoIncrement: false
},
highDefinition: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: "高清支持",
primaryKey: false,
field: "high_definition",
autoIncrement: false
},
voice: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: "语音对讲支持",
primaryKey: false,
field: "voice",
autoIncrement: false
},
memoryCard: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "内存卡容量",
primaryKey: false,
field: "memory_card",
autoIncrement: false
},
venderId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "设备厂商id",
primaryKey: false,
field: "vender_id",
autoIncrement: false,
references: {
key: "id",
model: "vender"
}
},
cascadeType: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "级联方式:up - 上级联;down - 下级联",
primaryKey: false,
field: "cascade_type",
autoIncrement: false
},
sip: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "sip",
autoIncrement: false
},
longitude: {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
comment: "经度",
primaryKey: false,
field: "longitude",
autoIncrement: false
},
latitude: {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
comment: "维度",
primaryKey: false,
field: "latitude",
autoIncrement: false
},
forbidden: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: "是否禁用",
primaryKey: false,
field: "forbidden",
autoIncrement: false
},
createTime: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_time",
autoIncrement: false
},
recycleTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: "放入回收站时间",
primaryKey: false,
field: "recycle_time",
autoIncrement: false
},
delete: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: "是否彻底删除",
primaryKey: false,
field: "delete",
autoIncrement: false
},
createUserId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_user_id",
autoIncrement: false
},
nvrId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "nvr_id",
autoIncrement: false,
references: {
key: "id",
model: "nvr"
}
},
model: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "型号",
primaryKey: false,
field: "model",
autoIncrement: false
},
kindId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "kind_id",
autoIncrement: false,
references: {
key: "id",
model: "cameraKind"
}
},
abilityId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "ability_id",
autoIncrement: false,
references: {
key: "id",
model: "cameraAbility"
}
}
}, {
tableName: "camera",
comment: "",
indexes: []
});
dc.models.Camera = Camera;
return Camera;
};

34
code/VideoAccess-VCMP/api/app/lib/models/camera_ability.js

@ -0,0 +1,34 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const CameraAbility = sequelize.define("cameraAbility", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: false,
unique: "camera_ability_id_uindex"
},
ability: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "ability",
autoIncrement: false
}
}, {
tableName: "camera_ability",
comment: "",
indexes: []
});
dc.models.CameraAbility = CameraAbility;
return CameraAbility;
};

34
code/VideoAccess-VCMP/api/app/lib/models/camera_kind.js

@ -0,0 +1,34 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const CameraKind = sequelize.define("cameraKind", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: false,
unique: "camera_kind_id_uindex"
},
kind: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "kind",
autoIncrement: false
}
}, {
tableName: "camera_kind",
comment: "",
indexes: []
});
dc.models.CameraKind = CameraKind;
return CameraKind;
};

96
code/VideoAccess-VCMP/api/app/lib/models/user.js → code/VideoAccess-VCMP/api/app/lib/models/nvr.js

@ -4,7 +4,7 @@
module.exports = dc => { module.exports = dc => {
const DataTypes = dc.ORM; const DataTypes = dc.ORM;
const sequelize = dc.orm; const sequelize = dc.orm;
const User = sequelize.define("user", { const Nvr = sequelize.define("nvr", {
id: { id: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
@ -13,7 +13,7 @@ module.exports = dc => {
primaryKey: true, primaryKey: true,
field: "id", field: "id",
autoIncrement: true, autoIncrement: true,
unique: "user_id_uindex" unique: "nvr_id_uindex"
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
@ -24,49 +24,80 @@ module.exports = dc => {
field: "name", field: "name",
autoIncrement: false autoIncrement: false
}, },
username: { venderId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "设备厂家id",
primaryKey: false,
field: "vender_id",
autoIncrement: false,
references: {
key: "id",
model: "vender"
}
},
serialNo: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "用户名 账号", comment: "设备编号",
primaryKey: false, primaryKey: false,
field: "username", field: "serial_no",
autoIncrement: false autoIncrement: false
}, },
password: { regionCode: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "行政区码",
primaryKey: false,
field: "region_code",
autoIncrement: false
},
longitude: {
type: DataTypes.DOUBLE,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "password", field: "longitude",
autoIncrement: false autoIncrement: false
}, },
departmentId: { latitude: {
type: DataTypes.INTEGER, type: DataTypes.DOUBLE,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "部门id", comment: null,
primaryKey: false, primaryKey: false,
field: "department_id", field: "latitude",
autoIncrement: false autoIncrement: false
}, },
email: { createTime: {
type: DataTypes.STRING, type: DataTypes.DATE,
allowNull: false,
defaultValue: sequelize.fn('now'),
comment: "创建时间",
primaryKey: false,
field: "create_time",
autoIncrement: false
},
channelCount: {
type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: "通道数",
primaryKey: false, primaryKey: false,
field: "email", field: "channel_count",
autoIncrement: false autoIncrement: false
}, },
enable: { port: {
type: DataTypes.BOOLEAN, type: DataTypes.STRING,
allowNull: false, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "启用状态", comment: "端口",
primaryKey: false, primaryKey: false,
field: "enable", field: "port",
autoIncrement: false autoIncrement: false
}, },
delete: { delete: {
@ -78,31 +109,20 @@ module.exports = dc => {
field: "delete", field: "delete",
autoIncrement: false autoIncrement: false
}, },
phone: { createUserId: {
type: DataTypes.STRING, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "手机号(小程序使用手机号登录)", comment: null,
primaryKey: false,
field: "phone",
autoIncrement: false
},
post: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "职位",
primaryKey: false, primaryKey: false,
field: "post", field: "create_user_id",
autoIncrement: false autoIncrement: false
} }
}, { }, {
tableName: "user", tableName: "nvr",
comment: "", comment: "",
indexes: [] indexes: []
}); });
dc.models.User = User; dc.models.Nvr = Nvr;
return Nvr;
return User;
}; };

34
code/VideoAccess-VCMP/api/app/lib/models/vender.js

@ -0,0 +1,34 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Vender = sequelize.define("vender", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "vender_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
}
}, {
tableName: "vender",
comment: "",
indexes: []
});
dc.models.Vender = Vender;
return Vender;
};

8
code/VideoAccess-VCMP/api/sequelize-automate.config.js

@ -1,7 +1,7 @@
module.exports = { module.exports = {
// 数据库配置 与 sequelize 相同 // 数据库配置 与 sequelize 相同
dbOptions: { dbOptions: {
database: 'yinjiguanli', database: 'video_access',
username: 'postgres', username: 'postgres',
password: '123', password: '123',
dialect: 'postgres', dialect: 'postgres',
@ -25,9 +25,9 @@ module.exports = {
fileNameCamelCase: false, // Model 文件名是否使用驼峰法命名,默认文件名会使用表名,如 `user_post.js`;如果为 true,则文件名为 `userPost.js` fileNameCamelCase: false, // Model 文件名是否使用驼峰法命名,默认文件名会使用表名,如 `user_post.js`;如果为 true,则文件名为 `userPost.js`
dir: './app/lib/models', // 指定输出 models 文件的目录 dir: './app/lib/models', // 指定输出 models 文件的目录
typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义 typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义
emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir` emptyDir: true, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
tables: ['user_placeSecurityRecord', 'places'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 tables: null, // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
skipTables: ['user'], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性
tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中 tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中
ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面 ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面
attrLength: false, // 在生成模型的字段中 是否生成 如 var(128)这种格式,公司一般使用 String ,则配置为 false attrLength: false, // 在生成模型的字段中 是否生成 如 var(128)这种格式,公司一般使用 String ,则配置为 false

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/location.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

BIN
code/VideoAccess-VCMP/web/client/assets/video/camera_banner.mp4

Binary file not shown.

BIN
code/VideoAccess-VCMP/web/client/assets/video/nvr_banner.mp4

Binary file not shown.

BIN
code/VideoAccess-VCMP/web/client/assets/video/recycle_banner.mp4

Binary file not shown.

112
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx

@ -0,0 +1,112 @@
import React, { useState } from 'react'
import { Modal, Button,Form,Row,Col,Divider,Spin } from '@douyinfe/semi-ui';
import { IconTickCircle } from '@douyinfe/semi-icons';
function nvrModal(props){
const [visible, setVisible] = useState(false);//
const [isloading,setloading] = useState(false);//loading
const [loadingTip,setloadingTip] = useState('获取中...请稍后...');//loading tip
const [step,setstep] = useState(0)
function showDialog() {//
setVisible(true);
}
function handleOk() {//
// setVisible(false);
setloading(true);
setTimeout(() => {
setloadingTip('...接受成功')
setTimeout(()=>{
setloadingTip('已完成')
setTimeout(() => {
setstep(1);
setloading(false);
}, 2000);
},2000)
}, 2000);
}
function handleAfterClose(){//
console.log('after');
}
function handleCancel() {//
setVisible(false);
}
return (
<>
<div onClick={showDialog}>{props.modalName}</div>
<Modal
title="添加NVR"
okText="测试校验"
// cancelText
visible={visible}
onOk={handleOk}
height={386}
width={607}
afterClose={handleAfterClose} //>=1.16.0
onCancel={handleCancel}
>
<Spin tip={loadingTip} spinning={isloading}>
{step==0?<div style={{paddingLeft:16+'px'}}>
<Form
labelPosition='left'
labelAlign='left'
labelWidth= '90px'
onValueChange={values=>console.log(values)}>
<Row>
<Col span={12}>
<Form.Input field='UserName' label='设备编号:' placeholder='请输入设备编号' style={{ width:149 }}
rules={[
{ required: true, message: '请输入设备编号' }
]}/>
</Col>
<Col span={12}>
<Form.Input field='Use11rName' label='行政区区码:' placeholder='请输入行政区区码' style={{ width:149 }}/>
</Col>
<Col span={24}>
<Form.Input field='Use11rName11' label='设备名称:' placeholder='请输入设备名称、常用项目或位置定义' style={{ width:421 }}
rules={[
{ required: true, message: '请输入设备名称、常用项目或位置定义' }
]}/>
</Col>
<Col span={24}>
<Form.Select label="设备厂家:" field='business2' placeholder='请选择设备厂家' style={{ width: 421+'px' }}>
<Form.Select.Option value="abc">Semi</Form.Select.Option>
<Form.Select.Option value="ulikeCam">轻颜相机</Form.Select.Option>
<Form.Select.Option value="toutiao">今日头条</Form.Select.Option>
</Form.Select>
</Col>
<Col span={24} style={{display:'flex',alignItems:'center'}}>
<Form.Input field='Use11rName131' label='安装位置:' placeholder='请输入或拾取高德经纬度坐标' style={{ width:386 }}
rules={[
{ required: true, message: '请输入或拾取高德经纬度坐标' }
]}/>
<div style={{
width:32,
height:32,
background:"#1859C1",
marginLeft:4+'px',
display:'flex',
justifyContent: 'center',
alignItems: 'center',
cursor: "pointer",
borderRadius: 3+'px'}}>
<img src="../../../assets/images/background/location.png" width={16} height={20}/>
</div>
</Col>
</Row>
</Form>
</div>:
<div >
<div style={{marginTop:50,display: 'flex', justifyContent: 'center'}}>
<IconTickCircle style={{color:'#04B234',fontSize:60}}/>
</div>
<div style={{marginTop:20,display: 'flex', justifyContent: 'center'}}>
已完成NVR设备测试和校验是否确认添加
</div>
</div>
}
</Spin>
</Modal>
</>
);
}
export default nvrModal

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

@ -2,6 +2,7 @@ import React, { useEffect } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Button, Form, Input, Row, Table } from "@douyinfe/semi-ui"; import { Button, Form, Input, Row, Table } from "@douyinfe/semi-ui";
import "../style.less"; import "../style.less";
import NvrModal from "../components/nvrModal"
const NvrHeader = (props) => { const NvrHeader = (props) => {
const { dispatch, actions, user, loading } = props; const { dispatch, actions, user, loading } = props;
@ -108,42 +109,45 @@ const NvrHeader = (props) => {
]; ];
return ( return (
<> <>
<div className="NvrHeader"> <div style={{position:''}}>
<div <video id='nvrBanner' autoPlay loop muted style={{ width: '100%', objectFit: 'cover', height: 171 }} src='/assets/video/nvr_banner.mp4' type='video/mp4' />
style={{ <div style={{position: 'absolute',top:12}}>
fontSize: 22 + "px", <div
paddingTop: 15 + "px", style={{
marginLeft: 21 + "px", fontSize: 22 + "px",
}} paddingTop: 15 + "px",
> marginLeft: 21 + "px",
NVR管理 }}
</div> >
<div NVR管理
style={{ </div>
fontSize: 14 + "px", <div
paddingTop: 18 + "px", style={{
marginLeft: 20 + "px", fontSize: 14 + "px",
}} paddingTop: 18 + "px",
> marginLeft: 20 + "px",
对NVR网络硬盘录像机设备节点的管理 }}
</div> >
<div 对NVR网络硬盘录像机设备节点的管理
style={{ </div>
fontSize: 14 + "px", <div
marginTop: 28 + "px", style={{
marginLeft: 21 + "px", fontSize: 14 + "px",
width: 89 + "px", marginTop: 28 + "px",
height: 32 + "px", marginLeft: 21 + "px",
lineHeight: 32 + "px", width: 89 + "px",
textAlign: "center", height: 32 + "px",
backgroundColor: "#D9EAFF", lineHeight: 32 + "px",
color: "#1859C1", textAlign: "center",
cursor: "pointer", backgroundColor: "#D9EAFF",
}} color: "#1859C1",
> cursor: "pointer",
添加NVR }}
</div> >
</div> <NvrModal modalName="添加NVR"/>
</div>
</div>
</div>
<div <div
style={{ style={{
width: "100%", width: "100%",
@ -272,14 +276,14 @@ const NvrHeader = (props) => {
); );
}; };
function mapStateToProps(state) { function mapStateToProps (state) {
const { auth, global, members } = state; const { auth, global, members } = state;
return { return {
loading: members.isRequesting, loading: members.isRequesting,
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
members: members.data, members: members.data,
}; };
} }
export default connect(mapStateToProps)(NvrHeader); export default connect(mapStateToProps)(NvrHeader);

Loading…
Cancel
Save