ww664853070 2 years ago
parent
commit
5e32da90d6
  1. 24
      api/app/lib/controllers/data/appointed.js
  2. 9
      api/app/lib/controllers/data/project.js
  3. 51
      api/app/lib/controllers/organization/department.js
  4. 26
      api/app/lib/controllers/report/index.js
  5. 278
      api/app/lib/models/project.js
  6. 37
      api/app/lib/models/report.js
  7. 3
      api/app/lib/routes/organization/index.js
  8. 2
      api/app/lib/routes/report/index.js
  9. 17
      scripts/1.2.3/schema/2.alter_project.sql
  10. 8
      scripts/1.2.3/schema/2.update_report.sql
  11. 4
      scripts/1.2.3/schema/3.alter_report.sql
  12. 76588
      web/client/assets/js/OlMap/OlMapTool.common.js
  13. 1
      web/client/assets/js/OlMap/OlMapTool.common.js.map
  14. 1
      web/client/assets/js/OlMap/OlMapTool.css
  15. 115
      web/client/assets/js/OlMap/OlMapTool.umd.min.js
  16. 1
      web/client/assets/js/OlMap/OlMapTool.umd.min.js.map
  17. 41
      web/client/index.ejs
  18. 4
      web/client/index.html
  19. 13
      web/client/src/sections/fillion/actions/appointTask.js
  20. 379
      web/client/src/sections/fillion/components/buildingTable.js
  21. 152
      web/client/src/sections/fillion/components/feedback/nominateModal.js
  22. 45
      web/client/src/sections/fillion/components/patrolTable.js
  23. 37
      web/client/src/sections/fillion/components/project/project.js
  24. 59
      web/client/src/sections/fillion/containers/building.js
  25. 13
      web/client/src/sections/fillion/nav-item.js
  26. 6
      web/client/src/sections/fillion/routes.js
  27. 12
      web/client/src/sections/organization/actions/user.js
  28. 35
      web/client/src/sections/organization/containers/authority.js
  29. 30
      web/client/src/sections/organization/containers/user.js
  30. 66
      web/client/src/sections/quanju/containers/example.js
  31. 131
      web/client/src/sections/quanju/containers/public/olMap.js
  32. 4
      web/client/src/utils/index.js
  33. 11
      web/client/src/utils/webapi.js

24
api/app/lib/controllers/data/appointed.js

@ -0,0 +1,24 @@
'use strict';
const moment = require('moment')
async function appoint(ctx) {
try {
const models = ctx.fs.dc.models
const { recordId, performerId } = ctx.request.body
await models.Report.update({
performerId
}, { where: { id: recordId } })
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
module.exports = {
appoint
};

9
api/app/lib/controllers/data/project.js

@ -3,7 +3,7 @@
async function projectGet (ctx) {
try {
const models = ctx.fs.dc.models;
const { type, entryName } = ctx.query;
const { type, entryName, doneState } = ctx.query;
let findOption = {
where: {
@ -19,6 +19,13 @@ async function projectGet (ctx) {
$like: `%${entryName}%`
}
}
if (doneState) {
if (doneState == 'true') {
findOption.where.done = true
} else if (doneState == 'false') {
findOption.where.done = false
}
}
const projectRes = await models.Project.findAll(findOption)

51
api/app/lib/controllers/organization/department.js

@ -185,7 +185,56 @@ async function delDep(ctx) {
}
}
}
async function getDepById(ctx) {
try {
const models = ctx.fs.dc.models;
const { deptId } = ctx.query
console.log('deptId1', deptId)
let depLevel0 = await models.Department.findAll({
order: [['id', 'asc']],
where: {
// id: userInfo.departmentId
delete: false,
id: deptId
},
})
let depRslt = []
const getDep = async (d) => {
let subordinate = []
let depRes = await models.Department.findAll({
order: [['id', 'asc']],
where: {
dependence: d.id,
delete: false,
id: { $ne: 1 }
},
})
if (depRes.length)
for (let d of depRes) {
let dep = d.dataValues
dep.subordinate = await getDep(d.dataValues)
subordinate.push(dep)
}
return subordinate
}
for (let d of depLevel0) {
let dep0 = d.dataValues
dep0.subordinate = await getDep(d.dataValues)
depRslt.push(dep0)
}
ctx.status = 200;
console.log('depRslt', depRslt)
ctx.body = depRslt
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
module.exports = {
getdep, editDep, delDep,
getdep, editDep, delDep, getDepById
};

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

@ -4,7 +4,7 @@ const { QueryTypes } = require('sequelize');
async function reportList (ctx) {
try {
const models = ctx.fs.dc.models;
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType } = ctx.query
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '' } = ctx.query
const { userInfo } = ctx.fs.api
const sequelize = ctx.fs.dc.orm;
@ -14,7 +14,7 @@ async function reportList (ctx) {
&& userInfo.isAdmin
&& userInfo.phone != 'SuperAdmin'
) {
// 是管理员但不是超管 查自己部门及下级部门的所有信息
// 是管理员但不是超管 查自己部门及下级部门的所有用户的信息
const sqlStr = `
WITH RECURSIVE sub_departments AS (
SELECT id, dependence
@ -32,7 +32,6 @@ async function reportList (ctx) {
`
const res = await sequelize.query(sqlStr, { type: QueryTypes.SELECT })
let a = 1
findUsers = res.map(item => {
return item.id
})
@ -86,6 +85,14 @@ async function reportList (ctx) {
if (projectType) {
findOption.where.projectType = projectType
}
if (performerId) {
let performerIds = performerId.split(',')
findOption.where.performerId = { $in: performerIds }
}
if (handleState) {
findOption.where.handleState = handleState
}
let reportRes = null;
if (isTop) {
@ -184,10 +191,15 @@ async function reportHandle (ctx) {
const { reportId } = ctx.params
const { handleState } = ctx.request.body
await models.Report.update({
handleState: handleState
}, {
const data = ctx.request.body
/**
* data = {
* handleState,
* handleContent,
* handlePic
* }
*/
await models.Report.update(data, {
where: {
id: reportId
}

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

@ -1,136 +1,152 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Project = sequelize.define("project", {
id: {
index: 1,
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "project_id_uindex"
},
entryName: {
index: 2,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "项目名称",
primaryKey: false,
field: "entry_name",
autoIncrement: false
},
projectMileage: {
index: 3,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "工程里程",
primaryKey: false,
field: "project_mileage",
autoIncrement: false
},
investment: {
index: 4,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "投资",
primaryKey: false,
field: "investment",
autoIncrement: false
},
buildUnit: {
index: 5,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "建设单位",
primaryKey: false,
field: "build_unit",
autoIncrement: false
},
constructionControlUnit: {
index: 6,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "监理单位",
primaryKey: false,
field: "construction_control_unit",
autoIncrement: false
},
designUnit: {
index: 7,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "设计单位",
primaryKey: false,
field: "design_unit",
autoIncrement: false
},
constructionUnit: {
index: 8,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "施工单位",
primaryKey: false,
field: "construction_unit",
autoIncrement: false
},
supervisorAndSupervisor: {
index: 9,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "监督负责人及监督人员",
primaryKey: false,
field: "supervisor_and_supervisor",
autoIncrement: false
},
projectProgress: {
index: 10,
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "项目进展情况",
primaryKey: false,
field: "project_progress",
autoIncrement: false
},
done: {
index: 11,
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "done",
autoIncrement: false
},
type: {
index: 12,
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "类型 道路:road / 桥梁:bridge",
primaryKey: false,
field: "type",
autoIncrement: false
}
}, {
tableName: "project",
comment: "",
indexes: []
});
dc.models.Project = Project;
return Project;
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Project = sequelize.define("project", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "project_id_uindex"
},
entryName: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "项目名称",
primaryKey: false,
field: "entry_name",
autoIncrement: false
},
projectMileage: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "工程里程",
primaryKey: false,
field: "project_mileage",
autoIncrement: false
},
investment: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "投资",
primaryKey: false,
field: "investment",
autoIncrement: false
},
buildUnit: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "建设单位",
primaryKey: false,
field: "build_unit",
autoIncrement: false
},
constructionControlUnit: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "监理单位",
primaryKey: false,
field: "construction_control_unit",
autoIncrement: false
},
designUnit: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "设计单位",
primaryKey: false,
field: "design_unit",
autoIncrement: false
},
constructionUnit: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "施工单位",
primaryKey: false,
field: "construction_unit",
autoIncrement: false
},
supervisorAndSupervisor: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "监督负责人及监督人员",
primaryKey: false,
field: "supervisor_and_supervisor",
autoIncrement: false
},
projectProgress: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "项目进展情况",
primaryKey: false,
field: "project_progress",
autoIncrement: false
},
done: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "done",
autoIncrement: false
},
type: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "类型 道路:road / 桥梁:bridge",
primaryKey: false,
field: "type",
autoIncrement: false
},
startTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: "开工时间",
primaryKey: false,
field: "start_time",
autoIncrement: false
},
remark: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "备注",
primaryKey: false,
field: "remark",
autoIncrement: false
},
qutityUnit: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "质量检测单位",
primaryKey: false,
field: "qutity_unit",
autoIncrement: false
}
}, {
tableName: "project",
comment: "",
indexes: []
});
dc.models.Project = Project;
return Project;
};

