diff --git a/web/client/src/sections/fillion/containers/luzheng.js b/web/client/src/sections/fillion/containers/luzheng.js new file mode 100644 index 00000000..8f56c7dc --- /dev/null +++ b/web/client/src/sections/fillion/containers/luzheng.js @@ -0,0 +1,171 @@ +import React, { useState, useEffect } from 'react'; +import { connect } from 'react-redux'; +import { getAssess, delAssess, editAssess } from '../actions/assess'; +import {getRoadadministration} from '../actions/luzheng' +import ProTable from '@ant-design/pro-table'; +import AssessModal from '../components/assessModal'; +import { Form, Space, DatePicker, Button, Select, Popconfirm } from 'antd' +import moment from 'moment'; + +export const unitList = [ + '县道', + '蒋巷镇', + '三江镇', + '塔城乡', + '泾口乡', + '八一乡', + '冈上镇', + '南新乡', + '富山乡', + '莲塘镇', + '金湖管理处', + '武阳镇', + '向塘镇', + '幽兰镇', + '广福镇', + '塘南镇', + '银三角管委会', + '黄马乡', +] +function Assess(props) { + const { dispatch, assess, user } = props; + const [assessModalVisible, setAssessModalVisible] = useState(false); + const [editData, setEditData] = useState(null); + const [query, setQuery] = useState({ page: 1, pageSize: 10 }) + const [loading, setLoading] = useState(false); + const [isCheck, setIsCheck] = useState(false) + const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'ASSESSMANAGE')?.isshow === "true" ? true : '') + useEffect(() => { + dispatch(getRoadadministration()).then(res=>{console.log(res,'res')}) + return () => { }; + }, []); + + useEffect(() => { + getData() + }, [query]) + + const getData = () => { + setLoading(true) + dispatch(getAssess(query)).then(res => { + setLoading(false) + }) + } + + return ( +
+
+
{ + setQuery({ ...query, unit: v.unit, month: v.month ? moment(v.month).format() : undefined }) + }}> + + + + + + + + + + + +
+ + +
+ ( + text ? moment(record.month).format('YYYY-MM') : '' + ) + }, + { + title: '考核得分', + dataIndex: 'totalPoints', + key: 'totalPoints', + }, + { + title: '操作', + key: 'action', + render: (text, record) => ( + + + + { + setLoading(true) + dispatch(delAssess({ id: record.id })).then(res => { + setLoading(false) + if (res.success) { + getData() + } + }) + }} + > + + + + ), + },]} + dataSource={assess.rows || []} + loading={loading} + pagination={{ + total: assess?.count || 0, + pageSize: 10, + defaultPageSize: 10, + showSizeChanger: false, + onChange: (page, pageSize) => { + setQuery({ + ...query, + page, limit: pageSize + }) + } + }} + rowKey="key" + toolBarRender={false} + search={false} + /> + { + assessModalVisible ? { + getData() + setIsCheck(false) + setEditData(null) + setAssessModalVisible(false) + }} /> : '' + } +
+ ); +} +function mapStateToProps(state) { + const { auth, assess } = state + return { + user: auth.user, + assess: assess.data || [], + } +} +export default connect(mapStateToProps)(Assess); \ No newline at end of file