Compare commits

..

17 Commits

Author SHA1 Message Date
秦子超 70b19cb2fc 样式修改 2024-09-25 09:57:08 +08:00
秦子超 556d09b558 菜单路径修改 2024-09-24 17:20:44 +08:00
秦子超 21caa58a8f Merge branch 'qzc-dev' 2024-09-24 17:01:49 +08:00
李神峰 ba59774b4b Merge branch 'lsf-dev' 2024-09-24 17:00:17 +08:00
李神峰 89457a0f49 feat():模块开发 2024-09-24 16:52:53 +08:00
xielei 946f0f7c85 页面搭建 2024-09-24 16:52:00 +08:00
xielei bd868c929f 页面搭建 2024-09-24 14:37:41 +08:00
李神峰 9b161f4012 feat():水情开发 2024-09-23 18:04:37 +08:00
xielei 155aca0416 Merge branch 'master' of http://10.0.41.100:3000/lishenfeng/tsg-web 2024-09-23 18:03:36 +08:00
xielei e6a7298010 caidan 2024-09-23 18:03:30 +08:00
秦子超 e05baad76e Merge branch 'qzc-dev' 2024-09-23 17:24:07 +08:00
xielei 8d6f15bcbe caidan 2024-09-23 15:52:06 +08:00
xielei 65449e77a2 caidan 2024-09-23 14:07:06 +08:00
xielei 617c85af3d caidan 2024-09-23 14:06:03 +08:00
李神峰 8971744caa fix():合并冲突 2024-09-23 13:52:54 +08:00
李神峰 97bde58ba9 Merge branch 'lsf-dev' 2024-09-23 13:52:20 +08:00
李神峰 22ff44b1e6 feat(): 模块迁移 2024-09-23 13:49:58 +08:00
149 changed files with 10101 additions and 867 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/assets/img/qys1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 KiB

BIN
src/assets/img/qys2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 KiB

BIN
src/assets/img/qys3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

BIN
src/assets/img/qys4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

BIN
src/assets/img/u7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 KiB

View File

@ -88,7 +88,7 @@ const DashboardLayout: React.FC = () => {
navigate('/login')
}else{
dispatch.auth.loadMenu();
document.title = "小玉潭水库综合管理系统";
document.title = "檀树岗水库现代化运行管理矩阵平台";
}
},[])
@ -148,7 +148,7 @@ const DashboardLayout: React.FC = () => {
{/*<span className="app-title">{TITLE}{SUBTITLE}</span>*/}
<span className="app-title lf">
<img src={`${process.env.PUBLIC_URL}/assets/shuili.png`} alt=""/>
<span></span>
<span></span>
</span>
<div className="topMenu lf">
<TopMenu menu={menu} menuIndexes={menuIndexes} />

View File

@ -0,0 +1,217 @@
import React from 'react';
import { Modal, message } from 'antd';
import { createCrudService } from './_';
import apiurl from '../../service/apiurl';
class BasicCrudModal extends React.Component {
constructor(props) {
super(props);
this.state = {
record: null,
open: false,
mode: null,
};
}
showEdit(record) {
this.setState({ record, open: true, mode: 'edit' });
}
showSave(record) {
record = record || {};
this.setState({ record, open: true, mode: 'save' });
}
showSimilarSave(record) {
record = record || {};
this.setState({ record, open: true, mode: 'similarSave' });
}
show(record) {
record = record || {};
this.setState({ record, open: true, mode: 'show' });
}
showView(record) {
record = record || {};
this.setState({ record, open: true, mode: 'view' });
}
showReView(record) {
record = record || {};
this.setState({ record, open: true, mode: 'review' });
}
showAdd(record) {
record = record || {};
this.setState({ record, open: true, mode: 'add' });
}
showImp() {
this.setState({ open: true, mode: 'imp' });
}
onEdit = (path,values) => {
createCrudService(path).edit1(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||'修改失败');
}
})
}
onSave = (path,values) => {
createCrudService(path).save(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||'保存失败');
}
})
}
onDelete = (path, values) => {
createCrudService(path).del(values).then((result) => {
if (result?.code === 200) {
message.success('删除成功');
this.setState({ open: false });
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
} else {
message.error(result?.msg||'删除失败');
}
})
}
onDeleteGet = (path,values) => {
createCrudService(path).delGet(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||'删除失败');
}
})
}
onDeletePost= (path,values) => {
createCrudService(path).edit1(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||'删除失败');
}
})
}
onSimilarSave = (path, values) => {
createCrudService(path).delGet(values).then((result) => {
if (result?.code === 200) {
message.success('类似新增成功');
this.setState({ open: false });
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
} else {
message.error(result?.msg||'类似新增失败');
}
})
}
onFileGet = (path,values) => {
createCrudService(path).delGet(values).then((result) => {
if (result?.code === 200) {
message.success('删除成功');
this.setState({ open: false });
if (this.props.onCrudSuccess) {
this.props.onCrudSuccess();
}
} else {
message.error(result?.msg||'删除失败');
}
})
}
whichMod = (value) => {
if(value === 'save'){
return '新增'
}else if (value === 'add' || value === ''){
return '新增'
}else if (value === 'edit'){
return '修改'
}else if (value === 'view'){
return '查看'
}else if (value === 'show' || value === 'review'){
return ''
} else {
return '新增'
}
}
render() {
const { record, open, mode } = this.state;
const { width, title, style, wrapClassName, formProps, component: Component,extraFun } = this.props;
if (!record || !open) {
return null;
}
return (
<Modal
width={width || 600}
style={style || { top: 10 }}
wrapClassName={wrapClassName}
visible
title={`${this.whichMod(mode)}${title}`}
footer={null}
destroyOnClose
onCancel={() => { this.setState({ open: false }) }}
>
<Component
mode={mode}
close={()=>{this.setState({ open: false })}}
onCrudSuccess={this.props.onCrudSuccess}
record={record}
onEdit={this.onEdit}
onSave={this.onSave}
onSimilarSave={this.onSimilarSave}
formProps={formProps}
/>
</Modal>
);
}
}
export default BasicCrudModal;

View File