37
api/app/lib/models/report.js

@ -1,4 +1,5 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
@ -186,14 +187,40 @@ module.exports = dc => {
field: "handle_state",
autoIncrement: false
},
codeRoad: {
index: 19,
routeCode: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "route_code",
autoIncrement: false
},
performerId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "执行者",
primaryKey: false,
field: "performer_id",
autoIncrement: false
},
handleContent: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: "",
// comment: "路线代码",
defaultValue: null,
comment: "",
primaryKey: false,
field: "handle_content",
autoIncrement: false
},
handlePic: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "code_road",
field: "handle_pic",
autoIncrement: false
},
}, {

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

@ -8,6 +8,9 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/department'] = { content: '获取部门列表', visible: false };
router.get('/department', Department.getdep);
app.fs.api.logAttr['GET/departmentById'] = { content: '根据id获取部门', visible: false };
router.get('/departmentById', Department.getDepById);
app.fs.api.logAttr['PUT/department'] = { content: '编辑部门信息', visible: false };
router.put('/department', Department.editDep);

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

@ -13,7 +13,7 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/report/:reportId/detail'] = { content: '获取上报详情', visible: false };
router.get('/report/:reportId/detail', report.reportDetail);
app.fs.api.logAttr['GET/report/:reportId/handle'] = { content: '处理上报详情', visible: false };
app.fs.api.logAttr['POST/report/:reportId/handle'] = { content: '处理上报详情', visible: false };
router.post('/report/:reportId/handle', report.reportHandle);
app.fs.api.logAttr['POST/report'] = { content: '创建上报', visible: false };

17
scripts/1.2.3/schema/2.alter_project.sql

@ -0,0 +1,17 @@
alter table project
add start_time timestamp with time zone;
comment on column project.start_time is '开工时间';
alter table project
add remark varchar(300);
comment on column project.remark is '备注';
alter table project
add qutity_unit varchar(1024);
comment on column project.qutity_unit is '质量检测单位';

8
scripts/1.2.3/schema/2.update_report.sql

@ -1,2 +1,6 @@
alter table report
add code_road varchar(512);
ALTER TABLE report add code_road varchar(512);
ALTER TABLE report add handle_content varchar(1024); comment
ON column report.handle_content is '执行内容描述';
ALTER TABLE report add handle_pic varchar(1204) [];

4
scripts/1.2.3/schema/3.alter_report.sql

@ -0,0 +1,4 @@
alter table report
add performer_id integer;
comment on column report.performer_id is '处理人';

76588
web/client/assets/js/OlMap/OlMapTool.common.js

File diff suppressed because one or more lines are too long

1
web/client/assets/js/OlMap/OlMapTool.common.js.map

File diff suppressed because one or more lines are too long

1
web/client/assets/js/OlMap/OlMapTool.css

@ -0,0 +1 @@
.ol-tooltip{position:relative;background:rgba(0,0,0,.6);border-radius:4px;color:#fff;padding:4px 8px;opacity:.7;white-space:nowrap;font-size:12px}.ol-tooltip-measure{opacity:1;font-weight:700}.ol-tooltip-static{background-color:#fc3;color:#000;border:1px solid #fff}.ol-tooltip-measure:before,.ol-tooltip-static:before{border-top:6px solid rgba(0,0,0,.5);border-right:6px solid transparent;border-left:6px solid transparent;content:"";position:absolute;bottom:-6px;margin-left:-7px;left:50%}.ol-tooltip-static:before{border-top-color:#fc3}.ol-popup{position:absolute;filter:drop-shadow(0 1px 4px rgba(0,0,0,.2));padding:15px;border-radius:4px;transform:translate(10px,25px);min-width:200px;text-align:left;background-color:hsla(0,0%,100%,.8)}.ol-popup:after,.ol-popup:before{top:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.ol-popup:after{border-width:10px;left:50%;margin-left:-10px}.ol-popup:before{border-width:11px;left:50%;margin-left:-11px}.ol-popup-closer{text-decoration:none;position:absolute;top:2px;right:8px}.ol-popup-closer:after{content:"x"}.ol-popup-content{font-size:14px}.ol-popup-content-tab td:nth-child(odd){font-weight:700}.contextmenu{position:absolute;padding:3px;width:100px;font-size:12px;border-radius:3px;cursor:pointer;text-align:left}.contextmenu ul li{padding:10px}.contextmenu ul li:last-child{border-bottom:none}.contextmenu ul li span{margin-left:5px}

115
web/client/assets/js/OlMap/OlMapTool.umd.min.js

File diff suppressed because one or more lines are too long

1
web/client/assets/js/OlMap/OlMapTool.umd.min.js.map

File diff suppressed because one or more lines are too long

41
web/client/index.ejs

@ -1,24 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" href="/assets/images/favicon.ico" />
<link rel="stylesheet" href="/assets/fontziti/font.css" />
<link
rel="stylesheet"
type="text/css"
href="/assets/font_sc/iconfont.css"
/>
<link rel="stylesheet" type="text/css" href="/assets/font_sc/iconfont.css" />
<!-- -->
<script src="/assets/js/OlMap/OlMapTool.umd.min.js"></script>
<link rel="stylesheet" href="/assets/js/OlMap/OlMapTool.css">
<!-- -->
<script type="text/javascript">
window._AMapSecurityConfig = {
securityJsCode: 'e955cd5ddfc3a752aa27d1e1c67d182d',
}
</script>
<script src="https://webapi.amap.com/maps?v=2.0&key=00f9a29dedcdbd8befec3dfe0cef5003&plugin=AMap.Adaptor,AMap.Scale,AMap.ToolBar,AMap.DistrictSearch,AMap.Geocoder,AMap.CustomLayer,Map3D,ElasticMarker"></script>
<script src="https://webapi.amap.com/loca?v=2.0.0&key=00f9a29dedcdbd8befec3dfe0cef5003"></script>
</head>
window._AMapSecurityConfig = {
securityJsCode: 'e955cd5ddfc3a752aa27d1e1c67d182d',
}
</script>
<script
src="https://webapi.amap.com/maps?v=2.0&key=00f9a29dedcdbd8befec3dfe0cef5003&plugin=AMap.Adaptor,AMap.Scale,AMap.ToolBar,AMap.DistrictSearch,AMap.Geocoder,AMap.CustomLayer,Map3D,ElasticMarker"></script>
<script src="https://webapi.amap.com/loca?v=2.0.0&key=00f9a29dedcdbd8befec3dfe0cef5003"></script>
</head>
<body style="background: transparent">
<body style="background: transparent">
<!-- <link
rel="stylesheet/less"
type="text/css"
@ -27,12 +29,13 @@
/> -->
<script>
window.less = {
async: false,
env: "production",
};
window.less = {
async: false,
env: "production",
};
</script>
<script type="text/javascript" src="/assets/js/less/less.min.js"></script>
<div id="App"></div>
</body>
</body>
</html>

4
web/client/index.html

@ -7,6 +7,10 @@
<link rel="shortcut icon" href="/assets/images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/assets/font_sc/iconfont.css" />
<link rel="stylesheet" href="/assets/fontziti/font.css" />
<!-- -->
<script src="/assets/js/OlMap/OlMapTool.umd.min.js"></script>
<link rel="stylesheet" href="/assets/js/OlMap/OlMapTool.css">
<!-- -->
<script type="text/javascript">
window._AMapSecurityConfig = {
securityJsCode: 'e955cd5ddfc3a752aa27d1e1c67d182d',

13
web/client/src/sections/fillion/actions/appointTask.js

@ -0,0 +1,13 @@
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function appointTask(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_APPOINT_TASK',
url: ApiTable.appointTask,
msg: { option: '指派任务' },
});
}

379
web/client/src/sections/fillion/components/buildingTable.js

@ -0,0 +1,379 @@
'use strict';
import React, { useState, useEffect, useRef } from 'react';
import { connect } from 'react-redux';
import { Spin, Button, Popconfirm } from 'antd';
import ProTable from '@ant-design/pro-table';
import './protable.less'
import ProjectModal from './project/project';
import { getProject, delProject } from "../actions/infor"
import moment from 'moment';
// import UserModal from './infor/details';
const BuildingTable = (props) => {
const { dispatch, user, depData, depMessage, depLoading } = props
const [rowSelected, setRowSelected] = useState([])
const [sitename, setSitename] = useState()//名称
const [counts, setCounts] = useState()//shuju
const [modalVisible, setModalVisible] = useState(false);
const [modalVisibleyilan, setModalVisibleyilan] = useState(false);
const [modalRecord, setModalRecord] = useState();
const [typecard, setTypecard] = useState();
const [recortd, setRecortd] = useState()
const [whichofits, setWhichofits] = useState('在建项目')
const [delet, setDelet] = useState()
const [differentiate, setDifferentiate] = useState('road')
const [grade, setGrade] = useState('project')
const [departmentInfo, setDepartment] = useState('')
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : '')
const ref = useRef()
const [activeKey, setActiveKey] = useState('tab1');
//打开弹窗
const yilanModal = (type, record) => {
setModalVisibleyilan(true);
// setModalType(type);
if (type == 'edit') {
setModalRecord(record);
} else {
setModalRecord(null);
}
}
const getData = async () => {
const res = await dispatch(getProject({
entryName: sitename
}));
setCounts(res.payload.data)
}
const deldatas = async (id) => { // 工程
const query = {
projectId: id
}
dispatch(delProject(query)).then((res) => {
setDelet(res)
})
const res = await dispatch(getProject({
entryName: sitename
}));
setCounts(res.payload.data)
}
const columns = {
tab1: [
{
title: '项目名称',
dataIndex: 'placeName',
fixed: 'left',
width: 120,
options: 1,
backgroundColor: "#ffffff",
fieldProps: {
onChange: (value, cs) => {
setSitename(value.currentTarget.value)
},
placeholder: '请输入项目名称进行搜索',
getPopupContainer: (triggerNode) => triggerNode.parentNode,
},
render: (dom, record) => {
return record.entryName
},
},
{
title: '项目规模(公里)',
search: false,
dataIndex: 'containers',
fixed: 'left',
width: 120,
render: (dom, record) => {
return record.projectMileage
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '项目投资(万元)',
search: false,
dataIndex: 'time2',
valueType: 'dateRange',
// align: 'right',
width: 120,
render: (dom, record) => {
return record.investment
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '业主单位',
search: false,
dataIndex: 'time3',
valueType: 'dateRange',
width: 120,
render: (dom, record) => {
return record.buildUnit
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '质量监督单位',
search: false,
dataIndex: 'time3',
valueType: 'dateRange',
width: 120,
render: (dom, record) => {
return record.qutityUnit
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
}, {
title: '施工单位',
search: false,
dataIndex: 'time6',
valueType: 'dateRange',
width: 120,
render: (dom, record) => {
return record.constructionUnit
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
}, {
title: '设计单位',
search: false,
dataIndex: 'time5',
valueType: 'dateRange',
width: 120,
render: (dom, record) => {
return record.designUnit
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
}, {
title: '监理单位',
search: false,
dataIndex: 'time4',
valueType: 'dateRange',
width: 120,
render: (dom, record) => {
return record.constructionControlUnit
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '开工时间',
search: false,
dataIndex: 'time7',
valueType: 'dateRange',
width: 120,
render: (dom, record) => {
return record.startTime ? moment(record.startTime).format('YYYY-MM-DD') : ''
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '是否完成',
search: false,
dataIndex: 'time8',
valueType: 'dateRange',
width: 120,
render: (dom, record) => {
return record.done === true ? '已完成' : '未完成'
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '备注',
search: false,
dataIndex: 'time9',
valueType: 'dateRange',
width: 120,
render: (dom, record) => {
return record.remark
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '操作',
dataIndex: 'creatTime',
valueType: 'dateTimeRange',
hideInSearch: true,
width: 160,
fixed: 'right',
render: (dom, record) => {
return <div><Button type="link"
onClick={() => {
yilanModal('edit', record)
setTypecard('compile')
setRecortd(record)
}}
disabled={editAble}
>编辑</Button><Popconfirm title='' onConfirm={() => { deldatas(record.id) }} disabled={editAble}>
<Button type="link" disabled={editAble}>删除</Button>
</Popconfirm></div>
}
},
{
key: "direction",
hideInTable: true,
dataIndex: "direction",
order: 6,
renderFormItem: (item, { type, defaultRender, ...rest }, form, record) => {
return (
<div> <Button
type="primary"
style={{ width: "100px" }}
onClick={() => {
yilanModal('edit', record)
setTypecard('')
}}
disabled={editAble}
>
新增
</Button>
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button> */}
</div>
);
},
},
]
}
return (
<Spin spinning={false}>
<div className='protable-transpor'>
<ProTable
actionRef={ref}
toolbar={{
multipleLine: true,
menu: {
activeKey,
onChange: (key) => setActiveKey(key),
items: [
{
key: 'tab1',
label: <span onClick={() => {
setWhichofits('在建项目')
setDifferentiate('project')
setGrade('在建项目')
}}>在建项目{activeKey === 'tab1'}</span>,
},
],
},
}}
scroll={{ x: 800 }}
options={false}
ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id'
onReset={(v) => {
setSitename('')
}}
rowSelection={{
selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys);
},
}}
columns={columns[activeKey]}
dataSource={counts || []}
request={async (params) => {
console.log(whichofits)
if (whichofits == '在建项目') {
const query = {
entryName: sitename
}
setRowSelected([]);
const res = await dispatch(getProject(query));
setCounts(res.payload.data)
return {
...res,
total: res.payload.data ? res.payload.data.count : 0
}
}
}}
search={{
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, grade, differentiate) }}
disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : ''}
>
<Button
disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : ''}
>
导出
</Button>
</Popconfirm>
],
}}
>
</ProTable>
</div>
{modalVisibleyilan ? <ProjectModal
visible={modalVisibleyilan}
onVisibleChange={setModalVisibleyilan}
modalRecord={modalRecord}
typecard={typecard}
getData={getData}
rewkeys={'road'}
recortd={recortd}
setRecortd={setRecortd}
setDelet={setDelet}
/> : ''}
</Spin >
)
}
function mapStateToProps(state) {
const { auth, depMessage } = state;
const pakData = (dep) => {
return dep.map((d) => {
return {
title: d.name,
value: d.id,
// children: d.type >= 2 ? [] : pakData(d.subordinate)
children: pakData(d.subordinate)
}
})
}
let depData = pakData(depMessage.data || [])
return {
user: auth.user,
depMessage: depMessage.data || [],
depLoading: depMessage.isRequesting,
depData,
};
}
export default connect(mapStateToProps)(BuildingTable);

152
web/client/src/sections/fillion/components/feedback/nominateModal.js

@ -0,0 +1,152 @@
'use strict';
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { connect } from 'react-redux';
import { Spin } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect, ProFormSelect } from '@ant-design/pro-form';
import { getDepUser } from '../../../organization/actions/user'
import { appointTask } from '../../actions/appointTask'
import moment from 'moment';
const NominateModal = (props) => {
const { recordId, visible, user, onCancel, depMessage, loading, depUser, clientHeight, depData, onVisibleChange, dispatch } = props
const [depId, setDepId] = useState(null)
const [depUsers, setDepUsers] = useState()
const selectRef = useRef(null);
const handleTreeSelectChange = async (value) => {
console.log('recordId', recordId)
setDepId(value)
// 根据选择的部门ID获取对应的用户数据
setDepUsers(null)
const res = await dispatch(getDepUser(value));
setDepUsers(res?.payload.data);
// 清空第二个输入框的值
if (selectRef.current) {
selectRef.current.value = '';
}
}
const handleFinish = async (values) => {
const { name } = values;
// 在这里使用第二个框的值进行网络请求或其他操作
// await dispatch(yourAction(name));
// 其他操作...
// 取消弹窗
onCancel();
};
const dispatchGetDepUser = useCallback(async () => {
if (depId) {
const res = await dispatch(getDepUser(depId));
setDepUsers(res?.payload.data);
}
}, [depId, dispatch]);
useEffect(() => {
dispatchGetDepUser()
}, [dispatchGetDepUser])
const [depMessagedata, setdepMessagedata] = useState(depMessage)
return (
<Spin spinning={false}>
<ModalForm
title='指派'
visible={visible}
onVisibleChange={onVisibleChange}
onFinish={handleFinish}
destroyOnClose
>
<ProForm.Group>
<ProFormTreeSelect
name={['contract', 'departmentId']}
placeholder="请选择所属部门"
width="md"
label="所属部门"
required
fieldNames={{
title: 'name',
key: 'id',
children: 'subordinate'
}}
onSelect={(selectedKeys, { selected, selectedNodes }) => {
console.log('selected', selectedKeys)
if (selected) {
setDepSelectedKeys(selectedKeys)
setDepSelected(selectedNodes[0].name || "")
dispatch(getDepUser(selectedKeys[0]))
}
}}
fieldProps={{
onChange: handleTreeSelectChange,
fieldNames: {
label: 'title',
},
treeDefaultExpandAll: false,
}}
rules={[{ required: true, message: '请选择所属部门' }]}
request={async () => {
return depData
}}
expandedKeys={["title"]}
/>
{depUsers ? <ProFormSelect
ref={selectRef}
value={null} // 设置输入框的值为null
onValuesChange={(values) => { console.log('values1', values) }}
name="name"
label="指派人"
request={async () => {
if (depId) {
const res = await dispatch(getDepUser(depId));
const processedUsers = res?.payload.data.map((user) => ({
label: user.name, // 使用用户的名字作为选项的显示文本
value: user.id, // 使用用户的id作为选项的值
}));
return Promise.resolve(processedUsers)
}
}}
placeholder="请选择指派人"
rules={[{ required: true, message: '请选择指派人' }]}
/> : ''}
</ProForm.Group>
</ModalForm>
</Spin>
)
}
function mapStateToProps(state) {
const { auth, depMessage, depUser, global } = 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,
// };
return {
user: auth.user,
clientHeight: global.clientHeight,
loading: depMessage.isRequesting,
//depMessage: depMessage.data || [],
depUser: depUser.data || [],
depData
}
}
export default connect(mapStateToProps)(NominateModal);

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

