diff --git a/public/assets/images/touxiang.png b/public/assets/images/touxiang.png new file mode 100644 index 0000000..088f260 Binary files /dev/null and b/public/assets/images/touxiang.png differ diff --git a/src/components/Form/DeptTreeSelect_xyt.js b/src/components/Form/DeptTreeSelect_xyt.js new file mode 100644 index 0000000..09a05ab --- /dev/null +++ b/src/components/Form/DeptTreeSelect_xyt.js @@ -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 ( + + ); +} + +export default TreePage; diff --git a/src/components/crud/BasicCrudModal.js b/src/components/crud/BasicCrudModal.js index 759645a..26c2755 100644 --- a/src/components/crud/BasicCrudModal.js +++ b/src/components/crud/BasicCrudModal.js @@ -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} diff --git a/src/components/crud/CrudOpRender.js b/src/components/crud/CrudOpRender.js index 2099f23..8409e9a 100644 --- a/src/components/crud/CrudOpRender.js +++ b/src/components/crud/CrudOpRender.js @@ -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 (
+ { + status ? ( + + + + ) : null + } { edit ? ( diff --git a/src/components/crud/_.js b/src/components/crud/_.js index 1cf0298..4730e9f 100644 --- a/src/components/crud/_.js +++ b/src/components/crud/_.js @@ -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, diff --git a/src/components/fileUpload/index.js b/src/components/fileUpload/index.js index 7a95b60..0392c07 100644 --- a/src/components/fileUpload/index.js +++ b/src/components/fileUpload/index.js @@ -152,9 +152,9 @@ export default function FileUpload({ mode, setFileIds, files, downloadUrl, uploa } {file.name}
-
deleteFile(file.response?.data?.fileId)}> + {mode != 'view' &&
deleteFile(file.response?.data?.fileId)}> -
+
} ) diff --git a/src/index.tsx b/src/index.tsx index b66ddc4..c0d866c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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'; @@ -19,7 +19,7 @@ root.render( - + diff --git a/src/models/auth/_.ts b/src/models/auth/_.ts index cb0313d..fd12618 100644 --- a/src/models/auth/_.ts +++ b/src/models/auth/_.ts @@ -175,85 +175,94 @@ export function loadRole(data: any) { export async function loadMenu(): Promise { - // 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() { diff --git a/src/service/apiurl.js b/src/service/apiurl.js index f225685..8079702 100644 --- a/src/service/apiurl.js +++ b/src/service/apiurl.js @@ -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 diff --git a/src/utils/request.js b/src/utils/request.js index 4f5d83e..21a0678 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -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), }; diff --git a/src/views/AppRouters.tsx b/src/views/AppRouters.tsx index 64d5d44..d8f55ba 100644 --- a/src/views/AppRouters.tsx +++ b/src/views/AppRouters.tsx @@ -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() @@ -60,6 +62,9 @@ const AppRouters: React.FC = () => { // 系统管理 { path: 'xtgl/yhxx', element: }, + { path: 'xtgl/bmgl', element: }, + { path: 'xtgl/jsgl', element: }, + { path: 'xtgl/cdgl', element: }, ], }, diff --git a/src/views/Gcyx/InformationSearch/BasicSituation/index.js b/src/views/Gcyx/InformationSearch/BasicSituation/index.js index 31d7efe..cb806e4 100644 --- a/src/views/Gcyx/InformationSearch/BasicSituation/index.js +++ b/src/views/Gcyx/InformationSearch/BasicSituation/index.js @@ -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 ( - -
-
-
- - - -
- { - skdisabled ? : -
- - -
- } - - -
-
- -
-
水文
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
工程规模
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
建设征地与移民安置
- - - - - - - - - - - - - - - - - -
主要建筑物及设备
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
+ +
+
+
+ + + +
+ { + skdisabled ? : +
+ + +
+ } + + +
+
+ +
+
水文
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
工程规模
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
建设征地与移民安置
+ + + + + + + + + + + + + + + + + +
主要建筑物及设备
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- +
+ ) } diff --git a/src/views/Gcyx/InformationSearch/OperateLog/index.js b/src/views/Gcyx/InformationSearch/OperateLog/index.js index e6bdd68..f79162c 100644 --- a/src/views/Gcyx/InformationSearch/OperateLog/index.js +++ b/src/views/Gcyx/InformationSearch/OperateLog/index.js @@ -53,7 +53,7 @@ const Page = () => { return ( <> -
+
{ return ( <> -
+
{ diff --git a/src/views/Sbwh/Ssgcjl/form.js b/src/views/Sbwh/Ssgcjl/form.js index de0e4ae..dd4762e 100644 --- a/src/views/Sbwh/Ssgcjl/form.js +++ b/src/views/Sbwh/Ssgcjl/form.js @@ -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) } } diff --git a/src/views/SystemMangant/UserInfo/index.js b/src/views/SystemMangant/UserInfo/index.js index 0066b01..253f427 100644 --- a/src/views/SystemMangant/UserInfo/index.js +++ b/src/views/SystemMangant/UserInfo/index.js @@ -87,7 +87,7 @@ const Page = () => { return ( <> -
+
{ + 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 ( +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + {mode !== "view" && + + + + } + {mode != "view" ?
+ + +
: null} +
+
+ ); +} + +export default ModalForm; diff --git a/src/views/SystemMangant/UserInfo1/index.js b/src/views/SystemMangant/UserInfo1/index.js new file mode 100644 index 0000000..eb20fd3 --- /dev/null +++ b/src/views/SystemMangant/UserInfo1/index.js @@ -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) => {r?.dept?.deptName} + }, + { title: '状态', key: 'status', dataIndex: 'status', width: 100, align: "center", render: (v) => {!v ? "正常" : "异常"} }, + { + title: '创建日期', key: 'createTime', dataIndex: 'createTime', width: 150, align: "center", + }, + { + title: '操作', key: 'action', dataIndex: 'action', width: 150, align: "center", + render: (v, r) => ( + + command("view")(r)}>查看 + command("edit")(r)}>编辑 + command("del")(r)}> + + + + ) + }, + ]; + 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 ( + <> +
+
+ + 0 ? true : false} + setDashOpen={setDashOpen} + /> + + +
+ + + + + { refresh({ addvcd: localStorage.getItem('ADCD6') }) }} + /> + + + ); +} + +export default Page; diff --git a/src/views/SystemMangant/UserInfo1/toolbar.js b/src/views/SystemMangant/UserInfo1/toolbar.js new file mode 100644 index 0000000..a23ff96 --- /dev/null +++ b/src/views/SystemMangant/UserInfo1/toolbar.js @@ -0,0 +1,27 @@ +import { Form, Input, Button } from 'antd'; + + +const ToolBar = ({ setSearchVal, onSave, dispatchBtn = false, setDashOpen }) => { + return ( +
+
setSearchVal(v)}> + + + + + + + + + + + + + {/* */} + {/* {dispatchBtn ? : null} */} + +
+ ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/views/SystemMangant/dept/form.js b/src/views/SystemMangant/dept/form.js new file mode 100644 index 0000000..c56c682 --- /dev/null +++ b/src/views/SystemMangant/dept/form.js @@ -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 ( + <> +
+ + + + + + + + + + + + + + + + + + + { + mode==='view'?null:( + <> + + + + + ) + } + + + ); +} + +export default ModalForm; diff --git a/src/views/SystemMangant/dept/index.js b/src/views/SystemMangant/dept/index.js new file mode 100644 index 0000000..4ce69c4 --- /dev/null +++ b/src/views/SystemMangant/dept/index.js @@ -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) => {i + 1}}, + { 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) => ( () => 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 ( + <> +
+
+ + + +
+
{ + console.log(v,r); + setExpandedRowKeys(v) + } + }} + /> + + + + {getData(searchVal)}} + /> + + + ); +} + +export default Page; diff --git a/src/views/SystemMangant/dept/toolbar.js b/src/views/SystemMangant/dept/toolbar.js new file mode 100644 index 0000000..cfd0480 --- /dev/null +++ b/src/views/SystemMangant/dept/toolbar.js @@ -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 ( + <> +
+
+ + + + + + + + + + +
+ + ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/views/SystemMangant/menuM/form.js b/src/views/SystemMangant/menuM/form.js new file mode 100644 index 0000000..ab79ff8 --- /dev/null +++ b/src/views/SystemMangant/menuM/form.js @@ -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 ( + <> +
+
+ +
+ + + 目录 + 菜单 + 按钮 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 启用 + 禁用 + + + + + { + mode === 'view' ? null : ( + <> + + + + + ) + } + + + + ); +} + +export default ModalForm; diff --git a/src/views/SystemMangant/menuM/index.js b/src/views/SystemMangant/menuM/index.js new file mode 100644 index 0000000..95a395d --- /dev/null +++ b/src/views/SystemMangant/menuM/index.js @@ -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) => {i + 1}}, + // { 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) => { + 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) => ( () => 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 ( + <> +
+
+ + + +
+
{ + console.log(v,r); + setExpandedRowKeys(v) + } + }} + /> + + + + { refresh({ addvcd: localStorage.getItem('ADCD6') }) }} + /> + + + ); +} + +export default Page; diff --git a/src/views/SystemMangant/menuM/toolbar.js b/src/views/SystemMangant/menuM/toolbar.js new file mode 100644 index 0000000..dbcf782 --- /dev/null +++ b/src/views/SystemMangant/menuM/toolbar.js @@ -0,0 +1,25 @@ +import { Form, Input, Button } from 'antd'; + + +const ToolBar = ({ setSearchVal, onSave,setAllOpen }) => { + + return ( + <> +
+
setSearchVal(v)}> + + + + + + + + + + +
+ + ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/views/SystemMangant/role/form.js b/src/views/SystemMangant/role/form.js new file mode 100644 index 0000000..8656cfe --- /dev/null +++ b/src/views/SystemMangant/role/form.js @@ -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 ( + <> +
+ + + + + + + + + + + + + + { + mode==='view'?null:( + <> + + + + + ) + } + + + ); +} + +export default ModalForm; diff --git a/src/views/SystemMangant/role/index.js b/src/views/SystemMangant/role/index.js new file mode 100644 index 0000000..b9368c5 --- /dev/null +++ b/src/views/SystemMangant/role/index.js @@ -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) => ( () => 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 ( + <> +
+
+ +
+ {/*
+ + + + + + + + + + + +
*/} + + {}} + /> +
+ + ); +} + +export default Page; diff --git a/src/views/SystemMangant/role/menuTree/index.js b/src/views/SystemMangant/role/menuTree/index.js new file mode 100644 index 0000000..37f7253 --- /dev/null +++ b/src/views/SystemMangant/role/menuTree/index.js @@ -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 ( +
+
+ { + // return (<> + //
{ + // e.stopPropagation() + // }}> + // refModal.current.showSave(v)}/> + // + //
+ //
{v.title}
+ // ) + // }} + /> +
+
+ ); +} + +export default TreePage; diff --git a/src/views/SystemMangant/role/menuTree/index.less b/src/views/SystemMangant/role/menuTree/index.less new file mode 100644 index 0000000..1b37cc8 --- /dev/null +++ b/src/views/SystemMangant/role/menuTree/index.less @@ -0,0 +1,11 @@ +.deptPage_deptTree{ + .ant-tree-treenode{ + width: 100%; + + .ant-tree-node-content-wrapper{ + // width: 100%; + // padding-right: 15px; + // position: static; + } + } +} \ No newline at end of file diff --git a/src/views/SystemMangant/role/person/form.js b/src/views/SystemMangant/role/person/form.js new file mode 100644 index 0000000..33c7632 --- /dev/null +++ b/src/views/SystemMangant/role/person/form.js @@ -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 ( + <> +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + mode==='view'?null:( + <> + + + + + ) + } + + + ); +} + +export default ModalForm; diff --git a/src/views/SystemMangant/role/person/index.js b/src/views/SystemMangant/role/person/index.js new file mode 100644 index 0000000..adcc973 --- /dev/null +++ b/src/views/SystemMangant/role/person/index.js @@ -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) => ( () => 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 ( + <> +
+ + + +
+
+ + + {refresh({addvcd:localStorage.getItem('ADCD6')})}} + /> + + + ); +} + +export default Page; diff --git a/src/views/SystemMangant/role/person/index.less b/src/views/SystemMangant/role/person/index.less new file mode 100644 index 0000000..44f284b --- /dev/null +++ b/src/views/SystemMangant/role/person/index.less @@ -0,0 +1,9 @@ +.deptPage{ + + + .deptPage_deptTree{ + width: 100%; + height: 100%; + padding: 10px 10px; + } +} \ No newline at end of file diff --git a/src/views/SystemMangant/role/person/toolbar.js b/src/views/SystemMangant/role/person/toolbar.js new file mode 100644 index 0000000..d22a9d8 --- /dev/null +++ b/src/views/SystemMangant/role/person/toolbar.js @@ -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 ( + <> +
+
+ + + + + + + + + + + {/* + + */} + +
+ + ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/views/SystemMangant/role/rolePage/form.js b/src/views/SystemMangant/role/rolePage/form.js new file mode 100644 index 0000000..d1e0581 --- /dev/null +++ b/src/views/SystemMangant/role/rolePage/form.js @@ -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 ( + <> +
+ + + + + + + + + + + + + + { + mode==='view'?null:( + <> + + + + + ) + } + + + ); +} + +export default ModalForm; diff --git a/src/views/SystemMangant/role/rolePage/index.js b/src/views/SystemMangant/role/rolePage/index.js new file mode 100644 index 0000000..3b3b4ce --- /dev/null +++ b/src/views/SystemMangant/role/rolePage/index.js @@ -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) => ( () => 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 ( + <> +
+ + + +
+
+ + + + + + ); +} + +export default Page; diff --git a/src/views/SystemMangant/role/rolePage/toolbar.js b/src/views/SystemMangant/role/rolePage/toolbar.js new file mode 100644 index 0000000..213625e --- /dev/null +++ b/src/views/SystemMangant/role/rolePage/toolbar.js @@ -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 ( + <> +
+
+ + + + + + + + + + +
+ + ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/views/SystemMangant/role/toolbar.js b/src/views/SystemMangant/role/toolbar.js new file mode 100644 index 0000000..37ad39d --- /dev/null +++ b/src/views/SystemMangant/role/toolbar.js @@ -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 ( + <> +
+
+ + + + + + + {/* + + */} + {/* + + */} + + + + {/* + + */} + + + + { + onSave && ( + + + + ) + } + +
+ + ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/views/WatchData/PoliceMangant/PoliceRuleConfig/form.js b/src/views/WatchData/PoliceMangant/PoliceRuleConfig/form.js index 39f4b01..e245dd3 100644 --- a/src/views/WatchData/PoliceMangant/PoliceRuleConfig/form.js +++ b/src/views/WatchData/PoliceMangant/PoliceRuleConfig/form.js @@ -16,27 +16,27 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => { value: 0, }, { - label: "闸前水位", + label: "雨量", value: 1, + }, + { + label: "闸前水位", + value:2, }, { label: "闸后水位", - value: 2, - }, - { - 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 }) => {
@@ -61,7 +61,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => { @@ -73,7 +73,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => { diff --git a/src/views/WatchData/PoliceMangant/PoliceRuleConfig/index.js b/src/views/WatchData/PoliceMangant/PoliceRuleConfig/index.js index 2ce5212..037879d 100644 --- a/src/views/WatchData/PoliceMangant/PoliceRuleConfig/index.js +++ b/src/views/WatchData/PoliceMangant/PoliceRuleConfig/index.js @@ -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) => {types[v]} }, - { 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) => { v == 1 ? '停用': '启用'} + }, + { + title: '配置时间', key: 'createTime', dataIndex: 'createTime', width: 150, }, { title: '最近报警时间', key: 'eventsDate', dataIndex: 'eventsDate', width: 140, @@ -40,7 +43,8 @@ const Page = () => { () => 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 ( <> -
+
{ 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}); }