feat(): 用户管理以及维护项目验收联调

test
李神峰 2024-12-18 17:53:30 +08:00
parent 96970ad8cc
commit 7a17832dbe
41 changed files with 3170 additions and 576 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,54 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import { TreeSelect, Card, Button, message } from 'antd';
import BasicCrudModal from '../../components/crud/BasicCrudModal';
import apiurl from '../../service/apiurl';
import { xyt_httpget2 } from '../../utils/request';
const TreePage = ({onChange, value, disabled=false}) => {
const refModal = useRef();
const [treeData, setTreeData] = useState([]);
useEffect(()=>{
getTree()
},[])
const getTree = async()=>{
const {code, data} = await xyt_httpget2(apiurl.systemManagement.dept.tree)
if(code!==200){
message.error('请求失败')
return
}
handelTreeData(data)
setTreeData(data)
}
const handelTreeData = (data) => {
if (data.length > 0) {
data.forEach(item => {
item.title = item.label;
item.key = item.id;
item.value = item.id;
if (item.children && item.children.length > 0) {
handelTreeData(item.children);
}
});
}
}
return (
<TreeSelect
defaultExpandAll={true}
blockNode={false}
treeData={treeData}
value={value||undefined}
onChange={onChange}
disabled={disabled}
/>
);
}
export default TreePage;

View File

