13 changed files with 586 additions and 99 deletions
@ -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; |
|||
}; |
@ -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; |
|||
}; |
@ -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; |
|||
}; |
@ -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; |
|||
}; |
After Width: | Height: | Size: 481 B |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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 |
Loading…
Reference in new issue