@ -9,6 +9,7 @@ import { getAllDepUsers } from '../actions/allDepUsers'
import { httpDel } from '@peace/utils'
import { PinyinHelper } from '@peace/utils';
import PatrolGis from './gis/patrolGis';
import NominateModal from '../components/feedback/nominateModal' //指派的模块
// @ts-ignore
import styles from './protable.less';
import moment from 'moment';
@ -118,10 +119,15 @@ const DetailList = (props) => {
const [selectRecord, setSelectRecord] = useState();
const [noProcessingPopVisible, setNoProcessingPopVisible] = useState(false);
const [noProcessingSelectRecord, setNoProcessingSelectRecord] = useState();
const [vis, setVis] = useState(false)//指派任务的弹窗显示与隐藏
const [recordId, setRecordId] = useState(0)//默认指派任务id
const checkDetail = (record) => {
dispatch(getReportDetail(record.id))
}
//modal取消的事件
const onCancel = () => {
setVis(false)
}
const handleRemove = (record) => {
let url = 'report/{reportId}';
const actionType = "DEL_REPORT_RECORD";
@ -140,7 +146,8 @@ const DetailList = (props) => {
}
let basicDate = null;
let counter = 0;
//指派任务
console.log('vis', vis)
const columns = [
isPatrol ? {
title: '编号',
@ -242,7 +249,8 @@ const DetailList = (props) => {
<Button
onClick={() => { checkDetail(record); handleOpen(); }}
style={{ marginRight: 10 }}>查看</Button>,
isAnomaly && record.handleState != '已处理' ? <Button disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE' || 'FEEDBACKMANAGE')[0].isshow === "true" ? true : ''}>指派</Button> : null,
isAnomaly && record.handleState != '已处理' ?
<Button disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE' || 'FEEDBACKMANAGE')[0].isshow === "true" ? true : ''} onClick={() => { setVis(true); setRecordId(record.id) }}>指派</Button> : null,
isAnomaly && record.handleState != '已处理' ?
<Popover
content={[
@ -285,20 +293,23 @@ const DetailList = (props) => {
},
].filter(s => s);
return (
<ProTable
columns={columns}
dataSource={reportList}
loading={loading}
pagination={{
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,
}}
rowKey="key"
toolBarRender={false}
search={false}
/>
);
<div>
<ProTable
columns={columns}
dataSource={reportList}
loading={loading}
pagination={{
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,
}}
rowKey="key"
toolBarRender={false}
search={false}
/>
<NominateModal recordId={recordId} dispatch={dispatch} visible={vis} onCancel={onCancel} onVisibleChange={setVis}></NominateModal>
</div>
)
};

37
web/client/src/sections/fillion/components/project/project.js

@ -1,23 +1,25 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Form, Spin, Table } from 'antd';
import { DrawerForm, ProForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
import { DrawerForm, ProForm, ProFormText, ProFormSelect, ProFormDatePicker, ProFormTextArea } from '@ant-design/pro-form';
import { putProject } from "../../actions/infor"
import _ from 'lodash'
const data = {
"entryName": "项目名称",
"projectMileage": "工程里程",
"investment": "投资",
"buildUnit": "建设单位",
"constructionControlUnit": "监理单位",
"designUnit": "设计单位",
"projectMileage": "项目规模(公里)",
"investment": " 项目投资(万元)",
"buildUnit": "业主单位",
"qutityUnit": "质量监督单位",
"constructionUnit": "施工单位",
"supervisorAndSupervisor": "监督负责人及监督人员",
"projectProgress": "项目进展情况"
"designUnit": "设计单位",
"constructionControlUnit": "监理单位",
//"startTime": "开工时间",
//"remark": "备注"
}
const ProjectModal = (props) => {
const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd, setDelet } = props
const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd, setDelet, getData } = props
console.log('typecard', newlysay)
const [newlys, setNewlys] = useState() //必填数据
const [newlysay, setNewlysay] = useState() //处理hou
const [records, setRecords] = useState()//处理
@ -83,37 +85,39 @@ const ProjectModal = (props) => {
setDelet(values)
const query = { ...values, type: rewkeys, projectId: records?.[0]?.value || '', done: values.done === 'true' ? true : false }
dispatch(putProject(query)).then((res) => {
})
getData()
return true
} else {
setDelet(values)
const query = { ...values, type: rewkeys,done: values.done === 'true' ? true : false }
const query = { ...values, type: rewkeys, done: values.done === 'true' ? true : false }
dispatch(putProject(query)).then((res) => {
})
getData()
return true
}
}
if (rewkeys === 'bridge') {
if (typecard == 'compile') {
setDelet(values)
const query = { ...values, type: rewkeys, projectId: records?.[0]?.value || '',done: values.done === 'true' ? true : false }
const query = { ...values, type: rewkeys, projectId: records?.[0]?.value || '', done: values.done === 'true' ? true : false }
dispatch(putProject(query)).then((res) => {
})
getData()
return true
} else {
setDelet(values)
const query = { ...values, type: rewkeys,done: values.done === 'true' ? true : false }
const query = { ...values, type: rewkeys, done: values.done === 'true' ? true : false }
dispatch(putProject(query)).then((res) => {
})
getData()
return true
}
}
}}
initialValues={{ ...recortd, done: typecard == 'compile'?recortd?.done ? 'true' : 'false':'' }}
initialValues={{ ...recortd, done: typecard == 'compile' ? recortd?.done ? 'true' : 'false' : '' }}
>
{typecard == 'compile' ?
<ProForm.Group
@ -197,6 +201,9 @@ const ProjectModal = (props) => {
/>
})}
<ProFormDatePicker width="md" name='startTime' label='开工时间' key={10}></ProFormDatePicker>
<ProFormTextArea width="md" name='remark' label='备注' key={11}></ProFormTextArea>
</ProForm.Group>}
</DrawerForm>

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