@ -70,6 +70,33 @@ showUpdate(record) {
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
if (this.props.extraFun) {
this.props.extraFun();
}
} else if (result?.code === 400) {
message.error(result?.description);
}
else {
message.error(result?.msg||'修改失败');
}
})
}
onUerEdit = (path, values) => {
createCrudService(path).userEdit(values).then((result) => {
if (result?.code === 200) {
message.success('修改成功');
this.setState({ open: false });
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
if (this.props.extraFun) {
this.props.extraFun();
}
} else if (result?.code === 400) {
message.error(result?.description);
@ -107,6 +134,9 @@ showUpdate(record) {
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
if (this.props.extraFun) {
this.props.extraFun();
}
} else if (result?.code === 400) {
message.error(result?.description||'修改失败');
}
@ -124,6 +154,7 @@ showUpdate(record) {
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
} else {
message.error(result?.msg||'删除失败');
}
@ -138,6 +169,26 @@ showUpdate(record) {
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
if (this.props.extraFun) {
this.props.extraFun();
}
} else {
message.error(result?.msg||'删除失败');
}
})
}
onUerDeleteGet = (path, values) => {
createCrudService(path).userDel(values).then((result) => {
if (result?.code === 200) {
message.success('删除成功');
this.setState({ open: false });
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
if (this.props.extraFun) {
this.props.extraFun();
}
} else {
message.error(result?.msg||'删除失败');
}
@ -215,6 +266,7 @@ showUpdate(record) {
onCrudSuccess={this.props.onCrudSuccess}
record={record}
onEdit={this.onEdit}
onUerEdit={this.onUerEdit}
onSave={this.onSave}
onSimilarSave={this.onSimilarSave}
formProps={formProps}

View File

@ -38,9 +38,16 @@ export function CrudOpRender_icon({ command, edit, del, restore, add, view }) {
)
}
export function CrudOpRender_text({ command,modify,edit,del,view}) {
export function CrudOpRender_text({ command,modify,edit,del,view,status}) {
return (
<div style={{ display: 'inline' }}>
{
status ? (
<Popconfirm title={ `确定要${status.status ==1 ? '停用' : '启用'}吗?`} onConfirm={command('status')}>
<Button style={{ marginRight: 4}} type="link" size="small" title={`${status.status ==1 ? '停用' : '启用'}`}>{ status.status ==1 ? '停用' : '启用'}</Button>
</Popconfirm>
) : null
}
{
edit ? (
<Button style={{ marginRight: 4 }} type="link" size="small" onClick={command('edit')} title="编辑">编辑</Button>

View File

@ -1,4 +1,4 @@
import {httppost2, download, httpPostFile, httpget, httpget2,httpget6} from "../../utils/request";
import {httppost2, download, httpPostFile, httpget, httpget2,httpget6,xyt_httpget2,xyt_httpput,xyt_httpdelete} from "../../utils/request";
import apiurl from "../../service/apiurl";
import {config} from "../../config";
@ -123,6 +123,22 @@ export async function paginate3(url, params = {}) {
return {list: [], totalRow: 0};
}
export async function xyt_paginate_noCode(url, params = {}) {
const {pageNumber, pageSize, ...ret} = params;
const pam = {
pageNum:pageNumber,
pageSize:pageSize,
...ret
}
const result = await xyt_httpget2(url, pam);
if (result && result.rows) {
return {
list: result.rows.map((m, index) => ({inx: (pageNumber - 1) * pageSize + index + 1, ...m})),
totalRow: result.total
};
}
return {list: [], totalRow: 0};
}
export function createCrudService(urlSet) {
const find = async (params) => {
@ -132,6 +148,9 @@ export function createCrudService(urlSet) {
const find_noCode = async (params) => {
return paginate_noCode(urlSet, params);
}
const xyt_find_noCode = async (params) => {
return xyt_paginate_noCode(urlSet, params);
}
const find_nopage = async (params) => {
return paginate_nopage(urlSet, params);
@ -157,6 +176,11 @@ export function createCrudService(urlSet) {
return resData;
}
const userEdit = async (params) => {
const resData = await xyt_httpput(urlSet, params) || {};
return resData;
}
const edit1 = async (params) => {
const resData = await httppost2(urlSet, params) || {};
return resData;
@ -176,6 +200,11 @@ export function createCrudService(urlSet) {
return resData;
}
const userDel = async (params) => {
const resData = await xyt_httpdelete(urlSet, params) || {};
return resData;
}
const treeList = async (params) => {
const {data} = await httppost2(urlSet, params) || {};
return {list: data, totalRow: data?.length};
@ -239,15 +268,18 @@ export function createCrudService(urlSet) {
return {
find: find,
find_noCode: find_noCode,
find_nopage:find_nopage,
find_nopage: find_nopage,
xyt_find_noCode,
find2: find2,
find3:find3,
list: list,
todo: todo,
save: save,
edit: edit,
userEdit,
edit1: edit1,
del: del,
userDel,
insert:insert,
delGet:delGet,
upLoad: upLoad,

View File

@ -152,9 +152,9 @@ export default function FileUpload({ mode, setFileIds, files, downloadUrl, uploa
}
<span>{file.name}</span>
</div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
{mode != 'view' && <div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
<DeleteOutlined />
</div>
</div>}
</div>
</Col>
)

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { Suspense } from 'react';
import ReactDOM from 'react-dom/client';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/lib/locale/zh_CN';

View File

@ -175,85 +175,94 @@ export function loadRole(data: any) {
export async function loadMenu(): Promise<MenuItem[]> {
// await wait(200)
// const { code, data } = await xyt_httpget2(apiurl.xytlogin.role)
// if( code!== 200){
// message.error('获取用户权限失败')
// return []
// }
// //获取到菜单后遍历
// const id = idgen()
// // handelTreeData(data,id)
// const tree = buildTree(data,0)
// const tree2 = tree?.filter((item:any) =>(item.menuId != "1" && item.menuId != "2" && item.menuId != "3"))
// handelTreeData(tree2,id)
// return tree2
await wait(200)
const { code, data } = await xyt_httpget2(apiurl.login.role)
if( code!== 200){
message.error('获取用户权限失败')
return []
}
//获取到菜单后遍历
const id = idgen()
return [
{ id: id(), title: '首页', path: '/home', icon: 'yzt' },
{
id: id(), title: '监测数据', redirect: '/mgr/jcsj/jcsj', icon: 'sz',
children: [
{
id: id(), title: '监测数据', path: '/mgr/jcsj/jcsj',
},
{
id: id(), title: '报警管理', redirect: '/mgr/jcsj/bjgl/bjjl',
children: [
{ id: id(), title: '报警记录', path: '/mgr/jcsj/bjgl/bjjl' },
{ id: id(), title: '报警规则配置', path: '/mgr/jcsj/bjgl/bjgzpz' },
]
},
]
},
{ id: id(), title: '安全监测', path: '/mgr/aqjc', icon: 'sz' },
{
id: id(), title: '设备维护', redirect: '/mgr/sbwh/wxyhgl/wxfabz', icon: 'sz',
children: [
{
id: id(), title: '维修养护管理', redirect: '/mgr/sbwh/wxyhgl/wxfabz',
children: [
{ id: id(), title: '维护方案编制', path: '/mgr/sbwh/wxyhgl/wxfabz' },
{ id: id(), title: '实施过程记录', path: '/mgr/sbwh/wxyhgl/ssgcjl' },
{ id: id(), title: '维护项目验收', path: '/mgr/sbwh/wxyhgl/whxmys' },
]
},
{
id: id(), title: '设备物资管理', redirect: '/mgr/sbwh/sbwzgl/cgtzgl',
children: [
{ id: id(), title: '采购台账管理', path: '/mgr/sbwh/sbwzgl/cgtzgl' },
{ id: id(), title: '库存核算管理', path: '/mgr/sbwh/sbwzgl/kchsgl' },
{ id: id(), title: '备品备件管理', path: '/mgr/sbwh/sbwzgl/bpbjgl' },
{ id: id(), title: '综合分析考核', path: '/mgr/sbwh/sbwzgl/zhfxkh' },
]
},
]
},
{
id: id(), title: '工程运行', redirect: '/mgr/gcyx/xxcx/jbqk', icon: 'sz',
children: [
{
id: id(), title: '信息查询', redirect: '/mgr/gcyx/xxcx/jbqk',
children: [
{ id: id(), title: '基本情况', path: '/mgr/gcyx/xxcx/jbqk' },
{ id: id(), title: '运行情况', path: '/mgr/gcyx/xxcx/yxqk' },
{ id: id(), title: '统计报表', path: '/mgr/gcyx/xxcx/tjbb' },
{ id: id(), title: '操作日志', path: '/mgr/gcyx/xxcx/czrz' },
]
},
]
},
{
id: id(), title: '系统管理', redirect: '/mgr/xtgl/yhxx', icon: 'sz',
children: [
{
id: id(), title: '用户信息', path: '/mgr/xtgl/yhxx',
},
]
},
]
// handelTreeData(data,id)
const tree = buildTree(data,0)
const tree2 = tree?.filter((item:any) =>(item.menuId != "1" && item.menuId != "2" && item.menuId != "3"))
handelTreeData(tree2,id)
return tree2
// const id = idgen()
// return [
// { id: id(), title: '首页', path: '/home', icon: 'yzt' },
// {
// id: id(), title: '监测数据', redirect: '/mgr/jcsj/jcsj', icon: 'sz',
// children: [
// {
// id: id(), title: '监测数据', path: '/mgr/jcsj/jcsj',
// },
// {
// id: id(), title: '报警管理', redirect: '/mgr/jcsj/bjgl/bjjl',
// children: [
// { id: id(), title: '报警记录', path: '/mgr/jcsj/bjgl/bjjl' },
// { id: id(), title: '报警规则配置', path: '/mgr/jcsj/bjgl/bjgzpz' },
// ]
// },
// ]
// },
// { id: id(), title: '安全监测', path: '/mgr/aqjc', icon: 'sz' },
// {
// id: id(), title: '设备维护', redirect: '/mgr/sbwh/wxyhgl/wxfabz', icon: 'sz',
// children: [
// {
// id: id(), title: '维修养护管理', redirect: '/mgr/sbwh/wxyhgl/wxfabz',
// children: [
// { id: id(), title: '维护方案编制', path: '/mgr/sbwh/wxyhgl/wxfabz' },
// { id: id(), title: '实施过程记录', path: '/mgr/sbwh/wxyhgl/ssgcjl' },
// { id: id(), title: '维护项目验收', path: '/mgr/sbwh/wxyhgl/whxmys' },
// ]
// },
// {
// id: id(), title: '设备物资管理', redirect: '/mgr/sbwh/sbwzgl/cgtzgl',
// children: [
// { id: id(), title: '采购台账管理', path: '/mgr/sbwh/sbwzgl/cgtzgl' },
// { id: id(), title: '库存核算管理', path: '/mgr/sbwh/sbwzgl/kchsgl' },
// { id: id(), title: '备品备件管理', path: '/mgr/sbwh/sbwzgl/bpbjgl' },
// { id: id(), title: '综合分析考核', path: '/mgr/sbwh/sbwzgl/zhfxkh' },
// ]
// },
// ]
// },
// {
// id: id(), title: '工程运行', redirect: '/mgr/gcyx/xxcx/jbqk', icon: 'sz',
// children: [
// {
// id: id(), title: '信息查询', redirect: '/mgr/gcyx/xxcx/jbqk',
// children: [
// { id: id(), title: '基本情况', path: '/mgr/gcyx/xxcx/jbqk' },
// { id: id(), title: '运行情况', path: '/mgr/gcyx/xxcx/yxqk' },
// { id: id(), title: '统计报表', path: '/mgr/gcyx/xxcx/tjbb' },
// { id: id(), title: '操作日志', path: '/mgr/gcyx/xxcx/czrz' },
// ]
// },
// ]
// },
// {
// id: id(), title: '系统管理', redirect: '/mgr/xtgl/yhxx', icon: 'sz',
// children: [
// {
// id: id(), title: '用户信息', path: '/mgr/xtgl/yhxx',
// },
// {
// id: id(), title: '部门管理', path: '/mgr/xtgl/bmgl',
// },
// {
// id: id(), title: '角色管理', path: '/mgr/xtgl/jsgl',
// },
// {
// id: id(), title: '菜单管理', path: '/mgr/xtgl/cdgl',
// },
// ]
// },
// ]
}
export function defaultHomePage() {

View File

@ -7,10 +7,10 @@ const apiurl = {
setMenu: service_fxdd + '/visitMenuLog/insert',
setPassword: service_fxdd + '/user/updateSecretKey',
login: {
login: service_xyt + '/login',
info: service_xyt + '/getInfo',
router: service_xyt + '/getRouters',
role: service_xyt + '/system/menu/list'
login: service_ykz + '/login',
info: service_ykz + '/getInfo',
router: service_ykz + '/getRouters',
role: service_ykz + '/system/menu/list'
},
home: {
@ -23,6 +23,16 @@ const apiurl = {
getDamData: service_xyt + '/gatePore/listByStcd',
getVideo: service_xyt + '/gateValveCctvRel/list'
},
jcsj: {
bjgl: {
bjgzpz: {
page: service_ykz + '/warnRule/page',
save: service_ykz +'/warnRule/insert',
edit: service_ykz +'/warnRule/update',
delete:service_ykz +'/warnRule/del'
}
}
},
sbwh: {
whfabz: {
page: service_ykz + '/maintainPlan/page',
@ -80,9 +90,58 @@ const apiurl = {
downloadUrl: service_ykz + '/sparePartsInfo/file/download',
export:service_ykz + '/sparePartsInfo/export'
}
}
},
gcyx: {
jbqk: {
list: service_ykz + '/projectBasicInfo/list',
edit: service_ykz + '/projectBasicInfo/update',
export:service_ykz + '/projectBasicInfo/export'
}
},
systemM: {
userM: {
page: service_ykz + "/system/user/list",
save: service_ykz + "/system/user",
list: service_ykz + "/system/role/list",
update: service_ykz + "/system/user/profile/updatePwd",
profile: service_ykz + "/system/user/profile",
avatar:service_ykz + "/common/download/resource"
},
menuM: {
page: service_ykz + "/system/menu/list",
menu:service_ykz + "/system/menu"
},
log: {
page: service_ykz + "/monitor/operlog/list"
},
action: {
todayData: service_fxdd + "/userLoginLog/todayCount",
activeCount: service_fxdd + "/userLoginLog/userCount",
userCount: service_fxdd + "/userLoginLog/visitCount",
hotData:service_fxdd + "/visitMenuLog/count"
}
},
//系统管理
systemManagement:{
//部门管理
dept:{
tree: service_ykz + '/system/user/deptTree',
list: service_ykz + '/system/dept/list',
deptSave: service_ykz + '/system/dept',
delete: service_ykz + '/system/dept/',
menuTree: service_ykz + '/system/menu/list'
},
user:{
list: service_ykz + '/system/user/list',
save: service_ykz + '/system/user',
},
role:{
list: service_ykz + '/system/role/list',
save: service_ykz + '/system/role',
getMenuIds: service_ykz + '/system/menu/roleMenuTreeselect/',
delete: service_ykz + '/system/role/',
}
},
}
export default apiurl

View File

@ -182,6 +182,95 @@ export function xyt_httpget2(url, data = {}) {
return send(url, options);
}
export function xyt_httpput1(url, data = {}) {
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'adcd': localStorage.getItem('ADCD6'),
"authorization":"Bearer" + ' ' + localStorage.getItem('access_token')
},
body: JSON.stringify(data),
};
return send(url, options);
}
export function xyt_httpput(url, data = {}) {
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'adcd': localStorage.getItem('ADCD6'),
"authorization":"Bearer" + ' ' + localStorage.getItem('access_token')
},
body: JSON.stringify(data),
};
return send(url, options);
}
export function xyt_httpget3(url, data = {}) {
const options = {
method: 'GET',
headers: {
"cookie":'Token=' + localStorage.getItem('access_token'),
"dataScope":"CUSTOM_WATERSHED",
"customWatershedCode":localStorage.getItem('customWatershedCode'),
"SHOW_LOADING": true,
"authorization": "Bearer" + ' ' + localStorage.getItem('access_token'),
"responseType":"arraybuffer"
},
};
return sendFile(url, options);
}
export function xyt_httpdelete(url, data = {}) {
const options = {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
'adcd': localStorage.getItem('ADCD6'),
"authorization":"Bearer" + ' ' + localStorage.getItem('access_token')
},
body: JSON.stringify(data),
};
return send(url, options);
}
export function qzc_xyt_httppost(url, data = {}) {
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
"cookie":'Token=' + localStorage.getItem('access_token'),
"dataScope":"CUSTOM_WATERSHED",
"customWatershedCode":localStorage.getItem('customWatershedCode'),
"SHOW_LOADING": true,
"authorization":"Bearer" + ' ' + localStorage.getItem('access_token')
},
body: JSON.stringify(data),
};
return send(url, options);
}
export function qzc_xyt_httpput(url, data = {}) {
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
"cookie":'Token=' + localStorage.getItem('access_token'),
"dataScope":"CUSTOM_WATERSHED",
"customWatershedCode":localStorage.getItem('customWatershedCode'),
"SHOW_LOADING": true,
"authorization":"Bearer" + ' ' + localStorage.getItem('access_token')
},
body: JSON.stringify(data),
};
return send(url, options);
}
export function httpget3(url, data = {}) {
if (url.indexOf('?') > 0) {
@ -330,6 +419,7 @@ export function httppost2(url, data = {}) {
'Content-Type': 'application/json',
'adcd': localStorage.getItem('ADCD6'),
"gs-token": localStorage.getItem('access_token'),
"authorization":"Bearer" + ' ' + localStorage.getItem('access_token')
},
body: JSON.stringify(data),
};

View File

@ -4,6 +4,7 @@ import { Navigate, useRoutes } from 'react-router'
import DashboardLayout from '../components/DashboardLayout'
import { Dispatch } from '../models/store'
import LoginPage from './Login/index1'
import HomePage from './Home'
import Whfabz from "./Sbwh/Whfabz";
import Ssgcjl from "./Sbwh/Ssgcjl";
import Whxmys from "./Sbwh/Whxmys";
@ -17,10 +18,11 @@ import OperateLog from "./Gcyx/InformationSearch/OperateLog";
import Jcsj from './WatchData/Jcsj';
import PoliceRecord from './WatchData/PoliceMangant/PoliceRecord'
import PoliceRuleConfig from './WatchData/PoliceMangant/PoliceRuleConfig'
import UserInfo from './SystemMangant/UserInfo'
const HomePage = lazy(() => import('./Home'))
import UserInfo from './SystemMangant/UserInfo1'
import Dept from './SystemMangant/dept'
import Role from './SystemMangant/role'
import MenuM from './SystemMangant/menuM'
// const HomePage = lazy(() => import('./Home'))
const AppRouters: React.FC = () => {
const dispatch = useDispatch<Dispatch>()
@ -60,6 +62,9 @@ const AppRouters: React.FC = () => {
// 系统管理
{ path: 'xtgl/yhxx', element: <UserInfo /> },
{ path: 'xtgl/bmgl', element: <Dept /> },
{ path: 'xtgl/jsgl', element: <Role /> },
{ path: 'xtgl/cdgl', element: <MenuM /> },
],
},

View File

@ -1,445 +1,481 @@
import React,{useState,useEffect} from 'react'
import React, { useState, useEffect } from 'react'
import { Row, Col, Form, Input, DatePicker, Button, Upload, message, Modal, Divider } from "antd"
import { formItemLayout } from '../../../../components/crud/FormLayoutProps'
import moment from 'moment';
import { httppost2,httppost5 } from '../../../../utils/request'
import apiurl from '../../../../service/apiurl'
import { exportFile } from '../../../../utils/tools'
import './index.less'
export default function BasicSituation() {
const [form] = Form.useForm();
const [skdisabled, setSkDisabled] = useState(true)
const [form] = Form.useForm();
const [skdisabled, setSkDisabled] = useState(true)
const [basicObj, setBasicObj] = useState({})
const getBasicInfo = async () => {
try {
const res = await httppost2(apiurl.gcyx.jbqk.list)
if (res.code == 200) {
setBasicObj(res.data)
form.setFieldsValue(res.data)
}
} catch (error) {
console.log(error);
}
}
const onFinish = async (val) => {
try {
const res = await httppost2(apiurl.gcyx.jbqk.edit, { ...basicObj, ...val })
if (res.code == 200) {
setSkDisabled(true)
message.success('编辑成功')
}
} catch (error) {
console.log(error);
}
}
// 导出
const exportExcel = () => {
httppost5(apiurl.gcyx.jbqk.export).then(res => {
exportFile(`基本情况.xlsx`, res.data)
})
}
useEffect(() => {
getBasicInfo()
}, [])
return (
<div className='content-root clearFloat xybm xxcx' style={{paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{ width: "100%", overflowY: "auto" }}>
<Form
form={form}
{...formItemLayout}
// onFinish={onFinish}
>
<Row >
<Col span={12}>
<Form.Item>
<div style={{ display: 'flex', columnGap: 20,marginBottom:20 }}>
{
skdisabled ? <Button type="primary" onClick={() => setSkDisabled(false)}>编辑</Button> :
<div style={{ display: 'flex', columnGap: 20 }}>
<Button onClick={() => setSkDisabled(true)}>取消</Button>
<Button type="primary" onClick={() => { }}>保存</Button>
</div>
}
<Button onClick={() => { }} >导出</Button>
<div className='content-root clearFloat xybm xxcx' style={{ paddingBottom: "0" }}>
<div className='lf CrudAdcdTreeTableBox' style={{ width: "100%", overflowY: "auto" }}>
<Form
form={form}
{...formItemLayout}
onFinish={onFinish}
>
<Row >
<Col span={12}>
<Form.Item>
<div style={{ display: 'flex', columnGap: 20, marginBottom: 20 }}>
{
skdisabled ? <Button type="primary" onClick={() => setSkDisabled(false)}>编辑</Button> :
<div style={{ display: 'flex', columnGap: 20 }}>
<Button onClick={() => setSkDisabled(true)}>取消</Button>
<Button type="primary" htmlType="submit">保存</Button>
</div>
}
<Button onClick={exportExcel} >导出</Button>
</div>
</Form.Item>
</Col>
</Row>
<div style={{width:'100%',padding:'15px 10px',background:"#e0edff",fontSize:16,color:'#02a7f0',fontWeight:700}}>水文</div>
<Row style={{background:"#f0f8fe",padding:10}}>
<Col span={8}>
<Form.Item
label="全流域面积(km²)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"6%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="利用水文系列年限(年)"
name="resCode"
labelCol={{
style: { marginLeft:"13%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="多年平均年径流量(m³)"
name="regSn"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"8%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{background:"#f0f8fe",padding:'10px'}}>
<Col span={8}>
<Form.Item
label="多年平均流量(m³/s)"
name="regTime"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"2.5%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="设计洪水标准P%相应流量(m³/s)"
name="resLoc"
labelCol={{
style: { marginLeft:"0%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<div style={{width:'100%',padding:'15px 10px',background:"#e0edff",fontSize:16,color:'#02a7f0',fontWeight:700}}>工程规模</div>
<Row style={{background:"#f0f8fe",padding:10}}>
<Col span={8}>
<Form.Item
label="设计灌溉面积(万亩)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"2.5%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="灌溉保证率(%)"
name="resCode"
labelCol={{
style: { marginLeft:"21%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="设计引水流量(m³/s)"
name="regSn"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"11%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{background:"#f0f8fe",padding:'10px'}}>
<Col span={8}>
<Form.Item
label="外江设计洪水位(m)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"2.5%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="外江最高运行水位(m)"
name="resCode"
labelCol={{
style: { marginLeft:"13%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="灌溉设计水位(m)"
name="regSn"
labelCol={{
style: { marginLeft:"14%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<div style={{width:'100%',padding:'15px 10px',background:"#e0edff",fontSize:16,color:'#02a7f0',fontWeight:700}}>建设征地与移民安置</div>
<Row style={{background:"#f0f8fe",padding:10}}>
<Col span={8}>
<Form.Item
label="永久征地面积(亩)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"5.5%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="临时用地(亩)"
name="resCode"
labelCol={{
style: { marginLeft:"24%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="搬迁安置人口(人)"
name="regSn"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"15%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<div style={{width:'100%',padding:'15px 10px',background:"#e0edff",fontSize:16,color:'#02a7f0',fontWeight:700}}>主要建筑物及设备</div>
<Row style={{background:"#f0f8fe",padding:10}}>
<Col span={8}>
<Form.Item
label="水闸形式"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"15.5%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={16}>
<Form.Item
label="水闸地基特性"
name="resCode"
labelCol={{
style: { marginLeft:"11%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'133%'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{background:"#f0f8fe",padding:'10px 10px 0 10px'}}>
<Col span={8}>
<Form.Item
label="水闸地震动参数(g)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"3.5%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸地震基本烈度(度)"
name="resCode"
labelCol={{
style: { marginLeft:"11.5%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸地震设计烈度(度)"
name="regSn"
labelCol={{
style: { marginLeft:"10%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{background:"#f0f8fe",padding:'0 10px'}}>
<Col span={8}>
<Form.Item
label="水闸闸顶高程(m)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"5.5%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸底槛高程(m)"
name="resCode"
labelCol={{
style: { marginLeft:"17%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸闸孔尺寸(m)"
name="regSn"
labelCol={{
style: { marginLeft:"16%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{background:"#f0f8fe",padding:'0 10px'}}>
<Col span={8}>
<Form.Item
label="水闸工作闸门数量(个)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"0%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸事故闸门数量(个)"
name="resCode"
labelCol={{
style: { marginLeft:"11%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸闸室长度(m)"
name="regSn"
labelCol={{
style: { marginLeft:"16%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{background:"#f0f8fe",padding:'0 10px'}}>
<Col span={8}>
<Form.Item
label="荆江大堤堤防级别(级)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"0%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="荆江大堤堤顶宽度(m)"
name="resCode"
labelCol={{
style: { marginLeft:"11%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="穿堤箱涵长度(m)"
name="regSn"
labelCol={{
style: { marginLeft:"16%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{background:"#f0f8fe",padding:'0 10px'}}>
<Col span={8}>
<Form.Item
label="箱涵尺寸"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"15%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="消能方式"
name="resCode"
labelCol={{
style: { marginLeft:"26%"}
}}
style={{marginBottom:0}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="消力池长度(m)"
name="regSn"
labelCol={{
style: { marginLeft:"19%"}
}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{background:"#f0f8fe",padding:'0 10px'}}>
<Col span={8}>
<Form.Item
label="出口海漫长度(m)"
name="resName"
style={{marginBottom:0}}
labelCol={{
style: { marginLeft:"5%"}
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
</Form>
</div>
</div>
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', padding: '15px 10px', background: "#e0edff", fontSize: 16, color: '#02a7f0', fontWeight: 700 }}>水文</div>
<Row style={{ background: "#f0f8fe", padding: 10 }}>
<Col span={8}>
<Form.Item
label="全流域面积(km²)"
name="basArea"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "6%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="利用水文系列年限(年)"
name="yearLimit"
labelCol={{
style: { marginLeft: "13%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="多年平均年径流量(亿m³)"
name="annualAvgYearQ"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "8%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ background: "#f0f8fe", padding: '10px' }}>
<Col span={8}>
<Form.Item
label="多年平均流量(m³/s)"
name="annualAvgQ"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "2.5%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="设计洪水标准P%相应流量(m³/s)"
name="desStandardQ"
labelCol={{
style: { marginLeft: "0%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', padding: '15px 10px', background: "#e0edff", fontSize: 16, color: '#02a7f0', fontWeight: 700 }}>工程规模</div>
<Row style={{ background: "#f0f8fe", padding: 10 }}>
<Col span={8}>
<Form.Item
label="设计灌溉面积(万亩)"
name="designIrrArea"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "2.5%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="灌溉保证率(%)"
name="irrEnsureRate"
labelCol={{
style: { marginLeft: "21%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="设计引水流量(m³/s)"
name="desDiverQ"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "11%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ background: "#f0f8fe", padding: '10px' }}>
<Col span={8}>
<Form.Item
label="外江设计洪水位(m)"
name="outerDesFlood"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "2.5%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="外江最高运行水位(m)"
name="outerMaxRunFlood"
labelCol={{
style: { marginLeft: "13%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="灌溉设计水位(m)"
name="irrDesFlood"
labelCol={{
style: { marginLeft: "14%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', padding: '15px 10px', background: "#e0edff", fontSize: 16, color: '#02a7f0', fontWeight: 700 }}>建设征地与移民安置</div>
<Row style={{ background: "#f0f8fe", padding: 10 }}>
<Col span={8}>
<Form.Item
label="永久征地面积(亩)"
name="perLandArea"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "5.5%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="临时用地(亩)"
name="tempLandUse"
labelCol={{
style: { marginLeft: "24%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="搬迁安置人口(人)"
name="resetPopulation"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "15%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<div style={{ width: '100%', padding: '15px 10px', background: "#e0edff", fontSize: 16, color: '#02a7f0', fontWeight: 700 }}>主要建筑物及设备</div>
<Row style={{ background: "#f0f8fe", padding: 10 }}>
<Col span={8}>
<Form.Item
label="水闸形式"
name="gateType"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "15.5%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={16}>
<Form.Item
label="水闸地基特性"
name="foundCharacter"
labelCol={{
style: { marginLeft: "11%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '133%' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ background: "#f0f8fe", padding: '10px 10px 0 10px' }}>
<Col span={8}>
<Form.Item
label="水闸地震动参数(g)"
name="groundMotionPara"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "3.5%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸地震基本烈度(度)"
name="basicSeisIntensity"
labelCol={{
style: { marginLeft: "11.5%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸地震设计烈度(度)"
name="desSeisIntensity"
labelCol={{
style: { marginLeft: "10%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ background: "#f0f8fe", padding: '0 10px' }}>
<Col span={8}>
<Form.Item
label="水闸闸顶高程(m)"
name="gateTopElev"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "5.5%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸底槛高程(m)"
name="gateBottomElev"
labelCol={{
style: { marginLeft: "17%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸闸孔尺寸(m)"
name="gatePoreSize"
labelCol={{
style: { marginLeft: "16%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ background: "#f0f8fe", padding: '0 10px' }}>
<Col span={8}>
<Form.Item
label="水闸工作闸门数量(个)"
name="gateWorkNum"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "0%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸事故闸门数量(个)"
name="gateAccNum"
labelCol={{
style: { marginLeft: "11%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水闸闸室长度(m)"
name="gateRoomLen"
labelCol={{
style: { marginLeft: "16%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ background: "#f0f8fe", padding: '0 10px' }}>
<Col span={8}>
<Form.Item
label="荆江大堤堤防级别(级)"
name="dikeLevel"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "0%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="荆江大堤堤顶宽度(m)"
name="dikeTopWidth"
labelCol={{
style: { marginLeft: "11%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="穿堤箱涵长度(m)"
name="dikeBoxLen"
labelCol={{
style: { marginLeft: "16%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ background: "#f0f8fe", padding: '0 10px' }}>
<Col span={8}>
<Form.Item
label="箱涵尺寸"
name="dikeBoxSize"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "15%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="消能方式"
name="elimMethod"
labelCol={{
style: { marginLeft: "26%" }
}}
style={{ marginBottom: 0 }}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="消力池长度(m)"
name="dissPoolLen"
labelCol={{
style: { marginLeft: "19%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
<Row style={{ background: "#f0f8fe", padding: '0 10px' }}>
<Col span={8}>
<Form.Item
label="出口海漫长度(m)"
name="exportSeaLen"
style={{ marginBottom: 0 }}
labelCol={{
style: { marginLeft: "5%" }
}}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
</Row>
</Form>
</div>
</div>
)
}

View File

@ -53,7 +53,7 @@ const Page = () => {
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='content-root clearFloat xybm' style={{paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
<Card className='nonebox'>
<ToolBar

View File

@ -80,7 +80,7 @@ const Page = () => {
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='content-root clearFloat xybm' style={{paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
<Card className='nonebox'>
<ToolBar

View File

@ -59,7 +59,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
<RangePicker
allowClear
showTime
style={{ width: "300px" }}
style={{ width: "330px" }}
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item>

View File

@ -33,13 +33,11 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
values.createUserName = userName;
values.startTime = values.tm ? moment(values.tm[0]).format("YYYY-MM-DD 00:00:00") : '';
values.endTime = values.tm ? moment(values.tm[1]).format("YYYY-MM-DD 00:00:00") : '';
values.files = fileIds;
if (mode === 'edit') {
values.files = fileIds;
values.id = record.id;
onEdit(apiurl.sbwh.ssgcjl.edit, values)
onEdit(apiurl.sbwh.ssgcjl.edit,{...record,...values});
}
if (mode === 'save') {
values.files = fileIds
onSave(apiurl.sbwh.ssgcjl.save, values)
}
}

View File

@ -87,7 +87,7 @@ const Page = () => {
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='content-root clearFloat xybm' style={{paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
<Card className='nonebox'>
<ToolBar

View File

@ -0,0 +1,277 @@
import React, { useEffect, useState } from 'react';
import { Form, Button, Input, message, Row, Col, DatePicker, Upload, Image, Radio } from 'antd';
import { DeleteOutlined, FileWordOutlined, FilePdfOutlined, FilePptOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import apiurl from '../../../service/apiurl';
import { xyt_httpget2, xyt_httpget3 } from '../../../utils/request';
import { createCrudService } from '../../../components/crud/_';
import moment from 'moment';
import DeptTreeSelect from '../../../components/Form/DeptTreeSelect_xyt'
import NormalSelect from '../../../components/Form/NormalSelect';
const { Dragger } = Upload;
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const ModalForm = ({ mode, record, onEdit, onSave }) => {
if (record.prodDate) {
record.myTm = moment(record.prodDate)
}
const defaultAvatar = `${process.env.PUBLIC_URL}/assets/images/touxiang.png`
const [form] = Form.useForm();
const [fileList, setFileList] = useState([]) //上传文件列表
const [fileIds, setFileIds] = useState('')
const [flag, setFlag] = useState(true)
const [loading, setLoading] = useState(false)
const [userParams, setUserParams] = useState({})
const [roleOptions, setRoleOptions] = useState([])
const [imageSrc, setImageSrc] = useState(defaultAvatar)
/**
* @description 上传图片
* @param {string} file 上传的文件
*/
const fileChange = (info) => {
console.log("info", info);
if (info.file.status === "done") {
setLoading(false);
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
setFileIds(info.file?.response?.imgUrl)
setFileList(info.fileList)
setFlag(false)
getImgFlow(info.file?.response?.imgUrl)
}
const getUserInfo = async (id) => {
try {
const res = await xyt_httpget2(`${apiurl.systemM.userM.save}/${id}`)
const result = { ...res.data, roleIds: res.roleIds, postIds: res.postIds }
setUserParams(result)
form.setFieldValue("roleIds", result?.roleIds)
} catch (error) {
console.log(error);
}
}
const getroleList = async () => {
try {
const res = await xyt_httpget2(apiurl.systemM.userM.list, { pageNum: 1, pageSize: 9999 })
setRoleOptions(res.rows.map(item => ({ label: item.roleName, value: item.roleId })))
} catch (error) {
}
}
const onFinish = () => {
let values = form.getFieldsValue()
values.avatar = fileIds;
if (mode === 'edit') {
onEdit(apiurl.systemM.userM.save, { ...userParams, ...values })
}
if (mode === 'save') {
onSave(apiurl.systemM.userM.save, values)
}
}
/**
* @description 获取查看时文件
* @param {*} type
* @returns
*/
const getFileInfo = async (params) => {
try {
const res = xyt_httpget2(apiurl.systemM.userM.profile)
setImageSrc(res.data?.avatar)
// return {
// name: item.data.fileName,
// response: {
// data: {
// filePath: item.data.filePath,
// fileId:item.data.fileId
// }
// },
// }
} catch (error) {
console.log(error);
}
}
// 获取用户头像
const getImgFlow = async (avatar) => {
try {
if (avatar) {
const res = await xyt_httpget3(apiurl.systemM.userM.avatar + `?resource=${avatar}`)
let blob = new Blob([res.data], { type: 'application/octet-stream' })
const downloadUrl = URL.createObjectURL(blob);
setImageSrc(downloadUrl)
} else {
setImageSrc(defaultAvatar)
}
} catch (error) {
console.log(error);
}
}
useEffect(() => {
console.log(record);
if (mode != "save") {
// getFileInfo()
getImgFlow(record.avatar)
}
}, [record, mode])
useEffect(() => {
if (record.userId) {
getUserInfo(record.userId)
}
}, [record])
useEffect(() => {
if (mode != 'save') {
form.setFieldValue("password", localStorage.getItem("password") || "")
} else {
form.setFieldValue('sex','0')
}
getroleList()
}, [])
return (
<div style={{ display: "flex", columnGap: 10 }}>
<div style={{ width: 850 }}>
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
<Row>
<Col span={12}>
<Form.Item
label="用户账号"
name="userName"
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="用户姓名"
name="nickName"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="登录密码"
name="password"
rules={[{ required: true }]}
>
<Input.Password disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="手机号码"
name="phonenumber"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="性别"
name="sex"
>
<Radio.Group disabled={mode === 'view'}>
<Radio value="0"></Radio>
<Radio value="1"></Radio>
</Radio.Group>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="邮箱"
name="email"
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="部门分配"
name="deptId"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<DeptTreeSelect disabled={mode === 'view'}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="角色分配"
name="roleIds"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<NormalSelect
disabled={mode === 'view'}
style={{ width: '100%' }}
allowClear
mode="multiple"
options={roleOptions}
optionFilterProp="label"
/>
</Form.Item>
</Col>
</Row>
</Form>
</div>
<div style={{
position: "relative",
display: 'flex',
flexDirection: "column",
alignItems: "center",
rowGap: 20,
width: 100,
marginTop: 30,
}}>
<Image
src={imageSrc}
style={{ borderRadius: "50%", height: 100 }}
/>
{mode !== "view" &&
<Upload
name='avatarfile'
// multiple
action="/gunshiApp/xyt/system/user/profile/avatar"
onChange={fileChange}
fileList={fileList}
disabled={loading}
headers={
{
'Authorization': 'Bearer ' + localStorage.getItem('access_token')
}
}
>
<Button>修改头像</Button>
</Upload>
}
{mode != "view" ? <div style={{ position: "absolute", bottom: 0, left: -40, display: "flex", columnGap: 20 }}>
<Button onClick={() => form.resetFields()}>重置</Button>
<Button type='primary' onClick={() => onFinish()}>提交</Button>
</div> : null}
</div>
</div>
);
}
export default ModalForm;

View File

@ -0,0 +1,107 @@
import React, { Fragment, useRef, useMemo, useEffect, useState } from 'react';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, Dropdown, Space, Divider, Form, Row, Col, Input, Button, Modal, Popconfirm, message } from 'antd';
import { DownOutlined } from "@ant-design/icons"
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable2';
import { createCrudService } from '../../../components/crud/_';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import moment from 'moment';
import { xyt_httpput1 } from '../../../utils/request';
const Page = () => {
const [form] = Form.useForm();
const refModal = useRef();
const [searchVal, setSearchVal] = useState({})
const [selectedRowKeys, setselectedRowKeys] = useState([])
const [dropItem, setDropItem] = useState({})
const [passwordOpen, setPasswordOpen] = useState(false)
const [dashOpen, setDashOpen] = useState(false)
const columns = [
{ title: '用户帐号', key: 'userName', dataIndex: 'userName', width: 150, align: "center" },
{ title: '用户姓名', key: 'nickName', dataIndex: 'nickName', width: 150, align: "center" },
{ title: '手机号码', key: 'phonenumber', dataIndex: 'phonenumber', width: 140, align: "center" },
// { title: '入职日期', key: 'prodDate', dataIndex: 'prodDate', width: 140,align:"center" },
// { title: '工号', key: 'departNum', dataIndex: 'departNum', width: 150, align:"center" },
{
title: '部门', key: 'departmentName', dataIndex: 'departmentName', width: 150, align: "center",
render: (v, r) => <span>{r?.dept?.deptName}</span>
},
{ title: '状态', key: 'status', dataIndex: 'status', width: 100, align: "center", render: (v) => <span>{!v ? "正常" : "异常"}</span> },
{
title: '创建日期', key: 'createTime', dataIndex: 'createTime', width: 150, align: "center",
},
{
title: '操作', key: 'action', dataIndex: 'action', width: 150, align: "center",
render: (v, r) => (
<Space size="middle">
<a onClick={() => command("view")(r)}>查看</a>
<a onClick={() => command("edit")(r)}>编辑</a>
<Popconfirm title="确定要删除吗?" onConfirm={() => command("del")(r)}>
<Button type="link" size="small" title="删除" style={{ color: "red" }}>删除</Button>
</Popconfirm>
</Space>
)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave();
} else if (type === 'edit') {
refModal.current.showEdit(params);
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onUerDeleteGet(`${apiurl.systemM.userM.save}/${params.userId}`);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.systemM.userM.page).xyt_find_noCode);
useEffect(() => {
if (searchVal) {
const params = {
search: searchVal
};
search(params)
}
}, [searchVal])
return (
<>
<div className='content-root clearFloat xybm' style={{ paddingRight: 14, paddingBottom: "0" }}>
<div className='adcdTableBox' style={{ height: "calc(100vh - 110px)" }}>
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onSave={command('save')}
dispatchBtn={selectedRowKeys.length > 0 ? true : false}
setDashOpen={setDashOpen}
/>
</Card>
<Divider style={{ margin: "10px 0" }} />
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table
columns={columns}
rowKey="inx"
{...tableProps}
scroll={{ x: width, y: "calc( 100vh - 400px )" }}
/>
</div>
</div>
<BasicCrudModal
width={1000}
ref={refModal}
title="用户"
component={ModalForm}
onCrudSuccess={() => { refresh({ addvcd: localStorage.getItem('ADCD6') }) }}
/>
</div>
</>
);
}
export default Page;

View File

@ -0,0 +1,27 @@
import { Form, Input, Button } from 'antd';
const ToolBar = ({ setSearchVal, onSave, dispatchBtn = false, setDashOpen }) => {
return (
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form className='toolbarBox' layout="inline" onFinish={(v) => setSearchVal(v)}>
<Form.Item label="用户" name="userName">
<Input allowClear placeholder='请输入账号/姓名/手机号查询' style={{ width: '250px' }} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button onClick={onSave}>新建用户</Button>
</Form.Item>
</Form>
{/* <Button type='primary' onClick={() =>setDashOpen(true)}>回收站</Button> */}
{/* {dispatchBtn ? <Button onClick={onSave}>批量删除</Button> : null} */}
</div>
);
}
export default ToolBar;

View File

@ -0,0 +1,107 @@
import React,{useEffect,useState} from 'react';
import { Form, Button, Input, Row, Col, DatePicker, InputNumber, message } from 'antd';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import apiurl from '../../../service/apiurl';
import DeptTreeSelect from '../../../components/Form/DeptTreeSelect_xyt'
import moment from 'moment';
import { qzc_xyt_httppost, qzc_xyt_httpput } from '../../../utils/request';
const ModalForm = ({ mode, record,onEdit,onSave, onCrudSuccess, close }) => {
const [form] = Form.useForm();
const onFinish = async(values) => {
values.status = "0"
if (mode === 'edit') {
values.deptId = record.deptId
const res = await qzc_xyt_httpput(apiurl.systemManagement.dept.deptSave,values)
if(res?.code===200){
message.success('修改成功')
onCrudSuccess()
close()
}else{
message.error('修改失败')
}
}
if (mode === 'save') {
const res = await qzc_xyt_httppost(apiurl.systemManagement.dept.deptSave,values)
if(res?.code===200){
message.success('新增成功')
onCrudSuccess()
close()
}else{
message.error('新增失败')
}
}
}
return (
<>
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
<Form.Item
label="部门名称"
name="deptName"
labelCol={{ span: 5 }}
wrapperCol={{ span: 18 }}
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="上级部门"
name="parentId"
labelCol={{ span: 5 }}
wrapperCol={{ span: 18 }}
rules={[{ required: true }]}
>
<DeptTreeSelect/>
</Form.Item>
<Form.Item
label="部门排序"
name="orderNum"
labelCol={{ span: 5 }}
wrapperCol={{ span: 18 }}
rules={[{ required: true }]}
>
<InputNumber min={0} disabled={mode==='view'} style={{width:'100%'}} />
</Form.Item>
<Form.Item
label="备注"
name="remark"
labelCol={{ span: 5 }}
wrapperCol={{ span: 18 }}
// rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '增加' : '修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
</>
);
}
export default ModalForm;

View File

@ -0,0 +1,153 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, message } from 'antd';
import {DownOutlined} from "@ant-design/icons"
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable';
import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import moment from 'moment';
import { httpget2, xyt_httpget2, httpdelete } from '../../../utils/request';
const Page = () => {
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const [data, setData] = useState([])
const [expandedRowKeys, setExpandedRowKeys] = useState([])
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center", render: (v, r, i) => <span>{i + 1}</span>},
{ title: '排序号', key: 'orderNum', dataIndex: 'orderNum', width: 80,align:"center" },
{ title: '名称', key: 'deptName', dataIndex: 'deptName', width: 150, align:"center" },
{ title: '备注', key: 'remark', dataIndex: 'remark', width: 230,align:"center" },
{ title: '数据更新时间', key: 'createTime', dataIndex: 'createTime', width: 150,align:"center",},
{
title: '操作', key: 'operation', width: 240, fixed: 'right', align: 'center',
render: (value, row, index) => (<CrudOpRender_text del={true} edit={true} command={(cmd) => () => command(cmd)(row)} />)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => async(params) => {
if (type === 'save') {
refModal.current.showSave({tree:data});
} else if (type === 'edit') {
refModal.current.showEdit({...params, tree:data});
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
const {code, msg} = await httpdelete(apiurl.systemManagement.dept.delete+params.deptId)
if(code===200){
getData(searchVal)
message.success('删除成功')
}else{
message.error(msg)
}
}
}
const onEdit = (path,values) => {
createCrudService(path).edit(values).then((result) => {
if (result?.code === 200) {
getData()
}
})
}
const convertToTree = (flatData, parentId = null) => {
const result = [];
const map = {};
// 先构建一个id映射表
flatData.forEach((item,i) => {
map[item.deptId] = { ...item, inx:i+1,children: [] };
});
// 然后根据parentId将子节点添加到父节点的children属性下
flatData.forEach((item,i) => {
if (item.parentId !== 0) {
map[item.parentId].children.push(map[item.deptId]);
} else {
result.push(map[item.deptId]);
}
});
return result;
}
const buildTree = (data, parentId)=> {
let tree = [];
data.forEach((node) => {
node.title = node.deptName;
node.key = node.deptId;
if (node.parentId === parentId) {
let children = buildTree(data, node.deptId);
if (children.length) {
node.children = children;
}
tree.push(node);
}
});
return tree;
}
const getData = async(params) => {
try {
const res = await xyt_httpget2(apiurl.systemManagement.dept.list,params)
let data = []
if(params.deptName){
data = res.data
}else{
data = convertToTree(res.data)
}
setData(data)
} catch (error) {
}
}
useEffect(() => {
getData(searchVal)
}, [searchVal])
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:14,paddingBottom:"0"}}>
<div className='adcdTableBox'>
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onSave={command('save')}
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table
columns={columns}
rowKey="deptId"
dataSource={data}
scroll={{ x: width, y: "calc( 100vh - 400px )" }}
expandable={{
expandedRowKeys,
onExpandedRowsChange: (v, r) => {
console.log(v,r);
setExpandedRowKeys(v)
}
}}
/>
</div>
</div>
<BasicCrudModal
width={600}
ref={refModal}
title=""
component={ModalForm}
extraFun={getData}
onCrudSuccess={() => {getData(searchVal)}}
/>
</div>
</>
);
}
export default Page;

View File

@ -0,0 +1,36 @@
import React, { useEffect,useState } from 'react';
import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
// import '../../../index.less'
const ToolBar = ({ setSearchVal, onSave, onChecked }) => {
const [form] = Form.useForm();
// const [source,setSource] = useState([])
// const [sttp,setSttp] = useState([])
const onFinish = (val) => {
setSearchVal(val);
}
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="部门名称" name="deptName">
<Input allowClear placeholder='请输入用户名称' style={{width:'180px'}}/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button type="primary" onClick={onSave}>新增</Button>
</Form.Item>
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -0,0 +1,178 @@
import React, { useEffect, useState } from 'react';
import { Form, Button, Input, message, Row, Col, DatePicker, Upload, Image, Radio, TreeSelect } from 'antd';
import apiurl from '../../../service/apiurl';
import {btnItemLayout,formItemLayout } from '../../../components/crud/FormLayoutProps';
const ModalForm = ({ mode, record, onUerEdit, onSave, close }) => {
console.log("record", record);
const [form] = Form.useForm();
const [treeData, setTreeData] = useState([])
const [menuType, setMenuType] = useState('')
const onFinish = () => {
const values = form.getFieldsValue()
if (mode === 'edit') {
onUerEdit(apiurl.systemM.menuM.menu, { ...record, ...values, tree: undefined, menuId: record?.menuId })
}
if (mode === 'save') {
onSave(apiurl.systemM.menuM.menu,
{
...values,
parentId:
values.menuId,
menuId: undefined,
// visible: "0",
// isCache: "0",
// isFrame:"1"
})
}
}
const onValuesChange = (values) => {
if (Object.keys(values)[0] == "menuType") {
setMenuType(values.menuType)
}
}
useEffect(() => {
if (mode !== "view") {
const data = [
{
children: record.tree,
menuId: 0,
parentId: 0,
menuName: "根目录"
}
]
setTreeData(data)
}
if (record.menuType) {
setMenuType(record.menuType)
}
if (mode != "save") {
console.log("record", record);
form.setFieldValue("menuId", record?.parentId)
form.setFieldValue("status", Number(record.status))
}
}, [record, mode])
return (
<>
<div >
<Form
form={form}
{...formItemLayout}
onFinish={onFinish}
initialValues={record}
onValuesChange={onValuesChange}
>
<Row>
<Col span={24}>
<Form.Item
label="类型"
name="menuType"
rules={[{ required: true }]}
>
<Radio.Group>
<Radio value="M">目录</Radio>
<Radio value="C">菜单</Radio>
<Radio value="F">按钮</Radio>
</Radio.Group>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="菜单图标"
name="icon"
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="名称"
name="menuName"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="上级目录"
name="menuId"
>
<TreeSelect
disabled={mode === 'view'}
style={{ width: '100%' }}
allowClear
treeData={treeData}
fieldNames={{ label: "menuName", value: "menuId", children: "children" }}
treeDefaultExpandedKeys={[0]}
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="地址"
name="path"
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="排序号"
name="orderNum"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="状态"
name="status"
rules={[{ required: true }]}
>
<Radio.Group>
<Radio value={0}>启用</Radio>
<Radio value={1}>禁用</Radio>
</Radio.Group>
</Form.Item>
</Col>
</Row>
{
mode === 'view' ? null : (
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '提交' : '修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
</div>
</>
);
}
export default ModalForm;

View File

@ -0,0 +1,170 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, Switch } from 'antd';
import {DownOutlined} from "@ant-design/icons"
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable';
import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import moment from 'moment';
import { httpget2, xyt_httpget2 } from '../../../utils/request';
const Page = () => {
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const [data, setData] = useState([])
const [expandedRowKeys, setExpandedRowKeys] = useState([])
const [allOpen, setAllOpen] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center", render: (v, r, i) => <span>{i + 1}</span>},
// { title: '类型', key: 'type', dataIndex: 'type', width: 100, align:"center" },
{ title: '名称', key: 'menuName', dataIndex: 'menuName', width: 150, align:"center" },
{ title: '地址', key: 'path', dataIndex: 'path', width: 230,align:"center" },
{ title: '排序号', key: 'orderNum', dataIndex: 'orderNum', width: 80,align:"center" },
{
title: '状态', key: 'status', dataIndex: 'status', width: 100, align: "center",
render: (v, r) => <Switch
checkedChildren="启用"
unCheckedChildren="禁用"
checked={v == 0 ? true : false} onChange={(e) => {
onEdit(apiurl.systemM.menuM.menu,{...r, status:e ? 0 : 1})
}} />
},
{
title: '数据更新时间', key: 'createTime', dataIndex: 'createTime', width: 150,align:"center",
},
{
title: '操作', key: 'operation', width: 240, fixed: 'right', align: 'center',
render: (value, row, index) => (<CrudOpRender_text del={true} edit={true} command={(cmd) => () => command(cmd)(row)} />)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave({tree:data});
} else if (type === 'edit') {
refModal.current.showEdit({...params, tree:data});
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onUerDeleteGet(`${apiurl.systemM.menuM.menu}/${params.menuId}`);
}
}
const onEdit = (path,values) => {
createCrudService(path).edit(values).then((result) => {
if (result?.code === 200) {
getData()
}
})
}
const convertToTree = (flatData, parentId = null) => {
const result = [];
const map = {};
// 先构建一个id映射表
flatData.forEach((item,i) => {
map[item.menuId] = { ...item, inx:i+1,children: [] };
});
// 然后根据parentId将子节点添加到父节点的children属性下
flatData.forEach((item,i) => {
if (item.parentId !== 0) {
map[item.parentId].children.push(map[item.menuId]);
} else {
result.push(map[item.menuId]);
}
});
return result;
}
const getData = async() => {
try {
const res = await xyt_httpget2(apiurl.systemM.menuM.page)
let data = convertToTree(res.data)
console.log("data",data);
const result = data.filter(item =>(item.menuId != "1" && item.menuId != "2" && item.menuId != "3"))
setData(result)
} catch (error) {
console.log(error);
}
}
// useEffect(() => {
// if(searchVal){
// const params = {
// search: searchVal
// };
// search(params)
// }
// }, [searchVal])
useEffect(() => {
if (allOpen.num == 2) {
const res = data.filter(item => item.children)
const res1 = res.map(item => {
if (item.children.length > 0) {
return item.children.map(o => o.menuId)
} else {
return item.menuId
}
})
let t =[...res1,data.map(item=>item.menuId)].flat()
setExpandedRowKeys([...t])
} else {
setExpandedRowKeys([])
}
console.log("allOpen",allOpen);
}, [allOpen])
useEffect(() => {
getData()
}, [])
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:14,paddingBottom:"0"}}>
<div className='adcdTableBox' style={{height:"calc(100vh - 110px)"}}>
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onSave={command('save')}
setAllOpen={setAllOpen}
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table
columns={columns}
rowKey="menuId"
dataSource={data}
scroll={{ x: width, y: "calc( 100vh - 400px )" }}
expandable={{
expandedRowKeys,
onExpandedRowsChange: (v, r) => {
console.log(v,r);
setExpandedRowKeys(v)
}
}}
/>
</div>
</div>
<BasicCrudModal
width={600}
ref={refModal}
title=""
component={ModalForm}
extraFun={getData}
// onCrudSuccess={() => { refresh({ addvcd: localStorage.getItem('ADCD6') }) }}
/>
</div>
</>
);
}
export default Page;

View File

@ -0,0 +1,25 @@
import { Form, Input, Button } from 'antd';
const ToolBar = ({ setSearchVal, onSave,setAllOpen }) => {
return (
<>
<div style={{}}>
<Form className='toolbarBox' layout="inline" onFinish={(v)=>setSearchVal(v)}>
<Form.Item>
<Button type="primary" onClick={()=>onSave()}>新增</Button>
</Form.Item>
<Form.Item>
<Button onClick={()=>setAllOpen({num:1})}>全部收起</Button>
</Form.Item>
<Form.Item>
<Button onClick={()=>setAllOpen({num:2})}>全部展开</Button>
</Form.Item>
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -0,0 +1,98 @@
import React,{useEffect,useState} from 'react';
import { Form, Button, Input, Row, Col, DatePicker, InputNumber } from 'antd';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import { getDictService } from '../../../service/SelectValue'
import { validlgtd , validlttd } from '../../../utils/validators';
import apiurl from '../../../service/apiurl';
import {mobile} from '../../../utils/validators'
import AdcdTreeSelect from '../../../components/Form/AdcdTreeSelect'
import NormalSelect from '../../../components/Form/NormalSelect';
import { config } from '../../../config';
import DeptTreeSelect from '../../../components/Form/DeptTreeSelect_xyt'
import moment from 'moment';
const ModalForm = ({ mode, record,onEdit,onSave }) => {
const [form] = Form.useForm();
const [sttp,setSttp] = useState([])
const [frgrd,setFrgrd] = useState([])
const [stbk,setStbk] = useState([])
const [usfl,setUsfl] = useState([])
const [locality,setLocality] = useState([])
const onFinish = (values) => {
if (mode === 'edit') {
// onEdit(apiurl.informationManagement.stcd.edit,values)
}
if (mode === 'save') {
// onSave(apiurl.informationManagement.stcd.save,values)
}
}
useEffect(()=>{
getOptions()
},[])
const getOptions = async ()=>{
// setSttp(await getDictService({dictType:'sttp'}))
// setFrgrd(await getDictService({dictType:'frgrd'}))
// setStbk(await getDictService({dictType:'stbk'}))
// setUsfl(await getDictService({dictType:'usfl'}))
// setLocality(await getDictService({dictType:'locality'}))
}
return (
<>
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record} style={{width:'600px',marginTop:'30px'}}>
<Form.Item
label="角色编码"
name="stnm"
labelCol={{ span: 5 }}
wrapperCol={{ span: 18 }}
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="角色名称"
name="22"
labelCol={{ span: 5 }}
wrapperCol={{ span: 18 }}
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="描述"
name="bmjj"
labelCol={{ span: 5 }}
wrapperCol={{ span: 18 }}
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '增加' : '修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
</>
);
}
export default ModalForm;

View File

@ -0,0 +1,109 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import { useSelector } from 'react-redux';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, Tabs } from 'antd';
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import { getDictService } from '../../../service/SelectValue'
import usePageTable from '../../../components/crud/usePageTable';
import { createCrudService } from '../../../components/crud/_';
import {CrudOpRender_text} from '../../../components/crud/CrudOpRender';
import RolePage from './rolePage/index'
import PersonTable from './person'
import MenuTree from './menuTree'
const Page = () => {
const refModal = useRef();
const refModal2 = useRef();
const [adcd, setAdcd] = useState(null)
const [searchVal, setSearchVal] = useState({})
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '测站名称', key: 'stnm', dataIndex: 'stnm', width: 200, ellipsis: true },
{ title: '测站编码', key: 'stcd', dataIndex: 'stcd', width: 140 },
{ title: '行政区划', key: 'adnm', dataIndex: 'adnm', width: 140 },
{ title: '站址', key: 'stlc', dataIndex: 'stlc', width: 150, ellipsis: true },
{
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (<CrudOpRender_text edit={row.source === 'SH'? true : false} del={row.source === 'SH'? true : false} view={row.source !== 'SH'? true : false} cjxgl={true} command={(cmd) => () => command(cmd)(row)} />)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave();
} else if (type === 'edit') {
refModal.current.showEdit(params);
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDelete(apiurl.informationManagement.stcd.del,{stcd:params?.stcd,source:params?.source,countycode:params?.countycode?params?.countycode:''});
} else if (type === 'cjxgl') {
refModal2.current.show(params)
}
}
// 页面初始默认查询参数
const options = {
search:{
adcd:''
},
};
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.systemManagement).find_noCode,options);
useEffect(()=>{
},[])
useEffect(()=>{
if(adcd!==null && searchVal){
const params = {
search: {
adcd,
...searchVal
}
};
search(params)
}
},[adcd,searchVal])
return (
<>
<div className='content-root clearFloat xybm deptPage' style={{paddingRight:"0",paddingBottom:"0",display:'flex'}}>
<div style={{height:'calc(100vh - 168px)',width:'100%',marginRight:'20px'}}>
<RolePage/>
</div>
{/* <div style={{width:'40%'}}>
<Tabs defaultActiveKey="1">
<Tabs.TabPane tab="用户" key="1">
<PersonTable/>
</Tabs.TabPane>
<Tabs.TabPane tab="基本信息" key="2">
<ModalForm/>
</Tabs.TabPane>
<Tabs.TabPane tab="角色权限" key="3">
<MenuTree/>
</Tabs.TabPane>
</Tabs>
</div> */}
<BasicCrudModal
width={1200}
ref={refModal}
title="测站"
component={ModalForm}
onCrudSuccess={()=>{}}
/>
</div>
</>
);
}
export default Page;

View File

@ -0,0 +1,112 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import { Tree, Card, Button, message } from 'antd';
import { PlusCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';
import BasicCrudModal from '../../../../components/crud/BasicCrudModal';
import apiurl from '../../../../service/apiurl';
import { xyt_httpget2 } from '../../../../utils/request';
import './index.less'
const TreePage = ({onChange, value, setParentId}) => {
const refModal = useRef();
const [treeData, setTreeData] = useState([]);
const [menuObj,setMenuObj] = useState({})
useEffect(()=>{
getTree()
},[])
const getTree = async()=>{
const {code, data} = await xyt_httpget2(apiurl.systemManagement.dept.menuTree)
if(code!==200){
message.error('请求失败')
return
}
const obj = {}
data.map((item)=>{
obj[item.menuId] = item
})
setMenuObj(obj)
const tree = buildTree(data,0)
const tree2 = tree?.filter(item =>(item.menuId != "1" && item.menuId != "2" && item.menuId != "3"))
setTreeData(tree2)
}
const buildTree = (data, parentId)=> {
let tree = [];
data.forEach((node) => {
node.title = node.menuName;
node.key = node.menuId;
if (node.parentId === parentId) {
let children = buildTree(data, node.menuId);
if (children.length) {
node.children = children;
}
tree.push(node);
}
});
return tree;
}
const handelTreeData = (data) => {
if (data.length > 0) {
data.forEach(item => {
item.title = item.label;
item.key = item.id;
if (item.children && item.children.length > 0) {
handelTreeData(item.children);
}
});
}
}
const onCheck = (a,b,c)=>{
const parentList = []
const getParentId = (id)=>{
const data = menuObj[id]
if(data.parentId!==0){
parentList.push(data.parentId)
getParentId(data.parentId)
}
}
b?.checkedNodes?.map(item=>{
getParentId(item.menuId)
})
if(setParentId){
setParentId(parentList)
}
onChange(a)
}
return (
<div className='deptPage_deptTree'>
<div style={{padding:'0 0 0 0px',marginTop:"8px",height:'calc( 300px )',border:'1px solid #eee',overflowY:"scroll"}}>
<Tree
checkable
defaultExpandAll={true}
blockNode={false}
onCheck={onCheck}
selectable={false}
treeData={treeData}
checkedKeys={value||undefined}
// titleRender={(v)=>{
// return (<>
// <div style={{color:'#a8a8a8',position:'absolute',right:'-50px'}} onClick={(e)=>{
// e.stopPropagation()
// }}>
// <PlusCircleOutlined style={{marginRight:'5px'}} onClick={()=>refModal.current.showSave(v)}/>
// <CloseCircleOutlined />
// </div>
// <div>{v.title}</div>
// </>)
// }}
/>
</div>
</div>
);
}
export default TreePage;

View File

@ -0,0 +1,11 @@
.deptPage_deptTree{
.ant-tree-treenode{
width: 100%;
.ant-tree-node-content-wrapper{
// width: 100%;
// padding-right: 15px;
// position: static;
}
}
}

View File

@ -0,0 +1,373 @@
import React,{useEffect,useState} from 'react';
import { Form, Button, Input, Row, Col, DatePicker, InputNumber } from 'antd';
import { formItemLayout, btnItemLayout } from '../../../../components/crud/FormLayoutProps';
import { getDictService } from '../../../../service/SelectValue'
import { validlgtd , validlttd } from '../../../../utils/validators';
import apiurl from '../../../../service/apiurl';
import AdcdTreeSelect from '../../../../components/Form/AdcdTreeSelect'
import NormalSelect from '../../../../components/Form/NormalSelect';
import moment from 'moment';
const ModalForm = ({ mode, record,onEdit,onSave }) => {
const [form] = Form.useForm();
const [sttp,setSttp] = useState([])
const [frgrd,setFrgrd] = useState([])
const [stbk,setStbk] = useState([])
const [usfl,setUsfl] = useState([])
const [locality,setLocality] = useState([])
const onFinish = (values) => {
if (mode === 'edit') {
// onEdit(apiurl.informationManagement.stcd.edit,values)
}
if (mode === 'save') {
// onSave(apiurl.informationManagement.stcd.save,values)
}
}
useEffect(()=>{
getOptions()
},[])
const getOptions = async ()=>{
setSttp(await getDictService({dictType:'sttp'}))
setFrgrd(await getDictService({dictType:'frgrd'}))
setStbk(await getDictService({dictType:'stbk'}))
setUsfl(await getDictService({dictType:'usfl'}))
setLocality(await getDictService({dictType:'locality'}))
}
return (
<>
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
<Row>
<Col span={12}>
<Form.Item
label="测站名称"
name="stnm"
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="测站编码"
name="stcd"
rules={[{ required: true }]}
>
<InputNumber disabled={mode!=='save'} style={{width:'100%'}} allowClear/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="行政区划"
name="addvcd"
rules={[{ required: true }]}
>
<AdcdTreeSelect disabled={mode==='view'} style={{width:'100%'}}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="测站类型"
name="sttp"
rules={[{ required: true }]}
>
<NormalSelect disabled={mode==='view'} options={sttp} allowClear={false}/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="所在小流域代码"
name="wscd"
>
<Input min={0} disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="来源"
name="source"
rules={[{ required: true }]}
>
<NormalSelect disabled={true} options={[{label:'山洪',value:'SH'},{label:'水文',value:'SW'},{label:'气象',value:'QX'},{label:'水库',value:'SK'}]} allowClear={false}/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="县行政区划编码"
name="countycode"
rules={[{ required: true }]}
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="河流名称"
name="rvnm"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="水系名称"
name="hnnm"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="流域名称"
name="bsnm"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="站址"
name="stlc"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="经度"
name="lgtd"
rules={[{ required: true, validator: validlgtd }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="纬度"
name="lttd"
rules={[{ required: true,validator: validlttd}]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="基面名称"
name="dtmnm"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="基面高程(m)"
name="dtmel"
rules={record?.dtmel===undefined?[{ required: false,}]:[{ required: true,}]}
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="基面修正值(m)"
name="dtpr"
rules={record?.dtpr===undefined?[{ required: false,}]:[{ required: true,}]}
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="报汛等级"
name="frgrd"
>
<NormalSelect disabled={mode==='view'} options={frgrd} allowClear={false}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="建站年月"
name="esstym"
>
<DatePicker picker="month" style={{width:'100%'}} disabled={mode==='view'}/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="始报年月"
name="bgfrym"
>
<DatePicker picker="month" style={{width:'100%'}} disabled={mode==='view'}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="隶属行业单位"
name="atcunit"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="信息管理单位"
name="admauth"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="交换管理单位"
name="locality"
>
<NormalSelect disabled={mode==='view'} options={locality} allowClear={false}/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="测站岸别"
name="stbk"
>
<NormalSelect disabled={mode==='view'} options={stbk} allowClear={false}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="测站方位(°)"
name="stazt"
rules={record?.stazt===undefined?[{ required: false,}]:[{ required: true,}]}
>
<InputNumber min={0} disabled={mode==='view'} style={{width:'100%'}} />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="至河口距离(km)"
name="dstrvm"
rules={record?.dstrvm===undefined?[{ required: false,}]:[{ required: true,}]}
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="集水面积(k㎡)"
name="drna"
rules={record?.drna===undefined?[{ required: false,}]:[{ required: true,}]}
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="拼音码"
name="phcd"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="启用标志"
name="usfl"
>
<NormalSelect disabled={mode==='view'} options={usfl} allowClear={false}/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="建设年度"
name="buildYear"
>
<DatePicker picker="year" style={{width:'100%'}} disabled={mode==='view'}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="备注"
name="comments"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<Input.TextArea disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '增加' : '修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
</>
);
}
export default ModalForm;

View File

@ -0,0 +1,97 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import { useSelector } from 'react-redux';
import BasicCrudModal from '../../../../components/crud/BasicCrudModal';
import { Table, Card, Tabs } from 'antd';
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../../service/apiurl';
import usePageTable from '../../../../components/crud/usePageTable';
import { createCrudService } from '../../../../components/crud/_';
import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const Page = () => {
const refModal = useRef();
const refModal2 = useRef();
const [adcd, setAdcd] = useState(null)
const [searchVal, setSearchVal] = useState({})
const columns = [
// { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '用户帐号', key: 'stnm', dataIndex: 'stnm', width: 200, ellipsis: true },
{ title: '用户姓名', key: 'stcd', dataIndex: 'stcd', width: 140 },
{ title: '部门', key: 'adnm', dataIndex: 'adnm', width: 140 },
{
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (<CrudOpRender_text edit={row.source === 'SH'? true : false} del={row.source === 'SH'? true : false} view={row.source !== 'SH'? true : false} cjxgl={true} command={(cmd) => () => command(cmd)(row)} />)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave();
} else if (type === 'edit') {
refModal.current.showEdit(params);
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDelete(apiurl.informationManagement.stcd.del,{stcd:params?.stcd,source:params?.source,countycode:params?.countycode?params?.countycode:''});
} else if (type === 'cjxgl') {
refModal2.current.show(params)
}
}
// 页面初始默认查询参数
const options = {
search:{
adcd:''
},
};
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.ddjc.ddjz.page).find_noCode,options);
useEffect(()=>{
getDictValue()
},[])
useEffect(()=>{
if(adcd!==null && searchVal){
const params = {
search: {
adcd,
...searchVal
}
};
search(params)
}
},[adcd,searchVal])
const getDictValue = async()=>{
};
return (
<>
<div className='content-root clearFloat xybm deptPage' style={{padding:"0",margin:'0'}}>
<Card className='nonebox'>
<ToolBar setSearchVal={setSearchVal} onSave={command('save')} />
</Card>
<div className="ant-card-body" style={{padding:"20px 0 0 0"}}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width , y: "calc( 100vh - 400px )"}}/>
</div>
<BasicCrudModal
width={1200}
ref={refModal}
title="测站"
component={ModalForm}
onCrudSuccess={()=>{refresh({addvcd:localStorage.getItem('ADCD6')})}}
/>
</div>
</>
);
}
export default Page;

View File

@ -0,0 +1,9 @@
.deptPage{
.deptPage_deptTree{
width: 100%;
height: 100%;
padding: 10px 10px;
}
}

View File

@ -0,0 +1,49 @@
import React, { useEffect,useState } from 'react';
import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
// import '../../../index.less'
const ToolBar = ({ setSearchVal, onSave }) => {
const [form] = Form.useForm();
// const [source,setSource] = useState([])
// const [sttp,setSttp] = useState([])
const onFinish = (val) => {
val.buildYear=val.buildYear?moment(val.buildYear).format('YYYY'):undefined
setSearchVal(val);
}
useEffect(()=>{
getSelect()
},[])
const getSelect = async()=>{
// setSource(await getDictService({dictType:'source'}))
// setSttp(await getDictService({dictType:'sttp'}))
}
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="用户" name="user">
<Input allowClear placeholder='请输入测站名称' style={{width:'180px'}}/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">添加已有用户</Button>
</Form.Item>
{/* <Form.Item>
<Button type="primary" >新建用户</Button>
</Form.Item> */}
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -0,0 +1,113 @@
import React,{useEffect,useState} from 'react';
import { Form, Button, Input, Row, Col, DatePicker, InputNumber, message } from 'antd';
import { formItemLayout, btnItemLayout } from '../../../../components/crud/FormLayoutProps';
import { getDictService } from '../../../../service/SelectValue'
import { validlgtd , validlttd } from '../../../../utils/validators';
import apiurl from '../../../../service/apiurl';
import AdcdTreeSelect from '../../../../components/Form/AdcdTreeSelect'
import MenuTree from '../menuTree/index'
import NormalSelect from '../../../../components/Form/NormalSelect';
import moment from 'moment';
import { qzc_xyt_httppost, qzc_xyt_httpput, xyt_httpget2 } from '../../../../utils/request';
const ModalForm = ({ mode, record,onEdit,onSave, onCrudSuccess, close }) => {
const [form] = Form.useForm();
const [list, setList] = useState([])
const [parentId,setParentId] = useState([])
const onFinish = async(values) => {
const arr = [111,112,113,114,1046,1047,1048,1049,1050,1051,1052,1053,1054,109,110,2,1,100,101,102,103,104,105,106,107,108,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,500,501,1039,1040,1041,1042,1043,1044,1045,3,115,116,117,1055,1056,1057,1058,1059,1060]
values.status = 0
values.menuCheckStrictly = 1
values.menuIds = values.menuIds?Array.from(new Set([...values.menuIds,...arr,...parentId])):Array.from(new Set([...arr,...parentId]))
if (mode === 'edit') {
values.roleId = record.roleId
const {code} = await qzc_xyt_httpput(apiurl.systemManagement.role.save,values)
if(code===200){
message.success('新增成功')
onCrudSuccess()
close()
}else{
message.error('新增失败')
}
}
if (mode === 'save') {
const {code} = await qzc_xyt_httppost(apiurl.systemManagement.role.save,values)
if(code===200){
message.success('新增成功')
onCrudSuccess()
close()
}else{
message.error('新增失败')
}
}
}
useEffect(()=>{
const {roleId} = record
if(mode==='edit'&& roleId){
getMenuIds(roleId)
}
},[])
const getMenuIds = async (roleId)=>{
const {code, checkedKeys } = await xyt_httpget2(apiurl.systemManagement.role.getMenuIds+roleId)
if(code!==200){
message.error('查询权限失败')
}else{
form.setFieldsValue({
'menuIds':checkedKeys
})
}
}
return (
<>
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
<Form.Item
label="角色名称"
name="roleName"
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="权限字符"
name="roleKey"
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="角色顺序"
name="roleSort"
rules={[{ required: true }]}
>
<InputNumber min={0} disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="菜单权限"
name="menuIds"
>
<MenuTree setParentId={setParentId}/>
</Form.Item>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '增加' : '修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
</>
);
}
export default ModalForm;

View File

@ -0,0 +1,91 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import { useSelector } from 'react-redux';
import BasicCrudModal from '../../../../components/crud/BasicCrudModal';
import { Table, Card, message } from 'antd';
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../../service/apiurl';
import usePageTable from '../../../../components/crud/usePageTable';
import { createCrudService } from '../../../../components/crud/_';
import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
import { httpdelete } from '../../../../utils/request';
const Page = () => {
const refModal = useRef();
const refModal2 = useRef();
const [searchVal, setSearchVal] = useState({})
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '角色编码', key: 'roleKey', dataIndex: 'roleKey', width: 200, ellipsis: true },
{ title: '角色名称', key: 'roleName', dataIndex: 'roleName', width: 140 },
{ title: '创建日期', key: 'createTime', dataIndex: 'createTime', width: 140 },
{
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (<CrudOpRender_text edit={true} del={true} command={(cmd) => () => command(cmd)(row)} />)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => async(params) => {
if (type === 'save') {
refModal.current.showSave();
} else if (type === 'edit') {
refModal.current.showEdit(params);
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
const {code, msg} = await httpdelete(apiurl.systemManagement.role.delete+params.roleId)
if(code===200){
refresh()
message.success('删除成功')
}else{
message.error(msg)
}
} else if (type === 'cjxgl') {
refModal2.current.show(params)
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.systemManagement.role.list).xyt_find_noCode);
// useEffect(()=>{
// if(searchVal){
// const params = {
// search: {
// ...searchVal
// }
// };
// search(params)
// }
// },[searchVal])
return (
<>
<div className='content-root clearFloat xybm deptPage' style={{padding:"0",margin:'0'}}>
<Card className='nonebox'>
<ToolBar search={search} onSave={command('save')} />
</Card>
<div className="ant-card-body" style={{padding:"20px 0 0 0"}}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width , y: "calc( 100vh - 400px )"}}/>
</div>
<BasicCrudModal
width={800}
ref={refModal}
title="角色"
component={ModalForm}
onCrudSuccess={refresh}
/>
</div>
</>
);
}
export default Page;

View File

@ -0,0 +1,46 @@
import React, { useEffect,useState } from 'react';
import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
// import '../../../index.less'
const ToolBar = ({ search, onSave }) => {
const [form] = Form.useForm();
// const [source,setSource] = useState([])
// const [sttp,setSttp] = useState([])
const onFinish = (val) => {
search({
search:val
});
}
useEffect(()=>{
getSelect()
},[])
const getSelect = async()=>{
// setSource(await getDictService({dictType:'source'}))
// setSttp(await getDictService({dictType:'sttp'}))
}
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="角色名称" name="roleName">
<Input allowClear placeholder='请输入角色名称' style={{width:'180px'}}/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button onClick={onSave}>新建角色</Button>
</Form.Item>
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -0,0 +1,64 @@
import React, { useEffect,useState } from 'react';
import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
// import '../../../index.less'
const ToolBar = ({ setSearchVal, onSave }) => {
const [form] = Form.useForm();
// const [source,setSource] = useState([])
// const [sttp,setSttp] = useState([])
const onFinish = (val) => {
val.buildYear=val.buildYear?moment(val.buildYear).format('YYYY'):undefined
setSearchVal(val);
}
useEffect(()=>{
getSelect()
},[])
const getSelect = async()=>{
// setSource(await getDictService({dictType:'source'}))
// setSttp(await getDictService({dictType:'sttp'}))
}
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="测站名称" name="stnm">
<Input allowClear placeholder='请输入测站名称' style={{width:'180px'}}/>
</Form.Item>
<Form.Item label="测站编码" name="stcd">
<Input allowClear placeholder='请输入测站编码' style={{width:'180px'}}/>
</Form.Item>
{/* <Form.Item label="" name="source">
<NormalSelect options={source} style={{width:'180px'}}/>
</Form.Item> */}
{/* <Form.Item label="" name="sttp" >
<NormalSelect options={sttp} style={{width:'180px'}}/>
</Form.Item> */}
<Form.Item label="建设年度" name="buildYear">
<DatePicker picker="year" style={{width:'180px'}}/>
</Form.Item>
{/*<Form.Item label="" name="addvcd">
<AdcdFuzzyTreeSelect style={{width:'180px'}}/>
</Form.Item>*/}
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
{
onSave && (
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
)
}
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -16,27 +16,27 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
value: 0,
},
{
label: "闸前水位",
label: "雨量",
value: 1,
},
{
label: "闸水位",
value: 2,
label: "闸水位",
value:2,
},
{
label: "雨量",
label: "闸后水位",
value: 3,
},
]
const [form] = Form.useForm();
const onfinish = (values) => {
values.eventsDate = values.eventsDate?moment(values.eventsDate).format("YYYY-MM-DD 00:00:00"):''
if (mode === 'edit') {
values.id = record.id;
onEdit(apiurl.rcgl.gcdsj.edit,values)
onEdit(apiurl.jcsj.bjgl.bjgzpz.edit,{...record,...values})
}
if (mode === 'save') {
onSave(apiurl.rcgl.gcdsj.save,values)
onSave(apiurl.jcsj.bjgl.bjgzpz.save,values)
}
}
@ -52,7 +52,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}>
<Form.Item
label="监测项目"
name="name"
name="type"
rules={[{ required: true }]}
>
<NormalSelect allowClear style={{ width: '100%' }} options={types} />
@ -61,7 +61,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}>
<Form.Item
label="阈值下限"
name="name"
name="upperLimit"
rules={[{ required: true }]}
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
@ -73,7 +73,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}>
<Form.Item
label="阈值上限"
name="adress"
name="lowerLimit"
rules={[{ required: true }]}
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />

View File

@ -11,9 +11,10 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const types = {
0: "设备维修",
1: '设备更换',
2:"结构加固"
0: "闸后流量",
1: '雨量',
2: "闸前水位",
3:'闸后水位'
}
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
@ -21,15 +22,17 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{
title: '监测项目', key: 'name', dataIndex: 'name', width: 150,
title: '监测点', key: 'type', dataIndex: 'type', width: 150,
render: (v) => <span>{types[v]}</span>
},
{ title: '监测值', key: 'adress', dataIndex: 'adress', width: 150},
{ title: '阈值下限', key: 'adress', dataIndex: 'adress', width: 150},
{ title: '阈值上限', key: 'adress', dataIndex: 'adress', width: 150},
{ title: '是否启用', key: 'adress', dataIndex: 'adress', width: 150},
{ title: '阈值下限', key: 'upperLimit', dataIndex: 'upperLimit', width: 150},
{ title: '阈值上限', key: 'lowerLimit ', dataIndex: 'lowerLimit', width: 150},
{
title: '配置时间', key: 'adress', dataIndex: 'adress', width: 150,
title: '是否启用', key: 'status', dataIndex: 'status', width: 150,
render: (v) => <span>{ v == 1 ? '停用': '启用'}</span>
},
{
title: '配置时间', key: 'createTime', dataIndex: 'createTime', width: 150,
},
{
title: '最近报警时间', key: 'eventsDate', dataIndex: 'eventsDate', width: 140,
@ -40,7 +43,8 @@ const Page = () => {
<CrudOpRender_text
edit={ true }
del={ true }
command={(cmd) => () => command(cmd)(row)} />)
status={{status:row.status,bol:true}}
command={(cmd) => () => command(cmd)(row)} />)
},
];
@ -55,13 +59,13 @@ const Page = () => {
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
refModal.current.onDeleteGet(apiurl.jcsj.bjgl.bjgzpz.delete + `/${params.id}`);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.whfabz.page).find_noCode);
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.jcsj.bjgl.bjgzpz.page).find_noCode);
/**
* @description 处理成功的回调
@ -82,7 +86,7 @@ const Page = () => {
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='content-root clearFloat xybm' style={{paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
<Card className='nonebox'>
<ToolBar

View File

@ -12,26 +12,22 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
value: 0,
},
{
label: "闸前水位",
label: "雨量",
value: 1,
},
{
label: "闸水位",
label: "闸水位",
value: 2,
},
{
label: "闸后水位",
value: 3,
},
]
const [form] = Form.useForm();
const onFinish = (values) => {
let dateSo;
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
}
}
delete values.tm
setSearchVal({...values, dateSo});
setSearchVal({...values});
}