Browse Source

回收站建设页

release_0.0.2
yuan_yi 3 years ago
parent
commit
77efe48d7c
  1. 82
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js
  2. 20
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  3. 39
      code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js
  4. 1
      code/VideoAccess-VCMP/api/app/lib/index.js
  5. 17
      code/VideoAccess-VCMP/api/app/lib/models/camera.js
  6. 58
      code/VideoAccess-VCMP/api/app/lib/models/camera_ability.js
  7. 56
      code/VideoAccess-VCMP/api/app/lib/models/camera_ability_bind.js
  8. 279
      code/VideoAccess-VCMP/api/app/lib/models/gb_camera.js
  9. 244
      code/VideoAccess-VCMP/api/app/lib/models/nvr.js
  10. 2
      code/VideoAccess-VCMP/api/app/lib/utils/xlsxDownload.js
  11. 2
      code/VideoAccess-VCMP/api/sequelize-automate.config.js
  12. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/building.jpg
  13. 22
      code/VideoAccess-VCMP/web/client/src/components/coming.jsx
  14. 4
      code/VideoAccess-VCMP/web/client/src/components/index.js
  15. 4
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/index.js
  16. 18
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/recycle.jsx
  17. 23
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/nav-item.jsx
  18. 43
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/routes.js

82
code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js