@ -38,9 +38,14 @@ export function CrudOpRender_icon({ command, edit, del, restore, add, view }) {
)
}
export function CrudOpRender_text({ command,picReview, edit,detail, dispatch,del, restore, add,similarAdd, view,zg, cjxgl,review,download }) {
export function CrudOpRender_text({ command,picReview, edit,detail, dispatch,del, restore, add,similarAdd, view,zg, cjxgl,review,download,record }) {
return (
<div style={{ display: 'inline' }}>
{
record ? (
<Button style={{ marginRight: 4 }} type="link" size="small" onClick={command('record')} title="培训记录">培训记录</Button>
) : null
}
{
add ? (
<Button style={{ marginRight: 4 }} type="link" size="small" onClick={command('add')} title="增加">增加</Button>
@ -113,6 +118,7 @@ export function CrudOpRender_text({ command,picReview, edit,detail, dispatch,del
</Popconfirm>
) : null
}
</div>
)
}

View File

@ -203,3 +203,9 @@ code {
padding: 0 !important;
padding-right: 10px !important;
}
.flex{
display: flex;
}
.flex-end{
justify-content: flex-end;
}

View File

@ -32,11 +32,11 @@ export function removeLoginInfo() {
let keysToKeep = ["checked", "loginNamePwd"];
let keysToRemove = [];
// 遍历 localStorage
for (let i = 0; i < localStorage.length; i++) {
let key: any = localStorage.key(i);
if (!keysToKeep.includes(key)) {
keysToRemove.push(key);
}
for (let i = 0; i < localStorage.length; i++) {
let key: any = localStorage.key(i);
if (!keysToKeep.includes(key)) {
keysToRemove.push(key);
}
}
for (let i = 0; i < keysToRemove.length; i++) {
@ -67,7 +67,7 @@ export function getUserFromSession(): LoginUser | null {
if (obj.id && obj.tokenInfo.tokenValue) {
return obj
}
} catch (e) {}
} catch (e) { }
return null
}
@ -114,55 +114,55 @@ function idgen() {
return () => `${id++}`
}
const handelTreeData = (data:any,id:any)=>{
const handelTreeData = (data: any, id: any) => {
if (data.length > 0) {
data.forEach((item:any) => {
item.id = id()
item.title = item.menuName;
item.icon = item.icon;
data.forEach((item: any) => {
item.id = id()
item.title = item.menuName;
item.icon = item.icon;
if(item.menuType==='M'&&item.children && item.children.length > 0){//目录
item.redirect = item.path;
delete item.path
handelTreeData(item.children,id);
}
if(item.menuType==='C'){//菜单
item.rule = item.children;
delete item.children
}
});
if (item.menuType === 'M' && item.children && item.children.length > 0) {//目录
item.redirect = item.path;
delete item.path
handelTreeData(item.children, id);
}
if (item.menuType === 'C') {//菜单
item.rule = item.children;
delete item.children
}
});
}
}
const buildTree = (data:any, parentId:any)=> {
let tree:any = [];
data.forEach((node:any) => {
if (node.parentId === parentId) {
const buildTree = (data: any, parentId: any) => {
let tree: any = [];
data.forEach((node: any) => {
if (node.parentId === parentId) {
let children = buildTree(data, node.menuId);
if (children.length) {
node.children = children;
node.children = children;
}
tree.push(node);
}
}
});
return tree;
}
export function loadRole(data:any) {
const roleObj:any = {}
const handelTreeData2 = (data:any)=>{
export function loadRole(data: any) {
const roleObj: any = {}
const handelTreeData2 = (data: any) => {
if (data.length > 0) {
data.forEach((item:any) => {
if (item.children && item.children.length > 0) {
//是目录
handelTreeData2(item.children);
}else{
//是菜单
roleObj[item.path] = item
}
});
data.forEach((item: any) => {
if (item.children && item.children.length > 0) {
//是目录
handelTreeData2(item.children);
} else {
//是菜单
roleObj[item.path] = item
}
});
}
}
@ -193,11 +193,64 @@ export async function loadMenu(): Promise<MenuItem[]> {
const id = idgen()
return [
{ id: id(), title: '水库一张图', path: '/mgr/home', icon: 'jbqk' },
{ id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb',
{
id: id(), title: '四制', redirect: '/mgr/sz/gltx/zzjgck', icon: 'jbqk',
children: [
{ id: id(), title: '防洪现状分析', path: '/mgr/sy/fhxzfx'},
{ id: id(), title: '天气预报', path: '/mgr/sy/tqyb'},
{
id: id(), title: '管理体系', redirect: '/mgr/sz/gltx/zzjgck',
children: [
{
id: id(), title: '管理体系', path: '/mgr/sz/gltx/zzjgck',
},
{
id: id(), title: '责任人管理', path: '/mgr/sz/gltx/zrrgl',
}
]
},
{
id: id(), title: '水政执法', redirect: '/mgr/sz/szzf/ajdj',
children: [
{
id: id(), title: '案件登记', path: '/mgr/sz/szzf/ajdj',
},
{
id: id(), title: '案件统计', path: '/mgr/sz/szzf/ajtj',
},
{
id: id(), title: '处理依据', path: '/mgr/sz/szzf/clyj',
}
]
},
{
id: id(), title: '监督考核', redirect: '/mgr/sz/jdkh/khtj',
children: [
{
id: id(), title: '考核统计', path: '/mgr/sz/jdkh/khtj',
},
{
id: id(), title: '考核任务管理', path: '/mgr/sz/jdkh/khrwgl',
},
{
id: id(), title: '考核问题整改', path: '/mgr/sz/jdkh/khwtzg',
},
{
id: id(), title: '考核指标管理', path: '/mgr/sz/jdkh/khzbgl',
},
{
id: id(), title: '考核模板管理', path: '/mgr/sz/jdkh/khmbgl',
}
]
},
{ id: id(), title: '法律法规', path: '/mgr/sz/flfg' },
{ id: id(), title: '制度管理', path: '/mgr/sz/zdgl' },
]
},
{
id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb',
children: [
{ id: id(), title: '防洪形势', path: '/mgr/sy/fhxzfx' },
{ id: id(), title: '天气预报', path: '/mgr/sy/tqyb' },
{
id: id(), title: '洪水预报', redirect: '/mgr/sy/hsyb/hyybjs',
children: [
@ -206,33 +259,87 @@ export async function loadMenu(): Promise<MenuItem[]> {
{ id: id(), title: '参数管理', path: '/mgr/sy/hsyb/csgl' },
]
},
{ id: id(), title: '调度规程', path: '/mgr/fxzb/ddgc'},
{ id: id(), title: '防汛预案', path: '/mgr/fxzb/fxya'},
{ id: id(), title: '防汛预案', path: '/mgr/sy/fxya' },
{ id: id(), title: '调度规程', path: '/mgr/sy/ddgc' },
{
id: id(),
title: '抢险物料',
path: '/mgr/fxzb/qxwl',
path: '/mgr/sy/qxwl',
},
{
id: id(),
title: '抢险队伍',
path: '/mgr/fxzb/qxdw',
path: '/mgr/sy/qxdw',
},
],
},
{
id: id(),
title: '工程安全监测',
redirect: '/mgr/gcaqjc/gcaqyj/bzt',
icon: 'fxzb',
id: id(), title: '四管', redirect: '/mgr/sg/xcxj/xcrw', icon: 'fxzb',
children: [
{ id: id(), title: '布置图', path: '/mgr/gcaqjc/gcaqyj/bzt' },
{
id: id(), title: '巡查巡检', redirect: '/mgr/sg/xcxj/xcrw',
children: [
{ id: id(), title: '巡检任务', path: '/mgr/sg/xcxj/xcrw' },
{ id: id(), title: '巡检问题处理', path: '/mgr/sg/xcxj/xjwtcl' },
{ id: id(), title: '巡检项配置', path: '/mgr/sg/xcxj/xjxpz' },
]
},
{
id: id(), title: '安全管理', redirect: '/mgr/sg/aqgl/fxgkqd',
children: [
{ id: id(), title: '风险管控清单', path: '/mgr/sg/aqgl/fxgkqd' },
{ id: id(), title: '安全隐患排查', path: '/mgr/sg/aqgl/aqyhpc' },
{ id: id(), title: '安全检查管理', path: '/mgr/sg/aqgl/aqjcgl' },
{ id: id(), title: '安全事故登记', path: '/mgr/sg/aqgl/aqsgdj' },
{ id: id(), title: '安全鉴定台帐', path: '/mgr/sg/aqgl/aqjdtz' },
{ id: id(), title: '除险加固台帐', path: '/mgr/sg/aqgl/cxjgtz' },
]
},
{
id: id(), title: '白蚁防治', redirect: '/mgr/sg/byfz/bypc',
children: [
{ id: id(), title: '白蚁普查', path: '/mgr/sg/byfz/bypc' },
{ id: id(), title: '防治宣传', path: '/mgr/sg/byfz/byxc' },
]
},
{
id: id(), title: '维修养护', path: '/mgr/sg/wxyh',
},
{
id: id(), title: '值班管理', redirect: '/mgr/sg/zbgl/zbb',
children: [
{ id: id(), title: '值班表', path: '/mgr/sg/zbgl/zbb' },
{ id: id(), title: '值班日志', path: '/mgr/sg/zbgl/zbrz' },
]
},
{
id: id(), title: '报表管理', redirect: '/mgr/sg/btbb/sdjyrbb',
children: [
{ id: id(), title: '时段降雨日报表', path: '/mgr/sg/btbb/sdjyrbb' },
{ id: id(), title: '日降雨量年报表', path: '/mgr/sg/btbb/rjylnbb' },
{ id: id(), title: '时段水位日报表', path: '/mgr/sg/btbb/sdswbb' },
{ id: id(), title: '日均水位年报表', path: '/mgr/sg/btbb/rjswbb' },
]
},
{
id: id(), title: '告警管理', redirect: '/mgr/sg/gjgl/aigj',
children: [
{ id: id(), title: 'AI告警', path: '/mgr/sg/gjgl/aigj' },
{ id: id(), title: '广播预警', path: '/mgr/sg/gjgl/gbyj' },
]
},
],
},
{
id: id(), title: '工程安全监测', redirect: '/mgr/gcaqjc/gcaqyj/bzt', icon: 'fxzb',
children: [
{
id: id(), title: '布置图', path: '/mgr/gcaqjc/gcaqyj/bzt',
},
{
id: id(), title: '工程安全分析', redirect: '/mgr/gcaqjc/gcaqfx/jrx',
children: [
{ id: id(), title: '浸润线', path: '/mgr/gcaqjc/gcaqfx/jrx' },
]
},
{
@ -240,26 +347,58 @@ export async function loadMenu(): Promise<MenuItem[]> {
children: [
{ id: id(), title: '隐患预警', path: '/mgr/gcaqjc/gcaqyj/yhyj' },
{ id: id(), title: '预警规则配置', path: '/mgr/gcaqjc/gcaqyj/yjgzpz' },
]
},
{
id: id(), title: '数据统计查询', redirect: '/mgr/gcaqjc/sjtjcx/sljx',
id: id(), title: '数据统计查询', redirect: '/mgr/gcaqjc/sjtjcx/czcx',
children: [
{ id: id(), title: '测值查询', path: '/mgr/gcaqjc/sjtjcx/czcx' },
{ id: id(), title: '渗压监测', path: '/mgr/gcaqjc/sjtjcx/syjx' },
{ id: id(), title: '渗流监测', path: '/mgr/gcaqjc/sjtjcx/sljx' },
{ id: id(), title: '位移监测', path: '/mgr/gcaqjc/sjtjcx/wyjx' },
{ id: id(), title: '渗流监测 ', path: '/mgr/gcaqjc/sjtjcx/sljx' },
{ id: id(), title: '位移监测 ', path: '/mgr/gcaqjc/sjtjcx/wyjx' },
{ id: id(), title: '年度渗压统计表', path: '/mgr/gcaqjc/sjtjcx/ndsytjb' },
{ id: id(), title: '年度渗流统计表', path: '/mgr/gcaqjc/sjtjcx/ndsltjb' },
{ id: id(), title: '年度位移统计表', path: '/mgr/gcaqjc/sjtjcx/ndwytjb' },
]
},
],
},
{
id: id(), title: '四全', redirect: '/mgr/sq/qfg/zcdjxx',
children: [
{
id: id(), title: '全覆盖', redirect: '/mgr/sq/qfg/zcdjxx',
children: [
{ id: id(), title: '注册登记信息', path: '/mgr/sq/qfg/zcdjxx' },
]
},
{
id: id(), title: '全要素', redirect: '/mgr/sq/qys/kqys',
children: [
{ id: id(), title: '库区要素', path: '/mgr/sq/qys/kqys' },
{ id: id(), title: '工程要素', path: '/mgr/sq/qys/gcys' },
{ id: id(), title: '下游要素', path: '/mgr/sq/qys/xyys' },
]
},
],
{ id: id(), title: '全周期', redirect: '/mgr/sq/qzq/gcdsj',
children: [
{ id: id(), title: '工程大事记', path: '/mgr/sq/qzq/gcdsj'},
{ id: id(), title: '全周期档案', path: '/mgr/sq/qys/qzqda'},
]
},
{ id: id(), title: '全天候', redirect: '/mgr/sq/qth/sksq',
children: [
{ id: id(), title: '水库水情', path: '/mgr/sq/qth/sksq'},
{ id: id(), title: '河道水情', path: '/mgr/sq/qth/hdsq'},
{ id: id(), title: '实时雨情', path: '/mgr/sq/qth/ssyq'},
{ id: id(), title: '大坝安全监测', path: '/mgr/sq/qth/dbaqjc'},
{ id: id(), title: '视频监控', path: '/mgr/sq/qth/spjk'},
]
},
]
},
// { id: id(), title: '基本情况', path: '/mgr/home', icon: 'jbqk' },
// {
// id: id(),

View File

@ -5,9 +5,16 @@ const pubapi_old = 'https://owrsvr.cloudowr.cn/svr'
const pubapi = 'https://owrsvr.cloudowr.cn/pubapi'
const zdkapi = 'https://slt-sh.chutianyun.gov.cn:8002' //中电科的市级平台
const service_fxdd = '/gunshiApp/tsg'
const service_xyt = '/gunshiApp/xyt'//登陆先用小玉潭
const service_xyt = '/gunshiApp/tsg'//登陆先用小玉潭
const service_shzh = '/shzh'
const apiurl = {
fxya: {
page: service_fxdd + "/resPlanB/list",
update: service_fxdd + "/resPlanB/update",
save: service_fxdd + "/resPlanB/insert",
delete:service_fxdd + "/resPlanB/del",
getFile:service_fxdd + "/resPlanB/file/get"
},
setMenu: service_fxdd + '/visitMenuLog/insert',
setPassword: service_fxdd + '/user/updateSecretKey',
xytlogin: {
@ -415,11 +422,10 @@ const apiurl = {
controler:service_fxdd + "/attCctvBase/control"
}
},
sdz:{
sdz: {
zrrByCode:service_fxdd + '/hEHystSafePerson/hystCode',
gctp:service_fxdd + '/attHystBase/projectImgList',
sjzl:service_fxdd + '/attHystBase/desFileList',
fxya:service_fxdd + '/attHystBase/planList',
delGctp:service_fxdd + '/hEHystProjectImg/delete',
filedNameById:service_fxdd + '/hEHystProjectImg/file/get/'
},
@ -847,6 +853,7 @@ const apiurl = {
//实时水情
sssq: {
selectList:service_fxdd + "/real/rain/list",
list: service_fxdd + '/river/water/list', //实时水情-河道水情列表
warn: service_fxdd + '/current/situation/rv/warn', //实时水情-河道水情统计
summaryInfo: service_fxdd + '/river/water/summaryInfo', //实时水情-河道水情汇总
@ -855,7 +862,7 @@ const apiurl = {
reservoirsummaryInfo: service_fxdd + '/reservoir/water/summaryInfo', //实时水情-水库水情汇总
//河道弹框详情
monitor: service_fxdd + '/river/water/monitor/data', //监测数据
detail: service_fxdd + '/reservoir/water/detail', //监测数据-下方表格
detail: service_fxdd + '/river/water/detail', //监测数据-下方表格
zqrl: service_fxdd + '/river/water/zqrl', //水位流量关系
channel: service_fxdd + '/reservoir/water/image/channel', //图像监测-视角
imageinfo: service_fxdd + '/reservoir/water/image/info', //图像监测-列表
@ -891,7 +898,155 @@ const apiurl = {
weatherasin: service_fxdd + '/weather/basin', // 24小时流域统计
weatherArea: service_fxdd + '/weather/area', // 24小时区域统计
short: service_fxdd + '/weather/short/level ' // 短临预报量级统计
},
//檀树岗
// 全要素
dataResourcesCenter: {
projectAndWater: {
shuikuBasicinfo: {
detail: service_fxdd + "/attResBase/list",
update: service_fxdd + "/attResBase/update",
getFile:service_fxdd + "/attResBase/file/get"
},
kr: {
list: service_fxdd + "/stZvarlB/list",
save: service_fxdd + "/stZvarlB/insert",
update: service_fxdd + "/stZvarlB/update",
delete: service_fxdd + "/stZvarlB/del"
},
xl: {
list: service_fxdd + "/stZqrlB/list",
save: service_fxdd + "/stZqrlB/insert",
update: service_fxdd + "/stZqrlB/update",
delete: service_fxdd + "/stZqrlB/del"
},
mangerUnit: {
list: service_fxdd + "/resMangUnit/list",
update:service_fxdd + "/resMangUnit/update"
},
zrtx: {
list: service_fxdd + "/resSafePersonB/list",
save: service_fxdd + "/resSafePersonB/insert",
update: service_fxdd + "/resSafePersonB/update",
delete:service_fxdd + "/resSafePersonB/del"
},
monthLl: {
page: service_fxdd + "/resMonthEcoFlow/list",
update:service_fxdd + "/resMonthEcoFlow/updates"
},
fxya: {
page: service_fxdd + "/resPlanB/list",
update: service_fxdd + "/resPlanB/update",
save: service_fxdd + "/resPlanB/insert",
delete:service_fxdd + "/resPlanB/del",
getFile:service_fxdd + "/resPlanB/file/get"
},
sjtz: {
list: service_fxdd + "/attResBase/fileList",
upload: service_fxdd + "/attResBase/updateFile",
delete: service_fxdd + "/attResBase/del",
},
projectPic: {
list: service_fxdd + "/resProjectImg/list",
save: service_fxdd + "/resProjectImg/insert",
delete:service_fxdd + "/resProjectImg/del"
},
yhd: {
page: service_fxdd + '/attSpillwayBase/page',
save:service_fxdd + '/attSpillwayBase/insert',
update: service_fxdd + '/attSpillwayBase/update',
delete:service_fxdd + "/attSpillwayBase/del"
},
db: {
page: service_fxdd + '/attDamBase/page',
save:service_fxdd + '/attDamBase/insert',
update: service_fxdd + '/attDamBase/update',
delete: service_fxdd + "/attDamBase/del",
getFile:service_fxdd + "/attDamBase/get"
},
zf: {
page: service_fxdd + '/attGateValve/page',
save:service_fxdd + '/attGateValve/insert',
update: service_fxdd + '/attGateValve/update',
delete: service_fxdd + "/attGateValve/del",
getFile:service_fxdd + "/attGateValve/get"
},
lsy: {
page: service_fxdd + '/attMeaWeir/page',
save:service_fxdd + '/attMeaWeir/insert',
update: service_fxdd + '/attMeaWeir/update',
delete: service_fxdd + "/attMeaWeir/del",
list:service_fxdd+"/stAddvcdD/tree"
}
},
basicData: {
jczd: {
page: service_fxdd + "/stStbprpB/page",
save: service_fxdd + "/stStbprpB/insert",
update: service_fxdd + "/stStbprpB/update",
delete: service_fxdd + "/stStbprpB/del"
},
dmgl: {
page: service_fxdd + "/attDamProfile/page",
update: service_fxdd + "/attDamProfile/update",
save: service_fxdd + "/attDamProfile/insert",
delete: service_fxdd + "/attDamProfile/del",
getFile: service_fxdd + "/attDamProfile/file/get"
},
sysbgl: {
page: service_fxdd + "/osmoticPressDevice/page",
update: service_fxdd + "/osmoticPressDevice/update",
save: service_fxdd + "/osmoticPressDevice/insert",
delete: service_fxdd + "/osmoticPressDevice/del",
list:service_fxdd + "/osmoticPressDevice/list"
},
slsbgl: {
page: service_fxdd + "/osmoticFlowDevice/page",
update: service_fxdd + "/osmoticFlowDevice/update",
save: service_fxdd + "/osmoticFlowDevice/insert",
delete: service_fxdd + "/osmoticFlowDevice/del",
list:service_fxdd + "/osmoticFlowDevice/list"
},
sjzd: {
page: service_fxdd + "/sysDictB/page",
update: service_fxdd + "/sysDictB/update",
save: service_fxdd + "/sysDictB/insert",
delete: service_fxdd + "/sysDictB/del",
},
spjbxx: {
page: service_fxdd + "/attCctvBase/page",
update: service_fxdd + "/attCctvBase/update",
save: service_fxdd + "/attCctvBase/insert",
delete: service_fxdd + "/attCctvBase/del",
tree: service_fxdd + "/cctvBMenu/tree",
saveTree: service_fxdd + "/cctvBMenu/insert",
editTree: service_fxdd + "/cctvBMenu/update",
deleteTree: service_fxdd + "/cctvBMenu/del"
}
},
dygxb: {
zfysxt: {
page: service_fxdd + "/gateValveCctvRel/page",
save: service_fxdd + "/gateValveCctvRel/insert",
update: service_fxdd + "/gateValveCctvRel/update",
delete: service_fxdd + "/gateValveCctvRel/del",
zflist: service_fxdd + "/attGateValve/list",
splist:service_fxdd + "/attCctvBase/list"
}
}
},
// 全周期
gcdsj:{
qzqda:{
list:service_fxdd + '/projectEvents/doc/page'
}
}
}
export default apiurl

View File

@ -66,7 +66,7 @@ import Khrwgl from "./rcgl/jdkh/khrwgl"
// 值班管理
import Zbb from "./zbgl/zbb"
import Zbrz from "./zbgl/zbrz"
import Gcdsj from "./rcgl/gcdsj"
// import Gcdsj from "./rcgl/gcdsj"
import VideoList from './video'
@ -79,6 +79,34 @@ import Gstjfx from "./gxsl/gstjfx"
import Spjk from "./video"
import AiWarn from "./spjk/aiWarn"
// 四全
import Zcdjxx from './sq/qfg/zcdjxx'
import Kqys from './sq/qys/kqys/index.js'
import Xyys from './sq/qys/xyys/index.js'
import Gcys from './sq/qys/gcys/index.js'
import Gcdsj from './sq/qzq/gcdsj'
import Sksq from './sq/qth/sksq'
import Hdsq from './sq/qth/hdsq'
import Ssyq from './sq/qth/ssyq'
import Qzqda from './sq/qzq/qzqda'
// import Zcdjxx from './sq/qys/'
// import Zcdjxx from './sq/qfg/zcdjxx'
// import Zcdjxx from './sq/qfg/zcdjxx'
// import Zcdjxx from './sq/qfg/zcdjxx'
// 四制 - 组织机构查看
import Zzjgck from './sz/zzjgck'
import Zrrgl from './sz/zrrgl'
import Pxjhgl from './sz/pxjhgl'
import Pxjlgl from './sz/pxjlgl'
import Flfg from './sz/flfg'
import Zdgl from './sz/zdgl'
import Ajdj from './sz/szzf/ajdj'
import Ajtj from './sz/szzf/ajtj'
import Clyj from './sz/szzf/clyj'
const HomePage = lazy(() => import('./Home'))
const IframePage = lazy(() => import('./Iframe'))
@ -118,19 +146,24 @@ const AppRouters: React.FC = () => {
{ path: 'sy/hsyb/csgl', element: <Csgl /> },
// 调度规程
{ path: 'fxzb/ddgc', element: <Ddgc /> },
{ path: 'sy/ddgc', element: <Ddgc /> },
// 防汛预案
{ path: 'fxzb/fxya', element: <Fxya /> },
{ path: 'sy/fxya', element: <Fxya /> },
// 抢险物料
{ path: 'fxzb/qxwl', element: <Qxwl_Gc /> },
{ path: 'sy/qxwl', element: <Qxwl_Gc /> },
// 抢险队伍
{ path: 'fxzb/qxdw', element: <Qxdw_Gc /> },
{ path: 'sy/qxdw', element: <Qxdw_Gc /> },
// 工程安全监测
{ path: 'sq/qth/dbaqjc', element: <Bzt isHome={false}/> },
{ path: 'sq/qth/sksq', element: <Sksq /> },
{ path: 'sq/qth/hdsq', element: <Hdsq /> },
{ path: 'sq/qth/ssyq', element: <Ssyq /> },
// 预警
{ path: 'gcaqjc/gcaqyj/bzt', element: <Bzt isHome={false}/> },
{ path: 'gcaqjc/gcaqyj/yhyj', element: <Yhyj /> },
@ -149,33 +182,33 @@ const AppRouters: React.FC = () => {
{ path: 'gcaqjc/gcaqfx/jrx', element: <Jrx /> },
// 日常管理-水质整编
{ path: 'rcgl/btbb/rjswbb', element: <Rjswnbb /> },
{ path: 'rcgl/btbb/rjylnbb', element: <Rjylnbb /> },
{ path: 'rcgl/btbb/sdswbb', element: <Sdswrbb /> },
{ path: 'rcgl/btbb/sdjyrbb', element: <Sdjyrbb /> },
{ path: 'rcgl/xcxj/xcrw', element: <Xjrw /> },
{ path: 'rcgl/xcxj/xjwtcl', element: <Xjwtcl /> },
{ path: 'rcgl/xcxj/xjxpz', element: <Xjxpz/> },
{ path: 'byfz/fzxc', element: <Fzxc /> },
{ path: 'byfz/bypc', element: <Bypc /> },
{ path: 'rcgl/wxyh', element: <Wxyh /> },
{ path: 'rcgl/aqgl/aqjcgl', element: <Aqjcgl /> },
{ path: 'rcgl/aqgl/fxgkqd', element: <Fxgkqd /> },
{ path: 'rcgl/aqgl/cxjbtz', element: <Cxjgtz /> },
{ path: 'rcgl/aqgl/aqjdtz', element: <Aqjdtz /> },
{ path: 'rcgl/aqgl/aqyhpc', element: <Aqyhpc /> },
{ path: 'rcgl/aqgl/aqsgdj', element: <Aqsgdj /> },
{ path: 'rcgl/gcdsj', element: <Gcdsj /> },
{ path: 'rcgl/szzb', element: <Szzb /> },
{ path: 'sg/btbb/rjswbb', element: <Rjswnbb /> },
{ path: 'sg/btbb/rjylnbb', element: <Rjylnbb /> },
{ path: 'sg/btbb/sdswbb', element: <Sdswrbb /> },
{ path: 'sg/btbb/sdjyrbb', element: <Sdjyrbb /> },
{ path: 'sg/xcxj/xcrw', element: <Xjrw /> },
{ path: 'sg/xcxj/xjwtcl', element: <Xjwtcl /> },
{ path: 'sg/xcxj/xjxpz', element: <Xjxpz/> },
{ path: 'sg/byfz/byxc', element: <Fzxc /> },
{ path: 'sg/byfz/bypc', element: <Bypc /> },
{ path: 'sg/wxyh', element: <Wxyh /> },
{ path: 'sg/aqgl/aqjcgl', element: <Aqjcgl /> },
{ path: 'sg/aqgl/fxgkqd', element: <Fxgkqd /> },
{ path: 'sg/aqgl/cxjgtz', element: <Cxjgtz /> },
{ path: 'sg/aqgl/aqjdtz', element: <Aqjdtz /> },
{ path: 'sg/aqgl/aqyhpc', element: <Aqyhpc /> },
{ path: 'sg/aqgl/aqsgdj', element: <Aqsgdj /> },
{ path: 'sg/gcdsj', element: <Gcdsj /> },
{ path: 'sg/szzb', element: <Szzb /> },
{ path: 'rcgl/stlljc', element: <Stlljc /> },
{ path: 'rcgl/zbgl/zbb', element: <Zbb /> },
{ path: 'rcgl/zbgl/zbrz', element: <Zbrz /> },
{ path: 'sg/zbgl/zbb', element: <Zbb /> },
{ path: 'sg/zbgl/zbrz', element: <Zbrz /> },
// 日常管理-监督考核
{ path: 'rcgl/jdkh/khtj', element: <Khtj /> },
{ path: 'rcgl/jdkh/khzbgl', element: <Khzbgl /> },
{ path: 'rcgl/jdkh/khmbgl', element: <Khmbgl /> },
{ path: 'rcgl/jdkh/khwtzg', element: <Khwtzg /> },
{ path: 'rcgl/jdkh/khrwgl', element: <Khrwgl /> },
{ path: 'sz/jdkh/khtj', element: <Khtj /> },
{ path: 'sz/jdkh/khzbgl', element: <Khzbgl /> },
{ path: 'sz/jdkh/khmbgl', element: <Khmbgl /> },
{ path: 'sz/jdkh/khwtzg', element: <Khwtzg /> },
{ path: 'sz/jdkh/khrwgl', element: <Khrwgl /> },
// 供水兴利
@ -187,8 +220,8 @@ const AppRouters: React.FC = () => {
{ path: 'fxzb/jczw/yqz', element: <HomePage /> },
{ path: 'fxzb/jczw/sqz', element: <HomePage /> },
// 视频监控
{ path: 'spjk/spjk', element: <Spjk /> },
{ path: 'spjk/aiWarn', element: <AiWarn /> },
{ path: 'sq/qth/spjk', element: <Spjk /> },
{ path: 'sg/gjgl/aigj', element: <AiWarn /> },
// { path: 'fxzb/zbb', element: <Zbb /> },
// { path: 'fxzb/txl', element: <Txl /> },
@ -207,6 +240,28 @@ const AppRouters: React.FC = () => {
{ path: 'fxdd/ddjc/yjxy', element: <Yjxy /> },
{ path: 'fxdd/ddjc/ddzl', element: <Ddzl /> },
{ path: 'videoSurveillance', element: <VideoList /> },
// 四全
// 注册登记信息
{ path: 'sq/qfg/zcdjxx', element: <Zcdjxx /> },
//库区要素
{ path: 'sq/qys/kqys', element: <Kqys /> },
{ path: 'sq/qys/xyys', element: <Xyys /> },
{ path: 'sq/qys/gcys', element: <Gcys /> },
{ path: 'sq/qzq/gcdsj', element: <Gcdsj /> },
{ path: 'sq/qys/qzqda', element: <Qzqda /> },
// 四制-组织机构查看
{ path: 'sz/gltx/zzjgck', element: <Zzjgck /> },
{ path: 'sz/gltx/zrrgl', element: <Zrrgl /> },
{ path: 'sz/pxgl/pxjhgl', element: <Pxjhgl /> },
{ path: 'sz/pxgl/pxjlgl', element: <Pxjlgl /> },
{ path: 'sz/flfg', element: <Flfg /> },
{ path: 'sz/zdgl', element: <Zdgl /> },
{ path: 'sz/szzf/ajdj', element: <Ajdj /> },
{ path: 'sz/szzf/ajtj', element: <Ajtj /> },
{ path: 'sz/szzf/clyj', element: <Clyj /> },
],
},
{ path: '/login', element: <LoginPage /> },

View File

@ -77,10 +77,12 @@ function DrpSearch({record}) {
],
}
setParams(option)
if (record.stcd) {
setParams(option)
getData(option)
}
}, [current])
}, [current,record])
return (
@ -104,16 +106,16 @@ function DrpSearch({record}) {
<div className="time-type">
{
['小时', '日'].map((item, index) => (
<div className={clsx({active: index === current})} onClick={() => setCurrent(index)}>{item}</div>
<div className={clsx({sqActive: index === current})} onClick={() => setCurrent(index)}>{item}</div>
))
}
</div>
</div>
<div className="mid1">
<div className="mid-left">
<div className="mid1" >
<div className="mid-left" style={record?.height ? { height: "55vh" } : {}}>
<TableData data={data} current={current}/>
</div>
<div className="mid-right">
<div className="mid-right" style={record?.height ? { height: "55vh" } : {}}>
{
data?.length > 0 ?
<ReactEcharts
@ -125,7 +127,7 @@ function DrpSearch({record}) {
}
</div>
</div>
<div className="footer">
<div className="footer" style={record?.height?{fontSize:15}:{}}>
<div className="footer-row">
<div className="footer-item">
<div className="footer-name">近1h雨量(mm)</div>

View File

@ -13,7 +13,7 @@
padding: 8px 0;
}
.active {
.sqActive {
color: #5FB7FF;
background: #F0F7FF;
border: 1px solid #5FB7FF;

View File

@ -40,31 +40,9 @@ function DrpSearch({ record }) {
useEffect(() => {
let option = "";
// 比较当前时间和早上八点
// if (currentTime.isBefore(eightAM)) {
// option = {
// stcd: record.stcd,
// source: record.source,
// stm: moment().subtract(8, 'days').startOf('day').set({hour: 8, minute: 0}).format("YYYY-MM-DD HH:mm"),
// etm: moment().subtract(1, 'days').startOf('day').set({hour: 8, minute: 0}).format("YYYY-MM-DD HH:mm"),
// tm: [moment().subtract(8, 'days').startOf('day').set({
// hour: 8,
// minute: 0
// }), moment().subtract(1, 'days').startOf('day').set({hour: 8, minute: 0})],
// }
// } else {
// option = {
// stcd: record.stcd,
// source: record.source,
// stm: moment().subtract(7, 'days').startOf('day').set({hour: 8, minute: 0}).format("YYYY-MM-DD HH:mm"),
// etm: moment().startOf('day').set({hour: 8, minute: 0}).format("YYYY-MM-DD HH:mm"),
// tm: [moment().subtract(7, 'days').startOf('day').set({
// hour: 8,
// minute: 0
// }), moment().startOf('day').set({hour: 8, minute: 0})],
// }
// }
option = {
stcd: record.stcd,
source: record.source,
@ -75,15 +53,18 @@ function DrpSearch({ record }) {
moment().add(1, 'hour').set({ minute: 0, second: 0 }),
],
}
setParams(option)
getData(option)
if (record?.stcd && record.source) {
setParams(option)
getData(option)
}
}, [record])
return (
<div style={{width: "98%", height: '65vh'}} className="jcsj-sq">
<div className="top">
<div className="top-left">
<div className="top-left" style={record?.height?{height:"65vh"}:{}}>
<div className="top-toobar">
<RangePicker showTime allowClear style={{width: "330px"}}
onChange={searchTm}
@ -92,11 +73,11 @@ function DrpSearch({ record }) {
/>
<Button type="primary" onClick={doSearch} style={{marginLeft: "10px"}}>查询</Button>
</div>
<div className="top-left-table">
<div className="top-left-table" style={record?.height?{height:"60vh"}:{}}>
<TableData data={data} />
</div>
</div>
<div className="top-right">
<div className="top-right" style={record?.height?{height:"65vh"}:{}}>
{
data.length > 0 ?
<ReactEcharts
@ -108,7 +89,7 @@ function DrpSearch({ record }) {
}
</div>
</div>
<div className="footer">
<div className="footer" style={record?.height?{fontSize:15}:{}}>
<div className="footer-row">
<div className="footer-item">
<div className="footer-name">近1h雨量(mm)</div>

View File

@ -20,7 +20,6 @@ function DrpSearch({record}) {
const option = useMemo(() => {
if (data && data.length) {
return drpOption({data,wrz:record.wrz,grz:record.grz});
}
}, [data])
@ -50,30 +49,6 @@ function DrpSearch({record}) {
useEffect(() => {
let option = "";
// 比较当前时间和早上八点
// if (currentTime.isBefore(eightAM)) {
// option = {
// stcd: record.stcd,
// source: record.source,
// stm: moment().subtract(8, 'days').startOf('day').set({hour: 8, minute: 0}).format("YYYY-MM-DD HH:mm"),
// etm: moment().subtract(1, 'days').startOf('day').set({hour: 8, minute: 0}).format("YYYY-MM-DD HH:mm"),
// tm: [moment().subtract(8, 'days').startOf('day').set({
// hour: 8,
// minute: 0
// }), moment().subtract(1, 'days').startOf('day').set({hour: 8, minute: 0})],
// }
// } else {
// option = {
// stcd: record.stcd,
// source: record.source,
// stm: moment().subtract(7, 'days').startOf('day').set({hour: 8, minute: 0}).format("YYYY-MM-DD HH:mm"),
// etm: moment().startOf('day').set({hour: 8, minute: 0}).format("YYYY-MM-DD HH:mm"),
// tm: [moment().subtract(7, 'days').startOf('day').set({
// hour: 8,
// minute: 0
// }), moment().startOf('day').set({hour: 8, minute: 0})],
// }
// }
option = {
stcd: record.stcd,
source: record.source,
@ -84,15 +59,18 @@ function DrpSearch({record}) {
moment().add(1, 'hour').set({ minute: 0, second: 0 }),
],
}
setParams(option)
setInitialDateRange(option)
getData(option)
if (record.stcd) {
setParams(option)
setInitialDateRange(option)
getData(option)
}
}, [record])
return (
<div style={{width: "98%", height: '65vh'}} className="jcsj-sq">
<div className="top">
<div className="top-left">
<div className="top-left" style={record?.height?{height:"65vh"}:{}}>
<div className="top-toobar">
<RangePicker showTime allowClear style={{width: "320px"}}
onChange={searchTm}
@ -103,11 +81,11 @@ function DrpSearch({record}) {
<Button type="primary" onClick={doSearch} style={{ marginLeft: "10px" }}>查询</Button>
<Button style={{ marginLeft: "10px" }} onClick={() => { handleReset()}}>重置</Button>
</div>
<div className="top-left-table">
<div className="top-left-table" style={record?.height?{height:"60vh"}:{}}>
<TableData data={data} />
</div>
</div>
<div className="top-right">
<div className="top-right" style={record?.height?{height:"65vh"}:{}}>
{
data.length > 0 ?
<ReactEcharts
@ -119,7 +97,7 @@ function DrpSearch({record}) {
}
</div>
</div>
<div className="footer">
<div className="footer" style={record?.height?{fontSize:15}:{}}>
<div className="footer-row">
<div className="footer-item">
<div className="footer-name">近1h雨量(mm)</div>

View File

@ -33,7 +33,7 @@ const Page = ({data}) => {
{
tableData.length>0?
<ReactEcharts option={option} style={{width: "100%", height: '300px'}}/>
:<div style={{textAlign: "center", margin: "10%"}}><img src={`${process.env.PUBLIC_URL}/assets/noData.png`} alt=""/></div>
:<div style={{textAlign: "center", padding: "5%"}}><img src={`${process.env.PUBLIC_URL}/assets/noData.png`} alt=""/></div>
}
</>
)

View File

@ -1,38 +1,96 @@
import React,{useEffect,useState} from 'react';
import { Form, Button, Input, message,Row, Col, DatePicker,Upload,Image,Modal } from 'antd';
import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FilePptOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
import React,{useEffect,useState,useRef} from 'react';
import { Form, Button, Input, Row, Col,Upload,DatePicker,Modal,message,Image } from 'antd';
import {PaperClipOutlined,DeleteOutlined,FileWordOutlined,FilePdfOutlined,FilePptOutlined,FileZipOutlined,FileExcelOutlined} from '@ant-design/icons';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import apiurl from '../../../service/apiurl';
import { createCrudService } from '../../../components/crud/_';
import { httpget2 } from '../../../utils/request';
import moment from 'moment';
const { Dragger } = Upload;
import "./index.less";
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 ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
const [form] = Form.useForm();
const [fileList, setFileList] = useState([]) //上传文件列表
const [fileIds, setFileIds] = useState([])
const [flag, setFlag] = useState(true)
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const [loading, setLoading] = useState(false)
/**
* @description 删除上传的图片
* @param {string} id 删除的id
*/
const deleteFile = (fileId) => {
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
const [iframeId, setIframeId] = useState('')
const [perviewOpen, setPerviewOpen] = useState(false)
const fileChange = (info) => {
console.log("file",info);
if (info.file.status === "done") {
setLoading(false);
setFileList(info.fileList)
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
if (fileList.length > 0) {
return
}
setFileList(info.fileList)
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (params) => {
const deleteFile = (fileId) => {
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
}
const onFinish = async (values) => {
if (fileList.length <= 0) {
message.error("请上传预案文件")
return
}
let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId }))
values.resCode = "42120250085"
values.type = 2
values.files = oldFiles;
values.prepTime = moment(values.prepTime).format("YYYY-MM-DD 00:00:00")
values.apprTime = moment(values.apprTime).format("YYYY-MM-DD 00:00:00")
if (mode === 'edit') {
values.id = record?.id;
onEdit(apiurl.fxya.update,values)
}
if (mode === 'save') {
onSave(apiurl.fxya.save,values)
}
}
const viewPdf = (params) => {
setIframeId(params)
setPerviewOpen(true)
}
const beforeUpload = () => {
if (fileList.length > 0) {
message.error("只能上传一个附件");
return false;
}
}
const getFileInfo = async(id) => {
try {
const res = await httpget2(`${apiurl.dataResourcesCenter.projectAndWater.fxya.getFile}/${id}`)
let obj ={
name: res.data.fileName,
response: {
data: {
filePath: res.data.filePath,
fileId:res.data.fileId
}
},
}
setFileList([obj])
} catch (error) {
console.log(error);
}
}
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xfflood/xfIdeoImgB/file/download/${params}`;
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/resPlanB/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
@ -41,153 +99,120 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
// 模拟点击事件,开始下载
downloadLink.click();
}
/**
* @description 上传图片
* @param {string} file 上传的文件
*/
const fileChange = (info) => {
if (info.file.status === "done") {
setLoading(false);
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
let fileIds = info.fileList.map(file => {
return file.response?.data?.fileId
})
setFileIds(fileIds)
setFileList(info.fileList)
setFlag(false)
}
const onFinish = (values) => {
if(values.myTm){
values.prodDate = moment(values.myTm).format('YYYY-MM-DD')
delete values.myTm
}
if (mode === 'edit') {
let oldFiles = fileList.map(item => item.response?.data?.fileId )
values.id = record.id
values.fileIds = oldFiles;
onEdit(apiurl.fxzb.sxfd.fxtj.edit,values)
}
if (mode === 'save') {
values.fileIds = fileIds
onSave(apiurl.fxzb.sxfd.fxtj.save,values)
}
}
/**
* @description 获取查看时文件
* @param {*} type
* @returns
*/
const getFileInfo = (params) => {
let fetchArr = params?.attachList.map(item => {
return createCrudService(apiurl.fxzb.gczx.ytygc.getFile + `/${item.fileId}`)
.delGet()
}
);
Promise.all(fetchArr).then(res => {
let fileArr = res.map(item => {
return {
name: item.data.fileName,
response: {
data: {
filePath: item.data.filePath,
fileId:item.data.fileId
}
},
}
})
setFlag(true)
setFileList(fileArr)
}).catch(err => console.log(err))
}
/**
* @description pdf文件预览
* @param {String} params 文件预览url
*/
const viewPdf = (params) => {
if (params) {
setIframeSrc(params)
setPdfViewOPen(true)
}
}
useEffect(() => {
console.log(record);
if ((mode === "view" || mode === "edit") && record.attachList?.length) {
getFileInfo(record)
}
}, [record, mode])
if (record && mode != "save") {
getFileInfo(record?.files[0]?.fileId)
}
}, [record,mode])
return (
<>
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
<Row>
<Col span={24}>
<Form.Item
label="图件名称"
name="imgName"
label="调度规程名称"
name="planName"
labelCol={{ span: 3, offset: 0 }}
wrapperCol={{span:21,offset:0}}
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
<Input
style={{ width: '100%' }}
allowClear
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Row>
<Col span={12}>
<Form.Item
label="单位"
name="prodUnitName"
label="编制单位"
name="prepOrg"
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
<Input
style={{ width: '100%' }}
allowClear
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Col span={12}>
<Form.Item
label="制作时间"
name="myTm"
label="编制日期"
name="prepTime"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
rules={[{ required: true }]}
>
<DatePicker
disabled={mode==='view'}
format="YYYY-MM-DD"
style={{width:'100%'}}
/>
<DatePicker allowClear style={{width:'280px'}} />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="附件"
// label={mode !== "view" ? "附件" : ''}
name="fieldId"
</Row>
<Row>
<Col span={12}>
<Form.Item
label="批复部门"
name="apprOrg"
rules={[{ required: true }]}
>
{mode !== "view" &&
<Dragger
<Input
style={{ width: '100%' }}
allowClear
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="批复日期"
name="apprTime"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
rules={[{ required: true }]}
>
<DatePicker allowClear style={{width:'280px'}} />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="预案文件"
name="files"
labelCol={{ span: 3, offset: 0 }}
wrapperCol={{span:21,offset:0}}
rules={[{ required: true }]}
>
<Upload
name='file'
// multiple
action="/gunshiApp/xfflood/xfIdeoImgB/file/upload/singleSimple"
action="/gunshiApp/xyt/resPlanB/file/upload/singleSimple"
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
disabled={loading}
// onSuccess={handleSuccess}
fileList={fileList}
maxCount={1}
disabled={loading}
showUploadList={false}
beforeUpload={beforeUpload}
>
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
<p className="ant-upload-hint">
支持扩展名.rar .zip .doc .docx .pdf .jpg .png .ppt
</p>
</Dragger>
}
<Row gutter={[16]}>
{mode == "view" ? null :
<div style={{display:"flex",alignItems:"center",columnGap:10,color:"#4f85ec",cursor:"pointer"}}>
<PaperClipOutlined />
<a style={{ cursor: "pointer" }}>上传PDF文件
<span style={{ marginLeft:10,color:"#dfdfdf" }}>(支持扩展名.xls .xlsx .doc .docx .pdf .jpg .png)</span></a>
</div>
}
</Upload>
</Form.Item>
</Col>
</Row>
<Row gutter={[16]}>
{
loading ? <span>文件正在上传中请等待</span> :
fileList.length > 0 && fileList.map(file => {
@ -239,25 +264,28 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
<Image width={60} src={url +file.response?.data?.filePath} alt='' />
}
<span>{file.name}</span>
</div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
</div>
{mode !== "view" &&
<div
className="delete-icon"
onClick={() => deleteFile(file.response?.data?.fileId)}
>
<DeleteOutlined />
</div>
}
</div>
</Col>
)
})
}
</Row>
</Form.Item>
</Col>
</Row>
</Row>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '增加' : '修改'}
{mode === 'save' ? '提交' : '修改'}
</Button>
</Form.Item>
</>
@ -265,13 +293,13 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
}
</Form>
<Modal
open={pdfViewOPen}
open={perviewOpen}
width={1000}
title=""
footer={null}
style={{marginTop:"-5%"}}
onCancel={() => {
setPdfViewOPen(false)
setPerviewOpen(false)
}}
>
<iframe
@ -281,7 +309,7 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xfflood/xfIdeoImgB/file/download/${iframeSrc}`)}`}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/resPlanB/file/download/${iframeId}`)}`}
/>
</Modal>
</>

View File

@ -1,121 +1,107 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import { Table, Modal, Image } from 'antd';
import { useSelector } from 'react-redux';
import React,{useEffect,useState,useRef,useMemo} from 'react'
import { Table, Button,Modal} from 'antd'
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable';
import { createCrudService } from '../../../components/crud/_';
import { httppost2 } from '../../../utils/request';
import moment from 'moment';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const downloadBtn = role?.rule?.find(item => item.menuName == "下载");
const [visible, setVisible] = useState(false);
const columns = [
{ title: '序号', key: 'idx', dataIndex: 'idx', width: 60, align:"center" },
{ title: '调度规程名称', key: 'planName', dataIndex: 'planName', width: 200,align:"center" },
{ title: '编制单位', key: 'prepOrg', dataIndex: 'prepOrg', width: 200 ,align:"center" },
{
title: '编制日期', key: 'prepTime', dataIndex: 'prepTime', width: 200, align: "center",
render: (rec) => <span>{rec?moment(rec).format("YYYY-MM-DD"):''}</span>
},
{ title: '批复部门', key: 'apprOrg', dataIndex: 'apprOrg', width: 200 ,align:"center" },
{
title: '批复日期', key: 'apprTime', dataIndex: 'apprTime', width: 200, align: "center",
render: (rec) => <span>{rec?moment(rec).format("YYYY-MM-DD"):''}</span>
},
{
title: '文件', key: 'planName', dataIndex: 'planName', width: 200, align: "center",
render: (rec, record) =>
(<div>
<a onClick={() => reviewFile(record?.files[0])}>{record?.files[0]?.fileName}</a>
<Image
src={url + record?.files[0]?.filePath}
style={{
display: 'none',
}}
preview={{
visible,
src:url + record?.files[0]?.filePath ,
onVisibleChange: (value) => {
setVisible(value);
},
}}
/>
</div>)
},
{ title: '上传时间', key: 'moditime', dataIndex: 'moditime', width: 150,align:"center" },
{
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (downloadBtn ?<a onClick={() => download(row?.files[0])}>下载</a> : null)
},
];
const [dataSources, setDataSources] = useState([])
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import BasicCrudModal from '../../../components/crud/BasicCrudModal2';
import moment from "moment"
export default function Zrtx() {
const refModal = useRef();
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const columns = [
{ title: '序号', key: 'idx', dataIndex: 'idx', width: 60, align:"center" },
{ title: '调度规程名称', key: 'planName', dataIndex: 'planName', width: 200,align:"center" },
{ title: '编制单位', key: 'prepOrg', dataIndex: 'prepOrg', width: 200 ,align:"center" },
{
title: '编制日期', key: 'prepTime', dataIndex: 'prepTime', width: 200, align: "center",
render: (r) => <span>{r ? moment(r).format("YYYY-MM-DD") : ''}</span>
},
{ title: '批复部门', key: 'apprOrg', dataIndex: 'apprOrg', width: 200 ,align:"center" },
{
title: '批复日期', key: 'apprTime', dataIndex: 'apprTime', width: 200, align: "center",
render: (r) => <span>{r ? moment(r).format("YYYY-MM-DD") : ''}</span>
},
{
title: '文件', key: 'planName', dataIndex: 'planName', width: 200, align: "center",
render: (rec, record) => <a onClick={() => reviewFile(record?.files[0])}>{record?.files[0]?.fileName}</a>
},
{ title: '上传时间', key: 'moditime', dataIndex: 'moditime', width: 150,align:"center" },
{
title: '操作', dataIndex: 'orgName', key: 'orgName', align: "center",width: 240, fixed: 'right',
render: (value, row, index) => (<CrudOpRender_text view={true} del={true} edit={true} command={(cmd) => () => command(cmd)(row)} />)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const [data, setData] = useState([])
const getData = async () => {
try {
const res = await httppost2(apiurl.fxya.page, { resCode: "42120250085",type:2 })
let newData = res.data.filter(s => s.type == 2)
setData(newData.map((item,i) => ({...item,idx:i+1})))
} catch (error) {
console.log(error);
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/resPlanB/file/download/${params?.fileId}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
}
}
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/resPlanB/file/download/${params?.fileId}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
// 模拟点击事件,开始下载
downloadLink.click();
}
const reviewFile = (params) => {
if (params?.fileName.split('.').pop() == "pdf") {
setPdfViewOPen(true)
setIframeSrc(params)
} else if (params.fileName.split('.').pop() == "png" ||
params.fileName.split('.').pop() == "jpg" ||
params.fileName.split('.').pop() == "jpeg"
) {
setVisible(true)
// 模拟点击事件,开始下载
downloadLink.click();
}
else{
download(params)
const reviewFile = (params) => {
if (params.fileName.split('.').pop() == "pdf") {
setPdfViewOPen(true)
setIframeSrc(params)
} else {
download(params)
}
}
}
const getList = async() => {
try {
const res = await httppost2(apiurl.fxzb1.ddgc.page, { resCode: "42120250085" })
let newData = res.data.filter(s => s.type == 2)
setDataSources(newData.map((item,i) => ({...item,idx:i+1})))
} catch (error) {
console.log(error);
}
}
useEffect(()=>{
getList()
},[])
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.onDeleteGet(apiurl.fxya.delete + `/${params.id}`);
}
}
useEffect(() => {
getData();
}, [])
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='adcdTableBox'>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table
columns={columns}
<div style={{background:"#fff",padding:10}}>
<h1><Button type='primary' onClick={() => {refModal.current.showSave({})}}>新增</Button></h1>
<Table
rowKey="id"
dataSource={dataSources}
columns={columns}
dataSource={data}
pagination={false}
scroll={{
x: width,
y: "calc( 100vh - 400px )"
}} />
</div>
</div>
<Modal
}}
/>
<BasicCrudModal
width={800}
ref={refModal}
title=""
component={ModalForm}
onCrudSuccess={getData}
/>
<Modal
open={pdfViewOPen}
width={1000}
title=""
@ -135,9 +121,6 @@ const Page = () => {
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/resPlanB/file/download/${iframeSrc.fileId}`)}`}
/>
</Modal>
</div>
</>
);
</div>
)
}
export default Page;

View File

@ -0,0 +1,23 @@
.file-item{
display: flex;
width: 100%;
margin-top: -10px;
align-items: center;
border: 1px solid #dedede;
justify-content: space-between;
padding: 1%;
.file-description{
display: flex;
align-items: center;
column-gap: 10px;
img{
width: 40px;
height: 40px;
// margin-right: 10px;
}
}
.delete-icon{
// margin-left: 1%;
cursor: pointer;
}
}

View File

@ -1,29 +0,0 @@
import { Form, Input, Button } from 'antd';
const ToolBar = ({ setSearchVal, onSave }) => {
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form className='toolbarBox' layout="inline" onFinish={(v)=>setSearchVal(v)}>
<Form.Item label="图件名称" name="imgName">
<Input allowClear placeholder='请输入图件名称' 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

@ -1,38 +1,96 @@
import React,{useEffect,useState} from 'react';
import { Form, Button, Input, message,Row, Col, DatePicker,Upload,Image,Modal } from 'antd';
import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FilePptOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
import React,{useEffect,useState,useRef} from 'react';
import { Form, Button, Input, Row, Col,Upload,DatePicker,Modal,message,Image } from 'antd';
import {PaperClipOutlined,DeleteOutlined,FileWordOutlined,FilePdfOutlined,FilePptOutlined,FileZipOutlined,FileExcelOutlined} from '@ant-design/icons';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import apiurl from '../../../service/apiurl';
import { createCrudService } from '../../../components/crud/_';
import { httpget2 } from '../../../utils/request';
import moment from 'moment';
const { Dragger } = Upload;
import "./index.less";
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 ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
const [form] = Form.useForm();
const [fileList, setFileList] = useState([]) //上传文件列表
const [fileIds, setFileIds] = useState([])
const [flag, setFlag] = useState(true)
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const [loading, setLoading] = useState(false)
/**
* @description 删除上传的图片
* @param {string} id 删除的id
*/
const deleteFile = (fileId) => {
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
const [iframeId, setIframeId] = useState('')
const [perviewOpen, setPerviewOpen] = useState(false)
const fileChange = (info) => {
console.log("file",info);
if (info.file.status === "done") {
setLoading(false);
setFileList(info.fileList)
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
if (fileList.length > 0) {
return
}
setFileList(info.fileList)
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (params) => {
const deleteFile = (fileId) => {
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
}
const onFinish = async (values) => {
if (fileList.length <= 0) {
message.error("请上传预案文件")
return
}
let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId }))
values.resCode = "42120250085"
values.type = 1
values.files = oldFiles;
values.prepTime = moment(values.prepTime).format("YYYY-MM-DD 00:00:00")
values.apprTime = moment(values.apprTime).format("YYYY-MM-DD 00:00:00")
if (mode === 'edit') {
values.id = record?.id;
onEdit(apiurl.fxya.update,values)
}
if (mode === 'save') {
onSave(apiurl.fxya.save,values)
}
}
const viewPdf = (params) => {
setIframeId(params)
setPerviewOpen(true)
}
const beforeUpload = () => {
if (fileList.length > 0) {
message.error("只能上传一个附件");
return false;
}
}
const getFileInfo = async(id) => {
try {
const res = await httpget2(`${apiurl.fxya.getFile}/${id}`)
let obj ={
name: res.data.fileName,
response: {
data: {
filePath: res.data.filePath,
fileId:res.data.fileId
}
},
}
setFileList([obj])
} catch (error) {
console.log(error);
}
}
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xfflood/xfIdeoImgB/file/download/${params}`;
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/resPlanB/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
@ -41,153 +99,120 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
// 模拟点击事件,开始下载
downloadLink.click();
}
/**
* @description 上传图片
* @param {string} file 上传的文件
*/
const fileChange = (info) => {
if (info.file.status === "done") {
setLoading(false);
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
let fileIds = info.fileList.map(file => {
return file.response?.data?.fileId
})
setFileIds(fileIds)
setFileList(info.fileList)
setFlag(false)
}
const onFinish = (values) => {
if(values.myTm){
values.prodDate = moment(values.myTm).format('YYYY-MM-DD')
delete values.myTm
}
if (mode === 'edit') {
let oldFiles = fileList.map(item => item.response?.data?.fileId )
values.id = record.id
values.fileIds = oldFiles;
onEdit(apiurl.fxzb.sxfd.fxtj.edit,values)
}
if (mode === 'save') {
values.fileIds = fileIds
onSave(apiurl.fxzb.sxfd.fxtj.save,values)
}
}
/**
* @description 获取查看时文件
* @param {*} type
* @returns
*/
const getFileInfo = (params) => {
let fetchArr = params?.attachList.map(item => {
return createCrudService(apiurl.fxzb.gczx.ytygc.getFile + `/${item.fileId}`)
.delGet()
}
);
Promise.all(fetchArr).then(res => {
let fileArr = res.map(item => {
return {
name: item.data.fileName,
response: {
data: {
filePath: item.data.filePath,
fileId:item.data.fileId
}
},
}
})
setFlag(true)
setFileList(fileArr)
}).catch(err => console.log(err))
}
/**
* @description pdf文件预览
* @param {String} params 文件预览url
*/
const viewPdf = (params) => {
if (params) {
setIframeSrc(params)
setPdfViewOPen(true)
}
}
useEffect(() => {
console.log(record);
if ((mode === "view" || mode === "edit") && record.attachList?.length) {
getFileInfo(record)
}
}, [record, mode])
if (record && mode != "save") {
getFileInfo(record?.files[0]?.fileId)
}
}, [record,mode])
return (
<>
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
<Row>
<Col span={24}>
<Form.Item
label="图件名称"
name="imgName"
label="预案名称"
name="planName"
labelCol={{ span: 3, offset: 0 }}
wrapperCol={{span:21,offset:0}}
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
<Input
style={{ width: '100%' }}
allowClear
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Row>
<Col span={12}>
<Form.Item
label="单位"
name="prodUnitName"
label="编制单位"
name="prepOrg"
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
<Input
style={{ width: '100%' }}
allowClear
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Col span={12}>
<Form.Item
label="制作时间"
name="myTm"
label="编制日期"
name="prepTime"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
rules={[{ required: true }]}
>
<DatePicker
disabled={mode==='view'}
format="YYYY-MM-DD"
style={{width:'100%'}}
/>
<DatePicker allowClear style={{width:'280px'}} />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="附件"
// label={mode !== "view" ? "附件" : ''}
name="fieldId"
</Row>
<Row>
<Col span={12}>
<Form.Item
label="批复部门"
name="apprOrg"
rules={[{ required: true }]}
>
{mode !== "view" &&
<Dragger
<Input
style={{ width: '100%' }}
allowClear
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="批复日期"
name="apprTime"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
rules={[{ required: true }]}
>
<DatePicker allowClear style={{width:'280px'}} />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="预案文件"
name="files"
labelCol={{ span: 3, offset: 0 }}
wrapperCol={{span:21,offset:0}}
rules={[{ required: true }]}
>
<Upload
name='file'
// multiple
action="/gunshiApp/xfflood/xfIdeoImgB/file/upload/singleSimple"
action="/gunshiApp/xyt/resPlanB/file/upload/singleSimple"
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
disabled={loading}
// onSuccess={handleSuccess}
fileList={fileList}
maxCount={1}
disabled={loading}
showUploadList={false}
beforeUpload={beforeUpload}
>
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
<p className="ant-upload-hint">
支持扩展名.rar .zip .doc .docx .pdf .jpg .png .ppt
</p>
</Dragger>
}
<Row gutter={[16]}>
{mode == "view" ? null :
<div style={{display:"flex",alignItems:"center",columnGap:10,color:"#4f85ec",cursor:"pointer"}}>
<PaperClipOutlined />
<a style={{ cursor: "pointer" }}>上传PDF文件
<span style={{ marginLeft:10,color:"#dfdfdf" }}>(支持扩展名.xls .xlsx .doc .docx .pdf .jpg .png)</span></a>
</div>
}
</Upload>
</Form.Item>
</Col>
</Row>
<Row gutter={[16]}>
{
loading ? <span>文件正在上传中请等待</span> :
fileList.length > 0 && fileList.map(file => {
@ -239,25 +264,28 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
<Image width={60} src={url +file.response?.data?.filePath} alt='' />
}
<span>{file.name}</span>
</div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
</div>
{mode !== "view" &&
<div
className="delete-icon"
onClick={() => deleteFile(file.response?.data?.fileId)}
>
<DeleteOutlined />
</div>
}
</div>
</Col>
)
})
}
</Row>
</Form.Item>
</Col>
</Row>
</Row>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '增加' : '修改'}
{mode === 'save' ? '提交' : '修改'}
</Button>
</Form.Item>
</>
@ -265,13 +293,13 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
}
</Form>
<Modal
open={pdfViewOPen}
open={perviewOpen}
width={1000}
title=""
footer={null}
style={{marginTop:"-5%"}}
onCancel={() => {
setPdfViewOPen(false)
setPerviewOpen(false)
}}
>
<iframe
@ -281,7 +309,7 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xfflood/xfIdeoImgB/file/download/${iframeSrc}`)}`}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/resPlanB/file/download/${iframeId}`)}`}
/>
</Modal>
</>

View File

@ -1,126 +1,106 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import { Table, Card, Modal, Image } from 'antd';
import { useSelector } from 'react-redux';
import React,{useEffect,useState,useRef,useMemo} from 'react'
import { Table, Button,Modal} from 'antd'
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable';
import { createCrudService } from '../../../components/crud/_';
import { httppost2 } from '../../../utils/request';
import moment from 'moment';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const downloadBtn = role?.rule?.find(item => item.menuName == "下载");
const [visible, setVisible] = useState(false);
const columns = [
{ title: '序号', key: 'idx', dataIndex: 'idx', width: 60, align:"center" },
{ title: '预案名称', key: 'planName', dataIndex: 'planName', width: 200,align:"center" },
{ title: '编制单位', key: 'prepOrg', dataIndex: 'prepOrg', width: 200 ,align:"center" },
{
title: '编制日期', key: 'prepTime', dataIndex: 'prepTime', width: 200, align: "center",
render: (rec) => <span>{rec?moment(rec).format("YYYY-MM-DD"):''}</span>
},
{ title: '批复部门', key: 'apprOrg', dataIndex: 'apprOrg', width: 200 ,align:"center" },
{
title: '批复日期', key: 'apprTime', dataIndex: 'apprTime', width: 200, align: "center",
render: (rec) => <span>{rec?moment(rec).format("YYYY-MM-DD"):''}</span>
},
{
title: '文件', key: 'planName', dataIndex: 'planName', width: 200, align: "center",
render: (rec, record) =>
(<div>
<a onClick={() => reviewFile(record?.files[0])}>{record?.files[0]?.fileName}</a>
<Image
src={url + record?.files[0]?.filePath}
style={{
display: 'none',
}}
preview={{
visible,
src:url + record?.files[0]?.filePath ,
onVisibleChange: (value) => {
setVisible(value);
},
}}
/>
</div>)
},
{ title: '上传时间', key: 'moditime', dataIndex: 'moditime', width: 150,align:"center" },
{
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (downloadBtn ?<a onClick={() => download(row?.files[0])}>下载</a> : null)
},
];
const [dataSources, setDataSources] = useState([])
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import BasicCrudModal from '../../../components/crud/BasicCrudModal2';
import moment from "moment"
export default function Zrtx() {
const refModal = useRef();
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const columns = [
{ title: '序号', key: 'idx', dataIndex: 'idx', width: 60, align:"center" },
{ title: '预案名称', key: 'planName', dataIndex: 'planName', width: 200,align:"center" },
{ title: '编制单位', key: 'prepOrg', dataIndex: 'prepOrg', width: 200 ,align:"center" },
{
title: '编制日期', key: 'prepTime', dataIndex: 'prepTime', width: 200, align: "center",
render: (r) => <span>{r ? moment(r).format("YYYY-MM-DD") : ''}</span>
},
{ title: '批复部门', key: 'apprOrg', dataIndex: 'apprOrg', width: 200 ,align:"center" },
{
title: '批复日期', key: 'apprTime', dataIndex: 'apprTime', width: 200, align: "center",
render: (r) => <span>{r ? moment(r).format("YYYY-MM-DD") : ''}</span>
},
{
title: '文件', key: 'planName', dataIndex: 'planName', width: 200, align: "center",
render: (rec, record) => <a onClick={() => reviewFile(record?.files[0])}>{record?.files[0]?.fileName}</a>
},
{ title: '上传时间', key: 'moditime', dataIndex: 'moditime', width: 150,align:"center" },
{
title: '操作', dataIndex: 'orgName', key: 'orgName', align: "center",width: 240, fixed: 'right',
render: (value, row, index) => (<CrudOpRender_text view={true} del={true} edit={true} command={(cmd) => () => command(cmd)(row)} />)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const [data, setData] = useState([])
const getData = async () => {
try {
const res = await httppost2(apiurl.fxya.page, { resCode: "42120250085",type:"1" })
let newData = res.data.filter(s => s.type == 1)
setData(newData.map((item,i) => ({...item,idx:i+1})))
} catch (error) {
console.log(error);
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/resPlanB/file/download/${params?.fileId}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
// 模拟点击事件,开始下载
downloadLink.click();
}
const reviewFile = (params) => {
console.log("params",params);
if (params?.fileName.split('.').pop() == "pdf") {
setPdfViewOPen(true)
setIframeSrc(params)
} else if (params.fileName.split('.').pop() == "png" ||
params.fileName.split('.').pop() == "jpg" ||
params.fileName.split('.').pop() == "jpeg"
) {
setVisible(true)
}
}
else{
download(params)
}
}
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/resPlanB/file/download/${params?.fileId}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
const getList = async() => {
try {
const res = await httppost2(apiurl.fxzb1.ddgc.page, { resCode: "42120250085",type:"1" })
let newData = res.data.filter(s => s.type == 1)
setDataSources(newData.map((item,i) => ({...item,idx:i+1})))
} catch (error) {
console.log(error);
}
}
useEffect(()=>{
getList()
},[])
// 模拟点击事件,开始下载
downloadLink.click();
}
const reviewFile = (params) => {
if (params.fileName.split('.').pop() == "pdf") {
setPdfViewOPen(true)
setIframeSrc(params)
} else {
download(params)
}
}
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.onDeleteGet(apiurl.fxya.delete + `/${params.id}`);
}
}
useEffect(() => {
getData();
}, [])
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='adcdTableBox'>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table
columns={columns}
<div style={{background:"#fff",padding:10}}>
<h1><Button type='primary' onClick={() => {refModal.current.showSave({})}}>新增</Button></h1>
<Table
rowKey="id"
dataSource={dataSources}
columns={columns}
dataSource={data}
pagination={false}
scroll={{
x: width,
y: "calc( 100vh - 400px )"
}} />
</div>
</div>
}}
/>
<BasicCrudModal
width={800}
ref={refModal}
title=""
component={ModalForm}
onCrudSuccess={getData}
/>
</div>
<Modal
open={pdfViewOPen}
width={1000}
@ -141,8 +121,6 @@ const Page = () => {
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/resPlanB/file/download/${iframeSrc.fileId}`)}`}
/>
</Modal>
</>
);
</div>
)
}
export default Page;

View File

@ -0,0 +1,23 @@
.file-item{
display: flex;
width: 100%;
margin-top: -10px;
align-items: center;
border: 1px solid #dedede;
justify-content: space-between;
padding: 1%;
.file-description{
display: flex;
align-items: center;
column-gap: 10px;
img{
width: 40px;
height: 40px;
// margin-right: 10px;
}
}
.delete-icon{
// margin-left: 1%;
cursor: pointer;
}
}

View File

@ -1,29 +0,0 @@
import { Form, Input, Button } from 'antd';
const ToolBar = ({ setSearchVal, onSave }) => {
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form className='toolbarBox' layout="inline" onFinish={(v)=>setSearchVal(v)}>
<Form.Item label="图件名称" name="imgName">
<Input allowClear placeholder='请输入图件名称' 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,9 +16,9 @@ import {getAdcdTreeData1, getGcTreeData5} from '../../../../service/warn';
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看") || true;
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const [isFetch, setIsFetch] = useState(false)

View File

@ -8,8 +8,8 @@ import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role = [] }) => {
const [form] = Form.useForm();
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const onFinish = (values) => {
let dateSo;
if (values.tm) {

View File

@ -16,9 +16,9 @@ import {getAdcdTreeData1, getGcTreeData4} from '../../../../service/warn';
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const copyBtn = role?.rule?.find(item => item.menuName == "复制");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
const copyBtn = role?.rule?.find(item => item.menuName == "复制") || true;
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
const refModal = useRef();
const treeRef = useRef();
const [form1] = Form.useForm();

View File

@ -7,8 +7,8 @@ import { config } from '../../../../config';
import moment from 'moment';
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const [form] = Form.useForm();
const onFinish = (val) => {

View File

@ -5,8 +5,8 @@ import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons'
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave,setSwiper,exportFile,role }) => {
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -7,7 +7,7 @@ import { config } from '../../../../config';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const optionsType = [
{
label: "渗压监测",

View File

@ -11,9 +11,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
import "./index.less"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const typeObj = {
1: "渗压监测",
2: "渗流监测",

View File

@ -7,8 +7,8 @@ import { config } from '../../../../config';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const optionsType = [
{
label: "渗压监测",

View File

@ -5,7 +5,7 @@ import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons'
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, onChecked,role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const [checked, setChecked] = useState("多图单线")
const options = [

View File

@ -8,8 +8,8 @@ import moment from 'moment';
import { httppost2 } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const onFinish = (values) => {
let dataSo;

View File

@ -8,8 +8,8 @@ import moment from 'moment';
import { httppost2 } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const [dmList, setDmList] = useState([])
const getDmList = async () => {

View File

@ -8,8 +8,8 @@ import moment from 'moment';
import { httppost2 } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
const ToolBar = ({ setSearchVal, setDmName, exportFile, role }) => {
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const onFinish = (values) => {
let dataSo;

View File

@ -7,7 +7,7 @@ import { config } from '../../../../config';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const optionsType = [
{
label: "今日",

View File

@ -9,7 +9,7 @@ import { httppost2 } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const optionsType = [
{
label: "今日",

View File

@ -9,7 +9,7 @@ import { httppost2 } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const optionsType = [
{

View File

@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const checkType = {
1: "日常检查",
2: "年度检查",

View File

@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -4,7 +4,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const level = {
1: "一般事故",
2: "较大事故",

View File

@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const columns = [

View File

@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const checkType = {
1: "地方自行组织",
2: "中央规划",

View File

@ -4,7 +4,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -16,9 +16,9 @@ const Page = () => {
const role = useSelector(state => state.auth.role);
console.log(role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const checkType = {
1: "低风险",
2: "一般风险",

View File

@ -6,7 +6,7 @@ const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
console.log("role",role);
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const exportBtn = role?.rule?.find(item => item.menuName == "导出")|| true;
const [form] = Form.useForm();
const onFinish = (values) => {
let dataSo;

View File

@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const exportBtn = role?.rule?.find(item => item.menuName == "导出")|| true;
const [form] = Form.useForm();
const onFinish = (values) => {
let dataSo;

View File

@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const exportBtn = role?.rule?.find(item => item.menuName == "导出")|| true;
const [form] = Form.useForm();
const onFinish = (values) => {
let dataSo;

View File

@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const exportBtn = role?.rule?.find(item => item.menuName == "导出")|| true;
const [form] = Form.useForm();
const onFinish = (values) => {
let dataSo;

View File

@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")|| true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")|| true;
const surveyType = {
1: "日常检查排查",
2: "定期普查",

View File

@ -5,8 +5,8 @@ import moment from 'moment';
import NormalSelect from '../../../../components/Form/NormalSelect';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -13,7 +13,7 @@ const Page = () => {
const role = useSelector(state => state.auth.role);
console.log("role",role);
const uploadBtn = role?.rule?.find(item => item.menuName == "上传");
const uploadBtn = role?.rule?.find(item => item.menuName == "上传") || true;
const refModal = useRef();
const [fileList, setFileList] = useState([]) //上传文件列表
const [loading, setLoading] = useState(false)

View File

@ -6,7 +6,7 @@ const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
console.log("role",role);
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const addBtn = role?.rule?.find(item => item.menuName == "新增") || true;
const [form] = Form.useForm();
const onFinish = (values) => {

View File

@ -13,8 +13,8 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
const refModal = useRef();
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },

View File

@ -4,7 +4,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
const [form] = Form.useForm();
const onFinish = (values) => {
setSearchVal({...values});

View File

@ -14,7 +14,7 @@ import { httpget2 } from '../../../../utils/request';
import "./index.less"
const Page = () => {
const role = useSelector(state => state.auth.role);
const qd = role?.rule?.find(item => item.menuName == "清单");
const qd = role?.rule?.find(item => item.menuName == "清单") || true;
const khLevel = {
1: "优秀",
2: "良好",

View File

@ -4,7 +4,7 @@ import moment from 'moment';
import NormalSelect from '../../../../components/Form/NormalSelect';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const addBtn = role?.rule?.find(item => item.menuName == "新增") || true;
const types = [
{label:"未启动",value:0},
{label:"评分中",value:1},

View File

@ -14,8 +14,8 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
const refModal = useRef();
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },

View File

@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑")|| true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")|| true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")|| true;
const types = {
1: '溢洪道淸障',

View File

@ -5,8 +5,8 @@ import moment from 'moment';
import NormalSelect from '../../../components/Form/NormalSelect';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const types = [
{label:"溢洪道淸障",value:1},

View File

@ -14,9 +14,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const task = {
0: "未完成",
1: "进行中",

View File

@ -5,8 +5,8 @@ import moment from 'moment';
import NormalSelect from '../../../../components/Form/NormalSelect';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "创建任务");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const addBtn = role?.rule?.find(item => item.menuName == "创建任务")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const types = [
{label:"日常巡查",value:1},

View File

@ -6,7 +6,7 @@ import { httppost2 } from '../../../utils/request';
import apiurl from '../../../service/apiurl';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
const warnTypes = [
{

View File

@ -1,9 +1,10 @@
import { Image } from "antd"
import zd from '../../../assets/img/u0.png'
const Page = () => {
return (
<>
<Image src="../../../"/>
</>
<div style={{display:'flex',justifyContent:'center',alignItems:'center',backgroundColor:'#fff',height:'100%'}}>
<Image src={zd} style={{margin:'auto'}} preview={false}/>
</div>
)
}
export default Page

View File

@ -0,0 +1,71 @@
import React, { useEffect, useState } from 'react'
import { zqrl, list} from "../../../../service/sssq";
import Sssw from './sssw';
import Sjcx from '../../../Home/MapCtrl/components/Sqjcsj/index'
import "./index.less"
import { Table } from 'antd';
export default function Sksq() {
const columns = [
{title: '水位(m)', key: 'z', dataIndex: 'z', align: 'center'},
{title: '流量(m³/s)', key: 'q', dataIndex: 'q', align: 'center'},
]
const [tableData, setTableData] = useState([])
const [swtableData, setSwTableData] = useState([])
const getData = async (params) => {
let res = await list(params)
setTableData(res);
getSwTableData(res[0]?.stcd)
}
const getSwTableData = async (stcd) => {
setSwTableData(await zqrl(stcd));
};
useEffect(() => {
getData({args: "",sources: ["SH", "SW"],})
}, [])
return (
<div className='lf' style={{ height: 'calc(100vh - 168px)', width: "100%" }}>
<div className='content-sk'>
<div className='content-left'>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center"}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span style={{marginLeft:10}}>实时水位</span>
</div>
<span>站点{tableData[0]?.stnm}</span>
</div>
<div className='sssw-content'>
<Sssw data={tableData[0] || {}}/>
</div>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center"}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span style={{marginLeft:10}}>水位流量关系表</span>
</div>
</div>
<div className='sssw-content' style={{padding:10}}>
<Table
dataSource={swtableData}
rowKey="adcd"
columns={columns}
pagination={false}
/>
</div>
</div>
<div className='content-right'>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center",columnGap:10}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span>数据查询</span>
</div>
</div>
<div className='sjcx-content'>
<Sjcx record={{...tableData[0],height:true} || {}}/>
</div>
</div>
</div>
</div>
)
}

View File

@ -0,0 +1,108 @@
.content-sk{
display: flex;
column-gap: 10px;
height: calc(100vh - 90px);
.comomn-title{
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 10px;
}
.content-left{
width: 550px;
height: 100%;
background-color: #fff;
.ssjc{
.root {
display: flex;
color: #333;
padding: 1rem 1rem 1rem 1rem;
}
.realinfo {
width: 100%;
margin-right: 1rem
}
.dataTm {
padding: 0.4rem 1rem;
border-radius: 0.4rem;
margin-bottom: 0.5rem;
font-size: 0.8rem;
}
.online, .offline{
color:#fff;
line-height:22px;
font-size:14px;
letter-spacing: 1px;
}
.online {
border: 1px solid #9ccc65;
background-color: #33691e;
}
.report-time,.rain-report{
display: flex;
width: 70%;
align-items: center;
color: #689fff;
font-size: 15px;
font-weight: 500;
line-height: 1.5;
column-gap: 5px;
margin-bottom: 10px;
justify-content: center;
padding: 7px 0;
background-color: #ecf5ff;
border: 1px solid #cde5ff;
border-radius: 5px;
margin-left: 10%;
}
.offline {
border: 1px solid #ef5350;
background-color: #b71c1c;
}
.infoItem {
border-bottom: 1px dashed #aaa;
display: flex;
font-size: 14px;
line-height: 1.8;
margin-bottom: 0.5rem;
& > .row-key{
width: 9rem;
line-height:30px;
}
& > .row-value{
width: 50%;
text-align: right;
font-weight: bold;
margin-right: 0.5rem;
flex-grow: 1;
}
& > .row-unit{
width: 3rem;
flex-shrink: 0;
}
}
}
}
.content-right{
flex: 1;
height: 100%;
background-color: #fff;
.sjcx-content{
padding: 10px;
}
}
.pic-container{
padding: 10px;
}
}

View File

@ -0,0 +1,37 @@
import React from 'react'
import {Divider} from "antd"
export default function Sssw({data}) {
return (
<div className="ssjc">
<div className="root">
<div className="realinfo">
<div
className='report-time'
>水位上报时间: {data?.tm}</div>
<div className="infoItem">
<div className="row-key">监测水位:</div>
<div className="row-value">{data?.z ? data?.z.toFixed(2):'-'}</div>
<div className="row-unit">m</div>
</div>
<div className="infoItem">
<div className="row-key">警戒水位:</div>
<div className="row-value">{data?.wrz ? data?.wrz.toFixed(2) : '-'}</div>
<Divider type="vertical" style={{height:25,background:"#000",width:2,margin:"0 30px"}}/>
<div className="row-value" style={{width:"20%"}}>{(data.wrz && data?.z) ? (data.wrz - data?.z).toFixed(2):'-'}</div>
<div className="row-unit">m</div>
</div>
<div className="infoItem">
<div className="row-key">危险水位:</div>
<div className="row-value">{data.grz ? data.grz.toFixed(2) : '-'}</div>
<Divider type="vertical" style={{height:25,background:"#000",width:2,margin:"0 30px"}}/>
<div className="row-value" style={{width:"20%"}}>{(data.grz && data?.z) ? (data.grz - data?.z).toFixed(2):'-'}</div>
<div className="row-unit">m</div>
</div>
</div>
</div>
</div>
)
}

View File

@ -0,0 +1,49 @@
import React, { useEffect, useState } from 'react'
import { reservoirlist, } from "../../../../service/sssq";
import Sssw from './sssw';
import Sjcx from '../../../Home/MapCtrl/components/Sksjcx/index'
import "./index.less"
import { helpers } from '@turf/turf';
export default function Sksq() {
const [tableData, setTableData] = useState([])
const getData = async (params) => {
setTableData(await reservoirlist(params));
}
useEffect(() => {
let option = {
sources: ["SW", "SK"],
args: "",
};
getData(option)
}, [])
return (
<div className='lf' style={{ height: 'calc(100vh - 168px)', width: "100%" }}>
<div className='content-sk'>
<div className='content-left'>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center"}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span style={{marginLeft:10}}>实时水位</span>
</div>
<span>站点{tableData[0]?.stnm}</span>
</div>
<div className='sssw-content'>
<Sssw data={tableData[0] || {}}/>
</div>
</div>
<div className='content-right'>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center",columnGap:10}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span>数据查询</span>
</div>
</div>
<div className='sjcx-content'>
<Sjcx record={{...tableData[0],height:true} || {}}/>
</div>
</div>
</div>
</div>
)
}

View File

@ -0,0 +1,108 @@
.content-sk{
display: flex;
column-gap: 10px;
height: calc(100vh - 90px);
.comomn-title{
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 10px;
}
.content-left{
width: 550px;
height: 100%;
background-color: #fff;
.ssjc{
.root {
display: flex;
color: #333;
padding: 1rem 1rem 1rem 1rem;
}
.realinfo {
width: 100%;
margin-right: 1rem
}
.dataTm {
padding: 0.4rem 1rem;
border-radius: 0.4rem;
margin-bottom: 0.5rem;
font-size: 0.8rem;
}
.online, .offline{
color:#fff;
line-height:22px;
font-size:14px;
letter-spacing: 1px;
}
.online {
border: 1px solid #9ccc65;
background-color: #33691e;
}
.report-time,.rain-report{
display: flex;
width: 70%;
align-items: center;
color: #689fff;
font-size: 15px;
font-weight: 500;
line-height: 1.5;
column-gap: 5px;
margin-bottom: 10px;
justify-content: center;
padding: 7px 0;
background-color: #ecf5ff;
border: 1px solid #cde5ff;
border-radius: 5px;
margin-left: 10%;
}
.offline {
border: 1px solid #ef5350;
background-color: #b71c1c;
}
.infoItem {
border-bottom: 1px dashed #aaa;
display: flex;
font-size: 14px;
line-height: 1.8;
margin-bottom: 0.5rem;
& > .row-key{
width: 9rem;
line-height:30px;
}
& > .row-value{
width: 50%;
text-align: right;
font-weight: bold;
margin-right: 0.5rem;
flex-grow: 1;
}
& > .row-unit{
width: 3rem;
flex-shrink: 0;
}
}
}
}
.content-right{
flex: 1;
height: 100%;
background-color: #fff;
.sjcx-content{
padding: 10px;
}
}
.pic-container{
padding: 10px;
}
}

View File

@ -0,0 +1,66 @@
import React from 'react'
import moment from 'moment'
import MyImg from '../../../Home/MapCtrl/components/Skssjc/myImg'
export default function Sssw({data}) {
return (
<div className="ssjc">
<div className="root">
<div className="realinfo">
<div
className='report-time'
>水位上报时间: {data?.tm}</div>
<div className="infoItem">
<div className="row-key">监测水位:</div>
<div className="row-value">{data?.rz ? data?.rz.toFixed(2):'-'}</div>
<div className="row-unit">m</div>
</div>
<div className="infoItem">
<div className="row-key">设计洪水位:</div>
<div className="row-value">{data?.desFloodLev ? data?.desFloodLev.toFixed(2):'-'}</div>
<div className="row-unit">m</div>
</div>
<div className="infoItem">
<div className="row-key">正常蓄水位:</div>
<div className="row-value">{data.normWatLev ? data.normWatLev.toFixed(2):'-'}</div>
<div className="row-unit">m</div>
</div>
<div className="infoItem">
<div className="row-key">汛限水位:</div>
<div className="row-value">{data.flLowLimLev ? data.flLowLimLev.toFixed(2):'-'}</div>
<div className="row-unit">m</div>
</div>
<div className="infoItem">
<div className="row-key">死水位:</div>
<div className="row-value">{data.deadLev ? data.deadLev.toFixed(2):'-'}</div>
<div className="row-unit">m</div>
</div>
<div className="infoItem">
<div className="row-key">坝顶高程:</div>
<div className="row-value">{data.crestElev}</div>
<div className="row-unit">{ data.crestElev ? "m" : "-"}</div>
</div>
<div className="infoItem">
<div className="row-key">水库当前库容:</div>
<div className="row-value">{data.nowCap}</div>
<div className="row-unit">万m³</div>
</div>
<div className="infoItem">
<div className="row-key">兴利库容:</div>
<div className="row-value">{data.benResCap}</div>
<div className="row-unit">万m³</div>
</div>
</div>
</div>
<div className='pic-container'>
<MyImg record={data} />
</div>
</div>
)
}

View File

@ -0,0 +1,93 @@
import React, { useEffect, useState } from 'react'
import { reservoirlist, } from "../../../../service/sssq";
import { message } from 'antd';
import Sssw from './sssw';
import Sjcx from '../../../Home/MapCtrl/components/Jcsj/index'
import "./index.less"
import { httppost2 } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
import { helpers } from '@turf/turf';
import NormalSelect from '../../../../components/Form/NormalSelect';
export default function Sksq() {
const [tableData1, setTableData1] = useState([])
const getData1 = async () => {
const { data, code, msg } = await httppost2(apiurl.home.yq)
if (code !== 200) {
message.error(msg || '请求失败');
}
const list = data.map((i)=>{
return {
id : i.stcd,
...i,
drp : i.drp ,//i.v,
}
})
setTableData1(list||[])
}
const [selectList, setSelectList] = useState([])
const [selected, setSelected] = useState('')
const [stcdItem, setStcdItem] = useState({})
const getList = async() => {
try {
const res = await httppost2(apiurl.sssq.selectList)
setSelectList(res.data.map(item => ({ label: item.stnm, value: item.stcd,...item})))
setSelected(res.data[0].stcd)
setStcdItem(res.data[0])
} catch (error) {
console.log(error);
}
}
const handleChange = (e) =>{
setSelected(e);
setStcdItem(selectList.find(item => item.stcd === e))
}
useEffect(() => {
getList()
}, [])
useEffect(() => {
getData1()
}, [])
return (
<div className='lf' style={{ height: 'calc(100vh - 168px)', width: "100%" }}>
<div className='content-sk'>
<div className='content-left'>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center",columnGap:0}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span style={{marginLeft:10}}>实时雨情</span>
</div>
<div style={{display:"flex",columnGap:10,width:"45%",alignItems:"center"}}>
<span style={{width:"18%"}}>站点</span>
<NormalSelect
style={{ width: '77%' }}
allowClear
options={selectList}
value={selected}
onChange={(e) => { handleChange(e)}}
/>
</div>
</div>
<div className='sssw-content'>
<Sssw data={stcdItem || {}}/>
</div>
</div>
<div className='content-right'>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center",columnGap:10}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span>数据查询</span>
</div>
</div>
<div className='sjcx-content'>
<Sjcx record={{stcd:selected,height:true} || {}}/>
</div>
</div>
</div>
</div>
)
}

View File

@ -0,0 +1,82 @@
.content-sk{
display: flex;
column-gap: 10px;
height: calc(100vh - 90px);
.comomn-title{
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 10px;
}
.content-left{
width: 550px;
height: 100%;
background-color: #fff;
.ssjc{
.root {
display: flex;
color: #333;
padding: 1rem 1rem 1rem 1rem;
.drp-content{
display: flex;
justify-content: center;
flex-wrap: wrap;
column-gap: 40px;
margin-top: 40px;
}
.drp-item{
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
width: 220px;
height: 160px;
background-color: #eaf4fe;
margin-bottom: 40px;
.value{
font-size: 20px;
font-weight: bold;
}
.name{
font-size: 16px;
color: #40a9ff;
}
}
}
.report-time,.rain-report{
display: flex;
width: 70%;
align-items: center;
color: #689fff;
font-size: 15px;
font-weight: 500;
line-height: 1.5;
column-gap: 5px;
margin-bottom: 10px;
justify-content: center;
padding: 7px 0;
background-color: #ecf5ff;
border: 1px solid #cde5ff;
border-radius: 5px;
margin-left: 10%;
}
}
}
.content-right{
flex: 1;
height: 100%;
background-color: #fff;
.sjcx-content{
padding: 10px;
}
}
.pic-container{
padding: 10px;
}
}

View File

@ -0,0 +1,52 @@
import React,{useState,useEffect} from 'react'
import {queryStPptnDetails} from '../../../../service/ssyq'
export default function Sssw({ data }) {
const [detail, setDetail] = useState({})
const getDetail = async (data) => {
setDetail(await queryStPptnDetails(data))
}
useEffect(() => {
if (data.stcd) {
getDetail(data.stcd)
}
}, [data])
return (
<div className="ssjc">
<div className="root">
<div className="realinfo">
<div
className='report-time'
>雨情最新上报时间: {detail?.tm}</div>
<div className='drp-content'>
<div className='drp-item'>
<div className='value'>{detail?.h1 ?? '-' }&nbsp;<span>mm</span></div>
<div className='name'>近1小时</div>
</div>
<div className='drp-item'>
<div className='value'>{detail?.h3 ?? '-' }&nbsp;<span>mm</span></div>
<div className='name'>近3小时</div>
</div>
<div className='drp-item'>
<div className='value'>{detail?.h6 ?? '-' }&nbsp;<span>mm</span></div>
<div className='name'>近6小时</div>
</div>
<div className='drp-item'>
<div className='value'>{detail?.h12 ?? '-' }&nbsp;<span>mm</span></div>
<div className='name'>近12小时</div>
</div>
<div className='drp-item'>
<div className='value'>{detail?.h24 ?? '-' }&nbsp;<span>mm</span></div>
<div className='name'>近24小时</div>
</div> <div className='drp-item'>
<div className='value'>{detail?.h48 ?? '-' }&nbsp;<span>mm</span></div>
<div className='name'>近48小时</div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@ -0,0 +1,97 @@
import echarts from 'echarts/lib/echarts';
import { GetInterval } from '../../../../../utils/tools'
export default function drpOption({data}) {
const maxVal = Math.ceil(Math.max(...data.map(obj => obj.rz)))
const minVal = Math.floor(Math.min(...data.map(obj => obj.rz)))
const maxValX = Math.max(...data.map(obj => obj.w))
const minValX = Math.min(...data.map(obj => obj.w))
let arr =[]
data.forEach(item=>{
console.log(data);
arr.push([item.w,item.rz])
})
// console.log(GetInterval(minValX,maxValX),'jhsdjkashdjkahjk');
return {
toolbox: {
show: true,
feature: {
saveAsImage: {
show: true,
excludeComponents: ['toolbox'],
pixelRatio: 2,
name:"库容曲线图"
}
},
right: "14%",
top:"5%"
},
title: {
text: "库容曲线图",
left: "40%",
},
tooltip: {
trigger: 'axis',
},
grid: [
{
top: "10%",
left: "15%",
right: "15%",
bottom: "8%"
},
],
xAxis: [
{
name: "库容(万m³)",
nameGap: 5,
type: 'value',
min:Math.floor(minValX / 5) *5,
max:Math.ceil(maxValX / 5) *5,
interval:GetInterval(minValX,maxValX),
data: data.map(o => o.w),
splitLine: {
show: false
},
}
],
yAxis: [
{
type: 'value',
name: "库水位(m)",
minInterval:1,
splitLine: {
show: true,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
show: false
},
axisTick: {
show: false,
},
min: minVal,
max: maxVal
}
],
series: [
{
type: 'line',
color: "#007AFD",
data: arr,
smooth: true
},
]
};
}

View File

@ -0,0 +1,79 @@
import React,{useEffect,useState,useRef} from 'react';
import { Form, Button, Input, Row, Col} from 'antd';
import { formItemLayout, btnItemLayout } from '../../../../../components/crud/FormLayoutProps';
import apiurl from '../../../../../service/apiurl';
const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
const [form] = Form.useForm();
const onFinish = async (values) => {
values.resCode = "42120250085"
values.id = record?.id
if (mode === 'edit') {
const params = {
...record,
rz: Number(values?.rz),
w: Number(values?.w),
}
onEdit(apiurl.dataResourcesCenter.projectAndWater.kr.update,params)
}
if (mode === 'save') {
onSave(apiurl.dataResourcesCenter.projectAndWater.kr.save,values)
}
}
return (
<>
<Form
form={form}
// {...formItemLayout}
onFinish={onFinish}
initialValues={record}>
<Row>
<Col span={24}>
<Form.Item
label="水位(m)"
name="rz"
labelCol={{ span: 5, offset: 0 }}
wrapperCol={{span:19,offset:0}}
rules={[{ required: true }]}
>
<Input
style={{ width: '100%' }}
allowClear
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="库容(万m³)"
name="w"
labelCol={{ span: 5, offset: 0 }}
wrapperCol={{span:19,offset:0}}
rules={[{ required: true }]}
>
<Input
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,88 @@
import React,{useEffect,useState,useRef,useMemo} from 'react'
import { Table, Button } from 'antd'
import ModalForm from './form';
import ReactEcharts from 'echarts-for-react';
import drpOption from './drpOption'
import apiurl from '../../../../../service/apiurl';
import { httppost2 } from '../../../../../utils/request';
import { CrudOpRender_text } from '../../../../../components/crud/CrudOpRender';
import BasicCrudModal from '../../../../../components/crud/BasicCrudModal2';
export default function Zrtx() {
const refModal = useRef();
const columns = [
{
title: '序号', dataIndex: 'index', key: 'index', align: "center",
render: (r, c,i) => <span>{i + 1}</span>
},
{ title: '水位(m)', dataIndex: 'rz', key: 'rz',align:"center" },
{ title: '库容(万m³)', dataIndex: 'w', key: 'w',align:"center" },
{
title: '操作', dataIndex: 'op', key: 'op', align: "center",width:200,
render: (value, row, index) => (<CrudOpRender_text del={true} edit={true} command={(cmd) => () => command(cmd)(row)} />)
},
];
const [data, setData] = useState([])
const option = useMemo(() => {
return drpOption({data});
}, [data])
const getData = async () => {
try {
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.kr.list)
setData(res.data.map((item,i) => ({...item,inx:i + 1})))
} catch (error) {
console.log(error);
}
}
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.onDeletePost(apiurl.dataResourcesCenter.projectAndWater.kr.delete,params);
}
}
useEffect(() => {
getData();
}, [])
return (
<div>
<h1><Button type='primary' onClick={() => {refModal.current.showSave({})}}>新增</Button></h1>
<div style={{display:"flex",columnGap:10,width:"100%"}}>
<div style={{width:500}}>
<Table
rowKey="inx"
columns={columns}
dataSource={data}
pagination={false}
scroll={{ y:"calc( 100vh - 300px )"}}
/>
</div>
<div className='right-echarts' style={{ flex: 1 }}>
{
data.length > 0 ?
<ReactEcharts
option={option}
style={{width: "100%", height: '100%'}}
/> : <div style={{textAlign: "center", margin: "10%"}}>
<img src={`${process.env.PUBLIC_URL}/assets/noData.png`} alt=""/>
</div>
}
</div>
</div>
<BasicCrudModal
width={550}
ref={refModal}
title=""
component={ModalForm}
onCrudSuccess={getData}
/>
</div>
)
}

View File

@ -0,0 +1,41 @@
import React, { useState } from 'react'
import ProjectBasciInfo from './projectBasicInfo'
import TzParams from './tzParams'
import KrLine from './KrLine'
import MonthLl from './monthLl'
import "./index.less"
export default function ShuikuBasicInfo() {
const [tabVal, setTabVal] = useState('1')
return (
<div className='shuiku-content-root'>
<div className='fxdd_hsybjs_toolbar'>
<div
className={tabVal === '1' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('1')}>工程基础信息
</div>
<div
className={tabVal === '2' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('2')}>主要特征参数
</div>
<div
className={tabVal === '3' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('3')}>水库库容曲线
</div>
<div
className={tabVal === '5' ? 'fxdd_hsybjs_toolbar_item hsybjs_checked' : 'fxdd_hsybjs_toolbar_item'}
onClick={() => setTabVal('5')}>月生态流量
</div>
</div>
<div
className='shuiku-content'
style={{marginLeft:(tabVal == 1 || tabVal == 2) ? 60 : 20}}
>
{tabVal === "1" ? <ProjectBasciInfo /> : null}
{tabVal === "2" ? <TzParams /> : null}
{tabVal === "3" ? <KrLine /> : null}
{tabVal === "5" ? <MonthLl /> : null}
</div>
</div>
)
}

View File

@ -0,0 +1,56 @@
.shuiku-content-root{
height: calc(100vh - 93px);
padding: 12px;
overflow-y: auto;
overflow-x: hidden;
background-color: #fff;
margin: 4px 0 0 5px;
.fxdd_hsybjs_toolbar{
width: 100%;
height: 40px;
display: flex;
.fxdd_hsybjs_toolbar_item{
width: 120px;
height: 40px;
line-height: 40px;
margin-right: 5px;
border-radius: 10px 10px 0 0;
background: #D7DFEB;
border: 1px solid rgba(228, 231, 237, 1);
text-align: center;
font-size: 14px;
font-weight: 500;
color: #333;
cursor: pointer;
}
.hsybjs_checked{
color: #409EFF;
background: #ffffff;
}
.fxdd_hsybjs_toolbar_item:hover{
color: #409EFF;
}
}
.shuiku-content{
margin: 0 20px 0 60px;
padding: 20px 0;
}
}
.ant-input[disabled]{
color: rgba(0, 0, 0, 0.5) !important;
}
.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{
color: rgba(0, 0, 0, 0.5) !important;
}
.ant-picker-input > input[disabled]{
color: rgba(0, 0, 0, 0.5) !important;
}
.ant-select-disabled.ant-select-multiple .ant-select-selection-item{
color: rgba(0, 0, 0, 0.5) !important;
}

View File

@ -0,0 +1,180 @@
import React, { useState,useEffect } from 'react'
import { Table, Input, Form, Row, Col, Button, message } from "antd"
import { httppost2 } from '../../../../../utils/request';
import apiurl from '../../../../../service/apiurl';
import moment from "moment"
const EditableCell = ({
editing,
dataIndex,
title,
inputType,
record,
index,
children,
...restProps
}) => {
const inputNode = <Input style={{ textAlign: "center" }} />;
return (
<td {...restProps}>
{editing ? (
<Form.Item
name={dataIndex}
wrapperCol={[24]}
style={{
margin: 0,
}}
>
{inputNode}
</Form.Item>
) : (
children
)}
</td>
);
};
export default function MonthLl() {
const [form] = Form.useForm()
const columns = Array(12).fill(0).map((item, i) => ({
title: (i + 1) + '月',
key: String(i + 1),
dataIndex: String(i + 1),
align:"center",
ellipsis: true,
editable: true,
}))
const [details, setDetails] = useState([])
const [editingKey, setEditingKey] = useState('');
const [skdisabled, setSkDisabled] = useState(true)
const [data, setData] = useState([])
const isEditing = (record) => {
console.log("editingKey",editingKey,record.id);
return record.id === editingKey;
}
const mergedColumns = columns.map((col) => {
if (!col.editable) {
return col;
}
return {
...col,
onCell: (record) => ({
record,
inputType: "text",
dataIndex: col.dataIndex,
title: col.title,
editing: isEditing(record),
}),
};
});
const edit = () => {
form.setFieldsValue(details[0])
setSkDisabled(false);
setEditingKey(details[0]?.id)
}
const cancel = () => {
setSkDisabled(true);
setEditingKey("")
}
const editItem = async(arr) => {
try {
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.monthLl.update,arr)
if (res.code == 200) {
message.success('修改成功');
getData()
}
} catch (error) {
console.log(error);
}
}
const save = async () => {
try {
const row = await form.validateFields();
const newData = [];
const index = newData.findIndex((item) => details[0]?.id === item.id);
if (index > -1) {
const item = newData[index];
newData.splice(index, 1, {
...item,
...row,
});
setDetails(newData);
setEditingKey('');
} else {
newData.push(row);
setDetails(newData);
setEditingKey('');
}
setSkDisabled(true)
const arr = data.map(item => ({
...item,
value:newData[0][item.month] ? Number(newData[0][item.month]) : ''
}))
editItem(arr)
} catch (errInfo) {
console.log('Validate Failed:', errInfo);
}
};
const getData = async () => {
try {
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.monthLl.page, { year: moment().year() })
setData(res.data)
let obj = {}
for (let i = 0; i < res.data.length; i++) {
obj[res.data[i].month] = res.data[i].value
}
setDetails([{...obj,id:"42120250085"}])
} catch (error) {
console.log(error);
}
}
useEffect(() => {
console.log(details);
}, [details])
useEffect(() => {
getData()
}, [])
return (
<div>
<h1 style={{ textAlign: "center" }}>月核定生态流量</h1>
<div style={{ textAlign: "center", marginLeft: "30vw" }}>单位:/s</div>
<Form form={form} component={false}>
<Table
rowKey="id"
columns={mergedColumns}
components={{
body: {
cell: EditableCell,
},
}}
dataSource={details}
pagination={false}
/>
</Form>
<Row style={{marginTop:"60vh"}}>
<Col span={24}>
<Form.Item
wrapperCol={{span:14,offset:10}}
>
{
skdisabled ? <Button type="primary" onClick={edit}>编辑</Button> :
<div style={{ display: 'flex', columnGap: 20 }}>
<Button onClick={cancel}>取消</Button>
<Button type="primary" onClick={save}>保存</Button>
</div>
}
</Form.Item>
</Col>
</Row>
</div>
)
}

View File

@ -0,0 +1,460 @@
import React,{useState,useEffect} from 'react'
import { Row, Col, Form, Input, DatePicker, Button,Upload,message,Modal } from "antd"
import {PaperClipOutlined,DeleteOutlined} from '@ant-design/icons';
import NormalSelect from '../../../../../components/Form/NormalSelect';
import { formItemLayout } from '../../../../../components/crud/FormLayoutProps'
import apiurl from '../../../../../service/apiurl';
import { httpget2, httppost2 } from '../../../../../utils/request';
import moment from 'moment'
import "./index.less"
export default function ProjectBasciInfo() {
const [form] = Form.useForm();
const [data, setData] = useState()
const [fileList, setFileList] = useState([]) //上传文件列表
const [fileIds, setFileIds] = useState([])
const [loading, setLoading] = useState(false)
const [iframeId, setIframeId] = useState('')
const [perviewOpen, setPerviewOpen] = useState(false)
const [skdisabled, setSkDisabled] = useState(true)
const optionsLevel = [
{
label: "大 (1)型",
value:"1"
},
{
label: "大 (2)型",
value:"2"
},
{
label: "中型",
value:"3"
},
{
label: "小 (1)型",
value:"4"
},
{
label: "小 (2)型",
value:"5"
},
{
label: "其他",
value:"9"
}
]
const getData = async () => {
try {
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.detail)
// debugger;
if (res.code == 200) {
form.setFieldsValue(res.data[0])
setData(res.data[0])
if (res.data[0].files.length > 0) {
getFileInfo(res.data[0]?.files[0]?.fileId)
}
}
} catch (error) {
console.log(error);
}
}
const beforeUpload = (file) => {
const isPdf = file.type === 'application/pdf'
if (!isPdf) {
message.error("请上传pdf文件")
}
return isPdf
}
const fileChange = (info) => {
if (info.file.status === "done") {
setLoading(false);
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
if (info?.file.type === "application/pdf") {
let fileIds = info.fileList.map(file => {
return file.response?.data?.fileId
})
setFileIds(fileIds)
setFileList(info.fileList)
}
}
const deleteFile = (fileId) => {
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
}
const onFinish = async () => {
try {
let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId }))
const values = form.getFieldsValue();
const params = {
...data,
...values,
files:oldFiles
}
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.update,params)
if (res.code == 200) {
message.success("修改成功")
setSkDisabled(true)
getData()
}
} catch (error) {
console.log(error);
}
}
const getFileInfo = async(id) => {
try {
const res = await httpget2(`${apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.getFile}/${id}`)
let obj ={
name: res.data.fileName,
response: {
data: {
filePath: res.data.filePath,
fileId:res.data.fileId
}
},
}
setFileList([obj])
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getData()
}, [])
return (
<div className='basic-info-content'>
<Form
form={form}
{...formItemLayout}
onFinish={onFinish}
>
<Row>
<Col span={8}>
<Form.Item
label="水库名称"
name="resName"
rules={[{ required: true }]}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="水库代码"
name="resCode"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="注册登记号"
name="regSn"
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="注册登记时间"
name="regTime"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
>
<DatePicker allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="工程位置"
name="resLoc"
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="所在河流(水系)名称"
name="basName"
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="水库规模"
name="engScal"
rules={[{ required: true }]}
>
<NormalSelect
style={{ width: '300px' }}
allowClear
options={optionsLevel}
disabled={skdisabled}
/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="主要功能"
name="rsvFunction"
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="经度"
name="lgtd"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="纬度"
name="lttd"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="设计灌溉面积(亩)"
name="designIrrArea"
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="实际灌溉面积(亩)"
name="actualIrrArea"
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="受益人口(人)"
name="feedPop"
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="开工日期"
name="startDate"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
>
<DatePicker allowClear style={{ width: '300px' }} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="竣工日期"
name="compDate"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
>
<DatePicker allowClear style={{ width: '300px' }} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="是否病险"
name="isDanger"
>
<NormalSelect
style={{ width: '300px' }}
allowClear
options={[
{
label: '否',
value:0,
},
{
label: '是',
value:1,
},
]}
disabled={skdisabled}
/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="是否有闸控制"
name="spillwayGate"
>
<NormalSelect
style={{ width: '300px' }}
allowClear
options={[
{
label: '否',
value:"0",
},
{
label: '是',
value:"1",
},
]}
disabled={skdisabled}
/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="工程特性表"
name=""
rules={[{ required: true }]}
>
<Upload
name='file'
action="/gunshiApp/xyt/attResBase/file/upload/singleSimple"
onChange={fileChange}
fileList={fileList}
maxCount={1}
disabled={loading}
beforeUpload={beforeUpload}
itemRender={(origin,file) => {
return (
<div style={{display:"flex",alignItems:"center",columnGap:10}}>
<PaperClipOutlined />
<span
style={{ cursor: "pointer" }}
onClick={() => { setPerviewOpen(true); setIframeId(file.response?.data?.fileId)}}
>
{file?.name}</span>
{skdisabled ? null :
<DeleteOutlined
style={{ marginLeft: 20, cursor: "pointer" }}
onClick={() => deleteFile(file.response?.data?.fileId)}
/>
}
</div>
)
}}
>
{skdisabled ? null :
<div style={{display:"flex",alignItems:"center",columnGap:10,color:"#4f85ec",cursor:skdisabled?"not-allowed":"pointer"}}>
<PaperClipOutlined />
<a style={{cursor:"pointer"}}>上传PDF文件</a>
</div>
}
</Upload>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="供水效益"
name="benefit"
labelCol={{ span: 2, offset: 0 }}
wrapperCol={{span:21,offset:0}}
>
<Input allowClear disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="工程概况"
name="projOverview"
labelCol={{ span: 2, offset: 0 }}
wrapperCol={{span:21,offset:0}}
>
<Input.TextArea allowClear style={{width:'100%',minHeight:'100px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{marginTop:80}}>
<Col span={24}>
<Form.Item
wrapperCol={{span:14,offset:10}}
>
{
skdisabled ? <Button type="primary" onClick={() => setSkDisabled(false)}>编辑</Button> :
<div style={{ display: 'flex', columnGap: 20 }}>
<Button onClick={() => setSkDisabled(true)}>取消</Button>
<Button type="primary" onClick={() => { onFinish() }}>保存</Button>
</div>
}
</Form.Item>
</Col>
</Row>
</Form>
<Modal
open={perviewOpen}
width={1000}
title=""
footer={null}
style={{marginTop:"-5%"}}
onCancel={() => {
setPerviewOpen(false)
}}
>
<iframe
style={{
height: '80vh',
width: '100%',
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/attResBase/file/download/${iframeId}`)}`}
/>
</Modal>
</div>
)
}

View File

@ -0,0 +1,271 @@
import React,{useState,useEffect} from 'react'
import { Row, Col, Form, Input, DatePicker, Button,Upload,message,Modal } from "antd"
import {PaperClipOutlined,DeleteOutlined} from '@ant-design/icons';
import NormalSelect from '../../../../../components/Form/NormalSelect';
import { formItemLayout } from '../../../../../components/crud/FormLayoutProps'
import apiurl from '../../../../../service/apiurl';
import { httppost2 } from '../../../../../utils/request';
import moment from 'moment'
import "./index.less"
export default function ProjectBasciInfo() {
const [form] = Form.useForm();
const [data, setData] = useState()
const [skdisabled, setSkDisabled] = useState(true)
const getData = async () => {
try {
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.detail)
form.setFieldsValue(res.data[0])
setData(res.data[0])
} catch (error) {
console.log(error);
}
}
const onFinish = async () => {
try {
const values = form.getFieldsValue();
const params = {
...data,
...values,
}
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.update,params)
if (res.code == 200) {
message.success("修改成功")
setSkDisabled(true)
getData()
}
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getData()
}, [])
return (
<div className='basic-info-content'>
<Form
form={form}
// {...formItemLayout}
onFinish={onFinish}
labelCol={{ span: 8 }}
wrapperCol={{span:14}}
>
<Row>
<Col span={8}>
<Form.Item
label="坝址以上流域面积(km²)"
name="watShedArea"
rules={[{ required: true }]}
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="坝顶高程(m)"
name="crestElev"
labelCol={{ span: 5 }}
wrapperCol={{span:14}}
rules={[{ required: true }]}
>
<Input allowClear style={{width:'280px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="最大坝高(m)"
name="maxDamHeig"
labelCol={{ span: 6 }}
wrapperCol={{span:14}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="校核洪水位(m)"
name="calFloodLev"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8} >
<Form.Item
label="总库容(万m³)"
name="totCap"
labelCol={{ span: 5 }}
wrapperCol={{span:14}}
rules={[{ required: true }]}
>
<Input allowClear style={{width:'280px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8} style={{marginLeft:"-105px"}}>
<Form.Item
label="校核洪水位时最大下泄流量(m³/s)"
name="maxCalFloodFlow"
labelCol={{ span: 11 }}
wrapperCol={{span:13}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="设计洪水位(m)"
name="desFloodLev"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="调洪库容(万m³)"
name="storFlCap"
labelCol={{ span: 5 }}
wrapperCol={{span:14}}
rules={[{ required: true }]}
>
<Input allowClear style={{width:'280px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8} style={{marginLeft:"-125px"}}>
<Form.Item
label="设计洪水位时最大下泄流量(m³/s)"
name="maxDesFloodFlow"
labelCol={{ span: 12 }}
wrapperCol={{span:12}}
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="防洪高水位(m)"
name="uppLevFlco"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="防洪库容(万m³)"
name="flcoCap "
labelCol={{ span: 5 }}
wrapperCol={{span:14}}
>
<Input allowClear style={{width:'280px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8} style={{marginLeft:"-43px"}}>
<Form.Item
label="下游河道安全泄量(m³/s)"
name="dsSaftFlow"
labelCol={{ span: 8 }}
wrapperCol={{span:14}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="正常蓄水位(m)"
name="normWatLev"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="兴利库容(万m³)"
name="benResCap"
labelCol={{ span: 5 }}
wrapperCol={{span:14}}
>
<Input allowClear style={{width:'280px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="汛限水位(m)"
name="flLowLimLev"
rules={[{ required: true }]}
labelCol={{ span: 6 }}
wrapperCol={{span:14}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Item
label="死水位(m)"
name="deadLev"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="死库容(万m³)"
name="deadCap"
labelCol={{ span: 5 }}
wrapperCol={{span:14}}
rules={[{ required: true }]}
>
<Input allowClear style={{width:'280px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="堰顶高程(m)"
name="wcrstel"
rules={[{ required: true }]}
labelCol={{ span: 6 }}
wrapperCol={{span:14}}
>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
</Row>
<Row style={{marginTop:80}}>
<Col span={24}>
<Form.Item
wrapperCol={{span:14,offset:10}}
>
{
skdisabled ? <Button type="primary" onClick={() => setSkDisabled(false)}>编辑</Button> :
<div style={{ display: 'flex', columnGap: 20 }}>
<Button onClick={() => setSkDisabled(true)}>取消</Button>
<Button type="primary" onClick={() => { onFinish() }}>保存</Button>
</div>
}
</Form.Item>
</Col>
</Row>
</Form>
</div>
)
}

View File

@ -0,0 +1,76 @@
import { Image } from "antd"
import zd from '../../../../assets/img/u0.png'
import qys1 from '../../../../assets/img/qys1.png'
import qys2 from '../../../../assets/img/qys2.jpg'
import qys3 from '../../../../assets/img/qys3.jpg'
import qys4 from '../../../../assets/img/qys4.png'
import stylesCss from './index.module.less'
import { Rnd } from "react-rnd"
import { useState, useEffect } from "react"
const list = [
{ name: '水库地理位置图', key: 1, img: qys1 },
{ name: '水库平面布置图', key: 2, img: qys2 },
{ name: '主坝平面布置图', key: 3, img: qys3 },
{ name: '副坝平面布置图', key: 4, img: qys4 },
]
const Page = () => {
const [url, setUrl] = useState(qys1)
const tabClick = (item) => {
setUrl(item.img)
}
useEffect(() => {
let scale = 1
const img = document.getElementById("img");
const fun = (e) => {
console.log(1111)
// 大于0:滚轮向上滚动 小于0:滚轮向下滚动
if (e.wheelDelta > 0) {
scale += 0.05;
img.style.transform = `scale(${scale})`;
} else {
if (scale == 1) {
img.style.left = 0 + "px";
img.style.top = 0 + "px";
}
// 缩放值大于1时,可以缩小,反之亦然
if (scale > 1) {
scale -= 0.05;
img.style.transform = `scale(${scale})`;
}
}
}
img.addEventListener("wheel", fun)
// getSyData()
// getSlData()
// getWyData()
// getDmData()
return () => {
img.removeEventListener("wheel", fun)
}
}, [])
return (
<div style={{ backgroundColor: '#fff', height: '100%' }}>
<div style={{ display: 'flex', justifyContent: 'start', alignItems: 'center', padding: 10 }}>
{list.map(item => <div className={url == item.img ? stylesCss.active : stylesCss.tabCheck} onClick={() => tabClick(item)}>{item.name}</div>)}
</div>
<Rnd
default={{
x: 200,
y: 60,
width: '80%',
height: 'calc(100% - 100px)'
}}
>
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', width:'72%',height:'98%',}}>
<Image src={url} id="img" preview={false} />
</div>
</Rnd>
</div>
)
}
export default Page

View File

@ -0,0 +1,54 @@
.tabCheck{
width: 120px;
height: 40px;
line-height: 40px;
margin-right: 5px;
border-radius: 10px 10px 0 0;
background: #D7DFEB;
border: 1px solid rgba(228, 231, 237, 1);
text-align: center;
font-size: 14px;
font-weight: 500;
color: #333;
cursor: pointer;
}
.active{
width: 120px;
height: 40px;
line-height: 40px;
margin-right: 5px;
border-radius: 10px 10px 0 0;
background: #D7DFEB;
border: 1px solid rgba(228, 231, 237, 1);
text-align: center;
font-size: 14px;
font-weight: 500;
color: #333;
cursor: pointer;
color: #409EFF;
background: #ffffff;
}
// .fxdd_hsybjs_toolbar_item{
// width: 120px;
// height: 40px;
// line-height: 40px;
// margin-right: 5px;
// border-radius: 10px 10px 0 0;
// background: #D7DFEB;
// border: 1px solid rgba(228, 231, 237, 1);
// text-align: center;
// font-size: 14px;
// font-weight: 500;
// color: #333;
// cursor: pointer;
// }
// .hsybjs_checked{
// color: #409EFF;
// background: #ffffff;
// }

View File

@ -0,0 +1,28 @@
import { Image } from "antd"
import zd from '../../../../assets/img/u7.png'
import title from '../../../../assets/img/titleRight.png'
import './index.less'
const Page = () => {
return (
<div style={{ display: 'flex',height:'100%' }}>
<div style={{ backgroundColor: '#ffffff',width:390,height:'100%',marginRight:10 }}>
<div className="title">
<Image src={title} />保护对象
</div>
<div className="content">
水库防洪标准按50年一遇设计1000年一遇校核设计洪水位111.51校核洪水位 112.75 ,水库担负着红安县城七里坪杏花城关等城镇以及京九铁路汉麻连络线省道S234国道G230,京九铁路汉麻联络线等交通设施安全的防洪重任防洪保护人口32万
保护耕地 15 万亩
</div>
</div>
<div style={{ backgroundColor: '#ffffff',flex:1}}>
<div className="title">
<Image src={title} />转移路线示意图
</div>
<Image src={zd} width='80%' preview={false} />
</div>
</div>
)
}
export default Page

View File

@ -0,0 +1,28 @@
import { Image } from "antd"
import zd from '../../../../assets/img/u7.png'
import title from '../../../../assets/img/titleRight.png'
import './index.less'
const Page = () => {
return (
<div style={{ display: 'flex',height:'100%' }}>
<div style={{ backgroundColor: '#ffffff',width:390,height:'100%',marginRight:10,padding:10 }}>
<div className="title">
<Image src={title} />保护对象
</div>
<div className="content">
水库防洪标准按50年一遇设计1000年一遇校核设计洪水位111.51校核洪水位 112.75 ,水库担负着红安县城七里坪杏花城关等城镇以及京九铁路汉麻连络线省道S234国道G230,京九铁路汉麻联络线等交通设施安全的防洪重任防洪保护人口32万
保护耕地 15 万亩
</div>
</div>
<div style={{ backgroundColor: '#ffffff',flex:1,padding:10}}>
<div className="title">
<Image src={title} />转移路线示意图
</div>
<Image src={zd} width='80%' preview={false} />
</div>
</div>
)
}
export default Page

View File

@ -0,0 +1,10 @@
.title{
font-size: 16px;
color: #000000;
width: 112px;
height: 32px
}
.content{
font-size: 17px;
padding: 0 20px;
}

View File

@ -0,0 +1,296 @@
import React,{useEffect,useState,useMemo,useRef} from 'react';
import { Form, Button, Input, Row,Upload, Col, Table, DatePicker, InputNumber,message,Image,Modal,Typography ,Popconfirm } from 'antd';
import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
import { formItemLayout, btnItemLayout } from '../../../../components/crud/FormLayoutProps';
import apiurl from '../../../../service/apiurl';
import NormalSelect from '../../../../components/Form/NormalSelect';
import "./index.less"
import moment from 'moment';
const { RangePicker } = DatePicker
const { Dragger } = Upload;
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const [form] = Form.useForm();
const [fileList, setFileList] = useState([]) //上传文件列表
const [fileIds, setFileIds] = useState([])
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const [loading, setLoading] = useState(false)
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
// 模拟点击事件,开始下载
downloadLink.click();
}
/**
* @description 上传图片
* @param {string} file 上传的文件
*/
const fileChange = (info) => {
if (info.file.status === "done") {
setLoading(false);
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
let fileIds = info.fileList.map(file => {
return file.response?.data?.fileId
})
setFileIds(fileIds)
setFileList(info.fileList)
}
/**
* @description pdf文件预览
* @param {String} params 文件预览url
*/
const viewPdf = (params) => {
setIframeSrc(params)
setPdfViewOPen(true)
}
const onfinish = (values) => {
values.eventsDate = values.eventsDate?moment(values.eventsDate).format("YYYY-MM-DD 00:00:00"):''
let oldFiles = fileList.map(item => ({fileId:item.response?.data?.fileId}) )
if (mode === 'edit') {
values.files = oldFiles;
values.id = record.id;
onEdit(apiurl.rcgl.gcdsj.edit,values)
}
if (mode === 'save') {
values.files = oldFiles
onSave(apiurl.rcgl.gcdsj.save,values)
}
}
/**
* @description 删除上传的图片
* @param {string} id 删除的id
*/
const deleteFile = (fileId) => {
console.log(fileId);
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
}
useEffect(() => {
if (mode != 'save') {
const imgFile = record?.files?.map(o => ({
name: o.fileName,
response: {
data: {
filePath: o.filePath,
fileId:o.fileId
}
},
}))
setFileList(imgFile)
}
}, [record, mode])
return (
<>
<Form
form={form}
{...formItemLayout}
onFinish={onfinish}
initialValues={record}
>
<Row>
<Col span={12}>
<Form.Item
label="名称"
name="name"
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="发生日期"
name="eventsDate"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[
{
required: true,
},
]}
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="事件类型"
name="eventsType"
>
<NormalSelect
allowClear
disabled={mode==='view'}
style={{ width: "100%" }}
options={[{label:"综合大事记",value:1},{label:"专题大事记",value:2}]}
/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="事件内容描述"
name="eventsDesc"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<Input.TextArea disabled={mode==='view'} style={{width:'100%',minHeight:'100px'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="附件"
name="fieldId"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
{mode !== "view" &&
<Dragger
name='file'
// multiple
action="/gunshiApp/xyt/projectEvents/file/upload/singleSimple"
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
disabled={loading}
// onSuccess={handleSuccess}
>
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
<p className="ant-upload-hint">
支持扩展名.doc .docx .pdf .jpg .png .ppt
</p>
</Dragger>
}
<Row gutter={[16]}>
{
fileList.length > 0 && fileList.map(file => {
return (
<Col span={12}>
<div className="file-item" style={{width:"75%"}}>
<div className='file-description'>
{file.name.indexOf('.docx') > -1 ?
<div
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileWordOutlined
style={{ fontSize: 40 }}
/>
</div>
:
file.name.indexOf('.pdf') > -1 ?
<div
onClick={() => { viewPdf(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FilePdfOutlined style={{ fontSize: 40 }} />
</div>
:
file.name.indexOf('.zip') > -1 ?
<div
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileZipOutlined style={{ fontSize: 40 }} />
</div>
:
file.name.indexOf('.xlsx') > -1 ?
<div
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileExcelOutlined style={{ fontSize: 40 }} />
</div>
:
<Image width={60} src={url +file.response?.data?.filePath} alt='' />
}
<span>{file.name}</span>
</div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
<DeleteOutlined />
</div>
</div>
</Col>
)
})
}
</Row>
</Form.Item>
</Col>
</Row>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '提交' : '修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
<Modal
open={pdfViewOPen}
width={1000}
title=""
footer={null}
style={{marginTop:"-5%"}}
onCancel={() => {
setPdfViewOPen(false)
}}
>
<iframe
style={{
height: '80vh',
width: '100%',
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/projectEvents/file/download/${iframeSrc}`)}`}
/>
</Modal>
</>
);
}
export default ModalForm;

View File

@ -0,0 +1,223 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import BasicCrudModal from '../../../../components/crud/BasicCrudModal';
import { Table, Card, Modal, Form, Input, Button, Row,Col, Timeline, message, Tabs,Image } from 'antd';
import {FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
import { useSelector } from 'react-redux';
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 {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
const delBtn = role?.rule?.find(item => item.menuName == "删除");
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const [isFetch, setIsFetch] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '名称', key: 'name', dataIndex: 'name', width: 250, ellipsis: true },
{
title: '发生日期', key: 'eventsDate', dataIndex: 'eventsDate', width: 140,
},
{
title: '事件类型', key: 'eventsType', dataIndex: 'eventsType', width: 140,
render: (value) => <span>{value == 1 ? "综合大事记" : value == 2 ? "专题大事记" : ''}</span>,
},
{
title: '事件内容描述', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300},
{
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (
<CrudOpRender_text
edit={ true }
del={ true }
view={ 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.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
}
}
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
// 模拟点击事件,开始下载
downloadLink.click();
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.gcdsj.page).find_noCode);
/**
* @description 处理成功的回调
*/
const successCallback = () => {
refresh()
setIsFetch(!isFetch)
}
const viewPdf = (params) => {
setIframeSrc(params)
setPdfViewOPen(true)
}
useEffect(()=>{
const params = {
search: {
...searchVal,
}
};
search(params)
}, [searchVal])
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onSave={command('save')}
role={role}
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Tabs defaultActiveKey="1">
<Tabs.TabPane tab="列表" key="1">
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width , y: "calc( 100vh - 400px )"}}/>
</Tabs.TabPane>
<Tabs.TabPane tab="时间轴" key="2">
<div className='time-line'>
<Timeline>
{tableProps.dataSource.map((item, index) => (
<Timeline.Item key={index}>
<div className='time-line-item'>
<span style={{width:100}}>{item.eventsDate}</span>
<div className='item-right'>
<span>{item.eventsDesc}</span>
<div style={{ display: "flex"}}>
<span>附件</span>
<Row gutter={[16]} style={{flex:1}}>
{
item.files.length > 0 && item.files.map(file => {
return (
<Col span={12}>
<div className="file-item" style={{width:"100%"}}>
<div className='file-description'>
{file.fileName.indexOf('.docx') > -1 ?
<div
onClick={() => { download(file.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileWordOutlined
style={{ fontSize: 40 }}
/>
</div>
:
file.fileName.indexOf('.pdf') > -1 ?
<div
onClick={() => { viewPdf(file?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FilePdfOutlined style={{ fontSize: 40 }} />
</div>
:
file.fileName.indexOf('.zip') > -1 ?
<div
onClick={() => { download(file?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileZipOutlined style={{ fontSize: 40 }} />
</div>
:
file.fileName.indexOf('.xlsx') > -1 ?
<div
onClick={() => { download(file?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileExcelOutlined style={{ fontSize: 40 }} />
</div>
:
<Image width={60} src={url +file?.filePath} alt='' />
}
<span>{file.fileName}</span>
</div>
</div>
</Col>
)
})
}
</Row>
</div>
</div>
</div>
</Timeline.Item>
))}
</Timeline>
</div>
</Tabs.TabPane>
</Tabs>
</div>
</div>
<BasicCrudModal
width={1000}
ref={refModal}
title=""
component={ModalForm}
onCrudSuccess={successCallback}
// onCrudSuccess={()=>{refresh({addvcd:localStorage.getItem('ADCD6')})}}
/>
</div>
<Modal
open={pdfViewOPen}
width={1000}
title=""
footer={null}
style={{marginTop:"-5%"}}
onCancel={() => {
setPdfViewOPen(false)
}}
>
<iframe
style={{
height: '80vh',
width: '100%',
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/projectEvents/file/download/${iframeSrc}`)}`}
/>
</Modal>
</>
);
}
export default Page;

View File

@ -0,0 +1,30 @@
.basic-info{
position: relative;
font-size: 16px;
margin-bottom: 20px;
padding:5px 25px;
border-bottom: 1px solid #eee;
&::before{
position: absolute;
top:8px;
left:0;
content: "";
display: block;
width: 5px;
height: 20px;
background-color: #0079fe;
}
}
.time-line{
width: 50%;
margin-left: 6%;
margin-top: 1%;
.time-line-item{
display: flex;
// align-items: center;
column-gap: 20px;
.item-right{
flex:1
}
}
}

Some files were not shown because too many files have changed in this diff Show More