diff --git a/api/app/lib/controllers/patrolPlan/patrolPlan.js b/api/app/lib/controllers/patrolPlan/patrolPlan.js
deleted file mode 100644
index f0e7584..0000000
--- a/api/app/lib/controllers/patrolPlan/patrolPlan.js
+++ /dev/null
@@ -1,122 +0,0 @@
-'use strict';
-
-async function getPatrolPlan(ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- const { limit, page } = ctx.query;
- let options = {
- include: [{
- required: true,
- model: models.User,
- attributes: ['id', 'name'],
- include: [{
- required: true,
- model: models.Department,
- attributes: ['id', 'name'],
- }]
- }, {
- required: true,
- model: models.Project,
- attributes: ['id', 'name'],
- }]
- };
- if (limit) {
- options.limit = Number(limit);
- }
- if (page && limit) {
- options.offset = Number(page) * Number(limit);
- }
- let res = await models.PatrolPlan.findAndCountAll(options);
- ctx.status = 200;
- ctx.body = res;
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {
- "message": "获取巡检计划失败"
- }
- }
-}
-
-async function createPatrolPlan(ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- const data = ctx.request.body;
- const { name, way, structureId, startTime, endTime, frequency, points, userId } = data;
-
- let plan = { name, way, structureId, startTime, endTime, frequency, points, userId };
-
- await models.PatrolPlan.create(plan);
-
- ctx.status = 204;
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {
- "message": '新增巡检计划失败'
- }
- }
-}
-
-async function updatePatrolPlan(ctx, next) {
- try {
- let errMsg = '修改巡检计划失败';
- const models = ctx.fs.dc.models;
- const data = ctx.request.body;
- const { name, way, structureId, startTime, endTime, frequency, points, userId } = data;
-
- let plan = { name, way, structureId, startTime, endTime, frequency, points, userId };
-
- if (data && data.id) {
- await models.PatrolPlan.update(plan, {
- where: { id: data.id }
- })
- } else {
- errMsg = '请传入巡检计划id';
- throw errMsg;
- }
-
- ctx.status = 204;
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {
- "message": errMsg
- }
- }
-}
-
-async function delPatrolPlan(ctx, next) {
- try {
- let errMsg = '删除巡检计划失败';
-
- const models = ctx.fs.dc.models;
- const { id } = ctx.params;
-
- const record = await models.PatrolRecord.findOne({
- where: { patrolPlanId: id }
- });
-
- if (record) {
- errMsg = '不能删除有巡检记录的计划';
- throw errMsg;
- }
-
- await models.PatrolPlan.destroy({
- where: { id }
- })
-
- ctx.status = 204;
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = { message: error }
- }
-}
-
-module.exports = {
- getPatrolPlan,
- createPatrolPlan,
- updatePatrolPlan,
- delPatrolPlan,
-}
\ No newline at end of file
diff --git a/api/app/lib/controllers/patrolRecord/patrolRecord.js b/api/app/lib/controllers/patrolRecord/patrolRecord.js
deleted file mode 100644
index baefeb2..0000000
--- a/api/app/lib/controllers/patrolRecord/patrolRecord.js
+++ /dev/null
@@ -1,113 +0,0 @@
-'use strict';
-
-async function findPatrolRecord(ctx, next) {
- let rslt = [];
- let error = { name: 'FindError', message: '获取巡检记录失败' };
- try {
- const models = ctx.fs.dc.models;
- const { startTime, endTime, alarm, patrolPlanId, pointId } = ctx.params;
- // patrolPlanId传all查所有
- if (patrolPlanId == 'all') {
- /* 如果有startTime && endTime,查询所有符合条件的数据 */
- if (startTime !== 'null' && endTime !== 'null') {
- if (pointId !== 'null') {
- if (alarm == 'null') {
- rslt = await models.PatrolRecord.findAll({
- where: { inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } },
- });
- } else {
- rslt = await models.PatrolRecord.findAll({
- where: { alarm, inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } },
- });
- }
- } else {
- if (alarm == 'null') {
- rslt = await models.PatrolRecord.findAll({
- where: { inspectionTime: { $between: [startTime, endTime] } },
- });
- } else {
- rslt = await models.PatrolRecord.findAll({
- where: { alarm, inspectionTime: { $between: [startTime, endTime] } },
- });
- }
- }
- } else {
- /* 如果没有startTime && endTime,查询每个点位最新一条符合条件的数据 */
- let a = []
- if (pointId !== 'null') {
- a = await models.PatrolRecord.findAll({
- where: { pointId: { $in: pointId.split(',') } },
- });
- }
- rslt = pointId.split(',').map(i => {
- return a.filter(t => t.pointId == i).sort((a, b) => b.id - a.id)[0] || null
- })
- }
- } else {
- if (startTime !== 'null' && endTime !== 'null') {
- if (pointId !== 'null') {
- rslt = await models.PatrolRecord.findAll({
- where: { patrolPlanId: { $in: patrolPlanId.split(',') }, alarm, inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } },
- });
- } else {
- rslt = await models.PatrolRecord.findAll({
- where: { patrolPlanId: { $in: patrolPlanId.split(',') }, alarm, inspectionTime: { $between: [startTime, endTime] } },
- });
- }
-
- } else {
- let a = []
- /* 如果没有startTime && endTime,查询每个点位最新一条符合条件的数据 */
- if (pointId !== 'null') {
- a = await models.PatrolRecord.findAll({
- where: { patrolPlanId: { $in: patrolPlanId.split(',') }, pointId: { $in: pointId.split(',') } },
- });
- } else {
- a = await models.PatrolRecord.findAll({
- where: { patrolPlanId: { $in: patrolPlanId.split(',') } },
- });
- }
-
- rslt = pointId.split(',').map(i => {
- return a.filter(t => t.pointId == i).sort((a, b) => b.id - a.id)[0] || null
- })
- }
- }
-
- ctx.status = 200;
- ctx.body = rslt;
- error = null
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {
- "message": "获取巡检记录失败"
- }
- }
-}
-
-async function addPatrolRecord(ctx, next) {
- let error = { name: 'addError', message: '新增巡检记录失败' };
- try {
- const models = ctx.fs.dc.models;
- const data = ctx.request.body;
- let { patrolPlanId, lastInspectionTime, inspectionTime, points, alarm, pointId } = data
- let record = { patrolPlanId, lastInspectionTime, inspectionTime, points, alarm, pointId }
-
- await models.PatrolRecord.create(record);
-
- ctx.status = 204;
- error = null
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {
- "message": '新增巡检计划失败'
- }
- }
-}
-
-module.exports = {
- findPatrolRecord,
- addPatrolRecord,
-}
\ No newline at end of file
diff --git a/api/app/lib/controllers/projectRegime/projectSituation.js b/api/app/lib/controllers/projectRegime/projectSituation.js
deleted file mode 100644
index 6b3fe83..0000000
--- a/api/app/lib/controllers/projectRegime/projectSituation.js
+++ /dev/null
@@ -1,431 +0,0 @@
-'use strict';
-
-
-async function projectList (ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- let userInfo = ctx.fs.api.userInfo;
- const { limit, page, name, justStructure } = ctx.query;
-
- let options = {
- where: {
-
- },
- // include: [{
- // as: 'company',
- // model: models.Company,
- // attributes: ['id', 'name'],
- // },],
- }
- if (limit) {
- options.limit = Number(limit)
- }
- if (page && limit) {
- options.offset = Number(page) * Number(limit)
- }
- if (name) {
- options.where.name = { $like: `%${name}%` }
- }
-
- let res = []
- if (justStructure) {
- res = await models.Project.findAndCountAll({
- attributes: ['id', 'name'],
- })
- } else {
- res = await models.Project.findAndCountAll(options)
- }
-
- ctx.status = 200;
- ctx.body = res
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {
- "message": "获取结构列表失败"
- }
- }
-}
-
-
-async function postAddProject (ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- let userInfo = ctx.fs.api.userInfo;
- const data = ctx.request.body;
- const { img, longitude, latitude, name, type, describe } = data
-
- let errMsg = data.id ? '结构物编辑失败' : '结构物新增失败'
- let project = { img, longitude, latitude, name, type, describe, userId: userInfo.id }
-
- const alikeProject = await models.Project.findOne({
- where: {
- name: name,
- }
- })
-
- if ((!data.id && alikeProject) || (alikeProject && alikeProject.id !== data.id)) {
- errMsg = '已有相同结构物名称'
- throw errMsg
- }
- if (data && data.id) {
- await models.Project.update(project, {
- where: {
- id: data.id
- }
- })
- } else {
- await models.Project.create(project)
- }
-
-
- ctx.status = 204;
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
- ctx.status = 400;
- ctx.body = {
- "message": errMsg
- }
- }
-}
-
-async function delProject (ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- let userInfo = ctx.fs.api.userInfo;
- const { id } = ctx.params
-
- //删除结构物
- await models.Project.destroy({
- where: {
- id,
- }
- })
- const pointId = []
- const pointLIst = await models.Point.findAll({
- where: {
- projectId: id,
- },
- attributes: ['id'],
- })
- pointLIst.map(v => pointId.push(v.id))
-
- //点位
- await models.Point.destroy({
- where: {
- projectId: id
- }
- })
-
-
- //巡检计划
- const planId = []
- const planLIst = await models.PatrolPlan.findAll({
- where: {
- structureId: id,
- },
- attributes: ['id'],
- })
- planLIst.map(v => planId.push(v.id))
- await models.PatrolPlan.destroy({
- where: {
- structureId: id
- }
- })
-
- //巡检记录
- await models.PatrolRecord.destroy({
- where: {
- pointId: { $in: pointId },
- patrolPlanId: { $in: planId }
- }
- })
-
-
- ctx.status = 204;
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
- ctx.status = 400;
- ctx.body = {
- "message": '删除结构物失败'
- }
- }
-}
-
-async function addPosition (ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- let userInfo = ctx.fs.api.userInfo;
- const data = ctx.request.body;
- const { longitude, latitude, name, describe, qrCode, projectId, } = data
-
- let errMsg = data.id ? '点位编辑失败' : '点位新增失败'
- let pointData = { longitude, latitude, name, describe, qrCode, projectId }
-
- const alikeProject = await models.Point.findOne({
- where: {
- id: data.id,
- }
- })
-
- if (data && data.id) {
- if (qrCode) {
- await models.Point.update({ ...alikeProject, qrCode }, {
- where: {
- id: data.id,
- }
- })
- } else {
- await models.Point.update({ pointData }, {
- where: {
- id: data.id,
- }
- })
- }
-
- } else {
- await models.Point.create(pointData)
- }
-
-
- ctx.status = 204;
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
- ctx.status = 400;
- ctx.body = {
- "message": errMsg
- }
- }
-}
-
-async function position (ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- let userInfo = ctx.fs.api.userInfo;
- const { limit, page, projectId } = ctx.query;
-
- let options = {
- where: {
- id: projectId
- },
- include: [{
- model: models.Point,
- },],
- }
- if (limit) {
- options.limit = Number(limit)
- }
- if (page && limit) {
- options.offset = Number(page) * Number(limit)
- }
-
- let res = await models.Project.findAndCountAll(options)
- ctx.status = 200;
- ctx.body = res
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {
- "message": "获取结构列表失败"
- }
- }
-}
-
-async function delPosition (ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- let userInfo = ctx.fs.api.userInfo;
- const { id } = ctx.params
-
- const pointOne = await models.Point.findOne({
- where: {
- id
- },
- attributes: ['projectId'],
- })
- if (pointOne) {
- const patrolPlanLIst = await models.PatrolPlan.findAll({
- where: {
- structureId: pointOne.projectId,
- },
- })
-
- for (var u of patrolPlanLIst) {
- const points = []
- u.points.map(r => {
- if (r.id == id) {
- } else {
- points.push(r)
- }
- })
- u.points = points
-
- await models.PatrolRecord.destroy({
- where: {
- pointId: id,
- patrolPlanId: u.id
- }
- })
-
- if (points.length > 0) {
- let data = {
- name: u.dataValues.name,
- way: u.dataValues.way,
- structureId: u.dataValues.structureId,
- startTime: u.dataValues.startTime,
- endTime: u.dataValues.endTime,
- frequency: u.dataValues.frequency,
- points: u.dataValues.points,
- userId: u.dataValues.userId,
- patrolCount: u.dataValues.patrolCount
- }
- await models.PatrolPlan.update(data,{
- where: {
- id: u.dataValues.id
- }
- })
- } else {
- await models.PatrolPlan.destroy({
- where: {
- id: u.id
- }
- })
- }
- }
-
- }
-
- await models.Point.destroy({
- where: {
- id,
- }
- })
-
-
- ctx.status = 204;
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
- ctx.status = 400;
- ctx.body = {
- "message": '删除点位失败'
- }
- }
-}
-
-
-async function qrCodeShow (ctx, next) {
- try {
- const models = ctx.fs.dc.models;
- let userInfo = ctx.fs.api.userInfo;
- const { projectId, name } = ctx.query;
-
- let options = {
- where: {
- qrCode: { $ne: null }
- },
- }
- if (projectId) {
- options.where.projectId = projectId
- }
- if (name) {
- options.where.name = { $like: `%${name}%` }
- }
-
- let res = await models.Point.findAndCountAll(options)
- ctx.status = 200;
- ctx.body = res
- } catch (error) {
- ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
- ctx.status = 400;
- ctx.body = {
- "message": "获取二维码列表失败"
- }
- }
-}
-
-
-async function q (ctx) {
- // let error = {
- // name: 'FindError',
- // message: "获取失败!"
- // };
- // const models = ctx.fs.dc.models;
- // const { devices } = ctx.request.body
- // const attachment = ctx.app.fs.qn_attachment
-
- // try {
-
- // if (!Array.isArray(devices)) {
- // error = { name: 'paramsError', message: '参数不能为空' };
- // ctx.throw(400);
- // }
- // const devicesArr = await models.Device.findAll({
- // attributes: ['deviceNo', 'periodCode', 'qrSrc'],
- // where: { deviceNo: { $in: devices } }
- // })
-
- // let ids = [], idsMap = {}, qnImages = []
- // devicesArr.forEach(d => {
- // const qrSrc = d.qrSrc
- // const deviceNo = d.deviceNo
- // const periodCode = d.periodCode
- // if (qrSrc) {
- // if (/^\d+$/.test(qrSrc)) {
- // ids.push(qrSrc)
- // idsMap[qrSrc] = { deviceNo, periodCode }
- // } else {
- // let domain = globalCache.getQnDomain()
- // let imgUrl = `${domain}/${qrSrc}`
- // qnImages.push({ src: imgUrl, deviceNo, periodCode })
- // }
- // }
- // })
-
- // const docs = await models.QrcodePng.findAll({
- // where: {
- // id: { $in: ids }
- // },
- // attributes: ["id", "base64"]
- // })
-
- // let pics = []
-
- // if (docs.length > 0) {
- // pics = docs.map((d) => {
- // let { deviceNo, periodCode } = idsMap[d.id] || {}
- // let base64 = d.base64.replace(/^data:image\/\w+;base64,/, '')
- // return {
- // url: Buffer.from(base64, 'base64'),
- // name: deviceNo,
- // periodCode
- // }
- // })
- // }
-
- // if (qnImages.length > 0) {
- // let qns = await downloadImgsAsBase64(qnImages)
- // pics = pics.concat(qns)
- // }
-
- // let fileUrl = await downLoadImageBiz(pics, { zipName: "二维码_" + moment().format("YYYY-MM-DD-HH-mm-ss"), attachment })
- // add2CleanCache(fileUrl, attachment)
- // ctx.status = 200
- // ctx.body = { fileUrl }
-
- // } catch (err) {
- // ctx.fs.logger.error(err);
- // ctx.status = 400;
- // ctx.body = error;
- // }
-}
-
-module.exports = {
- projectList,
- postAddProject,
- delProject,
- addPosition,
- position,
- delPosition,
- qrCodeShow,
- q
-}
\ No newline at end of file
diff --git a/api/app/lib/routes/patrolPlan/patrolPlan.js b/api/app/lib/routes/patrolPlan/patrolPlan.js
deleted file mode 100644
index 5f0e455..0000000
--- a/api/app/lib/routes/patrolPlan/patrolPlan.js
+++ /dev/null
@@ -1,17 +0,0 @@
-'use strict';
-
-const patrolPlan = require('../../controllers/patrolPlan/patrolPlan');
-
-module.exports = function (app, router, opts) {
- app.fs.api.logAttr['GET/patrolPlan'] = { content: '获取巡检计划', visible: false };
- router.get('/patrolPlan', patrolPlan.getPatrolPlan);
-
- app.fs.api.logAttr['POST/patrolPlan'] = { content: '新增巡检计划', visible: true };
- router.post('/patrolPlan', patrolPlan.createPatrolPlan);
-
- app.fs.api.logAttr['PUT/patrolPlan'] = { content: '修改巡检计划', visible: true };
- router.put('/patrolPlan', patrolPlan.updatePatrolPlan);
-
- app.fs.api.logAttr['DELETE/patrolPlan/:id'] = { content: '删除巡检计划', visible: true };
- router.del('/patrolPlan/:id', patrolPlan.delPatrolPlan);
-};
\ No newline at end of file
diff --git a/api/app/lib/routes/patrolRecord/patrolRecord.js b/api/app/lib/routes/patrolRecord/patrolRecord.js
deleted file mode 100644
index 48f3d4b..0000000
--- a/api/app/lib/routes/patrolRecord/patrolRecord.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict';
-const patrolRecord = require('../../controllers/patrolRecord/patrolRecord');
-
-module.exports = function (app, router, opts) {
- app.fs.api.logAttr['GET/patrolRecord/:patrolPlanId/:startTime/:endTime/:alarm/:pointId'] = { content: '获取巡检记录', visible: true };
- // web端、小程序端查数据:patrolPlanId为all,不需要传pointId
- // 小程序端查点位最新一条数据:startTime、endTime、alarm不传
- router.get('/patrolRecord/:patrolPlanId/:startTime/:endTime/:alarm/:pointId', patrolRecord.findPatrolRecord);
-
- app.fs.api.logAttr['POST/patrolRecord/add'] = { content: '新增巡检记录', visible: true }
- router.post('/patrolRecord/add', patrolRecord.addPatrolRecord);
-};
\ No newline at end of file
diff --git a/api/app/lib/routes/projectRegime/index.js b/api/app/lib/routes/projectRegime/index.js
deleted file mode 100644
index a81a805..0000000
--- a/api/app/lib/routes/projectRegime/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-'use strict';
-
-const projectSituation = require('../../controllers/projectRegime/projectSituation');
-
-module.exports = function (app, router, opts) {
-
- app.fs.api.logAttr['GET/projectList'] = { content: '获取结构物列表', visible: false };
- router.get('/projectList', projectSituation.projectList);
-
- app.fs.api.logAttr['POST/addProject'] = { content: '新增修改结构物', visible: false };
- router.post('/addProject', projectSituation.postAddProject);
-
- app.fs.api.logAttr['DEL/delProject/:id'] = { content: '删除结构物', visible: false };
- router.del('/delProject/:id', projectSituation.delProject);
-
- app.fs.api.logAttr['POST/position'] = { content: '新增修改点位', visible: false };
- router.post('/position', projectSituation.addPosition);
-
- app.fs.api.logAttr['GET/position'] = { content: '获取点位列表', visible: false };
- router.get('/position', projectSituation.position);
-
- app.fs.api.logAttr['DEL/delPosition/:id'] = { content: '删除点位', visible: false };
- router.del('/delPosition/:id', projectSituation.delPosition);
-
- app.fs.api.logAttr['GET/qrCodeShow'] = { content: '获取二维码列表', visible: false };
- router.get('/qrCodeShow', projectSituation.qrCodeShow);
-
- app.fs.api.logAttr['GET/q'] = { content: '获取二维码列表', visible: false };
- router.get('/q', projectSituation.q);
-
-}
\ No newline at end of file
diff --git a/web/client/assets/images/avatar/1.png b/web/client/assets/images/avatar/1.png
deleted file mode 100644
index 52dbdb8..0000000
Binary files a/web/client/assets/images/avatar/1.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/10.png b/web/client/assets/images/avatar/10.png
deleted file mode 100644
index a543c2a..0000000
Binary files a/web/client/assets/images/avatar/10.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/11.png b/web/client/assets/images/avatar/11.png
deleted file mode 100644
index f569e09..0000000
Binary files a/web/client/assets/images/avatar/11.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/12.png b/web/client/assets/images/avatar/12.png
deleted file mode 100644
index 7265983..0000000
Binary files a/web/client/assets/images/avatar/12.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/2.png b/web/client/assets/images/avatar/2.png
deleted file mode 100644
index 708e41d..0000000
Binary files a/web/client/assets/images/avatar/2.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/3.png b/web/client/assets/images/avatar/3.png
deleted file mode 100644
index 933b3f1..0000000
Binary files a/web/client/assets/images/avatar/3.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/4.png b/web/client/assets/images/avatar/4.png
deleted file mode 100644
index 793baca..0000000
Binary files a/web/client/assets/images/avatar/4.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/5.png b/web/client/assets/images/avatar/5.png
deleted file mode 100644
index c66ec46..0000000
Binary files a/web/client/assets/images/avatar/5.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/6.png b/web/client/assets/images/avatar/6.png
deleted file mode 100644
index 157f56a..0000000
Binary files a/web/client/assets/images/avatar/6.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/7.png b/web/client/assets/images/avatar/7.png
deleted file mode 100644
index ddd4f3d..0000000
Binary files a/web/client/assets/images/avatar/7.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/8.png b/web/client/assets/images/avatar/8.png
deleted file mode 100644
index 3a01c87..0000000
Binary files a/web/client/assets/images/avatar/8.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/9.png b/web/client/assets/images/avatar/9.png
deleted file mode 100644
index 0a952d4..0000000
Binary files a/web/client/assets/images/avatar/9.png and /dev/null differ
diff --git a/web/client/assets/images/avatar/avatar.jpg b/web/client/assets/images/avatar/avatar.jpg
deleted file mode 100644
index dd6739f..0000000
Binary files a/web/client/assets/images/avatar/avatar.jpg and /dev/null differ
diff --git a/web/client/assets/images/homePage/close.png b/web/client/assets/images/homePage/close.png
deleted file mode 100644
index 4bff91d..0000000
Binary files a/web/client/assets/images/homePage/close.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis-infowindow-bg.png b/web/client/assets/images/homePage/gis-infowindow-bg.png
deleted file mode 100644
index 3099ec5..0000000
Binary files a/web/client/assets/images/homePage/gis-infowindow-bg.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/marker.gif b/web/client/assets/images/homePage/gis/marker.gif
deleted file mode 100644
index f6d4830..0000000
Binary files a/web/client/assets/images/homePage/gis/marker.gif and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/mingchu_anquan.png b/web/client/assets/images/homePage/gis/mingchu_anquan.png
deleted file mode 100644
index 1d7c906..0000000
Binary files a/web/client/assets/images/homePage/gis/mingchu_anquan.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/mingchu_weisheng.png b/web/client/assets/images/homePage/gis/mingchu_weisheng.png
deleted file mode 100644
index 154a89d..0000000
Binary files a/web/client/assets/images/homePage/gis/mingchu_weisheng.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/企业-中低风险.png b/web/client/assets/images/homePage/gis/企业-中低风险.png
deleted file mode 100644
index 89d709f..0000000
Binary files a/web/client/assets/images/homePage/gis/企业-中低风险.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/企业-中风险.png b/web/client/assets/images/homePage/gis/企业-中风险.png
deleted file mode 100644
index 02ee964..0000000
Binary files a/web/client/assets/images/homePage/gis/企业-中风险.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/企业-低风险.png b/web/client/assets/images/homePage/gis/企业-低风险.png
deleted file mode 100644
index 00e1f24..0000000
Binary files a/web/client/assets/images/homePage/gis/企业-低风险.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/企业-高风险.png b/web/client/assets/images/homePage/gis/企业-高风险.png
deleted file mode 100644
index d069ad6..0000000
Binary files a/web/client/assets/images/homePage/gis/企业-高风险.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/特种设备企业.png b/web/client/assets/images/homePage/gis/特种设备企业.png
deleted file mode 100644
index b3fa2cd..0000000
Binary files a/web/client/assets/images/homePage/gis/特种设备企业.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/gis/食堂.png b/web/client/assets/images/homePage/gis/食堂.png
deleted file mode 100644
index 6c111e3..0000000
Binary files a/web/client/assets/images/homePage/gis/食堂.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u1025.png b/web/client/assets/images/homePage/u1025.png
deleted file mode 100644
index e0d61f1..0000000
Binary files a/web/client/assets/images/homePage/u1025.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u1026.png b/web/client/assets/images/homePage/u1026.png
deleted file mode 100644
index 5831a13..0000000
Binary files a/web/client/assets/images/homePage/u1026.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u1031.png b/web/client/assets/images/homePage/u1031.png
deleted file mode 100644
index 7b7b51c..0000000
Binary files a/web/client/assets/images/homePage/u1031.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u1036.png b/web/client/assets/images/homePage/u1036.png
deleted file mode 100644
index 0bfb677..0000000
Binary files a/web/client/assets/images/homePage/u1036.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u133.png b/web/client/assets/images/homePage/u133.png
deleted file mode 100644
index c17573c..0000000
Binary files a/web/client/assets/images/homePage/u133.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u145.png b/web/client/assets/images/homePage/u145.png
deleted file mode 100644
index 67b270a..0000000
Binary files a/web/client/assets/images/homePage/u145.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u150.png b/web/client/assets/images/homePage/u150.png
deleted file mode 100644
index e1181a0..0000000
Binary files a/web/client/assets/images/homePage/u150.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u151.png b/web/client/assets/images/homePage/u151.png
deleted file mode 100644
index 0bfb677..0000000
Binary files a/web/client/assets/images/homePage/u151.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u162.png b/web/client/assets/images/homePage/u162.png
deleted file mode 100644
index c734fac..0000000
Binary files a/web/client/assets/images/homePage/u162.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u165.png b/web/client/assets/images/homePage/u165.png
deleted file mode 100644
index b3f574b..0000000
Binary files a/web/client/assets/images/homePage/u165.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u182.png b/web/client/assets/images/homePage/u182.png
deleted file mode 100644
index 5bbeec3..0000000
Binary files a/web/client/assets/images/homePage/u182.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u183.png b/web/client/assets/images/homePage/u183.png
deleted file mode 100644
index 894305b..0000000
Binary files a/web/client/assets/images/homePage/u183.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u184.png b/web/client/assets/images/homePage/u184.png
deleted file mode 100644
index 2e51b5d..0000000
Binary files a/web/client/assets/images/homePage/u184.png and /dev/null differ
diff --git a/web/client/assets/images/homePage/u189.png b/web/client/assets/images/homePage/u189.png
deleted file mode 100644
index 34a2025..0000000
Binary files a/web/client/assets/images/homePage/u189.png and /dev/null differ
diff --git a/web/client/assets/images/login.png b/web/client/assets/images/login.png
deleted file mode 100644
index af4a5b6..0000000
Binary files a/web/client/assets/images/login.png and /dev/null differ
diff --git a/web/client/assets/images/login_bg.png b/web/client/assets/images/login_bg.png
deleted file mode 100644
index 08658af..0000000
Binary files a/web/client/assets/images/login_bg.png and /dev/null differ
diff --git a/web/client/assets/images/logo.png b/web/client/assets/images/logo.png
deleted file mode 100644
index 87a6aa3..0000000
Binary files a/web/client/assets/images/logo.png and /dev/null differ
diff --git a/web/client/assets/images/monitor/chose-none.png b/web/client/assets/images/monitor/chose-none.png
new file mode 100644
index 0000000..6da1f93
Binary files /dev/null and b/web/client/assets/images/monitor/chose-none.png differ
diff --git a/web/client/assets/images/monitor/header-bg.png b/web/client/assets/images/monitor/header-bg.png
new file mode 100644
index 0000000..3126b4a
Binary files /dev/null and b/web/client/assets/images/monitor/header-bg.png differ
diff --git a/web/client/assets/images/monitor/pitch-on.png b/web/client/assets/images/monitor/pitch-on.png
new file mode 100644
index 0000000..f0c384d
Binary files /dev/null and b/web/client/assets/images/monitor/pitch-on.png differ
diff --git a/web/client/assets/images/monitor/screen-bg.png b/web/client/assets/images/monitor/screen-bg.png
new file mode 100644
index 0000000..31e24df
Binary files /dev/null and b/web/client/assets/images/monitor/screen-bg.png differ
diff --git a/web/client/assets/images/monitor/strip.png b/web/client/assets/images/monitor/strip.png
new file mode 100644
index 0000000..5843b36
Binary files /dev/null and b/web/client/assets/images/monitor/strip.png differ
diff --git a/web/client/assets/images/monitor/user.png b/web/client/assets/images/monitor/user.png
new file mode 100644
index 0000000..63de0c6
Binary files /dev/null and b/web/client/assets/images/monitor/user.png differ
diff --git a/web/client/src/app.js b/web/client/src/app.js
index 98d351d..c90edf7 100644
--- a/web/client/src/app.js
+++ b/web/client/src/app.js
@@ -3,10 +3,7 @@
import React, { useEffect } from 'react';
import Layout from './layout';
import Auth from './sections/auth';
-import Safetymanage from './sections/safetymanage';
-import ProjectRegime from './sections/projectRegime';
-import Organization from './sections/organization';
-import PatrolManage from './sections/patrolManage';
+import bigScreen from './sections/bigScreen';
const App = props => {
const { projectName } = props
@@ -18,7 +15,7 @@ const App = props => {
return (
)
diff --git a/web/client/src/components/README.txt b/web/client/src/components/README.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/web/client/src/components/Upload/index.js b/web/client/src/components/Upload/index.js
deleted file mode 100644
index eac0a27..0000000
--- a/web/client/src/components/Upload/index.js
+++ /dev/null
@@ -1,316 +0,0 @@
-'use strict';
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { Spin, Upload, message, Modal, Card, Button } from 'antd';
-import moment from 'moment';
-import { PlusOutlined, UploadOutlined, CloseOutlined } from '@ant-design/icons';
-
-class Uploads extends Component {
- constructor(props) {
- super(props);
- this.ApiRoot = localStorage.getItem('tyApiRoot')
- this.state = {
- fileUploading: false,
- fileList: [],
- curPreviewPic: '',
- delPicIng: false,
- removeFilesList: []
- };
- }
-
- dealName = (uploaded) => {
- let realName = uploaded.split('/')[2]
- let x1 = realName.split('.')
- let x2 = x1[0].split('_')
- let showName = `${x2[0]}.${x1[1]}`
- return showName
- }
-
- // setFileList = (value) => {
- // let defaultFileList = [];
- // defaultFileList = value.map((u, index) => {
- // let fileUrl = `${this.ApiRoot}/${u.url}`;
- // return {
- // uid: -index - 1,
- // name: this.dealName(u.url),
- // status: 'done',
- // storageUrl: u.url,
- // url: fileUrl
- // };
- // });
- // onChange(defaultFileList)
- // this.setState({
- // fileList: defaultFileList
- // });
- // };
-
- componentDidMount() {
- const { value } = this.props;
- if (value) {
- this.setState(value);
- }
- }
-
- componentWillReceiveProps(np) {
- const { dispatch, value: thisEditData, onChange } = this.props;
- const { value: nextEditData } = np;
-
- const setFileList = () => {
- let defaultFileList = [];
- defaultFileList = nextEditData.map((u, index) => {
- let fileUrl = `${this.ApiRoot}/${u.storageUrl}`;
- return {
- uid: -index - 1,
- name: this.dealName(u.storageUrl),
- status: 'done',
- storageUrl: u.storageUrl,
- url: fileUrl,
- size: u.size || -1
- };
- });
- this.setState({
- fileList: defaultFileList
- });
- };
-
- if (nextEditData && nextEditData.length) {
- if (!thisEditData || !this.state.fileList.length) {
- setFileList();
- } else if (nextEditData.length != thisEditData.length) {
- setFileList();
- } else {
- let repeat = true;
- for (let i = 0; i < thisEditData.length; i++) {
- if (thisEditData[i] != nextEditData[i]) {
- repeat = false;
- break;
- }
- }
- if (!repeat) {
- setFileList();
- }
- }
- }
- // else{
- // this.setState({
- // fileList:[],
- // })
- // }
- }
-
- render() {
- const UploadPath = {
- project: ['txt', 'dwg', 'doc', 'docx', 'xls', 'xlsx', 'pdf', 'png', 'jpg', 'rar', 'zip'],
- report: ['doc', 'docx', 'xls', 'xlsx', 'pdf'],
- data: ['txt', 'xls', 'xlsx'],
- image: ['png', 'jpg', 'svg', 'jpeg'],
- three: ['js'],
- video: ['mp4']
- };
- /**
- * uploadType 【string】 主要区别文件上传路径 以及类型 以 web/routes/attachment/index.js 中 UploadPath 的 key 值为准;默认 project;
- * disabled 【boolean】 上传是否可用
- * maxFilesNum 【number】 最大上传数量
- * fileTypes 【array[string]】 可允许上传的文件类型;
- * maxFileSize 【number】 单个文件最大大小 M
- * listType 【antd】 upload 组件的属性
- * onChange 【function】 文件数量变化时候回调 返回文件
- * value 【array[obj]】 编辑数据 [{url:'xxx', [size:999]}]
- * onStateChange 【function】 文件状态改变回调函数 上传中 return { uploading:true/false }
- */
- const {
- uploadType,
- disabled,
- maxFilesNum,
- fileTypes,
- maxFileSize,
- listType,
- onChange,
- value,
- showUploadList,
- onStateChange
- } = this.props;
- const { fileList, curPreviewPic, delPicIng, removeFilesList } = this.state;
- const that = this;
- let uploadType_ = uploadType || 'project';
- let maxFilesNum_ = maxFilesNum || 1;
- let defaultFileTypes = fileTypes || UploadPath[uploadType_];
- const uploadProps = {
- name: 'checkFile_',
- multiple: false,
- showUploadList: showUploadList || true,
- action: `${this.ApiRoot}/attachments/${uploadType_}`,
- listType: listType || 'text',
- disabled: disabled,
- beforeUpload: (file) => {
- if (fileList.length >= maxFilesNum_) {
- message.warning(`最多选择${maxFilesNum_}个文件上传`);
- return false;
- }
- if (file.name.length > 60) {
- message.warning(`文件名过长(大于60字符),请修改后上传`);
- return false;
- }
- const extNames = file.name.split('.');
- var reg = /^[\.\s\u4e00-\u9fa5a-zA-Z0-9_-]{0,}$/;
- if (!reg.exec(file.name)) {
- message.warning(`文件名包含除字母、汉字、数字、中划线、下划线之外的字符,请修改后上传`);
- return false;
- }
- let isDAE = false;
- if (extNames.length > 0) {
- let fileType = extNames[extNames.length - 1].toLowerCase();
- isDAE = defaultFileTypes.some((f) => f == fileType);
- }
- if (!isDAE) {
- message.error(`只能上传 ${defaultFileTypes.join()} 格式的文件!`);
- return false;
- }
- const isLt = file.size / 1024 / 1024 < (maxFileSize || 3);
- if (!isLt) {
- message.error(`文件必须小于${maxFileSize || 3}MB!`);
- return false;
- }
- this.setState({
- fileUploading: true
- });
- if (onStateChange) {
- onStateChange({ uploading: true });
- }
- },
- onChange(info) {
- const status = info.file.status;
- if (status === 'uploading') {
- that.setState({
- fileList: info.fileList
- });
- }
- if (status === 'done') {
- let { uploaded, url } = info.file.response;
- let size = info.file.size;
- let nextFileList = fileList;
- nextFileList[nextFileList.length - 1] = {
- uid: -moment().unix(),
- name: that.dealName(uploaded),
- status: 'done',
- storageUrl: uploaded,
- url: url,
- size: size
- };
- onChange(nextFileList);
- that.setState({
- fileUploading: false,
- fileList: nextFileList
- });
- if (onStateChange) {
- onStateChange({ uploading: false });
- }
- } else if (status === 'error') {
- that.setState({
- fileUploading: false
- });
- message.error(`${info.file.name} 上传失败,请重试`);
- if (onStateChange) {
- onStateChange({ uploading: false });
- }
- }
- },
- onRemove(file) {
- let nextFileList = [];
- fileList.map((f, i) => {
- if (f.uid != file.uid) {
- nextFileList.push(f);
- }
- });
- let nextRemoveFiles = removeFilesList.concat([file.storageUrl]);
- if (curPreviewPic == file.url) {
- that.setState({
- curPreviewPic: ''
- });
- }
- onChange(nextFileList);
- that.setState({
- fileList: nextFileList,
- removeFilesList: nextRemoveFiles
- });
- },
- onPreview(file) {
- let filePostfix = file.url.split('.').pop();
- filePostfix = filePostfix.toLowerCase();
- if (UploadPath.image.some((img) => img == filePostfix)) {
- that.setState({
- curPreviewPic: file.url
- });
- } else {
- message.warn('仅支持图片预览');
- }
- }
- };
-
- let fileList_ = fileList
- // .map(f => {
- // if (f.storageUrl) {
- // let realName = f.storageUrl.split('/').pop()
- // if (f.name != realName) {
- // f.name = realName
- // }
- // }
- // return f
- // })
-
- return (
-
-
-
- {
- disabled ? (
- ''
- ) :
- listType == 'picture-card' ?
- (
- fileList.length >= maxFilesNum_ ? null : (
-
- )
- ) : (
-
- )
- }
-
- {
- curPreviewPic ? (
-
-
- 文件预览
- { this.setState({ curPreviewPic: '' }); }}
- >
-
-
-
-
-
- ) : ''
- }
-
-
- );
- }
-}
-
-function mapStateToProps(state) {
- const { auth } = state
- return {
- user: auth.user
- };
-}
-
-export default connect(mapStateToProps)(Uploads);
diff --git a/web/client/src/components/Uploads/index.js b/web/client/src/components/Uploads/index.js
deleted file mode 100644
index 8725880..0000000
--- a/web/client/src/components/Uploads/index.js
+++ /dev/null
@@ -1,389 +0,0 @@
-'use strict';
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { Spin, Upload, message, Modal, Card, Button } from 'antd';
-import moment from 'moment';
-import { PlusOutlined, UploadOutlined, CloseOutlined } from '@ant-design/icons';
-
-class Uploads extends Component {
- constructor(props) {
- super(props);
- this.ApiRoot = localStorage.getItem('tyApiRoot')
- this.qnDomain = localStorage.getItem('qnDomain');
- this.aliAdmin = localStorage.getItem('aliAdmin');
- this.state = {
- fileUploading: false,
- fileList: [],
- curPreviewPic: '',
- curPreviewVideo: '',
- delPicIng: false,
- removeFilesList: []
- };
- }
-
- dealName = (uploaded) => {
- let realName = uploaded.split('/')[2]
- // let x1 = realName.split('.')
- // let postfix = x1.pop()
- // let allName = x1.join('.')
- // let x2 = allName.split('_')
- // let showName = `${x2[0]}.${postfix}`
- return realName
- }
-
- // setFileList = (value) => {
- // let defaultFileList = [];
- // defaultFileList = value.map((u, index) => {
- // let fileUrl = `${this.ApiRoot}/${u.url}`;
- // return {
- // uid: -index - 1,
- // name: this.dealName(u.url),
- // status: 'done',
- // storageUrl: u.url,
- // url: fileUrl
- // };
- // });
- // onChange(defaultFileList)
- // this.setState({
- // fileList: defaultFileList
- // });
- // };
-
- setFileList = (nextEditData, isQiniu, isAli) => {
- let defaultFileList = [];
- defaultFileList = nextEditData.map((u, index) => {
- let fileUrl =
- isQiniu ? `/_file-server/${u.storageUrl}`
- : isAli ? `/_file-ali-server/${u.storageUrl}`
- : `${this.ApiRoot}/${u.storageUrl}`;
-
- return {
- uid: -index - 1,
- name: this.dealName(u.storageUrl),
- status: 'done',
- storageUrl: u.storageUrl,
- url: fileUrl,
- size: u.size || -1
- };
- });
- this.setState({
- fileList: defaultFileList
- });
- };
-
- componentDidMount() {
- const { value, defaultValue, isQiniu, isAli } = this.props;
- if (defaultValue) {
- this.setFileList(defaultValue, isQiniu, isAli)
- }
- }
-
- UNSAFE_componentWillReceiveProps(np) {
- const { dispatch, value: thisEditData, onChange } = this.props;
- const { value: nextEditData, isQiniu, isAli } = np;
- // this.setFileList(nextEditData, isQiniu)
- // const setFileList = () => {
- // let defaultFileList = [];
- // defaultFileList = nextEditData.map((u, index) => {
- // let fileUrl = isQiniu ? `/_file-server/${u.storageUrl}` : `${this.ApiRoot}/${u.storageUrl}`;
- // return {
- // uid: -index - 1,
- // name: this.dealName(u.storageUrl),
- // status: 'done',
- // storageUrl: u.storageUrl,
- // url: fileUrl,
- // size: u.size || -1
- // };
- // });
- // this.setState({
- // fileList: defaultFileList
- // });
- // };
- if (nextEditData && nextEditData.length) {
- if (!thisEditData || !this.state.fileList.length) {
- this.setFileList(nextEditData, isQiniu, isAli);
- } else if (nextEditData.length != thisEditData.length) {
- this.setFileList(nextEditData, isQiniu, isAli);
- } else {
- let repeat = true;
- for (let i = 0; i < thisEditData.length; i++) {
- if (thisEditData[i] != nextEditData[i]) {
- repeat = false;
- break;
- }
- }
- if (!repeat) {
- this.setFileList(nextEditData, isQiniu, isAli);
- }
- }
- }
- // else{
- // this.setState({
- // fileList:[],
- // })
- // }
- }
-
- render() {
- const UploadPath = {
- project: ['txt', 'dwg', 'doc', 'docx', 'xls', 'xlsx', 'csv', 'pdf', 'pptx', 'png', 'jpg', 'svg', 'jpeg', 'rar', 'zip', 'jpeg', 'mp4'],
- report: ['doc', 'docx', 'xls', 'xlsx', 'csv', 'pdf'],
- data: ['txt', 'xls', 'xlsx', 'csv'],
- image: ['png', 'jpg', 'svg', 'jpeg'],
- three: ['js'],
- video: ['mp4']
- };
- /**
- * uploadType 【string】 主要区别文件上传路径 以及类型 以 web/routes/attachment/index.js 中 UploadPath 的 key 值为准;默认 project;
- * disabled 【boolean】 上传是否可用
- * maxFilesNum 【number】 最大上传数量
- * fileTypes 【array[string]】 可允许上传的文件类型;
- * maxFileSize 【number】 单个文件最大大小 M
- * listType 【antd】 upload 组件的属性
- * onChange 【function】 文件数量变化时候回调 返回文件
- * value 【array[obj]】 编辑数据 [{url:'xxx', [size:999]}]
- * onStateChange 【function】 文件状态改变回调函数 上传中 return { uploading:true/false }
- */
- const {
- uploadType,
- disabled,
- maxFilesNum,
- fileTypes,
- maxFileSize,
- listType,
- onChange = () => { },
- value,
- showUploadList,
- onStateChange,
- isQiniu,
- isAli,
- } = this.props;
- const { fileList, curPreviewPic, curPreviewVideo, delPicIng, removeFilesList } = this.state;
- const that = this;
- let uploadType_ = uploadType || 'project';
- let maxFilesNum_ = maxFilesNum || 1;
- let defaultFileTypes = fileTypes || UploadPath[uploadType_];
- // debugger
- const uploadProps = {
- name: 'checkFile_',
- multiple: false,
- showUploadList: showUploadList || true,
- action:
- isQiniu ? `/_upload/attachments/${uploadType_}`
- : isAli ? `/_upload/attachments/ali/${uploadType_}`
- : `${this.ApiRoot}/attachments/${uploadType_}`,
- listType: listType || 'text',
- disabled: disabled,
- beforeUpload: (file) => {
- if (fileList.length >= maxFilesNum_) {
- message.warning(`最多选择${maxFilesNum_}个文件上传`);
- return false;
- }
- if (file.name.length > 60) {
- message.warning(`文件名过长(大于60字符),请修改后上传`);
- return false;
- }
- const extNames = file.name.split('.');
- // var reg = /^[\.\s\u4e00-\u9fa5a-zA-Z0-9_-]{0,}$/;
- // if (!reg.exec(file.name)) {
- // message.warning(`文件名包含除字母、汉字、数字、中划线、下划线之外的字符,请修改后上传`);
- // return false;
- // }
- let isDAE = false;
- if (extNames.length > 0) {
- let fileType = extNames[extNames.length - 1].toLowerCase();
- isDAE = defaultFileTypes.some((f) => f == fileType);
- }
- if (!isDAE) {
- message.error(`只能上传 ${defaultFileTypes.join()} 格式的文件!`);
- return false;
- }
- const isLt = file.size / 1024 / 1024 < (maxFileSize || 3);
- if (!isLt) {
- message.error(`文件必须小于${maxFileSize || 3}MB!`);
- return false;
- }
- this.setState({
- fileUploading: true
- });
- if (onStateChange) {
- onStateChange({ uploading: true });
- }
- },
- onChange(info) {
- const status = info.file.status;
- if (status === 'uploading') {
- that.setState({
- fileList: info.fileList
- });
- }
- if (status === 'done') {
- let { uploaded, url } = info.file.response;
- let size = info.file.size;
- let nextFileList = fileList;
- nextFileList[nextFileList.length - 1] = {
- uid: -moment().unix(),
- name: that.dealName(uploaded),
- status: 'done',
- storageUrl: uploaded,
- url:
- isQiniu ? '/_file-server/' + uploaded :
- isAli ? `/_file-ali-server/${uploaded}` :
- url,
- size: size
- };
- onChange(nextFileList);
- that.setState({
- fileUploading: false,
- fileList: nextFileList
- });
- if (onStateChange) {
- onStateChange({ uploading: false });
- }
- } else if (status === 'error') {
- that.setState({
- fileUploading: false
- });
- message.error(`${info.file.name} 上传失败,请重试`);
- if (onStateChange) {
- onStateChange({ uploading: false });
- }
- }
- },
- onRemove(file) {
- let nextFileList = [];
- fileList.map((f, i) => {
- if (f.uid != file.uid) {
- nextFileList.push(f);
- }
- });
- let nextRemoveFiles = removeFilesList.concat([file.storageUrl]);
- if (curPreviewPic == file.url) {
- that.setState({
- curPreviewPic: ''
- });
- }
- if (curPreviewVideo == file.url) {
- that.setState({
- curPreviewVideo: ''
- });
- }
- onChange(nextFileList);
- that.setState({
- fileList: nextFileList,
- removeFilesList: nextRemoveFiles
- });
- },
- onPreview(file) {
- let filePostfix = file.url.split('.').pop();
- filePostfix = filePostfix.toLowerCase();
- if (UploadPath.image.some((img) => img == filePostfix)) {
- that.setState({
- curPreviewPic: file.url
- });
- } else if (UploadPath.video.some((img) => img == filePostfix)) {
- that.setState({
- curPreviewVideo: file.url
- });
- } else {
- //message.warn('仅支持图片预览');
- preview(file.storageUrl)
- }
- }
- };
-
- const preview = (url) => {
- let link = isQiniu ? encodeURI(`${this.qnDomain}/${url}`) :
- isAli ? encodeURI(`${this.aliAdmin}/${url}`) : ''
- if (link)
- if (url.indexOf("pdf") !== -1 || url.indexOf("csv") !== -1) {
- window.open(link)
- } else {
- window.open(`https://view.officeapps.live.com/op/view.aspx?src=${link}`)
- }
- }
-
- let fileList_ = fileList
- // .map(f => {
- // if (f.storageUrl) {
- // let realName = f.storageUrl.split('/').pop()
- // if (f.name != realName) {
- // f.name = realName
- // }
- // }
- // return f
- // })
- //下载文件
- const handleDownload = (file) => {
- saveAs(file)
- };
- const saveAs = (file) => {
- const link = document.createElement('a');
- link.href = file.url;
- link.download = file.name;
- link.style.display = 'none';
- link.click();
- }
- //自定义下载
- return (
-
-
-
- {
- disabled ? (
- ''
- ) :
- listType == 'picture-card' ?
- (
- fileList.length >= maxFilesNum_ ? null : (
-
- )
- ) : (
-
- )
- }
-
- {
- curPreviewPic ? (
-
-
- 图片预览
- { this.setState({ curPreviewPic: '' }) }}>
-
-
-
-
-
- ) : ''
- }
- {
- curPreviewVideo ? (
-
- 视频预览
- { this.setState({ curPreviewVideo: '' }) }}>
-
-
-
-
- ) : ''
- }
-
-
- );
- }
-}
-
-function mapStateToProps(state) {
- const { auth } = state
- return {
- user: auth.user
- };
-}
-
-export default connect(mapStateToProps)(Uploads);
\ No newline at end of file
diff --git a/web/client/src/components/export/index.js b/web/client/src/components/export/index.js
deleted file mode 100644
index 3fd980f..0000000
--- a/web/client/src/components/export/index.js
+++ /dev/null
@@ -1,683 +0,0 @@
-/**
- * Created by Xumeng 2020/04/22.
- */
-
-import React, { useState, useEffect } from 'react';
-import PropTypes from 'prop-types';
-import {
- Row, Col, Space, Button, message, notification, Form, Input, Tooltip, Menu, Dropdown,
-} from 'antd';
-import moment from 'moment';
-import XLSX from 'xlsx';
-import { fromJS } from 'immutable';
-import { Request } from '@peace/utils';
-import FileSaver from 'file-saver';
-import './index.less';
-
-// 通用前端导入导出组件 使用方法查看底部propTypes
-function ExportAndImport(props) {
- const [form] = Form.useForm();
- const [exportLoading, setExportLoading] = useState(false);
- const [importLoading, setImportLoading] = useState(false);
- const {
- importDataCallback, onImportSucess, handelData, importMethod = 'post',
- } = props;
-
- useEffect(() => () => {
- // 只有unmount 时调用
- notification.close('import-notification');
- });
- const importExcel = (file, type) => {
- setImportLoading(true);
- // 获取上传的文件对象
- const { files } = file.target;
- // 判断xls、xlsx格式
- if (files[0].type.indexOf('sheet') > -1 || files[0].type.indexOf('ms-excel') > -1) {
- // 通过FileReader对象读取文件
- const fileReader = new FileReader();
- fileReader.onload = (event) => {
- try {
- const { importRequest = true, importUrl, importQuery } = props;
- if (importRequest && !importUrl) {
- message.error('获取导入接口失败!');
- form.resetFields();
- return;
- }
- const { result } = event.target;
- // 以二进制流方式读取得到整份excel表格对象
- const workbook = XLSX.read(result, { type: 'binary', cellDates: true });
- let data = []; // 存储获取到的数据
- // 遍历每张工作表进行读取(这里默认只读取第一张表)
- for (const sheet in workbook.Sheets) {
- if (workbook.Sheets.hasOwnProperty(sheet)) {
- // 利用 sheet_to_json 方法将 excel 转成 json 数据
- data = data.concat(XLSX.utils.sheet_to_json(workbook.Sheets[sheet]));
- break; // 如果只取第一张表,就取消注释这行
- }
- }
- if (data.length > 10000) {
- message.error('一次最多导入10000条数据,请分批导入!');
- form.resetFields();
- setImportLoading(false);
- return;
- }
- if (importRequest) {
- message.success('获取文件数据成功,开始处理导入...');
- const importData = handelData ? handelData(data) : data;
- Request[importMethod](importUrl, { data: importData }, importQuery || {}).then((res) => {
- message.success('导入数据成功');
- form.resetFields();
- notification.close('import-notification');
- setImportLoading(false);
- onImportSucess && onImportSucess();
- }, (err) => {
- if (err.status === 500) {
- message.error('数据导入出错,导入失败');
- } else if (err.status === 400) {
- message.error(err.body.message || '数据验证出错,请检查数据格式是否正确');
- } else {
- message.error('导入失败');
- }
- form.resetFields();
- setImportLoading(false);
- });
- } else {
- form.resetFields();
- setImportLoading(false);
- importDataCallback && importDataCallback(data, type);
- notification.close('import-notification');
- }
- } catch (e) {
- console.log(e);
- // 这里可以抛出文件类型错误不正确的相关提示
- message.error('文件格式不正确!');
- setImportLoading(false);
- form.resetFields();
- }
- };
- // fileReader.onloadend = (event) => {
- // console.log(event)
- // }
- // 以二进制方式打开文件
- fileReader.readAsBinaryString(files[0]);
- } else {
- message.error('文件格式不正确!');
- form.resetFields();
- setImportLoading(false);
- }
- };
-
- const loop = (data, keypath, values) => { // deal with array
- const dkey = keypath.slice(0, 1)[0];
- console.log(dkey);
- if (dkey) {
- const dvalue = data[dkey];
- const otherKeypath = keypath.slice(1);
- if (Array.isArray(dvalue)) {
- if (otherKeypath.length) {
- const immutableData = fromJS(data);
- for (let index = 0; index < dvalue.length; index++) {
- const tmp = immutableData.getIn([dkey, index]).toJS();
- loop(tmp, otherKeypath, values);
- }
- }
- } else {
- values.push(dvalue);
- }
- }
- return values;
- };
- const getColumnData = (opts) => {
- const {
- data, keypath, render, spliter, rawdata,
- } = opts;
- let v = null;
- const outer = data[keypath[0]];
-
- if (Array.isArray(outer)) {
- const values = loop(data, keypath, []);
- v = rawdata ? values : values.join(spliter || ',');
- } else {
- v = fromJS(data).getIn(keypath);
- }
- // 处理render
- if (render && typeof render === 'function') {
- v = render(outer, data);
- }
- return v;
- };
- const getDataSource = (attrs, filterData) => {
- // let token = JSON.parse(sessionStorage.getItem('user')).token;
- const dataSource = filterData.map((item) => {
- const record = {};
- attrs.forEach((attr) => {
- const {
- key, dataIndex, render, child,
- } = attr;
- if (child) {
- record[key] = getDataSource(child, item[key]);
- } else {
- const v = getColumnData({
- data: item,
- keypath: dataIndex || [key],
- render: render || null,
- });
- record[key] = v;
- }
- });
-
- return record;
- });
- return dataSource;
- };
- // 暂时只处理两层
- const getFlatData = (attrs, filterData, dataToAoa, deep = 0) => {
- filterData.map((item) => {
- let cur = dataToAoa[deep];
- if (!cur) {
- cur = dataToAoa[deep] = [];
- }
- attrs.map((attr, index) => {
- const { key, child } = attr;
- if (child) {
- if (Array.isArray(item[key])) {
- // getFlatData(child,item[key],dataToAoa,deep)
-
- item[key].map((s, i) => {
- if (i == 0) {
- child.map((c) => {
- cur.push(s[c.key]);
- });
- } else {
- deep++;
- const childCur = dataToAoa[deep] = [];
- pushNull(childCur, index);
- child.map((c) => {
- childCur.push(s[c.key]);
- });
- }
- });
- }
- } else {
- cur.push(item[key]);
- }
- });
- deep++;
- });
- };
-
- const getHeader = (headers, excelHeader, deep, perOffset) => {
- let offset = 0;
- let cur = excelHeader[deep];
- if (!cur) {
- cur = excelHeader[deep] = [];
- }
- pushNull(cur, perOffset - cur.length);
- for (let i = 0; i < headers.length; i++) {
- const head = headers[i];
- cur.push(head.name);
- if (head.hasOwnProperty('child') && Array.isArray(head.child) && head.child.length > 0) {
- const childOffset = getHeader(head.child, excelHeader, deep + 1, cur.length - 1);
- pushNull(cur, childOffset - 1);
- offset += childOffset;
- } else {
- offset++;
- }
- }
- return offset;
- };
-
- const pushNull = (arr, count) => {
- for (let i = 0; i < count; i++) {
- arr.push(null);
- }
- };
- const fillNull = (arr) => {
- const max = Math.max(...(arr.map((a) => a.length)));
- arr.filter((e) => e.length < max).forEach((e) => pushNull(e, max - e.length));
- };
- const doMerges = (arr) => {
- // 要么横向合并 要么纵向合并
- const deep = arr.length;
- const merges = [];
- for (let y = 0; y < deep; y++) {
- // 先处理横向合并
- const row = arr[y];
- let colSpan = 0;
- for (let x = 0; x < row.length; x++) {
- if (row[x] === null) {
- colSpan++;
- if (((x + 1) === row.length) && (colSpan > 0 && x > colSpan)) {
- merges.push({ s: { r: y, c: x - colSpan }, e: { r: y, c: x } });
- }
- } else if (colSpan > 0 && x > colSpan) {
- merges.push({ s: { r: y, c: x - colSpan - 1 }, e: { r: y, c: x - 1 } });
- colSpan = 0;
- } else {
- colSpan = 0;
- }
- }
- }
- // 再处理纵向合并
- const colLength = arr[0].length;
- for (let x = 0; x < colLength; x++) {
- let rowSpan = 0;
- for (let y = 0; y < deep; y++) {
- if (arr[y][x] != null) {
- rowSpan = 0;
- } else {
- rowSpan++;
- }
- }
- if (rowSpan > 0) {
- merges.push({ s: { r: deep - rowSpan - 1, c: x }, e: { r: deep - 1, c: x } });
- }
- }
- return merges;
- };
- // 内容暂只出了纵向合并
- const doContetMerges = (arr, headerLength) => {
- const deep = arr.length;
- const merges = [];
- // 处理纵向合并
- const colLength = arr[0].length;
- for (let x = 0; x < colLength; x++) {
- let rowSpan = 0;
- const mergY = 0;
- for (let y = 0; y < deep; y++) {
- if (rowSpan > 0) {
- // 如果还有null 继续加
- if (arr[y][x] === null) {
- rowSpan += 1;
- } else {
- // 不为null 增加merge
- merges.push({ s: { r: headerLength + (y - rowSpan - 1), c: x }, e: { r: headerLength + y - 1, c: x } });
- rowSpan = 0;
- }
- } else if (arr[y][x] === null) {
- rowSpan += 1;
- }
- }
- if (rowSpan > 0) {
- merges.push({ s: { r: headerLength + (deep - rowSpan - 1), c: x }, e: { r: headerLength + deep - 1, c: x } });
- rowSpan = 0;
- }
- }
- return merges;
- };
- const exportMergeExcel = async () => {
- setExportLoading(true);
- const {
- column, data, fileName, exportUrl, exportQuery, exportBody, requestType, header, showYearMouth,
- } = props || {};
-
- let resultData = [];
- if (exportUrl) {
- resultData = requestType == 'post' ? await Request.post(exportUrl, exportBody || {}, exportQuery || {}).then((data) => {
- // 数据接口返回的结果 如果是对象 必须把返回数组放入rows
- if (typeof data === 'object' && data.rows) {
- return data.rows;
- }
- return data;
- }, (err) => {
- message.error('获取数据失败,导出失败!');
- }) : await Request.get(exportUrl, exportQuery || {}).then((data) => {
- if (typeof data === 'object' && data.rows) {
- return data.rows;
- }
- return data;
- }, (err) => {
- message.error('获取数据失败,导出失败!');
- });
- if (!resultData) {
- return;
- }
- } else {
- resultData = data;
- }
- const excelHeader = [];
- getHeader(column, excelHeader, 0, 0);
- fillNull(excelHeader);
-
- // console.log(excelHeader);
-
- const loopData = getDataSource(column, resultData);
- // console.log(loopData)
-
- const dataToAoa = [];
- getFlatData(column, loopData, dataToAoa, 0);
- fillNull(dataToAoa);
- // console.log(dataToAoa);
-
- const aoa = [].concat(excelHeader, dataToAoa);
- // console.log(aoa)
-
- const headerMerges = doMerges(excelHeader);
- const contentMerages = doContetMerges(dataToAoa, excelHeader.length);
- const merges = [].concat(headerMerges, contentMerages);
- // console.log(contentMerages)
-
- // let opts = {
- // defaultCellStyle: {
- // font: { name: "宋体", sz: 11, color: { auto: 1 } },
- // border: {
- // color: { auto: 1 }
- // },
- // alignment: {
- // /// 自动换行
- // wrapText: 1,
- // // 居中
- // horizontal: "center",
- // vertical: "center",
- // indent: 0
- // }
- // }
- // }
- const sheet = XLSX.utils.aoa_to_sheet(aoa);
- // let newSheet = {};
- // for (let [key, value] of Object.entries(sheet)) {
- // if(key == '!ref'){
- // newSheet[key] = value
- // }else if(typeof value === 'object'){
- // newSheet[key] = {
- // ...value,
- // s: opts.defaultCellStyle
- // }
- // }
- // }
- const wpx = column.map((c) => ({
- wpx: Number.parseInt(c.wpx) ? Number.parseInt(c.wpx) : 100,
- }));
- sheet['!cols'] = wpx;
- sheet['!merges'] = merges;
-
- // 构建 workbook 对象
- const workbook = XLSX.utils.book_new();
-
- const time = moment().format('YYYY-MM-DD');
-
- XLSX.utils.book_append_sheet(workbook, sheet, 'mySheet');
- // 导出 Excel
- XLSX.writeFile(workbook, fileName ? `${fileName}-${time}.xlsx` : '导出数据.xlsx');
- setExportLoading(false);
- // message.success(`成功导出了 ${loopData.length || 0} 条数据`);
- };
-
- const exportProExcel = async () => {
- setExportLoading(true);
- const {
- column, data, fileName, exportUrl, exportQuery, exportBody, requestType, showYearMouth,
- } = props || {};
- let resultData = [];
- if (exportUrl) {
- resultData = requestType == 'post' ? await Request.post(exportUrl, exportBody || {}, exportQuery || {}).then((data) => {
- // 数据接口返回的结果 如果是对象 必须把返回数组放入rows
- if (typeof data === 'object') {
- return data.data ? data.data : data.rows;
- }
- return data;
- }, (err) => {
- message.error('获取数据失败,导出失败!');
- }) : await Request.get(exportUrl, exportQuery || {}).then((data) => {
- if (showYearMouth) {
-
- }
- if (typeof data === 'object' && data.rows) {
- return data.rows;
- }
- return data;
- }, (err) => {
- message.error('获取数据失败,导出失败!');
- });
- if (!resultData) {
- return;
- }
- } else {
- resultData = data;
- }
-
- const loopData = getDataSource(column, resultData);
-
- let content = '';
- let header = '';
- // header += `序号 | `;
- column.map((colum) => {
- header += `${colum.name} | `;
- });
- header += '
';
- loopData.map((data) => {
- content += '';
- column.map((c) => {
- if (c.style) {
- content += `${data[c.dataIndex || c.key]} | `;
- } else {
- content += `${data[c.dataIndex || c.key]} | `;
- }
- });
- content += '
';
- });
-
- const exportTable = `\uFEFF
-
- ${header}
- ${content}
-
- `;
- const time = moment().format('YYYY-MM-DD');
- const tempStrs = new Blob([exportTable], { type: 'text/xls' });
- FileSaver.saveAs(tempStrs, fileName ? `${fileName}-${time}.xls` : '导出数据.xls');
- setExportLoading(false);
- // message.success(`成功导出了 ${loopData.length || 0} 条数据`);
- };
-
- const exportExcel = async () => {
- setExportLoading(true);
- const {
- column, data, fileName, exportUrl, exportQuery, exportBody, requestType,
- } = props || {};
- const _headers = column
- .map((item, i) => ({ key: item.key, title: item.name, position: String.fromCharCode(65 + i) + 1 }))
- .reduce((prev, next) => ({ ...prev, [next.position]: { key: next.key, v: next.title } }), {});
- let resultData = [];
- if (exportUrl) {
- resultData = requestType == 'post' ? await Request.post(exportUrl, exportBody || {}, exportQuery || {}).then((data) => {
- // 数据接口返回的结果 如果是对象 必须把返回数组放入rows
-
- if (typeof data === 'object' && (data.rows || data.data)) {
- return data.data ? data.data : data.rows;
- }
- return data;
- }, (err) => {
- message.error('获取数据失败,导出失败!');
- }) : await Request.get(exportUrl, exportQuery || {}).then((data) => {
- if (typeof data === 'object' && data.rows) {
- return data.rows;
- }
- return data;
- }, (err) => {
- message.error('获取数据失败,导出失败!');
- });
- if (!resultData) {
- return;
- }
- } else {
- resultData = data;
- }
-
- const loopDate = getDataSource(column, resultData);
-
- const wpx = column.map((c) => ({
- wpx: Number.parseInt(c.wpx) ? Number.parseInt(c.wpx) : 100,
- }));
- if (!(loopDate.length > 0)) {
- setExportLoading(false);
- return;
- }
- const _data = loopDate
- .map((item, i) => column.map((key, j) => ({ content: item[key.key], position: String.fromCharCode(65 + j) + (i + 2) })))
- // 对刚才的结果进行降维处理(二维数组变成一维数组)
- .reduce((prev, next) => prev.concat(next))
- // 转换成 worksheet 需要的结构
- .reduce((prev, next) => ({ ...prev, [next.position]: { v: next.content } }), {});
-
- // 合并 column 和 data
- const output = { ..._headers, ..._data };
- // 获取所有单元格的位置
- const outputPos = Object.keys(output);
- // 计算出范围 ,["A1",..., "H2"]
- const ref = `${outputPos[0]}:${outputPos[outputPos.length - 1]}`;
-
- // 构建 workbook 对象
- const workbook = {
- SheetNames: ['mySheet'],
- Sheets: {
- mySheet: {
-
- ...output,
- '!ref': ref,
- '!cols': wpx,
- },
- },
- };
- const time = moment().format('YYYY-MM-DD');
- // 导出 Excel
- XLSX.writeFile(workbook, fileName ? `${fileName}-${time}.xlsx` : '导出数据.xlsx');
- setExportLoading(false);
- // message.success(`成功导出了 ${loopDate.length || 0} 条数据`);
- };
-
- const exportTemplete = async () => {
- const { importTemColumn, importTemData, fileName } = props || {};
- const _headers = importTemColumn
- .map((item, i) => {
- let group = 0; // 用于处理Z1的时候,重计算AA1
- if (parseInt(i / 26) > group) {
- group = parseInt(i / 26);
- }
- if (group > 0) { // AA1 BA1 CA1
- const position = String.fromCharCode(65 + (group - 1));
- return { key: item.key, title: item.name, position: position + String.fromCharCode(65 + (i % 26)) + 1 };
- } return { key: item.key, title: item.name, position: String.fromCharCode(65 + i) + 1 };
- })
- .reduce((prev, next) => ({ ...prev, [next.position]: { key: next.key, v: next.title } }), {});
-
- const loopDate = getDataSource(importTemColumn, importTemData);
-
- const wpx = importTemColumn.map((c) => ({
- wpx: Number.parseInt(c.wpx) ? Number.parseInt(c.wpx) : 100,
- }));
- const _data = loopDate.length ? loopDate
- .map((item, i) => importTemColumn.map((key, j) => ({ content: item[key.key], position: String.fromCharCode(65 + j) + (i + 2) })))
- // 对刚才的结果进行降维处理(二维数组变成一维数组)
- .reduce((prev, next) => prev.concat(next))
- // 转换成 worksheet 需要的结构
- .reduce((prev, next) => ({ ...prev, [next.position]: { v: next.content } }), {}) : [];
- // 合并 column 和 data
- const output = { ..._headers, ..._data };
- // 获取所有单元格的位置
- const outputPos = Object.keys(output);
- // 计算出范围 ,["A1",..., "H2"]
- const ref = `${outputPos[0]}:${outputPos[outputPos.length - 1]}`;
-
- // 构建 workbook 对象
- const workbook = {
- SheetNames: ['mySheet'],
- Sheets: {
- mySheet: {
-
- ...output,
- '!ref': ref,
- '!cols': wpx,
- },
- },
- };
- // 导出 Excel
- XLSX.writeFile(workbook, fileName ? `${fileName}-导入模板.xlsx` : '导入模板.xlsx');
- };
- const tips = (type) => {
- const { tips, templeteBth = true } = props;
- const description = (
-
- {tips && tips}
-
-
-
- importExcel(e, type)} />
-
-
-
-
- {templeteBth && (
-
-
-
- )}
-
-
- );
-
- notification.info({
- message: '支持 .xlsx、.xls 格式的文件',
- description,
- key: 'import-notification',
- duration: null,
- });
- };
-
- return (
-
- {
- props.import && (
-
- )
- }
- {
- props.export && (
-
-
-
- )
- }
-
- );
-}
-
-ExportAndImport.propTypes = {
- export: PropTypes.bool, // 是否显示导出按钮
- exportBtnName: PropTypes.string, // 导出按钮文字
- importBtnName: PropTypes.string, // 导入按钮文字
- import: PropTypes.bool, // 是否显示导入按钮
- variedImport: PropTypes.bool, // 是否显示多样导入
- variedImportDisable: PropTypes.bool, // 多样导入禁用
- variedImportBtnName: PropTypes.string, // 多样导入文字
- column: PropTypes.array, // 导出显示的header数组 兼容antd column 可直接拿table的column使用 注:column每列的属性wpx设置导出的execl每列的宽度值 默认 100
- data: PropTypes.array, // 导出的数据 兼容antd table 数组嵌套处理
- exportUrl: PropTypes.string, // 导出数据从接口获取的url地址 返回的数据1、数组必须支持column的设置 ,2、如果是对象,数组需放在rows属性上
- exportBody: PropTypes.object, // 导出数据接口body参数
- exportQuery: PropTypes.object, // 导出数据从接口获取的url地址上的参数
- exportBtnTips: PropTypes.string, // 导出按钮tips文字提示
- importUrl: PropTypes.string, // 导入接口url
- importQuery: PropTypes.object, // 导入接口url地址上的参数
- btnClass: PropTypes.string, // 按钮className
- btnStyle: PropTypes.object, // 按钮style
- tips: PropTypes.oneOfType([PropTypes.string, PropTypes.element]), // 上传文件提示的信息
- onImportSucess: PropTypes.func, // 上传成功后 返回处理函数
- importTemColumn: PropTypes.array, // 导入模板设置 头部字段数组
- importTemData: PropTypes.array, // 导入模板默认数据
- requestType: PropTypes.string, // 请求类型
- importDataCallback: PropTypes.func, // 上传后数据返回
- templeteBth: PropTypes.bool, // 模板按钮
- importRequest: PropTypes.bool, // 请求导入接口,false时搭配importDataCallback,
- exportType: PropTypes.string, // 导出执行的函数名
-};
-
-export default ExportAndImport;
diff --git a/web/client/src/components/export/index.less b/web/client/src/components/export/index.less
deleted file mode 100644
index a362e30..0000000
--- a/web/client/src/components/export/index.less
+++ /dev/null
@@ -1,13 +0,0 @@
-.export-import {
- .file-uploader {
- position: absolute;
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- outline: none;
- opacity: 0;
- background-color: transparent;
- z-index: 10;
- }
- }
\ No newline at end of file
diff --git a/web/client/src/components/flowRecordTable/index.js b/web/client/src/components/flowRecordTable/index.js
deleted file mode 100644
index 4d4465c..0000000
--- a/web/client/src/components/flowRecordTable/index.js
+++ /dev/null
@@ -1,74 +0,0 @@
-'use strict';
-import React, { Component } from 'react';
-import { Table } from 'antd';
-import './index.less';
-import moment from 'moment';
-
-class FlowRecordTable extends Component {
- constructor(props) {
- super(props);
- this.state = {
- isRequesting: false,
- pagination: {
- showTotal: total => `共${total}条`,
- responsive: true,
- defaultPageSize: 10,
- },
- data: []
- }
- this.token = JSON.parse(sessionStorage.getItem('user')).token;
- }
-
-
- getPagination = () => {
- const { pagination, data } = this.state;
- const { actiPage } = this.props;
- pagination.total = data.length > 0 ? data.length : 0;
- pagination.current = actiPage;
- return pagination;
- };
-
- onTableChange = (pagination, filters, sorter) => {
- this.props.onPageChange(pagination.current)
- }
- componentDidMount() {
- }
- render() {
- const { flowRecord } = this.props;
- const tableColumnAttrs = [
- {
- title: '序号',
- dataIndex: 'id',
- width: '12%',
- render: (text, record, index) => { return index + 1 }
- },
- {
- title: '操作人',
- dataIndex: 'processBy',
- width: '25%',
- },
- {
- title: '操作时间',
- dataIndex: 'processAt',
- width: '25%',
- render: (text, record, index) => { return moment(text).format('YYYY-MM-DD HH:mm') }
- }, {
- title: '操作内容',
- dataIndex: 'processContent',
- width: '38%',
- },
- ];
- return (
-
- );
- }
-}
-
-export default FlowRecordTable;
\ No newline at end of file
diff --git a/web/client/src/components/flowRecordTable/index.less b/web/client/src/components/flowRecordTable/index.less
deleted file mode 100644
index e69de29..0000000
diff --git a/web/client/src/components/index.js b/web/client/src/components/index.js
index 976457f..d2d7ebc 100644
--- a/web/client/src/components/index.js
+++ b/web/client/src/components/index.js
@@ -1,27 +1,10 @@
'use strict';
-import Upload from './Upload';
-import Uploads from './Uploads';
-import NoResource from './no-resource';
-import LimitTextArea from './limit-textarea';
-// import ProcessForm from './process_form'
-import FlowRecordTable from './flowRecordTable'
-import Table from './table'
-import Search from './search'
-import SketchColor from './sketchColor'
-import ExportAndImport from './export'
+// import Upload from './Upload';
+
export {
- Upload,
- Uploads,
- NoResource,
- LimitTextArea,
- // ProcessForm,
- FlowRecordTable,
- Table,
- Search,
- SketchColor,
- ExportAndImport,
+
};
diff --git a/web/client/src/components/limit-textarea/index.js b/web/client/src/components/limit-textarea/index.js
deleted file mode 100644
index e62863a..0000000
--- a/web/client/src/components/limit-textarea/index.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Input } from 'antd';
-const { TextArea } = Input;
-import './index.less';
-
-/***
- * 显示最大输入字符数
- * maxLength:300(默认)
- */
-class LimitTextArea extends PureComponent {
-
- constructor(props) {
- super(props)
- this.state = {
- len: 0,
- maxLength: 300,
- isvalid: true, // 是否显示最大字符数
- }
- // 若需要覆盖onChange时,value必填
- if (props.onChange && !props.hasOwnProperty('value')) {
- this.state.isvalid = false
- console.warn('LimitTextArea:绑定onChange时,value属性必填,否则显示最大输入字符数将失效!')
- }
- }
-
- // 若外部定义了onChange事件,handleChange将会被覆盖
- handleChange = (e) => {
- const { sep } = this.props
- const val = e.target.value
- const arr = (val || '').split(sep)
- this.setState({
- len: arr.length
- })
- }
-
- render () {
- const { maxLength: defaultMax, isvalid } = this.state
- const { sep, maxLength, value, ...restProps } = this.props
- const max = maxLength > 0 ? maxLength : defaultMax
- /** form组件中,value有值 */
- const arr = (value || '').split(sep)
- let len = value ? arr.length : this.state.len
- len = len > max ? max : len
- /**截取最大字符串 */
- const val = arr.slice(0, len).join(sep)
- const n = val ? len : 0
- const suffix = `${n}/${max}`
-
- return isvalid ? (
-
-
- ) :
- }
-}
-
-LimitTextArea.defaultProps = {
- /** 分割符
- * 可以是个字符串,如:'\n'
- * 也可以是个正则表达式,如:/\n\r/
- */
- sep: ''
-}
-
-export default LimitTextArea;
diff --git a/web/client/src/components/limit-textarea/index.less b/web/client/src/components/limit-textarea/index.less
deleted file mode 100644
index b3fd54a..0000000
--- a/web/client/src/components/limit-textarea/index.less
+++ /dev/null
@@ -1,10 +0,0 @@
-.block {
- position: relative;
- .counter {
- position: absolute;
- bottom: 5px;
- right: 15px;
- color: #adadad;
- z-index: 2;
- }
- }
\ No newline at end of file
diff --git a/web/client/src/components/no-resource/index.js b/web/client/src/components/no-resource/index.js
deleted file mode 100644
index b4a221d..0000000
--- a/web/client/src/components/no-resource/index.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-import React from 'react';
-import { Result} from 'antd';
-import { MehOutlined } from '@ant-design/icons';
-class NoResource extends React.Component {
- constructor(props) {
- super(props);
- }
- render() {
- const title = this.props.title ? this.props.title : "抱歉,没有可访问的资源!"
- return (
- }
- title={title}
- />
- );
- }
-}
-
-export default NoResource;
\ No newline at end of file
diff --git a/web/client/src/components/search/index.js b/web/client/src/components/search/index.js
deleted file mode 100644
index e2a0786..0000000
--- a/web/client/src/components/search/index.js
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- * Created by Xumeng 2020/04/01.
- */
-'use strict';
-
-import React, { useState } from 'react';
-import PropTypes from 'prop-types';
-import { Space, Row, Col, Form, DatePicker, Input, Select, Button } from 'antd';
-import { DownOutlined, UpOutlined } from '@ant-design/icons';
-//import { fromJS } from 'immutable';
-import { Constans } from '$utils';
-import moment from 'moment';
-import './index.less';
-const FormItem = Form.Item;
-const { RangePicker } = DatePicker;
-
-//通用搜索栏组件 使用方法查看底部propTypes
-
-const Search = (props) => {
- const [expand, setExpand] = useState(false);
- const [form] = Form.useForm();
- const { colSpan } = props;
- //初始化表单数据
- const getinitialValues = () => {
- const { formList } = props;
- let obj = {};
- formList.forEach((v) => {
- const { field, initialValue } = v;
- if (initialValue) {
- obj[field] = initialValue;
- }
- });
-
- return obj;
- };
- //获取表单项
- const getFields = () => {
- const formItemList = [];
- const { formList, showNumber, offset } = props;
- let showNum = showNumber ? showNumber : 3;
- let offsetNum = offset ? offset : 0;
- const span = Number.parseInt((24 - offsetNum) / showNum);
- if (formList && formList.length > 0) {
- formList.forEach((item, index) => {
- const { label, field, type, placeholder, style, labelSpan, showTime, optionName, list, rules, itemProps } = item;
- let num = 0;
- if (index === 0 && offsetNum) {
- num = offsetNum;
- }
- switch (type) {
- case 'TIME':
- const TIMES = (
-
-
- triggerNode.parentNode}
- //showTime={showTime ? showTime : false}
- style={style ? style : {}}
- placeholder={placeholder || '选择日期'}
- format='YYYY-MM-DD'
- {...itemProps}
- />
-
-
- );
- formItemList.push(TIMES);
- break;
- case 'RANGETIME':
- const RANGETIMES = (
-
-
- triggerNode.parentNode}
- showTime={showTime ? showTime : false}
- style={style ? style : {}}
- //placeholder={placeholder || '选择日期时间段'}
- format={showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'}
- {...itemProps}
- />
-
-
- );
- formItemList.push(RANGETIMES);
- break;
- case 'SELECT':
- const SELECT = (
-
-
-
-
-
- );
- formItemList.push(SELECT);
- break;
- default:
- const INPUT = (
-
-
-
-
-
- );
- formItemList.push(INPUT);
- break;
- }
- });
- }
- //默认显示个数处理
- return expand ? formItemList : formItemList.slice(0, showNum);
- };
-
- const onFinish = (values) => {
- const { formList } = props;
- let obj = Object.assign({}, values);
- //处理时间
- formList.forEach((v) => {
- if (v.type == 'TIME' && obj.hasOwnProperty(v.field)) {
- if (obj[v.field]) {
- obj[v.field] = [
- moment(obj[v.field]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
- moment(obj[v.field]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
- ];
- }
- }
- if (v.type == 'RANGETIME' && obj.hasOwnProperty(v.field)) {
- if (Array.isArray(obj[v.field])) {
- obj[v.field] = v.showTime
- ? [moment(obj[v.field][0]).format('YYYY-MM-DD HH:mm:ss'), moment(obj[v.field][1]).format('YYYY-MM-DD HH:mm:ss')]
- : [
- moment(obj[v.field][0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
- moment(obj[v.field][1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
- ];
- }
- }
- //处理undefind
- if (obj[v.field] === undefined) {
- obj[v.field] = null;
- }
- });
-
- props.onSearch(obj);
- };
-
- const getOptionList = (data, name) => {
- if (!data) {
- return [];
- }
- return data.map((item) => (
-
- {item[`${name}`]}
-
- ));
- };
-
- return (
-
- );
-};
-
-Search.propTypes = {
- //查询配置数组 [{label, field, type[TIME,RANGETIME,SELECT,INPUT], initialValue, placeholder, width, list(select使用) optionName(select使用) , showTime(是否显示时间) }]
- formList: PropTypes.array.isRequired,
- showNumber: PropTypes.number, //默认展示几个item ,其余展开按钮控制
- offset: PropTypes.number, //设置第一个item的偏移值
- onSearch: PropTypes.func.isRequired, //查询提交函数
- showRest: PropTypes.bool, //是否显示重置按钮
- colSpan: PropTypes.object // 搜索栏整体布局 默认 {label: 18 : button: 6}
-};
-
-export default Search;
diff --git a/web/client/src/components/search/index.less b/web/client/src/components/search/index.less
deleted file mode 100644
index 53bef59..0000000
--- a/web/client/src/components/search/index.less
+++ /dev/null
@@ -1,3 +0,0 @@
-.ant-form-horizontal .ant-form-item-control {
- flex: 1 1 0%;
-}
diff --git a/web/client/src/components/sketchColor/index.js b/web/client/src/components/sketchColor/index.js
deleted file mode 100644
index 498cfda..0000000
--- a/web/client/src/components/sketchColor/index.js
+++ /dev/null
@@ -1,82 +0,0 @@
-'use strict'
-import React from 'react';
-import { SketchPicker } from 'react-color';
-
-class SketchColor extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- displayColorPicker: false,
- color: "#fff",
- };
-
- }
- componentDidMount() {
- const { color } = this.props;
-
- color && this.setState({
- color: color
- })
-
- }
- handleClick = () => {
- this.setState({ displayColorPicker: !this.state.displayColorPicker })
- };
-
- handleClose = () => {
- this.setState({ displayColorPicker: false })
- };
-
- handleChange = (color) => {
- const {onChangeComplete} = this.props;
- this.setState({ color: color.hex });
- onChangeComplete && onChangeComplete(color)
- };
-
- render() {
- const { color } = this.state;
- const styles = {
- color: {
- width: '36px',
- height: '14px',
- borderRadius: '2px',
- background: color,
- },
- swatch: {
- padding: '5px',
- background: '#fff',
- borderRadius: '1px',
- boxShadow: '0 0 0 1px rgba(0,0,0,.1)',
- display: 'inline-block',
- cursor: 'pointer',
- },
- popover: {
- position: 'absolute',
- zIndex: '2',
- },
- cover: {
- position: 'fixed',
- top: '0px',
- right: '0px',
- bottom: '0px',
- left: '0px',
- },
-
- };
-
- return (
-
-
- { this.state.displayColorPicker ?
: null }
-
-
- )
- }
-}
-
-export default SketchColor
\ No newline at end of file
diff --git a/web/client/src/components/table/index.js b/web/client/src/components/table/index.js
deleted file mode 100644
index 02b52e6..0000000
--- a/web/client/src/components/table/index.js
+++ /dev/null
@@ -1,259 +0,0 @@
-'use strict';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { Table as AntdTable, Divider, Dropdown, Menu, Spin, Popconfirm } from 'antd';
-import { DownOutlined } from '@ant-design/icons';
-import { fromJS } from 'immutable';
-import './index.less';
-
-const loop = (data, keypath, values) => {
- // deal with array
- let dkey = keypath.slice(0, 1)[0];
- if (dkey) {
- let dvalue = data[dkey];
- let otherKeypath = keypath.slice(1);
- if (Array.isArray(dvalue)) {
- if (otherKeypath.length) {
- let immutableData = fromJS(data);
- for (let index = 0; index < dvalue.length; index++) {
- let tmp = immutableData.getIn([dkey, index]).toJS();
- loop(tmp, otherKeypath, values);
- }
- }
- } else {
- values.push(dvalue);
- }
- }
- return values;
-};
-
-//通用table组件 使用方法查看底部propTypes
-class Table extends Component {
- constructor(props) {
- super(props);
- this.state = {
- selectedRowKeys: [],
- pagination: {
- showTotal: (total) => `共${total}条`,
- showSizeChanger: true,
- showQuickJumper: true,
- responsive: true,
- pageSizeOptions: ['10', '20', '30', '40'],
- defaultPageSize: 10
- },
- visible: {},
- current: 1
- };
- this.token = JSON.parse(sessionStorage.getItem('user')).token;
- }
- handleMenuClick = (e) => {
- //TODO 点击删除
- };
-
- UNSAFE_componentWillReceiveProps() {
- this.setState({
- visible: {}
- });
- }
-
- handleVisibleChange = (flag, key) => {
- let visible = this.state.visible;
- visible[key] = flag;
- this.setState({ visible });
- };
-
- getColumns = () => {
- let columns = this.props.attrs.map((attr) => {
- const { dataIndex, key, name, render, width, ellipsis, fixed } = attr;
- let obj = {
- title: name,
- dataIndex: dataIndex || key,
- key: key,
- ellipsis: ellipsis == undefined ? true : ellipsis,
- width: width
- };
- if (render) {
- obj.render = render;
- }
- if (fixed) {
- obj.fixed = fixed;
- }
- return obj;
- });
-
- if (!this.props.actions) {
- return columns;
- }
-
- columns.push({
- title: '操作',
- key: 'action',
- className: 'fs-table-column-action',
- render: (text, record) => {
- let actions = this.props.actions;
- if (record && record.actions) actions = actions.filter((act) => record.actions.includes(act.key));
-
- return (
-
- {actions.reduce((p, c, i) => {
- const { key, name, handler, dom, style, dropdown, hidden, popconfirm, getPopTitleFun, definedTitle } = c;
- if (typeof hidden === 'function') {
- let unVisiable = hidden(record);
- if (unVisiable) return p;
- }
-
- if (dropdown && Array.isArray(dropdown)) {
- // 操作按钮 下拉菜单处理
- const menus = (
-
- );
- p.push(
- this.handleVisibleChange(e, text.id)}
- visible={this.state.visible ? this.state.visible[text.id] : false}
- key={key}
- >
- e.preventDefault()}>
- {name}
-
-
- );
- } else {
- if (dom) {
- popconfirm
- ? p.push(
- handler(record)} key={key}>
- e.preventDefault()}
- >
- {dom}
-
-
- )
- : p.push(
- handler(record)}>
- {dom}
-
- );
- } else {
- popconfirm
- ? p.push(
- handler(record)} key={key}>
- e.preventDefault()}
- >
- {name}
-
-
- )
- : p.push(
- handler(record)}>
- {name}
-
- );
- }
- }
-
- if (i < actions.length - 1) p.push();
- return p;
- }, [])}
-
- );
- }
- });
-
- return columns;
- };
-
- getColumnData = (opts) => {
- const { data, keypath, spliter, rawdata } = opts;
- let v = null;
- let outer = data[keypath[0]];
- if (Array.isArray(outer)) {
- let values = loop(data, keypath, []);
- v = rawdata ? values : values.join(spliter || ',');
- } else {
- v = fromJS(data).getIn(keypath);
- }
- return v;
- };
-
- getPagination = () => {
- const { total, curpage } = this.props;
- const { pagination, current } = this.state;
- pagination.total = total ? total : 0;
- pagination.current = curpage ? curpage : current;
- return pagination;
- };
- //暂时只支持分页远程处理
- handleTableChange = (pagination, filters, sorter) => {
- this.setState({
- current: pagination.current
- });
- if (this.props.onTableChange) {
- let limit = Number.parseInt(pagination.pageSize);
- let offset = limit * (Number.parseInt(pagination.current) - 1);
- this.props.onTableChange(limit, offset, pagination.current);
- }
- };
- render() {
- const { scroll, rowSelection, data, isRequesting, showHeader, noShowPagination, rowKey } = this.props;
- return (
-
- );
- }
-}
-Table.propTypes = {
- data: PropTypes.array.isRequired, //数据资源
- attrs: PropTypes.array.isRequired, //属性数组用于colums {key,name,|render|isImg|nullable}
- actions: PropTypes.array, //操作栏数组 { key,name,style,handler,dropdown,dom}
- scroll: PropTypes.object, //同antd 用法
- rowSelection: PropTypes.object, //表格行是否可选择 配置项同antd
- onTableChange: PropTypes.func, //onChange触发函数
- showHeader: PropTypes.bool, //是否显示表头
- noShowPagination: PropTypes.bool, //是否显示分页器,
- showLessItems: PropTypes.bool, //是否显示较少页面内容,
- rowKey: PropTypes.string//表格记录的key
-};
-export default Table;
diff --git a/web/client/src/components/table/index.less b/web/client/src/components/table/index.less
deleted file mode 100644
index fdbacac..0000000
--- a/web/client/src/components/table/index.less
+++ /dev/null
@@ -1,34 +0,0 @@
-//宽度小于1920px
-@media screen and (max-width:1920px) {
- .fs-table :global(.ant-table tbody > tr > td) {
- border: none;
- font-size: 14px;
- font-weight: 400;
- color: #666;
- }
- .fs-table :global(.ant-table thead > tr > th) {
- border: none;
- font-size: 14px;
- font-weight: 600;
- }
-}
-
-//宽度大于等于1920px
-@media screen and (min-width:1920px) {
- .fs-table :global(.ant-table tbody > tr > td) {
- border: none;
- font-size: 14px;
- font-weight: 400;
- color: #666;
- }
- .fs-table :global(.ant-table thead > tr > th) {
- border: none;
- font-size: 16px;
- font-weight: 600;
- }
-}
-
-
-// .fs-table :global(.fs-table-column-action) {
-// font-size: 16px;
-// }
diff --git a/web/client/src/index.js b/web/client/src/index.js
index dac0415..867e9db 100644
--- a/web/client/src/index.js
+++ b/web/client/src/index.js
@@ -4,4 +4,4 @@ import React from 'react';
import { render } from 'react-dom';
import App from './app';
-render((), document.getElementById('App'));
\ No newline at end of file
+render((), document.getElementById('App'));
\ No newline at end of file
diff --git a/web/client/src/layout/components/header/index.js b/web/client/src/layout/components/header/index.js
index 3e088ae..fd3712f 100644
--- a/web/client/src/layout/components/header/index.js
+++ b/web/client/src/layout/components/header/index.js
@@ -38,7 +38,7 @@ const Header = props => {
{/*
*/}
- 运维巡检平台
+ 泵站系统
diff --git a/web/client/src/layout/components/sider/index.js b/web/client/src/layout/components/sider/index.js
index a909838..a653387 100644
--- a/web/client/src/layout/components/sider/index.js
+++ b/web/client/src/layout/components/sider/index.js
@@ -37,15 +37,15 @@ const Sider = (props) => {
let firstItem = items[0] || null
if (firstItem) {
- let children = firstItem.props.children
+ let children = firstItem?.props?.children
if (Array.isArray(children)) {
- selectedKeys = [children[0].key]
- openKeys = [firstItem.key]
- } else if (children.key) {
- selectedKeys = [children.key]
- openKeys = [firstItem.key]
+ selectedKeys = [children[0]?.key]
+ openKeys = [firstItem?.key]
+ } else if (children?.key) {
+ selectedKeys = [children?.key]
+ openKeys = [firstItem?.key]
} else {
- selectedKeys = [firstItem.key]
+ selectedKeys = [firstItem?.key]
}
}
}
diff --git a/web/client/src/sections/auth/containers/login.js b/web/client/src/sections/auth/containers/login.js
index 63bbe0c..034eab3 100644
--- a/web/client/src/sections/auth/containers/login.js
+++ b/web/client/src/sections/auth/containers/login.js
@@ -35,7 +35,7 @@ const Login = props => {
useEffect(() => {
if (user && user.authorized) {
- dispatch(push('/projectRegime/information'));
+ dispatch(push('/systemManagement'));
}
}, [user])
@@ -138,7 +138,6 @@ const Login = props => {
function mapStateToProps (state) {
const { auth } = state;
- console.log(auth.error);
return {
user: auth.user,
error: auth.error,
diff --git a/web/client/src/sections/organization/actions/authority.js b/web/client/src/sections/bigScreen/actions/authority.js
similarity index 100%
rename from web/client/src/sections/organization/actions/authority.js
rename to web/client/src/sections/bigScreen/actions/authority.js
diff --git a/web/client/src/sections/organization/actions/index.js b/web/client/src/sections/bigScreen/actions/index.js
similarity index 100%
rename from web/client/src/sections/organization/actions/index.js
rename to web/client/src/sections/bigScreen/actions/index.js
diff --git a/web/client/src/sections/organization/actions/user.js b/web/client/src/sections/bigScreen/actions/user.js
similarity index 100%
rename from web/client/src/sections/organization/actions/user.js
rename to web/client/src/sections/bigScreen/actions/user.js
diff --git a/web/client/src/sections/bigScreen/components/basis.js b/web/client/src/sections/bigScreen/components/basis.js
new file mode 100644
index 0000000..3e2f4f8
--- /dev/null
+++ b/web/client/src/sections/bigScreen/components/basis.js
@@ -0,0 +1,26 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { Spin, Card, Modal, TreeSelect, message } from 'antd';
+import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
+
+const Basis = ({ user, module, setModule }) => {
+
+
+
+
+
+ return
+ 基础信息
+
+
+}
+
+function mapStateToProps (state) {
+ const { auth, global } = state;
+ return {
+ user: auth.user,
+ clientHeight: global.clientHeight,
+ };
+}
+
+export default connect(mapStateToProps)(Basis);
\ No newline at end of file
diff --git a/web/client/src/sections/bigScreen/components/capacity.js b/web/client/src/sections/bigScreen/components/capacity.js
new file mode 100644
index 0000000..5091abd
--- /dev/null
+++ b/web/client/src/sections/bigScreen/components/capacity.js
@@ -0,0 +1,26 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { Spin, Card, Modal, TreeSelect, message } from 'antd';
+import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
+import Title from 'antd/lib/skeleton/Title';
+
+const Capacity = ({ user, }) => {
+
+
+
+
+
+ return
+ 能耗监测
+
+}
+
+function mapStateToProps (state) {
+ const { auth, global } = state;
+ return {
+ user: auth.user,
+ clientHeight: global.clientHeight,
+ };
+}
+
+export default connect(mapStateToProps)(Capacity);
\ No newline at end of file
diff --git a/web/client/src/sections/bigScreen/components/electrical.js b/web/client/src/sections/bigScreen/components/electrical.js
new file mode 100644
index 0000000..12465e0
--- /dev/null
+++ b/web/client/src/sections/bigScreen/components/electrical.js
@@ -0,0 +1,27 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { Spin, Card, Modal, TreeSelect, message } from 'antd';
+import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
+import Title from 'antd/lib/skeleton/Title';
+
+const Electrical = ({ user, module, setModule }) => {
+
+
+
+
+
+ return
+ 电排远控
+
+
+}
+
+function mapStateToProps (state) {
+ const { auth, global } = state;
+ return {
+ user: auth.user,
+ clientHeight: global.clientHeight,
+ };
+}
+
+export default connect(mapStateToProps)(Electrical);
\ No newline at end of file
diff --git a/web/client/src/sections/bigScreen/components/header.js b/web/client/src/sections/bigScreen/components/header.js
new file mode 100644
index 0000000..c8b721f
--- /dev/null
+++ b/web/client/src/sections/bigScreen/components/header.js
@@ -0,0 +1,75 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { Spin, Card, Modal, TreeSelect, message } from 'antd';
+import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
+import Title from 'antd/lib/skeleton/Title';
+
+const Header = ({ user, module, setModule }) => {
+
+
+
+
+
+ return
+
+
+
+ {[{ title: '基础信息', key: 'basis' },
+ { title: '能耗监测', key: 'capacity' },
+ { title: '电排远控', key: 'electrical ' },
+ { title: '实时监测', key: 'realTime' },].map(v => {
+ return
setModule(v.key)}>{v.title}
+ })}
+
+
+
+
+
+}
+
+function mapStateToProps (state) {
+ const { auth, global } = state;
+ return {
+ user: auth.user,
+ clientHeight: global.clientHeight,
+ };
+}
+
+export default connect(mapStateToProps)(Header);
\ No newline at end of file
diff --git a/web/client/src/sections/bigScreen/components/realTime.js b/web/client/src/sections/bigScreen/components/realTime.js
new file mode 100644
index 0000000..a9ea597
--- /dev/null
+++ b/web/client/src/sections/bigScreen/components/realTime.js
@@ -0,0 +1,26 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import { Spin, Card, Modal, TreeSelect, message } from 'antd';
+import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
+import Title from 'antd/lib/skeleton/Title';
+
+const RealTime = ({ user, module, setModule }) => {
+
+
+
+
+
+ return
+ 实时监测
+
+}
+
+function mapStateToProps (state) {
+ const { auth, global } = state;
+ return {
+ user: auth.user,
+ clientHeight: global.clientHeight,
+ };
+}
+
+export default connect(mapStateToProps)(RealTime);
\ No newline at end of file
diff --git a/web/client/src/sections/bigScreen/containers/index.js b/web/client/src/sections/bigScreen/containers/index.js
new file mode 100644
index 0000000..6921acb
--- /dev/null
+++ b/web/client/src/sections/bigScreen/containers/index.js
@@ -0,0 +1,5 @@
+'use strict';
+
+import SystemManagement from './systemManagement';
+
+export { SystemManagement };
\ No newline at end of file
diff --git a/web/client/src/sections/bigScreen/containers/systemManagement.js b/web/client/src/sections/bigScreen/containers/systemManagement.js
new file mode 100644
index 0000000..ee7e1e3
--- /dev/null
+++ b/web/client/src/sections/bigScreen/containers/systemManagement.js
@@ -0,0 +1,50 @@
+import React, { useEffect, useState } from 'react';
+import { connect } from 'react-redux';
+import { FormOutlined, DeleteOutlined } from '@ant-design/icons';
+import { Spin, Tooltip, Button, Popconfirm, Row, Col, Tree, Card, Switch } from 'antd';
+import ProTable from '@ant-design/pro-table';
+import { getDepMessage, getDepUser, createUser, updateUser, delUser, resetPwd, createDept, updateDept, delDept } from '../actions/user';
+import Header from '../components/header';
+import Basis from '../components/basis';
+import Capacity from '../components/capacity';
+import Electrical from '../components/electrical';
+import RealTime from '../components/realTime';
+
+const TreeNode = Tree.TreeNode;
+
+const SystemManagement = ({ clientHeight, user }) => {
+
+ const [module, setModule] = useState('basis')
+ useEffect(() => {
+
+ }, [])
+
+
+
+
+
+ return (
+
+
+ {module == 'basis' ? : ""}
+ {module == 'capacity' ? : ""}
+ {module == 'electrical' ? : ""}
+ {module == 'realTime' ? : ""}
+
+ )
+}
+
+function mapStateToProps (state) {
+ const { auth, global } = state;
+ return {
+ user: auth.user,
+ clientHeight: global.clientHeight,
+ };
+}
+
+export default connect(mapStateToProps)(SystemManagement);
\ No newline at end of file
diff --git a/web/client/src/sections/organization/index.js b/web/client/src/sections/bigScreen/index.js
similarity index 100%
rename from web/client/src/sections/organization/index.js
rename to web/client/src/sections/bigScreen/index.js
diff --git a/web/client/src/sections/bigScreen/nav-item.js b/web/client/src/sections/bigScreen/nav-item.js
new file mode 100644
index 0000000..07ffb16
--- /dev/null
+++ b/web/client/src/sections/bigScreen/nav-item.js
@@ -0,0 +1,22 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+import { Menu } from 'antd';
+import { SettingOutlined } from '@ant-design/icons';
+
+const SubMenu = Menu.SubMenu;
+
+export function getNavItem(user, dispatch) {
+ // if (!Func.isAuthorized("ORG_MANAGE")) {
+ // return null
+ // }
+ return (<>>
+ //
} title={'组织管理'}>
+ //
+ // 部门成员
+ //
+ //
+ // 权限配置
+ //
+ //
+ );
+}
\ No newline at end of file
diff --git a/web/client/src/sections/organization/reducers/index.js b/web/client/src/sections/bigScreen/reducers/index.js
similarity index 100%
rename from web/client/src/sections/organization/reducers/index.js
rename to web/client/src/sections/bigScreen/reducers/index.js
diff --git a/web/client/src/sections/bigScreen/routes.js b/web/client/src/sections/bigScreen/routes.js
new file mode 100644
index 0000000..5eebdd7
--- /dev/null
+++ b/web/client/src/sections/bigScreen/routes.js
@@ -0,0 +1,27 @@
+'use strict';
+import { SystemManagement } from './containers';
+
+export default [{
+ type: 'outer',
+ route: {
+ path: '/systemManagement',
+ key: 'systemManagement',
+ breadcrumb: '泵站大屏',
+ component: SystemManagement,
+ // menuSelectKeys: ['userManage'],
+ // menuOpenKeys: ['organization'],
+ // childRoutes: [{
+ // path: '/user',
+ // key: 'userManage',
+ // menuSelectKeys: ['userManage'],
+ // component: UserManage,
+ // breadcrumb: '部门成员',
+ // }, {
+ // path: '/authority',
+ // key: 'authority',
+ // component: Authority,
+ // menuSelectKeys: ['authority'],
+ // breadcrumb: '权限配置',
+ // }]
+ }
+}];
\ No newline at end of file
diff --git a/web/client/src/sections/organization/components/deptModal.js b/web/client/src/sections/organization/components/deptModal.js
deleted file mode 100644
index 9947081..0000000
--- a/web/client/src/sections/organization/components/deptModal.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import React from 'react';
-import { connect } from 'react-redux';
-import { ProFormText, ModalForm, ProFormSelect } from '@ant-design/pro-form';
-
-const DeptModal = (props) => {
- const { visible, modalType, onVisibleChange, onConfirm, editData, depts } = props
- let deptOptions = [], sonArr = [];
- depts.map(d => {
- deptOptions.push({
- value: d.id,
- label: d.name
- });
-
- d.subordinate.map(ds => {
- sonArr.push({
- value: ds.id,
- label: ds.name
- })
- })
- })
- const onFinish = (values) => {
- if (onConfirm) {
- if (modalType === 'edit') {
- values.contract.parentDeptId = values.contract.parentDeptId || null
- onConfirm(values)
- } else {
- onConfirm(values);
- }
- }
- }
-
- const checkName = (rule, value, callback) => {
- const list = modalType == 'edit' ? deptOptions.concat(sonArr).filter(g => g.value != editData.id) : deptOptions.concat(sonArr)
- if (list.filter(s => s.label == value).length) {
- callback('该名称已存在');
- } else {
- callback();
- }
- }
-
- return (
-
-
- {
- let t = modalType === 'edit' ? deptOptions.filter(i => i.value !== editData.id) : deptOptions
- return t
- }}
- disabled={modalType === 'edit' ? editData.subordinate?.length === 0 ? false : true : false}
- />
-
- )
-}
-
-function mapStateToProps(state) {
- return {
- };
-}
-
-export default connect(mapStateToProps)(DeptModal);
\ No newline at end of file
diff --git a/web/client/src/sections/organization/components/resetPwd.js b/web/client/src/sections/organization/components/resetPwd.js
deleted file mode 100644
index 14135e0..0000000
--- a/web/client/src/sections/organization/components/resetPwd.js
+++ /dev/null
@@ -1,74 +0,0 @@
-import React, { useRef, useState } from 'react';
-import { connect } from 'react-redux';
-import { Spin, Card, Modal, TreeSelect } from 'antd';
-import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
-
-const ResetPwd = (props) => {
- const { visible, onVisibleChange, onConfirm } = props;
- const formRef = useRef();
-
- const onFinish = (values) => {
- if (onConfirm) {
- onConfirm(values);
- }
- }
-
- return (
-
-
-
- {
- const pwd = formRef.current.getFieldValue('password');
- if (!value) {
- callback();
- }
- if (pwd == value) {
- callback();
- } else {
- callback('两次输入的密码不一致');
- }
- }
- }
- ]}
- />
-
-
- )
-}
-
-function mapStateToProps(state) {
- return {};
-}
-
-export default connect(mapStateToProps)(ResetPwd);
\ No newline at end of file
diff --git a/web/client/src/sections/organization/components/resource.js b/web/client/src/sections/organization/components/resource.js
deleted file mode 100644
index 5e336f0..0000000
--- a/web/client/src/sections/organization/components/resource.js
+++ /dev/null
@@ -1,121 +0,0 @@
-import React, { useEffect } from 'react';
-import { Checkbox, Table } from 'antd';
-import { useState } from 'react';
-
-const CheckboxGroup = Checkbox.Group;
-
-const Resource = props => {
- const { roleData, userRole, userSelected, setResCode, userType } = props;
- const [indeterminate, setIndeterminate] = useState({});
- const [roleCheck, setRoleCheck] = useState({});//一级权限码
- const [parentRoleCheck, setParentRoleCheck] = useState({}); //二级权限码
-
- const roleDatas=roleData.slice(0)
- useEffect(() => {
- const check = {}
- const parentCheck = {}
- const initInd = {}
- roleData && roleData.map && roleData.map(r => {
- let currentInd = false;
- let sum = 0;
- if (r.resources) {
- check[r.code] = []
- r.resources.map(child => {
- if (userRole.find(code => code.resourceId == child.code)) {
- currentInd = true;
- sum++;
- check[r.code].push(child.code);
- }
- })
- }
- parentCheck[r.code] = r.resources.length === sum
- initInd[r.code] = parentCheck[r.code] ? false : currentInd
- });
- setParentRoleCheck(parentCheck)
- setRoleCheck(check);
- setIndeterminate(initInd);
- }, [userRole]);
-
- const setResData = (role) => {
- let codes = [];
- // Object.keys(partRole).map(r => {
- // if (partRole[r]) codes.push(r)
- // })
- Object.keys(role).map(r => {
- if (role[r].length) {
- codes.push(r);
- }
- codes = codes.concat(role[r])
- })
- setResCode(codes)
- }
- return (
-
{
- const parentCode = record.code
- return {
- const currentParCheck = JSON.parse(JSON.stringify(parentRoleCheck));
- currentParCheck[parentCode] = e.target.checked;
- const currentCode = JSON.parse(JSON.stringify(roleCheck));
- currentCode[parentCode] = e.target.checked ? roleData.find(r => r.code == parentCode).resources.map(r => r.code) : []
- const currentInd = JSON.parse(JSON.stringify(indeterminate));
- currentInd[parentCode] = false;
-
- setParentRoleCheck(currentParCheck);
- setRoleCheck(currentCode);
- setIndeterminate(currentInd);
- setResData(currentCode)
- }}
- checked={parentRoleCheck[parentCode] || false}
- disabled={userSelected === "SuperAdmin" || userType === 4}
- options={''}
- >
- {text}
-
- }
- }, {
- title: '列表',
- key: 'resources',
- dataIndex: 'resources',
- render: (text, record) => {
- let data = [];
- console.log()
- text.map(s => { s.name !== "整治汇总编辑" ? data.push({ label: s.name, value: s.code }) : '' })
- let parentCode = record.code;
-
- return {
- const checkArr = JSON.parse(JSON.stringify(roleCheck));
- const parentCheck = JSON.parse(JSON.stringify(parentRoleCheck));
- const ind = JSON.parse(JSON.stringify(indeterminate));
- const currentCode = roleData.find(r => r.code == parentCode) || {}
-
- checkArr[parentCode] = value;
- ind[parentCode] = !!value.length && value.length < currentCode.resources.length
- parentCheck[parentCode] = value.length === currentCode.resources.length
-
- setRoleCheck(checkArr);
- setIndeterminate(ind);
- setParentRoleCheck(parentCheck);
- setResData(checkArr)
- }}
- />
- }
- }]}
- >
- )
-}
-export default Resource
\ No newline at end of file
diff --git a/web/client/src/sections/organization/components/userModal.js b/web/client/src/sections/organization/components/userModal.js
deleted file mode 100644
index 73a082a..0000000
--- a/web/client/src/sections/organization/components/userModal.js
+++ /dev/null
@@ -1,171 +0,0 @@
-import React from 'react';
-import { connect } from 'react-redux';
-import { Spin, Card, Modal, TreeSelect, message } from 'antd';
-import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
-
-const UserModal = (props) => {
- const { visible, modalType, depData, onVisibleChange, onConfirm, editData } = props
- const reg_tel = /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/;
- const onFinish = (values) => {
- if (onConfirm) {
- onConfirm(values);
- }
- }
- const mobile = (value) => {
- if (reg_tel.test(value)) {
- return
- }
- return message('请输入姓名')
- }
- return (
-
-
-
-
- {
- return event.target.value.replace(/\D/g, '')
- }}
- placeholder="请输入用户名(手机号)"
- rules={[
- { required: true, valueType: Number, max: 11 }, { pattern: /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/, message: "请输入正确的手机号" }
- ]}
- />
-
-
- {
- if (selected) {
- setDepSelectedKeys(selectedKeys)
- setDepSelected(selectedNodes[0].name || "")
- dispatch(getDepUser(selectedKeys[0]))
- }
- }}
- fieldProps={{
- fieldNames: {
- label: 'title',
- },
- treeDefaultExpandAll: false,
- }}
- rules={[{ required: true, message: '请选择所属部门' }]}
- request={async () => {
- console.log(depData);
- return depData
- }}
- expandedKeys={["title"]}
- />
- < ProFormText
- name={['contract', 'post']}
- width="md"
- label="职位"
- // required
- placeholder="请输入职位"
- />
-
-
-
- {modalType == 'edit' ? null : }
-
-
-
-
-
-
- )
-}
-
-function mapStateToProps(state) {
- const { depMessage } = state;
-
- const pakData = (dep) => {
- // console.log(dep);
- return dep.map((d) => {
- return {
- title: d.name,
- value: d.id,
- // key: d.id,
- children: pakData(d.subordinate)
- }
- })
- }
- let depData = pakData(depMessage.data || [])
-
- return {
- loading: depMessage.isRequesting,
- depData,
- };
-}
-
-export default connect(mapStateToProps)(UserModal);
\ No newline at end of file
diff --git a/web/client/src/sections/organization/containers/authority.js b/web/client/src/sections/organization/containers/authority.js
deleted file mode 100644
index 5ef2cdd..0000000
--- a/web/client/src/sections/organization/containers/authority.js
+++ /dev/null
@@ -1,149 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import { Spin, Row, Col, Card, Button, Tree, Empty } from 'antd';
-import { getDepMessage, getDepUser } from '../actions/user';
-import { getResource, getUserResource, postUserRes } from '../actions/authority';
-import Resource from '../components/resource';
-
-const Authority = (props) => {
- const { dispatch, loading, depMessage, depUser, resource, userResource, clientHeight } = props
- const [depSelectedKeys, setDepSelectedKeys] = useState([])
- const [userSelectedKeys, setUserSelectedKeys] = useState([])
- const [depSelected, setDepSelected] = useState()
- const [userSelected, setUserSelected] = useState()
- const [resCode, setResCode] = useState({})
- const [useName, setUseName] = useState()// 选中名字
- const [userType, setUserType] = useState()
- console.log(resource)
- useEffect(() => {
- dispatch(getResource())
- if (!(depMessage && depMessage.length)) {
- dispatch(getDepMessage())
- }
-
- }, [])
- useEffect(() => {
- if (depMessage.length) {
- setDepSelectedKeys([depMessage[0].id])
- setDepSelected([depMessage[0].name])
- dispatch(getDepUser(depMessage[0].id))
- }
-
- }, [depMessage])
- useEffect(() => {
- if (depUser.length) {
- setUserSelectedKeys([depUser[0].id])
- setUserSelected(depUser[0].username)
- dispatch(getUserResource(depUser[0].id))
- setUseName(depUser[0].name)
- }
- console.log(depUser, 'depUser')
- }, [depUser])
-
- const handleSave = () => {
- dispatch(postUserRes({ userId: userSelectedKeys[0], resCode: resCode })).then(res => {
- if (res.success) {
- dispatch(getUserResource(userSelectedKeys[0]))
- }
- })
- }
- return (
-
-
-
-
- {
- depMessage.length ?
- {
- setUserType(selectedNodes[0].type)
- if (selected) {
- setDepSelectedKeys(selectedKeys)
- setDepSelected(selectedNodes[0].name || "")
- dispatch(getDepUser(selectedKeys[0]))
- }
-
- }}
- treeData={depMessage}
- fieldNames={{
- title: 'name',
- key: 'id',
- children: 'subordinate'
- }}
- /> : ''
- }
-
-
-
-
- {
- depUser.length ?
- {
- const name = node.name
- setUseName(name)
-
- if (selected) {
- setUserSelectedKeys(selectedKeys)
- setUserSelected(selectedNodes[0].username || '')
- dispatch(getUserResource(selectedKeys[0]))
- }
-
- }}
- treeData={depUser}
- fieldNames={{
- title: 'name',
- key: 'id'
- }}
- /> :
- }
-
-
-
- {depUser.length ?
-
-
-
-
-
-
-
- :
-
-
- }
-
-
-
- )
-}
-
-function mapStateToProps (state) {
- const { userResource, resource, depMessage, depUser, global } = state;
- return {
- clientHeight: global.clientHeight,
- loading: depMessage.isRequesting || depUser.isRequesting || resource.isRequesting,
- userResource: userResource.data || [],
- resource: resource.data || [],
- depMessage: depMessage.data || [],
- depUser: depUser.data || []
- };
-}
-
-export default connect(mapStateToProps)(Authority);
\ No newline at end of file
diff --git a/web/client/src/sections/organization/containers/index.js b/web/client/src/sections/organization/containers/index.js
deleted file mode 100644
index e1a69b0..0000000
--- a/web/client/src/sections/organization/containers/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-import Authority from './authority';
-import UserManage from './user';
-
-export { Authority, UserManage };
\ No newline at end of file
diff --git a/web/client/src/sections/organization/containers/user.js b/web/client/src/sections/organization/containers/user.js
deleted file mode 100644
index 10f59b1..0000000
--- a/web/client/src/sections/organization/containers/user.js
+++ /dev/null
@@ -1,332 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import { FormOutlined, DeleteOutlined } from '@ant-design/icons';
-import { Spin, Tooltip, Button, Popconfirm, Row, Col, Tree, Card, Switch } from 'antd';
-import ProTable from '@ant-design/pro-table';
-import { getDepMessage, getDepUser, createUser, updateUser, delUser, resetPwd, createDept, updateDept, delDept } from '../actions/user';
-import UserModal from '../components/userModal';
-import ResetPwd from '../components/resetPwd';
-import DeptModal from '../components/deptModal';
-
-const TreeNode = Tree.TreeNode;
-
-const UserManage = (props) => {
- const user = JSON.parse(sessionStorage.getItem('user'));
-
- const { dispatch, loading, depMessage, depUser, clientHeight } = props;
- // 部门
- const [deptModalVisible, setDeptModalVisible] = useState(false);
- const [deptModalType, setDeptModalType] = useState();
- const [deptModalRecord, setDeptModalRecord] = useState();
-
- // 成员
- const [modalVisible, setModalVisible] = useState(false);
- const [modalType, setModalType] = useState();
- const [modalRecord, setModalRecord] = useState();
- const [pwdModalVisible, setPwdModalVisible] = useState(false);
- const [depSelectedKeys, setDepSelectedKeys] = useState([])
- const [rowSelected, setRowSelected] = useState([])
-
- useEffect(() => {
- dispatch(getDepMessage())
- }, [])
-
- useEffect(() => {
- if (depMessage.length) {
- setDepSelectedKeys([depMessage[0].id])
- dispatch(getDepUser(depMessage[0].id))
- }
- }, [depMessage])
-
- const columns = [
- {
- title: '姓名',
- dataIndex: 'name',
- }, {
- title: '用户名(手机号)',
- dataIndex: 'username',
- },
- {
- title: '职位',
- dataIndex: 'post',
- }, {
- title: '邮箱',
- dataIndex: 'email',
- }, {
- title: '启用状态',
- dataIndex: 'enable',
- render: (_, r) => {
- return
- }
- }, {
- title: '操作',
- dataIndex: 'action',
- render: (dom, record) => {
-
- return record.username == 'SuperAdmin' ? '' : [
-
,
-
{
- delUsers([record.id])
- }}
- >
-
- ,
-
- ]
- },
- },
- ];
-
- //弹窗确认
- const onConfirm = (values) => {
- if (modalType == 'edit') {
- dispatch(updateUser(modalRecord.id, values.contract)).then(res => {
- if (res.success) {
- setModalVisible(false);
- dispatch(getDepUser(depSelectedKeys[0]));
- }
- });
- } else {
- dispatch(createUser(values.contract)).then(res => {
- if (res.success) {
- setModalVisible(false);
- dispatch(getDepUser(depSelectedKeys[0]));
- }
- });
- }
-
- }
-
- //打开弹窗
- const openModal = (type, record) => {
- setModalVisible(true);
- setModalType(type);
- if (type == 'edit') {
- setModalRecord(record);
- } else {
- setModalRecord(null);
- }
- }
-
- //删除用户
- const delUsers = (ids, type) => {
- dispatch(delUser(ids)).then(res => {
- dispatch(getDepUser(depSelectedKeys[0]));
- if (type == 'batch') {
- setRowSelected([]);
- }
- });
- }
-
- //重置密码
- const onPwdConfirm = (values) => {
- dispatch(resetPwd(modalRecord.id, { password: values.password })).then(res => {
- if (res.success) {
- setPwdModalVisible(false);
- dispatch(getDepUser(depSelectedKeys[0]));
- }
- });
- }
-
- const openDeptModal = (type, record) => {
- console.log(type, record, 'type, record')
-
- setDeptModalVisible(true);
- setDeptModalType(type);
- if (type === 'edit') {
- setDeptModalRecord(record);
- } else {
- setDeptModalRecord(null);
- }
- }
- const onDeptConfirm = (values) => {
- if (deptModalType === 'edit') {
- dispatch(updateDept(deptModalRecord.id, values.contract)).then(res => {
- if (res.success) {
- setDeptModalVisible(false);
- dispatch(getDepMessage())
- }
- });
- } else {
- dispatch(createDept(values.contract)).then(res => {
- if (res.success) {
- setDeptModalVisible(false);
- dispatch(getDepMessage())
- }
- });
- }
- }
- const delDepartment = (id) => {
- dispatch(delDept(id)).then(res => {
- if (res.success) {
- dispatch(getDepMessage())
- }
- });
- }
-
- const renderTree = (item, id) => {
- // let cannotDel = item.users.length || item.subordinate?.filter(is => is.users.length).length;//自己下面有成员 或者下级部门下有成员 不能删除
- return
-
- {item.name}
-
-
- {
- depSelectedKeys == id && user.username === "SuperAdmin" ?
- <>
-
{
- setDeptModalRecord(item)
- setDeptModalVisible(true)
- setDeptModalType('edit')
- }} />
- {
- { delDepartment(id) }}>
-
-
- }
- > : null
- }
-
-
- }
-
- return (
-
-
|
-
-
- {
- user.username === "SuperAdmin" &&
- }
- {
- depMessage.length ?
- {
- if (e.selected) {
- setDepSelectedKeys(selectedKeys)
- dispatch(getDepUser(selectedKeys[0]))
- }
- }}
- // treeData={depMessage}
- // fieldNames={{
- // title: 'name',
- // key: 'id',
- // children: 'subordinate'
- // }}
- >
- {
- depMessage.map((s, index) => {
- return
- {
- s.subordinate.map(k => {
- return { setIShowIcon(k.id) }} onMouseOut={() => { setIShowIcon(null) }}>
-
- })
- }
-
- })
- }
- : ''
- }
-
-
-
-
-
- {
- setRowSelected(selectedRowKeys);
-
- },
- getCheckboxProps: (record) => {
- return {
- disabled: record.username === 'SuperAdmin',
- }
- },
- }}
- options={false}
- search={false}
- rowKey="id"
- toolBarRender={() => [
-
-
-
- { delUsers(rowSelected, 'batch') }}>
-
-
-
- ]}
- />
-
- {
- deptModalVisible ?
-
- : ''
- }
- {
- depMessage.length && modalVisible ?
-
- : ''
- }
- {pwdModalVisible ?
: ''}
-
-
-
-
-
-
- )
-}
-
-function mapStateToProps(state) {
- const { depMessage, depUser, global } = state;
- return {
- clientHeight: global.clientHeight,
- loading: depMessage.isRequesting,
- depMessage: depMessage.data || [],
- depUser: depUser.data || []
- };
-}
-
-export default connect(mapStateToProps)(UserManage);
\ No newline at end of file
diff --git a/web/client/src/sections/organization/nav-item.js b/web/client/src/sections/organization/nav-item.js
deleted file mode 100644
index 6b25267..0000000
--- a/web/client/src/sections/organization/nav-item.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from 'react';
-import { Link } from 'react-router-dom';
-import { Menu } from 'antd';
-import { SettingOutlined } from '@ant-design/icons';
-
-const SubMenu = Menu.SubMenu;
-
-export function getNavItem(user, dispatch) {
- // if (!Func.isAuthorized("ORG_MANAGE")) {
- // return null
- // }
- return (
-
} title={'组织管理'}>
-
- 部门成员
-
-
- 权限配置
-
-
- );
-}
\ No newline at end of file
diff --git a/web/client/src/sections/organization/routes.js b/web/client/src/sections/organization/routes.js
deleted file mode 100644
index d6675f5..0000000
--- a/web/client/src/sections/organization/routes.js
+++ /dev/null
@@ -1,26 +0,0 @@
-'use strict';
-import { UserManage, Authority } from './containers';
-
-export default [{
- type: 'inner',
- route: {
- path: '/organization',
- key: 'organization',
- breadcrumb: '组织管理',
- menuSelectKeys: ['userManage'],
- menuOpenKeys: ['organization'],
- childRoutes: [{
- path: '/user',
- key: 'userManage',
- menuSelectKeys: ['userManage'],
- component: UserManage,
- breadcrumb: '部门成员',
- }, {
- path: '/authority',
- key: 'authority',
- component: Authority,
- menuSelectKeys: ['authority'],
- breadcrumb: '权限配置',
- }]
- }
-}];
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/actions/index.js b/web/client/src/sections/patrolManage/actions/index.js
deleted file mode 100644
index c465b0f..0000000
--- a/web/client/src/sections/patrolManage/actions/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-import * as plan from './plan'
-import * as record from './record'
-
-export default {
- ...plan,
- ...record,
-}
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/actions/plan.js b/web/client/src/sections/patrolManage/actions/plan.js
deleted file mode 100644
index 6b94bca..0000000
--- a/web/client/src/sections/patrolManage/actions/plan.js
+++ /dev/null
@@ -1,80 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
-
-export function getPatrolPlan() {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- actionType: 'GET_PATROL_PLAN',
- url: ApiTable.patrolPlan,
- msg: { error: '获取巡检计划失败' },
- });
-}
-
-export function createPatrolPlan(data) {
- return dispatch => basicAction({
- type: 'post',
- data,
- dispatch: dispatch,
- actionType: 'CREATE_PATROL_PLAN',
- url: ApiTable.patrolPlan,
- msg: { error: '新增巡检计划失败' },
- });
-}
-
-export function delPatrolPlan(id) {
- return dispatch => basicAction({
- type: 'del',
- dispatch: dispatch,
- actionType: 'DEL_PATROL_PLAN',
- url: ApiTable.delPatrolPlan.replace('{id}', id),
- msg: { error: '删除巡检计划失败' },
- });
-}
-
-export function updatePatrolPlan(data) {
- return dispatch => basicAction({
- type: 'put',
- data,
- dispatch: dispatch,
- actionType: 'UPDATE_PATROL_PLAN',
- url: ApiTable.patrolPlan,
- msg: { error: '修改巡检计划失败' },
- });
-}
-
-export function getUserList() {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- actionType: 'GET_USER_LIST',
- url: ApiTable.getDepUser.replace('{depId}', null),
- msg: { error: '获取人员列表失败' },
- reducer: { name: 'userList' }
- });
-}
-
-export function getProjectList(query) {
- return (dispatch) => basicAction({
- type: 'get',
- query,
- dispatch,
- actionType: 'GET_PROJEECT_LIST',
- url: ApiTable.getProjectList,
- msg: { error: '获取结构物列表失败', },
- reducer: { name: 'structureList' }
- });
-}
-
-export function positionList(query) {
- return (dispatch) => basicAction({
- type: 'get',
- query,
- dispatch,
- actionType: 'POSITION_LIST',
- url: ApiTable.position,
- msg: { error: '获取点位列表失败', },
- });
-}
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/actions/record.js b/web/client/src/sections/patrolManage/actions/record.js
deleted file mode 100644
index a6ae77e..0000000
--- a/web/client/src/sections/patrolManage/actions/record.js
+++ /dev/null
@@ -1,17 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-
-export const GET_PATROL_RECORD_LIST = 'GET_PATROL_RECORD_LIST';
-export const GET_PATROL_RECORD_LIST_SUCCESS = 'GET_PATROL_RECORD_LIST_SUCCESS';
-export const GET_PATROL_RECORD_LIST_ERROR = 'GET_PATROL_RECORD_LIST_ERROR';
-export function records(url) {
- return (dispatch) => basicAction({
- type: 'get',
- dispatch,
- actionType: GET_PATROL_RECORD_LIST,
- url: url,
- msg: { error: '获取巡检记录失败', },
- reducer: { name: 'record' }
- });
-}
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/components/planModal.js b/web/client/src/sections/patrolManage/components/planModal.js
deleted file mode 100644
index 67f4e96..0000000
--- a/web/client/src/sections/patrolManage/components/planModal.js
+++ /dev/null
@@ -1,202 +0,0 @@
-import { Button, Form, Input, Modal, Select, DatePicker } from 'antd';
-import React, { useState, useEffect } from 'react';
-import { connect } from 'react-redux';
-import { getUserList, getProjectList, positionList } from '../actions/plan';
-import moment from 'moment';
-
-const { RangePicker } = DatePicker;
-
-const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userList, structureList, struLoading, type, curRecord }) => {
- const [userOpt, setUserOpt] = useState();
- const [struOpt, setStruOpt] = useState();
- const [pointOpt, setPointOpt] = useState();
- const [points, setPoints] = useState();
- const [unit, setUnit] = useState('次/天');
- const [form] = Form.useForm();
-
- useEffect(() => {
- if (type === 'view') {
-
- } else {
- dispatch(getUserList())
- dispatch(getProjectList())
- }
- if (type === 'edit') {
- dispatch(positionList({ projectId: curRecord?.project?.id })).then(res => {
- if (res.success) {
- setPoints(res.payload.data?.rows)
- setPointOpt(res.payload.data?.rows[0]?.points?.map(p => ({ label: p.name, value: p.id })))
- }
- })
- }
- }, [])
-
- useEffect(() => {
- if (userList.length) {
- setUserOpt(userList.map(u => ({ label: u.name, value: u.id })))
- }
- }, [userList])
-
- useEffect(() => {
- if (structureList?.rows?.length) {
- setStruOpt(structureList?.rows?.map(s => ({ label: s.name, value: s.id })))
- }
- }, [structureList])
-
- const selectAfter = (
-
- );
- return (
-
{
- form.resetFields();
- onCancel();
- }}
- onOk={() => {
- if (type === 'view') {
- form.resetFields();
- onCancel();
- return;
- }
- form
- .validateFields()
- .then((values) => {
- form.resetFields();
- const params = {
- ...values,
- frequency: values.frequency + unit,
- startTime: values.time[0],
- endTime: values.time[1],
- points: points[0]?.points?.filter(p => values?.points?.includes(p.id))
- }
- onCreate(params);
- })
- .catch((info) => {
- console.log('Validate Failed:', info);
- });
- }}
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-function mapStateToProps(state) {
- const { auth, userList, structureList } = state
- return {
- user: auth.user,
- userList: userList.data || [],
- structureList: structureList.data || [],
- userLoading: userList.isRequesting,
- struLoading: structureList.isRequesting
- }
-}
-export default connect(mapStateToProps)(PlanModal);
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/containers/index.js b/web/client/src/sections/patrolManage/containers/index.js
deleted file mode 100644
index d83768a..0000000
--- a/web/client/src/sections/patrolManage/containers/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-import PatrolPlan from './patrolPlan';
-import PatrolReocrd from './patrolRecord';
-
-export { PatrolPlan, PatrolReocrd };
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/containers/patrolPlan.js b/web/client/src/sections/patrolManage/containers/patrolPlan.js
deleted file mode 100644
index 36a3f82..0000000
--- a/web/client/src/sections/patrolManage/containers/patrolPlan.js
+++ /dev/null
@@ -1,164 +0,0 @@
-import React, { useState, useRef } from 'react';
-import { connect } from 'react-redux';
-import { Button, Popconfirm } from 'antd';
-import ProTable from '@ant-design/pro-table';
-import PlanModal from '../components/planModal';
-import { createPatrolPlan, delPatrolPlan, updatePatrolPlan, getPatrolPlan } from '../actions/plan';
-import moment from 'moment';
-
-function PatrolPlan(props) {
- const { dispatch, user } = props;
- const tableRef = useRef();
- const [dataSource, setDataSource] = useState([{}]);
- const [visible, setVisible] = useState(false);
- const [type, setType] = useState();
- const [curRecord, setCurRecord] = useState();
-
- const onCreate = (values) => {
- if (type === 'create') {
- dispatch(createPatrolPlan(values)).then(res => {
- if (res.success) {
- tableRef.current.reload();
- }
- })
- } else {
- dispatch(updatePatrolPlan({ ...values, id: curRecord.id })).then(res => {
- if (res.success) {
- tableRef.current.reload();
- }
- })
- }
- setVisible(false);
- };
-
- const columns = [{
- title: '结构物名称',
- dataIndex: 'struName',
- key: 'struName',
- ellipsis: true,
- render: (_, record) => {
- return
{record?.project?.name}
- }
- }, {
- title: '巡检任务名称',
- dataIndex: 'name',
- key: 'name',
- ellipsis: true
- }, {
- title: '开始时间',
- dataIndex: 'startTime',
- key: 'startTime',
- ellipsis: true,
- render: (_, record) => moment(record.startTime).format('YYYY-MM-DD')
- }, {
- title: '结束时间',
- dataIndex: 'endTime',
- key: 'endTime',
- ellipsis: true,
- render: (_, record) => moment(record.endTime).format('YYYY-MM-DD')
-
- }, {
- title: '巡检频次',
- dataIndex: 'frequency',
- key: 'frequency',
- ellipsis: true,
- }, {
- title: '巡检点位',
- dataIndex: 'patrolPoints',
- key: 'patrolPoints',
- ellipsis: true,
- render: (_, record) =>
{record?.points?.length ? record?.points?.map(p => p.name).join() : '-'}
- }, {
- title: '巡检人',
- dataIndex: 'patrolPerson',
- key: 'patrolPerson',
- ellipsis: true,
- render: (_, record) =>
{record?.user?.name}
- }, {
- title: '巡检次数统计',
- dataIndex: 'patrolCount',
- key: 'patrolCount',
- ellipsis: true,
- }, {
- title: '操作',
- dataIndex: 'action',
- key: 'action',
- search: false,
- width: 200,
- render: (_, record) => {
- return <>
-
-
-
{
- dispatch(delPatrolPlan(record.id)).then(res => {
- if (res.success) {
- tableRef.current.reload();
- }
- })
- }}>
-
-
- >
- },
- }];
-
- return (
- <>
-
{
- const res = await dispatch(getPatrolPlan(params));
- setDataSource(res?.payload.data?.rows);
- return { ...res };
- }}
- onReset={() => { }}
- toolBarRender={() => [
-
- ]}
- />
- {
- visible ?
- {
- setVisible(false);
- }}
- /> : null
- }
- >
- )
-}
-
-function mapStateToProps(state) {
- const { auth } = state
- return {
- user: auth.user
- }
-}
-export default connect(mapStateToProps)(PatrolPlan);
diff --git a/web/client/src/sections/patrolManage/containers/patrolRecord.js b/web/client/src/sections/patrolManage/containers/patrolRecord.js
deleted file mode 100644
index ce15464..0000000
--- a/web/client/src/sections/patrolManage/containers/patrolRecord.js
+++ /dev/null
@@ -1,204 +0,0 @@
-
-'use strict'
-
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import { Form, Input, Select, Button, Table, Modal, DatePicker, Checkbox, Row, Col } from 'antd';
-import moment from "moment";
-
-const PatrolRecord = (props) => {
- const { dispatch, actions, } = props
- const { patrolManage } = actions
- const [tableList, settableList] = useState([])
- const [showDetailModal, setShowDetail] = useState(false)
- const [modelData, setModelData] = useState({})
- const [query, setQuery] = useState({ limit: 10, page: 0 })
- const [limits, setLimits] = useState()
- const format = 'YYYY-MM-DD'
- const [search, setSearch] = useState({ name: null, time: [moment().add(-7, 'd').format(format), moment().format(format)], state: 'null' })
-
- useEffect(() => {
- record(search)
- }, [])
-
- const record = (params) => {
- dispatch(patrolManage.records(`patrolRecord/all/${params.time[0]}/${params.time[1]}/${params.state}/null`)).then(res => {
- if (res.success) {
- settableList(params.name != null ? res.payload.data?.filter(v =>
- (v.points.user.name.indexOf(params.name) != -1 || v.points.project.name.indexOf(params.name) != -1))
- .map(v => ({ ...v, key: v.id })) : res.payload.data?.map(v => ({ ...v, key: v.id })))
- setLimits(res.payload.data?.length)
- }
- })
- }
-
- const columns = [{
- title: '结构物名称',
- dataIndex: 'name',
- key: 'name',
- render: (text, record, index) => {
- return !record.points?.project ? '' : {record.points.project.name}
- }
- }, {
- title: '巡检人',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => {
- return !record.points?.user ? '' : {record.points.user.name}
- }
- }, {
- title: '巡检点位',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => {
- return !record.points?.user ? '' : {record.points.itemData.name}
- }
- }, {
- title: '巡检单位',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => {
- return !record.points?.user ? '' : {record.points.user.department.name}
- }
- }, {
- title: '巡检频次',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => {
- return !record.points ? '' : {record.points.frequency}
- }
- }, {
- title: '上次巡检日期',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => moment(record.lastInspectionTime).format('YYYY-MM-DD HH:mm') || '--'
- }, {
- title: '本次巡检日期',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => moment(record.inspectionTime).format('YYYY-MM-DD HH:mm') || '--'
- }, {
- title: '巡检结果',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => !record.alarm ? '正常' : '异常'
- }, {
- title: '操作',
- dataIndex: 'operation',
- key: 'operation',
- render: (text, record, index) => {
- return (
-
-
-
- )
- }
- }
- ]
-
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {
- return {`共${Math.ceil(total / query?.limit)}页,${total}项`}
- },
- onChange: (page, pageSize) => {
- setQuery({ limit: pageSize, page: page - 1 });
- record({ limit: pageSize, page: page - 1, ...search, companyId: companyID || search?.companyId })
- }
- }}
- />
- setShowDetail(false)}
- footer={[]}
- >
-
- 当前点位:{modelData?.points?.itemData?.name}
-
-
- 当前位置:{modelData?.points?.address}
-
-
- 巡检结果:{modelData.alarm? '异常':'正常'}
-
- { !modelData.alarm? '':
-
- 巡检详情:{modelData?.points?.msgInp}
-
}
- { !modelData.alarm? '':
-
- 异常等级:{modelData?.points?.changeThree}
-
}
- { !modelData.alarm? '':
- { modelData?.points?.imgs?.map(rs => )}
-
}
-
- >
- )
-}
-
-function mapStateToProps(state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(PatrolRecord);
diff --git a/web/client/src/sections/patrolManage/index.js b/web/client/src/sections/patrolManage/index.js
deleted file mode 100644
index fe6ee58..0000000
--- a/web/client/src/sections/patrolManage/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-
-import reducers from './reducers';
-import routes from './routes';
-import actions from './actions';
-import { getNavItem } from './nav-item';
-
-export default {
- key: 'patrolManage',
- name: '',
- reducers: reducers,
- routes: routes,
- actions: actions,
- getNavItem: getNavItem
-};
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/nav-item.js b/web/client/src/sections/patrolManage/nav-item.js
deleted file mode 100644
index c3bdb3d..0000000
--- a/web/client/src/sections/patrolManage/nav-item.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from 'react';
-import { Link } from 'react-router-dom';
-import { Menu } from 'antd';
-import { SettingOutlined } from '@ant-design/icons';
-
-const SubMenu = Menu.SubMenu;
-
-export function getNavItem(user, dispatch) {
- // if (!Func.isAuthorized("ORG_MANAGE")) {
- // return null
- // }
- return (
- } title={'巡检管理'}>
-
- 巡检计划制定
-
-
- 巡检记录
-
-
- );
-}
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/reducers/index.js b/web/client/src/sections/patrolManage/reducers/index.js
deleted file mode 100644
index 0203d01..0000000
--- a/web/client/src/sections/patrolManage/reducers/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-export default {
-
-};
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/reducers/record.js b/web/client/src/sections/patrolManage/reducers/record.js
deleted file mode 100644
index 91fa14a..0000000
--- a/web/client/src/sections/patrolManage/reducers/record.js
+++ /dev/null
@@ -1,32 +0,0 @@
-'use strict';
-import * as actionTypes from '../actions/record';
-import Immutable from 'immutable';
-
-const initState = {
- data: {},
- isRequesting: false,
- error: null
-};
-
-function record(state = initState, action) {
- const payload = action.payload;
- switch (action.type){
- case actionTypes.GET_PATROL_RECORD_LIST:
- return Immutable.fromJS(state).set('data',
- payload.data).toJS();
- case actionTypes.GET_PATROL_RECORD_LIST_SUCCESS:
- return Immutable.fromJS(state).merge({
- isRequesting: false,
- data: payload.data
- }).toJS();
- case actionTypes.GET_PATROL_RECORD_LIST_ERROR:
- return Immutable.fromJS(state).merge({
- isRequesting: false,
- error: payload.error
- }).toJS();
- default:
- return state;
- }
-}
-
-export default record;
\ No newline at end of file
diff --git a/web/client/src/sections/patrolManage/routes.js b/web/client/src/sections/patrolManage/routes.js
deleted file mode 100644
index ddd494a..0000000
--- a/web/client/src/sections/patrolManage/routes.js
+++ /dev/null
@@ -1,22 +0,0 @@
-'use strict';
-import { PatrolPlan, PatrolReocrd } from './containers';
-
-export default [{
- type: 'inner',
- route: {
- path: '/patrolManage',
- key: 'patrolManage',
- breadcrumb: '巡检管理',
- childRoutes: [{
- path: '/patrolPlan',
- key: 'patrolPlan',
- component: PatrolPlan,
- breadcrumb: '巡检计划制定',
- },{
- path: '/patrolRecord',
- key: 'patrolRecord',
- component: PatrolReocrd,
- breadcrumb: '巡检记录',
- }]
- }
-}];
\ No newline at end of file
diff --git a/web/client/src/sections/projectRegime/actions/index.js b/web/client/src/sections/projectRegime/actions/index.js
deleted file mode 100644
index 4e50055..0000000
--- a/web/client/src/sections/projectRegime/actions/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-
-import * as projectSituation from './projectSituation'
-
-export default {
- ...projectSituation,
-
-}
\ No newline at end of file
diff --git a/web/client/src/sections/projectRegime/actions/projectSituation.js b/web/client/src/sections/projectRegime/actions/projectSituation.js
deleted file mode 100644
index ab045b8..0000000
--- a/web/client/src/sections/projectRegime/actions/projectSituation.js
+++ /dev/null
@@ -1,100 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
-
-
-export function getProjectList (query) {
- return (dispatch) => basicAction({
- type: 'get',
- query,
- dispatch,
- actionType: 'GET_PROJEECT_LIST',
- url: ApiTable.getProjectList,
- msg: { error: '获取结构物列表失败', },
- });
-}
-
-
-export function postAddProject (data) {
- return (dispatch) => basicAction({
- type: 'post',
- data,
- dispatch,
- actionType: 'POST_ADD_PROJECT',
- url: ApiTable.postAddProject,
- msg: { option: data?.id ? '编辑结构物' : '新增结构物', },
- });
-}
-
-
-export function delProject (id) {
- return (dispatch) => basicAction({
- type: 'del',
- dispatch,
- actionType: 'DEL_PROJECT',
- url: ApiTable.delProject.replace('{id}', id),
- msg: {
- option: '删除结构物',
- },
- });
-}
-
-
-export function addPosition (data, point) {
- return (dispatch) => basicAction({
- type: 'post',
- data,
- dispatch,
- actionType: 'ADD_POSITION',
- url: ApiTable.position,
- msg: { option: point ? '二维码生成' : data?.id ? '编辑点位' : '新增点位', },
- });
-}
-
-export function positionList (query) {
- return (dispatch) => basicAction({
- type: 'get',
- query,
- dispatch,
- actionType: 'POSITION_LIST',
- url: ApiTable.position,
- msg: { error: '获取点位列表失败', },
- });
-}
-
-
-export function delPosition (id) {
- return (dispatch) => basicAction({
- type: 'del',
- dispatch,
- actionType: 'DEL_POSITION',
- url: ApiTable.delPosition.replace('{id}', id),
- msg: {
- option: '删除点位',
- },
- });
-}
-
-
-export function qrCodeShow (query) {
- return (dispatch) => basicAction({
- type: 'get',
- query,
- dispatch,
- actionType: 'GET_QR_CODE',
- url: ApiTable.qrCodeShow,
- msg: { error: '获取二维码列表失败', },
- });
-}
-
-export function q () {
- return (dispatch) => basicAction({
- type: 'get',
- dispatch,
- actionType: 'GET_CODE',
- url: ApiTable.q,
- msg: { error: '获取二维码列表失败', },
- });
-}
-
diff --git a/web/client/src/sections/projectRegime/components/pointModel.js b/web/client/src/sections/projectRegime/components/pointModel.js
deleted file mode 100644
index fdb2c2e..0000000
--- a/web/client/src/sections/projectRegime/components/pointModel.js
+++ /dev/null
@@ -1,170 +0,0 @@
-import React, { useState } from 'react';
-import { Button, Form, Input, Modal, Select, DatePicker } from 'antd';
-import { EnvironmentTwoTone } from '@ant-design/icons';
-const { TextArea } = Input;
-import { connect } from 'react-redux';
-import Uploads from '$components/Uploads';
-import { useEffect } from 'react';
-import moment from 'moment';
-
-const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, qrCodeId }) => {
-
- const { projectRegime } = actions
- const [showBaiduMap, setShowBaiduMap] = useState(false)
- const [form] = Form.useForm();
-
- useEffect(() => {
- if (modelData?.longitude && modelData?.latitude) {
- form.setFieldValue('longitude', modelData?.longitude)
- form.setFieldValue('latitude', modelData?.latitude)
- }
- var map = new AMap.Map('container', {
- resizeEnable: true, //是否监控地图容器尺寸变化
- zoom: 11, //初始化地图层级
- center: [116.397428, 39.90923] //初始化地图中心点
- });
-
- var autoOptions = {
- input: "tipinput"
- };
-
- AMap.plugin(['AMap.PlaceSearch', 'AMap.AutoComplete', 'AMap.Geocoder'], () => {
- var auto = new AMap.AutoComplete(autoOptions);
- var placeSearch = new AMap.PlaceSearch({
- map: map
- }); //构造地点查询类
-
- function select (e) {
- if (e) {
- placeSearch.setCity(e.poi.adcode);
- placeSearch.search(e.poi.name, function (status, result) {
- form.setFieldValue('longitude', result.poiList.pois[0].location.lat)
- form.setFieldValue('latitude', result.poiList.pois[0].location.lng)
- }) //关键字查询查询
- }
- }
- auto.on("select", select);//注册监听,当选中某条记录时会触发
- map.on('click', function (e) { //点击地图获取经纬度
- form.setFieldValue('longitude', e.lnglat.lat)
- form.setFieldValue('latitude', e.lnglat.lng)
- });
- });
-
-
- }, [])
-
-
- return (
- {
- form.validateFields().then(r => {
- dispatch(projectRegime.addPosition({
- ...r,
- id: modelData?.id,
- projectId: qrCodeId
- })).then(res => {
- if (res.success) {
- success()
- }
- })
- })
- }}
- onCancel={() => {
- close()
- }}
- >
-
-
-
-
- {/* /^\d+$|^\d*\.\d+$/g */}
-
{
- const sjh = /^\d+$|^\d*\.\d+$/g;
- if (value) {
- let valid = sjh.test(value);
- if (!valid) {
- return callback([new Error("横坐标填写错误")]);
- }
- callback();
- }
- return callback([new Error("请输入横坐标")]);
- }
- }]}
- >
-
-
- ~
- {
- const sjh = /^\d+$|^\d*\.\d+$/g;
- if (value) {
- let valid = sjh.test(value);
- if (!valid) {
- return callback([new Error("纵坐标填写错误")]);
- }
- callback();
- }
- return callback([new Error("请输入纵坐标")]);
- }
- }]}
- >
-
-
- {
- setShowBaiduMap(!showBaiduMap)
- }} />
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-
-function mapStateToProps (state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(ProjectAddModel);
\ No newline at end of file
diff --git a/web/client/src/sections/projectRegime/components/projectAddModel.js b/web/client/src/sections/projectRegime/components/projectAddModel.js
deleted file mode 100644
index 66e9db0..0000000
--- a/web/client/src/sections/projectRegime/components/projectAddModel.js
+++ /dev/null
@@ -1,204 +0,0 @@
-import React, { useState } from 'react';
-import { Button, Form, Input, Modal, Select, DatePicker, Icon } from 'antd';
-import { EnvironmentTwoTone } from '@ant-design/icons';
-const { TextArea } = Input;
-import { connect } from 'react-redux';
-import Uploads from '$components/Uploads';
-import { useEffect } from 'react';
-import moment from 'moment';
-
-const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, firmList }) => {
-
- const { projectRegime } = actions
- const [showBaiduMap, setShowBaiduMap] = useState(false)
- const [form] = Form.useForm();
-
- useEffect(() => {
- if (modelData?.longitude && modelData?.latitude) {
- form.setFieldValue('longitude', modelData?.longitude)
- form.setFieldValue('latitude', modelData?.latitude)
- }
- var map = new AMap.Map('container', {
- resizeEnable: true, //是否监控地图容器尺寸变化
- zoom: 11, //初始化地图层级
- center: [116.397428, 39.90923] //初始化地图中心点
- });
-
- var autoOptions = {
- input: "tipinput"
- };
-
- AMap.plugin(['AMap.PlaceSearch', 'AMap.AutoComplete', 'AMap.Geocoder'], () => {
- var auto = new AMap.AutoComplete(autoOptions);
- var placeSearch = new AMap.PlaceSearch({
- map: map
- }); //构造地点查询类
-
- function select (e) {
- if (e) {
- placeSearch.setCity(e.poi.adcode);
- placeSearch.search(e.poi.name, function (status, result) {
- form.setFieldValue('longitude', result.poiList.pois[0].location.lat)
- form.setFieldValue('latitude', result.poiList.pois[0].location.lng)
- }) //关键字查询查询
- }
- }
- auto.on("select", select);//注册监听,当选中某条记录时会触发
- map.on('click', function (e) { //点击地图获取经纬度
- form.setFieldValue('longitude', e.lnglat.lat)
- form.setFieldValue('latitude', e.lnglat.lng)
- });
- });
-
- }, [])
-
-
-
- return (
- {
- form.validateFields().then(v => {
- dispatch(projectRegime.postAddProject({
- ...v,
- img: v.img ? v.img.map(u => u.storageUrl) : [],
- id: modelData?.id
- })).then(res => {
- if (res.success) {
- success()
- }
- })
- })
- }}
- onCancel={() => close()}
- >
-
-
-
-
-
-
-
-
{
- const sjh = /^\d+$|^\d*\.\d+$/g;
- if (value) {
- let valid = sjh.test(value);
- if (!valid) {
- return callback([new Error("横坐标填写错误")]);
- }
- callback();
- }
- return callback([new Error("请输入横坐标")]);
- }
- }]}
- >
-
-
- ~
- {
- const sjh = /^\d+$|^\d*\.\d+$/g;
- if (value) {
- let valid = sjh.test(value);
- if (!valid) {
- return callback([new Error("纵坐标填写错误")]);
- }
- callback();
- }
- return callback([new Error("请输入纵坐标")]);
- }
- }]}
- >
-
-
- {
- setShowBaiduMap(!showBaiduMap)
- }} />
-
-
-
-
-
-
-
-
-
-
- 说明:请上传png,jpg格式图片,图片大小不超过5M,建议图片宽高比16:9}
- // rules={[{ required: true, message: '请上传图片', },]}
- >
- {
- return {
- storageUrl: s
- }
- })}
- />
-
-
-
-
- );
-};
-
-
-function mapStateToProps (state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(ProjectAddModel);
\ No newline at end of file
diff --git a/web/client/src/sections/projectRegime/containers/index.js b/web/client/src/sections/projectRegime/containers/index.js
deleted file mode 100644
index 8dee879..0000000
--- a/web/client/src/sections/projectRegime/containers/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-
-import QrCode from './qrCode'
-import Information from './information'
-import Point from './point'
-
-
-export { QrCode, Information, Point };
diff --git a/web/client/src/sections/projectRegime/containers/information.js b/web/client/src/sections/projectRegime/containers/information.js
deleted file mode 100644
index f5936b0..0000000
--- a/web/client/src/sections/projectRegime/containers/information.js
+++ /dev/null
@@ -1,239 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import { Spin, Card, Form, Input, Select, Button, Table, Modal, Popconfirm, Tooltip } from 'antd';
-import moment from "moment";
-import '../style.less';
-import { push } from 'react-router-redux';
-import ProjectAddModel from '../components/projectAddModel'
-import { Model } from 'echarts';
-
-
-const Information = (props) => {
- const { dispatch, actions, user, loading } = props
- const { projectRegime } = actions
- const [firmList, setFirmList] = useState([])
- const [tableList, settableList] = useState([])
- const [addModel, setAddModel] = useState(false)
- const [modelData, setModelData] = useState({})
- const [query, setQuery] = useState({ limit: 10, page: 0 })
- const [limits, setLimits] = useState()
- const [search, setSearch] = useState({})
- const [isPicture, setIsPicture] = useState(false)
- const [pictureUrl, setPictureUrl] = useState()
- const [companyID, setCompanyId] = useState('')
- const [select, setSelect] = useState([])
- const [selec, setSelec] = useState()
- var QRCode = require('qrcode')
-
-
-
- useEffect(() => {
- projectList(query)
- }, [])
-
- const projectList = (obj) => {
- const { limit, page, name } = obj
- dispatch(projectRegime.getProjectList({ limit, page, name, })).then(res => {
- // console.log(res)
- if (res.success) {
- settableList(res.payload.data?.rows?.map(v => ({ ...v, key: v.id })))
- setLimits(res.payload.data?.count)
- }
- })
- }
-
- const createQrCode = (name) => {
- let url = ''
- QRCode.toDataURL(name, {
- errorCorrectionLevel: 'low',
- type: 'image/png',
- quality: 0.3,
- margin: 2,
- maskPattern: 9,
- width: 400,
- color: {
- dark: "#000000ff",
- light: "#ffffffff"
- }
- }, function (err, v) {
- url = v
- })
- return url
- }
-
-
- const columns = [
- {
- title: '序号',
- dataIndex: 'index',
- key: 'index',
- render: (text, record, index) => index + 1
- }, {
- title: '结构物名称',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '所在地区',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => {
- return record.longitude && record.latitude ? {record.longitude},{record.latitude}
: "--"
- }
- }, {
- title: '结构物类型',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => record.type || '--'
- }, {
- title: '描述',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => record.describe || '--'
- }, {
- title: '操作',
- dataIndex: 'operation',
- key: 'operation',
- render: (text, record, index) => {
- return (
-
-
-
删除此结构物后,与结构物对应的点位、巡检计划、巡检记录也会删除,是否确认删除? }
- position='topLeft'
- onConfirm={() => {
- dispatch(projectRegime.delProject(record.id)).then(res => {
- if (res.success) {
- if ((limits > 11 && tableList.length > 1) || limits < 11) {
- projectList({ ...query, ...search })
- } else {
- projectList({ limit: query?.limit, page: query?.page - 1, ...search })
- setQuery({ limit: query?.limit, page: query?.page - 1 });
- }
-
- }
- })
- }}
- >
-
-
- {/* */}
-
-
- )
- }
- }
- ]
-
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
- {/* */}
-
-
-
- {
- return {`共${Math.ceil(total / query?.limit)}页,${total}项`}
- },
- onChange: (page, pageSize) => {
- setQuery({ limit: pageSize, page: page - 1 });
- projectList({ limit: pageSize, page: page - 1, ...search, companyId: companyID || search?.companyId })
- }
- }}
- rowSelection={{
- selectedRowKeys: select || [],
- onChange: (selectedRowKeys, selectedRows) => {
- setSelect(selectedRowKeys)
- console.log(selectedRowKeys, selectedRows);
- }
- }}
- />
- {
- { }}
- footer={null}
- onCancel={() => {
- setIsPicture(false)
- setPictureUrl('')
- }}
- >
- {pictureUrl && pictureUrl[0] ? : "暂无图片"}
-
- }
- {
- addModel ?
- {
- setAddModel(false)
- setModelData({})
- }}
- success={() => {
- setAddModel(false)
- setModelData({})
- setQuery({ limit: 10, page: 0 });
- projectList({ limit: 10, page: 0, ...search, companyId: companyID || search?.companyId })
- }}
- /> : ""
- }
- >
- )
-}
-
-function mapStateToProps (state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(Information);
diff --git a/web/client/src/sections/projectRegime/containers/point.js b/web/client/src/sections/projectRegime/containers/point.js
deleted file mode 100644
index 0b1d845..0000000
--- a/web/client/src/sections/projectRegime/containers/point.js
+++ /dev/null
@@ -1,270 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import { Spin, Card, Form, Input, Select, Button, Table, Modal, Popconfirm, Tooltip } from 'antd';
-const { TextArea } = Input;
-import moment from "moment";
-import '../style.less';
-import { push } from 'react-router-redux';
-import PointModel from '../components/pointModel'
-import { Model } from 'qrcode';
-
-
-const Information = (props) => {
- const { dispatch, actions, user, loading } = props
- const { projectRegime } = actions
- const [firmList, setFirmList] = useState([])
- const [tableList, settableList] = useState([])
- const [addModel, setAddModel] = useState(false)
- const [modelData, setModelData] = useState({})
- const [query, setQuery] = useState({ limit: 10, page: 0 })
- const [limits, setLimits] = useState()
- const [search, setSearch] = useState({})
- const [isPicture, setIsPicture] = useState(false)
- const [pictureUrl, setPictureUrl] = useState()
- const [companyID, setCompanyId] = useState('')
- const [select, setSelect] = useState([])
- const [selec, setSelec] = useState()
- const [form] = Form.useForm();
-
- var QRCode = require('qrcode')
- const { createCanvas, loadImage, registerFont } = require('canvas')
-
-
- const qrCodeId = props?.match?.params?.id
-
- useEffect(() => {
- projectList(query)
- }, [])
-
- const projectList = (obj) => {
- const { limit, page } = obj
- dispatch(projectRegime.positionList({ limit, page, projectId: qrCodeId })).then(res => {
- // console.log(res)
- if (res.success) {
- let data = []
- res.payload.data?.rows?.map(v => {
- v.points?.map(r => {
- data?.push(r)
- })
- })
- settableList(data?.map(v => ({ ...v, key: v.id })))
- setLimits(res.payload.data?.count)
- }
- })
- }
-
- const createQrCode = (name) => {
- let url = ''
- QRCode.toDataURL(name, {
- errorCorrectionLevel: 'low',
- type: 'image/png',
- quality: 0.3,
- margin: 2,
- maskPattern: 9,
- width: 400,
- color: {
- dark: "#000000ff",
- light: "#ffffffff"
- }
- }, function (err, v) {
- url = v
- })
- return url
- }
-
-// const createQrCode = (name) => {
-// const CW = 400, FONTSIZE = 30, FR = 2, CH = CW + FONTSIZE * FR;
-// let url = ''
-// // QRCode.toFile('F',name,
-// // {
-// // margin: 1,//二维码内边距,默认为4。单位px
-// // height: CW,//二维码高度
-// // width: CW,//二维码宽度
-// // color: {
-// // dark: '#000', //
-// // light: '#fff' //
-// // }
-// // });
-
-// QRCode.toDataURL(name, {
-// errorCorrectionLevel: 'low',
-// type: 'image/png',
-// quality: 0.3,
-// margin: 2,
-// maskPattern: 9,
-// width: 400,
-// color: {
-// dark: "#000000ff",
-// light: "#ffffffff"
-// }
-// }, function (err, v) {
-// url = v
-// })
-// // return url
-
-// const canvas = createCanvas(CW, CH)
-// const ctx = canvas.getContext('2d')
-// ctx.clearRect(0, 0, CW, CH)
-// ctx.fillStyle = 'rgba(255,255,255,1)'
-// ctx.fillRect(0, 0, CW, CH)
-// ctx.fillStyle = 'rgba(0,0,0,1)'
-// ctx.font = `${FONTSIZE}px ZiTiQuanWeiJunHei`
-// // ctx.font = `700 ${FONTSIZE}px `
-// let image = loadImage(url)
-// ctx.drawImage(image, 0, 0, CW, CW)
-// const text = ctx.measureText(name)
-// ctx.fillText(name, (CW - text.width) * 0.5, CH - FONTSIZE)
-// canvas.toDataURL('image/png', (err, png) => {
-// if (!err) {
-// console.log(png);
-// }
-// })
-// return url
-// }
-
-
-const columns = [
- {
- title: '序号',
- dataIndex: 'index',
- key: 'index',
- render: (text, record, index) => index + 1
- }, {
- title: '点位名称',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '所在地区',
- dataIndex: 'position',
- key: 'position',
- render: (text, record, index) => {
- return record.longitude && record.latitude ? {record.longitude},{record.latitude}
: "--"
- }
- }, {
- title: '描述',
- dataIndex: 'describe',
- key: 'describe',
- render: (text, record, index) => record.describe || '--'
- }, {
- title: '操作',
- dataIndex: 'operation',
- key: 'operation',
- render: (text, record, index) => {
- return (
-
-
-
删除该点位后,与巡检计划关联的点位删除,对应的巡检记录删除,是否确认删除? }
- position='topLeft'
- onConfirm={() => {
- dispatch(projectRegime.delPosition(record.id)).then(res => {
- if (res.success) {
- if ((limits > 11 && tableList.length > 1) || limits < 11) {
- projectList({ ...query, ...search })
- } else {
- projectList({ limit: query?.limit, page: query?.page - 1, ...search })
- setQuery({ limit: query?.limit, page: query?.page - 1 });
- }
-
- }
- })
- }}
- >
-
-
- {/* */}
-
-
- )
- }
- }
-]
-
-return (
- <>
-
-
-
-
-
-
-
- {
- return {`共${Math.ceil(total / query?.limit)}页,${total}项`}
- },
- onChange: (page, pageSize) => {
- setQuery({ limit: pageSize, page: page - 1 });
- projectList({ limit: pageSize, page: page - 1, ...search, companyId: companyID || search?.companyId })
- }
- }}
- rowSelection={{
- selectedRowKeys: select?.map(v => v.id) || [],
- onChange: (selectedRowKeys, selectedRows) => {
- setSelect(selectedRows)
- console.log(selectedRows);
- }
- }}
- />
- {
- addModel ?
- {
- setAddModel(false)
- setModelData({})
- }}
- success={() => {
- setAddModel(false)
- setModelData({})
- setQuery({ limit: 10, page: 0 });
- projectList({ limit: 10, page: 0 })
- }}
- /> : ""
- }
- >
-)
-}
-
-function mapStateToProps (state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(Information);
diff --git a/web/client/src/sections/projectRegime/containers/qrCode.js b/web/client/src/sections/projectRegime/containers/qrCode.js
deleted file mode 100644
index 39fde45..0000000
--- a/web/client/src/sections/projectRegime/containers/qrCode.js
+++ /dev/null
@@ -1,129 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import { Spin, Card, Form, Input, Select, Button, Table, Modal, Popconfirm, Tooltip } from 'antd';
-import moment from "moment";
-import '../style.less';
-import ProjectAddModel from '../components/projectAddModel'
-import QRCode from 'qrcode';
-import { login } from '../../auth/actions/auth';
-import { createCanvas, loadImage, registerFont } from 'canvas'
-import { dataURItoBlob } from 'react-jsonschema-form/lib/utils';
-
-
-const QrCode = (props) => {
- const { dispatch, actions, user, loading } = props
- const { projectRegime } = actions
- const [firmList, setFirmList] = useState([])
- const [tableList, settableList] = useState([])
- const [addModel, setAddModel] = useState(false)
- const [modelData, setModelData] = useState({})
- const [query, setQuery] = useState({ limit: 10, page: 0 })
- const [limits, setLimits] = useState()
- const [search, setSearch] = useState({})
- const [isPicture, setIsPicture] = useState(false)
- const [pictureUrl, setPictureUrl] = useState()
- const [companyID, setCompanyId] = useState('')
-
-
-
-
- useEffect(() => {
- dispatch(projectRegime.getProjectList({ justStructure: true })).then(res => {
- if (res.success) {
- setFirmList(res.payload.data?.rows?.map(v => ({ value: v.id, label: v.name })))
- }
- })
- projectList({})
-
- // dispatch(projectRegime.q())
- }, [])
-
- const projectList = (obj) => {
- const { projectId, name } = obj
- dispatch(projectRegime.qrCodeShow({ projectId, name })).then(res => {
- if (res.success) {
- settableList(res.payload.data?.rows)
- }
- })
- }
- console.log(firmList);
-
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
- {
- tableList?.map(v => {
- return
-
- 结构物名称:{firmList?.filter(u => u.value == v.projectId)[0]?.label}
- 点位名称:{v.name}
-
-
-
-
- }
- )
- }
-
-
- >
- )
-}
-
-function mapStateToProps (state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(QrCode);
diff --git a/web/client/src/sections/projectRegime/index.js b/web/client/src/sections/projectRegime/index.js
deleted file mode 100644
index 3d5db2a..0000000
--- a/web/client/src/sections/projectRegime/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-
-import reducers from './reducers';
-import routes from './routes';
-import actions from './actions';
-import { getNavItem } from './nav-item';
-
-export default {
- key: 'projectRegime',
- name: '结构物管理',
- reducers: reducers,
- routes: routes,
- actions: actions,
- getNavItem: getNavItem
-};
\ No newline at end of file
diff --git a/web/client/src/sections/projectRegime/nav-item.js b/web/client/src/sections/projectRegime/nav-item.js
deleted file mode 100644
index 72ac1b4..0000000
--- a/web/client/src/sections/projectRegime/nav-item.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import React from 'react';
-import { Link } from 'react-router-dom';
-import { Menu } from 'antd';
-import { SettingOutlined } from '@ant-design/icons';
-
-const SubMenu = Menu.SubMenu;
-
-export function getNavItem (user, dispatch) {
- return } title={'结构物管理'}>
-
- 结构物基础信息管理
-
-
- 二维码管理
-
-
-
-}
\ No newline at end of file
diff --git a/web/client/src/sections/projectRegime/reducers/index.js b/web/client/src/sections/projectRegime/reducers/index.js
deleted file mode 100644
index 7ed1088..0000000
--- a/web/client/src/sections/projectRegime/reducers/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-export default {
-
-}
\ No newline at end of file
diff --git a/web/client/src/sections/projectRegime/routes.js b/web/client/src/sections/projectRegime/routes.js
deleted file mode 100644
index e722522..0000000
--- a/web/client/src/sections/projectRegime/routes.js
+++ /dev/null
@@ -1,31 +0,0 @@
-'use strict';
-import { Information, QrCode, Point } from './containers';
-
-export default [{
- type: 'inner',
- route: {
- path: '/projectRegime',
- key: 'projectRegime',
- breadcrumb: '结构物管理',
- // 不设置 component 则面包屑禁止跳转
- childRoutes: [{
- path: '/information',
- key: 'information',
- breadcrumb: '结构物基础信息管理',
- component: Information,
- childRoutes: [ {
- path: '/:id',
- key: ':id',
- component: Point,
- breadcrumb: '点位',
- },
- ]
- }, {
- path: '/qrCode',
- key: 'qrCode',
- component: QrCode,
- breadcrumb: '二维码管理',
- },
- ]
- }
-}];
\ No newline at end of file
diff --git a/web/client/src/sections/projectRegime/style.less b/web/client/src/sections/projectRegime/style.less
deleted file mode 100644
index 3323452..0000000
--- a/web/client/src/sections/projectRegime/style.less
+++ /dev/null
@@ -1,3 +0,0 @@
-#example:hover {
- font-size: larger;
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/actions/hiddenrectification.js b/web/client/src/sections/safetymanage/actions/hiddenrectification.js
deleted file mode 100644
index 4427500..0000000
--- a/web/client/src/sections/safetymanage/actions/hiddenrectification.js
+++ /dev/null
@@ -1,79 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
-export function getRectifyList (query = {}) {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- query: query,
- actionType: 'GET_RECTIFY_LIST',
- url: ApiTable.getRectifyList,
- msg: { option: '获取隐患整改数据' },
- reducer: { name: 'getRectifyList' }
- });
-}
-
-export function addRectify (params) {
- return dispatch => basicAction({
- type: 'post',
- data: params,
- dispatch: dispatch,
- actionType: 'ADD_RECTIFY',
- url: ApiTable.addRectify,
- msg: { option: '新增隐患整改' },
- });
-}
-
-export function editRectify (id, params) {
- return dispatch => basicAction({
- type: 'put',
- data: params,
- dispatch: dispatch,
- actionType: 'EDIT_RECTIFY',
- url: ApiTable.editRectify.replace('{id}', id),
- msg: { option: '修改隐患整改' },
- });
-}
-
-export function delRectify (id) {
- return dispatch => basicAction({
- type: 'delete',
- dispatch: dispatch,
- actionType: 'DEL_RECTIFY',
- url: ApiTable.delRectify.replace('{id}', id),
- msg: { option: '删除隐患整改' },
- })
-}
-
-export function disposeRectify (data, optionStr = '') {
- return dispatch => basicAction({
- type: 'post',
- dispatch: dispatch,
- data: data,
- actionType: 'DISPOSE_RECTIFY',
- url: ApiTable.disposeRectify,
- msg: { option: '隐患整改' + optionStr + '信息保存' },
- })
-}
-
-export function getRectifyReport (query = {}) {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- query: query,
- actionType: 'GET_RECTIFY_REPORT',
- url: ApiTable.rectifyReport,
- msg: { option: '获取隐患整改数据报表' },
- reducer: { name: 'getRectifyReport' }
- });
-}
-
-export default {
- getRectifyList,
- addRectify,
- editRectify,
- delRectify,
- disposeRectify,
- getRectifyReport,
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/actions/index.js b/web/client/src/sections/safetymanage/actions/index.js
deleted file mode 100644
index 80334e9..0000000
--- a/web/client/src/sections/safetymanage/actions/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict';
-
-import * as Hiddenrectification from './hiddenrectification'
-import * as Safeinspection from './safeinspection'
-import * as Safetraining from './safetraining'
-export default {
- ...Hiddenrectification,
- ...Safeinspection,
- ...Safetraining
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/actions/safeinspection.js b/web/client/src/sections/safetymanage/actions/safeinspection.js
deleted file mode 100644
index 3a349af..0000000
--- a/web/client/src/sections/safetymanage/actions/safeinspection.js
+++ /dev/null
@@ -1,54 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
-export function getProjectDisclosureList(query = {}) {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- query: query,
- actionType: 'GET_CHECK_TASK_LIST',
- url: ApiTable.getCheckTask,
- msg: { option: '获取巡查任务' },
- reducer: { name: 'getCheckTask' }
- });
-}
-
-export function addProjectDisclosure(params) {
- return dispatch => basicAction({
- type: 'post',
- data: params,
- dispatch: dispatch,
- actionType: 'ADD_CHECK_TASK',
- url: ApiTable.addCheckTask,
- msg: { option: '新增巡查任务' },
- });
-}
-
-export function editProjectDisclosure(data) {
- return dispatch => basicAction({
- type: 'put',
- data,
- dispatch: dispatch,
- actionType: 'EDIT_CHECK_TASK',
- url: ApiTable.editCheckTask,
- msg: { option: '' },
- });
-}
-
-export function delProjectDisclosure(id) {
- return dispatch => basicAction({
- type: 'delete',
- dispatch: dispatch,
- actionType: 'DEL_CHECK_TASK',
- url: ApiTable.delCheckTask.replace(':id', id),
- msg: { option: '删除巡查任务' },
- })
-}
-
-export default {
- getProjectDisclosureList,
- addProjectDisclosure,
- editProjectDisclosure,
- delProjectDisclosure,
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/actions/safetraining.js b/web/client/src/sections/safetymanage/actions/safetraining.js
deleted file mode 100644
index 17b06d3..0000000
--- a/web/client/src/sections/safetymanage/actions/safetraining.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict';
-
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
-
-export function getTring(id, params) {
- return dispatch => basicAction({
- type: 'get',
- dispatch: dispatch,
- query: params,
- actionType: 'GET_TRINING',
- url: ApiTable.getTring.replace(':siteid', id),
- msg: { option: '获取安全管理' },
- // reducer: { name: 'getCheckTask' }
- });
-}
-
-export function postTring(params) {
- return dispatch => basicAction({
- type: 'post',
- data: params,
- dispatch: dispatch,
- actionType: 'ADD_TR_INING',
- url: ApiTable.postTring,
- msg: { option: '新增安全管理' },
- });
-}
-
-export function modifyTring(params) {
- return dispatch => basicAction({
- type: 'put',
- data: params,
- dispatch: dispatch,
- actionType: 'MODIFY_TR_INING',
- url: ApiTable.putTring,
- msg: { option: '编辑安全管理' },
- })
-}
-
-
-export function deleteTring(id) {
- return dispatch => basicAction({
- type: 'delete',
- dispatch: dispatch,
- actionType: 'DEL_TR_INING',
- url: ApiTable.delTring.replace(':id', id),
- msg: { option: '删除安全管理' },
- })
-};
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/disclosure-modal.js b/web/client/src/sections/safetymanage/components/disclosure-modal.js
deleted file mode 100644
index 22435ed..0000000
--- a/web/client/src/sections/safetymanage/components/disclosure-modal.js
+++ /dev/null
@@ -1,207 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment';
-import Uploads from '$components/Uploads';
-import { Input, Modal, Form, Button, message, Select ,DatePicker} from 'antd';
-import { MinusCircleOutlined, PlusOutlined, } from '@ant-design/icons';
-const ProductEditModal = (props) => {
- const { RangePicker } = DatePicker;
- const { user, onCancel, onSave, editData, type } = props;
- let files = editData?.projectDisclosureFiles?.map(p => {
- return { fName: p.fileName, size: p.fileSize, fileSize: p.fileSize, storageUrl: p.fileLink }
- })
- // const [dd,setdd] = useState('次/天')
- const [form] = Form.useForm();
- const [startTime, setStartTime] = useState();
- const [endTime, setEndTime] = useState();
- const [editUrl, setEditUrl] = useState(files);
- const [taskperiod,settaskperiod] = useState(editData?.taskperiod || '次/天')
- //初始化表单数据
- const getinitialValues = () => {
- if (editData) {
- // console.log(editData,'编辑的数据')
- let data = {...editData,contentList:editData.contentList?.filter((i,n)=>n!==0),checkContent:editData.checkContent,zouqi:editData?.starTime&&editData?.endTime?[moment(editData.starTime),moment(editData.endTime)]:[]}
- return data;
-
- }
- return {inspectionnum:'1'}
- };
-
- useEffect(() => {
- // setdd('你好')
- }, []);
- const selectAfter = (
-
- );
- const handleOk = () => {
- form.validateFields().then(values => {
- let obj = {
- // siteId: 1,//todo
- inspectiontaskname: values.inspectiontaskname,
- inspectionnum: values.inspectionnum || "1",
- taskperiod:taskperiod,
- checkContent:values.checkContent,
- insectionuser:values.insectionuser,
- starTime:startTime,
- endTime:endTime,
- contentList: [],
- path:editUrl
- }
- console.log(values,'values')
- if (values.checkContent) {
-
- obj.contentList.push({id:0,content:values.checkContent,logcontent:editData?.contentList[0].logcontent})
- // console.log({id:0,content:values.checkContent,...editData?.contentList[0]},'第一步')
- }
- if (values.contentList && values.contentList instanceof Array) {
- values.contentList.forEach((element,n) => {
- obj.contentList.push({id:n+1,content:element.content,logcontent:element?.logcontent||[]});
- // console.log({id:n+1,content:element.content,...element},'第二部')
-
- });
- }
-
-
- onSave(obj, editUrl)
- onCancel()
- })
- }
-
- const vsjunct = (params) => {
- if (params.length) {
- let appendix = []
- for (let p of params) {
- appendix.push({
- fName: p.name,
- size: p.size,
- fileSize: p.size,
- storageUrl: p.storageUrl,//必须有storageUrl
- })
- }
- setEditUrl(appendix)
- } else {
- setEditUrl([])
- }
- }
-
- return (
- onCancel(0)} onOk={handleOk}>
-
-
-
-
-
-
-
- {
- if (time) {
- setStartTime(moment(time[0]).format('YYYY-MM-DD'));
- setEndTime(moment(time[1]).format('YYYY-MM-DD'))
- } else {
- setStartTime(null)
- setEndTime(null)
- }
- }} defaultValue={editData?.starTime&&editData?.endTime?[moment(editData.starTime),moment(editData.endTime)]:[]}/>
-
-
-
-
-
- {(fields, { add, remove }) => (
- <>
- {fields?.map((field, index) => (
-
-
-
-
-
-
-
- { remove(field.name); }} style={{ padding: '6% 0 0 7%' }} />
-
-
-
-
-
- // >
- ))}
- {
-
- }>
- 增加巡检点
-
-
- }
- >
- )}
-
-
-
-
- {/*
-
- */}
-
-
- )
-}
-function mapStateToProps(state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- }
-}
-
-export default connect(mapStateToProps)(ProductEditModal);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/hide-danger-approval-modal.js b/web/client/src/sections/safetymanage/components/hide-danger-approval-modal.js
deleted file mode 100644
index d4d17e9..0000000
--- a/web/client/src/sections/safetymanage/components/hide-danger-approval-modal.js
+++ /dev/null
@@ -1,169 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment';
-import Uploads from '$components/Uploads';
-import { Input, Modal, Form, Button, message, Select, DatePicker, Timeline, Divider, Switch, Radio } from 'antd';
-
-const HideDangerApprovalModal = (props) => {
- const { dispatch, user, onCancel, editData, actions } = props;
- const { safetymanage } = actions;
- const [form] = Form.useForm();
-
- useEffect(() => {
- }, []);
-
- const handleOk = () => {
- if (editData.dispose == '查看') {
- onCancel({ refresh: false })
- } else
- form.validateFields().then(values => {
- let obj = {
- ...values,
- files: values.files ? values.files.map(f => f.storageUrl) : [],
- rectifySiteId: editData.hideDangerRectifySites[0]?.id,
- type: editData.dispose == '整改' ?
- 1 : editData.dispose == '审批' ?
- 2 : 3
- }
- dispatch(safetymanage.disposeRectify(obj, editData.dispose == '整改' ? '' : '审核')).then(res => {
- if (res.success) {
- onCancel({ refresh: true })
- }
- })
- })
- }
-
- return (
- onCancel(0)} onOk={handleOk}>
-
-
-
-
任务详情
-
{editData.createTime ? moment(editData.createTime).format('YYYY-MM-DD HH:mm:ss') : ''}
-
-
-
任务名称:
-
{editData.name}
-
-
-
任务描述:
-
{editData.desc}
-
-
-
截止时间:
-
{moment(editData.deadline).format('YYYY-MM-DD HH:mm:ss')}
-
-
- {
- editData?.hideDangerRectifySites[0]?.hideDangerDisposes?.map(d => {
- return
-
-
{d.type == 1 ? '整改' : d.type == 2 ? '审核' : '复审'}详情
-
{d.disposeTime ? moment(d.disposeTime).format('YYYY-MM-DD HH:mm:ss') : ''}
-
-
-
{d.type == 1 ? '整改人' : '审批人'}:
-
{d.user?.displayName}
-
- {
- d.type != 1 ?
-
-
审批结果:
-
{d.admit ? '审批通过' : '审批驳回'}
-
- : ''
- }
-
-
{d.type == 1 ? '整改描述' : '审批意见'}:
-
{d.describe}
-
-
-
{d.type == 1 ? '整改附件' : '审批附件'}:
-
- {
- return {
- url: f,
- storageUrl: f
- }
- })
- }
- />
-
-
-
- })
- }
- {/* */}
-
- {
- editData.dispose != '查看' ?
-
- 提交{editData.dispose == '整改' ? '整改' : '审批'}
-
-
- 审批通过
- 审批驳回
-
- : ''
- }
-
-
-
-
- { }}
- // fileTypes={["jpeg", "png", "jpg", "pdf", "doc", "docx"]}
- // value={editUrlMap.type1}
- // defaultValue={editUrlMap.type1}
- />
-
-
- : ''
- }
-
-
-
- )
-}
-
-function mapStateToProps(state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- }
-}
-
-export default connect(mapStateToProps)(HideDangerApprovalModal);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/hide-danger-approval-report.js b/web/client/src/sections/safetymanage/components/hide-danger-approval-report.js
deleted file mode 100644
index 3f6fded..0000000
--- a/web/client/src/sections/safetymanage/components/hide-danger-approval-report.js
+++ /dev/null
@@ -1,182 +0,0 @@
-import { Modal, Timeline, Row, Col, Button, Space, DatePicker, Spin } from 'antd';
-import React, { useState, useEffect } from 'react';
-import moment from 'moment';
-import { connect } from 'react-redux';
-import { useFsRequest, ApiTable } from '$utils';
-import './style.less';
-
-const HideDangerApprovalReport = (props) => {
- const { visible, user, getColumns, actions, dispatch, onCancel } = props;
- const { safetymanage } = actions;
- const [loading, setLoading] = useState(false)
- const [searchTime, setSearchTime] = useState([
- moment().subtract(1, 'month'),
- moment().subtract(1, 'quarters'),
- moment().subtract(1, 'year'),
- ])
- const [data, setData] = useState([])
- const [aliAdmin] = useState(localStorage.getItem('aliAdmin'))
-
- const getData = () => {
- let searchTime_ = searchTime
- searchTime_[0] = moment(searchTime_[0]).format('YYYY-MM')
- searchTime_[1] = moment(searchTime_[1]).format('YYYY-季度Q').replace('季度', 'Q')
- searchTime_[2] = moment(searchTime_[2]).format('YYYY')
- setLoading(true)
- dispatch(safetymanage.getRectifyReport({ time: searchTime_.join(',') })).then(res => {
- if (res.success) {
- setData(res.payload.data)
- }
- setLoading(false)
- })
- }
-
- useEffect(() => {
- getData()
- }, [])
-
- useEffect(() => {
- getData()
- }, [searchTime])
-
- const getPopupContainer = (triggerNode) => triggerNode.parentNode;
-
- const renderList = (timeIndex) => {
- let time = ''
- if (timeIndex == 0) {
- time = moment(searchTime[0]).format('YYYY-MM')
- } else if (timeIndex == 1) {
- time = moment(searchTime[1]).format('YYYY-季度Q').replace('季度', 'Q')
- } else if (timeIndex == 2) {
- time = moment(searchTime[2]).format('YYYY')
- }
- let corData = data.find(d => d.time == time) || {}
- return <>
-
- 整改项目数量:
- {corData.siteCount || 0}
-
-
- 整改任务数量:
- {corData.rectifyCount || 0}
-
-
- 已完成任务数量:
- {corData.completedRectifyCount || 0}
-
-
- 未完成任务数量:
- {corData.uncompletedRectifyCount || 0}
-
-
- 报表:
- {
- corData.report ? corData.report.split('/').pop() : '-'
- }
-
- {
- corData.report ?
-
-
-
-
-
-
-
-
-
-
-
- : ''
- }
- >
- }
-
- const updateSearchTime = (time, index) => {
- let searchTime_ = JSON.parse(JSON.stringify(searchTime))
- searchTime_[index] = time
- setSearchTime(searchTime_)
- }
-
- return (
- onCancel(0)}
- >
-
-
-
-
-
-
- 月报:
-
- {
- updateSearchTime(date, 0)
- }} picker="month"
- />
-
-
- {renderList(0)}
-
-
-
-
-
- 季报:
-
- {
- updateSearchTime(date, 1)
- }} picker="quarter"
- />
-
-
- {renderList(1)}
-
-
-
-
-
- 年报:
-
- {
- updateSearchTime(date, 2)
- }} picker="year" />
-
-
- {renderList(2)}
-
-
-
-
-
-
- );
-};
-
-function mapStateToProps (state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(HideDangerApprovalReport);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/hide-danger-modal.js b/web/client/src/sections/safetymanage/components/hide-danger-modal.js
deleted file mode 100644
index 5f7dbdf..0000000
--- a/web/client/src/sections/safetymanage/components/hide-danger-modal.js
+++ /dev/null
@@ -1,129 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment';
-import { Input, Modal, Form, Button, message, Select, DatePicker } from 'antd';
-const HideDangerModal = (props) => {
- const { user, onCancel, onSave, editData, enterance, sites } = props;
- const [form] = Form.useForm();
- const [siteOptions, setSiteOptions] = useState([]);
- const isXiangmu = enterance === 'isXiangmu';
- //初始化表单数据
- const getinitialValues = () => {
- if (editData) {
- editData.deadline = moment(editData.deadline)
- if (!isXiangmu) {
- editData.toSites = editData.hideDangerRectifySites.map(s => s.siteId)
- }
- return editData;
- }
- return {}
- };
-
- useEffect(() => {
- if (!isXiangmu) {
- const options = [];
- sites.map(s => {
- options.push(
- {s.name}
- )
- })
- setSiteOptions(options);
- }
- }, []);
-
- const handleOk = () => {
- form.validateFields().then(values => {
- let obj = {
- status: 0,
- siteId: user?.relateSites && user?.relateSites[0],
- user: user.id,
- from: user.role.type,//1集团 2公司 3项目
- ...values
- }
- onSave(obj)
- onCancel()
- })
- }
-
- return (
- onCancel(0)} onOk={handleOk}>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {
- isXiangmu ? null :
-
-
-
- }
-
-
- )
-}
-
-function mapStateToProps(state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- sites: global.sites
- }
-}
-
-export default connect(mapStateToProps)(HideDangerModal);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/patrolpoin-model.js b/web/client/src/sections/safetymanage/components/patrolpoin-model.js
deleted file mode 100644
index 270590b..0000000
--- a/web/client/src/sections/safetymanage/components/patrolpoin-model.js
+++ /dev/null
@@ -1,133 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment';
-import Uploads from '$components/Uploads';
-import { Input, Modal, Form, Button, message, Select ,DatePicker} from 'antd';
-import { MinusCircleOutlined, PlusOutlined, } from '@ant-design/icons';
-const ProductEditModal = (props) => {
-
- const { TextArea } = Input;
- const { user, onCancel, onSave, editData, type ,nowdata} = props;
- // console.log(nowdata,'当前的时间')
- let files = editData?.projectDisclosureFiles?.map(p => {
- return { fName: p.fileName, size: p.fileSize, fileSize: p.fileSize, storageUrl: p.fileLink }
- })
- // const [dd,setdd] = useState('次/天')
- const [form] = Form.useForm();
- const [startTime, setStartTime] = useState();
- const [endTime, setEndTime] = useState();
- const [editUrl, setEditUrl] = useState(files);
- const [taskperiod,settaskperiod] = useState(editData?.taskperiod || '次/天')
- //初始化表单数据
- const getinitialValues = () => {
- if (editData) {
- console.log(editData,'编辑的详情数据')
- let data = {content:editData.content}
- return data;
- }
- return {}
- };
- useEffect(() => {
- // setdd('你好')
- }, []);
- const selectAfter = (
-
- );
- const handleOk = () => {
- form.validateFields().then(values => {
- // let obj = {
- // // siteId: 1,//todo
- // inspectiontaskname: values.inspectiontaskname,
- // inspectionnum: values.inspectionnum || "1",
- // taskperiod:taskperiod,
- // checkContent:values.checkContent,
- // insectionuser:values.insectionuser,
- // starTime:startTime,
- // endTime:endTime,
- // contentList: [],
- // path:editUrl
- // }
- let obj ={id:editData.id,content:values.content,logcontent:editData.logcontent?[{...values,subtime:moment().format('YYYY-MM-DD HH:mm:ss'),edittime:moment(nowdata).format('YYYY-MM-DD')},...editData.logcontent]:[{...values,subtime:moment().format('YYYY-MM-DD HH:mm:ss'),edittime:moment(nowdata).format('YYYY-MM-DD')}]}
- // console.log(editData,'edit')
- // console.log(obj,'提交的值')
-
- onSave(obj, editUrl)
- onCancel()
- })
- }
-
- const vsjunct = (params) => {
- if (params.length) {
- let appendix = []
- for (let p of params) {
- appendix.push({
- fName: p.name,
- size: p.size,
- fileSize: p.size,
- storageUrl: p.storageUrl,//必须有storageUrl
- })
- }
- setEditUrl(appendix)
- } else {
- setEditUrl([])
- }
- }
-
- return (
- onCancel(0)} onOk={handleOk}>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
-}
-function mapStateToProps(state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- }
-}
-
-export default connect(mapStateToProps)(ProductEditModal);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/report/data-picker.js b/web/client/src/sections/safetymanage/components/report/data-picker.js
deleted file mode 100644
index 2a7064a..0000000
--- a/web/client/src/sections/safetymanage/components/report/data-picker.js
+++ /dev/null
@@ -1,104 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import moment from 'moment';
-import { Calendar, Col, Radio, Row, Select, Typography } from 'antd';
-import { LeftOutlined, RightOutlined ,DoubleLeftOutlined ,DoubleRightOutlined} from '@ant-design/icons';
-import './style.less'
-const MonthWeekPicker = (props) => {
- const {data,seldate} = props
-
-
-
- const onPanelChange = (value, mode) => {
- // console.log(value.format('YYYY-MM-DD'), mode);
- };
- // console.log(data,'data日历')
- const dateCellRender = (value) => {
- // console.log(moment(value).week(),'周')
- // console.log(moment(value).format("YYYY-MM-DD"),'value')
- let nowdate = parseInt(moment(value).format("YYYYMMDD"))
- let startdate = parseInt(moment(data?.starTime).format("YYYYMMDD"))
- let enddate = parseInt(moment(data?.endTime).format("YYYYMMDD"))
- if(nowdate>=startdate&&nowdate<=parseInt(moment().format('YYYYMMDD'))){
- let logdata
- if(data?.taskperiod==='次/天'){
- logdata = data?.contentList.map(i=>i.logcontent).map(n=>n?.filter(j=>parseInt(moment(j.edittime).format('YYYYMMDD'))===nowdate))
- }
- else if(data?.taskperiod==="次/周"){
- logdata = data?.contentList.map(i=>i.logcontent).map(n=>n?.filter(j=>parseInt(moment(j.edittime).format('YYYYMMDD'))<=nowdate&&moment(value).week()===moment(j.edittime).week()))
- }
- else{
- logdata = data?.contentList.map(i=>i.logcontent).map(n=>n?.filter(j=>parseInt(moment(j.edittime).format('YYYYMMDD'))<=nowdate&&moment(value).month()===moment(j.edittime).month()))
- }
- // console.log(logdata,'logdata')
- if(logdata?.every(i=>i?.length>=parseInt(data.inspectionnum))){
- return (
-
- )
- }
- else{
- return
- }
-
-
- }
- }
- return (
-
-
{
- // console.log(moment(e).format('YYYY-MM-DD HH:mm:ss'),'时间')
- seldate(moment(e))
- }}
- fullscreen={false}
- headerRender={({ value, type, onChange, onTypeChange }) => {
- const current = value.clone();
- const localeData = value.localeData();
- const months = [];
- for (let i = 0; i < 12; i++) {
- current.month(i);
- months.push(localeData.monthsShort(current));
- }
-
- const year = value.year();
- const month = value.month();
-
- return (
-
-
-
-
-
- {let now = value.clone().year(year-1)
- onChange(now)}} style={{marginRight:'20px'}}/>
- {
- let now = value.clone().month(month-1)
- onChange(now);
- }}/>
-
{`${year}年${month+1}月`}
-
{
- let now = value.clone().month(month+1)
- onChange(now);
- }}/>
- {let now = value.clone().year(year+1)
- onChange(now)}} style={{marginLeft:'20px'}}/>
-
-
-
-
-
-
-
- );
- }}
- onPanelChange={onPanelChange}
- dateCellRender={dateCellRender}
- />
-
- )
-}
-
-export default MonthWeekPicker;
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/report/month-picker.js b/web/client/src/sections/safetymanage/components/report/month-picker.js
deleted file mode 100644
index dea3a7d..0000000
--- a/web/client/src/sections/safetymanage/components/report/month-picker.js
+++ /dev/null
@@ -1,115 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import { LeftOutlined, RightOutlined, DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons';
-import moment from 'moment';
-
-const MonthWeekPicker = (props) => {
- const { data } = props;
- const [currentMonth, setCurrentMonth] = useState(moment().format('YYYY-MM'))
- const [currentWeek, setCurrentWeek] = useState()
-
- useEffect(() => {
- const arr = initTime(currentMonth)
- const start = arr[0].start;
- const end = arr[arr.length - 1].end;
- setCurrentWeek(null)
- props.timeChange(start, end)
- }, [currentMonth])
-
- const formatTime = (val) => {
- let arr = ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十"];
- let len = val.toString().length;
- if (len == 1) { // 长度为1,可以直接返回
- return arr[val - 1];
- } else {
- let newarr = val.toString().split("");
- switch (newarr[0]) {
- case "1":
- return `${arr[arr.length - 1]}${newarr[1] == 0 ? "" : arr[newarr[1] - 1]
- }`;
- case "2":
- return `${arr[newarr[0] - 1]}${arr[arr.length - 1]}${newarr[1] == 0 ? "" : arr[newarr[1] - 1]
- }`;
- }
- }
- }
-
- const initTime = (month) => {
- // 对起止时间进行处理
- let beginTime = moment(month).startOf('month');
- let endTime = moment(month).endOf('month');
-
- let week = moment(beginTime).format('MM') == '01' ?
- beginTime.day() == 6 || beginTime.day() == 0 ? 6 : 5 :
- endTime.week() - beginTime.week() + 1; // 计算周数 用来循环
- let arr = [] // 存放结果数据
-
- for (let i = 0; i < week; i++) {
- let next_monday = '', next_sunday = '', obj = {};
- let date = moment(month).startOf('month').add(7 * i, 'days');
- next_sunday = moment(date).endOf('week').format('YYYY-MM-DD')
- next_monday = moment(next_sunday).subtract(6, 'd').format('YYYY-MM-DD')
- arr.push({ name: `第${formatTime(i + 1)}周`, start: `${next_monday}`, end: `${next_sunday}` })
- }
- return arr;
- }
-
- const getWeekClass = (week) => {
- let riskClassName = '';
- // 本周之后的时间显示白色背景
- if (moment().endOf('week') < moment(week.start).startOf('day')) {
- return riskClassName;
- }
- // 本周周一至周五有数据 显示绿色
- if (data.find(x => moment(week.start).startOf('day') < moment(x.createTime) && moment(week.end).endOf('day').subtract(2, 'days') > moment(x.createTime))) {
- return riskClassName = '_risk-normal'
- } else {
- // 延迟提交 周1-周5 未提交 且周六周日提交了
- if (data?.find(s => moment(s.createTime) > moment(week.start).startOf('day').add(4, 'days') && moment(s.createTime) < moment(week.end).endOf('day'))) {
- riskClassName = '_risk-delay'
- } else {
- // 若为当前周 周一至周五未提交显示白色 其他周显示未完成提交
- if (moment().startOf('week').valueOf() == moment(week.start).startOf('day').valueOf()) {
- riskClassName = '';
- } else {
- riskClassName = '_risk-abnormal'
- }
- }
- }
- return riskClassName;
- }
-
- const weekClick = (s) => {
- if (currentWeek !== s.start + s.end) {
- setCurrentWeek(s.start + s.end)
- props.weekSelect([s.start, s.end])
- } else {
- setCurrentWeek(null)
- props.weekSelect(null)
- }
- }
-
- return (
- <>
-
-
{ setCurrentMonth(moment(currentMonth).subtract(1, 'Y')) }}>
-
{ setCurrentMonth(moment(currentMonth).subtract(1, 'M')) }}>
-
{moment(currentMonth).format('YYYY年 MM月')}
-
{ setCurrentMonth(moment(currentMonth).add(1, 'M')) }}>
-
{ setCurrentMonth(moment(currentMonth).add(1, 'Y')) }}>
-
-
- {
- initTime(currentMonth).map(s => {
- let riskClassName = getWeekClass(s)
- return
{ weekClick(s) }}>
-
{s.name}
-
{moment(s.start).format('MM月DD日')} - {moment(s.end).format('MM月DD日')}
-
- })
- }
-
- >
- )
-}
-
-export default MonthWeekPicker;
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/report/risk-modal.js b/web/client/src/sections/safetymanage/components/report/risk-modal.js
deleted file mode 100644
index 0c4d2de..0000000
--- a/web/client/src/sections/safetymanage/components/report/risk-modal.js
+++ /dev/null
@@ -1,189 +0,0 @@
-import React, { useState } from 'react';
-import { Button, Form, Input } from 'antd';
-import {
- ModalForm,
- ProFormText,
- ProFormSelect,
-} from '@ant-design/pro-form';
-import Uploads from '$components/Uploads';
-import { RISK_LEVELS, SPECIAL_WORK_TYPE, deleteRiskReport } from '../../contants/risk-report';
-
-const FormItem = Form.Item;
-
-export default (props) => {
- const { title, triggerRender, editData = null, onFinish } = props;
- const [editUrlMap, setEditUrlMap] = useState({ type1: [], type2: [] });
- const formItemLayout = { labelCol: { span: 4 }, wrapperCol: { span: 14 } };
- const initialValues = editData ? {
- ...editData
- } : { riskLevel: RISK_LEVELS[0], specialType: SPECIAL_WORK_TYPE[0] };
-
- const vsjunct = (params, type) => {
- let temp = editUrlMap
- if (params.length) {
- let appendix = []
- for (let p of params) {
- appendix.push({
- fName: p.name,
- size: p.size,
- fileSize: p.size,
- storageUrl: p.storageUrl,//必须有storageUrl
- })
- }
- temp[type] = appendix
- setEditUrlMap(temp)
- } else {
- temp[type] = []
- setEditUrlMap(temp)
- }
- }
-
- return (
-
- {title || ''}
-
- }
- layout="horizontal"
- {...formItemLayout}
- modalProps={{
- destroyOnClose: true,
- onCancel: () => { },
- }}
- onFinish={async (values) => {
- onFinish && await onFinish(values, editData)
- //message.success('提交成功');
- return true;
- }}
- >
-
-
-
- {
- return { label: s, value: s }
- })}
- name="riskLevel"
- label="风险等级"
- />
-
- {
- return { label: s, value: s }
- })}
- name="specialType"
- label="特种作业类型"
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- vsjunct(params, 'type1')}
- fileTypes={["jpeg", "png", "jpg", "pdf", "doc", "docx"]}
- value={editUrlMap.type1}
- defaultValue={editUrlMap.type1}
- />
-
-
-
- );
-};
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/report/style.less b/web/client/src/sections/safetymanage/components/report/style.less
deleted file mode 100644
index ded0bd2..0000000
--- a/web/client/src/sections/safetymanage/components/report/style.less
+++ /dev/null
@@ -1,6 +0,0 @@
-.task-date{
- .ant-picker-calendar-date-value{
- // width: 40px;
- // height:39px;
- }
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/safetrining-modal.js b/web/client/src/sections/safetymanage/components/safetrining-modal.js
deleted file mode 100644
index 723d92a..0000000
--- a/web/client/src/sections/safetymanage/components/safetrining-modal.js
+++ /dev/null
@@ -1,113 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment';
-import Uploads from '$components/Uploads';
-import { Input, Modal, Form, Button, message, Select, DatePicker } from 'antd';
-import { MinusCircleOutlined, PlusOutlined, } from '@ant-design/icons';
-const SafetriningModal = (props) => {
- const { RangePicker } = DatePicker;
- const { user, onCancel, onSave, editData, type } = props;
- let files = editData?.interlinkage || [];
- const [form] = Form.useForm();
- const [editUrl, setEditUrl] = useState(files);
- const [isView, setIsView] = useState(false)
- //初始化表单数据
- const getinitialValues = () => {
- if (editData) {
- editData.files = 1//编辑时 初始赋个值
- return editData;
- }
- return {}
- };
-
- useEffect(() => {
- if (editData && editData.modalType == 'view') {
- setIsView(true)
- }
- }, [editData]);
-
- const handleOk = () => {
- form.validateFields().then(values => {
- let obj = {
- siteId: user.relateSites[0],
- name: values.name,
- type: values.type,
- path: editUrl,
- time: moment().format('YYYY-MM-DD HH:mm:ss')
- }
-
- console.log(obj, '提交的值')
-
- onSave(obj, editUrl)
- onCancel()
- })
- }
-
- const vsjunct = (params) => {
- if (params.length) {
- let appendix = []
- for (let p of params) {
- appendix.push({
- fName: p.name,
- size: p.size,
- fileSize: p.size,
- storageUrl: p?.storageUrl,//必须有storageUrl
- })
- }
- setEditUrl(appendix)
- } else {
- setEditUrl([])
- }
- }
-
- return (
- onCancel(0)} onOk={handleOk} width={600}>
-
- {isView ? {editData.name} : }
-
-
-
- {isView ? {editData.type} : }
-
-
- {isView ? {(editData.interlinkage || [])[0]?.fName || ''} : }
-
-
- 文件格式:.doc,.docx,.xls,.xlsx,.pdf,.pptx,.mp4,文件必须小于500MB
-
-
-
- )
-}
-function mapStateToProps(state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- }
-}
-
-export default connect(mapStateToProps)(SafetriningModal);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/style.less b/web/client/src/sections/safetymanage/components/style.less
deleted file mode 100644
index 9792f0d..0000000
--- a/web/client/src/sections/safetymanage/components/style.less
+++ /dev/null
@@ -1,17 +0,0 @@
-.export-list-container {
- text-align: right;
-
- ._title {
- text-align: left;
- font-size: 18px;
- font-weight: bold;
- padding-left: 10px;
- }
-
- .ant-row {
- display: flex;
- flex-flow: row wrap;
- min-width: 0;
- margin-top: 10px;
- }
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/components/task-model.js b/web/client/src/sections/safetymanage/components/task-model.js
deleted file mode 100644
index c73baff..0000000
--- a/web/client/src/sections/safetymanage/components/task-model.js
+++ /dev/null
@@ -1,97 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment';
-import Uploads from '$components/Uploads';
-import { Input, Modal, Form, Button, message, Select ,DatePicker,Timeline} from 'antd';
-import { MinusCircleOutlined, PlusOutlined, } from '@ant-design/icons';
-const ProductEditModal = (props) => {
-
- const { TextArea } = Input;
- const { user, onCancel, onSave, editData, type,nowdata } = props;
- let files = editData?.projectDisclosureFiles?.map(p => {
- return { fName: p.fileName, size: p.fileSize, fileSize: p.fileSize, storageUrl: p.fileLink }
- })
- // const [dd,setdd] = useState('次/天')
- const [form] = Form.useForm();
- const [startTime, setStartTime] = useState();
- const [endTime, setEndTime] = useState();
- const [editUrl, setEditUrl] = useState(files);
- let logdata = editData?.logcontent?.filter(i=>moment(i.edittime).format('YYYY-MM-DD')===moment(nowdata).format('YYYY-MM-DD'))||[]
- console.log(editData,'查看详情')
- console.log(logdata,'logdata')
- useEffect(() => {
- // setdd('你好')
- }, []);
-
- const handleOk = () => {
- form.validateFields().then(values => {
- // let obj = {
- // // siteId: 1,//todo
- // inspectiontaskname: values.inspectiontaskname,
- // inspectionnum: values.inspectionnum || "1",
- // taskperiod:taskperiod,
- // checkContent:values.checkContent,
- // insectionuser:values.insectionuser,
- // starTime:startTime,
- // endTime:endTime,
- // contentList: [],
- // path:editUrl
- // }
- let obj ={id:editData.id,content:values.content,logcontent:editData.logcontent?[{...values,subtime:moment().format('YYYY-MM-DD')},...editData.logcontent]:[{...values,subtime:moment().format('YYYY-MM-DD')}]}
- console.log(editData,'edit')
- // console.log(obj,'提交的值')
-
- onSave(obj, editUrl)
- onCancel()
- })
- }
-
-
-
- return (
- onCancel(0)} onOk={handleOk}>
-
-
-
- {logdata.map((i,n)=>{
- return
-
-
巡检记录
-
巡检点:{editData.content}
-
提交人员:{editData.insectionuser}
-
提交时间:{i.subtime}
-
巡查描述:{i.description}
-
巡查视频记录:{i.files?.map(item=>)}
-
其他附件
-
-
- })}
-
-
-
-
-
- )
-}
-function mapStateToProps(state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- }
-}
-
-export default connect(mapStateToProps)(ProductEditModal);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/containers/example.js b/web/client/src/sections/safetymanage/containers/example.js
deleted file mode 100644
index 483cb1d..0000000
--- a/web/client/src/sections/safetymanage/containers/example.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React, { useEffect } from 'react';
-import { connect } from 'react-redux';
-import { Spin, Card } from 'antd';
-import '../style.less';
-import ProTable, { TableDropdown } from '@ant-design/pro-table';
-
-const Example = (props) => {
- const { dispatch, actions, user, loading } = props
-
- useEffect(() => {
- dispatch(actions.example.getMembers(user.orgId))
- }, [])
-
- return (
-
-
-
-
-
-
- )
-}
-
-function mapStateToProps(state) {
- const { auth, global, members } = state;
- return {
- loading: members.isRequesting,
- user: auth.user,
- actions: global.actions,
- members: members.data
- };
-}
-
-export default connect(mapStateToProps)(Example);
diff --git a/web/client/src/sections/safetymanage/containers/hiddenrectification.js b/web/client/src/sections/safetymanage/containers/hiddenrectification.js
deleted file mode 100644
index c860d27..0000000
--- a/web/client/src/sections/safetymanage/containers/hiddenrectification.js
+++ /dev/null
@@ -1,250 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment'
-import { Select, Input, Button, Table, Tooltip, Alert, Popconfirm } from 'antd';
-import HideDangerModal from '../components/hide-danger-modal'
-
-const Hiddenrectification = (props) => {
- const { dispatch, actions, user } = props
- const { safetymanage } = actions;
- const [level, setLevel] = useState(null);//严重性
- const [status, setStatus] = useState(null);//状态
- const [keyword, setKeyword] = useState('');//关键字
- const [limits, setLimits] = useState()//每页实际条数
- const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [tableData, setTableData] = useState([]);
- const [editModalV, setEditModalV] = useState(false);
- const [editData, setEditData] = useState(null);
- const definitiveRef = useRef();
- useEffect(() => {
- getData();
- }, []);
-
- function getData(param) {
- let queryParam = param || query;
- dispatch(safetymanage.getRectifyList({
- level, status, keyword, ...queryParam,
- })).then(r => {
- if (r.success) {
- setTableData(r.payload.data.rows);
- setLimits(r.payload.data.count);
- }
- })
- }
-
- // const resetQuery = () => {
- // setQuery({ limit: 10, page: 0 })
- // getData({ limit: 10, page: 0 })
- // }
- let columns = [{
- title: '序号',
- dataIndex: 'id',
- key: 'id',
- render: (text, record, index) => index + 1,
- width: '5%'
- }, {
- title: '整改任务名称',
- dataIndex: 'name',
- key: 'name',
- width: '15%'
- }, {
- title: '责任区域',
- dataIndex: 'places',
- key: 'places',
- width: '15%'
- }, {
- title: '问题类型',
- dataIndex: 'type',
- key: 'type',
- width: '14%'
- }, {
- title: '严重性',
- dataIndex: 'level',
- key: 'level',
- width: '7%'
- }, {
- title: '处理状态',
- dataIndex: 'status',
- key: 'status',
- width: '15%',
- render: (text, record) => {
- let sts = record.hideDangerRectifySites[0]?.status
- if (sts == 0 || sts == 3 || sts == 4) {//待整改
- return
- } else if (sts == 1) {//待审核
- return
- } else if (sts == 2) {//待复审
- return
- } else if (sts == 5) {//完成
- return
- }
- }
- }, {
- title: '整改期限',
- dataIndex: 'deadline',
- key: 'deadline',
- width: '10%',
- render: (text, record, index) => {moment(text).format('YYYY-MM-DD HH:mm:ss')}
- }, {
- title: '完成时间',
- dataIndex: 'complete',
- key: 'complete',
- width: '10%',
- render: (text, record) => {
- let sts = record.hideDangerRectifySites[0]?.status
- let lastDisposeTime = record.hideDangerRectifySites[0]?.lastDisposeTime
- return {lastDisposeTime && sts == 5 ? moment(lastDisposeTime).format('YYYY-MM-DD HH:mm:ss') : '-'}
- }
- }, {
- title: '操作',
- dataIndex: 'action',
- key: 'action',
- width: '9%',
- render: (text, record) => {
- return
- {
- user.id === record.user || user.isSuper ?//创建者&超管 有编辑和删除权限
-
- onEdit(record)}>编辑
- confirmDelete(record.id)} style={{ width: 330 }}
- > 删除
-
- :
-
-
- 编辑
-
-
- 删除
-
-
- }
-
- }
- }]
-
- const onEdit = (data) => {
- setEditModalV(true)
- setEditData(data)
- }
- const confirmDelete = (id) => {
- dispatch(safetymanage.delRectify(id)).then(res => {
- if (res.success) {
- getData()
- }
- });
- }
-
- const onSave = (obj) => {
- if (editData) {//编辑
- dispatch(safetymanage.editRectify(editData.id, obj)).then(res => {
- if (res.success) {
- getData()
- }
- });
- } else {
- dispatch(safetymanage.addRectify(obj)).then(res => {
- if (res.success) {
- getData()
- }
- });
- }
- }
-
- return (
-
-
-
-
严重性:
-
-
-
当前状态:
-
-
-
setKeyword(e.target.value)} />
-
-
-
-
-
-
-
{
- return {`共${Math.ceil(total / limits)}页,${total}项`}
- },
- onChange: (page, pageSize) => {
- definitiveRef.current.focus();
- setLimits(pageSize)
- setQuery({ limit: pageSize, page: page - 1 });
- getData({ limit: pageSize, page: page - 1 });
- }
- }}
- />
-
-
- {
- editModalV ? setEditModalV(false)}
- editData={editData} enterance={'isXiangmu'} /> : ''
- }
- )
-}
-
-
-function mapStateToProps(state) {
- const { auth, global } = state;
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(Hiddenrectification)
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/containers/hiddenrectificationApproval.js b/web/client/src/sections/safetymanage/containers/hiddenrectificationApproval.js
deleted file mode 100644
index 5990beb..0000000
--- a/web/client/src/sections/safetymanage/containers/hiddenrectificationApproval.js
+++ /dev/null
@@ -1,263 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment'
-import { Select, Input, Button, Table, message, DatePicker, Popconfirm } from 'antd';
-import HideDangerApprovalModal from '../components/hide-danger-approval-modal';
-import HideDangerApprovalReport from '../components/hide-danger-approval-report'
-
-const { RangePicker } = DatePicker;
-
-const HiddenrectificationApproval = (props) => {
- const { dispatch, actions, user, location } = props
- const { safetymanage } = actions;
- const [status, setStatus] = useState(null);//状态
- const [keyword, setKeyword] = useState('');
- const [disposeTimeRange, setDisposeTimeRange] = useState(['', ''])
- const [limits, setLimits] = useState()//每页实际条数
- const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [tableData, setTableData] = useState([]);
- const [editModalV, setEditModalV] = useState(false);
- const [editData, setEditData] = useState(null);
- const [isRisk] = useState(location.pathname.includes('risk'))
- const [reportV, setReportV] = useState(false)
- const definitiveRef = useRef();
-
- useEffect(() => {
- getData();
- }, []);
-
- function getData (param) {
- let queryParam = param || query;
- dispatch(safetymanage.getRectifyList({
- disposeTimeRange, keyword, status, ...queryParam,
- siteList: location.pathname.includes('risk') ? 'true' : '',
- })).then(r => {
- if (r.success) {
- setTableData(r.payload.data.rows);
- setLimits(r.payload.data.count);
- }
- })
- }
-
- const onEdit = (data) => {
- setEditModalV(true)
- setEditData(data)
- }
-
- return (
-
-
-
-
-
- 审批状态
-
-
-
- 提交时间
-
-
{
- setDisposeTimeRange(dateStrings)
- }}
- />
-
- 名称搜索
-
- setKeyword(e.target.value)}
- />
-
- {
- isRisk ?
- : ''
- }
-
-
-
-
{
- let columns = [
- {
- title: '序号',
- dataIndex: 'id',
- key: 'id',
- render: (text, record, index) => index + 1
- }
- ]
- if (location.pathname.includes('risk')) {
- columns = columns.concat([
- {
- title: '工程项目名称',
- dataIndex: 'projectName',
- key: 'projectName',
- render: (t, r) => {
- return r.hideDangerRectifySites && r.hideDangerRectifySites.length ? r.hideDangerRectifySites[0].site.name : ''
- }
- },
- {
- title: '整改任务名称',
- dataIndex: 'name',
- key: 'name',
- },
- ])
- } else {
- columns = columns.concat([
- {
- title: '整改任务名称',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '责任区域',
- dataIndex: 'places',
- key: 'places',
- }, {
- title: '问题类型',
- dataIndex: 'type',
- key: 'type',
- }, {
- title: '严重性',
- dataIndex: 'level',
- key: 'level',
- },
- ])
- }
- columns = columns.concat([
- {
- title: '整改提交时间',
- dataIndex: 'lastDisposeTime',
- key: 'lastDisposeTime',
- render: (text, record) => {
- let lastDisposeTime = record.hideDangerRectifySites[0]?.lastDisposeTime
- return lastDisposeTime ? moment(lastDisposeTime).format('YYYY-MM-DD HH:mm:ss') : '-'
- }
- }, {
- title: '审批状态',
- dataIndex: 'status',
- key: 'status',
- render: (text, record) => {
- let sts = record.hideDangerRectifySites[0]?.status
- if (sts == 0) {
- return 待整改
- } else if (sts == 1) {
- return 待审批
- } else if (sts == 2) {
- return 待复审
- } else if (sts == 3 || sts == 4) {
- return 审批驳回
- } else if (sts == 5) {
- return 审批通过
- }
- }
- }, {
- title: '操作',
- dataIndex: 'action',
- key: 'action',
- render: (text, record) => {
- let sts = record.hideDangerRectifySites[0]?.status
- if (sts == 0 || sts == 3 || sts == 4) {
- return {
- onEdit({ dispose: '整改', ...record })
- }}>执行整改
- } else if (sts == 1 || sts == 2) {
- return {
- onEdit({ dispose: sts == 1 ? '审批' : '复审', ...record })
- }}>执行审批
- } else {
- return {
- onEdit({ dispose: '查看', ...record })
- }}>查看详情
- }
- }
- }
- ])
- return columns
- })()
- }
- dataSource={tableData}
- pagination={{
- current: query.page + 1,
- total: limits,
- showSizeChanger: true,
- showQuickJumper: true,
- showTotal: (total) => {
- return {`共${Math.ceil(total / limits)}页,${total}项`}
- },
- onChange: (page, pageSize) => {
- definitiveRef.current.focus();
- setQuery({ limit: pageSize, page: page - 1 });
- getData({ limit: pageSize, page: page - 1 });
- }
- }}
- />
-
-
- {
- editModalV ?
- {
- setEditModalV(false)
- if (refresh) {
- getData()
- }
- }}
- editData={editData}
- /> : ''
- }
- {
- reportV ?
- {
- setReportV(false)
- }}
- /> : ''
- }
-
- )
-}
-
-function mapStateToProps (state) {
- const { auth, global } = state;
-
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(HiddenrectificationApproval);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/containers/index.js b/web/client/src/sections/safetymanage/containers/index.js
deleted file mode 100644
index 158cb3a..0000000
--- a/web/client/src/sections/safetymanage/containers/index.js
+++ /dev/null
@@ -1,8 +0,0 @@
-'use strict';
-
-import Safetrining from './safetrining';
-import Safeinspection from './safeinspection'
-import Hiddenrectification from './hiddenrectification';
-import HiddenrectificationApproval from './hiddenrectificationApproval'
-import Taskdetail from './taskdetail';
-export { Safetrining, Safeinspection, Hiddenrectification, HiddenrectificationApproval ,Taskdetail};
diff --git a/web/client/src/sections/safetymanage/containers/safeinspection.js b/web/client/src/sections/safetymanage/containers/safeinspection.js
deleted file mode 100644
index 9e67821..0000000
--- a/web/client/src/sections/safetymanage/containers/safeinspection.js
+++ /dev/null
@@ -1,266 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment'
-import { Select, Input, Button, Table, message, Alert, Popconfirm,Tooltip } from 'antd';
-import DisclosureModal from '../components/disclosure-modal'
-
-const ProjectDisclosure = (props) => {
- const { dispatch, actions, user } = props
- const { safetymanage } = actions;
- const [siteNameKeyword, setSiteNameKeyword] = useState('');//搜索工地
- const [descKeyword, setDescKeyword] = useState('');//搜索工程交底
- const [limits, setLimits] = useState()//每页实际条数
- const [query, setQuery] = useState({ limit: 10, page: 1 }); //页码信息
- const [tableData, setTableData] = useState([]);
- const [editModalV, setEditModalV] = useState(false);
- const [editData, setEditData] = useState(null);
- const [status,setstatus] = useState('全部')
- const definitiveRef = useRef();
- useEffect(() => {
- // dispatch(safetymanage.editProjectDisclosure())
- getData();
- }, []);
-
- function getData(param) {
- // let queryParam = param || query;
- dispatch(safetymanage.getProjectDisclosureList(param)).then(r => {
- if (r.success) {
- console.log(r.payload.data.rows,'总的数据')
-
-
- let lin= r.payload.data.rows.map(i=>{
- // console.log(moment().week(),'天数')
- // if(parseInt(moment(i.endTime).format('YYYYMMDD'))j.logcontent?.filter(k=>{
- return parseInt(moment(k.edittime).format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))&&
- parseInt(moment(k.edittime).format('YYYYMMDD'))>=parseInt(moment(i.starTime).format('YYYYMMDD'))}))}
- }).map(n=>{
- // console.log(moment.duration(moment(n.endTime).diff(n.starTime)).days()+1,'天数')
- if(n.taskperiod==='次/天'){
-
- return {id:n.id,status:n.status==='已关闭'?'已关闭':n?.num?.flat(2).filter(k=>k!==undefined).length>=parseInt(n.inspectionnum)*n.contentList.length*(moment.duration(moment(n.endTime).diff(n.starTime)).days()+1)?'已完成':'进行中'}
- }
- if(n.taskperiod==='次/周'){
-
- // return n?.num?.flat(2)>=parseInt(n.inspectionnum)*n.contentList.length*(moment(n.endTime).week()-moment(n.starTime).week())
- return {id:n.id,status:n.status==='已关闭'?'已关闭':n?.num?.flat(2).filter(k=>k!==undefined).length>=parseInt(n.inspectionnum)*n.contentList.length*(moment.duration(moment(n.endTime).diff(n.starTime)).weeks()+1)?'已完成':'进行中'}
- }
- if(n.taskperiod==='次/月'){
- console.log(parseInt(n.inspectionnum)*n.contentList.length*(moment.duration(moment(n.endTime).diff(n.starTime)).months()),'n1')
- // return n?.num?.flat(2)>=parseInt(n.inspectionnum)*n.contentList.length*(moment(n.endTime).month()-moment(n.starTime).month())
- return {id:n.id,status:n.status==='已关闭'?'已关闭':n?.num?.flat(2).filter(k=>k!==undefined).length>=parseInt(n.inspectionnum)*n.contentList.length*(moment.duration(moment(n.endTime).diff(n.starTime)).months()+1)?'已完成':'进行中'}
- }
- // return n.num.flat(2).length
- // console.log(n,'n')
-
- })
-
-// let lin= r.payload.data.rows.map(i=>{
-// // console.log(moment().week(),'天数')
-// // if(parseInt(moment(i.endTime).format('YYYYMMDD'))j.logcontent?.filter(k=>{
-// return parseInt(moment(k.edittime).format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))&&
-// parseInt(moment(k.edittime).format('YYYYMMDD'))>=parseInt(moment(i.starTime).format('YYYYMMDD'))})).every(n=>{
-// if(i.taskperiod==='次/天'){
-// console.log(n,'n1')
-// return n?.length>=parseInt(i.inspectionnum)*i.contentList.length*moment.duration(moment(i.endTime).diff(i.starTime)).days()
-// }
-// if(i.taskperiod==='次/周'){
-
-// return n?.length>=parseInt(i.inspectionnum)*i.contentList.length*(moment(i.endTime).week()-moment(i.starTime).week())
-// }
-// if(i.taskperiod==='次/月'){
-// return n?.length>=parseInt(i.inspectionnum)*i.contentList.length*(moment(i.endTime).month()-moment(i.starTime).month())
-// }
-// })?'已完成':"进行中"}
-// })
-
- console.log('lin',lin)
- dispatch(safetymanage.editProjectDisclosure(lin)).then(()=>{
- dispatch(safetymanage.getProjectDisclosureList(param)).then(n=>{
- setTableData(n.payload.data.rows);
- setLimits(n.payload.data.count);
- })
- })
-
- }
- })
- }
-
- const resetQuery = () => {
- setQuery({ limit: 10, page: 1 })
- getData({ limit: 10, page: 1 })
- }
- let columns1 = [{
- title: '序号',
- dataIndex: 'id',
- key: 'id',
- render: (text, record, index) => index + 1
- }, {
- title: '巡检任务名称',
- dataIndex: 'inspectiontaskname',
- key: 'inspectiontaskname',
- // render: (text, record, index) => {record?.site?.name}
- }, {
- title: '巡检频次',
- dataIndex: 'inspectionnum',
- key: 'inspectionnum',
- render:(text,record,index) => record.inspectionnum+record.taskperiod
- }, {
- title: '巡检点位',
- dataIndex: 'checkContent',
- key: 'checkContent',
- render:(text, record, index) => {
- // return [...record?.contentList?.map(i=>i.content)].join(',')
- return i.content)].join(',')}>
-
- {[...record?.contentList?.map(i=>i.content)].join(',')}
-
- }
-
- }, {
- title: '巡检人员',
- dataIndex: 'insectionuser',
- key: 'insectionuser',
- // render: (text, record, index) => {record?.user?.displayName}
- }, {
- title: '任务状态',
- dataIndex: 'status',
- key: 'status',
- sorter: (a, b) => { },
- // render: (text, record, index) => {moment(text).format('YYYY-MM-DD HH:mm:ss')}
- }, {
- title: '操作',
- dataIndex: 'action',
- key: 'action',
- render: (text, record) => {
- return
-
onEdit(record)}>编辑
-
confirmDelete(record.id)} style={{ width: 330 }}
- > 删除
-
{props.history.push({pathname:'safeinspection/taskdetail',state:record})}}>查看
- {record.status==="已关闭"?
{confirmguanbi(record.id,'启动')}}>启动:
{confirmguanbi(record.id,'关闭')}} style={{ width: 330 }}
- >
- 关闭
- }
-
-
- }
- }]
-
- const onEdit = (data) => {
- setEditModalV(true)
- console.log(data,'数据')
- setEditData(data)
- }
- const confirmDelete = (id) => {
- dispatch(safetymanage.delProjectDisclosure(id)).then(res => {
- if (res.success) {
- resetQuery()
- }
- });
- }
- const confirmguanbi = (id,type) => {
- dispatch(safetymanage.editProjectDisclosure({id:id,status:type==="启动"?"进行中":'已关闭'})).then(res => {
- if (res.success) {
- resetQuery()
- }
- });
- }
- const onSave = (obj, files) => {
- if (editData) {//编辑
- console.log(editData,'编辑的数据')
- dispatch(safetymanage.editProjectDisclosure({ id:editData.id,...obj, files })).then(res => {
- if (res.success) {
- getData()
- return message.success('编辑巡检任务成功')
- }
- });
- } else {
- console.log(obj,'添加的值')
- dispatch(safetymanage.addProjectDisclosure({ data: obj, files })).then(res => {
- if (res.success) {
- resetQuery()
- return
- }
- });
- }
- }
-
- return (
-
-
-
-
分类筛选:
-
-
setSiteNameKeyword(e.target.value)} />
- {/*
setDescKeyword(e.target.value)} /> */}
-
-
-
-
-
-
{
- return {`共${Math.ceil(total / limits)}页,${total}项`}
- },
- onChange: (page, pageSize) => {
- definitiveRef.current.focus();
- setQuery({ limit: pageSize, page: page });
- getData({ limit: pageSize, page: page });
- }
- }}
- />
-
-
- {
- editModalV ? setEditModalV(false)}
- editData={editData} /> : ''
- }
- )
-}
-
-
-function mapStateToProps(state) {
- const { auth, global } = state;
-
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(ProjectDisclosure)
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/containers/safetrining.js b/web/client/src/sections/safetymanage/containers/safetrining.js
deleted file mode 100644
index 0997c8e..0000000
--- a/web/client/src/sections/safetymanage/containers/safetrining.js
+++ /dev/null
@@ -1,234 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment'
-import { Select, Input, Button, Table, message, Modal, Popconfirm } from 'antd';
-import SafetriningModal from '../components/safetrining-modal'
-import { getTring } from '../actions/safetraining'
-const Safetringing = (props) => {
- const { dispatch, actions, user } = props
- const { safetymanage } = actions;
- //const qnDomain = localStorage.getItem('qnDomain');
- const aliAdmin = localStorage.getItem('aliAdmin');
- const [siteNameKeyword, setSiteNameKeyword] = useState('');//搜索资料
- const [descKeyword, setDescKeyword] = useState('');//搜索分类
- const [limits, setLimits] = useState()//每页实际条数
- const [query, setQuery] = useState({ limit: 10, page: 1 }); //页码信息
- const [tableData, setTableData] = useState([]);
- const [editModalV, setEditModalV] = useState(false);
- const [editData, setEditData] = useState(null);
-
- const [videoModalV, setVideoModalV] = useState(false);
- const [videoUrl, setvideoUrl] = useState(null);
-
- const definitiveRef = useRef();
- useEffect(() => {
- getData(query);
- }, []);
-
- function getData(param) {
- // let queryParam = param || query;
- let params = {
- type: descKeyword,
- limit: param.limit,
- name: siteNameKeyword,
- page: param.page,
- }
- const siteId = user?.relateSites?.[0] || -1;
- dispatch(getTring(siteId, params)).then(r => {
- console.log(r)
- if (r.success) {
- // console.log(r,'总的数据')
- setTableData(r.payload.data.rows);
- setLimits(r.payload.data.count);
- }
- })
- }
-
- const resetQuery = () => {
- setQuery({ limit: 10, page: 1 })
- getData({ limit: 10, page: 1 })
- }
-
-
- let columns1 = [{
- title: '序号',
- dataIndex: 'id',
- key: 'id',
- render: (text, record, index) => index + 1,
- width: '4%'
- }, {
- title: '培训资料名称',
- dataIndex: 'name',
- key: 'name',
- // render: (text, record, index) => {record?.site?.name}
- }, {
- title: '分类',
- dataIndex: 'type',
- key: 'type',
- render: (text, record, index) => record.type
- }, {
- title: '类型',
- dataIndex: 'interlinkage',
- key: 'interlinkage',
- render: (text, record, index) => {
- console.log(record, 'record')
- let list = (record?.interlinkage || []).map(item => {
- const num = item.fName.lastIndexOf('.');
- return item.fName.substr(num);
- })
- return list.join(',')
- }
-
- }, {
- title: '更新时间',
- dataIndex: 'time',
- key: 'time',
- // render: (text, record, index) => {record?.user?.displayName}
- }, {
- title: '操作',
- dataIndex: 'action',
- key: 'action',
- render: (text, record) => {
- let url = (record.interlinkage || [])[0]?.storageUrl
- return
-
preview(url)}>预览
-
- {record.interlinkage ? 下载 : ''}
-
-
onEdit(record)}>编辑
-
confirmDelete(record.id)} style={{ width: 330 }}
- > 删除
-
- }
- }]
-
- const preview = (url) => {
- let link = encodeURI(`${aliAdmin}/${url}`)
- if (url.indexOf("pdf") !== -1 || url.indexOf("csv") !== -1) {
- window.open(link)
- } else if (url.indexOf("mp4") !== -1) {
- setVideoModalV(true)
- setvideoUrl(link)
- } else {
- window.open(`https://view.officeapps.live.com/op/view.aspx?src=${link}`)
- }
- }
-
- const onEdit = (data, type) => {
- setEditModalV(true)
- console.log(data, '数据')
- if (type && type == 'view') {
- setEditData({ ...data, modalType: 'view' })
- } else {
- setEditData(data)
- }
- }
- const confirmDelete = (id) => {
- dispatch(safetymanage.deleteTring(id)).then(res => {
- if (res.success) {
- resetQuery()
- }
- });
- }
-
- const onSave = (obj, files) => {
- if (editData) {//编辑
- console.log(editData, '编辑的数据')
- dispatch(safetymanage.modifyTring({ id: editData.id, ...obj, interlinkage: files })).then(res => {
- if (res.success) {
- getData(query)
- }
- });
- } else {
- console.log(obj, '添加的值')
- dispatch(safetymanage.postTring({ ...obj, interlinkage: files, siteId: user?.relateSites?.[0] })).then(res => {
- if (res.success) {
- resetQuery()
- }
- });
- }
- }
-
- return (
-
-
-
-
分类筛选:
-
-
setSiteNameKeyword(e.target.value)} />
-
-
-
-
-
-
{
- return {`共${Math.ceil(total / limits)}页,${total}项`}
- },
- onChange: (page, pageSize) => {
- definitiveRef.current.focus();
- setQuery({ limit: pageSize, page: page });
- getData({ limit: pageSize, page: page });
- }
- }}
- />
-
-
- {
- editModalV ? setEditModalV(false)}
- editData={editData} /> : ''
- }
- {
- videoModalV ?
- setVideoModalV(false)} width={600}
- footer={[]}>
-
-
- : ''
- }
- )
-}
-
-
-function mapStateToProps(state) {
- const { auth, global } = state;
-
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-
-export default connect(mapStateToProps)(Safetringing);
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/containers/style.less b/web/client/src/sections/safetymanage/containers/style.less
deleted file mode 100644
index 0f8df01..0000000
--- a/web/client/src/sections/safetymanage/containers/style.less
+++ /dev/null
@@ -1,152 +0,0 @@
-.date-month {
- display: flex;
- flex-direction: row;
- width: 100%;
- justify-content: space-around;
- margin-bottom: 12px;
-
- .pre-next {
- width: 10%;
- cursor: pointer;
- }
-
- .month-text {
- width: 50%;
- text-align: center;
- font-weight: bold;
- }
-}
-
-.date-month-list {
- height: 44px;
- font-weight: bold;
- background-color: #FFFFFF;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- margin-top: 8px;
- border-radius: 2px;
- text-align: center;
- cursor: pointer;
-
- ._item_pre {
- width: 30%;
- }
-
- ._item_next {
- width: 70%;
-
- }
-}
-
-.date-month-list:hover {
- border: 1px solid #85b0e1;
- box-shadow: 4px 4px 4px #85b0e1;
-}
-
-.date-month-select {
- border: 1px solid #85b0e1;
- box-shadow: 4px 4px 4px #85b0e1;
-}
-
-._risk-normal {
- background-color: #6DD3AB;
-}
-
-._risk-abnormal {
- background-color: #FF7373;
-}
-
-._risk-delay {
- background-color: #FFC9AF;
-}
-
-.risk-report-title {
- display: flex;
- align-items: center;
- flex-direction: row;
- margin-bottom: 20px;
- justify-content: space-between;
-
- ._dot {
- width: 10px;
- height: 10px;
- border-radius: 5px;
- display: inline-block;
- margin-right: 5px;
- }
-}
-
-.taskdetail{
-
- .taskdetail-head{
- box-shadow: 0 0 10px #F0F2F5;
- height: 16.1875rem;
- margin-bottom: 8px;
- padding: 16px 20px 0;
- .taskdetail-top{
- display: flex;
- align-items: center;
- justify-content: space-between;
- h2{
- font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
- font-weight: 700;
- }
- }
- .patrofrequency{
- margin-bottom: 27px;
- span:nth-child(1){
- color: #666666;
- margin-right: 30px;
- }
-
- }
- .taskdetail-head-position{
- display: flex;
- margin-bottom: 27px;
- .taskdetail-head-position-title{
- margin-right: 30px;
- color: #666666;
- }
- .taskdetail-head-position-content{
- width: 84%;
- display: flex;
- flex-wrap: wrap;
- // justify-content: space-around;
- span{
- background-color: rgba(242, 242, 242, 1);
- width: 18%;
- text-align: center;
- height: 26px;
- line-height: 26px;
- margin:0 8px 8px 0;
- }
- }
-
-
- }
- .task-user{
- span:nth-child(1){
- color: #666666;
- margin-right: 30px;
- }
- }
- }
- .taskdetail-body{
- width: 100%;
- display: flex;
- justify-content: space-between;
- .taskdetail-body-left{
- width:28% ;
- box-shadow: 0 0 10px #F0F2F5;
- height: 500px;
- }
- .taskdetail-body-right{
- width: 71%;
- box-shadow: 0 0 10px #F0F2F5;
- height: 500px;
- }
-
- }
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/containers/taskdetail.js b/web/client/src/sections/safetymanage/containers/taskdetail.js
deleted file mode 100644
index 4e1b311..0000000
--- a/web/client/src/sections/safetymanage/containers/taskdetail.js
+++ /dev/null
@@ -1,243 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { connect } from 'react-redux';
-import moment from 'moment'
-import { Select, Input, Button, Table, message, Alert, Popconfirm,} from 'antd';
-import PatrolpoinModel from '../components/patrolpoin-model';
-import DataPicker from '../components/report/data-picker';
-import ProCard from '@ant-design/pro-card';
-import './style.less'
-import TaskModel from '../components/task-model';
-const ProjectDisclosure = (props) => {
- const { dispatch, actions, user,location ,history} = props
- const { safetymanage } = actions;
- const [siteNameKeyword, setSiteNameKeyword] = useState('');//搜索工地
- const [descKeyword, setDescKeyword] = useState('');//搜索工程交底
- const [limits, setLimits] = useState()//每页实际条数
- const [query, setQuery] = useState({ limit: 10, page: 1 }); //页码信息
- const [tableData, setTableData] = useState([]);
- const [editModalV, setEditModalV] = useState(false);
- const [editData, setEditData] = useState(null);
- const [showdetailmodel,setshowdetailmodel] = useState(false)
- const [nowdata,setnowdata] = useState(moment())
- const [dataq,setdataq] = useState()
- const definitiveRef = useRef();
- const data = location.state
- console.log(location.state,'state')
- const checkposition = [...tableData?.map(i=>i?.content)]
- console.log(tableData,'tabledata')
- // console.log(nowdata,'nowdata')
- function getData(param) {
- // let queryParam = param || query;
- dispatch(safetymanage.getProjectDisclosureList(param)).then(r => {
- if (r.success) {
- console.log(r.payload.data.rows[0],'总的数据')
- console.log(data,'对比的数据')
- setdataq(r.payload.data.rows[0])
-
- let t
- if(data.taskperiod==='次/天'){
- t = r.payload.data.rows[0]?.contentList.map((i,n)=>{
- return({inspectionnum:`${i.logcontent?.filter(j=>moment(j?.edittime).format('YYYYMMDD')===nowdata.format('YYYYMMDD'))?.length||0}/${data.inspectionnum}`,time:i.logcontent?.length?moment(i.logcontent[0].subtime).format("YYYY-MM-DD HH:mm:ss"):moment().format('YYYY-MM-DD HH:mm:ss'),...i,insectionuser:data.insectionuser})
- })
-
- }
- else if(data.taskperiod==='次/周'){
- t = r.payload.data.rows[0]?.contentList.map((i,n)=>{
- return({inspectionnum:`${i.logcontent?.filter(j=>moment(j?.edittime).week()===nowdata.week()&&parseInt(moment(nowdata).format('YYYYMMDD'))>=parseInt(moment(j?.edittime).format('YYYYMMDD')))?.length||0}/${data.inspectionnum}`,time:i.logcontent?.length?moment(i.logcontent[0].subtime).format("YYYY-MM-DD HH:mm:ss"):moment().format('YYYY-MM-DD HH:mm:ss'),...i,insectionuser:data.insectionuser})
- })
- }else{
- t = r.payload.data.rows[0]?.contentList.map((i,n)=>{
- return({inspectionnum:`${i.logcontent?.filter(j=>moment(j?.edittime).month()===nowdata.month()&&parseInt(moment(nowdata).format('YYYYMMDD'))>=parseInt(moment(j?.edittime).format('YYYYMMDD')))?.length||0}/${data.inspectionnum}`,time:i.logcontent?.length?moment(i.logcontent[0].subtime).format("YYYY-MM-DD HH:mm:ss"):moment().format('YYYY-MM-DD HH:mm:ss'),...i,insectionuser:data.insectionuser})
- })
- }
- // console.log(logdata,'logodata')
- // dispatch(safetymanage.editProjectDisclosure({ id:data.id,status:data.status==="已关闭"?'已关闭':r.payload.data.rows[0].contentList.map(i=>i.logcontent).every(i=>i.length===parseInt(data.inspectionnum))?'已完成':"进行中"}))
- setTableData(t);
- setLimits(r.payload.data.count);
- }
- })
- }
- useEffect(()=>{
-getData({id:data.id})
-
- },[nowdata])
- const onEdit = (data) => {
- setEditModalV(!editModalV)
- console.log(data,'路由传的数据')
- setEditData(data)
- // setshowdetailmodel(!showdetailmodel)
- }
-
- const onDetail =(data)=>{
- setEditData(data)
-
- setshowdetailmodel(!showdetailmodel)
- }
- console.log(parseInt(moment(data.starTime).format('YYYYMMDD')),'开始')
- const onSave = (obj, files) => {
- if (editData) {//编辑
- console.log(editData,'编辑的数据')
- console.log(obj,'obj')
- // console.log(,'jjj')
- let isok = true
- let contentitem = tableData.map((i,n)=>{
- if(i.id===obj.id){
-
- if(parseInt(editData.inspectionnum.split('/')[0])i.logcontent),'contentitem')
- console.log(parseInt(data.inspectionnum),'数量')
- // console.log(contentitem.map(i=>i.logcontent).every(i=>i.length===parseInt(data.inspectionnum)),'科技')
- // console.log(data.contentList.map((i=>i.logcontent)),'对比')
-
- if(!isok){
- // console.log('执行了')
- return message.warning('已经完成巡检了')
- }
- if(data.status==="已关闭"){
- return message.warning('任务已经关闭了')
- }
- if(parseInt(moment(nowdata).format('YYYYMMDD'))>parseInt(moment().format('YYYYMMDD'))){
- return message.warn('不能提前提交巡检记录')
- }
- if(parseInt(moment(nowdata).format('YYYYMMDD'))parseInt(moment(data.endTime).format('YYYYMMDD'))){
- return message.warn('不能在任务周期外提交记录')
- }
- else{
- dispatch(safetymanage.editProjectDisclosure({ id:data.id,contentList:contentitem,files})).then(res => {
- if (res.success) {
- getData({id:data.id})
- message.success('提交巡检记录成功')
- }
- });
- }
-
-
- }
- }
- // console.log(tableData,'tabeldata')
- useEffect( () => {
- getData({id:data.id})
- // let t =tableData?.contentList?.map((i,n)=>{
- // return({id:i.id,inspectionnum:data.inspectionnum,content:i.content,time:moment().format("YYYY-MM-DD")})
- // })
- // setTableData(t)
- }, []);
- const columns = [{
- title: '序号',
- dataIndex: 'id',
- key: 'id',
- render: (text, record, index) => index + 1
- }, {
- title: '巡检点位',
- dataIndex: 'content',
- key: 'content',
- // render: (text, record, index) => {record?.site?.name}
- }, {
- title: '巡检完成情况',
- dataIndex: 'inspectionnum',
- key: 'inspectionnum',
- // render:(text,record,index) => record.inspectionnum+record.taskperiod
- }, {
- title: '更新时间',
- dataIndex: 'time',
- key: 'time',
- // render:(text, record, index) => {
- // return [record.checkContent,...record?.contentList?.map(i=>i.content)].join(',')
- // }
-
- }, {
- title: '操作',
- dataIndex: 'action',
- key: 'action',
- render: (text, record) => {
- return
- onEdit(record)}>提交巡检记录
- onDetail(record)}>查看详情
- {/* {props.history.push({pathname:'safeinspection/taskdetail',state:record})}}>查看 */}
-
- }
- }]
-
- return (
-
-
-
{data.inspectiontaskname}
-
-
-
- 巡检频次
- {data.inspectionnum+data.taskperiod}
-
-
-
巡检点位
-
- {checkposition.map((i,n)=>n<10?{i}:"")}
-
-
-
- 巡检人员
- {data.insectionuser}
-
-
-
-
-
-
- {setnowdata(v)}}
- />
-
-
-
-
- { editModalV?
setEditModalV(false)}
- editData={editData}
- nowdata={nowdata}/>:""}
- {showdetailmodel? setshowdetailmodel(false)}
- editData={editData}
- nowdata={nowdata}/>:''}
- )
-}
-
-
-function mapStateToProps(state) {
- const { auth, global } = state;
-
- return {
- user: auth.user,
- actions: global.actions,
- };
-}
-
-export default connect(mapStateToProps)(ProjectDisclosure)
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/contants/risk-report.js b/web/client/src/sections/safetymanage/contants/risk-report.js
deleted file mode 100644
index 2de71a1..0000000
--- a/web/client/src/sections/safetymanage/contants/risk-report.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export const RISK_LEVELS = ['I级', 'II级', 'III级'];
-
-export const SPECIAL_WORK_TYPE = ['电工作业'];
-
-export const REGISTER_STATE = ['全部', '登记', '延迟登记'];
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/index.js b/web/client/src/sections/safetymanage/index.js
deleted file mode 100644
index 9d9dbbe..0000000
--- a/web/client/src/sections/safetymanage/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-
-import reducers from './reducers';
-import routes from './routes';
-import actions from './actions';
-import { getNavItem } from './nav-item';
-
-export default {
- key: 'safetymanage',
- name: '安全管理',
- reducers: reducers,
- routes: routes,
- actions: actions,
- getNavItem: getNavItem
-};
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/nav-item.js b/web/client/src/sections/safetymanage/nav-item.js
deleted file mode 100644
index 218a3ce..0000000
--- a/web/client/src/sections/safetymanage/nav-item.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import React from 'react';
-import { Link } from 'react-router-dom';
-import { Menu } from 'antd';
-import { SettingOutlined } from '@ant-design/icons';
-
-const SubMenu = Menu.SubMenu;
-
-export function getNavItem(user, dispatch) {
- const { role } = user
- return (role?.type === 3 ?
- } title={'安全管理'}>
-
- 安全巡检
-
-
- 安全培训
-
-
- 隐患整改
-
-
- 整改审批
-
- : null
- );
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/reducers/index.js b/web/client/src/sections/safetymanage/reducers/index.js
deleted file mode 100644
index 7ed1088..0000000
--- a/web/client/src/sections/safetymanage/reducers/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-export default {
-
-}
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/routes.js b/web/client/src/sections/safetymanage/routes.js
deleted file mode 100644
index 36f5717..0000000
--- a/web/client/src/sections/safetymanage/routes.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-import { Safetrining, Safeinspection, Hiddenrectification, HiddenrectificationApproval ,Taskdetail} from './containers';
-
-export default [{
- type: 'inner',
- route: {
- path: '/safetymanage',
- key: 'safetymanage',
- breadcrumb: '安全管理',
- // 不设置 component 则面包屑禁止跳转
- childRoutes: [{
- path: '/safeinspection',
- key: 'safeinspection',
- component: Safeinspection,
- breadcrumb: '安全巡检',
- childRoutes:[{
- path: '/taskdetail',
- key: 'taskdetail',
- component: Taskdetail,
- breadcrumb: '任务详情',
- }]
- }, {
- path: '/safetraining',
- key: 'safetraining',
- component: Safetrining,
- breadcrumb: '安全培训',
- },
- {
- path: '/hiddenrectification',
- key: 'hiddenrectification',
- component: Hiddenrectification,
- breadcrumb: '隐患整改',
- },
- {
- path: '/hiddenrectification_approval',
- key: 'hiddenrectification_approval',
- component: HiddenrectificationApproval,
- breadcrumb: '整改审批',
- }
- ]
- }
-}];
\ No newline at end of file
diff --git a/web/client/src/sections/safetymanage/style.less b/web/client/src/sections/safetymanage/style.less
deleted file mode 100644
index 3323452..0000000
--- a/web/client/src/sections/safetymanage/style.less
+++ /dev/null
@@ -1,3 +0,0 @@
-#example:hover {
- font-size: larger;
-}
\ No newline at end of file