@ -4,6 +4,7 @@ const moment = require('moment')
async function createYingshi (ctx) { async function createYingshi (ctx) {
let errMsg = '添加萤石摄像头失败' let errMsg = '添加萤石摄像头失败'
const transaction = await ctx.fs.dc.orm.transaction();
try { try {
const { models } = ctx.fs.dc const { models } = ctx.fs.dc
const { userId, token } = ctx.fs.api const { userId, token } = ctx.fs.api
@ -13,6 +14,7 @@ async function createYingshi (ctx) {
id, name, cloudControl, highDefinition, memoryCard, id, name, cloudControl, highDefinition, memoryCard,
voice, kindId, abilityId, rtmp, serialNo, longitude, latitude, voice, kindId, abilityId, rtmp, serialNo, longitude, latitude,
} = ctx.request.body; } = ctx.request.body;
let handleCameraId = id
const serialNo_ = String(serialNo).toUpperCase() const serialNo_ = String(serialNo).toUpperCase()
const secretRes = await models.SecretYingshi.findAll() const secretRes = await models.SecretYingshi.findAll()
@ -39,25 +41,52 @@ async function createYingshi (ctx) {
let storageData = { let storageData = {
type: 'yingshi', name, cloudControl, highDefinition, memoryCard, type: 'yingshi', name, cloudControl, highDefinition, memoryCard,
voice, longitude, latitude, kindId, abilityId, rtmp, voice, longitude, latitude, kindId, rtmp,
serialNo: serialNo_,
yingshiSecretId: cameraBeloneSecretId yingshiSecretId: cameraBeloneSecretId
} }
if (id) { if (handleCameraId) {
await models.Camera.update(storageData, { await models.Camera.update(storageData, {
where: { where: {
id, id: handleCameraId,
} },
transaction
}) })
} else { } else {
storageData.createTime = moment().format() storageData.createTime = moment().format()
storageData.createUserId = userId storageData.createUserId = userId
storageData.forbidden = false storageData.forbidden = false
await models.Camera.create(storageData) const createRes = await models.Camera.create(storageData, {
transaction
})
handleCameraId = createRes.id
} }
await models.CameraAbilityBind.destroy({
where: {
cameraId: handleCameraId
},
transaction
})
if (abilityId && handleCameraId) {
let storageData = abilityId.map(aid => {
return {
cameraId: handleCameraId,
abilityId: aid
}
})
if (storageData.length) {
await models.CameraAbilityBind.bulkCreate(storageData, {
transaction
})
}
}
await transaction.commit();
ctx.status = 204; ctx.status = 204;
} catch (error) { } catch (error) {
await transaction.rollback();
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400; ctx.status = 400;
ctx.body = { ctx.body = {
@ -172,36 +201,65 @@ async function createNvrCamera (ctx) {
} }
async function createIpcCamera (ctx) { async function createIpcCamera (ctx) {
const transaction = await ctx.fs.dc.orm.transaction();
try { try {
const { models } = ctx.fs.dc const { models } = ctx.fs.dc
const { userId, token } = ctx.fs.api const { userId, token } = ctx.fs.api
const { const {
id, name, cloudControl, memoryCard, id, name, cloudControl, memoryCard,
voice, longitude, latitude, rtmp, voice, longitude, latitude, venderId, rtmp,
serialNo, kindId, abilityId, serialNo, kindId, abilityId,
} = ctx.request.body; } = ctx.request.body;
let handleCameraId = id
let storageData = { let storageData = {
type: 'ipc', name, cloudControl, memoryCard, type: 'ipc', name, cloudControl, memoryCard,
voice, longitude, latitude, rtmp, voice, longitude, latitude, rtmp, venderId,
serialNo, kindId, abilityId, serialNo, kindId,
} }
if (id) { if (handleCameraId) {
await models.Camera.update(storageData, { await models.Camera.update(storageData, {
where: { where: {
id, id: handleCameraId,
} },
transaction
}) })
} else { } else {
storageData.createTime = moment().format() storageData.createTime = moment().format()
storageData.createUserId = userId storageData.createUserId = userId
storageData.forbidden = false storageData.forbidden = false
await models.Camera.create(storageData) const createRes = await models.Camera.create(storageData, {
transaction
})
handleCameraId = createRes.id
} }
await models.CameraAbilityBind.destroy({
where: {
cameraId: handleCameraId
},
transaction
})
if (abilityId && handleCameraId) {
let storageData = abilityId.map(aid => {
return {
cameraId: handleCameraId,
abilityId: aid
}
})
if (storageData.length) {
await models.CameraAbilityBind.bulkCreate(storageData, {
transaction
})
}
}
await transaction.commit();
ctx.status = 204; ctx.status = 204;
} catch (error) { } catch (error) {
await transaction.rollback();
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400; ctx.status = 400;
ctx.body = {} ctx.body = {}

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

@ -19,11 +19,12 @@ async function getCameraProject (ctx, next) {
[orderBy || 'id', orderDirection || 'DESC'] [orderBy || 'id', orderDirection || 'DESC']
], ],
include: [{ include: [{
model: models.CameraAbility
}, {
model: models.CameraKind model: models.CameraKind
}] }]
} }
let abilityFind = {
model: models.CameraAbility
}
if (limit) { if (limit) {
findOption.limit = limit findOption.limit = limit
} }
@ -40,13 +41,16 @@ async function getCameraProject (ctx, next) {
if (type) { if (type) {
findOption.where.type = type findOption.where.type = type
} }
if (abilityId) {
findOption.where.abilityId = abilityId
}
if (venderId) { if (venderId) {
findOption.where.venderId = venderId findOption.where.venderId = venderId
} }
if (abilityId) {
abilityFind.where = {
abilityId: abilityId
}
}
findOption.include.push(abilityFind)
const cameraRes = await models.Camera.findAll(findOption) const cameraRes = await models.Camera.findAll(findOption)
const total = await models.Camera.count({ const total = await models.Camera.count({
where: findOption.where where: findOption.where
@ -356,10 +360,10 @@ async function cameraExport (ctx) {
exportData.push(camera) exportData.push(camera)
} }
const fileName = `摄像头信息列表_${userId}_${moment().format('YYYYMMDDHHmmss')}` + '.csv'
const filePath = await simpleExcelDown({ data: exportData, header, fileName: `摄像头信息列表_${userId}_${moment().format('YYYYMMDDHHmmss')}` }) const filePath = await simpleExcelDown({ data: exportData, header, fileName: fileName })
const fileData = fs.readFileSync(filePath); const fileData = fs.readFileSync(filePath);
let fileName = filePath.split('/').pop()
ctx.status = 200; ctx.status = 200;
ctx.set('Content-Type', 'application/x-xls'); ctx.set('Content-Type', 'application/x-xls');
ctx.set('Content-disposition', 'attachment; filename=' + encodeURI(fileName)); ctx.set('Content-disposition', 'attachment; filename=' + encodeURI(fileName));

39
code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js

@ -3,16 +3,34 @@ const fs = require('fs');
const moment = require('moment') const moment = require('moment')
async function edit (ctx, next) { async function edit (ctx, next) {
let errMsg = '添加 NVR 设备失败'
const transaction = await ctx.fs.dc.orm.transaction(); const transaction = await ctx.fs.dc.orm.transaction();
try { try {
const models = ctx.fs.dc.models; const { utils: { getCameraLevel3ByStreamId } } = ctx.app.fs
const { models } = ctx.fs.dc;
const { userId } = ctx.fs.api const { userId } = ctx.fs.api
const data = ctx.request.body; const data = ctx.request.body;
const { serialNo } = data
const nvrGbRes = await models.GbCamera.findOne({
where: {
streamid: serialNo,
level: 0
}
})
if (!nvrGbRes) {
errMsg = '没有找到已接入的 NVR 服务信息'
throw errMsg
}
const channelRes = await getCameraLevel3ByStreamId(serialNo)
// 或取其他服务信息 // 或取其他服务信息
const nvrData = { const nvrData = {
channelCount: 8, channelCount: channelRes.length,
port: 8080, port: 8080,
sip: nvrGbRes.sipip,
} }
if (data.id) { if (data.id) {
@ -57,7 +75,13 @@ async function get (ctx) {
}, },
order: [ order: [
[orderBy || 'id', orderDirection || 'DESC'] [orderBy || 'id', orderDirection || 'DESC']
] ],
include: [{
model: models.GbCamera,
as: 'gbNvr',
// attributes: ['id', 'address', 'name', 'online'],
required: false
}]
} }
if (limit) { if (limit) {
findOption.limit = limit findOption.limit = limit
@ -183,6 +207,11 @@ async function detail (ctx) {
}, },
include: [{ include: [{
model: models.Vender model: models.Vender
}, {
model: models.GbCamera,
as: 'gbNvr',
// attributes: ['id', 'address', 'name', 'online', 'registerTime', 'updateTime'],
required: false
}] }]
}) })
@ -339,9 +368,9 @@ async function nvrExport (ctx) {
exportData.push(n) exportData.push(n)
} }
const filePath = await simpleExcelDown({ data: exportData, header, fileName: `NVR信息列表_${userId}_${moment().format('YYYYMMDDHHmmss')}` }) const fileName = `NVR信息列表_${userId}_${moment().format('YYYYMMDDHHmmss')}` + '.csv'
const filePath = await simpleExcelDown({ data: exportData, header, fileName: fileName })
const fileData = fs.readFileSync(filePath); const fileData = fs.readFileSync(filePath);
let fileName = filePath.split('/').pop()
ctx.status = 200; ctx.status = 200;
ctx.set('Content-Type', 'application/x-xls'); ctx.set('Content-Type', 'application/x-xls');
ctx.set('Content-disposition', 'attachment; filename=' + encodeURI(fileName)); ctx.set('Content-disposition', 'attachment; filename=' + encodeURI(fileName));

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

@ -39,6 +39,7 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
require('./models/camera_ability')(dc); require('./models/camera_ability')(dc);
require('./models/camera_kind')(dc); require('./models/camera_kind')(dc);
require('./models/camera')(dc); require('./models/camera')(dc);
require('./models/camera_ability_bind')(dc);
require('./models/nvr')(dc); require('./models/nvr')(dc);
require('./models/vender')(dc); require('./models/vender')(dc);
require('./models/secret_yingshi')(dc); require('./models/secret_yingshi')(dc);

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

@ -234,19 +234,6 @@ module.exports = dc => {
model: "cameraKind" model: "cameraKind"
} }
}, },
abilityId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "ability_id",
autoIncrement: false,
references: {
key: "id",
model: "cameraAbility"
}
},
yingshiSecretId: { yingshiSecretId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
@ -271,9 +258,5 @@ module.exports = dc => {
Camera.belongsTo(CameraKind, { foreignKey: 'kindId', targetKey: 'id' }); Camera.belongsTo(CameraKind, { foreignKey: 'kindId', targetKey: 'id' });
CameraKind.hasMany(Camera, { foreignKey: 'kindId', sourceKey: 'id' }); CameraKind.hasMany(Camera, { foreignKey: 'kindId', sourceKey: 'id' });
const CameraAbility = dc.models.CameraAbility;
Camera.belongsTo(CameraAbility, { foreignKey: 'abilityId', targetKey: 'id' });
CameraAbility.hasMany(Camera, { foreignKey: 'abilityId', sourceKey: 'id' });
return Camera; return Camera;
}; };

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

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

56
code/VideoAccess-VCMP/api/app/lib/models/camera_ability_bind.js

@ -0,0 +1,56 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const CameraAbilityBind = sequelize.define("cameraAbilityBind", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "camera_ability_bind_id_uindex"
},
cameraId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "camera_id",
autoIncrement: false,
references: {
key: "id",
model: "camera"
}
},
abilityId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "ability_id",
autoIncrement: false,
references: {
key: "id",
model: "cameraAbility"
}
}
}, {
tableName: "camera_ability_bind",
comment: "",
indexes: []
});
dc.models.CameraAbilityBind = CameraAbilityBind;
const Camera = dc.models.Camera;
const CameraAbility = dc.models.CameraAbility;
Camera.belongsToMany(CameraAbility, { through: CameraAbilityBind, foreignKey: 'cameraId', otherKey: 'abilityId' });
return CameraAbilityBind;
};

279
code/VideoAccess-VCMP/api/app/lib/models/gb_camera.js

@ -2,141 +2,146 @@
'use strict'; 'use strict';
module.exports = dc => { module.exports = dc => {
const DataTypes = dc.ORM; const DataTypes = dc.ORM;
const sequelize = dc.orm; const sequelize = dc.orm;
const GbCamera = sequelize.define("gbCamera", { const GbCamera = sequelize.define("gbCamera", {
id: { id: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: true, primaryKey: true,
field: "id", field: "id",
autoIncrement: true, autoIncrement: true,
unique: "gbcamera_id_uindex" unique: "gbcamera_id_uindex"
}, },
level: { level: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "level", field: "level",
autoIncrement: false autoIncrement: false
}, },
parent: { parent: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "parent", field: "parent",
autoIncrement: false autoIncrement: false
}, },
streamid: { streamid: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "streamid", field: "streamid",
autoIncrement: false autoIncrement: false
}, },
registerTime: { registerTime: {
type: DataTypes.DATEONLY, type: DataTypes.DATEONLY,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "registerTime", field: "registerTime",
autoIncrement: false autoIncrement: false
}, },
updateTime: { updateTime: {
type: DataTypes.DATEONLY, type: DataTypes.DATEONLY,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "updateTime", field: "updateTime",
autoIncrement: false autoIncrement: false
}, },
online: { online: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "online", field: "online",
autoIncrement: false autoIncrement: false
}, },
manufactuer: { manufactuer: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "manufactuer", field: "manufactuer",
autoIncrement: false autoIncrement: false
}, },
model: { model: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "model", field: "model",
autoIncrement: false autoIncrement: false
}, },
civilCode: { civilCode: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "civilCode", field: "civilCode",
autoIncrement: false autoIncrement: false
}, },
adddress: { adddress: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "adddress", field: "adddress",
autoIncrement: false autoIncrement: false
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "name", field: "name",
autoIncrement: false autoIncrement: false
}, },
addr: { addr: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "Addr", field: "Addr",
autoIncrement: false autoIncrement: false
}, },
sipip: { sipip: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "Sipip", field: "Sipip",
autoIncrement: false autoIncrement: false
} }
}, { }, {
tableName: "gbCamera", tableName: "gbCamera",
comment: "", comment: "",
indexes: [] indexes: []
}); });
dc.models.GbCamera = GbCamera; dc.models.GbCamera = GbCamera;
return GbCamera;
const Nvr = dc.models.Nvr;
Nvr.belongsTo(GbCamera, { foreignKey: 'serialNo', targetKey: 'streamid', as: 'gbNvr' });
GbCamera.hasMany(Nvr, { foreignKey: 'serialNo', sourceKey: 'streamid', as: 'gbNvr' });
return GbCamera;
}; };

244
code/VideoAccess-VCMP/api/app/lib/models/nvr.js

@ -2,127 +2,127 @@
'use strict'; 'use strict';
module.exports = dc => { module.exports = dc => {
const DataTypes = dc.ORM; const DataTypes = dc.ORM;
const sequelize = dc.orm; const sequelize = dc.orm;
const Nvr = sequelize.define("nvr", { const Nvr = sequelize.define("nvr", {
id: { id: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: true, primaryKey: true,
field: "id", field: "id",
autoIncrement: true, autoIncrement: true,
unique: "nvr_id_uindex" unique: "nvr_id_uindex"
}, },
name: { name: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "name", field: "name",
autoIncrement: false autoIncrement: false
}, },
venderId: { venderId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "设备厂家id", comment: "设备厂家id",
primaryKey: false, primaryKey: false,
field: "vender_id", field: "vender_id",
autoIncrement: false, autoIncrement: false,
references: { references: {
key: "id", key: "id",
model: "vender" model: "vender"
}
},
serialNo: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "设备编号",
primaryKey: false,
field: "serial_no",
autoIncrement: false
},
regionCode: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "行政区码",
primaryKey: false,
field: "region_code",
autoIncrement: false
},
longitude: {
type: DataTypes.DOUBLE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "longitude",
autoIncrement: false
},
latitude: {
type: DataTypes.DOUBLE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "latitude",
autoIncrement: false
},
createTime: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: sequelize.fn('now'),
comment: "创建时间",
primaryKey: false,
field: "create_time",
autoIncrement: false
},
channelCount: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "通道数",
primaryKey: false,
field: "channel_count",
autoIncrement: false
},
port: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "端口",
primaryKey: false,
field: "port",
autoIncrement: false
},
delete: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "delete",
autoIncrement: false
},
createUserId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_user_id",
autoIncrement: false
} }
}, }, {
serialNo: { tableName: "nvr",
type: DataTypes.STRING, comment: "",
allowNull: false, indexes: []
defaultValue: null, });
comment: "设备编号", dc.models.Nvr = Nvr;
primaryKey: false, return Nvr;
field: "serial_no",
autoIncrement: false
},
regionCode: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "行政区码",
primaryKey: false,
field: "region_code",
autoIncrement: false
},
longitude: {
type: DataTypes.DOUBLE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "longitude",
autoIncrement: false
},
latitude: {
type: DataTypes.DOUBLE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "latitude",
autoIncrement: false
},
createTime: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: sequelize.fn('now'),
comment: "创建时间",
primaryKey: false,
field: "create_time",
autoIncrement: false
},
channelCount: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "通道数",
primaryKey: false,
field: "channel_count",
autoIncrement: false
},
port: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "端口",
primaryKey: false,
field: "port",
autoIncrement: false
},
delete: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "delete",
autoIncrement: false
},
createUserId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_user_id",
autoIncrement: false
}
}, {
tableName: "nvr",
comment: "",
indexes: []
});
dc.models.Nvr = Nvr;
return Nvr;
}; };

