ww664853070 2 years ago
parent
commit
ca4f25770c
  1. 6
      api/.vscode/launch.json
  2. 21
      api/app/lib/controllers/auth/index.js
  3. 63
      api/app/lib/controllers/data/assess.js
  4. 59
      api/app/lib/controllers/data/videoCenter.js
  5. 65
      api/app/lib/controllers/organization/depUsers.js
  6. 38
      api/app/lib/controllers/report/index.js
  7. 5
      api/app/lib/index.js
  8. 50
      api/app/lib/middlewares/business-rest.js
  9. 15
      api/app/lib/routes/data/index.js
  10. 2
      api/app/lib/routes/organization/index.js
  11. 4
      api/app/lib/routes/report/index.js
  12. 67
      api/app/lib/service/paasRequest.js
  13. 20
      api/config.js
  14. 40
      scripts/1.2.3/schema/1.create_assess.sql
  15. 14
      weapp/src/packages/components/inputPicker/index.jsx
  16. 3
      weapp/src/packages/patrol/index.jsx
  17. BIN
      web/client/assets/images/quanju/nodata.png
  18. 6
      web/client/src/components/index.js
  19. 52
      web/client/src/components/ysPlayerIframe.js
  20. 4
      web/client/src/layout/actions/global.js
  21. 4
      web/client/src/layout/components/header/index.js
  22. 2
      web/client/src/layout/components/sider/index.js
  23. 1
      web/client/src/layout/containers/layout/index.js
  24. 4
      web/client/src/layout/index.js
  25. 15
      web/client/src/layout/reducers/global.js
  26. 19
      web/client/src/sections/auth/containers/login.js
  27. 14
      web/client/src/sections/fillion/actions/allDepUsers.js
  28. 2
      web/client/src/sections/fillion/actions/assess.js
  29. 2
      web/client/src/sections/fillion/actions/index.js
  30. 108
      web/client/src/sections/fillion/components/assessModal.js
  31. 14
      web/client/src/sections/fillion/components/bridgeTable.js
  32. 290
      web/client/src/sections/fillion/components/maintenanceTable.js
  33. 290
      web/client/src/sections/fillion/components/patrolTable.js
  34. 15
      web/client/src/sections/fillion/components/transportationTable.js
  35. 155
      web/client/src/sections/fillion/containers/assess.js
  36. 41
      web/client/src/sections/fillion/containers/building.js
  37. 10
      web/client/src/sections/fillion/containers/index.js
  38. 30
      web/client/src/sections/fillion/containers/videoCenter.js
  39. 25
      web/client/src/sections/fillion/nav-item.js
  40. 52
      web/client/src/sections/fillion/routes.js
  41. 63
      web/client/src/sections/organization/containers/authority.js
  42. 39
      web/client/src/sections/organization/containers/user.js
  43. 3
      web/client/src/sections/organization/routes.js
  44. 48
      web/client/src/sections/quanju/actions/example.js
  45. 6
      web/client/src/sections/quanju/containers/example.js
  46. 109
      web/client/src/sections/quanju/containers/footer/conserve/left/left-center.js
  47. 162
      web/client/src/sections/quanju/containers/footer/conserve/right/right-center.js
  48. 163
      web/client/src/sections/quanju/containers/footer/conserve/right/right-top.js
  49. 17
      web/client/src/sections/quanju/containers/footer/leadership/index.js
  50. 205
      web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js
  51. 320
      web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js
  52. 202
      web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js
  53. 6
      web/client/src/sections/quanju/containers/footer/leadership/right/right-center.js
  54. 253
      web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js
  55. 14
      web/client/src/sections/quanju/containers/heand/index.js
  56. 10
      web/client/src/utils/webapi.js
  57. 13
      web/config.js
  58. 18
      web/package-lock.json
  59. 5
      web/package.json
  60. 4
      web/routes/attachment/index.js

6
api/.vscode/launch.json

