feat(): 模块迁移
parent
2a33ab7d66
commit
22ff44b1e6
|
|
@ -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;
|
||||||
|
|
@ -193,7 +193,42 @@ export async function loadMenu(): Promise<MenuItem[]> {
|
||||||
const id = idgen()
|
const id = idgen()
|
||||||
return [
|
return [
|
||||||
{ id: id(), title: '水库一张图', path: '/mgr/home', icon: 'jbqk' },
|
{ id: id(), title: '水库一张图', path: '/mgr/home', icon: 'jbqk' },
|
||||||
|
{
|
||||||
|
id: id(), title: '四制', redirect: '/mgr/sz/gltx/zzjgck', icon: 'jbqk',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
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/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: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb',
|
{ id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb',
|
||||||
children: [
|
children: [
|
||||||
{ id: id(), title: '防洪形势', path: '/mgr/sy/fhxzfx'},
|
{ id: id(), title: '防洪形势', path: '/mgr/sy/fhxzfx'},
|
||||||
|
|
@ -206,21 +241,107 @@ export async function loadMenu(): Promise<MenuItem[]> {
|
||||||
// { id: id(), title: '参数管理', path: '/mgr/fxzb/hsyb/csgl' },
|
// { id: id(), title: '参数管理', path: '/mgr/fxzb/hsyb/csgl' },
|
||||||
// ]
|
// ]
|
||||||
// },
|
// },
|
||||||
// { id: id(), title: '调度规程', path: '/mgr/fxzb/ddgc'},
|
{ id: id(), title: '防汛预案', path: '/mgr/sy/fxya'},
|
||||||
// { id: id(), title: '防汛预案', path: '/mgr/fxzb/fxya'},
|
{ id: id(), title: '调度规程', path: '/mgr/sy/ddgc'},
|
||||||
// {
|
{
|
||||||
// id: id(),
|
id: id(),
|
||||||
// title: '抢险物料',
|
title: '抢险物料',
|
||||||
// path: '/mgr/fxzb/qxwl',
|
path: '/mgr/sy/qxwl',
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// id: id(),
|
id: id(),
|
||||||
// title: '抢险队伍',
|
title: '抢险队伍',
|
||||||
// path: '/mgr/fxzb/qxdw',
|
path: '/mgr/sy/qxdw',
|
||||||
// },
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{ id: id(), title: '四管', redirect: '/mgr/sg/xcxj/xcrw', icon: 'fxzb',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
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'},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: id(), title: '工程安全预警', redirect: '/mgr/gcaqjc/gcaqyj/yhyj',
|
||||||
|
children: [
|
||||||
|
{ id: id(), title: '隐患预警', path: '/mgr/gcaqjc/gcaqyj/yhyj' },
|
||||||
|
{ id: id(), title: '预警规则配置', path: '/mgr/gcaqjc/gcaqyj/yjgzpz' },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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/ndsytjb' },
|
||||||
|
{ id: id(), title: '年度渗流统计表', path: '/mgr/gcaqjc/sjtjcx/ndsltjb' },
|
||||||
|
]
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// { id: id(), title: '基本2情况', path: '/mgr/home', icon: 'jbqk' },
|
// { id: id(), title: '基本2情况', path: '/mgr/home', icon: 'jbqk' },
|
||||||
// {
|
// {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,13 @@ const zdkapi = 'https://slt-sh.chutianyun.gov.cn:8002' //中电科的市级平
|
||||||
const service_fxdd = '/gunshiApp/xyt'
|
const service_fxdd = '/gunshiApp/xyt'
|
||||||
const service_shzh = '/shzh'
|
const service_shzh = '/shzh'
|
||||||
const apiurl = {
|
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',
|
setMenu: service_fxdd + '/visitMenuLog/insert',
|
||||||
setPassword: service_fxdd + '/user/updateSecretKey',
|
setPassword: service_fxdd + '/user/updateSecretKey',
|
||||||
xytlogin: {
|
xytlogin: {
|
||||||
|
|
@ -414,11 +421,10 @@ const apiurl = {
|
||||||
controler:service_fxdd + "/attCctvBase/control"
|
controler:service_fxdd + "/attCctvBase/control"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sdz:{
|
sdz: {
|
||||||
zrrByCode:service_fxdd + '/hEHystSafePerson/hystCode',
|
zrrByCode:service_fxdd + '/hEHystSafePerson/hystCode',
|
||||||
gctp:service_fxdd + '/attHystBase/projectImgList',
|
gctp:service_fxdd + '/attHystBase/projectImgList',
|
||||||
sjzl:service_fxdd + '/attHystBase/desFileList',
|
sjzl:service_fxdd + '/attHystBase/desFileList',
|
||||||
fxya:service_fxdd + '/attHystBase/planList',
|
|
||||||
delGctp:service_fxdd + '/hEHystProjectImg/delete',
|
delGctp:service_fxdd + '/hEHystProjectImg/delete',
|
||||||
filedNameById:service_fxdd + '/hEHystProjectImg/file/get/'
|
filedNameById:service_fxdd + '/hEHystProjectImg/file/get/'
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,10 @@ import Gstjfx from "./gxsl/gstjfx"
|
||||||
import Spjk from "./video"
|
import Spjk from "./video"
|
||||||
import AiWarn from "./spjk/aiWarn"
|
import AiWarn from "./spjk/aiWarn"
|
||||||
|
|
||||||
|
|
||||||
|
// 四制 - 组织机构查看
|
||||||
|
import Zzjgck from './sz/zzjgck'
|
||||||
|
|
||||||
const HomePage = lazy(() => import('./Home'))
|
const HomePage = lazy(() => import('./Home'))
|
||||||
|
|
||||||
const IframePage = lazy(() => import('./Iframe'))
|
const IframePage = lazy(() => import('./Iframe'))
|
||||||
|
|
@ -117,16 +121,16 @@ const AppRouters: React.FC = () => {
|
||||||
{ path: 'fxzb/hsyb/csgl', element: <Csgl /> },
|
{ path: 'fxzb/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 /> },
|
||||||
|
|
||||||
|
|
||||||
// 工程安全监测
|
// 工程安全监测
|
||||||
|
|
@ -148,33 +152,33 @@ const AppRouters: React.FC = () => {
|
||||||
{ path: 'gcaqjc/gcaqfx/jrx', element: <Jrx /> },
|
{ path: 'gcaqjc/gcaqfx/jrx', element: <Jrx /> },
|
||||||
|
|
||||||
// 日常管理-水质整编
|
// 日常管理-水质整编
|
||||||
{ path: 'rcgl/btbb/rjswbb', element: <Rjswnbb /> },
|
{ path: 'sg/btbb/rjswbb', element: <Rjswnbb /> },
|
||||||
{ path: 'rcgl/btbb/rjylnbb', element: <Rjylnbb /> },
|
{ path: 'sg/btbb/rjylnbb', element: <Rjylnbb /> },
|
||||||
{ path: 'rcgl/btbb/sdswbb', element: <Sdswrbb /> },
|
{ path: 'sg/btbb/sdswbb', element: <Sdswrbb /> },
|
||||||
{ path: 'rcgl/btbb/sdjyrbb', element: <Sdjyrbb /> },
|
{ path: 'sg/btbb/sdjyrbb', element: <Sdjyrbb /> },
|
||||||
{ path: 'rcgl/xcxj/xcrw', element: <Xjrw /> },
|
{ path: 'sg/xcxj/xcrw', element: <Xjrw /> },
|
||||||
{ path: 'rcgl/xcxj/xjwtcl', element: <Xjwtcl /> },
|
{ path: 'sg/xcxj/xjwtcl', element: <Xjwtcl /> },
|
||||||
{ path: 'rcgl/xcxj/xjxpz', element: <Xjxpz/> },
|
{ path: 'sg/xcxj/xjxpz', element: <Xjxpz/> },
|
||||||
{ path: 'byfz/fzxc', element: <Fzxc /> },
|
{ path: 'sg/byfz/byxc', element: <Fzxc /> },
|
||||||
{ path: 'byfz/bypc', element: <Bypc /> },
|
{ path: 'sg/byfz/bypc', element: <Bypc /> },
|
||||||
{ path: 'rcgl/wxyh', element: <Wxyh /> },
|
{ path: 'sg/wxyh', element: <Wxyh /> },
|
||||||
{ path: 'rcgl/aqgl/aqjcgl', element: <Aqjcgl /> },
|
{ path: 'sg/aqgl/aqjcgl', element: <Aqjcgl /> },
|
||||||
{ path: 'rcgl/aqgl/fxgkqd', element: <Fxgkqd /> },
|
{ path: 'sg/aqgl/fxgkqd', element: <Fxgkqd /> },
|
||||||
{ path: 'rcgl/aqgl/cxjbtz', element: <Cxjgtz /> },
|
{ path: 'sg/aqgl/cxjgtz', element: <Cxjgtz /> },
|
||||||
{ path: 'rcgl/aqgl/aqjdtz', element: <Aqjdtz /> },
|
{ path: 'sg/aqgl/aqjdtz', element: <Aqjdtz /> },
|
||||||
{ path: 'rcgl/aqgl/aqyhpc', element: <Aqyhpc /> },
|
{ path: 'sg/aqgl/aqyhpc', element: <Aqyhpc /> },
|
||||||
{ path: 'rcgl/aqgl/aqsgdj', element: <Aqsgdj /> },
|
{ path: 'sg/aqgl/aqsgdj', element: <Aqsgdj /> },
|
||||||
{ path: 'rcgl/gcdsj', element: <Gcdsj /> },
|
{ path: 'sg/gcdsj', element: <Gcdsj /> },
|
||||||
{ path: 'rcgl/szzb', element: <Szzb /> },
|
{ path: 'sg/szzb', element: <Szzb /> },
|
||||||
{ path: 'rcgl/stlljc', element: <Stlljc /> },
|
{ path: 'rcgl/stlljc', element: <Stlljc /> },
|
||||||
{ path: 'rcgl/zbgl/zbb', element: <Zbb /> },
|
{ path: 'sg/zbgl/zbb', element: <Zbb /> },
|
||||||
{ path: 'rcgl/zbgl/zbrz', element: <Zbrz /> },
|
{ path: 'sg/zbgl/zbrz', element: <Zbrz /> },
|
||||||
// 日常管理-监督考核
|
// 日常管理-监督考核
|
||||||
{ path: 'rcgl/jdkh/khtj', element: <Khtj /> },
|
{ path: 'sz/jdkh/khtj', element: <Khtj /> },
|
||||||
{ path: 'rcgl/jdkh/khzbgl', element: <Khzbgl /> },
|
{ path: 'sz/jdkh/khzbgl', element: <Khzbgl /> },
|
||||||
{ path: 'rcgl/jdkh/khmbgl', element: <Khmbgl /> },
|
{ path: 'sz/jdkh/khmbgl', element: <Khmbgl /> },
|
||||||
{ path: 'rcgl/jdkh/khwtzg', element: <Khwtzg /> },
|
{ path: 'sz/jdkh/khwtzg', element: <Khwtzg /> },
|
||||||
{ path: 'rcgl/jdkh/khrwgl', element: <Khrwgl /> },
|
{ path: 'sz/jdkh/khrwgl', element: <Khrwgl /> },
|
||||||
|
|
||||||
|
|
||||||
// 供水兴利
|
// 供水兴利
|
||||||
|
|
@ -187,7 +191,7 @@ const AppRouters: React.FC = () => {
|
||||||
{ path: 'fxzb/jczw/sqz', element: <HomePage /> },
|
{ path: 'fxzb/jczw/sqz', element: <HomePage /> },
|
||||||
// 视频监控
|
// 视频监控
|
||||||
{ path: 'spjk/spjk', element: <Spjk /> },
|
{ path: 'spjk/spjk', element: <Spjk /> },
|
||||||
{ path: 'spjk/aiWarn', element: <AiWarn /> },
|
{ path: 'sg/gjgl/aigj', element: <AiWarn /> },
|
||||||
|
|
||||||
// { path: 'fxzb/zbb', element: <Zbb /> },
|
// { path: 'fxzb/zbb', element: <Zbb /> },
|
||||||
// { path: 'fxzb/txl', element: <Txl /> },
|
// { path: 'fxzb/txl', element: <Txl /> },
|
||||||
|
|
@ -206,6 +210,9 @@ const AppRouters: React.FC = () => {
|
||||||
{ path: 'fxdd/ddjc/yjxy', element: <Yjxy /> },
|
{ path: 'fxdd/ddjc/yjxy', element: <Yjxy /> },
|
||||||
{ path: 'fxdd/ddjc/ddzl', element: <Ddzl /> },
|
{ path: 'fxdd/ddjc/ddzl', element: <Ddzl /> },
|
||||||
{ path: 'videoSurveillance', element: <VideoList /> },
|
{ path: 'videoSurveillance', element: <VideoList /> },
|
||||||
|
|
||||||
|
// 四制-组织机构查看
|
||||||
|
{ path: 'sz/gltx/zzjgck', element: <Zzjgck /> },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ path: '/login', element: <LoginPage /> },
|
{ path: '/login', element: <LoginPage /> },
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,96 @@
|
||||||
import React,{useEffect,useState} from 'react';
|
import React,{useEffect,useState,useRef} from 'react';
|
||||||
import { Form, Button, Input, message,Row, Col, DatePicker,Upload,Image,Modal } from 'antd';
|
import { Form, Button, Input, Row, Col,Upload,DatePicker,Modal,message,Image } from 'antd';
|
||||||
import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FilePptOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
|
import {PaperClipOutlined,DeleteOutlined,FileWordOutlined,FilePdfOutlined,FilePptOutlined,FileZipOutlined,FileExcelOutlined} from '@ant-design/icons';
|
||||||
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
|
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
|
||||||
import apiurl from '../../../service/apiurl';
|
import apiurl from '../../../service/apiurl';
|
||||||
import { createCrudService } from '../../../components/crud/_';
|
import { httpget2 } from '../../../utils/request';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { Dragger } = Upload;
|
import "./index.less";
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const ModalForm = ({ mode, record,onEdit,onSave }) => {
|
const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
|
||||||
if(record.prodDate){
|
|
||||||
record.myTm = moment(record.prodDate)
|
|
||||||
}
|
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [fileList, setFileList] = useState([]) //上传文件列表
|
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)
|
const [loading, setLoading] = useState(false)
|
||||||
/**
|
const [iframeId, setIframeId] = useState('')
|
||||||
* @description 删除上传的图片
|
const [perviewOpen, setPerviewOpen] = useState(false)
|
||||||
* @param {string} id 删除的id
|
|
||||||
*/
|
const fileChange = (info) => {
|
||||||
const deleteFile = (fileId) => {
|
console.log("file",info);
|
||||||
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
|
|
||||||
setFileList(filterFile)
|
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 文件下载
|
const deleteFile = (fileId) => {
|
||||||
* @param {String} params 文件fileId
|
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
|
||||||
*/
|
setFileList(filterFile)
|
||||||
const download = (params) => {
|
}
|
||||||
|
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");
|
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.download = `${params.fileName}`;
|
||||||
downloadLink.style.display = "none";
|
downloadLink.style.display = "none";
|
||||||
// 将链接添加到页面中
|
// 将链接添加到页面中
|
||||||
|
|
@ -41,153 +99,120 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
|
||||||
// 模拟点击事件,开始下载
|
// 模拟点击事件,开始下载
|
||||||
downloadLink.click();
|
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(() => {
|
useEffect(() => {
|
||||||
console.log(record);
|
if (record && mode != "save") {
|
||||||
if ((mode === "view" || mode === "edit") && record.attachList?.length) {
|
getFileInfo(record?.files[0]?.fileId)
|
||||||
getFileInfo(record)
|
}
|
||||||
}
|
}, [record,mode])
|
||||||
}, [record, mode])
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
|
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="图件名称"
|
label="调度规程名称"
|
||||||
name="imgName"
|
name="planName"
|
||||||
|
labelCol={{ span: 3, offset: 0 }}
|
||||||
|
wrapperCol={{span:21,offset:0}}
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input
|
||||||
|
style={{ width: '100%' }}
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
|
||||||
<Col span={24}>
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="制作单位"
|
label="编制单位"
|
||||||
name="prodUnitName"
|
name="prepOrg"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input
|
||||||
|
style={{ width: '100%' }}
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
<Col span={12}>
|
||||||
<Row>
|
|
||||||
<Col span={24}>
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="制作时间"
|
label="编制日期"
|
||||||
name="myTm"
|
name="prepTime"
|
||||||
|
getValueFromEvent={(e, dateString) => dateString}
|
||||||
|
getValueProps={value => ({
|
||||||
|
value: value ? moment(value) : undefined
|
||||||
|
})}
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<DatePicker
|
<DatePicker allowClear style={{width:'280px'}} />
|
||||||
disabled={mode==='view'}
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
style={{width:'100%'}}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="附件"
|
label="批复部门"
|
||||||
// label={mode !== "view" ? "附件" : ''}
|
name="apprOrg"
|
||||||
name="fieldId"
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
{mode !== "view" &&
|
<Input
|
||||||
<Dragger
|
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'
|
name='file'
|
||||||
// multiple
|
action="/gunshiApp/xyt/resPlanB/file/upload/singleSimple"
|
||||||
action="/gunshiApp/xfflood/xfIdeoImgB/file/upload/singleSimple"
|
|
||||||
onChange={fileChange}
|
onChange={fileChange}
|
||||||
onDrop={(info) => { console.log(info.dataTransfer.files); }}
|
fileList={fileList}
|
||||||
fileList={fileList}
|
maxCount={1}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
// onSuccess={handleSuccess}
|
showUploadList={false}
|
||||||
|
beforeUpload={beforeUpload}
|
||||||
>
|
>
|
||||||
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
|
{mode == "view" ? null :
|
||||||
<p className="ant-upload-hint">
|
<div style={{display:"flex",alignItems:"center",columnGap:10,color:"#4f85ec",cursor:"pointer"}}>
|
||||||
支持扩展名:.rar .zip .doc .docx .pdf .jpg .png .ppt
|
<PaperClipOutlined />
|
||||||
</p>
|
<a style={{ cursor: "pointer" }}>上传PDF文件
|
||||||
</Dragger>
|
<span style={{ marginLeft:10,color:"#dfdfdf" }}>(支持扩展名:.xls .xlsx .doc .docx .pdf .jpg .png)</span></a>
|
||||||
}
|
</div>
|
||||||
<Row gutter={[16]}>
|
}
|
||||||
|
</Upload>
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16]}>
|
||||||
{
|
{
|
||||||
loading ? <span>文件正在上传中,请等待</span> :
|
loading ? <span>文件正在上传中,请等待</span> :
|
||||||
fileList.length > 0 && fileList.map(file => {
|
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='' />
|
<Image width={60} src={url +file.response?.data?.filePath} alt='' />
|
||||||
}
|
}
|
||||||
<span>{file.name}</span>
|
<span>{file.name}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
|
{mode !== "view" &&
|
||||||
|
<div
|
||||||
|
className="delete-icon"
|
||||||
|
onClick={() => deleteFile(file.response?.data?.fileId)}
|
||||||
|
>
|
||||||
<DeleteOutlined />
|
<DeleteOutlined />
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</Row>
|
</Row>
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
{
|
{
|
||||||
mode==='view'?null:(
|
mode==='view'?null:(
|
||||||
<>
|
<>
|
||||||
<Form.Item {...btnItemLayout}>
|
<Form.Item {...btnItemLayout}>
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type="primary" htmlType="submit">
|
||||||
{mode === 'save' ? '增加' : '修改'}
|
{mode === 'save' ? '提交' : '修改'}
|
||||||
</Button>
|
</Button>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</>
|
</>
|
||||||
|
|
@ -265,13 +293,13 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
|
||||||
}
|
}
|
||||||
</Form>
|
</Form>
|
||||||
<Modal
|
<Modal
|
||||||
open={pdfViewOPen}
|
open={perviewOpen}
|
||||||
width={1000}
|
width={1000}
|
||||||
title=""
|
title=""
|
||||||
footer={null}
|
footer={null}
|
||||||
style={{marginTop:"-5%"}}
|
style={{marginTop:"-5%"}}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setPdfViewOPen(false)
|
setPerviewOpen(false)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<iframe
|
<iframe
|
||||||
|
|
@ -281,7 +309,7 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
|
||||||
border: 0,
|
border: 0,
|
||||||
marginTop: 20,
|
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>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -1,121 +1,107 @@
|
||||||
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
|
import React,{useEffect,useState,useRef,useMemo} from 'react'
|
||||||
import { Table, Modal, Image } from 'antd';
|
import { Table, Button,Modal} from 'antd'
|
||||||
import { useSelector } from 'react-redux';
|
import ModalForm from './form';
|
||||||
import apiurl from '../../../service/apiurl';
|
import apiurl from '../../../service/apiurl';
|
||||||
import usePageTable from '../../../components/crud/usePageTable';
|
|
||||||
import { createCrudService } from '../../../components/crud/_';
|
|
||||||
import { httppost2 } from '../../../utils/request';
|
import { httppost2 } from '../../../utils/request';
|
||||||
import moment from 'moment';
|
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
import BasicCrudModal from '../../../components/crud/BasicCrudModal2';
|
||||||
const Page = () => {
|
import moment from "moment"
|
||||||
const role = useSelector(state => state.auth.role);
|
export default function Zrtx() {
|
||||||
const downloadBtn = role?.rule?.find(item => item.menuName == "下载");
|
const refModal = useRef();
|
||||||
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([])
|
|
||||||
const [iframeSrc, setIframeSrc] = useState('')
|
const [iframeSrc, setIframeSrc] = useState('')
|
||||||
const [pdfViewOPen, setPdfViewOPen] = useState(false)
|
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" },
|
||||||
* @description 文件下载
|
{ title: '编制单位', key: 'prepOrg', dataIndex: 'prepOrg', width: 200 ,align:"center" },
|
||||||
* @param {String} params 文件fileId
|
{
|
||||||
*/
|
title: '编制日期', key: 'prepTime', dataIndex: 'prepTime', width: 200, align: "center",
|
||||||
const download = (params) => {
|
render: (r) => <span>{r ? moment(r).format("YYYY-MM-DD") : ''}</span>
|
||||||
let downloadLink = document.createElement("a");
|
},
|
||||||
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/resPlanB/file/download/${params?.fileId}`;
|
{ title: '批复部门', key: 'apprOrg', dataIndex: 'apprOrg', width: 200 ,align:"center" },
|
||||||
downloadLink.download = `${params.fileName}`;
|
{
|
||||||
downloadLink.style.display = "none";
|
title: '批复日期', key: 'apprTime', dataIndex: 'apprTime', width: 200, align: "center",
|
||||||
// 将链接添加到页面中
|
render: (r) => <span>{r ? moment(r).format("YYYY-MM-DD") : ''}</span>
|
||||||
document.body.appendChild(downloadLink);
|
},
|
||||||
|
{
|
||||||
// 模拟点击事件,开始下载
|
title: '文件', key: 'planName', dataIndex: 'planName', width: 200, align: "center",
|
||||||
downloadLink.click();
|
render: (rec, record) => <a onClick={() => reviewFile(record?.files[0])}>{record?.files[0]?.fileName}</a>
|
||||||
}
|
},
|
||||||
const reviewFile = (params) => {
|
{ title: '上传时间', key: 'moditime', dataIndex: 'moditime', width: 150,align:"center" },
|
||||||
if (params?.fileName.split('.').pop() == "pdf") {
|
{
|
||||||
setPdfViewOPen(true)
|
title: '操作', dataIndex: 'orgName', key: 'orgName', align: "center",width: 240, fixed: 'right',
|
||||||
setIframeSrc(params)
|
render: (value, row, index) => (<CrudOpRender_text view={true} del={true} edit={true} command={(cmd) => () => command(cmd)(row)} />)
|
||||||
} else if (params.fileName.split('.').pop() == "png" ||
|
},
|
||||||
params.fileName.split('.').pop() == "jpg" ||
|
];
|
||||||
params.fileName.split('.').pop() == "jpeg"
|
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
|
||||||
) {
|
const [data, setData] = useState([])
|
||||||
setVisible(true)
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
const download = (params) => {
|
||||||
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) => {
|
||||||
const getList = async() => {
|
if (params.fileName.split('.').pop() == "pdf") {
|
||||||
try {
|
setPdfViewOPen(true)
|
||||||
const res = await httppost2(apiurl.fxzb1.ddgc.page, { resCode: "42120250085" })
|
setIframeSrc(params)
|
||||||
let newData = res.data.filter(s => s.type == 2)
|
} else {
|
||||||
setDataSources(newData.map((item,i) => ({...item,idx:i+1})))
|
download(params)
|
||||||
} catch (error) {
|
}
|
||||||
console.log(error);
|
}
|
||||||
}
|
const command = (type) => (params) => {
|
||||||
}
|
if (type === 'save') {
|
||||||
useEffect(()=>{
|
refModal.current.showSave({});
|
||||||
getList()
|
} 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 (
|
return (
|
||||||
<>
|
<div style={{background:"#fff",padding:10}}>
|
||||||
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
|
<h1><Button type='primary' onClick={() => {refModal.current.showSave({})}}>新增</Button></h1>
|
||||||
<div className='adcdTableBox'>
|
<Table
|
||||||
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
|
|
||||||
<Table
|
|
||||||
columns={columns}
|
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={dataSources}
|
columns={columns}
|
||||||
|
dataSource={data}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
scroll={{
|
scroll={{
|
||||||
x: width,
|
x: width,
|
||||||
y: "calc( 100vh - 400px )"
|
y: "calc( 100vh - 400px )"
|
||||||
}} />
|
}}
|
||||||
</div>
|
/>
|
||||||
</div>
|
|
||||||
<Modal
|
<BasicCrudModal
|
||||||
|
width={800}
|
||||||
|
ref={refModal}
|
||||||
|
title=""
|
||||||
|
component={ModalForm}
|
||||||
|
onCrudSuccess={getData}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Modal
|
||||||
open={pdfViewOPen}
|
open={pdfViewOPen}
|
||||||
width={1000}
|
width={1000}
|
||||||
title=""
|
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}`)}`}
|
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/resPlanB/file/download/${iframeSrc.fileId}`)}`}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</>
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Page;
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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;
|
|
||||||
|
|
@ -1,38 +1,96 @@
|
||||||
import React,{useEffect,useState} from 'react';
|
import React,{useEffect,useState,useRef} from 'react';
|
||||||
import { Form, Button, Input, message,Row, Col, DatePicker,Upload,Image,Modal } from 'antd';
|
import { Form, Button, Input, Row, Col,Upload,DatePicker,Modal,message,Image } from 'antd';
|
||||||
import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FilePptOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
|
import {PaperClipOutlined,DeleteOutlined,FileWordOutlined,FilePdfOutlined,FilePptOutlined,FileZipOutlined,FileExcelOutlined} from '@ant-design/icons';
|
||||||
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
|
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
|
||||||
import apiurl from '../../../service/apiurl';
|
import apiurl from '../../../service/apiurl';
|
||||||
import { createCrudService } from '../../../components/crud/_';
|
import { httpget2 } from '../../../utils/request';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { Dragger } = Upload;
|
import "./index.less";
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const ModalForm = ({ mode, record,onEdit,onSave }) => {
|
const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
|
||||||
if(record.prodDate){
|
|
||||||
record.myTm = moment(record.prodDate)
|
|
||||||
}
|
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [fileList, setFileList] = useState([]) //上传文件列表
|
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)
|
const [loading, setLoading] = useState(false)
|
||||||
/**
|
const [iframeId, setIframeId] = useState('')
|
||||||
* @description 删除上传的图片
|
const [perviewOpen, setPerviewOpen] = useState(false)
|
||||||
* @param {string} id 删除的id
|
|
||||||
*/
|
const fileChange = (info) => {
|
||||||
const deleteFile = (fileId) => {
|
console.log("file",info);
|
||||||
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
|
|
||||||
setFileList(filterFile)
|
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 文件下载
|
const deleteFile = (fileId) => {
|
||||||
* @param {String} params 文件fileId
|
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
|
||||||
*/
|
setFileList(filterFile)
|
||||||
const download = (params) => {
|
}
|
||||||
|
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");
|
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.download = `${params.fileName}`;
|
||||||
downloadLink.style.display = "none";
|
downloadLink.style.display = "none";
|
||||||
// 将链接添加到页面中
|
// 将链接添加到页面中
|
||||||
|
|
@ -41,153 +99,120 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
|
||||||
// 模拟点击事件,开始下载
|
// 模拟点击事件,开始下载
|
||||||
downloadLink.click();
|
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(() => {
|
useEffect(() => {
|
||||||
console.log(record);
|
if (record && mode != "save") {
|
||||||
if ((mode === "view" || mode === "edit") && record.attachList?.length) {
|
getFileInfo(record?.files[0]?.fileId)
|
||||||
getFileInfo(record)
|
}
|
||||||
}
|
}, [record,mode])
|
||||||
}, [record, mode])
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
|
<Form form={form} {...formItemLayout} onFinish={onFinish} initialValues={record}>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="图件名称"
|
label="预案名称"
|
||||||
name="imgName"
|
name="planName"
|
||||||
|
labelCol={{ span: 3, offset: 0 }}
|
||||||
|
wrapperCol={{span:21,offset:0}}
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input
|
||||||
|
style={{ width: '100%' }}
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
|
||||||
<Col span={24}>
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="制作单位"
|
label="编制单位"
|
||||||
name="prodUnitName"
|
name="prepOrg"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input
|
||||||
|
style={{ width: '100%' }}
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
<Col span={12}>
|
||||||
<Row>
|
|
||||||
<Col span={24}>
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="制作时间"
|
label="编制日期"
|
||||||
name="myTm"
|
name="prepTime"
|
||||||
|
getValueFromEvent={(e, dateString) => dateString}
|
||||||
|
getValueProps={value => ({
|
||||||
|
value: value ? moment(value) : undefined
|
||||||
|
})}
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<DatePicker
|
<DatePicker allowClear style={{width:'280px'}} />
|
||||||
disabled={mode==='view'}
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
style={{width:'100%'}}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="附件"
|
label="批复部门"
|
||||||
// label={mode !== "view" ? "附件" : ''}
|
name="apprOrg"
|
||||||
name="fieldId"
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
{mode !== "view" &&
|
<Input
|
||||||
<Dragger
|
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'
|
name='file'
|
||||||
// multiple
|
action="/gunshiApp/xyt/resPlanB/file/upload/singleSimple"
|
||||||
action="/gunshiApp/xfflood/xfIdeoImgB/file/upload/singleSimple"
|
|
||||||
onChange={fileChange}
|
onChange={fileChange}
|
||||||
onDrop={(info) => { console.log(info.dataTransfer.files); }}
|
fileList={fileList}
|
||||||
fileList={fileList}
|
maxCount={1}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
// onSuccess={handleSuccess}
|
showUploadList={false}
|
||||||
|
beforeUpload={beforeUpload}
|
||||||
>
|
>
|
||||||
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
|
{mode == "view" ? null :
|
||||||
<p className="ant-upload-hint">
|
<div style={{display:"flex",alignItems:"center",columnGap:10,color:"#4f85ec",cursor:"pointer"}}>
|
||||||
支持扩展名:.rar .zip .doc .docx .pdf .jpg .png .ppt
|
<PaperClipOutlined />
|
||||||
</p>
|
<a style={{ cursor: "pointer" }}>上传PDF文件
|
||||||
</Dragger>
|
<span style={{ marginLeft:10,color:"#dfdfdf" }}>(支持扩展名:.xls .xlsx .doc .docx .pdf .jpg .png)</span></a>
|
||||||
}
|
</div>
|
||||||
<Row gutter={[16]}>
|
}
|
||||||
|
</Upload>
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16]}>
|
||||||
{
|
{
|
||||||
loading ? <span>文件正在上传中,请等待</span> :
|
loading ? <span>文件正在上传中,请等待</span> :
|
||||||
fileList.length > 0 && fileList.map(file => {
|
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='' />
|
<Image width={60} src={url +file.response?.data?.filePath} alt='' />
|
||||||
}
|
}
|
||||||
<span>{file.name}</span>
|
<span>{file.name}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
|
{mode !== "view" &&
|
||||||
|
<div
|
||||||
|
className="delete-icon"
|
||||||
|
onClick={() => deleteFile(file.response?.data?.fileId)}
|
||||||
|
>
|
||||||
<DeleteOutlined />
|
<DeleteOutlined />
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</Row>
|
</Row>
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
{
|
{
|
||||||
mode==='view'?null:(
|
mode==='view'?null:(
|
||||||
<>
|
<>
|
||||||
<Form.Item {...btnItemLayout}>
|
<Form.Item {...btnItemLayout}>
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type="primary" htmlType="submit">
|
||||||
{mode === 'save' ? '增加' : '修改'}
|
{mode === 'save' ? '提交' : '修改'}
|
||||||
</Button>
|
</Button>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</>
|
</>
|
||||||
|
|
@ -265,13 +293,13 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
|
||||||
}
|
}
|
||||||
</Form>
|
</Form>
|
||||||
<Modal
|
<Modal
|
||||||
open={pdfViewOPen}
|
open={perviewOpen}
|
||||||
width={1000}
|
width={1000}
|
||||||
title=""
|
title=""
|
||||||
footer={null}
|
footer={null}
|
||||||
style={{marginTop:"-5%"}}
|
style={{marginTop:"-5%"}}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setPdfViewOPen(false)
|
setPerviewOpen(false)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<iframe
|
<iframe
|
||||||
|
|
@ -281,7 +309,7 @@ const ModalForm = ({ mode, record,onEdit,onSave }) => {
|
||||||
border: 0,
|
border: 0,
|
||||||
marginTop: 20,
|
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>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -1,126 +1,106 @@
|
||||||
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
|
import React,{useEffect,useState,useRef,useMemo} from 'react'
|
||||||
import { Table, Card, Modal, Image } from 'antd';
|
import { Table, Button,Modal} from 'antd'
|
||||||
import { useSelector } from 'react-redux';
|
import ModalForm from './form';
|
||||||
import apiurl from '../../../service/apiurl';
|
import apiurl from '../../../service/apiurl';
|
||||||
import usePageTable from '../../../components/crud/usePageTable';
|
|
||||||
import { createCrudService } from '../../../components/crud/_';
|
|
||||||
import { httppost2 } from '../../../utils/request';
|
import { httppost2 } from '../../../utils/request';
|
||||||
import moment from 'moment';
|
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
import BasicCrudModal from '../../../components/crud/BasicCrudModal2';
|
||||||
const Page = () => {
|
import moment from "moment"
|
||||||
const role = useSelector(state => state.auth.role);
|
export default function Zrtx() {
|
||||||
const downloadBtn = role?.rule?.find(item => item.menuName == "下载");
|
const refModal = useRef();
|
||||||
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([])
|
|
||||||
const [iframeSrc, setIframeSrc] = useState('')
|
const [iframeSrc, setIframeSrc] = useState('')
|
||||||
const [pdfViewOPen, setPdfViewOPen] = useState(false)
|
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" },
|
||||||
* @description 文件下载
|
{ title: '编制单位', key: 'prepOrg', dataIndex: 'prepOrg', width: 200 ,align:"center" },
|
||||||
* @param {String} params 文件fileId
|
{
|
||||||
*/
|
title: '编制日期', key: 'prepTime', dataIndex: 'prepTime', width: 200, align: "center",
|
||||||
const download = (params) => {
|
render: (r) => <span>{r ? moment(r).format("YYYY-MM-DD") : ''}</span>
|
||||||
let downloadLink = document.createElement("a");
|
},
|
||||||
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/resPlanB/file/download/${params?.fileId}`;
|
{ title: '批复部门', key: 'apprOrg', dataIndex: 'apprOrg', width: 200 ,align:"center" },
|
||||||
downloadLink.download = `${params.fileName}`;
|
{
|
||||||
downloadLink.style.display = "none";
|
title: '批复日期', key: 'apprTime', dataIndex: 'apprTime', width: 200, align: "center",
|
||||||
// 将链接添加到页面中
|
render: (r) => <span>{r ? moment(r).format("YYYY-MM-DD") : ''}</span>
|
||||||
document.body.appendChild(downloadLink);
|
},
|
||||||
|
{
|
||||||
// 模拟点击事件,开始下载
|
title: '文件', key: 'planName', dataIndex: 'planName', width: 200, align: "center",
|
||||||
downloadLink.click();
|
render: (rec, record) => <a onClick={() => reviewFile(record?.files[0])}>{record?.files[0]?.fileName}</a>
|
||||||
}
|
},
|
||||||
|
{ title: '上传时间', key: 'moditime', dataIndex: 'moditime', width: 150,align:"center" },
|
||||||
const reviewFile = (params) => {
|
{
|
||||||
console.log("params",params);
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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 {
|
||||||
|
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();
|
||||||
|
}, [])
|
||||||
|
|
||||||
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 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()
|
|
||||||
},[])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div style={{background:"#fff",padding:10}}>
|
||||||
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
|
<h1><Button type='primary' onClick={() => {refModal.current.showSave({})}}>新增</Button></h1>
|
||||||
<div className='adcdTableBox'>
|
<Table
|
||||||
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
|
|
||||||
<Table
|
|
||||||
columns={columns}
|
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={dataSources}
|
columns={columns}
|
||||||
|
dataSource={data}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
scroll={{
|
scroll={{
|
||||||
x: width,
|
x: width,
|
||||||
y: "calc( 100vh - 400px )"
|
y: "calc( 100vh - 400px )"
|
||||||
}} />
|
}}
|
||||||
</div>
|
/>
|
||||||
</div>
|
|
||||||
|
<BasicCrudModal
|
||||||
</div>
|
width={800}
|
||||||
|
ref={refModal}
|
||||||
|
title=""
|
||||||
|
component={ModalForm}
|
||||||
|
onCrudSuccess={getData}
|
||||||
|
/>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
open={pdfViewOPen}
|
open={pdfViewOPen}
|
||||||
width={1000}
|
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}`)}`}
|
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/resPlanB/file/download/${iframeSrc.fileId}`)}`}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</div>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Page;
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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;
|
|
||||||
|
|
@ -16,9 +16,9 @@ import {getAdcdTreeData1, getGcTreeData5} from '../../../../service/warn';
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看") || true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
|
||||||
const refModal = useRef();
|
const refModal = useRef();
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
const [isFetch, setIsFetch] = useState(false)
|
const [isFetch, setIsFetch] = useState(false)
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role = [] }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role = [] }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dateSo;
|
let dateSo;
|
||||||
if (values.tm) {
|
if (values.tm) {
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ import {getAdcdTreeData1, getGcTreeData4} from '../../../../service/warn';
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
|
||||||
const copyBtn = role?.rule?.find(item => item.menuName == "复制");
|
const copyBtn = role?.rule?.find(item => item.menuName == "复制") || true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
|
||||||
const refModal = useRef();
|
const refModal = useRef();
|
||||||
const treeRef = useRef();
|
const treeRef = useRef();
|
||||||
const [form1] = Form.useForm();
|
const [form1] = Form.useForm();
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ import { config } from '../../../../config';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (val) => {
|
const onFinish = (val) => {
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons'
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
|
|
||||||
const ToolBar = ({ setSearchVal, onSave,setSwiper,exportFile,role }) => {
|
const ToolBar = ({ setSearchVal, onSave,setSwiper,exportFile,role }) => {
|
||||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
|
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { config } from '../../../../config';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
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 = [
|
const optionsType = [
|
||||||
{
|
{
|
||||||
label: "渗压监测",
|
label: "渗压监测",
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
|
||||||
const typeObj = {
|
const typeObj = {
|
||||||
1: "渗压监测",
|
1: "渗压监测",
|
||||||
2: "渗流监测",
|
2: "渗流监测",
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ import { config } from '../../../../config';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
const optionsType = [
|
const optionsType = [
|
||||||
{
|
{
|
||||||
label: "渗压监测",
|
label: "渗压监测",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons'
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
|
|
||||||
const ToolBar = ({ setSearchVal, onSave, onChecked,role }) => {
|
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 [form] = Form.useForm();
|
||||||
const [checked, setChecked] = useState("多图单线")
|
const [checked, setChecked] = useState("多图单线")
|
||||||
const options = [
|
const options = [
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import moment from 'moment';
|
||||||
import { httppost2 } from '../../../../utils/request';
|
import { httppost2 } from '../../../../utils/request';
|
||||||
import apiurl from '../../../../service/apiurl';
|
import apiurl from '../../../../service/apiurl';
|
||||||
const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
|
const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
|
||||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
|
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dataSo;
|
let dataSo;
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import moment from 'moment';
|
||||||
import { httppost2 } from '../../../../utils/request';
|
import { httppost2 } from '../../../../utils/request';
|
||||||
import apiurl from '../../../../service/apiurl';
|
import apiurl from '../../../../service/apiurl';
|
||||||
const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
|
const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
|
||||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
|
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [dmList, setDmList] = useState([])
|
const [dmList, setDmList] = useState([])
|
||||||
const getDmList = async () => {
|
const getDmList = async () => {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import moment from 'moment';
|
||||||
import { httppost2 } from '../../../../utils/request';
|
import { httppost2 } from '../../../../utils/request';
|
||||||
import apiurl from '../../../../service/apiurl';
|
import apiurl from '../../../../service/apiurl';
|
||||||
const ToolBar = ({ setSearchVal, setDmName, exportFile, role }) => {
|
const ToolBar = ({ setSearchVal, setDmName, exportFile, role }) => {
|
||||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
|
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dataSo;
|
let dataSo;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { config } from '../../../../config';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
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 = [
|
const optionsType = [
|
||||||
{
|
{
|
||||||
label: "今日",
|
label: "今日",
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { httppost2 } from '../../../../utils/request';
|
||||||
import apiurl from '../../../../service/apiurl';
|
import apiurl from '../../../../service/apiurl';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
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 = [
|
const optionsType = [
|
||||||
{
|
{
|
||||||
label: "今日",
|
label: "今日",
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { httppost2 } from '../../../../utils/request';
|
||||||
import apiurl from '../../../../service/apiurl';
|
import apiurl from '../../../../service/apiurl';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
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 = [
|
const optionsType = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
|
||||||
const checkType = {
|
const checkType = {
|
||||||
1: "日常检查",
|
1: "日常检查",
|
||||||
2: "年度检查",
|
2: "年度检查",
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
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 [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
|
||||||
const level = {
|
const level = {
|
||||||
1: "一般事故",
|
1: "一般事故",
|
||||||
2: "较大事故",
|
2: "较大事故",
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
|
||||||
const refModal = useRef();
|
const refModal = useRef();
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
const columns = [
|
const columns = [
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
|
||||||
const checkType = {
|
const checkType = {
|
||||||
1: "地方自行组织",
|
1: "地方自行组织",
|
||||||
2: "中央规划",
|
2: "中央规划",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
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 [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
console.log(role);
|
console.log(role);
|
||||||
|
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
|
||||||
const checkType = {
|
const checkType = {
|
||||||
1: "低风险",
|
1: "低风险",
|
||||||
2: "一般风险",
|
2: "一般风险",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
console.log("role",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 [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
|
const exportBtn = role?.rule?.find(item => item.menuName == "导出")|| true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dataSo;
|
let dataSo;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
|
const exportBtn = role?.rule?.find(item => item.menuName == "导出")|| true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dataSo;
|
let dataSo;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
|
const exportBtn = role?.rule?.find(item => item.menuName == "导出")|| true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dataSo;
|
let dataSo;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, exportFile, role }) => {
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
|
const exportBtn = role?.rule?.find(item => item.menuName == "导出")|| true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dataSo;
|
let dataSo;
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")|| true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")|| true;
|
||||||
const surveyType = {
|
const surveyType = {
|
||||||
1: "日常检查排查",
|
1: "日常检查排查",
|
||||||
2: "定期普查",
|
2: "定期普查",
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import moment from 'moment';
|
||||||
import NormalSelect from '../../../../components/Form/NormalSelect';
|
import NormalSelect from '../../../../components/Form/NormalSelect';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
console.log("role",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 refModal = useRef();
|
||||||
const [fileList, setFileList] = useState([]) //上传文件列表
|
const [fileList, setFileList] = useState([]) //上传文件列表
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
console.log("role",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 [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
|
||||||
const refModal = useRef();
|
const refModal = useRef();
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
|
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
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 [form] = Form.useForm();
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
setSearchVal({...values});
|
setSearchVal({...values});
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import { httpget2 } from '../../../../utils/request';
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
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 = {
|
const khLevel = {
|
||||||
1: "优秀",
|
1: "优秀",
|
||||||
2: "良好",
|
2: "良好",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import moment from 'moment';
|
||||||
import NormalSelect from '../../../../components/Form/NormalSelect';
|
import NormalSelect from '../../../../components/Form/NormalSelect';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
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 = [
|
const types = [
|
||||||
{label:"未启动",value:0},
|
{label:"未启动",value:0},
|
||||||
{label:"评分中",value:1},
|
{label:"评分中",value:1},
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
|
||||||
const refModal = useRef();
|
const refModal = useRef();
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
|
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import {CrudOpRender_text} from '../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")|| true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")|| true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")|| true;
|
||||||
|
|
||||||
const types = {
|
const types = {
|
||||||
1: '溢洪道淸障',
|
1: '溢洪道淸障',
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import moment from 'moment';
|
||||||
import NormalSelect from '../../../components/Form/NormalSelect';
|
import NormalSelect from '../../../components/Form/NormalSelect';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
|
|
||||||
const types = [
|
const types = [
|
||||||
{label:"溢洪道淸障",value:1},
|
{label:"溢洪道淸障",value:1},
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
|
||||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
|
||||||
const task = {
|
const task = {
|
||||||
0: "未完成",
|
0: "未完成",
|
||||||
1: "进行中",
|
1: "进行中",
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import moment from 'moment';
|
||||||
import NormalSelect from '../../../../components/Form/NormalSelect';
|
import NormalSelect from '../../../../components/Form/NormalSelect';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "创建任务");
|
const addBtn = role?.rule?.find(item => item.menuName == "创建任务")||true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||||
|
|
||||||
const types = [
|
const types = [
|
||||||
{label:"日常巡查",value:1},
|
{label:"日常巡查",value:1},
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { httppost2 } from '../../../utils/request';
|
||||||
import apiurl from '../../../service/apiurl';
|
import apiurl from '../../../service/apiurl';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
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 = [
|
const warnTypes = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import React, { useState, useMemo, useEffect } from 'react'
|
||||||
|
import ReactEcharts from 'echarts-for-react';
|
||||||
|
import jgOption from './jgoption'
|
||||||
|
import "./index.less"
|
||||||
|
export default function Zzjgck() {
|
||||||
|
|
||||||
|
const jgOptions = useMemo(() => {
|
||||||
|
return jgOption();
|
||||||
|
}, [])
|
||||||
|
return (
|
||||||
|
<div className='content-box' style={{ backgroundColor: '#fff', height: '100%', display: 'flex', padding: '10px' }}>
|
||||||
|
<div className='lf' style={{ height: 'calc(100vh - 168px)',width:"100%" }}>
|
||||||
|
<div style={{width:"100%",height:"100%"}}>
|
||||||
|
<ReactEcharts
|
||||||
|
option={jgOptions || {}}
|
||||||
|
style={{ width: "100%", height: '100%' }}
|
||||||
|
notMerge={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
export default function jgOption() {
|
||||||
|
return {
|
||||||
|
tooltip: {
|
||||||
|
trigger: "item",
|
||||||
|
triggerOn: "mousemove",
|
||||||
|
color: "#fff",
|
||||||
|
backgroundColor: "skyblue",
|
||||||
|
borderColor: "skyblue",
|
||||||
|
},
|
||||||
|
animationDurationUpdate: 1500,
|
||||||
|
animationEasingUpdate: "quinticInOut",
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
type: "tree",
|
||||||
|
symbolSize: 75,
|
||||||
|
symbol: "roundRect",
|
||||||
|
edgeShape: "polyline",
|
||||||
|
edgeForkPosition: "50%",
|
||||||
|
edgeSymbol: ["circle", "arrow"],
|
||||||
|
edgeSymbolSize: [4, 10],
|
||||||
|
edgeLabel: {
|
||||||
|
normal: {
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 18,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
initialTreeDepth: 2,
|
||||||
|
orient: "vertical",
|
||||||
|
|
||||||
|
itemStyle: {
|
||||||
|
color: "#FFC125",
|
||||||
|
borderColor: "#FFC125",
|
||||||
|
},
|
||||||
|
roam: true, // 可移动,可缩放
|
||||||
|
expandAndCollapse: true,
|
||||||
|
animationDuration: 550,
|
||||||
|
animationDurationUpdate: 750,
|
||||||
|
//线条的颜色
|
||||||
|
lineStyle: {
|
||||||
|
normal: {
|
||||||
|
opacity: 0.9,
|
||||||
|
color: "#93beff",
|
||||||
|
// type: "dashed",
|
||||||
|
width: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "inside",
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 15,
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
leaves: {
|
||||||
|
label: {
|
||||||
|
position: "inside",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
color: "#dfdfdf",
|
||||||
|
borderColor: "#dfdfdf",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
name: "根节点",
|
||||||
|
url: "",
|
||||||
|
// 根节点样式设置
|
||||||
|
itemStyle: {
|
||||||
|
color: "#18a849",
|
||||||
|
borderColor: "#18a849",
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: "子节点1",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: "叶子节点1",
|
||||||
|
itemStyle: {
|
||||||
|
color: "#5470C6",
|
||||||
|
borderColor: "#5470C6",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "叶子节点2",
|
||||||
|
itemStyle: {
|
||||||
|
color: "#5470C6",
|
||||||
|
borderColor: "#5470C6",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "叶子节点3",
|
||||||
|
itemStyle: {
|
||||||
|
color: "#5470C6",
|
||||||
|
borderColor: "#5470C6",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "子节点2",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: "叶子节点4",
|
||||||
|
itemStyle: {
|
||||||
|
color: "#5470C6",
|
||||||
|
borderColor: "#5470C6",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "叶子节点5",
|
||||||
|
itemStyle: {
|
||||||
|
color: "#5470C6",
|
||||||
|
borderColor: "#5470C6",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "叶子节点6",
|
||||||
|
itemStyle: {
|
||||||
|
color: "#5470C6",
|
||||||
|
borderColor: "#5470C6",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -17,9 +17,9 @@ import { httppost5, httppost2 } from '../../../utils/request';
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const role = useSelector(state => state.auth.role);
|
const role = useSelector(state => state.auth.role);
|
||||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
|
const editBtn = role?.rule?.find(item => item.menuName == "编辑")|| true;
|
||||||
// const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
// const viewBtn = role?.rule?.find(item => item.menuName == "查看");
|
||||||
const delBtn = role?.rule?.find(item => item.menuName == "删除");
|
const delBtn = role?.rule?.find(item => item.menuName == "删除")|| true;
|
||||||
const refModal = useRef();
|
const refModal = useRef();
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import NormalSelect from '../../../components/Form/NormalSelect';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const ToolBar = ({ setSearchVal, onSave, exportFile,role }) => {
|
const ToolBar = ({ setSearchVal, onSave, exportFile,role }) => {
|
||||||
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
|
||||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue