Browse Source

基础信息

master
wenlele 2 years ago
parent
commit
5f1967587e
  1. 3
      api/.vscode/launch.json
  2. 76
      api/app/lib/controllers/auth/index.js
  3. 30
      api/app/lib/index.js
  4. 56
      api/app/lib/models/department.js
  5. 105
      api/app/lib/models/patrol_plan.js
  6. 55
      api/app/lib/models/patrol_record.js
  7. 79
      api/app/lib/models/point.js
  8. 97
      api/app/lib/models/project.js
  9. 44
      api/app/lib/models/resource.js
  10. 58
      api/app/lib/models/user.js
  11. 52
      api/app/lib/models/user_resource.js
  12. 4
      api/app/lib/models/user_token.js
  13. 26
      scripts/0.1/schema/0.1user.sql
  14. 22
      web/client/assets/images/map.svg
  15. BIN
      web/client/assets/images/monitor/end.png
  16. BIN
      web/client/assets/images/monitor/lower-left.png
  17. BIN
      web/client/assets/images/monitor/lower-right.png
  18. BIN
      web/client/assets/images/monitor/point.png
  19. BIN
      web/client/assets/images/monitor/pump-p.png
  20. BIN
      web/client/assets/images/monitor/pumpPP.png
  21. BIN
      web/client/assets/images/monitor/pumpPo.png
  22. BIN
      web/client/assets/images/number/good1.png
  23. BIN
      web/client/assets/images/number/good10.png
  24. BIN
      web/client/assets/images/number/good11.png
  25. BIN
      web/client/assets/images/number/good12.png
  26. BIN
      web/client/assets/images/number/good2.png
  27. BIN
      web/client/assets/images/number/good3.png
  28. BIN
      web/client/assets/images/number/good4.png
  29. BIN
      web/client/assets/images/number/good5.png
  30. BIN
      web/client/assets/images/number/good6.png
  31. BIN
      web/client/assets/images/number/good7.png
  32. BIN
      web/client/assets/images/number/good8.png
  33. BIN
      web/client/assets/images/number/good9.png
  34. BIN
      web/client/assets/images/number/problem1.png
  35. BIN
      web/client/assets/images/number/problem10.png
  36. BIN
      web/client/assets/images/number/problem11.png
  37. BIN
      web/client/assets/images/number/problem12.png
  38. BIN
      web/client/assets/images/number/problem2.png
  39. BIN
      web/client/assets/images/number/problem3.png
  40. BIN
      web/client/assets/images/number/problem4.png
  41. BIN
      web/client/assets/images/number/problem5.png
  42. BIN
      web/client/assets/images/number/problem6.png
  43. BIN
      web/client/assets/images/number/problem7.png
  44. BIN
      web/client/assets/images/number/problem8.png
  45. BIN
      web/client/assets/images/number/problem9.png
  46. 2
      web/client/index.html
  47. 2
      web/client/src/layout/containers/layout/index.js
  48. 1
      web/client/src/layout/containers/layout/index.less
  49. 1
      web/client/src/sections/auth/containers/login.js
  50. 72
      web/client/src/sections/bigScreen/components/amap.js
  51. 227
      web/client/src/sections/bigScreen/components/basis.js
  52. 2
      web/client/src/sections/bigScreen/components/basis.less
  53. 13
      web/client/src/sections/bigScreen/components/basis/left_1.js
  54. 27
      web/client/src/sections/bigScreen/components/basis/left_1.less
  55. 13
      web/client/src/sections/bigScreen/components/basis/left_2.js
  56. 23
      web/client/src/sections/bigScreen/components/basis/right_1.js
  57. 21
      web/client/src/sections/bigScreen/components/basis/right_1.less
  58. 80
      web/client/src/sections/bigScreen/components/basis/right_2.js
  59. 21
      web/client/src/sections/bigScreen/components/capacity.js
  60. 28
      web/client/src/sections/bigScreen/components/shuizhan_detail.js
  61. 9
      web/client/src/sections/bigScreen/containers/systemManagement.js
  62. 1
      web/package.json

3
api/.vscode/launch.json

@ -15,7 +15,8 @@
"args": [
"-p 4900",
//
"-g postgres://postgres:123456@10.8.30.166:5432/XunJian",
// "-g postgres://postgres:123456@10.8.30.39:5432/PumpStation",
"-g postgres://FashionAdmin:123456@10.8.30.156:5432/PumpStation",
//
// "--apiEmisUrl http://10.8.30.161:1111",
// "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",

76
api/app/lib/controllers/auth/index.js

@ -5,9 +5,9 @@ const MD5 = require('crypto-js/md5');
const moment = require('moment');
const uuid = require('uuid');
async function login(ctx, next) {
async function login (ctx, next) {
try {
const transaction = await ctx.fs.dc.orm.transaction();
// const transaction = await ctx.fs.dc.orm.transaction();
const models = ctx.fs.dc.models;
const params = ctx.request.body;
@ -16,66 +16,36 @@ async function login(ctx, next) {
where: {
username: params.username,
password: password,
delete: false,
enable: true
},
attributes: { exclude: ['password'] },
include: [{
attributes: ["resourceId"],
model: models.UserResource
}]
}
});
if (!userRes) {
ctx.status = 400;
ctx.body = {
"message": "账号或密码错误"
}
}
if (userRes)
if (userRes && !userRes.enable) {
ctx.status = 400;
ctx.body = { message: "该用户已被禁用" }
} else {
const token = uuid.v4();
let deptInfo = null;
if (userRes) {
const { departmentId } = userRes.dataValues;
deptInfo = await models.Department.findOne({
where: {
id: departmentId
}
})
}
if (!userRes) {
ctx.status = 400;
ctx.body = { message: "暂无登录权限,请联系管理员" }
return;
}
let userData = userRes.dataValues;
let userRslt = Object.assign(userData, {
const token = uuid.v4();
const userInfo = {
authorized: true,
token: token,
userResources: userRes ? userRes.userResources.map(r => r.resourceId) : [],
type: deptInfo ? deptInfo.type : '',
deptName: deptInfo ? deptInfo.name : '',
});
...userRes.dataValues,
token,
};
// 记录token
const expiredDay = 7;
const expired = moment().add(expiredDay, 'day').format('YYYY-MM-DD HH:mm:ss')
await models.UserToken.create({
token: token,
userInfo: userRslt,
expired: moment().add(30, 'days').format()
userInfo: userInfo,
expired: expired
});
ctx.status = 200;
ctx.body = userRslt;
ctx.body = userInfo;
} else {
ctx.status = 400;
ctx.body = {
"message": "账号或密码错误"
}
}
await transaction.commit();
// await transaction.commit();
} catch (error) {
await transaction.rollback();
// await transaction.rollback();
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
@ -84,7 +54,7 @@ async function login(ctx, next) {
}
}
async function varfiyCode(ctx) {
async function varfiyCode (ctx) {
try {
const { models } = ctx.fs.dc;
const { pushBySms, pushByEmail } = ctx.app.fs.utils
@ -134,7 +104,7 @@ async function varfiyCode(ctx) {
}
}
async function logout(ctx) {
async function logout (ctx) {
try {
const models = ctx.fs.dc.models;
const params = ctx.request.body;

30
api/app/lib/index.js

@ -53,25 +53,25 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
require(`./models/${filename}`)(dc)
});
const { Department, User, UserResource, Resource, Project, Point, PatrolPlan
} = dc.models;
// const { Department, User, UserResource, Resource, Project, Point, PatrolPlan
// } = dc.models;
UserResource.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' });
User.hasMany(UserResource, { foreignKey: 'userId', sourceKey: 'id' });
// UserResource.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' });
// User.hasMany(UserResource, { foreignKey: 'userId', sourceKey: 'id' });
UserResource.belongsTo(Resource, { foreignKey: 'resourceId', targetKey: 'code' });
Resource.hasMany(UserResource, { foreignKey: 'resourceId', sourceKey: 'code' });
Resource.hasMany(Resource, { foreignKey: 'parentResource', sourceKey: 'code' });
// UserResource.belongsTo(Resource, { foreignKey: 'resourceId', targetKey: 'code' });
// Resource.hasMany(UserResource, { foreignKey: 'resourceId', sourceKey: 'code' });
// Resource.hasMany(Resource, { foreignKey: 'parentResource', sourceKey: 'code' });
User.belongsTo(Department, { foreignKey: 'departmentId', targetKey: 'id' });
Department.hasMany(User, { foreignKey: 'departmentId', sourceKey: 'id' });
// User.belongsTo(Department, { foreignKey: 'departmentId', targetKey: 'id' });
// Department.hasMany(User, { foreignKey: 'departmentId', sourceKey: 'id' });
Point.belongsTo(Project, { foreignKey: 'projectId', targetKey: 'id' });
Project.hasMany(Point, { foreignKey: 'projectId', sourceKey: 'id' });
// Point.belongsTo(Project, { foreignKey: 'projectId', targetKey: 'id' });
// Project.hasMany(Point, { foreignKey: 'projectId', sourceKey: 'id' });
PatrolPlan.belongsTo(Project, { foreignKey: 'structureId', targetKey: 'id' });
Project.hasMany(PatrolPlan, { foreignKey: 'structureId', sourceKey: 'id' });
// PatrolPlan.belongsTo(Project, { foreignKey: 'structureId', targetKey: 'id' });
// Project.hasMany(PatrolPlan, { foreignKey: 'structureId', sourceKey: 'id' });
PatrolPlan.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' });
User.hasMany(PatrolPlan, { foreignKey: 'userId', sourceKey: 'id' });
// PatrolPlan.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' });
// User.hasMany(PatrolPlan, { foreignKey: 'userId', sourceKey: 'id' });
};

56
api/app/lib/models/department.js

@ -1,56 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Department = sequelize.define("department", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "department_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
dependence: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "上级部门/从属",
primaryKey: false,
field: "dependence",
autoIncrement: false
},
type: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "",
primaryKey: false,
field: "type",
autoIncrement: false
}
}, {
tableName: "department",
comment: "",
indexes: []
});
dc.models.Department = Department;
return Department;
};

105
api/app/lib/models/patrol_plan.js

@ -1,105 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const PatrolPlan = sequelize.define("PatrolPlan", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "patrol_plan_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
way: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "way",
autoIncrement: false
},
structureId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "structure_id",
autoIncrement: false
},
startTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "start_time",
autoIncrement: false
},
endTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "end_time",
autoIncrement: false
},
frequency: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "frequency",
autoIncrement: false
},
points: {
type: DataTypes.JSONB,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "points",
autoIncrement: false
},
userId: {
type: DataTypes.INTEGER,
allowNull: true,
comment: null,
primaryKey: false,
field: "user_id",
autoIncrement: false,
},
patrolCount: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0,
comment: null,
primaryKey: false,
field: "patrol_count",
autoIncrement: false
},
}, {
tableName: "patrol_plan",
comment: "",
indexes: []
});
dc.models.PatrolPlan = PatrolPlan;
return PatrolPlan;
};

55
api/app/lib/models/patrol_record.js

@ -1,55 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const PatrolRecord = sequelize.define("PatrolRecord", {
id: {
field: "id",
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
patrolPlanId: {
field: "patrol_plan_id",
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: false,
autoIncrement: false
},
lastInspectionTime: {
field: "last_inspection_time",
type: DataTypes.DATE,
allowNull: true,
},
inspectionTime: {
field: "inspection_time",
type: DataTypes.DATE,
allowNull: true,
},
points: {
field: "points",
type: DataTypes.JSONB,
allowNull: true,
},
alarm: {
field: "alarm",
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
pointId: {
field: "point_id",
type: DataTypes.INTEGER,
allowNull: false,
},
}, {
tableName: "patrol_record",
comment: "",
indexes: []
});
dc.models.PatrolRecord = PatrolRecord;
return PatrolRecord;
};

79
api/app/lib/models/point.js

@ -1,79 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Point = sequelize.define("point", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "point_id_uindex"
},
projectId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "project_id",
autoIncrement: false
},
name: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
longitude: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "longitude",
autoIncrement: false
},
latitude: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "latitude",
autoIncrement: false
},
describe: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "describe",
autoIncrement: false
},
qrCode: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "qr_code",
autoIncrement: false
},
}, {
tableName: "point",
comment: "",
indexes: []
});
dc.models.Point = Point;
return Point;
};

97
api/app/lib/models/project.js

@ -1,97 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Project = sequelize.define("project", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "project_id_uindex"
},
img: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "img",
autoIncrement: false
},
userId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "user_id",
autoIncrement: false
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
type: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "type",
autoIncrement: false
},
longitude: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "longitude",
autoIncrement: false
},
latitude: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "latitude",
autoIncrement: false
},
describe: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "describe",
autoIncrement: false
},
qrCode: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "qr_code",
autoIncrement: false
},
}, {
tableName: "project",
comment: "",
indexes: []
});
dc.models.Project = Project;
return Project;
};

44
api/app/lib/models/resource.js

@ -1,44 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Resource = sequelize.define("resource", {
code: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "code",
autoIncrement: false,
unique: "resource_code_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false,
unique: "resource_name_uindex"
},
parentResource: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "parent_resource",
autoIncrement: false
}
}, {
tableName: "resource",
comment: "",
indexes: []
});
dc.models.Resource = Resource;
return Resource;
};

58
api/app/lib/models/user.js

@ -13,7 +13,7 @@ module.exports = dc => {
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "user_id_uindex"
unique: "t_user_id_uindex"
},
name: {
type: DataTypes.STRING,
@ -42,62 +42,8 @@ module.exports = dc => {
field: "password",
autoIncrement: false
},
departmentId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "部门id",
primaryKey: false,
field: "department_id",
autoIncrement: false
},
email: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "email",
autoIncrement: false
},
enable: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: "启用状态",
primaryKey: false,
field: "enable",
autoIncrement: false
},
delete: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "delete",
autoIncrement: false
},
phone: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "手机号(小程序使用手机号登录)",
primaryKey: false,
field: "phone",
autoIncrement: false
},
post: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "职位",
primaryKey: false,
field: "post",
autoIncrement: false
}
}, {
tableName: "user",
tableName: "t_user",
comment: "",
indexes: []
});

52
api/app/lib/models/user_resource.js

@ -1,52 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const UserResource = sequelize.define("userResource", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "post_resource_id_uindex"
},
userId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "user_id",
autoIncrement: false,
references: {
key: "id",
model: "post"
}
},
resourceId: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "resource",
autoIncrement: false,
references: {
key: "code",
model: "resource"
}
}
}, {
tableName: "user_resource",
comment: "",
indexes: []
});
dc.models.UserResource = UserResource;
return UserResource;
};

4
api/app/lib/models/user_token.js

@ -13,7 +13,7 @@ module.exports = dc => {
primaryKey: true,
field: "token",
autoIncrement: false,
unique: "user_token_token_uindex"
unique: "t_user_token_token_uindex"
},
userInfo: {
type: DataTypes.JSONB,
@ -34,7 +34,7 @@ module.exports = dc => {
autoIncrement: false
}
}, {
tableName: "user_token",
tableName: "t_user_token",
comment: "",
indexes: []
});

26
scripts/0.1/schema/0.1user.sql

@ -0,0 +1,26 @@
create table t_user
(
id serial not null
constraint t_user_pk
primary key,
name varchar(255),
username varchar(255) not null,
password varchar(255) not null
);
comment on table t_user is '用户表';
comment on column t_user.id is '唯一标识';
comment on column t_user.name is '姓名';
comment on column t_user.username is '用户名';
comment on column t_user.password is '密码';
create unique index t_user_id_uindex
on t_user (id);
INSERT INTO public.t_user (id, name, username, password) VALUES (DEFAULT, '超级管理员', 'SuperAdmin', 'e10adc3949ba59abbe56e057f20f883e')

22
web/client/assets/images/map.svg

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="517px" height="786px" viewBox="0 0 517 786" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>南昌县</title>
<defs>
<polygon id="path-1" points="1.93609023 484.689655 0 494.344828 5.80827068 511.724138 11.6165414 525.241379 27.1052632 542.62069 32.9135338 563.862069 13.5526316 629.517241 40.6578947 656.551724 44.5300752 664.275862 48.4022556 683.586207 56.1466165 699.034483 56.1466165 714.482759 50.3383459 729.931034 63.8909774 745.37931 71.6353383 762.758621 79.3796992 758.896552 98.7406015 729.931034 102.612782 733.793103 104.548872 745.37931 112.293233 741.517241 110.357143 739.586207 114.229323 731.862069 120.037594 731.862069 127.781955 741.517241 129.718045 739.586207 147.142857 749.241379 149.078947 747.310345 152.951128 756.965517 149.078947 762.758621 145.206767 762.758621 141.334586 770.482759 143.270677 772.413793 158.759398 776.275862 166.503759 772.413793 174.24812 756.965517 185.864662 762.758621 191.672932 772.413793 199.417293 772.413793 201.353383 766.62069 209.097744 768.551724 220.714286 764.689655 226.522556 756.965517 234.266917 753.103448 265.244361 760.827586 272.988722 774.344828 288.477444 784 282.669173 756.965517 286.541353 749.241379 292.349624 745.37931 290.413534 739.586207 272.988722 737.655172 265.244361 731.862069 265.244361 716.413793 253.62782 718.344828 249.755639 714.482759 251.691729 697.103448 236.203008 691.310345 222.650376 673.931034 218.778195 664.275862 220.714286 644.965517 228.458647 633.37931 228.458647 608.275862 220.714286 592.827586 220.714286 581.241379 228.458647 579.310345 236.203008 558.068966 245.883459 558.068966 253.62782 561.931034 261.37218 554.206897 272.988722 556.137931 271.052632 560 288.477444 565.793103 307.838346 579.310345 313.646617 579.310345 321.390977 573.517241 331.071429 558.068966 336.879699 538.758621 336.879699 505.931034 342.68797 490.482759 393.026316 455.724138 420.131579 422.896552 424.003759 409.37931 429.81203 407.448276 433.684211 399.724138 433.684211 393.931034 447.236842 390.068966 462.725564 393.931034 480.150376 384.275862 485.958647 361.103448 472.406015 361.103448 470.469925 353.37931 462.725564 349.517241 456.917293 334.068966 480.150376 310.896552 489.830827 291.586207 482.086466 274.206897 484.022556 270.344828 497.575188 258.758621 509.191729 254.896552 515 239.448276 511.12782 218.206897 499.511278 208.551724 493.703008 198.896552 478.214286 196.965517 464.661654 183.448276 445.300752 185.37931 439.492481 183.448276 435.620301 177.655172 431.74812 154.482759 437.556391 146.758621 437.556391 135.172414 429.81203 125.517241 433.684211 110.068966 441.428571 104.275862 451.109023 102.344828 470.469925 108.137931 493.703008 104.275862 476.278195 71.4482759 458.853383 63.7241379 456.917293 57.9310345 462.725564 44.4137931 453.045113 5.79310345 437.556391 0 431.74812 3.86206897 427.87594 15.4482759 412.387218 23.1724138 400.770677 23.1724138 373.665414 32.8275862 358.176692 75.3103448 342.68797 88.8275862 331.071429 84.9655172 323.327068 73.3793103 292.349624 90.7586207 284.605263 90.7586207 259.43609 77.2413793 251.691729 81.1034483 226.522556 110.068966 222.650376 142.896552 214.906015 144.827586 193.609023 139.034483 154.887218 171.862069 151.015038 179.586207 151.015038 189.241379 160.695489 195.034483 172.31203 196.965517 178.120301 204.689655 168.43985 212.413793 158.759398 225.931034 141.334586 235.586207 125.845865 260.689655 129.718045 266.482759 151.015038 256.827586 160.695489 256.827586 189.736842 268.413793 214.906015 268.413793 214.906015 272.275862 218.778195 272.275862 209.097744 280 203.289474 291.586207 203.289474 295.448276 209.097744 297.37931 197.481203 307.034483 187.800752 336 195.545113 337.931034 211.033835 361.103448 218.778195 364.965517 226.522556 361.103448 236.203008 347.586207 236.203008 366.896552 243.947368 374.62069 247.819549 384.275862 234.266917 401.655172 232.330827 409.37931 224.586466 411.310345 209.097744 426.758621 203.289474 428.689655 197.481203 428.689655 193.609023 420.965517 187.800752 426.758621 181.992481 420.965517 170.37594 426.758621 147.142857 415.172414 133.590226 419.034483 114.229323 413.241379 106.484962 417.103448 102.612782 428.689655 98.7406015 428.689655 96.8045113 419.034483 83.2518797 409.37931 85.1879699 405.517241 81.3157895 397.793103 77.443609 401.655172 50.3383459 393.931034 40.6578947 399.724138 32.9135338 392 25.1691729 390.068966 13.5526316 415.172414 11.6165414 451.862069 3.87218045 482.758621"></polygon>
<filter x="-1.7%" y="-1.1%" width="103.5%" height="102.3%" filterUnits="objectBoundingBox" id="filter-2">
<feMorphology radius="4" operator="erode" in="SourceAlpha" result="shadowSpreadInner1"></feMorphology>
<feGaussianBlur stdDeviation="6" in="shadowSpreadInner1" result="shadowBlurInner1"></feGaussianBlur>
<feOffset dx="0" dy="0" in="shadowBlurInner1" result="shadowOffsetInner1"></feOffset>
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
<feColorMatrix values="0 0 0 0 0.298570884 0 0 0 0 0.632037185 0 0 0 0 1 0 0 0 1 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
</filter>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="大屏-基础信息" transform="translate(-702.000000, -198.000000)">
<g id="南昌县" transform="translate(703.000000, 199.000000)">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
<use stroke="#C3E6FF" stroke-width="2" xlink:href="#path-1"></use>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
web/client/assets/images/monitor/end.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
web/client/assets/images/monitor/lower-left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
web/client/assets/images/monitor/lower-right.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
web/client/assets/images/monitor/point.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
web/client/assets/images/monitor/pump-p.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
web/client/assets/images/monitor/pumpPP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
web/client/assets/images/monitor/pumpPo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
web/client/assets/images/number/good1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
web/client/assets/images/number/good10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
web/client/assets/images/number/good11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
web/client/assets/images/number/good12.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
web/client/assets/images/number/good2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
web/client/assets/images/number/good3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
web/client/assets/images/number/good4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
web/client/assets/images/number/good5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
web/client/assets/images/number/good6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
web/client/assets/images/number/good7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
web/client/assets/images/number/good8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
web/client/assets/images/number/good9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
web/client/assets/images/number/problem1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
web/client/assets/images/number/problem10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
web/client/assets/images/number/problem11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
web/client/assets/images/number/problem12.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
web/client/assets/images/number/problem2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
web/client/assets/images/number/problem3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
web/client/assets/images/number/problem4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
web/client/assets/images/number/problem5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
web/client/assets/images/number/problem6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
web/client/assets/images/number/problem7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
web/client/assets/images/number/problem8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
web/client/assets/images/number/problem9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

2
web/client/index.html

@ -12,7 +12,7 @@
}
</script>
<script
src="https://webapi.amap.com/maps?v=2.0&key=00f9a29dedcdbd8befec3dfe0cef5003&plugin=AMap.AutoComplete,AMap.PlaceSearch"></script>
src="https://webapi.amap.com/maps?v=2.0&key=00f9a29dedcdbd8befec3dfe0cef5003&plugin=AMap.AutoComplete,AMap.PlaceSearch,aMap.DistrictSearch"></script>
<!-- <script src="https://webapi.amap.com/loca?v=2.0.0&key=00f9a29dedcdbd8befec3dfe0cef5003"></script> -->
</head>

2
web/client/src/layout/containers/layout/index.js

@ -34,7 +34,7 @@ const LayoutContainer = props => {
const resize_ = (collapsed) => {
const extraHeight = headerHeight + footerHeight;
console.log(document.body.clientHeight);
dispatch(resize(
document.body.clientHeight - extraHeight - 12,
document.body.clientWidth - (collapsed ? 120 : 220)

1
web/client/src/layout/containers/layout/index.less

@ -1,2 +1,3 @@
@import '~perfect-scrollbar/css/perfect-scrollbar.css';
@import '~nprogress/nprogress.css';
@import '~simplebar-react/dist/simplebar.min.css';

1
web/client/src/sections/auth/containers/login.js

@ -157,7 +157,6 @@ const Login = props => {
function mapStateToProps (state) {
const { auth, global } = state;
console.log(global);
return {
user: auth.user,
error: auth.error,

72
web/client/src/sections/bigScreen/components/amap.js

@ -1,36 +1,61 @@
import React, { useEffect, useState } from 'react';
let map = '';
const Amap = (props) => {
const Amap = ({ showData }) => {
const [mapComplete, setMapComplete] = useState(false);
useEffect(() => {
drawMap();
}, []);
useEffect(() => {
if (AMap && showData?.length) {
renderMarkers(showData)
}
}, [showData, AMap]);
const drawMap = () => {
try {
if (AMap) loadMap();
} catch (e) {
var script = document.createElement("script");
script.src = "https://webapi.amap.com/maps?v=2.0&key=00f9a29dedcdbd8befec3dfe0cef5003&plugin=AMap.AutoComplete,AMap.PlaceSearch";
script.src = "https://webapi.amap.com/maps?v=2.0&key=00f9a29dedcdbd8befec3dfe0cef5003&plugin=AMap.AutoComplete,AMap.PlaceSearch,AMap.Marker";
document.body.appendChild(script);
loadMap();
}
}
const loadMap = () => {
// 图片图层 实现瓦片地图中国地图样式 bounds 第一个点为左下角 第二个点为右上角
const imageLayer = new AMap.ImageLayer({
url: '/assets/images/map.svg',
bounds: new AMap.Bounds(
[115.800221, 28.265659],
[116.334849, 28.973298],
),
zooms: [3, 14],
});
map = new AMap.Map("amapId", {
resizeEnable: true,
center: [115.99255, 28.503617], // 地图中心点,初始定位加载显示楼块
zoom: 14, // 地图显示的缩放级别
zoom: 10.3, // 地图显示的缩放级别
zooms: [5, 20],
pitch: 0, // 地图俯仰角度,有效范围 0 度- 83 度
viewMode: '3D', // 地图模式
mapStyle: 'amap://styles/fb26776387242721c2fc32e2cb1daccc', // 主题样式
// rotation: 60
// showLabel: false
layers: [
AMap.createDefaultLayer(),
imageLayer,
],
});
map.on('complete', function () {
console.log("map-complete")
setMapComplete(true);
@ -38,8 +63,49 @@ const Amap = (props) => {
window.onload = function () {
console.log("window.onload")
}
};
const renderMarkers = (data) => {
// 初始层级 zoom14以下显示聚合点
// const data = [
// { lng: 116.117906, lat: 28.678096, name: 'ndjsa d dwqa', },
// ]
if (data?.length > 0) {
// map.clearMap();
map.setZoom(10.3)
map.setCenter([116.054664, 28.538966])
map.setPitch(22.9)
map.setRotation(1.7000)
data?.map((x, index) => {
let marker = new AMap.Marker({
position: new AMap.LngLat(x.lng, x.lat),
// 将一张图片的地址设置为 icon
icon: '/assets/images/monitor/point.png',
// 设置了 icon 以后,设置 icon 的偏移量,以 icon 的 [center bottom] 为原点
offset: new AMap.Pixel(-13, -30),
zooms: [5, 20],
title: x.name,
content: `<div style="position: relative;">
<img src="/assets/images/monitor/point.png" style="width:40px;height:60px;" />
<div style="background-image: url(/assets/images/monitor/pump-p.png);height:28px; white-space: nowrap;padding-right: 8px;
background-size: 100% 100%;background-position: center;background-repeat: no-repeat;color:#FFF;position: absolute;
top: 14px; left: 25px;line-height: 28px; text-indent: 14px">${x.name}</div>
</div>`
});
map.add(marker);
})
}
}
return <div style={{ width: '100%', height: '100%', }}>
<div id='amapId' style={{ width: '100%', height: '100%', background: "#101824" }} />
</div>

227
web/client/src/sections/bigScreen/components/basis.js

@ -1,47 +1,232 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import { Spin, Card, Modal, TreeSelect, message } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
import moment from 'moment'
import CardTitle from './public/cardTitle'
import SimpleBar from 'simplebar-react';
import Left_1 from './basis/left_1';
import Left_2 from './basis/left_2';
import Right_1 from './basis/right_1';
import Right_2 from './basis/right_2';
import { POWER_STATIONS } from './shuizhan_detail';
import './basis.less'
const Basis = ({ user, module, setModule }) => {
const Basis = ({ actions, dispatch, user, setshowData }) => {
useEffect(() => {
const { bigScreen } = actions
const [siteList, setSiteList] = useState([]) //站点列表
const [strucId, setStrucId] = useState() //站点ID
const [pageRefresh1, setPageRefresh1] = useState(false)
const [pageRefresh2, setPageRefresh2] = useState(false)
const [pageRefresh3, setPageRefresh3] = useState(false)
const [left2List, setleft2List] = useState([])
const [depthWater, setDepthWater] = useState([])
const [information, setInformation] = useState({})
const left1Data = useRef([])
const left2Data = useRef([])
const pumpNumber = useRef(0)
useEffect(async () => {
await dispatch(bigScreen.axyData({ type: 'get', url: `organizations/{orgId}/structures` })).then(async res => {
if (res.success) {
setSiteList(res.payload.data?.map(v => ({ value: v.id, label: v.name, latitude: v.latitude, longitude: v.longitude })) || [])
setshowData(res.payload.data?.map(v => ({ name: v.name, lat: v.latitude, lng: v.longitude })) || [])
setStrucId(res.payload.data[0]?.id)
for (let key in POWER_STATIONS) {
if (POWER_STATIONS[key]?.name == res.payload.data[0]?.name) {
setInformation(POWER_STATIONS[key])
}
}
//获取所有泵站的集水池液位
res.payload.data?.map(async v => {
await dispatch(bigScreen.axyData({ type: 'get', url: `structures/${v.id}/factors` })).then(async r => {
//泵站信息
let informationId = r.payload.data?.find(v => v.name == '泵站信息')?.id
if (informationId) {
await dispatch(bigScreen.axyData({
type: 'get', url: `structures/${v.id}/stations`,
params: { query: { factorId: informationId } }
})).then(async p => {
if (p.success) {
await dispatch(bigScreen.axyData({
type: 'get', url: `stations/theme/data`, params: {
query: {
stations: p.payload.data[0]?.groups[0]?.stations[0]?.id,
startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
limit: 1
}
}
})).then(async d => {
if (d.success) {
left1Data.current?.push({ name: v.name, level: d.payload.data?.stations[0]?.data[0]?.sLiquid_level || 0 })
setPageRefresh1(!pageRefresh1)
}
})
}
})
}
//水泵信息
let waterId = r.payload.data?.find(v => v.name == '泵站水泵')?.id
if (waterId) {
await dispatch(bigScreen.axyData({
type: 'get', url: `structures/${v.id}/stations`,
params: { query: { factorId: waterId } }
})).then(async p => {
if (p.success) {
pumpNumber.current += p.payload.data[0]?.groups[0]?.stations.length || 0
setPageRefresh3(!pageRefresh3)
let dataId = []
p.payload.data?.map(v => {
v.groups?.map(s => {
s.stations?.map(f => {
dataId.push(f.id)
})
})
})
if (dataId.length) {
// 当前时间
await dispatch(bigScreen.axyData({
type: 'get', url: `stations/theme/data`, params: {
query: {
stations: dataId.join(),
startTime: moment().startOf('day').format('YYYY:MM:DD HH:mm:ss'),
endTime: moment().endOf('day').format('YYYY:MM:DD HH:mm:ss'),
limit: 1
}
}
})).then(d => {
if (d.success) {
left2Data.current?.push({ name: v.name, data: d.payload.data?.stations })
setPageRefresh2(!pageRefresh2)
}
})
}
}
})
}
})
})
}
})
}, [])
const left1Data = [
{ name: '雄溪站站站站', level: 3 },
{ name: '雄溪站', level: 3 },
{ name: '雄溪站', level: 3 },
{ name: '雄溪站', level: 3 },
{ name: '雄溪站', level: 3 },
{ name: '雄溪站', level: 3 },
{ name: '雄溪站', level: 3 },
{ name: '雄溪站', level: 3 },
{ name: '雄溪站', level: 3 },
{ name: '雄溪站', level: 3 },
]
useEffect(async () => {
if (strucId) {
await dispatch(bigScreen.axyData({ type: 'get', url: `structures/${strucId}/factors` })).then(async r => {
//泵站信息
let informationId = r.payload.data?.find(v => v.name == '泵站信息')?.id
if (informationId) {
await dispatch(bigScreen.axyData({
type: 'get', url: `structures/${strucId}/stations`,
params: { query: { factorId: informationId } }
})).then(async p => {
if (p.success) {
await dispatch(bigScreen.axyData({
type: 'get', url: `stations/theme/data`, params: {
query: {
stations: p.payload.data[0]?.groups[0]?.stations[0]?.id,
startTime: moment().add(-24, 'hours').format('YYYY-MM-DD HH:mm:ss'),
endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
limit: 1440
}
}
})).then(async d => {
if (d.success) {
setDepthWater(d.payload.data?.stations[0]?.data)
}
})
}
})
}
})
}
}, [strucId])
return <div className='super-screen-body'>
<div className='super-screen-card left'>
<Left_1 data={left1Data} />
<Left_2 />
<Left_1 data={left1Data.current} />
<div className='card-item' style={{ height: '55%', minWidth: 350 }}>
<CardTitle title='水泵状态' />
<div className='card-content'>
<div style={{
width: '100%', height: 40,
backgroundImage: 'url(/assets/images/monitor/end.png)', backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat',
display: 'flex', alignItems: 'flex-end',
}}>
<div style={{ width: 80 }}>地点</div>
<div>编号</div>
</div>
<SimpleBar
style={{
// 容器高度
maxHeight: 'calc(100% - 50px)',
}}
// 允许的滚动方向
forceVisible="y"
>
{left2Data.current.map(v => <div style={{
display: 'flex', alignItems: 'center', marginTop: 6, width: '100%', height: 36,
backgroundImage: 'linear-gradient(180deg, #000e28e6 1%, #021f48cc 100%)'
}}>
<div style={{ width: 76, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', }}>{v.name}</div>
<div >
{v.data?.map((s, i) => <img style={{ width: 20, height: 20, marginLeft: 3 }} src={`/assets/images/number/${[2, 4, 6].includes(s.data[0]?.sMotor_State) ? 'good' : 'problem'}${i + 1}.png`} />)
}
</div>
</div>)}
</SimpleBar>
</div>
</div>
</div >
<div className='super-screen-card right'>
<Right_1 />
<Right_2 />
<Right_1 data={information} />
<Right_2 depthWater={depthWater} />
</div>
<div style={{ width: '40%', height: 30, display: 'flex', justifyContent: 'space-around', position: 'absolute', left: 'calc(30%)', bottom: 30, zIndex: 7 }}>
<div style={{
width: 170, height: 30, position: 'relative', textIndent: 50, lineHeight: '30px', color: 'white',
backgroundImage: 'url(/assets/images/monitor/lower-left.png)',
backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat',
}}>
<img style={{ width: 40, height: 40, position: 'absolute', left: 12, top: -18, }} src='/assets/images/monitor/pumpPO.png' />
泵站数量{siteList?.length || 0}
</div>
<div style={{
width: 170, height: 30, position: 'relative', textIndent: 50, lineHeight: '30px', color: 'white',
backgroundImage: 'url(/assets/images/monitor/lower-right.png)',
backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat',
}}>
<img style={{ width: 40, height: 40, position: 'absolute', left: 12, top: -18, }} src='/assets/images/monitor/pumpPP.png' />
提升泵数量{pumpNumber.current}
</div>
</div>
</div >
}
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,
clientHeight: global.clientHeight,
actions: global.actions,
};
}

2
web/client/src/sections/bigScreen/components/basis.less

@ -6,7 +6,7 @@
.super-screen-card {
position: absolute;
top: 100px;
width: 23%;
width: 26%;
height: calc(100% - 100px);
z-index: 7;
color: #fff;

13
web/client/src/sections/bigScreen/components/basis/left_1.js

@ -3,19 +3,24 @@ import CardTitle from '../public/cardTitle';
import '../basis.less';
import './left_1.less';
export default function Left_1(props) {
export default function Left_1 (props) {
const { data } = props;
return (
<div className='card-item' style={{ height: '40%' }}>
<div className='card-item' style={{ height: '40%', minWidth: 359 }}>
<CardTitle title='集水池液位' />
<div className='card-content liquid-level-content'>
{data?.map(d => <div className='liquid-level'>
{data?.map(d => <div style={{ width: 166, height: 86, display: 'inline-block' }}>
<div className='liquid-level'>
<img className='img' src='/assets/images/monitor/liquid-level.png' />
<div className='info'>
<div className='name'>{d.name}</div>
<div className='level'><span className='num'>{d.level}</span> m</div>
<div className='level'><span className='num'>{d.level?.toFixed(2) || 0}</span> m</div>
</div>
</div>
</div>)}
</div>
</div>
)

27
web/client/src/sections/bigScreen/components/basis/left_1.less

@ -1,40 +1,47 @@
.liquid-level-content {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
display: inline-block;
overflow-y: auto;
.liquid-level {
width: 46%;
width: 100%;
height: 80px;
display: flex;
justify-content: space-evenly;
align-items: center;
.img {
width: 84px;
height: 76px;
}
.info {
width: 101px;
width: 100px;
height: 80%;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
font-size: 1rem;
text-align: center;
font-family: D-DIN-Italic;
justify-content: space-around;
.name {
background-image: url(/assets/images/monitor/gradation-bg.svg);
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.level {
background-image: linear-gradient(90deg, #24396e00 2%, #24396e70 51%, #24396e00 100%);
background-image: linear-gradient(
90deg,
#24396e00 2%,
#24396e70 51%,
#24396e00 100%
);
width: 100%;
margin-top: 5px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
.num {
font-size: 1.25rem;

13
web/client/src/sections/bigScreen/components/basis/left_2.js

@ -1,13 +0,0 @@
import React from 'react';
import CardTitle from '../public/cardTitle';
import '../basis.less';
export default function Left_2(props) {
return (
<div className='card-item' style={{ height: '55%' }}>
<CardTitle title='水泵状态' />
<div className='card-content'></div>
</div>
)
}

23
web/client/src/sections/bigScreen/components/basis/right_1.js

@ -4,7 +4,8 @@ import { Select } from 'antd';
import '../basis.less';
import './right_1.less';
export default function Right_1(props) {
export default function Right_1 ({ data }) {
const renderSelect = () => {
return <Select
className='bigscreen-select'
@ -39,21 +40,21 @@ export default function Right_1(props) {
<div className='detail'>
<div className='detail-item'>
<div className='item pump-models'>
<div className='pump-models-value'>{'1200ZLB—160轴流泵'}</div>
<div className='pump-models-key'>水泵型号</div>
<div className='pump-models-value'>{data?.water_type}</div>
<div className='pump-models-key' >水泵型号</div>
</div>
</div>
<div className='detail-item'>
<div className='item'>
<div className='key'>电动机型号:</div>
<div className='value'>{'JsL10—12(210KW)'}</div>
<div className='value'>{data?.elc_type}</div>
</div>
<div className='line' />
</div>
<div className='detail-item'>
<div className='item'>
<div className='key'>变压器型号</div>
<div className='value'>{'s9—M315KVA、s9—M500KVA'}</div>
<div className='value'>{data?.by_type}</div>
</div>
<div className='line' />
</div>
@ -63,34 +64,34 @@ export default function Right_1(props) {
<div className='bottom-item'>
<div className='item'>
<div className='key'>类型:</div>
<div className='value'>{'排涝'}</div>
<div className='value'>{data?.func}</div>
</div>
<div className='vertical-line' />
<div className='item'>
<div className='key'>泵站规模:</div>
<div className='value'>{'630 (kw)'}</div>
<div className='value'>{data?.power} (kw)</div>
</div>
</div>
<div className='bottom-item'>
<div className='item'>
<div className='key'>机组数量</div>
<div className='value'>{'3台'}</div>
<div className='value'>{data?.num} </div>
</div>
<div className='vertical-line' />
<div className='item'>
<div className='key'>泵站建成时间</div>
<div className='value'>{'2004年'}</div>
<div className='value'>{data?.year?.split(',')[0]}</div>
</div>
</div>
<div className='bottom-item'>
<div className='item'>
<div className='key'>泵站除险加固时间</div>
<div className='value'>{'2024年'}</div>
<div className='value'>{data?.year?.split(',')[1]}</div>
</div>
<div className='vertical-line' />
<div className='item'>
<div className='key'>所属区域</div>
<div className='value'>{'象湖站'}</div>
<div className='value'>{data?.area}</div>
</div>
</div>
</div>

21
web/client/src/sections/bigScreen/components/basis/right_1.less

@ -23,6 +23,7 @@
justify-content: space-evenly;
.detail-item {
width: 100%;
height: 32%;
.item {
@ -37,14 +38,14 @@
font-family: SourceHanSansCN-Regular;
font-weight: 400;
font-size: 14px;
color: #C3E6FF;
color: #c3e6ff;
}
.value {
font-family: D-DIN;
font-weight: DIN;
font-size: 16px;
color: #FFFFFF;
color: #ffffff;
}
}
@ -54,21 +55,27 @@
}
.pump-models {
width: 100%;
background-image: url(/assets/images/monitor/pump-models-bg.svg);
background-size: cover;
.pump-models-value {
width: calc(100% - 60px);
font-family: YouSheBiaoTiHei;
font-size: 20px;
color: #FFFFFF;
color: #ffffff;
letter-spacing: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.pump-models-key {
width: 58px;
font-family: SourceHanSansCN-Medium;
font-weight: 500;
font-size: 12px;
color: #C3E6FF;
color: #c3e6ff;
letter-spacing: 0;
display: flex;
align-items: flex-end;
@ -104,13 +111,13 @@
font-family: SourceHanSansCN-Medium;
font-weight: 500;
font-size: 13px;
color: #63B0FF;
color: #63b0ff;
}
.value {
font-family: YouSheBiaoTiHei;
font-size: 16px;
color: #FFFFFF;
color: #ffffff;
}
}
@ -118,7 +125,7 @@
width: 2px;
height: 19px;
opacity: 0.45;
background-color: #5F82DC;
background-color: #5f82dc;
}
}
}

80
web/client/src/sections/bigScreen/components/basis/right_2.js

@ -1,12 +1,90 @@
import React from 'react';
import CardTitle from '../public/cardTitle';
import '../basis.less';
import ReactECharts from 'echarts-for-react';
import moment from 'moment'
export default function Right_2(props) {
export default function Right_2 ({ depthWater }) {
return (
<div className='card-item' style={{ height: '55%' }}>
<CardTitle title='泵站水位' />
<div className='card-content'>
<div style={{ height: 30, }}>
</div>
<ReactECharts
option={{
title: {
// text: v.name,
},
grid: {
left: '10%',
// right: '4%',
// bottom: '3%',
// containLabel: true
},
dataZoom: [
{
type: 'slider',
// startValue: depthWater?.map(v=>v.time)
},
{
type: 'inside',
},
],
tooltip: {
trigger: 'axis'
},
legend: {
data: ['集水池液位', '池前(上游)液位'],
right: '10%',
textStyle: {
color: '#FFF',
},
},
xAxis: {
type: 'category',
name: "时间",
boundaryGap: false,
data: depthWater?.map(v => moment(v.time).format('MM-DD HH:mm'))
},
yAxis: {
type: 'value',
name: "单位:M",
areaStyle: {
color: '#FFF',
},
},
series: [
{
type: 'line',
name: '集水池液位',
smooth: true,
areaStyle: {
color: '#0e9cff26',
},
data: depthWater?.map(v => v.sLiquid_level)
},
{
type: 'line',
name: '池前(上游)液位',
smooth: true,
areaStyle: {
color: '#0e9cff26',
},
data: depthWater?.map(v => v.sGrille_level)
},
]
}}
notMerge={true}
lazyUpdate={true}
theme={'ReactEChart'}
// onChartReady={this.onChartReadyCallback}
// onEvents={EventsDict}
// opts={}
/>
</div>
</div>

21
web/client/src/sections/bigScreen/components/capacity.js

@ -18,7 +18,6 @@ const Capacity = ({ actions, dispatch, user, }) => {
useEffect(() => {
dispatch(bigScreen.axyData({ type: 'get', url: `organizations/{orgId}/structures` })).then(res => {
// console.log(res);
if (res.success) {
setSiteList(res.payload.data?.map(v => ({ value: v.id, label: v.name })) || [])
setStrucId(res.payload.data[0]?.id)
@ -123,7 +122,6 @@ const Capacity = ({ actions, dispatch, user, }) => {
let find2 = month?.find(c => c.id == u.id)
let find3 = year?.find(c => c.id == u.id)
// console.log(find1);
pumpSun.push({
today: u?.data[0]?.eMotor_EQ && find1?.data[0]?.eMotor_EQ ? (u?.data[0]?.eMotor_EQ - find1?.data[0]?.eMotor_EQ) : '--',
sameMonth: u?.data[0]?.eMotor_EQ && find2?.data[0]?.eMotor_EQ ? (u?.data[0]?.eMotor_EQ - find2?.data[0]?.eMotor_EQ) : '--',
@ -227,7 +225,7 @@ const Capacity = ({ actions, dispatch, user, }) => {
let find2 = month?.find(c => c.id == u.id)
let find3 = year?.find(c => c.id == u.id)
// console.log(find1);
cabinetSun.push({
today: u?.data[0]?.eQF_EQ && find1?.data[0]?.eQF_EQ ? (u?.data[0]?.eQF_EQ - find1?.data[0]?.eQF_EQ) : '--',
sameMonth: u?.data[0]?.eQF_EQ && find2?.data[0]?.eQF_EQ ? (u?.data[0]?.eQF_EQ - find2?.data[0]?.eQF_EQ) : '--',
@ -284,21 +282,6 @@ const Capacity = ({ actions, dispatch, user, }) => {
})
}
await dispatch(bigScreen.axyData({
type: 'get', url: `stations/theme/data`, params: {
query: {
stations: 56643,
startTime: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
endTime: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
limit: 1
}
}
})).then(d => {
if (d.success) {
}
})
setPumpData(pump)
setCabinetData(cabinetSun)
@ -358,7 +341,7 @@ const Capacity = ({ actions, dispatch, user, }) => {
<div style={{
width: 50, height: 26, background: '#a7110033', border: '1px solid #A71100', cursor: "pointer",
borderRadius: 4, color: ' #E83E2B', textAlign: 'center', lineHeight: '22px', marginRight: 10
}}>{[1, 3, 5].includes(v.data[0]?.sMotor_RunMode) ? '启动' : [2, 4, 7].includes(v.data[0]?.sMotor_RunMode) ? '停止' : v.data[0]?.sMotor_RunMode == 7 ? '故障' : '无状态'}</div>
}}>{[1, 3, 5].includes(v.data[0]?.sMotor_RunMode) ? '停止' : [2, 4, 6].includes(v.data[0]?.sMotor_RunMode) ? '运行' : v.data[0]?.sMotor_RunMode == 7 ? '故障' : '无状态'}</div>
</div>
<div style={{ background: 'linear-gradient(180deg, #000e28e6 1%, #021f48cc 100%)' }}>
<Carousel style={{ width: '100%', height: 66 }} autoplay>

28
web/client/src/sections/bigScreen/components/shuizhan_detail.js

@ -0,0 +1,28 @@
const POWER_STATIONS = {
'象湖站': { area: '象湖站', name: '象湖电排站', func: '排涝', power: 1050, num: 5, elc_type: 'JsL10—12(210KW)', water_type: '1200ZLB—160轴流泵', by_type: 's9—M500KVA、s9—M800KVA', year: ' 2008年, 空', rightTo: '县城管局', managerUnit: '南昌县象湖联圩管理站', managers: '胡铁根、陈江、陈亮', costFrom: '南昌县象湖联圩管理站', remark: '空' },
'沥山站': { area: '象湖站', name: '沥山电排站', func: '排涝', power: 1680, num: 8, elc_type: 'JsL10—12(210KW)', water_type: '1200ZLB—160轴流泵', by_type: 's9—M1000KVA/2', year: ' 2004年, 空', rightTo: '县城管局', managerUnit: '南昌县象湖联圩管理站', managers: '宗磊、李文章、熊大方', costFrom: '南昌县象湖联圩管理站', remark: '空' },
'雄溪站': { area: '象湖站', name: '雄溪电排站', func: '排涝', power: 630, num: 3, elc_type: 'JsL10—12(210KW)', water_type: '1200ZLB—160轴流泵', by_type: 's9—M315KVA、s9—M500KVA', year: ' 2004年, 空', rightTo: '县城管局', managerUnit: '南昌县象湖联圩管理站', managers: '涂三毛、刘文红彭伟红、童珊玲、李跃兰(县聘泵站值守人员)', costFrom: '南昌县象湖联圩管理站', remark: '空' },
'张坊站': { area: '象湖站', name: '张坊电排站', func: '排涝', power: 2500, num: 5, elc_type: 'YL630-16/1430(500KW)', water_type: '1400ZLB-5立式半调节轴流泵', by_type: 'SCB11-160/10/0.4', year: ' 2020年, 空', rightTo: '县城管局', managerUnit: '还未明确管理单位,由水利局代管', managers: '康玉明、赵先福、殷长和、肖玉平', costFrom: '水利局垫付', remark: '工资发放至2021年12月止' },
'万寿湖站': { area: '象湖站', name: '万寿湖电排站', func: '排涝', power: 660, num: 3, elc_type: 'JsL14—12(220KW)', water_type: '1000ZLB-5立式半调节轴流泵', by_type: 'SCB11-1000/10/0.4、SCB11-80/10/0.4', year: ' 2020年, 空', rightTo: '县城管局', managerUnit: '还未明确管理单位,由水利局代管', managers: '夏小生、王刚', costFrom: '水利局垫付', remark: '工资发放至2021年12月止' },
'八月湖站': { area: '东新乡', name: '八月湖一站', func: '排灌结合', power: 840, num: 4, elc_type: 'JSL12—14', water_type: '1000ZLB—4轴流泵', by_type: 'S91000KVA', year: ' 1974年, 2009年', rightTo: '县城管局', managerUnit: '东新乡', managers: '邓重志、熊春华、邓仁凯、邓小玉、邓必华', costFrom: '由排灌站直接在乡财务办理缴费', remark: '空' },
'新八月湖站': { area: '东新乡', name: '八月湖二站', func: '纯排', power: 1050, num: 5, elc_type: 'JSL12—14', water_type: '1000ZLB—4轴流泵', by_type: 'S9800KVA2', year: ' 1985.4年, 2009年', rightTo: '县城管局', managerUnit: '东新乡', managers: '邓重志、熊春华、邓仁凯、邓小玉、邓必华', costFrom: '由排灌站直接在乡财务办理缴费', remark: '空' },
'河下站': { area: '东新乡', name: '河下电排站', func: '排灌结合', power: 320, num: 4, elc_type: 'Y—200T—4', water_type: 'ZLB28—70轴流泵', by_type: 'S9315KVA', year: ' 1972年, 1987年', rightTo: '县城管局', managerUnit: '河下村', managers: '万增福', costFrom: '由河下村排灌站直接缴费', remark: '空' },
'石岐站': { area: '东新乡', name: '石岐电排站', func: '排灌结合', power: 340, num: 3, elc_type: 'Y—200T—4', water_type: 'ZLB28—70轴流泵', by_type: 'S9315KVA', year: ' 1974年, 1988年', rightTo: '县城管局', managerUnit: '石岐村', managers: '万象保', costFrom: '由石岐村排灌站直接缴费', remark: '空' },
'东新乡': { area: '东新乡', name: '利用姚家塘电排站', func: '排灌结合', power: 240, num: 3, elc_type: 'Y—200T—4', water_type: 'ZLB28—70轴流泵', by_type: 'S9315KVA', year: ' 1974年, 1992年', rightTo: '县城管局', managerUnit: '利用村', managers: '蒋淑仁', costFrom: '由利用村排灌站直接缴费', remark: '空' },
'东新乡': { area: '东新乡', name: '汇仁大道排水泵站', func: '纯排', power: 260, num: 2, elc_type: 'Y67—130kw', water_type: '20ZLB—70轴流泵', by_type: '315KVA箱式变压器', year: ' 2014年, 空', rightTo: '县城管局', managerUnit: '东新乡', managers: '蒋国冬', costFrom: '由乡水管站直接垂管缴费', remark: '空' },
'东新乡': { area: '东新乡', name: '小洲杨家湾电排站', func: '纯排', power: 60, num: 2, elc_type: 'Y—200T—4', water_type: 'ZLB28—70轴流泵', by_type: '80KVA箱式变压器', year: ' 2013年, 空', rightTo: '县城管局', managerUnit: '东新乡', managers: '胡又莲', costFrom: '由乡水管站直接垂管缴费', remark: '空' },
'东新乡': { area: '东新乡', name: '石岐补水站', func: '灌溉', power: 260, num: 2, elc_type: 'Y67—130kw', water_type: '20ZLB—70轴流泵', by_type: 'S9_315KVA变压器', year: ' 2014年, 空', rightTo: '县城管局', managerUnit: '东新乡', managers: '万和全', costFrom: '由乡水管站直接垂管缴费', remark: '空' },
'象湖一号闸': { area: '东新乡', name: '象湖南电排站', func: '纯排', power: 60, num: 2, elc_type: 'Y—200T—4', water_type: 'ZLB28—70轴流泵', by_type: '80KVA箱式变压器', year: ' 2013年, 空', rightTo: '县城管局', managerUnit: '东新乡', managers: '陶小弟', costFrom: '由乡水管站直接垂管缴费', remark: '空' },
'东新乡': { area: '东新乡', name: '东莲路节制闸', func: '排涝', power: '空', num: '空', elc_type: '空', water_type: '空', by_type: '空', year: ' 2009年, 空', rightTo: '县城管局', managerUnit: '东新乡', managers: '蒋永新', costFrom: '由乡水管站直接垂管缴费', remark: '调节东莲路景观明渠水位' },
'三山站': { area: '富山乡', name: '三山电排站', func: '排涝', power: 390, num: 3, elc_type: '空', water_type: '空', by_type: '空', year: ' 1973年, 2008年', rightTo: '县城管局', managerUnit: '三山村村委会', managers: '空', costFrom: '富山乡', remark: '空' },
'河外泵站': { area: '富山乡', name: '河外电排站站', func: '排涝', power: 90, num: 2, elc_type: '空', water_type: '空', by_type: '空', year: ' 1984年, 2021年', rightTo: '县城管局', managerUnit: '三山村村委会', managers: '空', costFrom: '富山乡', remark: '空' },
'东山站': { area: '富山乡', name: '东山电排站', func: '排涝', power: 2010, num: 12, elc_type: '6台180、6台155', water_type: '空', by_type: '1250、1650', year: ' 1983年, 2008年', rightTo: '富山乡', managerUnit: '富山乡', managers: '空', costFrom: '富山乡', remark: '排涝能力偏小' },
'河口电排站': { area: '县城投', name: '河口电排站', func: '排涝', power: 6250, num: 5, elc_type: 'TL1250-30/2600(12500KW)', water_type: '2050ZLQ轴流泵', by_type: 'SCB11-630/10/0.4(2台)', year: ' 2021年, 空', rightTo: '县城管局', managerUnit: '县城投公司', managers: '空', costFrom: '县城投公司', remark: '空' },
'县城投': { area: '县城投', name: '芳湖路提升泵站', func: '排涝', power: 225, num: 3, elc_type: 'Y2-315M-8(75KW)', water_type: 'ZLDB-立式单基础轴流泵', by_type: 'ZGS13-200KVA、ZGS13-400KVA', year: ' 2019年, 空', rightTo: '县城管局', managerUnit: '还未明确管理单位,由工人代管', managers: '廖良斌', costFrom: '县城投公司', remark: '空' },
'县城投': { area: '县城投', name: '三干渠富山大道闸', func: '控制闸', power: '空', num: 2, elc_type: '空', water_type: '空', by_type: '空', year: ' 2018年, 空', rightTo: '县城管局', managerUnit: '县城投公司(水投公司)', managers: '葛江波', costFrom: '县城投公司(水投公司)', remark: '空' },
'县城投': { area: '县城投', name: '三干渠银湖二路明渠闸', func: '控制闸', power: '空', num: 2, elc_type: '空', water_type: '空', by_type: '空', year: ' 2018年, 空', rightTo: '县城管局', managerUnit: '县城投公司(水投公司)', managers: '葛江波', costFrom: '县城投公司(水投公司)', remark: '空' },
'县城投': { area: '县城投', name: '三干渠汇仁大道明渠闸', func: '控制闸', power: '空', num: 2, elc_type: '空', water_type: '空', by_type: '空', year: ' 2018年, 空', rightTo: '县城管局', managerUnit: '县城投公司(水投公司)', managers: '葛江波', costFrom: '县城投公司(水投公司)', remark: '空' },
}
export { POWER_STATIONS }

9
web/client/src/sections/bigScreen/containers/systemManagement.js

@ -15,7 +15,8 @@ const TreeNode = Tree.TreeNode;
const SystemManagement = ({ clientHeight, user, history }) => {
const [module, setModule] = useState('capacity')
const [module, setModule] = useState('basis')
const [showData, setshowData] = useState([])
useEffect(() => {
}, [])
@ -33,8 +34,8 @@ const SystemManagement = ({ clientHeight, user, history }) => {
<Header module={module} setModule={setModule} history={history} />
</div>
{module == 'basis' ? <>
<div className='map'><Amap /></div>
<Basis />
<div className='map' ><Amap showData={showData} /></div>
<Basis setshowData={setshowData} />
</> : ""}
{module == 'capacity' ? <Capacity /> : ""}
{module == 'electrical' ? <Electrical /> : ""}
@ -43,7 +44,7 @@ const SystemManagement = ({ clientHeight, user, history }) => {
)
}
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,

1
web/package.json

@ -100,6 +100,7 @@
"react-router-breadcrumbs-hoc": "^4.0.1",
"react-sortable-hoc": "^2.0.0",
"shortid": "^2.2.16",
"simplebar-react": "^3.2.4",
"superagent": "^6.1.0",
"uuid": "^8.3.1",
"webpack-dev-server": "^3.11.2",

Loading…
Cancel
Save