@ -15,13 +15,15 @@
"args": [ "args": [
"-p 13400", "-p 13400",
"-f http://localhost:13400", "-f http://localhost:13400",
// "-g postgres://postgres:123@10.8.30.32:5432/highways4good", "-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728", //"-g postgres://FashionAdmin:123456@10.8.30.156:5432/highway4goodn0728",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",
"--qnbkt dev-highways4good", "--qnbkt dev-highways4good",
// "--qndmn http://resources.anxinyun.cn", // "--qndmn http://resources.anxinyun.cn",
"--qndmn http://rfkimpwbb.hn-bkt.clouddn.com", "--qndmn http://rfkimpwbb.hn-bkt.clouddn.com",
"--yingshiKey d0704fb9d5d14a6682c1c1d592c12512",
"--yingshiSecret 93d023269495b86be62cdfdcf34a6cd1"
] ]
}, },
{ {

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

@ -4,7 +4,7 @@ const MD5 = require('crypto-js/md5');
const moment = require('moment'); const moment = require('moment');
const uuid = require('uuid'); const uuid = require('uuid');
async function login(ctx, next) { async function login (ctx, next) {
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 models = ctx.fs.dc.models;
@ -77,7 +77,7 @@ async function login(ctx, next) {
* 微信小程序登录 * 微信小程序登录
* @@requires.body {phone-手机号, password-密码} ctx * @@requires.body {phone-手机号, password-密码} ctx
*/ */
async function wxLogin(ctx, next) { async function wxLogin (ctx, next) {
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 models = ctx.fs.dc.models;
@ -106,14 +106,27 @@ async function wxLogin(ctx, next) {
let userRslt = Object.assign({ let userRslt = Object.assign({
authorized: true, authorized: true,
loginSource: 'wx',
token: token, token: token,
...userRes.dataValues ...userRes.dataValues,
}); });
if (params.phone == 'SuperAdmin') {
const allResource = await models.Resource.findAll({})
userRslt.userResources = allResource.map(r => {
return {
resourceId: r.dataValues.code
}
})
}
await models.UserToken.create({ await models.UserToken.create({
token: token, token: token,
userInfo: userRslt, userInfo: userRslt,
expired: moment().add(30, 'day').format('YYYY-MM-DD HH:mm:ss') expired: moment().add(30, 'day').format('YYYY-MM-DD HH:mm:ss')
}, { transaction: transaction }); }, { transaction: transaction });
ctx.status = 200; ctx.status = 200;
ctx.body = Object.assign({ ctx.body = Object.assign({
...userRslt, ...userRslt,
@ -130,7 +143,7 @@ async function wxLogin(ctx, next) {
} }
} }
async function logout(ctx) { async function logout (ctx) {
try { try {
const { token, code } = ctx.request.body; const { token, code } = ctx.request.body;
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;

63
api/app/lib/controllers/data/assess.js

@ -4,7 +4,7 @@ const moment = require('moment')
async function assessGet (ctx) { async function assessGet (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { unit, month } = ctx.query; const { unit, month, page, limit } = ctx.query;
let findOption = { let findOption = {
where: { where: {
@ -21,7 +21,14 @@ async function assessGet (ctx) {
findOption.where.unit = unit findOption.where.unit = unit
} }
const roadRes = await models.Assess.findAll(findOption) if (limit) {
findOption.limit = limit
}
if (page && limit) {
findOption.offset = (page - 1) * limit
}
const roadRes = await models.Assess.findAndCountAll(findOption)
ctx.status = 200; ctx.status = 200;
ctx.body = roadRes ctx.body = roadRes
@ -39,9 +46,23 @@ async function assessEdit (ctx) {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const data = ctx.request.body; const data = ctx.request.body;
const repeatRes = await models.Assess.findOne({
where: {
unit: data.unit,
month: { $between: [moment(data.month).startOf('month').format(), moment(data.month).endOf('month').format()] }
}
})
if (!data.assessId) { if (!data.assessId) {
if (repeatRes) {
throw '已有相同月份的考核记录'
}
await models.Assess.create(data) await models.Assess.create(data)
} else { } else {
if (repeatRes && repeatRes.id != data.assessId) {
throw '已有相同月份的考核记录'
}
await models.Assess.update( await models.Assess.update(
data, { data, {
where: { where: {
@ -81,6 +102,42 @@ async function assessDel (ctx) {
} }
} }
async function nearestSourceData (ctx) {
try {
const { models } = ctx.fs.dc;
const { monthRange } = ctx.query
// 查最近的有数据的月份的数据
const nearestRes = await models.Assess.findOne({
order: [['month', 'DESC']],
})
let rslt = []
if (nearestRes) {
rslt = await models.Assess.findAll({
attributes: ['totalPoints', 'unit', 'month'],
where: {
month: {
$between: [
moment(nearestRes.month).subtract(monthRange || 0, 'month').startOf('month').format(), moment(nearestRes.month).endOf('month').format()
]
}
},
order: [['month', 'DESC']],
})
}
ctx.status = 200;
ctx.body = rslt
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
module.exports = { module.exports = {
assessGet, assessEdit, assessDel, assessGet, assessEdit, assessDel, nearestSourceData,
}; };

59
api/app/lib/controllers/data/videoCenter.js

@ -0,0 +1,59 @@
'use strict';
const moment = require('moment')
const request = require('superagent')
function videoList (opts) {
return async function (ctx) {
try {
const { models, } = ctx.fs.dc;
const { app, yingshiTokenRes } = ctx
let yingshiToken = ''
if (yingshiTokenRes && yingshiTokenRes.token && yingshiTokenRes.expire && moment().isBefore(moment(yingshiTokenRes.expire))) {
yingshiToken = yingshiTokenRes.token
} else {
const tokenRes = await app.fs.yingshiRequest.post(`lapp/token/get`, {
query: {
appKey: opts.yingshiKey,
appSecret: opts.yingshiSecret
}
})
if (tokenRes.code == 200 && tokenRes.data) {
const { accessToken, expireTime } = tokenRes.data
ctx.yingshiTokenRes = {
token: accessToken,
expire: expireTime
}
yingshiToken = accessToken
} else {
throw '未能获取进行萤石鉴权'
}
}
const deviceRes = await app.fs.yingshiRequest.post(`lapp/device/list`, {
query: {
accessToken: yingshiToken,
}
})
ctx.status = 200;
ctx.body = (deviceRes.data || []).map(item => {
return {
...item,
token: yingshiToken,
}
})
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
}
module.exports = {
videoList
};

65
api/app/lib/controllers/organization/depUsers.js

@ -0,0 +1,65 @@
'use strict';
async function getDepUsers(ctx) {
try {
const models = ctx.fs.dc.models;
//所有部门
const departments = await models.Department.findAll({
attributes: ['id', 'name', 'dependence'],
order: [['id', 'asc']],
where: {
delete: false,
},
})
//所有用户
const allusers = await models.User.findAll({
attributes: ['id', 'name', 'username', 'department_id'],
order: [['id', 'asc']],
where: {
delete: false,
},
})
const employees = [...new Set(allusers)]
function collectEmployees(departments, employees) {
const result = [];
const processDepartment = (department) => {
const departmentData = {
depId: department.id,
depName: department.name,
users: [],
expanded: false, // 初始状态折叠
};
const departmentEmployees = employees.filter(employee =>
//console.log('employee.dataVaules.department_id', employee.department_id)
employee.dataValues.department_id === department.id
);
departmentData.users.push(...departmentEmployees);
departments.forEach(subDepartment => {
if (subDepartment.dependence === department.id) {
const subDepartmentData = processDepartment(subDepartment);
departmentData.users.push(...subDepartmentData.users);
}
});
return departmentData;
};
departments.forEach(department => {
if (department.dependence === null) {
const departmentData = processDepartment(department);
result.push(departmentData);
}
});
return result;
}
const result = collectEmployees(departments, employees);
ctx.status = 200;
ctx.body = result
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {}
}
}
module.exports = {
getDepUsers
};

38
api/app/lib/controllers/report/index.js

@ -5,6 +5,40 @@ async function reportList (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType } = ctx.query const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType } = ctx.query
const { userInfo } = ctx.fs.api
const sequelize = ctx.fs.dc.orm;
let findUsers = []
if (
userInfo.loginSource == 'wx'
&& userInfo.isAdmin
&& userInfo.phone != 'SuperAdmin'
) {
// 是管理员但不是超管 查自己部门及下级部门的所有信息
const sqlStr = `
WITH RECURSIVE sub_departments AS (
SELECT id, dependence
FROM department
WHERE id = 1
UNION ALL
SELECT d.id, d.dependence
FROM sub_departments sd
JOIN department d ON sd.id = d.dependence
)
SELECT u.id
FROM "user" AS u
JOIN sub_departments sd ON u.department_id = sd.id
WHERE u.delete = false;
`
const res = await sequelize.query(sqlStr, { type: QueryTypes.SELECT })
let a = 1
findUsers = res.map(item => {
return item.id
})
findUsers.push(-1)
}
let findOption = { let findOption = {
where: { where: {
@ -43,6 +77,9 @@ async function reportList (ctx) {
if (userId) { if (userId) {
findOption.where.userId = userId findOption.where.userId = userId
} }
if (findUsers.length) {
findOption.where.userId = { $in: findUsers }
}
if (reportType) { if (reportType) {
findOption.where.reportType = reportType findOption.where.reportType = reportType
} }
@ -53,7 +90,6 @@ async function reportList (ctx) {
if (isTop) { if (isTop) {
const sqlStr = 'select * from (SELECT R.*, "row_number"() OVER(PARTITION BY R.user_id ORDER BY R."time" DESC) AS NEWINDEX FROM report AS R ) AS NR WHERE NEWINDEX = 1' const sqlStr = 'select * from (SELECT R.*, "row_number"() OVER(PARTITION BY R.user_id ORDER BY R."time" DESC) AS NEWINDEX FROM report AS R ) AS NR WHERE NEWINDEX = 1'
const sequelize = ctx.fs.dc.orm;
reportRes = await sequelize.query(sqlStr, { type: QueryTypes.SELECT }); reportRes = await sequelize.query(sqlStr, { type: QueryTypes.SELECT });
} else { } else {
reportRes = await models.Report.findAll(findOption) reportRes = await models.Report.findAll(findOption)

5
api/app/lib/index.js

@ -5,7 +5,7 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
const authenticator = require('./middlewares/authenticator'); const authenticator = require('./middlewares/authenticator');
// const apiLog = require('./middlewares/api-log'); // const apiLog = require('./middlewares/api-log');
// const businessRest = require('./middlewares/business-rest'); const paasRequest = require('./service/paasRequest');
module.exports.entry = function (app, router, opts) { module.exports.entry = function (app, router, opts) {
app.fs.logger.log('info', '[FS-AUTH]', 'Inject auth and api mv into router.'); app.fs.logger.log('info', '[FS-AUTH]', 'Inject auth and api mv into router.');
@ -15,8 +15,9 @@ module.exports.entry = function (app, router, opts) {
app.fs.api.logAttr = app.fs.api.logAttr || {}; app.fs.api.logAttr = app.fs.api.logAttr || {};
router.use(authenticator(app, opts)); router.use(authenticator(app, opts));
// router.use(businessRest(app, router, opts));
// router.use(apiLog(app, opts)); // router.use(apiLog(app, opts));
// 实例其他平台请求方法
paasRequest(app, opts)
router = routes(app, router, opts); router = routes(app, router, opts);
}; };

50
api/app/lib/middlewares/business-rest.js

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

15
api/app/lib/routes/data/index.js

@ -10,6 +10,7 @@ const publicity = require('../../controllers/data/publicity');
const dataIndex = require('../../controllers/data/index'); const dataIndex = require('../../controllers/data/index');
const task = require('../../controllers/data/task') const task = require('../../controllers/data/task')
const assess = require('../../controllers/data/assess') const assess = require('../../controllers/data/assess')
const videoCenter = require('../../controllers/data/videoCenter')
module.exports = function (app, router, opts) { module.exports = function (app, router, opts) {
@ -23,7 +24,7 @@ module.exports = function (app, router, opts) {
// 运政 // 运政
//货运 //货运
async function setFreightType(ctx, next) { async function setFreightType (ctx, next) {
ctx.request.body = { ctx.request.body = {
...(ctx.request.body || {}), ...(ctx.request.body || {}),
type: 'freight' type: 'freight'
@ -40,7 +41,7 @@ module.exports = function (app, router, opts) {
router.del('/vehicle/freight/:id', setFreightType, vehicle.del); router.del('/vehicle/freight/:id', setFreightType, vehicle.del);
//客运车 //客运车
async function setVehicleType(ctx, next) { async function setVehicleType (ctx, next) {
ctx.request.body = { ctx.request.body = {
...(ctx.request.body || {}), ...(ctx.request.body || {}),
type: 'vehicle' type: 'vehicle'
@ -57,7 +58,7 @@ module.exports = function (app, router, opts) {
router.del('/vehicle/:id', setVehicleType, vehicle.del); router.del('/vehicle/:id', setVehicleType, vehicle.del);
// 路政 // 路政
async function setRoadManageType(ctx, next) { async function setRoadManageType (ctx, next) {
ctx.request.body = { ctx.request.body = {
...(ctx.request.body || {}), ...(ctx.request.body || {}),
type: 'road_manage' type: 'road_manage'
@ -192,5 +193,13 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['DEL/assess/:assessId'] = { content: '删除评分考核数据', visible: false }; app.fs.api.logAttr['DEL/assess/:assessId'] = { content: '删除评分考核数据', visible: false };
router.del('/assess/:assessId', assess.assessDel); router.del('/assess/:assessId', assess.assessDel);
app.fs.api.logAttr['GET/assess/nearest'] = { content: '获取评分考核最近的月份的所有考核单位的数据', visible: true };
router.get('/assess/nearest', assess.nearestSourceData);
// 评分考核 END // 评分考核 END
// 视频中心
app.fs.api.logAttr['GET/videoCenter/list'] = { content: '获取萤石设备列表', visible: true };
router.get('/videoCenter/list', videoCenter.videoList(opts));
// 视频中心 END
}; };

2
api/app/lib/routes/organization/index.js

@ -63,4 +63,6 @@ module.exports = function (app, router, opts) {
}; };

4
api/app/lib/routes/report/index.js

@ -1,6 +1,7 @@
'use strict'; 'use strict';
const report = require('../../controllers/report'); const report = require('../../controllers/report');
const Department = require('../../controllers/organization/depUsers')
module.exports = function (app, router, opts) { module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/report/list'] = { content: '获取上报列表', visible: false }; app.fs.api.logAttr['GET/report/list'] = { content: '获取上报列表', visible: false };
@ -20,4 +21,7 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['DEL/report/:reportId'] = { content: '删除上报', visible: false }; app.fs.api.logAttr['DEL/report/:reportId'] = { content: '删除上报', visible: false };
router.del('/report/:reportId', report.deleteReport); router.del('/report/:reportId', report.deleteReport);
app.fs.api.logAttr['get/allDepUsers'] = { content: '查询所有部门的员工', visible: false };
router.get('allDepUsers', Department.getDepUsers);
} }

67
api/app/lib/service/paasRequest.js

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

20
api/config.js

@ -17,6 +17,8 @@ args.option('qnsk', 'qiniuSecretKey');
args.option('qnbkt', 'qiniuBucket'); args.option('qnbkt', 'qiniuBucket');
args.option('qndmn', 'qiniuDomain'); args.option('qndmn', 'qiniuDomain');
// //
args.option('yingshiKey', '萤石 KEY')
args.option('yingshiSecret', '萤石 SECRET')
const flags = args.parse(process.argv); const flags = args.parse(process.argv);
@ -27,8 +29,15 @@ const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RE
const QINIU_BUCKET_RESOURCE = process.env.ANXINCLOUD_QINIU_BUCKET_RESOURCE || flags.qnbkt; const QINIU_BUCKET_RESOURCE = process.env.ANXINCLOUD_QINIU_BUCKET_RESOURCE || flags.qnbkt;
const QINIU_AK = process.env.ANXINCLOUD_QINIU_ACCESSKEY || flags.qnak; const QINIU_AK = process.env.ANXINCLOUD_QINIU_ACCESSKEY || flags.qnak;
const QINIU_SK = process.env.ANXINCLOUD_QINIU_SECRETKEY || flags.qnsk; const QINIU_SK = process.env.ANXINCLOUD_QINIU_SECRETKEY || flags.qnsk;
//
const YINGSHI_KEY = process.env.YINGSHI_KEY || flags.yingshiKey;
const YINGSHI_SECRET = process.env.YINGSHI_SECRET || flags.yingshiSecret;
// 萤石服务的地址
const YINGSHI_URL = process.env.YINGSHI_URL || flags.yingshiUrl || 'https://open.ys7.com/api';
if (!FS_UNIAPP_DB) { if (
!FS_UNIAPP_DB ||
!YINGSHI_KEY || !YINGSHI_SECRET) {
console.log('缺少启动参数,异常退出'); console.log('缺少启动参数,异常退出');
args.showHelp(); args.showHelp();
process.exit(-1); process.exit(-1);
@ -57,7 +66,16 @@ const product = {
}, { }, {
entry: require('./app').entry, entry: require('./app').entry,
opts: { opts: {
yingshiKey: YINGSHI_KEY,
yingshiSecret: YINGSHI_SECRET,
exclude: [], // 不做认证的路由,也可以使用 exclude: ["*"] 跳过所有路由 exclude: [], // 不做认证的路由,也可以使用 exclude: ["*"] 跳过所有路由
pssaRequest: [
{
name: 'yingshiRequest',
root: YINGSHI_URL,
params: {}
}
]
} }
} }
], ],

40
scripts/1.2.3/schema/1.create_assess.sql

@ -0,0 +1,40 @@
create table if not exists assess
(
id serial not null
constraint assess_pk
primary key,
unit varchar(64),
month timestamp with time zone,
total_points double precision,
industry_points double precision,
industry_out_points double precision,
plus_or_subtract double precision,
"industry_deduction_reason " varchar(1024),
industry_out_deduction_reason varchar(1024),
remark varchar(1024)
);
comment on table assess is '考核评分';
comment on column assess.unit is '考核单位';
comment on column assess.month is '考核月份';
comment on column assess.total_points is '总分';
comment on column assess.industry_points is '业内得分';
comment on column assess.industry_out_points is '业外得分';
comment on column assess.plus_or_subtract is '加减得分';
comment on column assess."industry_deduction_reason " is '业内扣分原因
';
comment on column assess.industry_out_deduction_reason is '业外扣分原因';
comment on column assess.remark is '备注';
create unique index if not exists assess_id_uindex
on assess (id);

14
weapp/src/packages/components/inputPicker/index.jsx

@ -6,19 +6,19 @@ import { View, Picker, Image, Input, Text } from '@tarojs/components'
import arrowIcon from '../../../static/img/patrol/arrow-down.svg' import arrowIcon from '../../../static/img/patrol/arrow-down.svg'
import './index.scss' import './index.scss'
export default function InputPicker(props) { export default function InputPicker (props) {
const { title, placeholder, selector, value, onInput, isView } = props const { title, placeholder, selector, value, onInput, isView, onlySelect } = props
const [curSelector, setCurSelector] = useState([]) const [curSelector, setCurSelector] = useState([])
useEffect(() => { useEffect(() => {
setCurSelector(selector) setCurSelector(selector)
}, []) }, [])
useEffect(()=>{ useEffect(() => {
handleInput({ detail: { value: value } }) handleInput({ detail: { value: value } })
},[value]) }, [value])
function handleInput({ detail: { value: v } }) { function handleInput ({ detail: { value: v } }) {
onInput(v) onInput(v)
if (v) { if (v) {
setCurSelector(selector.filter(item => item && item.includes(v))) setCurSelector(selector.filter(item => item && item.includes(v)))
@ -30,7 +30,7 @@ export default function InputPicker(props) {
const handlePickerChange = (e) => { const handlePickerChange = (e) => {
onInput(curSelector[e.detail.value]) onInput(curSelector[e.detail.value])
} }
console.log(onlySelect);
return ( return (
<View className='input-picker'> <View className='input-picker'>
<View className='input-box'> <View className='input-box'>
@ -42,7 +42,7 @@ export default function InputPicker(props) {
border={false} border={false}
value={value} value={value}
onInput={handleInput} onInput={handleInput}
disabled={isView} disabled={isView || onlySelect}
/> />
</View> </View>
{ {

3
weapp/src/packages/patrol/index.jsx

@ -224,7 +224,7 @@ const Index = () => {
return return
} }
if (isPatrol && prjTypeSelector.indexOf(projectType) === -1) { if ((isPatrol || isAnomaly) && prjTypeSelector.indexOf(projectType) === -1) {
Taro.showToast({ title: isAnomaly ? '反馈类型错误' : '工程类型错误', icon: 'none' }) Taro.showToast({ title: isAnomaly ? '反馈类型错误' : '工程类型错误', icon: 'none' })
return return
} }
@ -520,6 +520,7 @@ const Index = () => {
onInput={setProjectType} onInput={setProjectType}
selector={prjTypeSelector} selector={prjTypeSelector}
isView={isView} isView={isView}
onlySelect={true}
/> : '' /> : ''
} }

BIN
web/client/assets/images/quanju/nodata.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

6
web/client/src/components/index.js

@ -4,21 +4,21 @@
import Upload from './Upload'; import Upload from './Upload';
import NoResource from './no-resource'; import NoResource from './no-resource';
import LimitTextArea from './limit-textarea'; import LimitTextArea from './limit-textarea';
import ProcessForm from './process_form'
import FlowRecordTable from './flowRecordTable' import FlowRecordTable from './flowRecordTable'
import Table from './table' import Table from './table'
import Search from './search' import Search from './search'
import SketchColor from './sketchColor' import SketchColor from './sketchColor'
import SimpleFileDownButton from './simpleFileDownButton' import SimpleFileDownButton from './simpleFileDownButton'
import YSIframePlayer from './ysPlayerIframe'
export { export {
Upload, Upload,
NoResource, NoResource,
LimitTextArea, LimitTextArea,
ProcessForm,
FlowRecordTable, FlowRecordTable,
Table, Table,
Search, Search,
SketchColor, SketchColor,
SimpleFileDownButton SimpleFileDownButton,
YSIframePlayer
}; };

52
web/client/src/components/ysPlayerIframe.js

@ -0,0 +1,52 @@
/**
* 萤石视频直播基于萤石云iframe模式使用方式简单
* 官方参考https://open.ys7.com/console/ezopenIframe.html
*/
'use strict';
import React from 'react';
import { connect } from 'react-redux';
const YSIframePlayer = props => {
const { containerId, height, width, url, autoplay, audio, videoState, ysToken } = props;
const at = ysToken
if (!url || !at) return null;
const src = `https://open.ys7.com/ezopen/h5/iframe?audio=${audio ? '1' : '0'}&url=${url}&autoplay=${autoplay || 1}&accessToken=${at}`
// const src = `https://open.ys7.com/ezopen/h5/iframe?audio=1&url=${url}&autoplay=${autoplay || 1}&accessToken=${at}`
return (
<div
style={{ position: 'relative', height: '100%', width: '100%' }}>
<iframe
frameBorder="0"
id={containerId || 'myPlayer'}
src={src}
// https://open.ys7.com/doc/zh/book/index/live_proto.html 单个播放器的长宽比例限制最小为{width: 400px;height: 300px;}
width={width || 400}
height={height || 300}
allowFullScreen
wmode="transparent"
>
</iframe>
{
videoState && videoState.status == 0 ?
<div style={{
height: width || 300, width: width || 400, position: 'absolute', top: 0, background: '#000',
display: 'flex', justifyContent: 'center', alignItems: 'center', color: '#fff'
}}>
设备中断正在处理中...
</div>
: ''
}
</div>
)
}
function mapStateToProps (state) {
const { auth, } = state;
return {
user: auth.user,
};
}
export default connect(mapStateToProps)(YSIframePlayer);

4
web/client/src/layout/actions/global.js

@ -35,7 +35,9 @@ export function initApiRoot () {
dispatch({ dispatch({
type: INIT_API_ROOT, type: INIT_API_ROOT,
payload: { payload: {
apiRoot: res.root apiRoot: res.root,
vcmpWebUrl: res.vcmpWebUrl,
vcmpMirrorId: res.vcmpMirrorId,
} }
}) })
}); });

4
web/client/src/layout/components/header/index.js

@ -56,7 +56,7 @@ const Header = props => {
style={{ border: 0 }} style={{ border: 0 }}
onClick={handelClick} onClick={handelClick}
> >
<div style={{ display: 'inline-block', cursor: "pointer" }} onClick={() => history.push(`/screen/cockpit`)}>进入大屏</div> {user?.username === 'SuperAdmin' ? <div style={{ display: 'inline-block', cursor: "pointer" }} onClick={() => history.push(`/screen/cockpit`)}>进入大屏</div> : ''}
<Menu.SubMenu key="user" title={ <Menu.SubMenu key="user" title={
<div style={{ <div style={{
margin: '0 8px' margin: '0 8px'
@ -83,7 +83,7 @@ const Header = props => {
); );
}; };
function mapStateToProps (state) { function mapStateToProps(state) {
const { global, auth } = state; const { global, auth } = state;
return { return {
actions: global.actions, actions: global.actions,

2
web/client/src/layout/components/sider/index.js

@ -62,7 +62,7 @@ const Sider = props => {
setSelectedKeys(selectedKeys) setSelectedKeys(selectedKeys)
}} }}
onOpenChange={(ks) => { onOpenChange={(ks) => {
setOpenKeys(ks) setOpenKeys(ks.length > 1 ? [ks.pop()] : ks)
}} }}
> >
{items} {items}

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

@ -52,6 +52,7 @@ const LayoutContainer = props => {
}) })
}, [user]) }, [user])
useEffect(() => { useEffect(() => {
resize_()
scrollbar = new PerfectScrollbar('#page-content', { suppressScrollX: true }); scrollbar = new PerfectScrollbar('#page-content', { suppressScrollX: true });
}, []) }, [])

4
web/client/src/layout/index.js

@ -60,6 +60,9 @@ const Root = props => {
} }
flat(routes); flat(routes);
//将路由信息全部放在session,方便后面拿了用(权限控制的时候)
console.log('combineRoutes1', combineRoutes)
sessionStorage.setItem('allRoutes', JSON.stringify(combineRoutes));
return combineRoutes; return combineRoutes;
} }
@ -160,6 +163,7 @@ const Root = props => {
<Layout <Layout
history={history} history={history}
routes={innnerRoutes} routes={innnerRoutes}
combineRoutes={combineRoutes}
> >
{combineRoutes} {combineRoutes}
</Layout> </Layout>

15
web/client/src/layout/reducers/global.js

@ -1,15 +1,18 @@
'use strict'; 'use strict';
import Immutable from 'immutable'; import Immutable from 'immutable';
import { INIT_LAYOUT, RESIZE } from '../actions/global'; import { INIT_LAYOUT, RESIZE, INIT_API_ROOT } from '../actions/global';
function global(state = { function global (state = {
title: '', title: '',
copyright: '', copyright: '',
sections: [], sections: [],
actions: {}, actions: {},
plugins: {}, plugins: {},
clientHeight: 768, clientHeight: 768,
clientWidth: 1024 clientWidth: 1024,
apiRoot: '',
vcmpWebUrl: '',
vcmpMirrorId: '',
}, action) { }, action) {
const payload = action.payload; const payload = action.payload;
switch (action.type) { switch (action.type) {
@ -34,6 +37,12 @@ function global(state = {
// return Immutable.fromJS(state).merge({ // return Immutable.fromJS(state).merge({
// detailsComponent: payload.component // detailsComponent: payload.component
// }).toJS(); // }).toJS();
case INIT_API_ROOT:
return Immutable.fromJS(state).merge({
apiRoot: payload.apiRoot,
vcmpWebUrl: payload.vcmpWebUrl,
vcmpMirrorId: payload.vcmpMirrorId,
}).toJS();
default: default:
return state; return state;
} }

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

@ -5,6 +5,7 @@ import { push } from 'react-router-redux';
import { Button, Input, Form, Row, Col, message } from 'antd'; import { Button, Input, Form, Row, Col, message } from 'antd';
import { login } from '../actions/auth'; import { login } from '../actions/auth';
import './style.less'; import './style.less';
import leftTop from '../../quanju/containers/footer/conserve/left/left-top';
const FormItem = Form.Item; const FormItem = Form.Item;
const Login = props => { const Login = props => {
@ -25,7 +26,23 @@ const Login = props => {
}, [error]) }, [error])
useEffect(() => { useEffect(() => {
user && user.authorized ? dispatch(push('/screen/cockpit')) : null const allroutes = JSON.parse(sessionStorage.getItem('allRoutes')) || []
let hasAuth = []
if (user && user.authorized) {
hasAuth = allroutes?.filter((item) => { return user?.userResources.find((child) => { return child.resourceId === item.authCode }) })
if (user?.username === 'SuperAdmin') {
dispatch(push('/fillion/infor'))
}
else if (hasAuth && hasAuth.length > 0) {
const path = hasAuth[0].path
console.log('sasa', `${path}`)
dispatch(push(path))
} else {
dispatch(push('/noContent'))
}
}
//user && user.authorized ? dispatch(push('/screen/cockpit')) : null
}, [user]) }, [user])
const enterHandler = e => { const enterHandler = e => {

14
web/client/src/sections/fillion/actions/allDepUsers.js

@ -0,0 +1,14 @@
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function getAllDepUsers(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_AllDEPUSERS',
url: ApiTable.getAllDepUsers,
msg: { option: '获取部门下的所有员工' },//子部门算在第一级部门下面
reducer: { name: 'allDepUsers' }
});
}

2
web/client/src/sections/fillion/actions/assess.js

@ -30,6 +30,6 @@ export function editAssess (query) {
data: query, data: query,
actionType: 'PUT_ASSESS', actionType: 'PUT_ASSESS',
url: ApiTable.editAssess, url: ApiTable.editAssess,
msg: { option: '编辑新增考核评分信息' }, msg: { option: '编辑/新增考核评分信息' },
}); });
} }

2
web/client/src/sections/fillion/actions/index.js

@ -4,10 +4,12 @@ import * as infor from './infor'
import * as patrol from './patrol' import * as patrol from './patrol'
import * as file from './file' import * as file from './file'
import * as assess from './assess' import * as assess from './assess'
import * as allDepUsers from './allDepUsers'
export default { export default {
...infor, ...infor,
...patrol, ...patrol,
...file, ...file,
...assess, ...assess,
...allDepUsers
} }

108
web/client/src/sections/fillion/components/assessModal.js

@ -0,0 +1,108 @@
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { Form, Input, Select, DatePicker, InputNumber, Button, Modal } from 'antd';
import { unitList } from '../containers/assess'
import { getAssess, delAssess, editAssess } from '../actions/assess';
import moment from 'moment';
const { Option } = Select;
const AssessModal = ({ editData, check, visible, onCancel, dispatch }) => {
const [form] = Form.useForm();
return (
<Modal
title="考核评分"
open={visible}
visible={visible}
cancelButtonProps={{
disabled: check,
}}
onOk={() => {
if (check) {
return onCancel()
}
form.validateFields().then(values => {
dispatch(editAssess({
...values,
month: moment(values.month).format('YYYY-MM-DD'),
assessId: editData ? editData.id : undefined
})).then(res => {
if (res.success) {
onCancel()
}
})
})
}}
onCancel={() => {
onCancel()
}}
>
<Form
form={form}
initialValues={editData ? {
...editData,
month: moment(editData.month),
} : {}}
disabled={check}
labelCol={{
span: 6,
}}
wrapperCol={{
span: 18,
}}
>
<Form.Item name="unit" label="管养责任单位" rules={[{ required: true, message: '请填写' }]}>
<Select>
{
unitList.map(item => (
<Option value={item} key={item} />
))
}
</Select>
</Form.Item>
<Form.Item name="month" label="考核月份" rules={[{ required: true, message: '请填写' }]}>
<DatePicker picker="month" />
</Form.Item>
<Form.Item name="totalPoints" label="考核总分" rules={[{ required: true, message: '请填写' }]}>
<InputNumber step={0.1} precision={1} />
</Form.Item>
<Form.Item name="industryPoints" label="内业得分">
<InputNumber step={0.1} precision={1} />
</Form.Item>
<Form.Item name="industryOutPoints" label="外业得分">
<InputNumber step={0.1} precision={1} />
</Form.Item>
<Form.Item name="plusOrSubtract" label="加减分">
<InputNumber step={0.1} precision={1} />
</Form.Item>
<Form.Item name="industryDeductionReason" label="内业扣分原因">
<Input.TextArea rows={4} maxLength={1024} />
</Form.Item>
<Form.Item name="industryOutDeductionReason" label="外业扣分原因">
<Input.TextArea rows={4} maxLength={1024} />
</Form.Item>
<Form.Item name="remark" label="备注">
<Input.TextArea rows={4} maxLength={1024} />
</Form.Item>
</Form>
</Modal>
);
};
function mapStateToProps (state) {
const { auth, assess } = state
return {
user: auth.user,
assess: assess.data || []
}
}
export default connect(mapStateToProps)(AssessModal);

14
web/client/src/sections/fillion/components/bridgeTable.js

@ -1774,13 +1774,13 @@ const BrideTable = (props) => {
setDifferentiate('bridge') setDifferentiate('bridge')
}}>桥梁{activeKey === 'tab1'}</span>, }}>桥梁{activeKey === 'tab1'}</span>,
}, },
{ // {
key: 'tab2', // key: 'tab2',
label: <span onClick={() => { // label: <span onClick={() => {
setWhichofits('gongcheng') // setWhichofits('gongcheng')
setDifferentiate('project') // setDifferentiate('project')
}}>工程一览{activeKey === 'tab2'}</span>, // }}>工程一览{activeKey === 'tab2'}</span>,
}, // },
], ],
}, },

290
web/client/src/sections/fillion/components/maintenanceTable.js

@ -1,14 +1,17 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import './protable.less' import './protable.less'
import { Card, Button, DatePicker, Input, Modal, Spin, Image, message, Popover } from 'antd'; import { Card, Button, DatePicker, Input, Modal, Spin, Image, message, Popover, Tree, Tooltip } from 'antd';
import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import { getReportList, getReportDetail } from '../actions/patrol'; import { getReportList, getReportDetail } from '../actions/patrol';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState, useMemo } from 'react';
import { httpDel } from '@peace/utils' import { httpDel } from '@peace/utils'
import { PinyinHelper } from '@peace/utils'; import { PinyinHelper } from '@peace/utils';
// @ts-ignore // @ts-ignore
import styles from './protable.less'; import styles from './protable.less';
import moment from 'moment'; import moment from 'moment';
import { getAllDepUsers } from '../actions/allDepUsers'
import { getDepMessage, getDepUser, createUser, updateUser, delUser, resetPwd, createDep, delDep, updateDep } from '../../organization/actions/user'
import { reportTypeText } from './patrolTable' import { reportTypeText } from './patrolTable'
const DetailForm = (props) => { const DetailForm = (props) => {
@ -219,25 +222,192 @@ const DetailList = (props) => {
const PatrolNameList = (props) => { const PatrolNameList = (props) => {
const { Search } = Input;
const [users, setUsers] = useState([]); const [users, setUsers] = useState([]);
const { onChange, record, userList, loading } = props; const { onChange, record, userList, loading, depMessage, depUser, clientHeight, dispatch, user } = props;
const [selectRoad, setSelectRoad] = useState(); const [selectRoad, setSelectRoad] = useState();
const [selectedTree, setSelectedTree] = useState();
const [depSelectedKeys, setDepSelectedKeys] = useState([])
const [depAllUser, setDepAllUser] = useState([])
//const [depMessagedata, setdepMessagedata] = useState()//侧边栏的展示数据
const [expandedKeys, setExpandedKeys] = useState([]);
const [searchValue, setSearchValue] = useState('');
const [autoExpandParent, setAutoExpandParent] = useState(true);
const [defaultData, setDefaultData] = useState([]);
const [dataList, setDataList] = useState([]);
console.log('record', record)
useEffect(() => {
let departments = []
const generateData = (data, _preKey, _tns) => {
const preKey = _preKey || '0';
const tns = _tns || [];
const children = [];
data.forEach(department => {
const key = `${preKey}-${department.depId}`;
const node = {
title: department.depName.toString(),
key,
children: [],
};
if (department.users.length > 0) { // 仅当部门有用户时添加子节点
department.users.forEach(user => {
node.children.push({
title: user.name.toString(),
key: `${key}-${user.id}`,
isLeaf: true, // 用户节点为叶子节点
});
});
}
if (department.children && department.children.length > 0) {
const childKeys = generateData(department.children, key, node.children);
children.push(...childKeys);
}
tns.push(node);
if (node.children.length > 0 && department.expanded) { // 仅当部门展开时添加子节点
children.push(key);
}
});
return children;
};
if (user?.username === 'SuperAdmin') {
departments = [...new Set(depAllUser)]
} else {
let depAllUserCopy = []
depAllUser.map((item) => {
if (item.depId === user?.departmentId) {
depAllUserCopy.push(item)
}
})
departments = [...new Set(depAllUserCopy)]
}
const processedData = [];
const expandedKeys = generateData(departments, null, processedData);
setDefaultData(processedData);
setDataList(processedData.map(item => ({ key: item.key, title: item.title.toString(), children: item.children })));
setExpandedKeys(expandedKeys);
}, [depAllUser])
useEffect(() => {
dispatch(getAllDepUsers()).then((res) => {
if (res.success) setDepAllUser(res?.payload?.data)
})
}, [])
const getParentKey = (key, tree) => {
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some((item) => item.key === key)) {
parentKey = node.key;
} else {
parentKey = getParentKey(key, node.children);
}
}
if (parentKey) {
break;
}
}
return parentKey;
};
const handleSearch = (value) => {
const filteredKeys = [];
const expandedKeys = [];
const loopTreeData = (data) => {
data.forEach((item) => {
if (item.title.indexOf(value) > -1) {
filteredKeys.push(item.key);
let parentKey = getParentKey(item.key, defaultData);
while (parentKey) {
if (!expandedKeys.includes(parentKey)) {
expandedKeys.push(parentKey);
}
parentKey = getParentKey(parentKey, defaultData);
}
}
if (item.children) {
loopTreeData(item.children);
}
});
};
loopTreeData(defaultData);
setSearchValue(value);
setExpandedKeys(expandedKeys);
};
const handleExpand = (expandedKeys) => {
setExpandedKeys(expandedKeys);
};
const renderTreeNodes = (data) => {
return data.map((item) => {
const { key, title, children } = item;
const isLeaf = !children || children.length === 0;
return (
<Tree.TreeNode
key={key}
title={title}
icon={isLeaf ? null : (
expandedKeys.includes(key) ? <CaretDownOutlined /> : <CaretRightOutlined />
)}
isLeaf={isLeaf}
>
{children && children.length > 0 && renderTreeNodes(children)}
</Tree.TreeNode>
);
});
};
const treeData = useMemo(() => {
const loop = (data) =>
data.map((item) => {
const { title, key, children } = item;
const strTitle = title.toString();
const index = strTitle.indexOf(searchValue);
const beforeStr = strTitle.substring(0, index);
const afterStr = strTitle.slice(index + searchValue.length);
const titleNode = index > -1 ? (
<span>
{beforeStr}
<span style={{ color: '#f50' }}>{searchValue}</span>
{afterStr}
</span>
) : (
<span>{strTitle}</span>
);
if (children && children.length > 0) {
return {
title: titleNode,
key,
children: loop(children),
};
}
return {
title: titleNode,
key,
};
});
return loop(defaultData);
}, [searchValue, defaultData]);
useEffect(() => { useEffect(() => {
if (userList && userList instanceof Array && userList.length) { if (userList && userList instanceof Array && userList.length) {
setSelectRoad(userList[0].id) setSelectRoad(userList[0].id)
// onChange(userList[0]); // onChange(userList[0]);
} }
}, [userList]) }, [userList])
const columns = [
{
title: '养护人员',
key: 'name',
dataIndex: 'name',
align: 'center'
},
];
useEffect(() => { useEffect(() => {
if (userList && userList instanceof Array) { if (userList && userList instanceof Array) {
@ -245,51 +415,39 @@ const PatrolNameList = (props) => {
setUsers(users); setUsers(users);
} }
}, [userList]) }, [userList])
const handleSelect = (selectedKeys, { selected, selectedNodes, node }) => {
if (selected) {
if (selectedKeys[0].split("-").length - 1 >= 2) {
let id = selectedKeys[0].split('-')[selectedKeys[0].split('-').length - 1]
console.log('id', id)
onChange(id);
}
var timer = null;
const doUserNameSearch = (e) => {
const name = e.target.value;
if (timer) {
clearTimeout(timer)
} else {
setTimeout(() => {
let users = userList.filter(user => PinyinHelper.isSearchMatched(user.name, name) && user.remark != 'sp');
setUsers(users);
}, 500);
} }
console.log('selectedKeys', selectedKeys, selected, selectedNodes, node)
};
if (loading) {
return <div>Loading...</div>
} }
return ( return (
<div className='spilce'> <div className='spilce' style={{ height: '600px', width: '100%', overflow: 'auto' }} >
<ProTable <Search
columns={columns} placeholder="请输入养护人名称"
dataSource={users} value={searchValue}
loading={loading} onChange={(e) => handleSearch(e.target.value)}
rowKey="name" />
rowClassName={(record) => { <Tree
return record.id == selectRoad ? 'list-row-actived' : ''; expandedKeys={expandedKeys}
}} onExpand={handleExpand}
toolBarRender={() => [ autoExpandParent={autoExpandParent}
<Input placeholder='输入养护人员名称' onChange={doUserNameSearch} ></Input> onSelect={handleSelect}
]} >
options={false} {renderTreeNodes(treeData)}
pagination={false} </Tree>
search={false} </div>
onRow={(record) => {
return {
onClick: () => {
if (record) {
let id = record.id
if (selectRoad == record.id) {
id = null
}
setSelectRoad(id);
onChange(id ? record : null);
}
},
};
}}
/></div>
); );
}; };
@ -297,8 +455,8 @@ const PatrolNameList = (props) => {
const MaintenanceTable = (props) => { const MaintenanceTable = (props) => {
const { userList, user, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports } = props; const { userList, user, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, depMessage, depUser, clientHeight } = props;
const [record, setRecord] = useState(); const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState(); const [dateRange, setDateRange] = useState();
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
@ -322,8 +480,19 @@ const MaintenanceTable = (props) => {
}, [record, dateRange]) }, [record, dateRange])
const queryData = () => { const queryData = () => {
let userId = null
if (user?.username === 'SuperAdmin' && record === 1) {
userId = undefined
} else if (user?.username === 'SuperAdmin' && record !== 1) {
userId = record
} else if (user?.username !== 'SuperAdmin' && record === 1) {
userId = user?.id
} else if (user?.username !== 'SuperAdmin' && record !== 1) {
userId = record
}
//: user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id
let query = { let query = {
userId: record?.id, userId,
reportType: 'conserve', reportType: 'conserve',
asc: true asc: true
} }
@ -360,7 +529,9 @@ const MaintenanceTable = (props) => {
return ( return (
<div className='card-protable'> <div className='card-protable'>
<Card > <Card >
<PatrolNameList onChange={(record) => setRecord(record)} record={record} userList={userList} loading={userLoading} handelRefresh={handelRefresh} /> <PatrolNameList
depMessage={depMessage} depUser={depUser} clientHeight={clientHeight} dispatch={dispatch} user={user}
onChange={(record) => setRecord(record)} record={record} userList={userList} loading={userLoading} handelRefresh={handelRefresh} />
</Card> </Card>
<Card style={{ flex: 1 }} > <Card style={{ flex: 1 }} >
<div style={{ marginBottom: 20 }}> <div style={{ marginBottom: 20 }}>
@ -386,8 +557,8 @@ const MaintenanceTable = (props) => {
); );
}; };
function mapStateToProps (state) { function mapStateToProps(state) {
const { auth, depMessage, userList, reportList, reportDetail } = state; const { auth, depMessage, userList, reportList, reportDetail, depUser, global } = state;
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
return { return {
@ -399,6 +570,7 @@ function mapStateToProps (state) {
} }
let depData = pakData(depMessage.data || []) let depData = pakData(depMessage.data || [])
return { return {
clientHeight: global.clientHeight,
user: auth.user, user: auth.user,
depMessage: depMessage.data || [], depMessage: depMessage.data || [],
depLoading: depMessage.isRequesting, depLoading: depMessage.isRequesting,
@ -409,6 +581,8 @@ function mapStateToProps (state) {
reportListLoading: reportList.isRequesting, reportListLoading: reportList.isRequesting,
reportDetail: reportDetail.data, reportDetail: reportDetail.data,
reportDetailLoading: reportDetail.isRequesting, reportDetailLoading: reportDetail.isRequesting,
depUser: depUser.data || [],
}; };
} }
export default connect(mapStateToProps)(MaintenanceTable); export default connect(mapStateToProps)(MaintenanceTable);

290
web/client/src/sections/fillion/components/patrolTable.js

@ -1,9 +1,11 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import './protable.less' import './protable.less'
import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select } from 'antd'; import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select, Tree } from 'antd';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import { DownOutlined, RightOutlined, CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
import { getReportList, getReportDetail, handleReport } from '../actions/patrol'; import { getReportList, getReportDetail, handleReport } from '../actions/patrol';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState, useMemo } from 'react';
import { getAllDepUsers } from '../actions/allDepUsers'
import { httpDel } from '@peace/utils' import { httpDel } from '@peace/utils'
import { PinyinHelper } from '@peace/utils'; import { PinyinHelper } from '@peace/utils';
import PatrolGis from './gis/patrolGis'; import PatrolGis from './gis/patrolGis';
@ -302,14 +304,198 @@ const DetailList = (props) => {
const PatrolNameList = (props) => { const PatrolNameList = (props) => {
const { Search } = Input;
const [users, setUsers] = useState([]); const [users, setUsers] = useState([]);
const { onChange, record, userList, loading, activeTabKey1 } = props; const { onChange, record, userList, loading, activeTabKey1, dispatch, user } = props;
const [selectRoad, setSelectRoad] = useState(); const [selectRoad, setSelectRoad] = useState();
const [defaultData, setDefaultData] = useState([]);
const [expandedKeys, setExpandedKeys] = useState([]);
const [searchValue, setSearchValue] = useState('');
const [depAllUser, setDepAllUser] = useState([])
const [dataList, setDataList] = useState([]);
useEffect(() => {
let departments = []
const generateData = (data, _preKey, _tns) => {
const preKey = _preKey || '0';
const tns = _tns || [];
const children = [];
data.forEach(department => {
const key = `${preKey}-${department.depId}`;
const node = {
title: department.depName.toString(),
key,
children: [],
};
if (department.users.length > 0) { // 仅当部门有用户时添加子节点
department.users.forEach(user => {
node.children.push({
title: user.name.toString(),
key: `${key}-${user.id}`,
isLeaf: true, // 用户节点为叶子节点
});
});
}
if (department.children && department.children.length > 0) {
const childKeys = generateData(department.children, key, node.children);
children.push(...childKeys);
}
tns.push(node);
if (node.children.length > 0 && department.expanded) { // 仅当部门展开时添加子节点
children.push(key);
}
});
return children;
};
if (user?.username === 'SuperAdmin') {
departments = [...new Set(depAllUser)]
} else {
let depAllUserCopy = []
depAllUser.map((item) => {
if (item.depId === user?.departmentId) {
depAllUserCopy.push(item)
}
})
departments = [...new Set(depAllUserCopy)]
}
const processedData = [];
const expandedKeys = generateData(departments, null, processedData);
setDefaultData(processedData);
setDataList(processedData.map(item => ({ key: item.key, title: item.title.toString(), children: item.children })));
setExpandedKeys(expandedKeys);
}, [depAllUser])
useEffect(() => {
dispatch(getAllDepUsers()).then((res) => {
if (res.success) setDepAllUser(res?.payload?.data)
})
}, [])
const getParentKey = (key, tree) => {
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some((item) => item.key === key)) {
parentKey = node.key;
} else {
parentKey = getParentKey(key, node.children);
}
}
if (parentKey) {
break;
}
}
return parentKey;
};
const handleSearch = (value) => {
const filteredKeys = [];
const expandedKeys = [];
const loopTreeData = (data) => {
data.forEach((item) => {
if (item.title.indexOf(value) > -1) {
filteredKeys.push(item.key);
let parentKey = getParentKey(item.key, defaultData);
while (parentKey) {
if (!expandedKeys.includes(parentKey)) {
expandedKeys.push(parentKey);
}
parentKey = getParentKey(parentKey, defaultData);
}
}
if (item.children) {
loopTreeData(item.children);
}
});
};
loopTreeData(defaultData);
setSearchValue(value);
setExpandedKeys(expandedKeys);
};
const handleExpand = (expandedKeys) => {
setExpandedKeys(expandedKeys);
};
const renderTreeNodes = (data) => {
return data.map((item) => {
const { key, title, children } = item;
const isLeaf = !children || children.length === 0;
return (
<Tree.TreeNode
key={key}
title={title}
icon={isLeaf ? null : (
expandedKeys.includes(key) ? <CaretDownOutlined /> : <CaretRightOutlined />
)}
isLeaf={isLeaf}
>
{children && children.length > 0 && renderTreeNodes(children)}
</Tree.TreeNode>
);
});
};
const treeData = useMemo(() => {
const loop = (data) =>
data.map((item) => {
const { title, key, children } = item;
const strTitle = title.toString();
const index = strTitle.indexOf(searchValue);
const beforeStr = strTitle.substring(0, index);
const afterStr = strTitle.slice(index + searchValue.length);
const titleNode = index > -1 ? (
<span>
{beforeStr}
<span style={{ color: '#f50' }}>{searchValue}</span>
{afterStr}
</span>
) : (
<span>{strTitle}</span>
);
if (children && children.length > 0) {
return {
title: titleNode,
key,
children: loop(children),
};
}
return {
title: titleNode,
key,
};
});
return loop(defaultData);
}, [searchValue, defaultData]);
const handleSelect = (selectedKeys, { selected, selectedNodes, node }) => {
if (selected) {
if (selectedKeys[0].split("-").length - 1 >= 2) {
let id = selectedKeys[0].split('-')[selectedKeys[0].split('-').length - 1]
console.log('id1', id)
onChange(id);
}
}
console.log('selectedKeys', selectedKeys, selected, selectedNodes, node)
};
useEffect(() => { useEffect(() => {
if (userList && userList instanceof Array && userList.length) { if (userList && userList instanceof Array && userList.length) {
// setSelectRoad(userList[0].id) setSelectRoad(userList[0].id)
// onChange(userList[0]); // onChange(userList[0]);
} }
if (activeTabKey1 == 'tab2') { if (activeTabKey1 == 'tab2') {
@ -318,38 +504,38 @@ const PatrolNameList = (props) => {
}, [userList, activeTabKey1]) }, [userList, activeTabKey1])
const columns = [
{
title: '巡查人员',
key: 'name',
dataIndex: 'name',
align: 'center'
},
];
useEffect(() => { useEffect(() => {
if (userList) { if (userList) {
setUsers(userList) setUsers(userList)
} }
}, [userList]) }, [userList])
var timer = null; if (loading) {
const doUserNameSearch = (e) => { return <div>Loading...</div>
const name = e.target.value;
if (timer) {
clearTimeout(timer)
} else {
setTimeout(() => {
let users = userList.filter(user => PinyinHelper.isSearchMatched(user.name, name));
setUsers(users);
}, 500);
}
} }
return ( return (
<div className='spilce'> <div className='spilce'>
<ProTable <div className='spilce' style={{ height: '600px', width: '100%', overflow: 'auto' }} >
<Search
placeholder="请输入巡查人名称"
value={searchValue}
onChange={(e) => handleSearch(e.target.value)}
/>
<Tree
expandedKeys={expandedKeys}
onExpand={handleExpand}
onSelect={handleSelect}
>
{renderTreeNodes(treeData)}
</Tree>
</div>
{/* <ProTable
columns={columns} columns={columns}
dataSource={users} dataSource={users}
loading={loading} loading={loading}
@ -377,7 +563,9 @@ const PatrolNameList = (props) => {
}, },
}; };
}} }}
/></div> />
*/}
</div>
); );
}; };
@ -385,8 +573,8 @@ const PatrolNameList = (props) => {
const PatrolTable = (props) => { const PatrolTable = (props) => {
const { user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props; const { clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props;
const [record, setRecord] = useState(); const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState(); const [dateRange, setDateRange] = useState();
const [selectProjectType, setSelectProjectType] = useState(''); const [selectProjectType, setSelectProjectType] = useState('');
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
@ -413,7 +601,23 @@ const PatrolTable = (props) => {
}, [record, dateRange, selectProjectType]) }, [record, dateRange, selectProjectType])
const queryData = () => { const queryData = () => {
let query = { userId: record?.id, reportType: reportType, projectType: selectProjectType, asc: true } console.log(record, 'idididid')
let userId = null
if (user?.username === 'SuperAdmin' && record === 1) {
userId = undefined
} else if (user?.username === 'SuperAdmin' && record !== 1) {
userId = record
} else if (user?.username !== 'SuperAdmin' && record === 1) {
userId = user?.id
} else if (user?.username !== 'SuperAdmin' && record !== 1) {
userId = record
}
// user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id,
let query = {
userId,
reportType: reportType, projectType: selectProjectType, asc: true
}
console.log(query, 'query1')
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) { if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
@ -468,13 +672,13 @@ const PatrolTable = (props) => {
setActiveTabKey1(key); setActiveTabKey1(key);
}; };
const handleChangeRecord = (newRecord) => { // const handleChangeRecord = (newRecord) => {
let target = null; // let target = null;
if (!record || (newRecord && newRecord.id != record.id)) { // if (!record || (newRecord && newRecord.id != record.id)) {
target = newRecord; // target = newRecord;
} // }
setRecord(target); // setRecord(target);
} // }
const handleExport = () => { const handleExport = () => {
if (reportList && reportList instanceof Array && reportList.length) { if (reportList && reportList instanceof Array && reportList.length) {
@ -487,7 +691,9 @@ const PatrolTable = (props) => {
<div className='card-protable'> <div className='card-protable'>
<Card > <Card >
<PatrolNameList <PatrolNameList
onChange={(record) => handleChangeRecord(record)} clientHeight={clientHeight} user={user}
dispatch={dispatch}
onChange={(record) => setRecord(record)}
record={record} record={record}
activeTabKey1={activeTabKey1} activeTabKey1={activeTabKey1}
userList={userList} userList={userList}
@ -542,8 +748,8 @@ const PatrolTable = (props) => {
); );
}; };
function mapStateToProps (state) { function mapStateToProps(state) {
const { auth, depMessage, userList, reportList, reportDetail } = state; const { auth, depMessage, userList, reportList, reportDetail, global } = state;
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
return { return {
@ -565,6 +771,8 @@ function mapStateToProps (state) {
reportListLoading: reportList.isRequesting, reportListLoading: reportList.isRequesting,
reportDetail: reportDetail.data, reportDetail: reportDetail.data,
reportDetailLoading: reportDetail.isRequesting, reportDetailLoading: reportDetail.isRequesting,
clientHeight: global.clientHeight,
}; };
} }
export default connect(mapStateToProps)(PatrolTable); export default connect(mapStateToProps)(PatrolTable);

15
web/client/src/sections/fillion/components/transportationTable.js

@ -3780,14 +3780,15 @@ const TransporTationTable = (props) => {
setGrade('村') setGrade('村')
}}>村道{activeKey === 'tab3'}</span>, }}>村道{activeKey === 'tab3'}</span>,
}, {
key: 'tab4',
label: <span onClick={() => {
setWhichofits('gongcheng')
setDifferentiate('project')
}}>工程一览{activeKey === 'tab4'}</span>,
}, },
// {
// key: 'tab4',
// label: <span onClick={() => {
// setWhichofits('gongcheng')
// setDifferentiate('project')
// }}>工程一览{activeKey === 'tab4'}</span>,
// },
], ],
}, },
}} }}

155
web/client/src/sections/fillion/containers/assess.js

@ -1,24 +1,167 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { getAssess, delAssess, editAssess } from '../actions/assess';
import ProTable from '@ant-design/pro-table';
import AssessModal from '../components/assessModal';
import { Form, Space, DatePicker, Button, Select, Popconfirm } from 'antd'
import moment from 'moment';
function Assess () { export const unitList = [
'县道',
'蒋巷镇',
'三江镇',
'塔城乡',
'泾口乡',
'八一乡',
'冈上镇',
'南新乡',
'富山乡',
'莲塘镇',
'金湖管理处',
'武阳镇',
'向塘镇',
'幽兰镇',
'广福镇',
'塘南镇',
'银三角管委会',
'黄马乡',
]
function Assess (props) {
const { dispatch, assess } = props;
const [assessModalVisible, setAssessModalVisible] = useState(false);
const [editData, setEditData] = useState(null);
const [query, setQuery] = useState({ page: 1, pageSize: 10 })
const [loading, setLoading] = useState(false);
const [isCheck, setIsCheck] = useState(false)
useEffect(() => { useEffect(() => {
return () => { };
return () => {
};
}, []); }, []);
useEffect(() => {
getData()
}, [query])
const getData = () => {
setLoading(true)
dispatch(getAssess(query)).then(res => {
setLoading(false)
})
}
return ( return (
<div> <div>
<div style={{ marginBottom: '20px', display: 'flex', justifyContent: 'space-between' }}>
<Form layout="inline" onFinish={(v) => {
setQuery({ ...query, unit: v.unit, month: v.month ? moment(v.month).format() : undefined })
}}>
<Form.Item name="unit" label="责任单位" >
<Select style={{ width: 200 }} placeholder="全部" allowClear>
{
unitList.map(item => (
<Option value={item} key={item} />
))
}
</Select>
</Form.Item>
<Form.Item name="month" label="考核月份">
<DatePicker picker="month" style={{ width: 200 }} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">搜索</Button>
</Form.Item>
</Form>
<Button type="primary" onClick={() => {
setAssessModalVisible(true)
}}>新增</Button>
</div>
<ProTable
columns={[{
title: '责任单位',
dataIndex: 'unit',
key: 'unit',
},
{
title: '考核月份',
dataIndex: 'month',
key: 'month',
render: (text, record) => (
text ? moment(record.month).format('YYYY-MM') : ''
)
},
{
title: '考核得分',
dataIndex: 'totalPoints',
key: 'totalPoints',
},
{
title: '操作',
key: 'action',
render: (text, record) => (
<span>
<Button type="link" onClick={() => {
setAssessModalVisible(true)
setEditData(record)
setIsCheck(true)
}}>详情</Button>
<Button type="link" onClick={() => {
setAssessModalVisible(true)
setEditData(record)
}}>编辑</Button>
<Popconfirm
title="确定删除此条数据吗?"
onConfirm={() => {
setLoading(true)
dispatch(delAssess({ id: record.id })).then(res => {
setLoading(false)
if (res.success) {
getData()
}
})
}}
>
<Button type="link" danger>删除</Button>
</Popconfirm>
</span>
),
},]}
dataSource={assess.rows || []}
loading={loading}
pagination={{
total: assess?.count || 0,
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,
onChange: (page, pageSize) => {
setQuery({
...query,
page, limit: pageSize
})
}
}}
rowKey="key"
toolBarRender={false}
search={false}
/>
{
assessModalVisible ? <AssessModal check={isCheck} visible={assessModalVisible} editData={editData} onCancel={() => {
getData()
setIsCheck(false)
setEditData(null)
setAssessModalVisible(false)
}} /> : ''
}
</div> </div>
); );
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth } = state const { auth, assess } = state
return { return {
user: auth.user, user: auth.user,
assess: assess.data || [],
} }
} }
export default connect(mapStateToProps)(Assess); export default connect(mapStateToProps)(Assess);

41
web/client/src/sections/fillion/containers/building.js

@ -0,0 +1,41 @@
'use strict';
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
// import { Spin, Button, Popconfirm } from 'antd';
// import ProTable from '@ant-design/pro-table';
// //import './protable.less'
import moment from 'moment';
// import { getRoadway, getProject, delRoadway, delProject } from "../actions/infor"
// import UserModal from './infor/details';
// import ProjectModal from './project/project';
const Building = (props) => {
return (
<div>
hha
</div>
)
}
function mapStateToProps(state) {
const { auth, depMessage } = state;
// const pakData = (dep) => {
// return dep.map((d) => {
// return {
// title: d.name,
// value: d.id,
// // children: d.type >= 2 ? [] : pakData(d.subordinate)
// children: pakData(d.subordinate)
// }
// })
// }
// let depData = pakData(depMessage.data || [])
return {
user: auth.user,
// depMessage: depMessage.data || [],
// depLoading: depMessage.isRequesting,
// depData,
};
}
export default connect(mapStateToProps)(Building);

10
web/client/src/sections/fillion/containers/index.js

@ -14,4 +14,12 @@ import Patrol from './patrol';
import File from './file'; import File from './file';
import Jiekouguanli from './jiekouguanli'; import Jiekouguanli from './jiekouguanli';
import Task from './task' import Task from './task'
export { Infor, transportation, BridgeTable, HigHways, OperaTional, Enforce, Public, Videois, PromoTional, Maintenance, Patrol, File, Jiekouguanli, Task }; import Assess from './assess'
import VideoCenter from './videoCenter';
import Building from './building'
export {
Infor, transportation, BridgeTable, HigHways,
OperaTional, Enforce, Public, Videois, PromoTional,
Maintenance, Patrol, File, Jiekouguanli,
Task, Building, Assess, VideoCenter
};

30
web/client/src/sections/fillion/containers/videoCenter.js

@ -0,0 +1,30 @@
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { getAssess, delAssess, editAssess } from '../actions/assess';
import ProTable from '@ant-design/pro-table';
import AssessModal from '../components/assessModal';
import { Form, Space, DatePicker, Button, Select, Popconfirm } from 'antd'
import moment from 'moment';
function VideoCenter (props) {
const { dispatch, vcmpWebUrl, vcmpMirrorId } = props;
useEffect(() => {
return () => { };
}, []);
return (
<div>
<iframe src={`${vcmpWebUrl}/callService?mid=${vcmpMirrorId}`} style={{ height: 'calc(100vh - 142px)', width: '100%', display: 'block' }} frameBorder={0}></iframe>
</div>
);
}
function mapStateToProps (state) {
const { auth, global } = state
return {
user: auth.user,
vcmpWebUrl: global.vcmpWebUrl,
vcmpMirrorId: global.vcmpMirrorId,
}
}
export default connect(mapStateToProps)(VideoCenter);

25
web/client/src/sections/fillion/nav-item.js

@ -26,8 +26,8 @@ export function getNavItem(user, dispatch) {
<Link to="/fillion/infor">治超管理</Link> <Link to="/fillion/infor">治超管理</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{/* <Menu.Item key="filliontask"> {/* <Menu.Item key="filliontask">
<Link to="/fillion/task">任务管理</Link> <Link to="/fillion/task">任务管理</Link>
</Menu.Item> */} </Menu.Item> */}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')?.length !== 0 ? {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')?.length !== 0 ?
<Menu.Item key="filliontransportation"> <Menu.Item key="filliontransportation">
<Link to="/fillion/transportation">道路管理</Link> <Link to="/fillion/transportation">道路管理</Link>
@ -55,6 +55,16 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionpatrol"> <Menu.Item key="fillionpatrol">
<Link to="/fillion/patrol">巡查管理</Link> <Link to="/fillion/patrol">巡查管理</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolanomaly">
<Link to="/fillion/patrol_anomaly">异常反馈</Link>
</Menu.Item> : ''}
{/* {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
: ''} */}
<Menu.Item key="fillionbuilding">
<Link to="/fillion/building">在建项目</Link>
</Menu.Item>
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICTRANSPORTMANAGE')?.length !== 0 ? {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICTRANSPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpublic"> <Menu.Item key="fillionpublic">
<Link to="/fillion/public">公交管理</Link> <Link to="/fillion/public">公交管理</Link>
@ -74,16 +84,19 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionpromotional"> <Menu.Item key="fillionpromotional">
<Link to="/fillion/promotional">宣传视频</Link> <Link to="/fillion/promotional">宣传视频</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolanomaly">
<Link to="/fillion/patrol_anomaly">异常反馈</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'REPORTMANAGE')?.length !== 0 ? {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'REPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolroad"> <Menu.Item key="fillionpatrolroad">
<Link to="/fillion/patrol_road">建设上报</Link> <Link to="/fillion/patrol_road">建设上报</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
<Menu.Item key="fillionassess">
<Link to="/fillion/assess">考核评分</Link>
</Menu.Item>
<Menu.Item key="fillionvideoCenter">
<Link to="/fillion/videoCenter">视频中心</Link>
</Menu.Item>
</SubMenu> : null </SubMenu> : null
); );
} }

52
web/client/src/sections/fillion/routes.js

@ -12,7 +12,9 @@ import { Maintenance } from './containers'
import { Patrol } from './containers' import { Patrol } from './containers'
import { File } from './containers'; import { File } from './containers';
import { Jiekouguanli } from './containers' import { Jiekouguanli } from './containers'
import { Task } from './containers' import { Task, Assess, VideoCenter, } from './containers'
import { Building } from './containers'
export default [{ export default [{
type: 'inner', type: 'inner',
route: { route: {
@ -27,18 +29,31 @@ export default [{
menuSelectKeys: ['fillioninfor'], menuSelectKeys: ['fillioninfor'],
component: Infor, component: Infor,
breadcrumb: '治超管理', breadcrumb: '治超管理',
authCode: 'OVERLOADMANAGE'
}, { }, {
path: '/task', path: '/task',
key: 'filliontask', key: 'filliontask',
menuSelectKeys: ['filliontask'], menuSelectKeys: ['filliontask'],
component: Task, component: Task,
breadcrumb: '任务管理', breadcrumb: '任务管理',
//authCode: 'OVERLOADMANAGE'
}, { }, {
path: '/transportation', path: '/transportation',
key: 'filliontransportation', key: 'filliontransportation',
menuSelectKeys: ['filliontransportation'], menuSelectKeys: ['filliontransportation'],
component: transportation, component: transportation,
breadcrumb: '道路管理', breadcrumb: '道路管理',
authCode: 'ROADMANAGE'
},
{
path: '/building',
key: 'fillionbuilding',
menuSelectKeys: ['fillionbuilding'],
component: Building,
breadcrumb: '在建项目',
//authCode: 'ROADMANAGE'
} }
, { , {
path: '/bridge', path: '/bridge',
@ -46,6 +61,8 @@ export default [{
menuSelectKeys: ['fillionbridge'], menuSelectKeys: ['fillionbridge'],
component: BridgeTable, component: BridgeTable,
breadcrumb: '桥梁管理', breadcrumb: '桥梁管理',
authCode: 'BRIDGEMANAGE'
} }
, { , {
path: '/highways', path: '/highways',
@ -53,12 +70,16 @@ export default [{
menuSelectKeys: ['fillionhighways'], menuSelectKeys: ['fillionhighways'],
component: HigHways, component: HigHways,
breadcrumb: '管养管理', breadcrumb: '管养管理',
authCode: 'MAINTENANCEMANAGE'
}, { }, {
path: '/operational', path: '/operational',
key: 'fillionoperational', key: 'fillionoperational',
menuSelectKeys: ['fillionoperational'], menuSelectKeys: ['fillionoperational'],
component: OperaTional, component: OperaTional,
breadcrumb: '运政管理', breadcrumb: '运政管理',
authCode: 'TRANSPORTATIONMANAGE'
}, { }, {
path: '/enforce', path: '/enforce',
key: 'fillionenforce', key: 'fillionenforce',
@ -71,30 +92,39 @@ export default [{
menuSelectKeys: ['fillionmaintenance'], menuSelectKeys: ['fillionmaintenance'],
component: Maintenance, component: Maintenance,
breadcrumb: '养护管理', breadcrumb: '养护管理',
authCode: 'CONSERVATIONMANAGE'
}, { }, {
path: '/patrol', path: '/patrol',
key: 'fillionpatrol', key: 'fillionpatrol',
menuSelectKeys: ['fillionpatrol'], menuSelectKeys: ['fillionpatrol'],
component: Patrol, component: Patrol,
breadcrumb: '巡查管理', breadcrumb: '巡查管理',
authCode: 'PATROLMANAGE'
}, { }, {
path: '/patrol_anomaly', path: '/patrol_anomaly',
key: 'fillionpatrolanomaly', key: 'fillionpatrolanomaly',
menuSelectKeys: ['fillionpatrolanomaly'], menuSelectKeys: ['fillionpatrolanomaly'],
component: Patrol, component: Patrol,
breadcrumb: '异常反馈', breadcrumb: '异常反馈',
authCode: 'FEEDBACKMANAGE'
}, { }, {
path: '/patrol_road', path: '/patrol_road',
key: 'fillionpatrolroad', key: 'fillionpatrolroad',
menuSelectKeys: ['fillionpatrolroad'], menuSelectKeys: ['fillionpatrolroad'],
component: Patrol, component: Patrol,
breadcrumb: '建设上报', breadcrumb: '建设上报',
authCode: 'REPORTMANAGE'
}, { }, {
path: '/public', path: '/public',
key: 'fillionpublic', key: 'fillionpublic',
menuSelectKeys: ['fillionpublic'], menuSelectKeys: ['fillionpublic'],
component: Public, component: Public,
breadcrumb: '公交管理', breadcrumb: '公交管理',
authCode: 'PUBLICTRANSPORTMANAGE'
}, },
{ {
path: '/file', path: '/file',
@ -102,6 +132,8 @@ export default [{
menuSelectKeys: ['fileCont'], menuSelectKeys: ['fileCont'],
component: File, component: File,
breadcrumb: '档案管理', breadcrumb: '档案管理',
authCode: 'FILEMANAGE'
}, },
{ {
path: '/videois', path: '/videois',
@ -109,6 +141,8 @@ export default [{
menuSelectKeys: ['fillionvideois'], menuSelectKeys: ['fillionvideois'],
component: Videois, component: Videois,
breadcrumb: '视频管理', breadcrumb: '视频管理',
authCode: 'PUBLICITYVIDEO'
}, },
{ {
path: '/jiekouguanli', path: '/jiekouguanli',
@ -116,13 +150,25 @@ export default [{
menuSelectKeys: ['jiekouguanli'], menuSelectKeys: ['jiekouguanli'],
component: Jiekouguanli, component: Jiekouguanli,
breadcrumb: '接口管理', breadcrumb: '接口管理',
} }, {
, {
path: '/promotional', path: '/promotional',
key: 'fillionpromotional', key: 'fillionpromotional',
menuSelectKeys: ['fillionpromotional'], menuSelectKeys: ['fillionpromotional'],
component: PromoTional, component: PromoTional,
breadcrumb: '视频管理', breadcrumb: '视频管理',
authCode: 'PUBLICITYVIDEO'
}, {
path: '/assess',
key: 'fillionassess',
menuSelectKeys: ['fillionassess'],
component: Assess,
breadcrumb: '考核评分',
}, {
path: '/videoCenter',
key: 'fillionvideoCenter',
menuSelectKeys: ['fillionvideoCenter'],
component: VideoCenter,
breadcrumb: '视频中心',
} }
] ]
} }

63
web/client/src/sections/organization/containers/authority.js

@ -10,7 +10,10 @@ const Authority = (props) => {
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const { dispatch, loading, depMessage, depUser, resource, userResource, clientHeight, user } = props const { dispatch, loading, depMessage, depUser, resource, userResource, clientHeight, user } = props
const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE', const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE',
'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE'] 'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE',
'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD'
]
const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员
const [depSelectedKeys, setDepSelectedKeys] = useState([]) const [depSelectedKeys, setDepSelectedKeys] = useState([])
const [userSelectedKeys, setUserSelectedKeys] = useState([]) const [userSelectedKeys, setUserSelectedKeys] = useState([])
const [depSelected, setDepSelected] = useState() const [depSelected, setDepSelected] = useState()
@ -26,6 +29,7 @@ const Authority = (props) => {
const [checkAll, setCheckAll] = useState(true); const [checkAll, setCheckAll] = useState(true);
const [rescheckAll, setrescheckAll] = useState(false) const [rescheckAll, setrescheckAll] = useState(false)
const [isshow, setisshow] = useState(false); const [isshow, setisshow] = useState(false);
let plainOptions = depUser.map(i => ({ label: i.name, value: i.id })); let plainOptions = depUser.map(i => ({ label: i.name, value: i.id }));
const [checkedList, setCheckedList] = useState(depUser.map(i => i.id)); const [checkedList, setCheckedList] = useState(depUser.map(i => i.id));
const onChange = (list) => { const onChange = (list) => {
@ -79,24 +83,45 @@ const Authority = (props) => {
useEffect(() => { useEffect(() => {
if (depMessage.length) { if (depMessage.length) {
console.log('depMessage', depMessage) console.log('depMessage', depMessage)
setdepMessagedata(depMessage) //超级管理员展示所有部门
setDepSelectedKeys([depMessage[0]?.id]) if (user?.username === 'SuperAdmin') {
setDepSelected([depMessage[0]?.name]) setdepMessagedata(depMessage)
dispatch(getDepUser(depMessage[0]?.id)) dispatch(getDepUser(depMessage[0]?.id))
setDepSelectedKeys([depMessage[0]?.id])
setDepSelected([depMessage[0]?.name])
} else {
//不是超级管理员,展示相应部门的数据
let authDep = []
depMessage.map((item) => {
if (item.id === user?.departmentId) {
authDep.push(item)
}
})
setdepMessagedata(authDep)
if (authDep.length > 0) {
dispatch(getDepUser(authDep[0]?.id))
setDepSelectedKeys([authDep[0]?.id])
setDepSelected([authDep[0]?.name])
}
}
} }
}, [depMessage]) }, [depMessage])
useEffect(() => { useEffect(() => {
if (depUser.length) { const copy = depUser.filter((item) => {
setUserSelectedKeys([depUser[0].id]) return item.name !== user.name//把自己筛选出去
setUserSelected(depUser[0].username) })
dispatch(getUserResource(depUser[0].id)) setDepUserCopy(copy)
setUseName(depUser[0].name) if (copy.length) {
setUserSelectedKeys([copy[0].id])
setUserSelected(copy[0].username)
dispatch(getUserResource(copy[0].id))
setUseName(copy[0].name)
} }
setCheckedList(depUser.map(i => i.id)) setCheckedList(copy.map(i => i.id))
}, [depUser]) }, [depUser])
// console.log(depUser,'用户信息') // console.log(depUser,'用户信息')
const handleSave = () => { const handleSave = () => {
@ -131,12 +156,12 @@ const Authority = (props) => {
selectedKeys={depSelectedKeys} selectedKeys={depSelectedKeys}
onSelect={(selectedKeys, { selected, selectedNodes, node }) => { onSelect={(selectedKeys, { selected, selectedNodes, node }) => {
setUserType(selectedNodes[0].type) setUserType(selectedNodes[0].type)
setCheckedList(depUser.map(i => i.id)) setCheckedList(depUserCopy.map(i => i.id))
// setResCode(userResource.map(i=>i.resourceId)) // setResCode(userResource.map(i=>i.resourceId))
if (selected) { if (selected) {
setCheckedList(depUser.map(i => i.id)) setCheckedList(depUserCopy.map(i => i.id))
setDepSelectedKeys(selectedKeys) setDepSelectedKeys(selectedKeys)
setDepSelected(selectedNodes[0].name || "") setDepSelected(selectedNodes[0].name || "")
dispatch(getDepUser(selectedKeys[0])) dispatch(getDepUser(selectedKeys[0]))
@ -159,10 +184,10 @@ const Authority = (props) => {
<Col span={4} style={{ height: '100%', }}> <Col span={4} style={{ height: '100%', }}>
<Card title={` 用户列表`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}> <Card title={` 用户列表`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
{ {
depUser.length ? depUserCopy?.length ?
<Tree <Tree
height={clientHeight - 100} height={clientHeight - 100}
defaultSelectedKeys={[depUser[0].id]} defaultSelectedKeys={[depUserCopy[0]?.id]}
selectedKeys={userSelectedKeys} selectedKeys={userSelectedKeys}
onSelect={(selectedKeys, { selected, selectedNodes, node, event }) => { onSelect={(selectedKeys, { selected, selectedNodes, node, event }) => {
const name = node.name const name = node.name
@ -178,7 +203,7 @@ const Authority = (props) => {
} }
}} }}
treeData={depUser} treeData={depUserCopy}
fieldNames={{ fieldNames={{
title: 'name', title: 'name',
key: 'id' key: 'id'
@ -200,7 +225,7 @@ const Authority = (props) => {
<Checkbox onChange={onshowchange} checked={isshow} disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')[0]?.isshow === "true" ? true : ''}> <Checkbox onChange={onshowchange} checked={isshow} disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')[0]?.isshow === "true" ? true : ''}>
不可编辑 不可编辑
</Checkbox> </Checkbox>
{depUser.length ? {depUserCopy?.length ?
<Card title={` 功能范围`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}> <Card title={` 功能范围`} bordered={false} bodyStyle={{ padding: 8, paddingTop: 24 }}>
{/* <Resource {/* <Resource
userSelected={userSelected} userSelected={userSelected}

39
web/client/src/sections/organization/containers/user.js

@ -27,7 +27,35 @@ const UserManage = (props) => {
const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员 const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员
const [uid, setuid] = useState() const [uid, setuid] = useState()
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'USERMANAGE')[0].isshow === "true" ? true : '')//控制操作(新增删除等操作,对应权限的'不可编辑')是否可操作 const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'USERMANAGE')[0].isshow === "true" ? true : '')//控制操作(新增删除等操作,对应权限的'不可编辑')是否可操作
const [depMessagedata, setdepMessagedata] = useState(depMessage)
useEffect(() => {
if (depMessage.length) {
console.log('depMessage', depMessage)
//超级管理员展示所有部门
if (user?.username === 'SuperAdmin') {
setdepMessagedata(depMessage)
setDepSelectedKeys([depMessage[0].id])
dispatch(getDepUser(depMessage[0].id))
} else {
//不是超级管理员,展示相应部门的数据
let authDep = []
depMessage.map((item) => {
if (item.id === user?.departmentId) {
authDep.push(item)
}
})
setdepMessagedata(authDep)
if (authDep.length > 0) {
setDepSelectedKeys([authDep[0].id])
dispatch(getDepUser(authDep[0].id))
}
}
}
}, [depMessage])
useEffect(() => { useEffect(() => {
let code = ['USERMANAGE', 'AUTHORIMANAGE'] let code = ['USERMANAGE', 'AUTHORIMANAGE']
//console.log('你來u盧克嗎', depUser, uid) //console.log('你來u盧克嗎', depUser, uid)
@ -43,15 +71,16 @@ const UserManage = (props) => {
}, []) }, [])
useEffect(() => { useEffect(() => {
console.log('depuser', depUser)
const copy = depUser.filter((item) => { const copy = depUser.filter((item) => {
return item.name !== user//把自己筛选出去 return item.name !== user.name//把自己筛选出去
}) })
setDepUserCopy(copy) setDepUserCopy(copy)
}, [depUser]) }, [depUser])
useEffect(() => { useEffect(() => {
if (depMessage.length) { if (depMessage.length) {
setDepSelectedKeys([depMessage[0].id])
dispatch(getDepUser(depMessage[0].id))
} }
}, [depMessage]) }, [depMessage])
@ -295,7 +324,7 @@ const UserManage = (props) => {
depMessage.length ? depMessage.length ?
<Tree <Tree
height={clientHeight - 95} height={clientHeight - 95}
defaultExpandedKeys={[depMessage[0].id]} defaultExpandedKeys={[depMessagedata[0]?.id]}
selectedKeys={depSelectedKeys} selectedKeys={depSelectedKeys}
onSelect={(selectedKeys, e) => { onSelect={(selectedKeys, e) => {
// console.log('selectedKeys:',selectedKeys); // console.log('selectedKeys:',selectedKeys);
@ -310,7 +339,7 @@ const UserManage = (props) => {
style={{ paddingTop: 20 }} style={{ paddingTop: 20 }}
> >
{ {
depMessage?.map((s, index) => { depMessagedata?.map((s, index) => {
return <TreeNode title={renderTree(s, s.id)} key={s.id} > return <TreeNode title={renderTree(s, s.id)} key={s.id} >
{ {
s.subordinate.map(k => { s.subordinate.map(k => {

3
web/client/src/sections/organization/routes.js

@ -15,6 +15,8 @@ export default [{
menuSelectKeys: ['userManage'], menuSelectKeys: ['userManage'],
component: UserManage, component: UserManage,
breadcrumb: '用户管理', breadcrumb: '用户管理',
authCode: 'USERMANAGE'
}, },
{ {
path: '/authority', path: '/authority',
@ -22,6 +24,7 @@ export default [{
menuSelectKeys: ['userAuthority'], menuSelectKeys: ['userAuthority'],
component: Authority, component: Authority,
breadcrumb: '权限管理', breadcrumb: '权限管理',
authCode: 'AUTHORIMANAGE'
} }
] ]

48
web/client/src/sections/quanju/actions/example.js

@ -3,7 +3,7 @@
import { basicAction } from '@peace/utils' import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils' import { ApiTable } from '$utils'
export function getMembers(orgId) { export function getMembers (orgId) {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -16,7 +16,7 @@ export function getMembers(orgId) {
//获取大屏道路统计信息 //获取大屏道路统计信息
export function getdaolutongji() { export function getdaolutongji () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -28,7 +28,7 @@ export function getdaolutongji() {
} }
//获取治超监测点处理数据信息 //获取治超监测点处理数据信息
export function getjiandmanage() { export function getjiandmanage () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -41,7 +41,7 @@ export function getjiandmanage() {
//获取治超详情列 //获取治超详情列
export function getjiandetail() { export function getjiandetail () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -53,7 +53,7 @@ export function getjiandetail() {
} }
// <<<<<<< HEAD // <<<<<<< HEAD
// 获取运政数据统计 // 获取运政数据统计
export function getyunzheng() { export function getyunzheng () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -64,7 +64,7 @@ export function getyunzheng() {
}); });
} }
// 获取道路养护数据统计及列表 // 获取道路养护数据统计及列表
export function getRoadmaintain() { export function getRoadmaintain () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -75,7 +75,7 @@ export function getRoadmaintain() {
}); });
} }
// 获取治超详情列 // 获取治超详情列
export function getZhichaolist() { export function getZhichaolist () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -88,7 +88,7 @@ export function getZhichaolist() {
} }
//获取宣传数据 //获取宣传数据
export function getxuanchuan() { export function getxuanchuan () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -100,7 +100,7 @@ export function getxuanchuan() {
} }
//获取公交车辆层级信息 //获取公交车辆层级信息
export function getBusTierList() { export function getBusTierList () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -112,7 +112,7 @@ export function getBusTierList() {
}); });
} }
//获取道路拥堵指数 //获取道路拥堵指数
export function getGodshuju() { export function getGodshuju () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -125,7 +125,7 @@ export function getGodshuju() {
} }
//获取路政列表 //获取路政列表
export function getHighwayList() { export function getHighwayList () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -136,7 +136,7 @@ export function getHighwayList() {
}); });
} }
//获取道路养护统计及列表 //获取道路养护统计及列表
export function getRoadMaintenanceList() { export function getRoadMaintenanceList () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -147,7 +147,7 @@ export function getRoadMaintenanceList() {
}); });
} }
//获取管养单位概况 //获取管养单位概况
export function getCustodyunit() { export function getCustodyunit () {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,
@ -156,4 +156,26 @@ export function getCustodyunit() {
msg: { error: '获取管养单位概况失败' }, msg: { error: '获取管养单位概况失败' },
// reducer: { name: 'roadMaintenances' } // reducer: { name: 'roadMaintenances' }
}); });
}
export function getNearestAssessData (query = {}) {
return dispatch => basicAction({
type: 'get',
query,
dispatch: dispatch,
actionType: 'GET_NEAREST_ASSESS_DATA',
url: ApiTable.nearestAssessData,
msg: { error: '获取各乡镇考核得分情况失败' },
});
}
export function getVideoCenterList () {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
actionType: 'GET_VIDEO_CENTER_LIST',
url: ApiTable.videoCenterList,
msg: { error: '获取视频中心列表失败' },
reducer: { name: 'videoCenterList' }
});
} }

6
web/client/src/sections/quanju/containers/example.js

@ -32,10 +32,10 @@ const Example = (props) => {
}}> }}>
<div style={{ width: "100%", height: "10%" }}> <div style={{ width: "100%", height: "10%" }}>
<Header tabChange={tabChange} tabKey={tabKey} dispatch={dispatch} /> <Header tabChange={tabChange} tabKey={tabKey} dispatch={dispatch} user={user} />
</div> </div>
<div style={{ position: 'absolute', width: "100%", height: "90%" }}> <div style={{ position: 'absolute', width: "100%", height: "90%" }}>
<Gis tabKey={tabKey}/> <Gis tabKey={tabKey} />
<Footer tabKey={tabKey} dispatch={dispatch} /> <Footer tabKey={tabKey} dispatch={dispatch} />
</div> </div>
@ -45,7 +45,7 @@ const Example = (props) => {
) )
} }
function mapStateToProps (state) { function mapStateToProps(state) {
const { auth, global, members } = state; const { auth, global, members } = state;
return { return {
loading: members.isRequesting, loading: members.isRequesting,

109
web/client/src/sections/quanju/containers/footer/conserve/left/left-center.js

@ -6,33 +6,114 @@ import * as echarts from 'echarts';
import ZheXian from "./zhexin" import ZheXian from "./zhexin"
import PieChart from "./shituzujian" import PieChart from "./shituzujian"
import Lunbo from './lunbo'; import Lunbo from './lunbo';
import { connect } from 'react-redux'
import ReactECharts from 'echarts-for-react';
import { getNearestAssessData } from "../../../../actions/example"
import moment from 'moment'
const LeftCenter = (props) => { const LeftCenter = (props) => {
const { data, shuju } = props const { data, shuju, dispatch } = props
const style = { height: "31%", marginTop: "3%" } const style = { height: "31%", marginTop: "3%" }
// const chartRef = useState(); // const chartRef = useState();
// const { roadData } = props // const { roadData } = props
const [flag, setFlag] = useState(true) const [flag, setFlag] = useState(true)
// const [colorFlage, setColorFlage] = useState(true) // const [colorFlage, setColorFlage] = useState(true)
const [chartData, setChartData] = useState({
series: [],
xAxis: []
})
useEffect(() => {
dispatch(getNearestAssessData({ monthRange: 6 })).then(res => {
if (res.success) {
let nextChartSeries = []
let nextXAxis = new Set()
let data = res.payload.data
data.reverse()
for (let d of data) {
let corUnitSeries = nextChartSeries.find(item => item.name == d.unit)
let month = moment(d.month).format('YYYY-MM')
nextXAxis.add(month)
if (corUnitSeries) {
corUnitSeries.data.push(d.totalPoints)
} else {
nextChartSeries.push({
type: 'line',
smooth: true,
data: [d.totalPoints],
name: d.unit,
})
}
}
setChartData({
series: nextChartSeries,
xAxis: [...nextXAxis]
})
}
})
}, [])
return ( return (
<> <>
<Module style={style} title={"各乡镇养护里程及费用"}> <Module style={style} title={"各乡镇养护得分趋势"}>
<div onClick={() => {
setFlag(false)
}} style={{ position: "absolute", top: "38.5%", left: "80%", width: "50px", height: "20px", background: "linear-gradient(270deg, rgba(15,74,159,0) 0%, rgba(17,75,160,0.95) 100%)", float: "right", textAlign: "center", zIndex: 100, marginRight: "4%", borderLeft: "solid 2px #6E7A83" }} >
{/* <img /> */}
<p style={{ color: "rgba(216,240,255,0.8000)", fontSize: "0.4vh", lineHeight: "20px",/* position: "absolute", top: "0px" */ color:`${flag?'rgba(216,240,255,0.8000)':'#07b9fe'}`,marginTop:0}}>累计</p></div>
<div onClick={() => {
setFlag(true)
}} style={{ position: "absolute", width: "50px", left: "60%", top: "38.5%", height: "20px", background: "linear-gradient(270deg, rgba(15,74,159,0) 0%, rgba(17,75,160,0.95) 100%)", float: "right", textAlign: "center", zIndex: 100, marginRight: "2%", borderLeft: "solid 2px #6E7A83", }}>
{/* <img /> */}
<p style={{ color: "rgba(216,240,255,0.8000)", fontSize: "0.4vh", lineHeight: "20px",/* position: "absolute", top: "0px" */ color:`${flag?'#07b9fe':'rgba(216,240,255,0.8000)'}`}} >上月</p></div >
{ {
flag ? <Lunbo data={data} /> : <ZheXian shuju={shuju} /> false ?
<>
<div onClick={() => {
setFlag(false)
}} style={{ position: "absolute", top: "38.5%", left: "80%", width: "50px", height: "20px", background: "linear-gradient(270deg, rgba(15,74,159,0) 0%, rgba(17,75,160,0.95) 100%)", float: "right", textAlign: "center", zIndex: 100, marginRight: "4%", borderLeft: "solid 2px #6E7A83" }} >
{/* <img /> */}
<p style={{ color: "rgba(216,240,255,0.8000)", fontSize: "0.4vh", lineHeight: "20px",/* position: "absolute", top: "0px" */ color: `${flag ? 'rgba(216,240,255,0.8000)' : '#07b9fe'}`, marginTop: 0 }}>累计</p></div>
<div onClick={() => {
setFlag(true)
}} style={{ position: "absolute", width: "50px", left: "60%", top: "38.5%", height: "20px", background: "linear-gradient(270deg, rgba(15,74,159,0) 0%, rgba(17,75,160,0.95) 100%)", float: "right", textAlign: "center", zIndex: 100, marginRight: "2%", borderLeft: "solid 2px #6E7A83", }}>
{/* <img /> */}
<p style={{ color: "rgba(216,240,255,0.8000)", fontSize: "0.4vh", lineHeight: "20px",/* position: "absolute", top: "0px" */ color: `${flag ? '#07b9fe' : 'rgba(216,240,255,0.8000)'}` }} >上月</p></div >
{
flag ? <Lunbo data={data} /> : <ZheXian shuju={shuju} />
}
</> : ''
} }
<ReactECharts
notMerge={true}
lazyUpdate={true}
option={{
xAxis: {
type: 'category',
data: chartData.xAxis,
boundaryGap: false,
axisTick: {
show: false
}
},
yAxis: {
type: 'value',
splitLine: {
show: false
}
},
tooltip: {
trigger: "axis"
},
series: chartData.series,
grid: {
left: '3%',
right: '12%',
bottom: '21%',
top: '4%',
containLabel: true
},
}}
/>
</Module> </Module>
</> </>
) )
} }
export default LeftCenter function mapStateToProps (state) {
return {
}
}
export default connect(mapStateToProps)(LeftCenter)

162
web/client/src/sections/quanju/containers/footer/conserve/right/right-center.js

@ -1,61 +1,123 @@
import React from 'react' import React from 'react'
import Module from '../../../public/module' import Module from '../../../public/module'
import { Col, Row } from 'antd' import { Col, Row } from 'antd'
import { useEffect, useState } from 'react'
import { connect } from 'react-redux'
import ReactECharts from 'echarts-for-react';
import { getNearestAssessData } from "../../../../actions/example"
// const unit =['个','个',] // const unit =['个','个',]
const icon = [ const icon = [
'assets/images/quanju/jiancha.png', 'assets/images/quanju/jiancha.png',
'assets/images/quanju/yushui.png', 'assets/images/quanju/yushui.png',
'assets/images/quanju/lupai.png', 'assets/images/quanju/lupai.png',
'assets/images/quanju/zerenpai.png' 'assets/images/quanju/zerenpai.png'
] ]
const RightCenter = (props) => { const RightCenter = (props) => {
const { highwaysData } = props const { highwaysData, dispatch } = props
const style = { height: "31%", marginTop: "3%" }
const textStyle = { fontSize: 14, color: '#E9F7FF' } const [data, setData] = useState([])
const numStyle = { color: '#fff', fontSize: 21, fontFamily: 'YouSheBiaoTiHei', textShadow: '0px 0px 8px #1C60FE', marginTop: 8 }
let list = highwaysData?.sort((a, b) => a.id - b.id) const style = { height: "31%", marginTop: "3%" }
list = highwaysData?.slice(4, 8).map((h,index)=>{ // const textStyle = { fontSize: 14, color: '#E9F7FF' }
// const numStyle = { color: '#fff', fontSize: 21, fontFamily: 'YouSheBiaoTiHei', textShadow: '0px 0px 8px #1C60FE', marginTop: 8 }
// let list = highwaysData?.sort((a, b) => a.id - b.id)
// list = highwaysData?.slice(4, 8).map((h, index) => {
// return {
// id: h.id,
// name: h.name,
// count: h.count,
// // unit:unit[index],
// icon: icon[index]
// }
// })
// const arrayChunk = (array, size) => {
// let data = []
// for (let i = 0; i < array.length; i += size) {
// data.push(array.slice(i, i + size))
// }
// return data
// }
// let lists = list ? arrayChunk(list, 2) : []
useEffect(() => {
dispatch(getNearestAssessData()).then(res => {
if (res.success) {
setData(res.payload.data)
}
})
}, [])
return (
<>
<Module style={style} title={"各乡镇考核得分情况"}>
<div style={{ paddingLeft: '8%' }}>
{/* {
lists?.map((item, index) => {
return <div style={{ display: 'flex', marginTop: "5%", justifyContent: 'space-around' }} key={index}>
{
item?.map(i => (
<div style={{ display: 'flex', width: '50%' }} key={i.id}>
<img src={'/' + i.icon} alt='icon' style={{ width: '36%', height: '100%' }} />
<div style={{ marginLeft: 10 }}>
<div style={textStyle}>{i.name}</div>
<div style={numStyle}>{`${i.count}`}</div>
</div>
</div>
))
}
</div>
})
} */}
<ReactECharts
notMerge={true}
lazyUpdate={true}
option={{
xAxis: {
type: 'category',
data: data.map(d => d.unit),
axisTick: {
show: false
}
},
yAxis: {
type: 'value',
splitLine: {
show: false
}
},
tooltip: {
trigger: "axis"
},
series: [
{
data: data.map(d => d.totalPoints),
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
}
}
],
grid: {
left: '3%',
right: '4%',
bottom: '21%',
top: '4%',
containLabel: true
},
}}
/>
</div>
</Module>
</>
)
}
function mapStateToProps (state) {
return { return {
id:h.id,
name:h.name,
count:h.count,
// unit:unit[index],
icon:icon[index]
}
})
const arrayChunk = (array, size) => {
let data = []
for (let i = 0; i < array.length; i += size) {
data.push(array.slice(i, i + size))
} }
return data
}
let lists = list ? arrayChunk(list, 2) : []
return (
<>
<Module style={style} title={"各类附属设施数量统计"}>
<div style={{ paddingLeft: '8%' }}>
{
lists?.map((item, index) => {
return <div style={{ display: 'flex', marginTop: "5%", justifyContent: 'space-around' }} key={index}>
{
item?.map(i => (
<div style={{ display: 'flex', width: '50%' }} key={i.id}>
<img src={'/'+i.icon} alt='icon' style={{ width: '36%', height: '100%' }} />
<div style={{ marginLeft: 10 }}>
<div style={textStyle}>{i.name}</div>
<div style={numStyle}>{`${i.count}`}</div>
</div>
</div>
))
}
</div>
})
}
</div>
</Module>
</>
)
} }
export default RightCenter export default connect(mapStateToProps)(RightCenter)

163
web/client/src/sections/quanju/containers/footer/conserve/right/right-top.js

@ -1,46 +1,123 @@
import { Col, Row } from 'antd' import { Col, Row } from 'antd'
import React, { useState, useEffect } from 'react' import React, { useState, useEffect } from 'react'
import Module from '../../../public/module' import Module from '../../../public/module'
import { connect } from 'react-redux'
import Lun from "../../leadership/right/lunbo"
import { getRoadmaintain } from "../../../../actions/example"
import Hua from "../../leadership/right/hudong"
import moment from 'moment'
const iconSrc = [ const iconSrc = [
'assets/images/quanju/biaoxian.png', 'assets/images/quanju/biaoxian.png',
'assets/images/quanju/renxing.png', 'assets/images/quanju/renxing.png',
'assets/images/quanju/biaozhi.png', 'assets/images/quanju/biaozhi.png',
'assets/images/quanju/fanghu.png' 'assets/images/quanju/fanghu.png'
] ]
const unit = ['km', '处', '个', 'km'] const unit = ['km', '处', '个', 'km']
const RightTop = (props) => { const RightTop = (props) => {
const { highwaysData } = props const { highwaysData, dispatch } = props
const style = { height: "31%", marginTop: "3%" } const [roadmaintainList, setRoadmaintainList] = useState([])
const textStyle = { fontSize: 14, color: '#E9F7FF' } const [beijing, setBeijing] = useState()
const numStyle = { color: '#fff', fontSize: 21, fontFamily: 'YouSheBiaoTiHei', textShadow: '0px 0px 8px #1C60FE', marginTop: 8 } const [num, setNum] = useState()
let list = highwaysData?.sort((a, b) => a.id - b.id)
list = highwaysData?.slice(0, 4).map((h, index) => {
return {
id: h.id,
name: h.name,
count: h.count,
unit: unit[index],
icon: iconSrc[index]
} const style = { height: "31%", marginTop: "3%" }
}) // const textStyle = { fontSize: 14, color: '#E9F7FF' }
// const numStyle = { color: '#fff', fontSize: 21, fontFamily: 'YouSheBiaoTiHei', textShadow: '0px 0px 8px #1C60FE', marginTop: 8 }
// let list = highwaysData?.sort((a, b) => a.id - b.id)
// list = highwaysData?.slice(0, 4).map((h, index) => {
// return {
// id: h.id,
// name: h.name,
// count: h.count,
// unit: unit[index],
// icon: iconSrc[index]
// }
// })
const arrayChunk = (array, size) => { // const arrayChunk = (array, size) => {
let data = [] // let data = []
for (let i = 0; i < array.length; i += size) { // for (let i = 0; i < array.length; i += size) {
data.push(array.slice(i, i + size)) // data.push(array.slice(i, i + size))
// }
// return data
// }
// let lists = list ? arrayChunk(list, 2) : []
useEffect(() => {
dispatch(getRoadmaintain()).then((res) => {
setRoadmaintainList(res.payload.data.reportList.filter((item, index) => {
return item.projectType == "road"
}))
})
}, [])
const renderBody = () => {
return (
<div style={{ width: "100%", height: "100%" }}>
{
roadmaintainList.map((item, index) => {
return (
<li className={index} style={{
height: "20px", position: "relative", width: "100%", color: "#FFFFFF", marginTop: index == 0 ? "4px" : "5px", listStyle: "none", fontSize: "14px"
}} onMouseEnter={() => {
setBeijing(index)
setNum(index)
}} onMouseLeave={() => {
setBeijing()
setNum()
}}>
{beijing == index ? <img src='/assets/images/leadership/shezhi.png' style={{ width: "2%", height: "80%", position: "absolute", top: "12%", left: "1%" }} /> : ""}
{beijing == index ? <img src='/assets/images/leadership/lan.png' style={{ width: "100%", height: "120%", position: "absolute", right: "5%" }} /> : ""}
<p style={{ textAlign: "center", width: "40%", position: "absolute", right: "28.5%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }} >{item?.user?.name || '--'}</p>
<p style={{ textAlign: "left", width: "30%", position: "absolute", left: "5%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }} >{item.road ? item.road : "--"}</p>
<p style={{ textAlign: "right", width: "30%", position: "absolute", right: "3%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }}>
{
item.time ?
moment(item.time).format("YYYY-MM-DD")
: "--"
}
</p>
{
num == index ?
<div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, right: "24%", marginTop: "0", top: "25%" }}>
<img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} />
<div style={{ width: "50%", height: "100%", position: "absolute", top: "0", }}>
<Hua shuzu={[{
"imgs": item.conserveAfterPic ?
item.conserveAfterPic[0] : ""
}, {
"imgs": item.conserveBeforePic ?
item.conserveBeforePic[0] : ""
}, {
"imgs": item.conserveUnderwayPic ?
item.conserveUnderwayPic[0] : ""
}]} />
</div>
<div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}>
<p style={{ marginTop: "20px", color: "#FFFFFF", fontSize: "16px", fontFamily: "YouSheBiaoTiHei" }}>
{item.roadSectionStart ? item.roadSectionStart : ""}{item.roadSectionStart && item.roadSectionEnd ? "——" : ""}{item.roadSectionEnd ? item.roadSectionEnd : ""}{item.roadSectionStart || item.roadSectionEnd ? "" : "--"}
</p>
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>养护类型<span style={{ color: "#EEF4FF", marginLeft: "30px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>日常养护</span></p>
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>负责人<span style={{ color: "#EEF4FF", marginLeft: "45px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.user?.name ? item.user.name : "--"}</span></p>
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "60px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{moment(item.time).format("YYYY-MM-DD") ? moment(item.time).format("YYYY-MM-DD") : "--"}</span></p>
</div>
</div> : ""
}
</li>
)
})
}
</div>
)
} }
return data
} return (
let lists = list ? arrayChunk(list, 2) : [] <>
return ( <Module style={style} title={"养护详情"}>
<> <div style={{ paddingLeft: '8%', height: '100%' }}>
<Module style={style} title={"道路设施数量统计"}> {/* {
<div style={{ paddingLeft: '8%' }}>
{
lists?.map((item, index) => { lists?.map((item, index) => {
return <div style={{ display: 'flex', marginTop: "5%", justifyContent: 'space-around' }} key={index}> return <div style={{ display: 'flex', marginTop: "5%", justifyContent: 'space-around' }} key={index}>
{ {
@ -56,10 +133,22 @@ const RightTop = (props) => {
} }
</div> </div>
}) })
} } */}
</div> <Lun
</Module> // canScroll={true}
</> content={renderBody()}
) containerStyle={{ height: "100%", width: "90%" }}
divHeight={"100%"}
divId={"screen"}
/>
</div>
</Module>
</>
)
}
function mapStateToProps (state) {
return {
}
} }
export default RightTop export default connect(mapStateToProps)(RightTop)

17
web/client/src/sections/quanju/containers/footer/leadership/index.js

@ -1,19 +1,30 @@
import React from 'react' import React, { useEffect, useState } from 'react'
import Left from './left' import Left from './left'
import Right from './right' import Right from './right'
import CenterLeft from "./centerLeft" import CenterLeft from "./centerLeft"
import Centerright from "./centerRight" import Centerright from "./centerRight"
import { connect } from 'react-redux'
import { getNearestAssessData, getVideoCenterList } from "../../../actions/example"
const Leadership = (props) => { const Leadership = (props) => {
const { dispatch } = props const { dispatch } = props
useEffect(() => {
dispatch(getVideoCenterList())
}, [])
return ( return (
<> <>
<Left dispatch={dispatch} /> <Left dispatch={dispatch} />
<CenterLeft dispatch={dispatch} /> <CenterLeft dispatch={dispatch} />
<Right dispatch={dispatch} /> <Right dispatch={dispatch} />
{/* <Centerright /> */} {/* <Centerright /> */}
</> </>
) )
} }
export default Leadership function mapStateToProps (state) {
return {
}
}
export default connect(mapStateToProps)(Leadership)

205
web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js

@ -1,95 +1,130 @@
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import Module from '../../../public/module' import Module from '../../../public/module'
import Lunbo from "../right/lunbo" import Lunbo from "../right/lunbo"
import { connect } from 'react-redux'
import { YSIframePlayer } from '../../../../../../components'
// import "./left.less" // import "./left.less"
const Leftcenter = () => { const Leftcenter = ({ videoCenterList }) => {
const style = { height: "30%", marginTop: "5%" } const style = { height: "30%", marginTop: "5%" }
// const hualun = "auto" // const hualun = "auto"
const [num, setNum] = useState(1); const [num, setNum] = useState(1);
const [tu, setTu] = useState(""); const [tu, setTu] = useState("");
const [name, setName] = useState(""); const [name, setName] = useState("");
const [list, setList] = useState([ const [list, setList] = useState([
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, // { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, // { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, // { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, // { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, // { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
// { name: '小蓝至东新', img: "/assets/images/leadership/shiyantu.png" },
])
useEffect(() => {
const timer = setInterval(() => {
if (num == list.length) {
setNum(1);
setTu(list[0].img);
} else {
setNum(num + 1);
setTu(list[num].img);
}
}, 2000);
return () => clearInterval(timer);
}, [num]);
const renderBody = () => {
return (
<div style={{ width: "100%", height: "55%" }}>{
list.map((item, index) => {
return (
// <div style={{ width: "100%", height: "100%" }} >
// {/* <div style={{ width: "100%", height: "100%", }}> */}
<li style={{ height: "20px", position: "relative", width: "100%", marginTop: index == 0 ? "4px" : "5px", listStyle: "none", borderLeft: num - 1 == index ? "2px solid #1C60FE" : "2px solid #113892", backgroundColor: "linear-gradient(to right, rgba(0,70,200,0.3000) , rgba(0,124,230,0))" }} onMouseEnter={() => {
setTu(item.img);
setNum(index + 1);
setName(item.name)
// console.log(list);
}}>
<p style={{ position: "absolute", color: num - 1 == index ? "#fff" : "rgba(216,240,255,0.8)", left: "10%" }}>{item.name}</p>
<img src='/assets/images/leadership/juxing.png' style={{ width: "100%", height: "100%", position: "absolute" }} />
</li>
// {/* </div> */}
// </div>
)
}) // { name: '小蓝至东新', img: "/assets/images/leadership/shiyantu.png" },
} ])
</div >
)
}
return (
<>
<div style={{ width: "100%", height: "40px"/* , backgroundColor: "#fff" */, position: "relative" }}>
{/* <p>{title || []}</p> */}
<img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "20px", top: "20%" }} />
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "50px" }}>主要路段拥堵情况分析</span>
<img src='/assets/images/leadership/zibiaoti.png' style={{ width: "93%", height: "35px", position: "absolute", top: "8px", left: "35px" }} />
</div>
<div style={{ width: "100%", height: "100%", marginTop: "3%" }}>
<div style={{ width: "60%", height: "100%", float: "left", marginLeft: "1%" }}>
{
list.map((item, index) => {
return index + 1 == num ?
<div style={{ width: "100%", height: "100%", position: "relative" }}>
<img style={{ width: "100%",height:'100%', position: "absolute", bottom: "5%" }} src={item.img} /> useEffect(() => {
<p style={{ if (videoCenterList.length) {
width: "100%", height: "3vh", position: "absolute", bottom: "3%", setList(videoCenterList.slice(0, 5))
backgroundColor: "rgba(0,0,0,0.26)", lineHeight: "3vh", textAlign: "" }
}}> }, [videoCenterList])
<img src='/assets/images/leadership/weizhis.png' style={{ width: "5%", height: "60%", marginLeft: "3%" }} />
<span style={{ marginLeft: "3%", color: "#FFFFFF", fontSize: "12px", fontFamily: "PingFangSC-Regular, PingFang SC", fontWeight: 400 }}>{item.name}</span></p>
</div> : ""
}) useEffect(() => {
} const timer = setInterval(() => {
if (num == list.length) {
setNum(1);
// setTu(list[0].img);
} else {
setNum(num + 1);
// setTu(list[num].img);
}
}, 2000 * 10);
return () => clearInterval(timer);
}, [num]);
const renderBody = () => {
return (
<div style={{ width: "100%", height: "55%" }}>{
list.map((item, index) => {
return (
// <div style={{ width: "100%", height: "100%" }} >
// {/* <div style={{ width: "100%", height: "100%", }}> */}
<li style={{ height: "20px", position: "relative", width: "100%", marginTop: index == 0 ? "4px" : "5px", listStyle: "none", borderLeft: num - 1 == index ? "2px solid #1C60FE" : "2px solid #113892", backgroundColor: "linear-gradient(to right, rgba(0,70,200,0.3000) , rgba(0,124,230,0))" }} onMouseEnter={() => {
setTu(item.img);
setNum(index + 1);
setName(item.deviceName)
// console.log(list);
}}>
<p style={{ position: "absolute", color: num - 1 == index ? "#fff" : "rgba(216,240,255,0.8)", left: "10%" }}>{item.deviceName}</p>
<img src='/assets/images/leadership/juxing.png' style={{ width: "100%", height: "100%", position: "absolute" }} />
</li>
// {/* </div> */}
// </div>
)
})
}
</div >
)
}
return (
<>
<div style={{ width: "100%", height: "40px"/* , backgroundColor: "#fff" */, position: "relative" }}>
{/* <p>{title || []}</p> */}
<img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "20px", top: "20%" }} />
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "50px" }}>主要路段拥堵情况</span>
<img src='/assets/images/leadership/zibiaoti.png' style={{ width: "93%", height: "35px", position: "absolute", top: "8px", left: "35px" }} />
</div> </div>
<Lunbo <div style={{ width: "100%", height: "100%", marginTop: "3%" }}>
// canScroll={true} <div style={{ width: "60%", height: "100%", float: "left", marginLeft: "1%" }}>
content={renderBody()} {
containerStyle={{ position: "relative", height: "100%", width: "35%", float: "right", marginRight: "2%", marginTop: "1%" }} list.map((item, index) => {
divHeight={"100%"} console.log(item);
divId={"screen-slope-midde-top-jiangxi"} return index + 1 == num ?
/> <div style={{ width: "100%", height: "100%", position: "relative" }}>
</div>
</> {/* <img style={{ width: "100%", height: '100%', position: "absolute", bottom: "5%" }} src={item.img} /> */}
)
<YSIframePlayer
containerId={`yingshiPlay_${index}`}
height='100%'
width="100%"
url={`ezopen://open.ys7.com/${item.deviceSerial}/${item.channelNo || '1'}.live`}
audio="0"
ysToken={item.token}
videoState={{
status: item.status
}}
/>
<p style={{
width: "100%", height: "3vh", position: "absolute", bottom: "3%",
backgroundColor: "rgba(0,0,0,0.26)", lineHeight: "3vh", textAlign: ""
}}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "5%", height: "60%", marginLeft: "3%" }} />
<span style={{ marginLeft: "3%", color: "#FFFFFF", fontSize: "12px", fontFamily: "PingFangSC-Regular, PingFang SC", fontWeight: 400 }}>
{item.deviceName}
</span>
</p>
</div> : ""
})
}
</div>
<Lunbo
// canScroll={true}
content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "35%", float: "right", marginRight: "2%", marginTop: "1%" }}
divHeight={"100%"}
divId={"screen-slope-midde-top-jiangxi"}
/>
</div>
</>
)
}
function mapStateToProps (state) {
const { videoCenterList } = state
return {
videoCenterList: videoCenterList.data || []
}
} }
export default Leftcenter export default connect(mapStateToProps)(Leftcenter)

320
web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js

@ -1,108 +1,109 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import './left.less'; import './left.less';
class ReactCarousel extends Component { class ReactCarousel extends Component {
chunk (arr, size) { chunk (arr, size) {
var arr1 = new Array(); var arr1 = new Array();
for (var i = 0; i < Math.ceil(arr.length / size); i++) { for (var i = 0; i < Math.ceil(arr.length / size); i++) {
arr1[i] = new Array(); arr1[i] = new Array();
} }
var j = 0; var j = 0;
var x = 0; var x = 0;
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (!((i % size == 0) && (i != 0))) { if (!((i % size == 0) && (i != 0))) {
arr1[j][x] = arr[i]; arr1[j][x] = arr[i];
x++; x++;
} else { } else {
j++; j++;
x = 0; x = 0;
arr1[j][x] = arr[i]; arr1[j][x] = arr[i];
x++; x++;
} }
} }
return arr1; return arr1;
} }
constructor() { constructor() {
super(); super();
this.state = { this.state = {
shuzu: [ shuzu: [
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
], ],
imgs: [], imgs: [],
showIndex: 0, //显示第几个图片 showIndex: 0, //显示第几个图片
timer: null, // 定时器 timer: null, // 定时器
show: false, // 前后按钮显示 show: false, // 前后按钮显示
// arr1: "" // arr1: ""
} }
// console.log(this.state.imgs); // console.log(this.state.imgs);
this.state.imgs = this.chunk((this.state.shuzu), 4) this.state.imgs = this.chunk((this.state.shuzu), 4)
} }
render () { render () {
return ( console.log(this.props);
<div className="ReactCarousel" style={{ width: "100%", height: "100%" }}> return (
<div className="contain" <div className="ReactCarousel" style={{ width: "100%", height: "100%" }}>
onMouseEnter={() => { this.stop() }} //鼠标进入停止自动播放 <div className="contain"
onMouseLeave={() => { this.start() }} //鼠标退出自动播放 onMouseEnter={() => { this.stop() }} //鼠标进入停止自动播放
> onMouseLeave={() => { this.start() }} //鼠标退出自动播放
<ul className="ul"> >
{ <ul className="ul">
this.state.imgs.map((value, index) => { {
return ( this.state.imgs.map((value, index) => {
<li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''} return (
key={index} <li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''}
> key={index}
<div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[0].img})`, backgroundSize: 'cover', position: "absolute", left: "-3%", top: "5%" }}> >
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[0].img})`, backgroundSize: 'cover', position: "absolute", left: "-3%", top: "5%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
{value[0]?.name} <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
</div> {value[0]?.name}
</div> </div>
</div>
</div> </div>
{value[1]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[1].img})`, backgroundSize: 'cover', position: "absolute", left: "45%", top: "5%" }}> {value[1]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[1].img})`, backgroundSize: 'cover', position: "absolute", left: "45%", top: "5%" }}>
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value[1]?.name} {value[1]?.name}
</div> </div>
</div> </div>
</div> : ""} </div> : ""}
{value[2]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[0].img})`, backgroundSize: 'cover', position: "absolute", left: "-3%", top: "49%" }}> {value[2]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[0].img})`, backgroundSize: 'cover', position: "absolute", left: "-3%", top: "49%" }}>
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value[2]?.name} {value[2]?.name}
</div> </div>
</div> </div>
</div> : ""} </div> : ""}
{value[3]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[3].img})`, backgroundSize: 'cover', position: "absolute", left: "45%", top: "49%" }}> {value[3]?.name ? <div style={{ width: "45%", height: "40%", backgroundImage: `url(${value[3].img})`, backgroundSize: 'cover', position: "absolute", left: "45%", top: "49%" }}>
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value[3]?.name} {value[3]?.name}
</div> </div>
</div> </div>
</div> : ""} </div> : ""}
{/* <div>{value[1].name}</div> {/* <div>{value[1].name}</div>
<div>{value[2].name}</div> <div>{value[2].name}</div>
<div>{value[3].name}</div> */} <div>{value[3].name}</div> */}
</li> </li>
) )
}) })
} }
</ul> </ul>
{/* <ul className="dots" style={{ width: this.state.imgs.length * 20 + 'px' }}> {/* <ul className="dots" style={{ width: this.state.imgs.length * 20 + 'px' }}>
{ {
this.state.imgs.map((value, index) => { this.state.imgs.map((value, index) => {
return ( return (
@ -115,68 +116,71 @@ class ReactCarousel extends Component {
} }
</ul> */} </ul> */}
<div className="control" style={{ width: "100%", height: "10%" }}> <div className="control" style={{ width: "100%", height: "10%" }}>
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}> <span style={{ position: "absolute", top: "86%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}>
<img src='/assets/images/leadership/zuofanye.png' style={{ width: "100%", height: "100%" }} /> <img src='/assets/images/leadership/zuofanye.png' style={{ width: "100%", height: "100%" }} />
</span> </span>
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}> <span style={{ position: "absolute", top: "86%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}>
<img src='/assets/images/leadership/youofanye.png' style={{ width: "100%", height: "100%" }} /> <img src='/assets/images/leadership/youofanye.png' style={{ width: "100%", height: "100%" }} />
</span> </span>
</div> </div>
</div>
</div> </div>
</div> )
) }
} componentDidMount () { //一开始自动播放
componentDidMount () { //一开始自动播放 if(this.props.shuzu)
this.start(); setTimeout(() => {
} this.start();
}, 0)
}
componentWillUnmount () { //销毁前清除定时器 componentWillUnmount () { //销毁前清除定时器
this.stop(); this.stop();
} }
stop = () => { //暂停 stop = () => { //暂停
let { timer } = this.state; let { timer } = this.state;
clearInterval(timer); clearInterval(timer);
} }
start = () => { //开始 start = () => { //开始
let { timer } = this.state; let { timer } = this.state;
timer = setInterval(() => { timer = setInterval(() => {
this.next(); this.next();
}, 300000); }, 300000);
this.setState({ this.setState({
timer timer
}) })
} }
change = (index) => { //点击下面的按钮切换当前显示的图片 change = (index) => { //点击下面的按钮切换当前显示的图片
let { showIndex } = this.state; let { showIndex } = this.state;
showIndex = index; showIndex = index;
this.setState({ this.setState({
showIndex showIndex
}) })
} }
previous = (e) => { //上一张 previous = (e) => { //上一张
let ev = e || window.event; let ev = e || window.event;
let { showIndex, imgs } = this.state; let { showIndex, imgs } = this.state;
if (showIndex <= 0) { if (showIndex <= 0) {
showIndex = imgs.length - 1; showIndex = imgs.length - 1;
} else { } else {
showIndex--; showIndex--;
} }
this.setState({ this.setState({
showIndex showIndex
}) })
} }
next = (e) => { //下一张 next = (e) => { //下一张
let ev = e || window.event; let ev = e || window.event;
let { showIndex, imgs } = this.state; let { showIndex, imgs } = this.state;
if (showIndex >= imgs.length - 1) { if (showIndex >= imgs.length - 1) {
showIndex = 0; showIndex = 0;
} else { } else {
showIndex++; showIndex++;
} }
this.setState({ this.setState({
showIndex showIndex
}) })
} }
} }
export default ReactCarousel; export default ReactCarousel;

202
web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js

@ -0,0 +1,202 @@
import React, { Component } from 'react';
import './left.less';
import { connect } from 'react-redux'
import { YSIframePlayer } from '../../../../../../components'
class ReactCarousel extends Component {
chunk (arr, size) {
var arr1 = new Array();
for (var i = 0; i < Math.ceil(arr.length / size); i++) {
arr1[i] = new Array();
}
var j = 0;
var x = 0;
for (var i = 0; i < arr.length; i++) {
if (!((i % size == 0) && (i != 0))) {
arr1[j][x] = arr[i];
x++;
} else {
j++;
x = 0;
arr1[j][x] = arr[i];
x++;
}
}
return arr1;
}
constructor() {
super();
this.state = {
imgs: [],
showIndex: 0, //显示第几个图片
timer: null, // 定时器
show: false, // 前后按钮显示
}
}
renderVideo = (item, index) => {
return <YSIframePlayer
containerId={`yingshiPlay_lu_${index}`}
height='100%'
width="100%"
url={`ezopen://open.ys7.com/${item.deviceSerial}/${item.channelNo || '1'}.live`}
audio="0"
ysToken={item.token}
videoState={{
status: item.status
}}
/>
}
render () {
console.log(this.props);
const { imgs } = this.state
return (
<div className="ReactCarousel" style={{ width: "100%", height: "100%" }}>
<div className="contain"
onMouseEnter={() => { this.stop() }} //鼠标进入停止自动播放
onMouseLeave={() => { this.start() }} //鼠标退出自动播放
>
<ul className="ul">
{
this.state.imgs.map((value, index) => {
return (
<li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''}
key={index}
>
{
imgs.map((value, index) => {
if (index == 0) {
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "-3%", top: "5%" }}>
{this.renderVideo(value, index)}
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value?.deviceName}
</div>
</div>
</div> : ''
} else if (index == 1) {
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "45%", top: "5%" }}>
{this.renderVideo(value, index)}
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value?.deviceName}
</div>
</div>
</div> : ""
} else if (index == 2) {
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "-3%", top: "49%" }}>
{this.renderVideo(value, index)}
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value?.deviceName}
</div>
</div>
</div> : ""
} else if (index == 3) {
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "45%", top: "49%" }}>
{this.renderVideo(value, index)}
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
{value?.deviceName}
</div>
</div>
</div> : ""
} else {
return undefined
}
})
}
</li>
)
})
}
</ul>
{/* <div className="control" style={{ width: "100%", height: "10%" }}>
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}>
<img src='/assets/images/leadership/zuofanye.png' style={{ width: "100%", height: "100%" }} />
</span>
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}>
<img src='/assets/images/leadership/youofanye.png' style={{ width: "100%", height: "100%" }} />
</span>
</div> */}
</div>
</div>
)
}
componentWillReceiveProps (nextProps, oldProps) {
if (nextProps.videoCenterList && nextProps.videoCenterList.length && (!oldProps.videoCenterList || !oldProps.videoCenterList.length)) {
this.setState({
imgs: nextProps.videoCenterList.slice(-4)
})
}
}
componentDidMount () { //一开始自动播放
setTimeout(() => {
this.start();
}, 0)
}
componentWillUnmount () { //销毁前清除定时器
this.stop();
}
stop = () => { //暂停
let { timer } = this.state;
clearInterval(timer);
}
start = () => { //开始
let { timer } = this.state;
timer = setInterval(() => {
this.next();
}, 300000);
this.setState({
timer
})
}
change = (index) => { //点击下面的按钮切换当前显示的图片
let { showIndex } = this.state;
showIndex = index;
this.setState({
showIndex
})
}
previous = (e) => { //上一张
let ev = e || window.event;
let { showIndex, imgs } = this.state;
if (showIndex <= 0) {
showIndex = imgs.length - 1;
} else {
showIndex--;
}
this.setState({
showIndex
})
}
next = (e) => { //下一张
let ev = e || window.event;
let { showIndex, imgs } = this.state;
if (showIndex >= imgs.length - 1) {
showIndex = 0;
} else {
showIndex++;
}
this.setState({
showIndex
})
}
}
function mapStateToProps (state) {
const { videoCenterList } = state
return {
videoCenterList: videoCenterList.data || []
}
}
export default connect(mapStateToProps)(ReactCarousel)

6
web/client/src/sections/quanju/containers/footer/leadership/right/right-center.js

@ -2,8 +2,10 @@ import React from 'react'
const Rightcenter = () => { const Rightcenter = () => {
return ( return (
<><div style={{ width: /* width || */ "100%", height: /* height || */ "30%" }}> <>
</div></> <div style={{ width: /* width || */ "100%", height: /* height || */ "30%" }}>
</div>
</>
) )
} }
export default Rightcenter export default Rightcenter

253
web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js

@ -2,133 +2,152 @@ import React, { useState, useEffect } from 'react';
import Module from '../../../public/module' import Module from '../../../public/module'
import { Radio, Select, Spin } from 'antd'; import { Radio, Select, Spin } from 'antd';
import Lunbo from "./lunbo" import Lunbo from "./lunbo"
import Huadong from './hudong'; import Huadong from './hudongVideo';
import { connect } from 'react-redux'
import "./left.less" import "./left.less"
const Righttop = () => { const Righttop = ({ videoCenterList }) => {
const { Option } = Select; const { Option } = Select;
const style = { height: "68%" } const style = { height: "68%" }
const children = []; const children = [];
const [size, setSize] = useState('454544545'); const [size, setSize] = useState('454544545');
const [num, setNum] = useState(); const [num, setNum] = useState();
const [tu, setTu] = useState(""); const [tu, setTu] = useState("");
const [name, setName] = useState(""); const [name, setName] = useState("");
const handleChange = (value) => { const handleChange = (value) => {
// console.log(`Selected: ${value}`); // console.log(`Selected: ${value}`);
setSize(value) setSize(value)
}; };
const [list, setList] = useState([ const [list, setList] = useState([
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, // { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, // { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, // { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, // { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, // { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
{ name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" }, // { name: '沙潭至五星', img: "/assets/images/leadership/fake/1.jpg" },
{ name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" }, // { name: '滁槎至协城', img: "/assets/images/leadership/fake/2.jpg" },
{ name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" }, // { name: '瓜山至广福', img: "/assets/images/leadership/fake/3.jpg" },
{ name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" }, // { name: '罗舍至泗洪', img: "/assets/images/leadership/fake/4.jpg" },
{ name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" }, // { name: '渔业至万州', img: "/assets/images/leadership/fake/5.jpg" },
]) ])
for (let i = 0; i < list.length; i++) { // for (let i = 0; i < list.length; i++) {
children.push(<Option key={i.toString(36) + i}>{list[i].name}</Option>); // children.push(<Option key={i.toString(36) + i}>{list[i].name}</Option>);
} // }
// useEffect(() => { // useEffect(() => {
// const timer = setInterval(() => { // const timer = setInterval(() => {
// if (num == 12) { // if (num == 12) {
// setNum(1); // setNum(1);
// setTu(list[0].img); // setTu(list[0].img);
// } else { // } else {
// setNum(num + 1); // setNum(num + 1);
// setTu(list[num].img); // setTu(list[num].img);
// } // }
// }, 6000); // }, 6000);
// return () => clearInterval(timer); // return () => clearInterval(timer);
// }, [num]); // }, [num]);
const renderBody = () => {
return (
<div id='op' style={{ width: "100%", height: "55%" }}>{
list.map((item, index) => {
return (
<div style={{ width: "100%", height: "100%" }} >
<div style={{ width: "100%", height: "100%", }}>
<li className={index} style={{
height: "20px", position: "relative", width: "100%", color: "#FFFFFF", marginTop: index == 0 ? "4px" : "5px", listStyle: "none", fontSize: "14px"
}} onMouseEnter={() => {
// setTu(item.img);
setNum(index);
}} onMouseLeave={() => {
setNum()
}}>
{num == index ? <img src={item.img} style={{ width: "100%", height: "120%", position: "absolute", }} /> : ""}
{num == index ? <img src={item.img} style={{ width: "5%", height: "100%", position: "absolute", left: "-0.5%", top: "20%" }} /> : ""}
<p style={{ position: "absolute", left: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }} >{item.name}</p> useEffect(() => {
<p style={{ position: "absolute", right: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }}>{item.name}</p> if (videoCenterList.length) {
</li> setList(videoCenterList.slice(-4))
</div> }
</div> }, [videoCenterList])
) const renderBody = () => {
const offlineDevice = videoCenterList.filter(v => v.status == 0)
return (
<div id='op' style={{ width: "100%", height: "55%" }}>{
offlineDevice.length ? offlineDevice.map((item, index) => {
return (
<div style={{ width: "100%", height: "100%" }} >
<div style={{ width: "100%", height: "100%", }}>
<li className={index} style={{
height: "20px", position: "relative", width: "100%", color: "#FFFFFF", marginTop: index == 0 ? "4px" : "5px", listStyle: "none", fontSize: "14px"
}} onMouseEnter={() => {
// setTu(item.img);
setNum(index);
}} onMouseLeave={() => {
setNum()
}}>
{/* {num == index ? <img src={item.img} style={{ width: "100%", height: "120%", position: "absolute", }} /> : ""}
{num == index ? <img src={item.img} style={{ width: "5%", height: "100%", position: "absolute", left: "-0.5%", top: "20%" }} /> : ""} */}
}) <p style={{ position: "absolute", left: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }} >{item.deviceName}</p>
} <p style={{ position: "absolute", right: "5%", color: num == index ? "#FFFFFF" : "rgba(216,240,255,0.8)" }}>{item.deviceSerial}</p>
</div > </li>
) </div>
} </div>
return ( )
<> }) :
<img src='/assets/images/quanju/nodata.png' style={{minWidth:'100%'}}/>
}
</div >
)
}
return (
<>
<Module style={style} title={"路面执法监控"}> <Module style={style} title={"路面执法监控"}>
<div style={{ width: "100%", height: "65%", position: "relative" }}> <div style={{ width: "100%", height: "65%", position: "relative" }}>
<p style={{ position: "absolute", left: "25%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>监控总数</p><p style={{ position: "absolute", left: "37%", fontSize: "24px", marginLeft: "1%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>129</p> <p style={{ position: "absolute", left: "25%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>监控总数</p><p style={{ position: "absolute", left: "37%", fontSize: "24px", marginLeft: "1%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>{videoCenterList.length}</p>
<p style={{ position: "absolute", left: "55%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>在线率</p><p style={{ position: "absolute", right: "15%", fontSize: "24px", marginLeft: "2%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>88.87%</p> <p style={{ position: "absolute", left: "55%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>在线率</p><p style={{ position: "absolute", right: "15%", fontSize: "24px", marginLeft: "2%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>
<div style={{ width: "100%", height: "10%", position: "relative" }}> {
<img src='/assets/images/leadership/head.png' style={{ width: "15%", marginLeft: "5%" }} /> videoCenterList.length ?
((videoCenterList.filter(v => v.status == 1).length / videoCenterList.length) * 100).toFixed(0) : '100'
}%</p>
<div style={{ width: "100%", height: "10%", position: "relative" }}>
<img src='/assets/images/leadership/head.png' style={{ width: "15%", marginLeft: "5%" }} />
<div className='wy-rightTop' style={{ position: "absolute", right: "5%", top: "130%" }}> {/* <div className='wy-rightTop' style={{ position: "absolute", right: "5%", top: "130%" }}>
<Select <Select
size={size} size={size}
defaultValue="选择路段" defaultValue="选择路段"
onChange={handleChange} onChange={handleChange}
style={{ style={{
width: 100, width: 100,
fontSize: "12px", fontSize: "12px",
color: "#D8F0FF", color: "#D8F0FF",
}} }}
> >
{children} {children}
</Select> </Select>
<div>{size}</div> <div>{size}</div>
</div> */}
</div> </div>
<div style={{ width: "100%", height: "90%", position: "relative", top: "10%" }}>
<Huadong />
</div>
</div>
<div style={{ width: "100%", height: "35%" }}>
<div style={{ width: "100%", height: "40px"/* , backgroundColor: "#fff" */, position: "relative" }}>
{/* <p>{title || ''}</p> */}
<img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "20px", top: "18%" }} />
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "50px" }}>离线详情</span>
<img src='/assets/images/leadership/zibiaoti.png' style={{ width: "94%", height: "34px", position: "absolute", top: "8px", left: "35px" }} />
</div>
<Spin tip="Loading..." spinning={num ? true : false} style={{ width: "100%", height: "100%" }}>
<Lunbo
// canScroll={true}
content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "90%", left: "5%", top: "5%" }}
divHeight={"100%"}
divId={"screen-slope"}
/>
</Spin>
</div>
</div> </Module>
<div style={{ width: "100%", height: "80%", position: "relative", top: "10%" }}>
<Huadong />
</div>
</div>
<div style={{ width: "100%", height: "35%" }}>
<div style={{ width: "100%", height: "40px"/* , backgroundColor: "#fff" */, position: "relative" }}>
{/* <p>{title || ''}</p> */}
<img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "20px", top: "18%" }} />
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "50px" }}>离线详情</span>
<img src='/assets/images/leadership/zibiaoti.png' style={{ width: "94%", height: "34px", position: "absolute", top: "8px", left: "35px" }} />
</div>
<Spin tip="Loading..." spinning={num ? true : false} style={{ width: "100%", height: "100%" }}>
<Lunbo
// canScroll={true}
content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "90%", left: "5%", top: "5%" }}
divHeight={"100%"}
divId={"screen-slope"}
/>
</Spin>
</div>
</Module> </>
)
}
function mapStateToProps (state) {
const { videoCenterList } = state
</> return {
) videoCenterList: videoCenterList.data || []
}
} }
export default Righttop export default connect(mapStateToProps)(Righttop)

14
web/client/src/sections/quanju/containers/heand/index.js

@ -7,13 +7,25 @@ import { Tabs } from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const Header = (props) => { const Header = (props) => {
const { dispatch, tabChange, tabKey, user } = props const { dispatch, tabChange, tabKey, user } = props
console.log('user111', user)
// const [tab, setTad] = useState("base") // const [tab, setTad] = useState("base")
const onClick = (tab) => { const onClick = (tab) => {
// setTad({ tab }) // setTad({ tab })
tabChange(tab) tabChange(tab)
} }
const dianji = () => { const dianji = () => {
dispatch(push('/noContent')) const allroutes = JSON.parse(sessionStorage.getItem('allRoutes')) || []
const hasAuth = allroutes?.filter((item) => { return user?.userResources.find((child) => { return child.resourceId === item.authCode }) })
if (user?.username === 'SuperAdmin') {
dispatch(push('/fillion/infor'))
}
else if (hasAuth && hasAuth.length > 0) {
const path = hasAuth[0].path
console.log('sasa', `${path}`)
dispatch(push(path))
} else {
dispatch(push('/noContent'))
}
} }
return ( return (
<div style={{ position: "relative" }}> <div style={{ position: "relative" }}>

10
web/client/src/utils/webapi.js

@ -168,9 +168,13 @@ export const ApiTable = {
// 考核评分 // 考核评分
getAssess: 'assess', getAssess: 'assess',
putAssess: 'assess', editAssess: 'assess',
delAssess: 'assess/{assessId}', delAssess: 'assess/{assessId}',
nearestAssessData:'assess/nearest',
// 视频中心
videoCenterList:'videoCenter/list',
//工程数据 //工程数据
getProject: 'project', getProject: 'project',
putProject: 'project', putProject: 'project',
@ -289,7 +293,9 @@ export const ApiTable = {
//养护费用 //养护费用
getMaintenance: '/road/maintenance/cost/nanchang/query', getMaintenance: '/road/maintenance/cost/nanchang/query',
//任务信息 //任务信息
getTask: 'task', delTask: 'task/{taskId}', editTask: 'task' getTask: 'task', delTask: 'task/{taskId}', editTask: 'task',
//部门下所有员工
getAllDepUsers: 'allDepUsers'
}; };

13
web/config.js

@ -18,13 +18,22 @@ args.option(['u', 'api-url'], 'webapi的URL');
args.option('apiUrl', '可外网访问的 webapi 的URL'); args.option('apiUrl', '可外网访问的 webapi 的URL');
args.option(['r', 'report-node'], '报表进程地址'); args.option(['r', 'report-node'], '报表进程地址');
args.option('qndmn', '七牛'); args.option('qndmn', '七牛');
args.option('vcmpWebUrl', '视频平台web可访问地址');
args.option('vcmpMirrorId', '视频平台镜像服务id')
const flags = args.parse(process.argv); const flags = args.parse(process.argv);
const FS_UNIAPP_API = process.env.FS_UNIAPP_API || flags.apiUrl; const FS_UNIAPP_API = process.env.FS_UNIAPP_API || flags.apiUrl;
const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || flags.qndmn; const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || flags.qndmn;
const API_URL = process.env.API_URL || flags.apiUrl; const API_URL = process.env.API_URL || flags.apiUrl;
//
const VCMP_WEB_URL = process.env.VCMP_WEB_URL || flags.vcmpWebUrl;
const VCMP_MIRROR_ID = process.env.VCMP_MIRROR_ID || flags.vcmpMirrorId;
if (!FS_UNIAPP_API) { if (
!FS_UNIAPP_API ||
!VCMP_WEB_URL || !VCMP_MIRROR_ID
) {
console.log('缺少启动参数,异常退出'); console.log('缺少启动参数,异常退出');
args.showHelp(); args.showHelp();
process.exit(-1); process.exit(-1);
@ -56,6 +65,8 @@ const product = {
opts: { opts: {
apiUrl: API_URL, apiUrl: API_URL,
qndmn: QINIU_DOMAIN_QNDMN_RESOURCE, qndmn: QINIU_DOMAIN_QNDMN_RESOURCE,
vcmpWebUrl: VCMP_WEB_URL,
vcmpMirrorId: VCMP_MIRROR_ID,
staticRoot: './client', staticRoot: './client',
} }
}, { }, {

18
web/package-lock.json

@ -4446,7 +4446,7 @@
}, },
"cross-env": { "cross-env": {
"version": "7.0.3", "version": "7.0.3",
"resolved": "http://10.8.30.22:7000/cross-env/-/cross-env-7.0.3.tgz", "resolved": "http://npm.anxinyun.cn/cross-env/-/cross-env-7.0.3.tgz",
"integrity": "sha1-hlJkspZ33AFbqEGJGJZd0jL8VM8=", "integrity": "sha1-hlJkspZ33AFbqEGJGJZd0jL8VM8=",
"requires": { "requires": {
"cross-spawn": "^7.0.1" "cross-spawn": "^7.0.1"
@ -4964,6 +4964,15 @@
} }
} }
}, },
"echarts-for-react": {
"version": "3.0.2",
"resolved": "http://10.8.30.22:7000/echarts-for-react/-/echarts-for-react-3.0.2.tgz",
"integrity": "sha512-DRwIiTzx8JfwPOVgGttDytBqdp5VzCSyMRIxubgU/g2n9y3VLUmF2FK7Icmg/sNVkv4+rktmrLN9w22U2yy3fA==",
"requires": {
"fast-deep-equal": "^3.1.3",
"size-sensor": "^1.0.1"
}
},
"ee-first": { "ee-first": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "http://npm.anxinyun.cn/ee-first/-/ee-first-1.1.1.tgz", "resolved": "http://npm.anxinyun.cn/ee-first/-/ee-first-1.1.1.tgz",
@ -7510,7 +7519,7 @@
}, },
"lodash": { "lodash": {
"version": "4.17.21", "version": "4.17.21",
"resolved": "http://npm.anxinyun.cn/lodash/-/lodash-4.17.21.tgz", "resolved": "http://10.8.30.22:7000/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}, },
"lodash-es": { "lodash-es": {
@ -10299,6 +10308,11 @@
"totalist": "^1.0.0" "totalist": "^1.0.0"
} }
}, },
"size-sensor": {
"version": "1.0.1",
"resolved": "http://10.8.30.22:7000/size-sensor/-/size-sensor-1.0.1.tgz",
"integrity": "sha1-+E5GIG0+JZ+v8dVI5LO+ypMhnbs="
},
"smart-buffer": { "smart-buffer": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "http://npm.anxinyun.cn/smart-buffer/-/smart-buffer-4.2.0.tgz", "resolved": "http://npm.anxinyun.cn/smart-buffer/-/smart-buffer-4.2.0.tgz",

5
web/package.json

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"test": "mocha", "test": "mocha",
"start": "cross-env NODE_ENV=development npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "node server -p 5000 -u http://localhost:13400 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com", "start-params": "node server -p 5000 -u http://localhost:13400 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com --vcmpWebUrl https://mediaconsole.ngaiot.com --vcmpMirrorId 24461524032354",
"deploy": "export NODE_ENV=production&&npm run color && npm run build && node server", "deploy": "export NODE_ENV=production&&npm run color && npm run build && node server",
"build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js", "build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js", "build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js",
@ -77,6 +77,7 @@
"co-busboy": "^1.4.1", "co-busboy": "^1.4.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"echarts": "^5.3.2", "echarts": "^5.3.2",
"echarts-for-react": "^3.0.2",
"fs-web-server-scaffold": "^1.0.6", "fs-web-server-scaffold": "^1.0.6",
"koa-better-http-proxy": "^0.2.5", "koa-better-http-proxy": "^0.2.5",
"koa-convert": "^2.0.0", "koa-convert": "^2.0.0",
@ -94,4 +95,4 @@
"webpack-dev-server": "^3.11.2", "webpack-dev-server": "^3.11.2",
"xlsx": "^0.16.9" "xlsx": "^0.16.9"
} }
} }

4
web/routes/attachment/index.js

@ -19,9 +19,9 @@ module.exports = {
entry: function (app, router, opts) { entry: function (app, router, opts) {
const getApiRoot = async function (ctx) { const getApiRoot = async function (ctx) {
try { try {
const { apiUrl, qndmn } = opts; const { apiUrl, qndmn, vcmpWebUrl, vcmpMirrorId } = opts;
ctx.status = 200; ctx.status = 200;
ctx.body = { root: apiUrl, qndmn }; ctx.body = { root: apiUrl, qndmn, vcmpWebUrl, vcmpMirrorId };
} catch (error) { } catch (error) {
console.error('getApiRoot', error) console.error('getApiRoot', error)
} }

Loading…
Cancel
Save