ww664853070
2 years ago
33 changed files with 77898 additions and 309 deletions
@ -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 |
||||
|
}; |
@ -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 '质量检测单位'; |
||||
|
|
||||
|
|
@ -1,2 +1,6 @@ |
|||||
alter table report |
ALTER TABLE report add code_road varchar(512); |
||||
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) []; |
@ -0,0 +1,4 @@ |
|||||
|
alter table report |
||||
|
add performer_id integer; |
||||
|
|
||||
|
comment on column report.performer_id is '处理人'; |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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} |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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: '指派任务' }, |
||||
|
}); |
||||
|
} |
@ -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); |
@ -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); |
@ -1,41 +1,38 @@ |
|||||
'use strict'; |
import React, { useEffect, useState } from 'react'; |
||||
|
|
||||
import React, { useState, useEffect } from 'react'; |
|
||||
import { connect } from 'react-redux'; |
import { connect } from 'react-redux'; |
||||
// import { Spin, Button, Popconfirm } from 'antd';
|
import '../style.less'; |
||||
// import ProTable from '@ant-design/pro-table';
|
import BuildingTable from '../components/buildingTable'; |
||||
// //import './protable.less'
|
const superagent = require('superagent'); |
||||
import moment from 'moment'; |
const building = (props) => { |
||||
// import { getRoadway, getProject, delRoadway, delProject } from "../actions/infor"
|
const { dispatch, user } = props |
||||
// import UserModal from './infor/details';
|
const [data, setData] = useState() |
||||
// import ProjectModal from './project/project';
|
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 ( |
return ( |
||||
<div> |
<> <BuildingTable data={data} exports={exports} /> |
||||
hha |
</> |
||||
</div> |
|
||||
) |
) |
||||
} |
} |
||||
function mapStateToProps(state) { |
function mapStateToProps(state) { |
||||
const { auth, depMessage } = state; |
const { auth } = 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 { |
return { |
||||
user: auth.user, |
user: auth.user, |
||||
// depMessage: depMessage.data || [],
|
|
||||
// depLoading: depMessage.isRequesting,
|
|
||||
// depData,
|
|
||||
}; |
|
||||
} |
} |
||||
export default connect(mapStateToProps)(Building); |
} |
||||
|
export default connect(mapStateToProps)(building); |
@ -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); |
@ -1,10 +1,10 @@ |
|||||
'use strict'; |
'use strict'; |
||||
import { AuthorizationCode } from './authCode'; |
import { AuthorizationCode } from './authCode'; |
||||
import { ApiTable, RouteTable } from './webapi' |
import { ApiTable, RouteTable, } from './webapi' |
||||
import Func from './func'; |
import Func from './func'; |
||||
|
|
||||
export { |
export { |
||||
AuthorizationCode, |
AuthorizationCode, |
||||
Func, |
Func, |
||||
ApiTable, RouteTable |
ApiTable, RouteTable, |
||||
} |
} |
Loading…
Reference in new issue