@ -1,41 +1,38 @@
'use strict';
import React, { useState, useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
// import { Spin, Button, Popconfirm } from 'antd';
// import ProTable from '@ant-design/pro-table';
// //import './protable.less'
import moment from 'moment';
// import { getRoadway, getProject, delRoadway, delProject } from "../actions/infor"
// import UserModal from './infor/details';
// import ProjectModal from './project/project';
import '../style.less';
import BuildingTable from '../components/buildingTable';
const superagent = require('superagent');
const building = (props) => {
const { dispatch, user } = props
const [data, setData] = useState()
useEffect(() => {
// dispatch(getDepMessage())
setData(props)
}, []);
const exports = (ids, differentiate) => {
console.log('sssss1', ids, differentiate)
let idas = ids.toString()
if (differentiate == 'bridge') {
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&token=${user.token}`)
} if (differentiate == 'project') {
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&token=${user.token}`)
}
const Building = (props) => {
}
return (
<div>
hha
</div>
<> <BuildingTable data={data} exports={exports} />
</>
)
}
function mapStateToProps(state) {
const { auth, depMessage } = state;
// const pakData = (dep) => {
// return dep.map((d) => {
// return {
// title: d.name,
// value: d.id,
// // children: d.type >= 2 ? [] : pakData(d.subordinate)
// children: pakData(d.subordinate)
// }
// })
// }
// let depData = pakData(depMessage.data || [])
const { auth } = state
return {
user: auth.user,
// depMessage: depMessage.data || [],
// depLoading: depMessage.isRequesting,
// depData,
};
}
}
export default connect(mapStateToProps)(Building);
export default connect(mapStateToProps)(building);

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

