diff --git a/web/client/src/sections/auth/containers/login.js b/web/client/src/sections/auth/containers/login.js
index f8a6685f..5bb5ca5e 100644
--- a/web/client/src/sections/auth/containers/login.js
+++ b/web/client/src/sections/auth/containers/login.js
@@ -50,7 +50,7 @@ const Login = props => {
return
}
setInputChanged(false)
- dispatch(login("12345678912564589", "123456789"))
+ dispatch(login(username, password))
}
@@ -60,34 +60,36 @@ const Login = props => {
南昌县智慧交通监管系统
-
+ onChange={e => {
+ console.log('setPassword', e.target.value)
+ setPassword(e.target.value)
+ setInputChanged(true)
+ }}
+ />
+
+
diff --git a/web/client/src/sections/fillion/actions/task.js b/web/client/src/sections/fillion/actions/task.js
new file mode 100644
index 00000000..e32fbf5b
--- /dev/null
+++ b/web/client/src/sections/fillion/actions/task.js
@@ -0,0 +1,35 @@
+import { basicAction } from '@peace/utils'
+import { ApiTable } from '$utils'
+
+export function getTask(query) {
+ return dispatch => basicAction({
+ type: 'get',
+ dispatch: dispatch,
+ query: query,
+ actionType: 'GET_TASK',
+ url: ApiTable.getTask,
+ msg: { error: '获取任务信息' },
+ reducer: { name: 'task' }
+ });
+}
+
+export function delTask(query) {
+ return dispatch => basicAction({
+ type: 'del',
+ dispatch: dispatch,
+ actionType: 'DEL_TASK',
+ url: ApiTable.delTask.replace("{taskId}", query?.id),
+ msg: { option: '删除任务信息' },
+ });
+}
+
+export function editTask(query) {
+ return dispatch => basicAction({
+ type: 'put',
+ dispatch: dispatch,
+ data: query,
+ actionType: 'GET_TASK',
+ url: ApiTable.editTask,
+ msg: { error: '编辑或新增任务信息' },
+ });
+}
\ No newline at end of file
diff --git a/web/client/src/sections/fillion/components/task/addTaskModal.js b/web/client/src/sections/fillion/components/task/addTaskModal.js
new file mode 100644
index 00000000..60e4495d
--- /dev/null
+++ b/web/client/src/sections/fillion/components/task/addTaskModal.js
@@ -0,0 +1,152 @@
+import React, { useState, useEffect, useRef } from 'react';
+import { Modal, Form, Input, Select, Button } from 'antd';
+import { connect } from 'react-redux';
+import { getRoadway } from '../../actions/infor'
+import { getUserList } from '../../actions/patrol';
+import { editTask } from '../../actions/task';
+
+const AddModal = (props) => {
+ const { dispatch, recordRow, visible, onClose, user, lookVal } = props
+ const { TextArea } = Input
+ const [form] = Form.useForm()
+ const [inputVal, setIputVal] = useState(undefined)
+ const [selectVal, setSelectVal] = useState('')
+ const [roadRes, setRoadRes] = useState([])//路线列表
+ const [userList, setUserList] = useState([])//用户列表
+ useEffect(async () => {
+ const res = await dispatch(getUserList())
+ setUserList(res?.payload.data)
+ }, [true])
+
+ const onChange = () => {
+ form.resetFields(['code'])//清空具体某个表单的值
+ }
+ useEffect(() => {
+ form.setFieldsValue(recordRow ? { 'name': recordRow?.road.routeName, 'code': recordRow?.road.routeCode, 'danger': recordRow?.dangerDescription, 'user': recordRow?.user.name } : {})
+ }, [recordRow])
+ useEffect(async () => {
+ const res = await dispatch(getRoadway({}))
+ setRoadRes(res?.payload.data)
+ }, [])
+ //新增和修改
+ const handleSaveUpdate = () => {
+ form.validateFields().then((values) => {
+ console.log('VALUES', values)
+ const val = {
+ routeCode: values.code,
+ dangerDescription: values.danger,
+ name: values.user,
+ id: recordRow?.id
+ }
+ dispatch(editTask(val)).then(res => {
+ if (res.success) {
+ onClose()
+ form.resetFields()
+ }
+ })
+ })
+ }
+
+ return (
+ {
+ onClose()
+ form.resetFields()//清空所有个表单的值
+ setSelectVal('')//置空路线代码的选择
+ }}
+ onOk={
+ handleSaveUpdate
+ }
+ okButtonProps={{
+ disabled: lookVal ? true : false,
+ }}
+ cancelButtonProps={{
+ disabled: lookVal ? true : false,
+ }}
+ >
+
+
+
+
+
+
+
+
+
+
+ {lookVal ?
+
+ : ''}
+ {lookVal ?
+
+ : ''}
+
+
+
+ )
+}
+function mapStateToProps(state) {
+ const { auth } = state
+ return {
+ user: auth.user,
+ }
+}
+
+export default connect(mapStateToProps)(AddModal)
\ No newline at end of file
diff --git a/web/client/src/sections/fillion/containers/index.js b/web/client/src/sections/fillion/containers/index.js
index f3c5c932..dc231384 100644
--- a/web/client/src/sections/fillion/containers/index.js
+++ b/web/client/src/sections/fillion/containers/index.js
@@ -13,4 +13,5 @@ import Maintenance from './maintenance';
import Patrol from './patrol';
import File from './file';
import Jiekouguanli from './jiekouguanli';
-export { Infor,transportation,BridgeTable,HigHways,OperaTional,Enforce,Public,Videois,PromoTional,Maintenance,Patrol,File,Jiekouguanli};
\ No newline at end of file
+import Task from './task'
+export { Infor, transportation, BridgeTable, HigHways, OperaTional, Enforce, Public, Videois, PromoTional, Maintenance, Patrol, File, Jiekouguanli, Task };
\ No newline at end of file
diff --git a/web/client/src/sections/fillion/containers/task.js b/web/client/src/sections/fillion/containers/task.js
new file mode 100644
index 00000000..70dcd9b9
--- /dev/null
+++ b/web/client/src/sections/fillion/containers/task.js
@@ -0,0 +1,186 @@
+'use strict';
+import React, { useState, useEffect } from 'react';
+import { connect } from 'react-redux';
+import { Button, Table, Spin, Select, Divider, Popconfirm } from 'antd';
+import moment from 'moment';
+import { debounce } from 'lodash'
+import AddModal from '../components/task/addTaskModal';
+import { getRoadway } from '../actions/infor'
+import { getTask } from '../actions/task'
+import { delTask } from '../actions/task'
+
+const Task = (props) => {
+ const { dispatch, isRequesting } = props
+ const [addModalVis, setAddModalVis] = useState(false)
+ const [roadRes, setRoadRes] = useState([])//路线列表
+ const [selectVal, setSelectVal] = useState('all')//选择框得值
+ const [inputVal, setIputVal] = useState(undefined)
+ const [taskRes, setTaskRes] = useState([])
+ const [recordRow, setRecordRow] = useState(null)
+ const [lookVal, setLookval] = useState('')
+ useEffect(async () => {
+ const res = await dispatch(getRoadway({}))
+ setRoadRes(res.payload.data)
+ }, [])
+
+ const getData = async (querySelect = { id: inputVal, isdanger: selectVal === 'all' ? undefined : selectVal === 'y' ? true : false }) => {
+ console.log('getData', inputVal, selectVal)
+ const task = await dispatch(getTask(querySelect))
+ setTaskRes(task.payload?.data)
+ }
+ useEffect(async () => {
+ getData()
+ }, [])
+ //搜索道路名称
+ const searchRoadName = async (value) => {
+ const task = await dispatch(getTask({ id: value, isdanger: selectVal === 'all' ? undefined : selectVal === 'y' ? true : false }))
+ setTaskRes(task.payload?.data)
+ setIputVal(value)
+ }
+ //选择安全是否消除
+ const changeSelect = async (value) => {
+ console.log('value', value)
+ const task1 = await dispatch(getTask({ id: inputVal, isdanger: value === 'all' ? undefined : value === 'y' ? true : false }))
+ setTaskRes(task1.payload?.data)
+ setSelectVal(value)
+ }
+ //刪除task
+ const delTaskHandler = async (record) => {
+ const res = await dispatch(delTask({ id: record.id }))
+ if (res.success) {
+ const task = await getData()
+ setTaskRes(task.payload?.data)
+ }
+ }
+ //查看
+ const look = (record) => {
+ setAddModalVis(true)
+ setLookval(record)
+ setRecordRow(record);
+
+ }
+ //配置表格列
+ const columns = [{
+ title: '路线名称',
+ render: (_, record) => {
+ return {record.road.routeName}
+ }
+ },
+ {
+ title: '路线代码',
+ render: (_, record) => {
+ return {record.road.routeCode}
+ }
+ },
+ {
+ title: '隐患说明',
+ dataIndex: 'dangerDescription',
+ },
+ {
+ title: '下发时间',
+ render: (_, record) => {
+ return {record.issuanceTime ? moment(record?.issuanceTime).format('YYYY-MM-DD HH:mm:ss') : ''}
+ }
+ },
+ {
+ title: '责任人',
+ render: (_, record) => {
+ return {record.user.name}
+ }
+ },
+ {
+ title: '是否消除隐患',
+ render: (_, record) => {
+ return {record.isdanger === null ? '' : record.isdanger === 'true' ? '是' : '否'}
+ }
+ },
+ {
+ title: '上报时间',
+ render: (_, record) => {
+ return {record.reportTime ? moment(record.reportTime).format('YYYY-MM-DD HH:mm:ss') : ''}
+ }
+ },
+ {
+ title: '操作',
+ render: (dom, record) => {
+ return
+ {record.reportTime ?
: ''}
+
{ delTaskHandler(record) }}>
+
+
+
+ }
+ },
+ ]
+
+ //配置分页
+ const paginationOpt = {
+ defaultCurrent: 1,
+ defaultPageSize: 5,
+ total: taskRes?.count,
+ showSizeChanger: true,
+ showQuickJumper: true,
+ pageSizeOptions: ["5", "10", "15"],
+ showTotal: function () {
+ return `共有${taskRes?.count}条`
+ }
+ }
+
+
+ return (
+
+
+ 路线名称:
+
+ 是否存在安全隐患:
+
+
+
+
+
+
+
+
{ setAddModalVis(false); getData(); setRecordRow(null); setLookval(null) }} recordRow={recordRow}
+ lookVal={lookVal}
+ >
+
+
)
+
+
+}
+
+function mapStateToProps(state) {
+ const { auth } = state;
+ return {
+ user: auth.user,
+ error: auth.error,
+ isRequesting: auth.isRequesting,
+ }
+}
+
+export default connect(mapStateToProps)(Task);
\ No newline at end of file
diff --git a/web/client/src/sections/fillion/nav-item.js b/web/client/src/sections/fillion/nav-item.js
index 3cc28bec..948b41f6 100644
--- a/web/client/src/sections/fillion/nav-item.js
+++ b/web/client/src/sections/fillion/nav-item.js
@@ -9,6 +9,9 @@ export function getNavItem(user, dispatch) {
治超管理
+
+ 任务管理
+
道路管理
diff --git a/web/client/src/sections/fillion/routes.js b/web/client/src/sections/fillion/routes.js
index 3187441d..39edd68a 100644
--- a/web/client/src/sections/fillion/routes.js
+++ b/web/client/src/sections/fillion/routes.js
@@ -11,7 +11,8 @@ import { PromoTional } from './containers';
import { Maintenance } from './containers'
import { Patrol } from './containers'
import { File } from './containers';
-import {Jiekouguanli} from './containers'
+import { Jiekouguanli } from './containers'
+import { Task } from './containers'
export default [{
type: 'inner',
route: {
@@ -26,6 +27,12 @@ export default [{
menuSelectKeys: ['fillioninfor'],
component: Infor,
breadcrumb: '治超管理',
+ }, {
+ path: '/task',
+ key: 'filliontask',
+ menuSelectKeys: ['filliontask'],
+ component: Task,
+ breadcrumb: '任务管理',
}, {
path: '/transportation',
key: 'filliontransportation',
diff --git a/web/client/src/sections/organization/components/userModal.js b/web/client/src/sections/organization/components/userModal.js
index d229bc7a..01e731a2 100644
--- a/web/client/src/sections/organization/components/userModal.js
+++ b/web/client/src/sections/organization/components/userModal.js
@@ -153,6 +153,14 @@ const UserModal = (props) => {
// defaultChecked
valuePropName="checked"
/>
+
diff --git a/web/client/src/sections/organization/containers/user.js b/web/client/src/sections/organization/containers/user.js
index 634c2c7c..59b11374 100644
--- a/web/client/src/sections/organization/containers/user.js
+++ b/web/client/src/sections/organization/containers/user.js
@@ -11,7 +11,7 @@ import DepModal from '../components/depModal';
const TreeNode = Tree.TreeNode;
const UserManage = (props) => {
- const { dispatch, loading, depMessage, depUser, clientHeight } = props
+ const { dispatch, loading, depMessage, depUser, clientHeight, user } = props
const [modalVisible, setModalVisible] = useState(false);
const [modalType, setModalType] = useState();
const [modalRecord, setModalRecord] = useState();
@@ -23,12 +23,17 @@ const UserManage = (props) => {
const [depModalRecord, setDepModalRecord] = useState();
const [selectedTree, setSelectedTree] = useState();
const [depCrumbs, setDepCrumbs] = useState([]);
-
-
+ const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员
useEffect(() => {
dispatch(getDepMessage())
- }, [])
+ }, [])
+ useEffect(() => {
+ const copy = depUser.filter((item) => {
+ return item.name !== user//把自己筛选出去
+ })
+ setDepUserCopy(copy)
+ }, [depUser])
useEffect(() => {
if (depMessage.length) {
setDepSelectedKeys([depMessage[0].id])
@@ -60,7 +65,15 @@ const UserManage = (props) => {
render: (_, r) => {
return
}
- }, {
+ },
+ {
+ title: '是否管理员',
+ dataIndex: 'isadmin',
+ render: (_, r) => {
+ return {r.isAdmin ? '是' : '否'}
+ }
+ },
+ {
title: '操作',
dataIndex: 'action',
render: (dom, record) => {
@@ -168,10 +181,10 @@ const UserManage = (props) => {
}
//部门新增及编辑
const onDepConfirm = (data) => {
- console.log('depModalType:',depModalType);
- console.log('data:',data);
+ console.log('depModalType:', depModalType);
+ console.log('data:', data);
if (depModalType == 'edit') {
-
+
dispatch(updateDep(data)).then(res => {
if (res.success) {
setDepModalVisible(false);
@@ -307,7 +320,7 @@ const UserManage = (props) => {
{
}
function mapStateToProps(state) {
- const { depMessage, depUser, global } = state;
+ const { depMessage, depUser, global, auth } = state;
// console.log(state);
return {
clientHeight: global.clientHeight,
loading: depMessage.isRequesting,
depMessage: depMessage.data || [],
- depUser: depUser.data || []
+ depUser: depUser.data || [],
+ user: auth?.user?.name
};
}
diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js
index bd49b123..cc88e666 100644
--- a/web/client/src/utils/webapi.js
+++ b/web/client/src/utils/webapi.js
@@ -275,10 +275,13 @@ export const ApiTable = {
getCircuit: 'bus/line', putCircuit: 'bus/line', delCircuit: 'bus/line/{lineId}',
getVehicle: 'bus/car', putVehicle: 'bus/car', delVehicle: 'bus/car/{carId}',
//单位概况
- getCustodyunit:'/road/maintenance',
- postCustodyunit:'/road/maintenance',
+ getCustodyunit: '/road/maintenance',
+ postCustodyunit: '/road/maintenance',
//养护费用
- getMaintenance:'/road/maintenance/cost/nanchang/query'
+ getMaintenance: '/road/maintenance/cost/nanchang/query',
+ //任务信息
+ getTask: 'task', delTask: 'task/{taskId}', editTask: 'editTask'
+
};