2
code/VideoAccess-VCMP/api/app/lib/utils/xlsxDownload.js

@ -64,7 +64,7 @@ module.exports = function (app, opts) {
} }
} }
const savePath = path.join(fileDirPath, fileName + '.xlsx') const savePath = path.join(fileDirPath, fileName)
await new Promise(function (resolve, reject) { await new Promise(function (resolve, reject) {
file.saveAs() file.saveAs()
.pipe(fs.createWriteStream(savePath)) .pipe(fs.createWriteStream(savePath))

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

@ -26,7 +26,7 @@ module.exports = {
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: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
tables: ['gbCamera'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 tables: ['camera_ability_bind'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
skipTables: [], // 指定跳过哪些表的 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_',] ,长度较长的 前缀放前面

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/building.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

22
code/VideoAccess-VCMP/web/client/src/components/coming.jsx

@ -0,0 +1,22 @@
import React from "react";
const Coming = () => {
return (
<div style={{
height: 'calc(100% - 12px)', width: '100%', backgroundColor: '#fff',
display: 'flex', justifyContent: 'center', alignItems: 'center',
position: 'absolute',
}}>
<img
src='/assets/images/background/building.jpg'
style={{
maxHeight: 228,
maxWidth: 645,
width: '80%'
}}
/>
</div>
)
}
export default Coming

4
code/VideoAccess-VCMP/web/client/src/components/index.js

@ -1,6 +1,8 @@
'use strict'; 'use strict';
import SimpleFileDownButton from './simpleFileDownButton' import SimpleFileDownButton from './simpleFileDownButton'
import Coming from './coming'
export { export {
SimpleFileDownButton SimpleFileDownButton,
Coming
}; };

4
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/index.js

@ -2,4 +2,6 @@
import Nvr from './nvr'; import Nvr from './nvr';
import Camera from './camera'; import Camera from './camera';
export { Nvr,Camera }; import Recycle from './recycle'
export { Nvr, Camera, Recycle };

18
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/recycle.jsx

@ -0,0 +1,18 @@
import React from "react";
import { connect } from "react-redux";
import { Coming } from '$components'
const Recycle = () => {
return (
<Coming />
)
}
function mapStateToProps (state) {
const { auth } = state;
return {
user: auth.user,
};
}
export default connect(mapStateToProps)(Recycle);

23
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/nav-item.jsx

@ -2,15 +2,16 @@ import React from 'react';
import { IconCode } from '@douyinfe/semi-icons'; import { IconCode } from '@douyinfe/semi-icons';
export function getNavItem (user, dispatch) { export function getNavItem (user, dispatch) {
return ( return (
[ [
{ {
itemKey: 'equipmentWarehouse', text: '设备仓库', icon: <IconCode />, itemKey: 'equipmentWarehouse', text: '设备仓库', icon: <IconCode />,
items: [ items: [
{ itemKey: 'nvr', to: '/equipmentWarehouse/nvr', text: 'NVR管理' }, { itemKey: 'nvr', to: '/equipmentWarehouse/nvr', text: 'NVR管理' },
{ itemKey: 'camera', to: '/equipmentWarehouse/camera', text: '摄像头管理' }, { itemKey: 'camera', to: '/equipmentWarehouse/camera', text: '摄像头管理' },
] { itemKey: 'recycle', to: '/equipmentWarehouse/recycle', text: '回收站' },
}, ]
] },
); ]
);
} }

43
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/routes.js

@ -1,23 +1,28 @@
'use strict'; 'use strict';
import { Nvr,Camera } from './containers'; import { Nvr, Camera, Recycle } from './containers';
export default [{ export default [{
type: 'inner', type: 'inner',
route: { route: {
path: '/equipmentWarehouse', path: '/equipmentWarehouse',
key: 'equipmentWarehouse', key: 'equipmentWarehouse',
breadcrumb: '设备仓库', breadcrumb: '设备仓库',
// 不设置 component 则面包屑禁止跳转 // 不设置 component 则面包屑禁止跳转
childRoutes: [{ childRoutes: [{
path: '/nvr', path: '/nvr',
key: 'nvr', key: 'nvr',
component: Nvr, component: Nvr,
breadcrumb: 'NVR管理', breadcrumb: 'NVR管理',
},{ }, {
path: '/camera', path: '/camera',
key: 'camera', key: 'camera',
component: Camera, component: Camera,
breadcrumb: '摄像头管理', breadcrumb: '摄像头管理',
}] }, {
} path: '/recycle',
key: 'recycle',
component: Recycle,
breadcrumb: '回收站',
}]
}
}]; }];
Loading…
Cancel
Save