@ -59,11 +59,17 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionpatrolanomaly">
<Link to="/fillion/patrol_anomaly">异常反馈</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'REPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolroad">
<Link to="/fillion/patrol_road">建设上报</Link>
</Menu.Item> : ''}
{/* {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE')?.length !== 0 ?
: ''} */}
<Menu.Item key="fillionbuilding">
<Link to="/fillion/building">在建项目</Link>
<Link to="/fillion/processsing">在建项目</Link>
</Menu.Item>
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'PUBLICTRANSPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpublic">
@ -85,11 +91,6 @@ export function getNavItem(user, dispatch) {
<Link to="/fillion/promotional">宣传视频</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'REPORTMANAGE')?.length !== 0 ?
<Menu.Item key="fillionpatrolroad">
<Link to="/fillion/patrol_road">建设上报</Link>
</Menu.Item> : ''}
<Menu.Item key="fillionassess">
<Link to="/fillion/assess">考核评分</Link>

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

@ -47,9 +47,9 @@ export default [{
},
{
path: '/building',
key: 'fillionbuilding',
menuSelectKeys: ['fillionbuilding'],
path: '/processsing',
key: 'fillionprocesssing',
menuSelectKeys: ['fillionprocesssing'],
component: Building,
breadcrumb: '在建项目',
//authCode: 'ROADMANAGE'

12
web/client/src/sections/organization/actions/user.js

@ -14,6 +14,18 @@ export function getDepMessage() {
});
}
export function getDepById(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query,
actionType: 'GET_DEP_BY_ID',
url: ApiTable.getDepById,
msg: { error: '根据id获取部门失败失败' },
reducer: { name: 'depByIdInfo' }
});
}
export function getDepUser(depId) {
return dispatch => basicAction({
type: 'get',

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

@ -3,6 +3,8 @@ import { connect } from 'react-redux';
import { Spin, Row, Col, Card, Button, Tree, Empty, Checkbox } from 'antd';
import { getDepMessage, getDepUser } from '../actions/user';
import { getResource, getUserResource, postUserRes, postUserReso } from '../actions/authority';
import { getDepById } from '../actions/user';
import Resource from '../components/resource';
import user from './user';
@ -43,6 +45,7 @@ const Authority = (props) => {
// setUseName('全部用户')
// }
};
// console.log(userSelectedKeys,'当前1')
const onresChange = (d) => {
setResCode(d)
@ -66,6 +69,8 @@ const Authority = (props) => {
const onshowchange = (e) => {
setisshow(e.target.checked)
}
console.log('depMessagedata', depMessagedata)
useEffect(() => {
dispatch(getResource())
if (!(depMessage && depMessage.length)) {
@ -80,7 +85,7 @@ const Authority = (props) => {
setisshow(userResource.some(i => i.isshow === "true"))
setrescheckAll(userResource.map(i => i.resourceId).length === 14)
}, [userResource])
useEffect(() => {
useEffect(async () => {
if (depMessage.length) {
console.log('depMessage', depMessage)
//超级管理员展示所有部门
@ -91,18 +96,15 @@ const Authority = (props) => {
setDepSelected([depMessage[0]?.name])
} else {
//不是超级管理员,展示相应部门的数据
let authDep = []
depMessage.map((item) => {
if (item.id === user?.departmentId) {
authDep.push(item)
}
})
setdepMessagedata(authDep)
if (authDep.length > 0) {
dispatch(getDepUser(authDep[0]?.id))
setDepSelectedKeys([authDep[0]?.id])
setDepSelected([authDep[0]?.name])
}
dispatch(getDepUser(user.departmentId))
const res = await dispatch(getDepById({ deptId: parseInt(user.departmentId) }))
console.log('resssss', res)
setdepMessagedata(res.payload.data)
// if (authDep.length > 0) {
// dispatch(getDepUser(authDep[0]?.id))
// setDepSelectedKeys([authDep[0]?.id])
// setDepSelected([authDep[0]?.name])
// }
}
@ -110,9 +112,14 @@ const Authority = (props) => {
}, [depMessage])
// useEffect(() => {
// if(user.username!=='SuperAdmin'){
// dispatch(getDepMessage(user.departmentId))
// }
// }, [depMessage])
useEffect(() => {
const copy = depUser.filter((item) => {
return item.name !== user.name//把自己筛选出去
return item.id !== user.id//把自己筛选出去
})
setDepUserCopy(copy)
if (copy.length) {

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

@ -3,6 +3,7 @@ import { connect } from 'react-redux';
import { DeleteOutlined, EllipsisOutlined, FormOutlined } from '@ant-design/icons';
import { Spin, Space, Button, Popconfirm, Row, Col, Tree, Table, Card, Switch, Tooltip, Breadcrumb } from 'antd';
import ProTable from '@ant-design/pro-table';
import { getDepById } from '../actions/user';
import { getDepMessage, getDepUser, createUser, updateUser, delUser, resetPwd, createDep, delDep, updateDep } from '../actions/user'
import { postUserRes } from '../actions/authority'
import UserModal from '../components/userModal';
@ -28,7 +29,8 @@ const UserManage = (props) => {
const [uid, setuid] = useState()
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'USERMANAGE')[0].isshow === "true" ? true : '')//控制操作(新增删除等操作,对应权限的'不可编辑')是否可操作
const [depMessagedata, setdepMessagedata] = useState(depMessage)
useEffect(() => {
console.log('depMessagedata', depMessagedata)
useEffect(async () => {
if (depMessage.length) {
console.log('depMessage', depMessage)
//超级管理员展示所有部门
@ -38,18 +40,12 @@ const UserManage = (props) => {
dispatch(getDepUser(depMessage[0].id))
} else {
//不是超级管理员,展示相应部门的数据
let authDep = []
depMessage.map((item) => {
if (item.id === user?.departmentId) {
authDep.push(item)
}
})
setdepMessagedata(authDep)
if (authDep.length > 0) {
setDepSelectedKeys([authDep[0].id])
dispatch(getDepUser(authDep[0].id))
}
dispatch(getDepUser(user.departmentId))
const res = await dispatch(getDepById({ deptId: parseInt(user.departmentId) }))
console.log('resssss', res)
setdepMessagedata(res.payload.data)
// setDepSelectedKeys([res.payload.data[0].id])
// dispatch(getDepUser(res.payload.data[0].id))
}
}
@ -68,13 +64,14 @@ const UserManage = (props) => {
}, [uid])
useEffect(() => {
dispatch(getDepMessage())
}, [])
useEffect(() => {
console.log('depuser', depUser)
console.log('depuser', depUser, user)
const copy = depUser.filter((item) => {
return item.name !== user.name//把自己筛选出去
console.log('item1', item)
return item.id !== user.id//把自己筛选出去
})
console.log('copy', copy)
setDepUserCopy(copy)
}, [depUser])
useEffect(() => {
@ -408,6 +405,7 @@ const UserManage = (props) => {
{
depMessage.length && modalVisible ?
<UserModal
dispatch={dispatch}
visible={modalVisible}
onVisibleChange={setModalVisible}
modalType={modalType}

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

@ -7,49 +7,49 @@ import Header from './heand';
import Footer from './footer';
import ProTable, { TableDropdown } from '@ant-design/pro-table';
import Gis from './footer/gis/gis';
import OlMap from './public/olMap'
const MAPID = 'screenGis'
const Example = (props) => {
const { dispatch, actions, user, loading } = props
const [tabKey, setTabKey] = useState('leadership')
const [mapObj, setMapObj] = useState();
const tabChange = (tab) => {
setTabKey(tab)
// dispatch({ type: 'TAB-CHANGE', data: tab })
}
return (
<Spin tip="biubiubiu~" spinning={loading}>
<div style={{
backgroundColor: "#031839", width: "100vw", height: "100vh", /* transform: `scale(${Math.min(
const { dispatch, actions, user, loading } = props
const [tabKey, setTabKey] = useState('leadership')
const [mapObj, setMapObj] = useState();
const tabChange = (tab) => {
setTabKey(tab)
// dispatch({ type: 'TAB-CHANGE', data: tab })
}
return (
<Spin tip="biubiubiu~" spinning={loading}>
<div style={{
backgroundColor: "#031839", width: "100vw", height: "100vh", /* transform: `scale(${Math.min(
document.body.clientWidth / 1920,
document.body.clientHeight / 1080
)})`, */
}}>
<div style={{ width: "100%", height: "10%" }}>
<Header tabChange={tabChange} tabKey={tabKey} dispatch={dispatch} user={user} />
</div>
<div style={{ position: 'absolute', width: "100%", height: "90%" }}>
{/* <Gis tabKey={tabKey} /> */}
<Footer tabKey={tabKey} dispatch={dispatch} />
}}>
<div style={{ width: "100%", height: "10%" }}>
<Header tabChange={tabChange} tabKey={tabKey} dispatch={dispatch} user={user} />
</div>
<div style={{ position: 'absolute', width: "100%", height: "90%" }}>
{/* <Gis tabKey={tabKey} /> */}
<OlMap />
<Footer tabKey={tabKey} dispatch={dispatch} />
</div>
</div>
</div>
</Spin>
)
</Spin>
)
}
function mapStateToProps(state) {
const { auth, global, members } = state;
return {
loading: members.isRequesting,
user: auth.user,
actions: global.actions,
members: members.data
};
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);

131
web/client/src/sections/quanju/containers/public/olMap.js

@ -0,0 +1,131 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import request from 'superagent'
import { OlMapRequest } from '$utils'
const OlMap = (props) => {
const { dispatch, actions, user } = props
const [olMapOpenData, setOlMapOpenData] = useState([])
useEffect(() => {
let config = {
layerName: 'nanchang',
center: [116.08706, 28.602018], // 中心坐标
zoom: 10, // 缩放
minZoom: 8,
maxZoom: 21,
isMoveSelect: false, // 鼠标滑过是否选中
projection: 'EPSG:4326' // 坐标系
}
let arcgisUrls = {
nanchang: {
url: 'http://36.2.6.33:6080/arcgis/rest/services/PBDT/nachang/MapServer',
},
}
let option = {
target: 'olMap', // 元素ID
config: config,
arcgisUrls, // 动态底图图层
onEvent: {
// 选中回调
onSelectClick: function (p) { console.log(p) },
// 鼠标滑过回调
onPointerMove: function (p) { console.log(p) },
}
}
let olMapTool = new OlMapTool(option)
olMapTool.map.on('dblclick', function (p) {
console.log(p)
})
olMapTool.map.on('singleclick', function (p) {
console.log("singleclick", p)
olMapTool.closeOverlay('clickOpen')
olMapTool.removeGeometryLayer('geometry0')
request.post('http://36.2.6.32:8811/geoserver-pg/rest/bufferSearch')
.type('form')
.send({
params: `{"layerName":"view_by_line","pageSize":10,"pageNum":1,"filter":"","isReturnGeometry":"true","spatialRel":"INTERSECTS","orderByFields":" sort1, sort2, lxbm, sxxfx, qdzh asc", "spatialFilter":"point(${p.coordinate[0]} ${p.coordinate[1]})","distance":20}`
})
.then(res => {
console.log(res);
if (res.status == 200 && res.body && res.body.code == 1) {
const data = res.body.data
const { datalist } = data
let index = 0
for (let d of datalist.list) {
olMapTool.addGeometryJMLayer({
features: [
{
geometry: d.shape,
geometryType: 'LineString',
// geometryType: 'Point',
},
],
style: { stroke: { width: 10, color: '#9933FF' } },
selectStyle: { stroke: { width: 5, color: '#9933FF' } },
layerName: 'geometry' + index++
});
const config = {
id: 'clickOpen',
offset: [0, 25], // 偏移
position: p.coordinate, // 坐标
autoPan: true,
autoPanMargin: 100,
positioning: 'top-right'
}
setOlMapOpenData([{ k: Math.random() }])
olMapTool.addOverlay('clickOpen', config)
break
}
}
})
})
}, [])
return (
<div id="olMap" style={{ position: 'absolute', height: '100%', width: "100%" }}>
<div slot="overlays" style={{ display: 'none', }}>
<div id="clickOpen"
style={{
backgroundImage: `url(../../../../../assets/images/leadership/beijinglan.png)`,
width: 340,
backgroundPosition: 'center',
backgroundSize: '100% 100%',
minHeight: 240,
padding: '24px',
backgroundRepeat: 'no-repeat',
color: '#fff'
}}>
{
olMapOpenData.map(s => {
return <div style={{ display: 'flex' }}>
<div style={{ width: 120 }}>1</div>
<div style={{ flex: 1 }}>: {s.k}</div>
</div>
})
}
</div>
</div>
</div>
)
}
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,
actions: global.actions,
};
}
export default connect(mapStateToProps)(OlMap);

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

@ -1,10 +1,10 @@
'use strict';
import { AuthorizationCode } from './authCode';
import { ApiTable, RouteTable } from './webapi'
import { ApiTable, RouteTable, } from './webapi'
import Func from './func';
export {
AuthorizationCode,
Func,
ApiTable, RouteTable
ApiTable, RouteTable,
}

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

@ -2,6 +2,8 @@
import { ProxyRequest } from "@peace/utils";
export const GodTransRequest = new ProxyRequest("_godTrans");
export const OlMapRequest = new ProxyRequest("_olMap");
export const ApiTable = {
login: 'login',
logout: 'logout',
@ -116,6 +118,7 @@ export const ApiTable = {
getEnterprisesMembers: 'enterprises/{enterpriseId}/members',
getDepById: 'departmentById',
//组织管理-用户管理-部门
getDepMessage: 'department',
createDepMessage: 'department',
@ -170,10 +173,10 @@ export const ApiTable = {
getAssess: 'assess',
editAssess: 'assess',
delAssess: 'assess/{assessId}',
nearestAssessData:'assess/nearest',
nearestAssessData: 'assess/nearest',
// 视频中心
videoCenterList:'videoCenter/list',
videoCenterList: 'videoCenter/list',
//工程数据
getProject: 'project',
@ -295,7 +298,9 @@ export const ApiTable = {
//任务信息
getTask: 'task', delTask: 'task/{taskId}', editTask: 'task',
//部门下所有员工
getAllDepUsers: 'allDepUsers'
getAllDepUsers: 'allDepUsers',
//指派任务
appointTask: 'appointTask'
};

Loading…
Cancel
Save