feat():设备维护联调
parent
301269f407
commit
bedf26d9a6
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
|
|
@ -26,6 +26,7 @@ const SiderMenu: React.FC<{
|
||||||
const [openKeys, setOpenKeys] = useState<any>([`${menuIndexes[1]}`]);
|
const [openKeys, setOpenKeys] = useState<any>([`${menuIndexes[1]}`]);
|
||||||
console.log('openKeys', openKeys)
|
console.log('openKeys', openKeys)
|
||||||
console.log(subMenu);
|
console.log(subMenu);
|
||||||
|
const [irSelect,setIr] =useState('')
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const pathname = location.pathname;
|
const pathname = location.pathname;
|
||||||
|
|
@ -33,11 +34,22 @@ const SiderMenu: React.FC<{
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
function goto(url: string) {
|
function goto(url: string) {
|
||||||
|
setIr(url)
|
||||||
if (pathname !== url) {
|
if (pathname !== url) {
|
||||||
navigate(url);
|
navigate(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getIcon = (item: any) => {
|
||||||
|
|
||||||
|
const idx = item.children?.findIndex((item:any)=>irSelect == item.path)
|
||||||
|
if(item.path == irSelect || (idx !== -1&&idx !== undefined)){
|
||||||
|
return 'zcdSelect'
|
||||||
|
}else{
|
||||||
|
return 'zcd'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// if (openKeys?.[0] === 'undefined') {
|
// if (openKeys?.[0] === 'undefined') {
|
||||||
|
|
@ -93,7 +105,7 @@ const SiderMenu: React.FC<{
|
||||||
{
|
{
|
||||||
subMenu.map((o: any) => (
|
subMenu.map((o: any) => (
|
||||||
o.children && o.children.length > 0 ? (
|
o.children && o.children.length > 0 ? (
|
||||||
<SubMenu key={o.id} icon={o.icon ? <img style={{ width: 16, height: 16 }} src={`/assets/icons/${o.icon}.png`} /> : <FolderOutlined />}
|
<SubMenu key={o.id} icon={<img style={{ width: 16, height: 16 }} src={require(`../../assets/images/${getIcon(o)}.png`)} />}
|
||||||
title={<span>
|
title={<span>
|
||||||
{o.title}
|
{o.title}
|
||||||
{renderPop(o.title) && <span
|
{renderPop(o.title) && <span
|
||||||
|
|
@ -114,7 +126,9 @@ const SiderMenu: React.FC<{
|
||||||
<>
|
<>
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
onClick={() => goto(oo.path)}
|
onClick={() => goto(oo.path)}
|
||||||
key={oo.id}>{oo.title}
|
key={oo.id}
|
||||||
|
icon={<img style={{ width: 16, height: 16 }} src={require(`../../assets/images/${getIcon(oo)}.png`)} />}
|
||||||
|
>{oo.title}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
{renderPop(oo.title) &&<div
|
{renderPop(oo.title) &&<div
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -134,8 +148,8 @@ const SiderMenu: React.FC<{
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
icon={o.icon ? <img style={{ width: 16, height: 16 }}
|
icon={<img style={{ width: 16, height: 16 }}
|
||||||
src={`/assets/icons/${o.icon}.png`} /> : <ProfileOutlined />}
|
src={require(`../../assets/images/${getIcon(o)}.png`)} />}
|
||||||
onClick={() => goto(o.path)} key={o.id}>
|
onClick={() => goto(o.path)} key={o.id}>
|
||||||
<div style={{position:"relative"}}>
|
<div style={{position:"relative"}}>
|
||||||
<span>{o.title}</span>
|
<span>{o.title}</span>
|
||||||
|
|
|
||||||
|
|
@ -17,55 +17,6 @@ import { httppost2 } from '../../utils/request';
|
||||||
import apiurl from '../../service/apiurl';
|
import apiurl from '../../service/apiurl';
|
||||||
|
|
||||||
const { Header, Content, Sider } = Layout;
|
const { Header, Content, Sider } = Layout;
|
||||||
const meunObj:any = {
|
|
||||||
'home':'基本情况',
|
|
||||||
'fxzb':'防汛准备',
|
|
||||||
'sxfd':'思想发动',
|
|
||||||
'fxkhgzh':'防汛抗旱工作会',
|
|
||||||
'fbzrh':'防办主任会',
|
|
||||||
'fxpxb':'防汛培训班',
|
|
||||||
'fxtj':'防汛图件',
|
|
||||||
'zzjg':'组织机构',
|
|
||||||
'zq':'政区',
|
|
||||||
'gc':'工程',
|
|
||||||
'gczx':'工程整修',
|
|
||||||
'ytygc':'已投运工程',
|
|
||||||
'zjgc':'在建工程',
|
|
||||||
'hdqz':'河道清障',
|
|
||||||
'yaxb':'预案修编',
|
|
||||||
'zqya':'政区预案',
|
|
||||||
'ytygcya':'已投运工程预案',
|
|
||||||
'zjgcya':'在建工程预案',
|
|
||||||
'hsddya':'洪水调度方案',
|
|
||||||
'qxdw':'抢险队伍',
|
|
||||||
'qxwl':'抢险物料',
|
|
||||||
'jczw':'检测站网',
|
|
||||||
'yqz':'雨情站',
|
|
||||||
'sqz':'水情站',
|
|
||||||
'zbb':'值班表',
|
|
||||||
'txl':'通讯录',
|
|
||||||
'ysgzq':'雨水工灾情',
|
|
||||||
'ssyq':'实时雨情',
|
|
||||||
'sssq':'实时水情',
|
|
||||||
'ssgq':'实时工情',
|
|
||||||
'yxqk':'运行情况',
|
|
||||||
'gcxq':'工程险情',
|
|
||||||
'dbaq':'大坝安全监测数据',
|
|
||||||
'sszq':'实时灾情',
|
|
||||||
'fxdd':'防汛调度',
|
|
||||||
'dqxsfx':'当前形势分析',
|
|
||||||
'tqyb':'天气预报',
|
|
||||||
'hsyb':'洪水预报',
|
|
||||||
'skhs':'水库洪水',
|
|
||||||
'hdhs':'河道洪水',
|
|
||||||
'ddjc':'调度决策',
|
|
||||||
'yjxy':'应急响应',
|
|
||||||
'ddzl':'调度指令',
|
|
||||||
'videoSurveillance':'视频监控',
|
|
||||||
'fxdp':'防汛大屏',
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const DashboardLayout: React.FC = () => {
|
const DashboardLayout: React.FC = () => {
|
||||||
|
|
||||||
|
|
@ -112,33 +63,6 @@ const DashboardLayout: React.FC = () => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 这个方法是统计菜单点击情况的
|
|
||||||
// useEffect(()=>{
|
|
||||||
// (async()=>{
|
|
||||||
// const list = location.pathname.split('/')
|
|
||||||
// let menu1:any = meunObj?.[list[2]]
|
|
||||||
// let menu2:any = meunObj?.[list[3]]
|
|
||||||
// let menu3:any = meunObj?.[list[4]]
|
|
||||||
// if(menu1==='基本情况'){
|
|
||||||
// menu2 = '基本情况'
|
|
||||||
// }
|
|
||||||
// if(menu1==='视频监控'){
|
|
||||||
// menu2 = '视频监控'
|
|
||||||
// }
|
|
||||||
// if(menu1==='防汛大屏'){
|
|
||||||
// menu2 = '防汛大屏'
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const res = await httppost2(apiurl.setMenu,{
|
|
||||||
// createId:localStorage.getItem('userId'),
|
|
||||||
// loginType:0,
|
|
||||||
// menu1:menu1,
|
|
||||||
// menu2:menu2,
|
|
||||||
// menu3:menu3
|
|
||||||
// })
|
|
||||||
// })()
|
|
||||||
// },[location.pathname])
|
|
||||||
|
|
||||||
const menuIndexes = useMemo(() => findMenu(menu, pathname), [menu, pathname]);
|
const menuIndexes = useMemo(() => findMenu(menu, pathname), [menu, pathname]);
|
||||||
|
|
||||||
const menuUrl = ['/mgr/home', '/mgr/forecast', '/mgr/earlyWarning', '/mgr/preview', '/mgr/plan','/mgr/videoSurveillance'];
|
const menuUrl = ['/mgr/home', '/mgr/forecast', '/mgr/earlyWarning', '/mgr/preview', '/mgr/plan','/mgr/videoSurveillance'];
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,25 @@
|
||||||
import React,{useState,useEffect} from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import { Upload, Row, Col,Image,message,Modal } from "antd"
|
import { Upload, Row, Col, Image, message, Modal } from "antd"
|
||||||
import { DeleteOutlined, FileWordOutlined, FilePdfOutlined,FileJpgOutlined, FileZipOutlined, FilePptOutlined, FileExcelOutlined } from '@ant-design/icons';
|
import { DeleteOutlined, FileWordOutlined, FilePdfOutlined, FileJpgOutlined, FileZipOutlined, FilePptOutlined, FileExcelOutlined } from '@ant-design/icons';
|
||||||
import './index.less'
|
import './index.less'
|
||||||
import { httpget, httpGetFile, httppost } from '../../utils/request';
|
import { httpget, httpGetFile, httppost } from '../../utils/request';
|
||||||
import apiurl from '../../service/apiurl';
|
import apiurl from '../../service/apiurl';
|
||||||
const { Dragger } = Upload;
|
const { Dragger } = Upload;
|
||||||
export default function FileUpload({ mode,setFileIds,files }) {
|
|
||||||
|
export default function FileUpload({ mode, setFileIds, files, downloadUrl, uploadUrl }) {
|
||||||
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
const [fileList, setFileList] = useState([]) //上传文件列表
|
const [fileList, setFileList] = useState([]) //上传文件列表
|
||||||
const [iframeSrc, setIframeSrc] = useState('')
|
const [iframeSrc, setIframeSrc] = useState('')
|
||||||
const [pdfViewOPen, setPdfViewOPen] = useState(false)
|
const [pdfViewOPen, setPdfViewOPen] = useState(false)
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
/**
|
/**
|
||||||
* @description 删除上传的图片
|
* @description 删除上传的图片
|
||||||
* @param {string} id 删除的id
|
* @param {string} id 删除的id
|
||||||
*/
|
*/
|
||||||
const deleteFile = async(fileId) => {
|
const deleteFile = async (fileId) => {
|
||||||
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
|
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
|
||||||
setFileList(filterFile)
|
setFileList(filterFile)
|
||||||
setFileIds(filterFile.map(item => item.response?.data?.fileId))
|
setFileIds(filterFile.map(item => ({fileId:item.response?.data?.fileId})))
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileChange = (info) => {
|
const fileChange = (info) => {
|
||||||
|
|
@ -32,24 +34,25 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
let fileIds = info.fileList.map(file => {
|
let fileIds = info.fileList.map(file => {
|
||||||
return file.response?.data?.fileId
|
return {
|
||||||
|
fileId:file.response?.data?.fileId
|
||||||
|
}
|
||||||
})
|
})
|
||||||
setFileIds(fileIds)
|
setFileIds(fileIds)
|
||||||
setFileList(info.fileList)
|
setFileList(info.fileList)
|
||||||
console.log("info.fileList",info.fileList);
|
console.log("info.fileList", info.fileList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 文件下载
|
* @description 文件下载
|
||||||
* @param {String} params 文件fileId
|
* @param {String} params 文件fileId
|
||||||
*/
|
*/
|
||||||
const download = (params) => {
|
const download = (params) => {
|
||||||
let downloadLink = document.createElement("a");
|
let downloadLink = document.createElement("a");
|
||||||
// downloadLink.href = `http://192.168.66.7:20010/fileAssociations/downloadFile/${params?.fileId}`;
|
downloadLink.href = `${downloadUrl}/${params?.fileId}`;
|
||||||
downloadLink.href = `http://223.75.53.141:81/shzh/jcsj/fileAssociations/downloadFile/${params?.fileId}`;
|
|
||||||
downloadLink.download = `${params.fileName}`;
|
downloadLink.download = `${params.fileName}`;
|
||||||
downloadLink.style.display = "none";
|
downloadLink.style.display = "none";
|
||||||
// 将链接添加到页面中
|
// 将链接添加到页面中
|
||||||
|
|
@ -60,9 +63,9 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description pdf文件预览
|
* @description pdf文件预览
|
||||||
* @param {String} params 文件预览url
|
* @param {String} params 文件预览url
|
||||||
*/
|
*/
|
||||||
const viewPdf = (params) => {
|
const viewPdf = (params) => {
|
||||||
setIframeSrc(params.fileId)
|
setIframeSrc(params.fileId)
|
||||||
setPdfViewOPen(true)
|
setPdfViewOPen(true)
|
||||||
|
|
@ -70,10 +73,10 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mode != "save" && files) {
|
if (mode != "save" && files) {
|
||||||
setFileList(files.map(file => ({...file,name:file.fileName,response:{data:{name:file.fileName,fileId:file.fileId}}})))
|
setFileList(files.map(file => ({ ...file, name: file.fileName, response: { data: { name: file.fileName, fileId: file.fileId,filePath:file.filePath } } })))
|
||||||
setFileIds(files.map(item => item.response?.data?.fileId))
|
setFileIds(files.map(item => ({fileId:item.response?.data?.fileId})))
|
||||||
}
|
}
|
||||||
}, [mode,files])
|
}, [mode, files])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -81,7 +84,7 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
<Dragger
|
<Dragger
|
||||||
name='file'
|
name='file'
|
||||||
// multiple
|
// multiple
|
||||||
action="/shzh/jcsj/fileAssociations/uploadFile"
|
action={uploadUrl}
|
||||||
onChange={fileChange}
|
onChange={fileChange}
|
||||||
onDrop={(info) => { console.log(info.dataTransfer.files); }}
|
onDrop={(info) => { console.log(info.dataTransfer.files); }}
|
||||||
fileList={fileList}
|
fileList={fileList}
|
||||||
|
|
@ -115,7 +118,7 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
:
|
:
|
||||||
file.name.indexOf('.pdf') > -1 ?
|
file.name.indexOf('.pdf') > -1 ?
|
||||||
<div
|
<div
|
||||||
onClick={() => { download(file.response?.data) }}
|
onClick={() => { viewPdf(file.response?.data) }}
|
||||||
style={{ cursor: 'pointer' }}
|
style={{ cursor: 'pointer' }}
|
||||||
>
|
>
|
||||||
<FilePdfOutlined style={{ fontSize: 40 }} />
|
<FilePdfOutlined style={{ fontSize: 40 }} />
|
||||||
|
|
@ -131,7 +134,7 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
:
|
:
|
||||||
file.name.indexOf('.ppt') > -1 ?
|
file.name.indexOf('.ppt') > -1 ?
|
||||||
<div
|
<div
|
||||||
onClick={() => { viewPdf(file.response?.data) }}
|
onClick={() => { download(file.response?.data) }}
|
||||||
style={{ cursor: 'pointer' }}
|
style={{ cursor: 'pointer' }}
|
||||||
>
|
>
|
||||||
<FilePptOutlined style={{ fontSize: 40 }} />
|
<FilePptOutlined style={{ fontSize: 40 }} />
|
||||||
|
|
@ -145,7 +148,7 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
|
|
||||||
<FileJpgOutlined style={{ fontSize: 40 }} onClick={() => { download(file.response?.data) }} />
|
<Image width={60} src={url + file.response?.data?.filePath} alt='' />
|
||||||
}
|
}
|
||||||
<span>{file.name}</span>
|
<span>{file.name}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -164,7 +167,7 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
width={1000}
|
width={1000}
|
||||||
title=""
|
title=""
|
||||||
footer={null}
|
footer={null}
|
||||||
style={{marginTop:"-5%"}}
|
style={{ marginTop: "-5%" }}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setPdfViewOPen(false)
|
setPdfViewOPen(false)
|
||||||
}}
|
}}
|
||||||
|
|
@ -176,7 +179,7 @@ export default function FileUpload({ mode,setFileIds,files }) {
|
||||||
border: 0,
|
border: 0,
|
||||||
marginTop: 20,
|
marginTop: 20,
|
||||||
}}
|
}}
|
||||||
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/projectEvents/file/download/${iframeSrc}`)}`}
|
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`${downloadUrl}/${iframeSrc}`)}`}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
const service_fxdd = '/gunshiApp/tsg'
|
const service_fxdd = '/gunshiApp/tsg'
|
||||||
const service_xyt = '/gunshiApp/tsg'//登陆先用小玉潭
|
const service_xyt = '/gunshiApp/tsg'//登陆先用小玉潭
|
||||||
|
const service_ykz = '/gunshiApp/ykz'
|
||||||
const apiurl = {
|
const apiurl = {
|
||||||
setMenu: service_fxdd + '/visitMenuLog/insert',
|
setMenu: service_fxdd + '/visitMenuLog/insert',
|
||||||
setPassword: service_fxdd + '/user/updateSecretKey',
|
setPassword: service_fxdd + '/user/updateSecretKey',
|
||||||
|
|
@ -14,7 +15,7 @@ const apiurl = {
|
||||||
|
|
||||||
home: {
|
home: {
|
||||||
videoList: service_fxdd + "/gateValveCctvRel/list",
|
videoList: service_fxdd + "/gateValveCctvRel/list",
|
||||||
videosrc: service_fxdd + "/attCctvBase/preview",
|
videosrc: service_fxdd + "/attCctvBase/preview/",
|
||||||
},
|
},
|
||||||
zmjk: {
|
zmjk: {
|
||||||
getList : service_xyt + '/attGateB/list',
|
getList : service_xyt + '/attGateB/list',
|
||||||
|
|
@ -24,10 +25,37 @@ const apiurl = {
|
||||||
},
|
},
|
||||||
sbwh: {
|
sbwh: {
|
||||||
whfabz: {
|
whfabz: {
|
||||||
page: service_fxdd + '/resPerson/page',
|
page: service_ykz + '/maintainPlan/page',
|
||||||
save: service_fxdd + '/resPerson/save',
|
save: service_ykz + '/maintainPlan/insert',
|
||||||
edit: service_fxdd + '/resPerson/edit',
|
edit: service_ykz + '/maintainPlan/update',
|
||||||
delete:service_fxdd + '/resPerson/delete',
|
delete: service_ykz + '/maintainPlan/del',
|
||||||
|
uploadUrl: service_ykz + '/maintainPlan/file/upload/singleSimple',
|
||||||
|
downloadUrl:service_ykz + '/maintainPlan/file/download'
|
||||||
|
},
|
||||||
|
ssgcjl: {
|
||||||
|
page: service_ykz + '/implementProcessRecord/page',
|
||||||
|
save: service_ykz + '/implementProcessRecord/insert',
|
||||||
|
edit: service_ykz + '/implementProcessRecord/update',
|
||||||
|
delete: service_ykz + '/implementProcessRecord/del',
|
||||||
|
uploadUrl: service_ykz + '/implementProcessRecord/file/upload/singleSimple',
|
||||||
|
downloadUrl: service_ykz + '/implementProcessRecord/file/download',
|
||||||
|
list:service_ykz + '/implementProcessRecord/list'
|
||||||
|
},
|
||||||
|
whxmys: {
|
||||||
|
page: service_ykz + '/maintainProjectCheck/page',
|
||||||
|
save: service_ykz + '/maintainProjectCheck/insert',
|
||||||
|
edit: service_ykz + '/maintainProjectCheck/update',
|
||||||
|
delete: service_ykz + '/maintainProjectCheck/del',
|
||||||
|
uploadUrl: service_ykz + '/maintainProjectCheck/file/upload/singleSimple',
|
||||||
|
downloadUrl:service_ykz + '/maintainProjectCheck/file/download'
|
||||||
|
},
|
||||||
|
cgtzgl: {
|
||||||
|
page: service_ykz + '/purchaseLedger/page',
|
||||||
|
save: service_ykz + '/purchaseLedger/insert',
|
||||||
|
edit: service_ykz + '/purchaseLedger/update',
|
||||||
|
delete: service_ykz + '/purchaseLedger/del',
|
||||||
|
uploadUrl: service_ykz + '/purchaseLedger/file/upload/singleSimple',
|
||||||
|
downloadUrl:service_ykz + '/purchaseLedger/file/download'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ module.exports = function (app) {
|
||||||
app.use(
|
app.use(
|
||||||
'/gunshiApp',
|
'/gunshiApp',
|
||||||
createProxyMiddleware({
|
createProxyMiddleware({
|
||||||
target: 'http://local.gunshiiot.com:18083/',//测试
|
// target: 'http://local.gunshiiot.com:18083/',//测试
|
||||||
// target: 'http://192.168.66.199:24105/',//正式
|
target: 'http://192.168.66.7:24106/',//正式
|
||||||
// target: 'http://36.139.207.50:18083/',//移动云
|
// target: 'http://36.139.207.50:18083/',//移动云
|
||||||
// target: 'http://192.168.66.49:24105/',//移动云
|
// target: 'http://192.168.66.49:24105/',//移动云
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
import React, { useEffect, useState,useMemo } from 'react'
|
import React, { useEffect, useState, useMemo } from 'react'
|
||||||
import { useNavigate } from 'react-router';
|
import { useNavigate } from 'react-router';
|
||||||
|
import {
|
||||||
|
RightCircleFilled, LeftCircleFilled
|
||||||
|
} from '@ant-design/icons';
|
||||||
import autofit from 'autofit.js'
|
import autofit from 'autofit.js'
|
||||||
import Zmjk from "./zmjk"
|
import Zmjk from "./zmjk"
|
||||||
import './index.less'
|
import './index.less'
|
||||||
|
|
@ -7,10 +10,10 @@ import ReactEcharts from 'echarts-for-react';
|
||||||
import options from './options'
|
import options from './options'
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
import { httpget2,httppost2 } from '../../utils/request';
|
import { httpget2, httppost2 } from '../../utils/request';
|
||||||
import apiurl from '../../service/apiurl';
|
import apiurl from '../../service/apiurl';
|
||||||
|
import HFivePlayer from '../../components/video1Plary';
|
||||||
const MenuTitleCard = ({key,title}) => {
|
const MenuTitleCard = ({ key, title }) => {
|
||||||
return (
|
return (
|
||||||
<div className='menuItem_style' key={key} title={title}>
|
<div className='menuItem_style' key={key} title={title}>
|
||||||
{title}
|
{title}
|
||||||
|
|
@ -49,22 +52,22 @@ export default function Home() {
|
||||||
{
|
{
|
||||||
name: '闸后流量(m³/s)',
|
name: '闸后流量(m³/s)',
|
||||||
value: 4300,
|
value: 4300,
|
||||||
time:'2024-08-15 15:00:00'
|
time: '2024-08-15 15:00:00'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '闸前水位(m)',
|
name: '闸前水位(m)',
|
||||||
value: 9.82,
|
value: 9.82,
|
||||||
time:'2024-08-15 15:00:00'
|
time: '2024-08-15 15:00:00'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '闸后流量(m)',
|
name: '闸后流量(m)',
|
||||||
value: 8.87,
|
value: 8.87,
|
||||||
time:'2024-08-15 15:00:00'
|
time: '2024-08-15 15:00:00'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '雨量(mm)',
|
name: '雨量(mm)',
|
||||||
value: 10.5,
|
value: 10.5,
|
||||||
time:'2024-08-15 15:00:00'
|
time: '2024-08-15 15:00:00'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -81,42 +84,53 @@ export default function Home() {
|
||||||
//操作日志
|
//操作日志
|
||||||
const [operateData, setOperateData] = useState(Array(5).fill(0).map((item, i) => ({ id: i, cd: '1#闸孔', content: "设定闸门开度为0.10m", name: '刘天明', kpa: 2749, time: '2024-08-15 15:00:00' })))
|
const [operateData, setOperateData] = useState(Array(5).fill(0).map((item, i) => ({ id: i, cd: '1#闸孔', content: "设定闸门开度为0.10m", name: '刘天明', kpa: 2749, time: '2024-08-15 15:00:00' })))
|
||||||
//报警信息
|
//报警信息
|
||||||
const [policeData, setPoliceData] = useState(Array(5).fill(0).map((item, i) => ({ id: i,zd:'闸前水位', watchvalue: "10.23",limit:0,max:10, time: '2024-08-15 15:00:00' })))
|
const [policeData, setPoliceData] = useState(Array(5).fill(0).map((item, i) => ({ id: i, zd: '闸前水位', watchvalue: "10.23", limit: 0, max: 10, time: '2024-08-15 15:00:00' })))
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const jumpMenu = (item) => {
|
const jumpMenu = (item) => {
|
||||||
navigate(item.key)
|
navigate(item.key)
|
||||||
}
|
}
|
||||||
const [videoList, setVideoList] = useState([])
|
const [videoList, setVideoList] = useState([])
|
||||||
const [videoArr, setvideoArr] = useState({})
|
const [videoArr, setvideoArr] = useState({})
|
||||||
|
const [index, setIndex] = useState(0)
|
||||||
|
|
||||||
// 获取视频列表
|
// 获取视频列表
|
||||||
const getVideoList = async () => {
|
const getVideoList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await httppost2(apiurl.home.videoList,{valveCode:"HP0024208020000063"})
|
const res = await httppost2(apiurl.home.videoList, { valveCode: "HP0024208020000063" })
|
||||||
setVideoList(res.data.map(item => ({label:item.name,value:item.indexCode})))
|
setVideoList(res.data)
|
||||||
|
getVideoSrc(res.data[0].indexCode)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取视频流
|
// 获取视频流
|
||||||
const getVideoSrc = async (current) => {
|
const getVideoSrc = async (current) => {
|
||||||
const res = await httpget2(`${apiurl.home.videosrc}${current}`)
|
const res = await httpget2(`${apiurl.home.videosrc}${current}`)
|
||||||
if (res.code == 200 && res.data?.length !== 0) {
|
if (res.code == 200 && res.data?.length !== 0) {
|
||||||
setvideoArr({src:res.data})
|
// setvideoArr({src:'ws://223.76.234.232:559/openUrl/7WKpEbu'})
|
||||||
}else{
|
setvideoArr({ src: res.data })
|
||||||
|
} else {
|
||||||
setvideoArr({})
|
setvideoArr({})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const delClick = () => {
|
||||||
|
let idx = index - 1
|
||||||
|
setIndex(idx)
|
||||||
|
getVideoSrc(videoList[idx].indexCode)
|
||||||
|
}
|
||||||
|
const addClick = () => {
|
||||||
|
let idx = index + 1
|
||||||
|
setIndex(idx)
|
||||||
|
getVideoSrc(videoList[idx].indexCode)
|
||||||
|
}
|
||||||
const [activeOne, setActiveOne] = useState(0)
|
const [activeOne, setActiveOne] = useState(0)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
autofit.init({
|
autofit.init({
|
||||||
dh: 1080,
|
dh: 1080,
|
||||||
dw: 1920,
|
dw: 1920,
|
||||||
el:'#daping-body',
|
el: '#daping-body',
|
||||||
resize: true
|
resize: true
|
||||||
})
|
})
|
||||||
getVideoList()
|
getVideoList()
|
||||||
|
|
@ -128,7 +142,7 @@ export default function Home() {
|
||||||
<div className='title'></div>
|
<div className='title'></div>
|
||||||
<div className='title_name'></div>
|
<div className='title_name'></div>
|
||||||
{title.map((item, i) => (
|
{title.map((item, i) => (
|
||||||
<div key={item.key} className={'styles'+i} onClick={()=>jumpMenu(item)} style={{cursor:'pointer'}}>
|
<div key={item.key} className={'styles' + i} onClick={() => jumpMenu(item)} style={{ cursor: 'pointer' }}>
|
||||||
<MenuTitleCard title={item.title} />
|
<MenuTitleCard title={item.title} />
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
@ -143,16 +157,16 @@ export default function Home() {
|
||||||
<div className='project-content'>
|
<div className='project-content'>
|
||||||
<img alt='' className='content-img' src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/shuizhi2.png`}></img>
|
<img alt='' className='content-img' src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/shuizhi2.png`}></img>
|
||||||
盐卡闸位于湖北省荆州市经济开发区,荆江大堤左岸桩 745+614 处,位于观音寺闸上游 5km 处。盐卡闸主要工程任务为引水灌溉,解决四湖中下区农
|
盐卡闸位于湖北省荆州市经济开发区,荆江大堤左岸桩 745+614 处,位于观音寺闸上游 5km 处。盐卡闸主要工程任务为引水灌溉,解决四湖中下区农
|
||||||
业灌溉和洪湖生态保障不足的问题。利用盐卡泵站进水渠,反向从长江引水,引水灌溉设计流量55m³/s,水闸级别为 1 级,次要建筑物级别为 3 级。
|
业灌溉和洪湖生态保障不足的问题。利用盐卡泵站进水渠,反向从长江引水,引水灌溉设计流量55m³/s,水闸级别为 1 级,次要建筑物级别为 3 级。
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* 运行监测数据 */}
|
{/* 运行监测数据 */}
|
||||||
<div className='runWatch'>
|
<div className='runWatch'>
|
||||||
<div className='project-title'>运行监测数据</div>
|
<div className='project-title'>运行监测数据</div>
|
||||||
<div className='project-content'>
|
<div className='project-content'>
|
||||||
{runData.map((item,i) => (
|
{runData.map((item, i) => (
|
||||||
<div className={clsx({'run_list':true,active:activeOne == i})} key={item.name} onClick={() => setActiveOne(i)}>
|
<div className={clsx({ 'run_list': true, active: activeOne == i })} key={item.name} onClick={() => setActiveOne(i)}>
|
||||||
<span style={{width:94}}>{item.name}</span>
|
<span style={{ width: 94 }}>{item.name}</span>
|
||||||
<span>{item.value}</span>
|
<span>{item.value}</span>
|
||||||
<span>{item.time}</span>
|
<span>{item.time}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -173,20 +187,20 @@ export default function Home() {
|
||||||
<div className='project-content'>
|
<div className='project-content'>
|
||||||
<table style={{ width: '100%' }}>
|
<table style={{ width: '100%' }}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr style={{background:'#455a87',height:35,fontSize:14}}>
|
<tr style={{ background: '#455a87', height: 35, fontSize: 14 }}>
|
||||||
<th>测点编号</th>
|
<th>测点编号</th>
|
||||||
<th>监测断面</th>
|
<th>监测断面</th>
|
||||||
<th>渗压(KPa)</th>
|
<th>渗压(KPa)</th>
|
||||||
<th style={{width:137}}>监测时间</th>
|
<th style={{ width: 137 }}>监测时间</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody >
|
<tbody style={{ overflowY: safeData.length > 4 ? 'scroll' : 'hidden' }}>
|
||||||
{safeData.map((item, i) => (
|
{safeData.map((item, i) => (
|
||||||
<tr style={{borderBottom:'2px solid #536cc6',textAlign:'center'}} className={clsx({'odd_row':i%2})} key={i}>
|
<tr style={{ borderBottom: '2px solid #536cc6', textAlign: 'center' }} className={clsx({ 'odd_row': i % 2 })} key={i}>
|
||||||
<td>{item.cd}</td>
|
<td>{item.cd}</td>
|
||||||
<td>{item.dm}</td>
|
<td>{item.dm}</td>
|
||||||
<td>{item.kpa}</td>
|
<td>{item.kpa}</td>
|
||||||
<td style={{width:137}}>{item.time}</td>
|
<td style={{ width: 137 }}>{item.time}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
@ -203,20 +217,20 @@ export default function Home() {
|
||||||
<div className='project-content'>
|
<div className='project-content'>
|
||||||
<table style={{ width: '100%' }}>
|
<table style={{ width: '100%' }}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr style={{background:'#455a87',height:35,fontSize:14}}>
|
<tr style={{ background: '#455a87', height: 35, fontSize: 14 }}>
|
||||||
<th>闸孔编号</th>
|
<th>闸孔编号</th>
|
||||||
<th>操作内容</th>
|
<th>操作内容</th>
|
||||||
<th>操作人员</th>
|
<th>操作人员</th>
|
||||||
<th style={{width:137}}>操作时间</th>
|
<th style={{ width: 137 }}>操作时间</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody style={{height:170}}>
|
<tbody style={{ height: 170 }}>
|
||||||
{operateData.map((item, i) => (
|
{operateData.map((item, i) => (
|
||||||
<tr style={{borderBottom:'2px solid #536cc6',textAlign:'center'}} className={clsx({'odd_row':i%2})} key={i}>
|
<tr style={{ borderBottom: '2px solid #536cc6', textAlign: 'center' }} className={clsx({ 'odd_row': i % 2 })} key={i}>
|
||||||
<td>{item.cd}</td>
|
<td>{item.cd}</td>
|
||||||
<td>{item.content}</td>
|
<td>{item.content}</td>
|
||||||
<td>{item.name}</td>
|
<td>{item.name}</td>
|
||||||
<td style={{width:137}}>{item.time}</td>
|
<td style={{ width: 137 }}>{item.time}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
@ -230,22 +244,22 @@ export default function Home() {
|
||||||
<div className='project-content'>
|
<div className='project-content'>
|
||||||
<table style={{ width: '100%' }}>
|
<table style={{ width: '100%' }}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr style={{background:'#455a87',height:35,fontSize:14}}>
|
<tr style={{ background: '#455a87', height: 35, fontSize: 14 }}>
|
||||||
<th>监测点</th>
|
<th>监测点</th>
|
||||||
<th>监测值</th>
|
<th>监测值</th>
|
||||||
<th style={{width:58}}>阈值下限</th>
|
<th style={{ width: 58 }}>阈值下限</th>
|
||||||
<th style={{width:60}}>阈值上限</th>
|
<th style={{ width: 60 }}>阈值上限</th>
|
||||||
<th style={{width:129}}>报警时间</th>
|
<th style={{ width: 129 }}>报警时间</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody style={{height:170,overflow:policeData.length > 6 ? 'scroll':'hidden'}} >
|
<tbody style={{ height: 170, overflow: policeData.length > 6 ? 'scroll' : 'hidden' }} >
|
||||||
{policeData.map((item, i) => (
|
{policeData.map((item, i) => (
|
||||||
<tr style={{borderBottom:'2px solid #536cc6',textAlign:'center'}} className={clsx({'odd_row':i%2})} key={i}>
|
<tr style={{ borderBottom: '2px solid #536cc6', textAlign: 'center' }} className={clsx({ 'odd_row': i % 2 })} key={i}>
|
||||||
<td style={{width:58}}>{item.zd}</td>
|
<td style={{ width: 58 }}>{item.zd}</td>
|
||||||
<td>{item.watchvalue}</td>
|
<td>{item.watchvalue}</td>
|
||||||
<td style={{width:58}}>{item.limit}</td>
|
<td style={{ width: 58 }}>{item.limit}</td>
|
||||||
<td style={{width:58}}>{item.max}</td>
|
<td style={{ width: 58 }}>{item.max}</td>
|
||||||
<td style={{width:129}}>{item.time}</td>
|
<td style={{ width: 129 }}>{item.time}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
@ -256,15 +270,12 @@ export default function Home() {
|
||||||
{/* 视频监控 */}
|
{/* 视频监控 */}
|
||||||
<div className='operate-log'>
|
<div className='operate-log'>
|
||||||
<div className='project-title'>
|
<div className='project-title'>
|
||||||
<Select
|
|
||||||
placeholder="请选择视频"
|
|
||||||
options={videoList}
|
|
||||||
allowClear
|
|
||||||
/>
|
|
||||||
视频监控
|
视频监控
|
||||||
</div>
|
</div>
|
||||||
<div className='project-content'>
|
<div className='project-content video-style'>
|
||||||
|
{index !== 0 && <LeftCircleFilled className="leftIcon" onClick={() => delClick()} />}
|
||||||
|
<HFivePlayer wsUrl={videoArr} playerID={'111'} />
|
||||||
|
{index !== videoList.length - 1 && <RightCircleFilled className="rightIcon" onClick={() => addClick()} />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -154,9 +154,25 @@
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.video-style{
|
||||||
|
position: relative;
|
||||||
|
height: 300px;
|
||||||
|
.leftIcon{
|
||||||
|
position: absolute;
|
||||||
|
top: 45%;
|
||||||
|
left: 10px;
|
||||||
|
font-size: 24px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.rightIcon{
|
||||||
|
position: absolute;
|
||||||
|
top: 45%;
|
||||||
|
right: 10px;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.odd_row{
|
.odd_row{
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ const Page = () => {
|
||||||
<div key={o} className='o' style={{ flexGrow: 1, width: 100, display: 'flex', justifyContent: 'center' }}>
|
<div key={o} className='o' style={{ flexGrow: 1, width: 100, display: 'flex', justifyContent: 'center' }}>
|
||||||
<div
|
<div
|
||||||
onClick={() => {}}
|
onClick={() => {}}
|
||||||
style={{ width: 80, height: 32, border: '1px solid #444', backgroundColor: '#fff', borderRadius: 4, color: '#888', display: 'flex', justifyContent: 'center', alignItems: 'center', fontSize: 18, cursor: 'pointer' }}
|
style={{ width: 80, height: 32, border: '1px solid #4c5dce', backgroundColor: '#315da2', borderRadius: 4, color: '#fff', display: 'flex', justifyContent: 'center', alignItems: 'center', fontSize: 18, cursor: 'pointer' }}
|
||||||
>
|
>
|
||||||
{renAperture(damList[o]?.realAperture)}
|
{renAperture(damList[o]?.realAperture)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.3 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
.loginFormBox{
|
.loginFormBox{
|
||||||
background-color: rgba(255, 255, 255, .5);
|
background-color: rgba(255, 255, 255, .5);
|
||||||
|
// background:url(./img/formBg.png) no-repeat center;
|
||||||
|
background-size: 100% 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// height: 60%;
|
// height: 60%;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const LoginPage = () => {
|
||||||
// "aesKey": keystr
|
// "aesKey": keystr
|
||||||
}
|
}
|
||||||
const result = await login(params)
|
const result = await login(params)
|
||||||
if (result.code == 200) {
|
if (result?.code == 200) {
|
||||||
localStorage.setItem('access_token', result.token);
|
localStorage.setItem('access_token', result.token);
|
||||||
cookie.save('Admin-Token', result.token);
|
cookie.save('Admin-Token', result.token);
|
||||||
localStorage.setItem('expires_in', result.token);
|
localStorage.setItem('expires_in', result.token);
|
||||||
|
|
@ -67,12 +67,12 @@ const LoginPage = () => {
|
||||||
info().then(res => {
|
info().then(res => {
|
||||||
getInfo(res,value)
|
getInfo(res,value)
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
message.error((result.description).replace('参数错误',''));
|
message.error((result?.description)?.replace('参数错误',''));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getInfo = (result1: any, value: any) => {
|
const getInfo = (result1: any, value: any) => {
|
||||||
if (result1.code === 200) {
|
if (result1?.code === 200) {
|
||||||
if(checked){
|
if(checked){
|
||||||
localStorage.setItem('loginNamePwd',JSON.stringify(value))
|
localStorage.setItem('loginNamePwd',JSON.stringify(value))
|
||||||
// localStorage.setItem('checked',checked)
|
// localStorage.setItem('checked',checked)
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ import { createCrudService } from '../../../components/crud/_';
|
||||||
import {CrudOpRender_text} from '../../../components/crud/CrudOpRender';
|
import {CrudOpRender_text} from '../../../components/crud/CrudOpRender';
|
||||||
import { httppost5 } from '../../../utils/request';
|
import { httppost5 } from '../../../utils/request';
|
||||||
import { exportFile } from '../../../utils/tools.js';
|
import { exportFile } from '../../../utils/tools.js';
|
||||||
|
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const types = {
|
const types = {
|
||||||
0: "防汛物资",
|
0: "防汛物资",
|
||||||
|
|
@ -24,20 +22,20 @@ const Page = () => {
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
||||||
{ title: '物资名称', key: 'name', dataIndex: 'name', width: 150, ellipsis: true },
|
{ title: '物资名称', key: 'goodsName', dataIndex: 'goodsName', width: 150, ellipsis: true },
|
||||||
{
|
{
|
||||||
title: '类型', key: 'type', dataIndex: 'type', width: 140,
|
title: '类型', key: 'goodsType', dataIndex: 'goodsType', width: 140,
|
||||||
render: (value) => <span>{types[value]}</span>,
|
render: (value) => <span>{types[value]}</span>,
|
||||||
},
|
},
|
||||||
{ title: '规格型号', key: 'adress', dataIndex: 'adress', width: 150, ellipsis: true },
|
{ title: '规格型号', key: 'specs', dataIndex: 'specs', width: 150, ellipsis: true },
|
||||||
{ title: '数量', key: 'type', dataIndex: 'type', width: 140},
|
{ title: '数量', key: 'quantity', dataIndex: 'quantity', width: 140},
|
||||||
{ title: '计量单位', key: 'type', dataIndex: 'type', width: 140},
|
{ title: '计量单位', key: 'unit', dataIndex: 'unit', width: 140},
|
||||||
{ title: '单价(元)', key: 'type', dataIndex: 'type', width: 140},
|
{ title: '单价(元)', key: 'unitPrice', dataIndex: 'unitPrice', width: 140},
|
||||||
{
|
{
|
||||||
title: '采购时间', key: 'eventsDate', dataIndex: 'eventsDate', width: 150,
|
title: '采购时间', key: 'purchaseTime', dataIndex: 'purchaseTime', width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '供方名称', key: 'eventsDate', dataIndex: 'eventsDate', width: 150,
|
title: '供方名称', key: 'supplierName', dataIndex: 'supplierName', width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
||||||
|
|
@ -61,13 +59,13 @@ const Page = () => {
|
||||||
} else if (type === 'view') {
|
} else if (type === 'view') {
|
||||||
refModal.current.showView(params);
|
refModal.current.showView(params);
|
||||||
} else if (type === 'del') {
|
} else if (type === 'del') {
|
||||||
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
|
refModal.current.onDeleteGet(apiurl.sbwh.cgtzgl.delete + `/${params.id}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.whfabz.page).find_noCode);
|
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.cgtzgl.page).find_noCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 处理成功的回调
|
* @description 处理成功的回调
|
||||||
|
|
|
||||||
|
|
@ -33,15 +33,15 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dateSo;
|
let dateTimeRangeSo;
|
||||||
if (values.tm) {
|
if (values.tm) {
|
||||||
dateSo = {
|
dateTimeRangeSo = {
|
||||||
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
||||||
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete values.tm
|
delete values.tm
|
||||||
setSearchVal({...values, dateSo});
|
setSearchVal({...values, dateTimeRangeSo});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -49,10 +49,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
||||||
<>
|
<>
|
||||||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||||||
<Form.Item label="物资名称" name="name">
|
<Form.Item label="物资名称" name="goodsName">
|
||||||
<Input allowClear style={{width:'150px'}}/>
|
<Input allowClear style={{width:'150px'}}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="类型" name="type">
|
<Form.Item label="类型" name="goodsType">
|
||||||
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="采购时间" name="tm">
|
<Form.Item label="采购时间" name="tm">
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import React,{useEffect,useState,useMemo,useRef} from 'react';
|
import React, { useEffect, useState, useMemo, useRef } from 'react';
|
||||||
import { Form, Button, Input, Row,Upload, Col, Table, DatePicker, InputNumber,message,Image,Modal,Typography ,Popconfirm } from 'antd';
|
import { Form, Button, Input, Row, Upload, Col, Table, DatePicker, InputNumber, message, Image, Modal, Typography, Popconfirm } from 'antd';
|
||||||
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 FileUpload from '../../../components/fileUpload';
|
import FileUpload from '../../../components/fileUpload';
|
||||||
import NormalSelect from '../../../components/Form/NormalSelect';
|
import NormalSelect from '../../../components/Form/NormalSelect';
|
||||||
|
import { httppost2 } from '../../../utils/request';
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
const { RangePicker } = DatePicker
|
const { RangePicker } = DatePicker
|
||||||
|
|
@ -19,7 +19,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
{
|
{
|
||||||
label: "安全事故",
|
label: "安全事故",
|
||||||
value: 1
|
value: 1
|
||||||
},{
|
}, {
|
||||||
label: "质量问题",
|
label: "质量问题",
|
||||||
value: 2
|
value: 2
|
||||||
},
|
},
|
||||||
|
|
@ -27,18 +27,45 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [fileIds, setFileIds] = useState()
|
const [fileIds, setFileIds] = useState()
|
||||||
const onfinish = (values) => {
|
const onfinish = (values) => {
|
||||||
values.eventsDate = values.eventsDate?moment(values.eventsDate).format("YYYY-MM-DD 00:00:00"):''
|
const userId = localStorage.getItem('userId')
|
||||||
|
const userName = localStorage.getItem('userName')
|
||||||
|
values.createUserId = userId;
|
||||||
|
values.createUserName = userName;
|
||||||
|
values.startTime = values.tm ? moment(values.tm[0]).format("YYYY-MM-DD 00:00:00") : '';
|
||||||
|
values.endTime = values.tm ? moment(values.tm[1]).format("YYYY-MM-DD 00:00:00") : '';
|
||||||
if (mode === 'edit') {
|
if (mode === 'edit') {
|
||||||
values.files = fileIds;
|
values.files = fileIds;
|
||||||
values.id = record.id;
|
values.id = record.id;
|
||||||
onEdit(apiurl.rcgl.gcdsj.edit,values)
|
onEdit(apiurl.sbwh.ssgcjl.edit, values)
|
||||||
}
|
}
|
||||||
if (mode === 'save') {
|
if (mode === 'save') {
|
||||||
values.files = fileIds
|
values.files = fileIds
|
||||||
onSave(apiurl.rcgl.gcdsj.save,values)
|
onSave(apiurl.sbwh.ssgcjl.save, values)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取方案list
|
||||||
|
const faList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await httppost2(apiurl.sbwh.ssgcjl.list)
|
||||||
|
debugger
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
if (mode != 'save') {
|
||||||
|
let dataSo = record.startTime && record.endTime ?
|
||||||
|
[moment(record.startTime), moment(record.endTime)] : ''
|
||||||
|
form.setFieldValue("tm", dataSo)
|
||||||
|
}
|
||||||
|
}, [record, mode])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
faList()
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Form
|
<Form
|
||||||
|
|
@ -51,19 +78,19 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="项目名称"
|
label="项目名称"
|
||||||
name="name"
|
name="projectName"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="方案名称"
|
label="方案名称"
|
||||||
name="name"
|
name="planName"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
|
|
@ -72,18 +99,18 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="过程名称"
|
label="过程名称"
|
||||||
name="adress"
|
name="processName"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="完成情况(%)"
|
label="完成情况(%)"
|
||||||
name="name"
|
name="completeStatus"
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={100} disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<InputNumber min={0} max={100} disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
@ -91,11 +118,11 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="问题类型"
|
label="问题类型"
|
||||||
name="type"
|
name="problemType"
|
||||||
>
|
>
|
||||||
<NormalSelect
|
<NormalSelect
|
||||||
allowClear
|
allowClear
|
||||||
disabled={mode==='view'}
|
disabled={mode === 'view'}
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
options={types}
|
options={types}
|
||||||
/>
|
/>
|
||||||
|
|
@ -104,15 +131,15 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="问题发生时间"
|
label="问题发生时间"
|
||||||
name="eventsDate"
|
name="tm"
|
||||||
getValueFromEvent={(e,dateString) => dateString}
|
getValueFromEvent={(e, dateString) => dateString}
|
||||||
getValueProps={(value) => {
|
getValueProps={(value) => {
|
||||||
return {
|
return {
|
||||||
value: value ? [value[0]&&moment(value[0]),value[1]&&moment(value[1])] : undefined
|
value: value ? [value[0] && moment(value[0]), value[1] && moment(value[1])] : undefined
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RangePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
|
<RangePicker disabled={mode === 'view'} format={'YYYY-MM-DD'} style={{ width: '100%' }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
@ -121,11 +148,11 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="问题描述"
|
label="问题描述"
|
||||||
name="eventsDesc"
|
name="problemDesc"
|
||||||
labelCol={{ span: 3 }}
|
labelCol={{ span: 3 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
<Input.TextArea disabled={mode==='view'} style={{width:'100%',minHeight:'100px'}} allowClear />
|
<Input.TextArea disabled={mode === 'view'} style={{ width: '100%', minHeight: '100px' }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
@ -140,6 +167,8 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
uploadUrl={apiurl.sbwh.ssgcjl.uploadUrl}
|
||||||
|
downloadUrl={apiurl.sbwh.ssgcjl.downloadUrl}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
files={record?.files}
|
files={record?.files}
|
||||||
setFileIds={setFileIds}
|
setFileIds={setFileIds}
|
||||||
|
|
@ -148,7 +177,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
{
|
{
|
||||||
mode==='view'?null:(
|
mode === 'view' ? null : (
|
||||||
<>
|
<>
|
||||||
<Form.Item {...btnItemLayout}>
|
<Form.Item {...btnItemLayout}>
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type="primary" htmlType="submit">
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,15 @@ 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 types = {
|
|
||||||
0: "设备维修",
|
|
||||||
1: '设备更换',
|
|
||||||
2:"结构加固"
|
|
||||||
}
|
|
||||||
const refModal = useRef();
|
const refModal = useRef();
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
||||||
{ title: '方案名称', key: 'name', dataIndex: 'name', width: 150, ellipsis: true },
|
{ title: '方案名称', key: 'planName', dataIndex: 'planName', width: 150, ellipsis: true },
|
||||||
{ title: '过程地点', key: 'adress', dataIndex: 'adress', width: 200, ellipsis: true },
|
{ title: '过程名称', key: 'processName', dataIndex: 'processName', width: 200, ellipsis: true },
|
||||||
{ title: '记录人', key: 'type', dataIndex: 'type', width: 140,},
|
{ title: '记录人', key: 'createUserName', dataIndex: 'createUserName', width: 140,},
|
||||||
{
|
{
|
||||||
title: '记录时间', key: 'eventsDate', dataIndex: 'eventsDate', width: 140,
|
title: '记录时间', key: 'createTime', dataIndex: 'createTime', width: 140,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
||||||
|
|
@ -47,13 +42,13 @@ const Page = () => {
|
||||||
} else if (type === 'view') {
|
} else if (type === 'view') {
|
||||||
refModal.current.showView(params);
|
refModal.current.showView(params);
|
||||||
} else if (type === 'del') {
|
} else if (type === 'del') {
|
||||||
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
|
refModal.current.onDeleteGet(apiurl.sbwh.ssgcjl.delete + `/${params.id}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.whfabz.page).find_noCode);
|
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.ssgcjl.page).find_noCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 处理成功的回调
|
* @description 处理成功的回调
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,15 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dateSo;
|
let dateTimeRangeSo;
|
||||||
if (values.tm) {
|
if (values.tm) {
|
||||||
dateSo = {
|
dateTimeRangeSo = {
|
||||||
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
||||||
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete values.tm
|
delete values.tm
|
||||||
setSearchVal({...values, dateSo});
|
setSearchVal({...values, dateTimeRangeSo});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
<>
|
<>
|
||||||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||||||
<Form.Item label="项目名称" name="name">
|
<Form.Item label="项目名称" name="projectName">
|
||||||
<Input allowClear style={{width:'150px'}}/>
|
<Input allowClear style={{width:'150px'}}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="记录时间" name="tm">
|
<Form.Item label="记录时间" name="tm">
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import NormalSelect from '../../../components/Form/NormalSelect';
|
||||||
|
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import { httppost2 } from '../../../utils/request';
|
||||||
const { RangePicker } = DatePicker
|
const { RangePicker } = DatePicker
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
||||||
|
|
||||||
|
|
@ -29,18 +30,32 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [fileIds, setFileIds] = useState()
|
const [fileIds, setFileIds] = useState()
|
||||||
const onfinish = (values) => {
|
const onfinish = (values) => {
|
||||||
values.eventsDate = values.eventsDate?moment(values.eventsDate).format("YYYY-MM-DD 00:00:00"):''
|
const userId = localStorage.getItem('userId')
|
||||||
if (mode === 'edit') {
|
const userName = localStorage.getItem('userName')
|
||||||
|
values.createUserId = userId;
|
||||||
|
values.createUserName = userName;
|
||||||
|
values.startTime =values.tm? moment(values.tm[0]).format("YYYY-MM-DD 00:00:00") :'';
|
||||||
|
values.endTime = values.tm?moment(values.tm[1]).format("YYYY-MM-DD 00:00:00") :'';
|
||||||
values.files = fileIds;
|
values.files = fileIds;
|
||||||
|
if (mode === 'edit') {
|
||||||
values.id = record.id;
|
values.id = record.id;
|
||||||
onEdit(apiurl.rcgl.gcdsj.edit,values)
|
onEdit(apiurl.sbwh.whfabz.edit,values)
|
||||||
}
|
}
|
||||||
if (mode === 'save') {
|
if (mode === 'save') {
|
||||||
values.files = fileIds
|
onSave(apiurl.sbwh.whfabz.save,values)
|
||||||
onSave(apiurl.rcgl.gcdsj.save,values)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (mode != 'save') {
|
||||||
|
let dataSo = record.startTime && record.endTime ?
|
||||||
|
[moment(record.startTime), moment(record.endTime)]:''
|
||||||
|
form.setFieldValue("tm", dataSo)
|
||||||
|
}
|
||||||
|
}, [record,mode])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Form
|
<Form
|
||||||
|
|
@ -53,7 +68,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="项目名称"
|
label="项目名称"
|
||||||
name="name"
|
name="projectName"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
|
|
@ -62,7 +77,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="方案名称"
|
label="方案名称"
|
||||||
name="name"
|
name="planName"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
|
|
@ -74,7 +89,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="项目地点"
|
label="项目地点"
|
||||||
name="adress"
|
name="projectAddr"
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
@ -82,7 +97,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="项目负责人"
|
label="项目负责人"
|
||||||
name="name"
|
name="projectLeader"
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
@ -92,7 +107,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="维护类型"
|
label="维护类型"
|
||||||
name="type"
|
name="maintainType"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<NormalSelect
|
<NormalSelect
|
||||||
|
|
@ -106,7 +121,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="计划维护时间"
|
label="计划维护时间"
|
||||||
name="eventsDate"
|
name="tm"
|
||||||
getValueFromEvent={(e,dateString) => dateString}
|
getValueFromEvent={(e,dateString) => dateString}
|
||||||
getValueProps={(value) => {
|
getValueProps={(value) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -123,7 +138,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="维护内容"
|
label="维护内容"
|
||||||
name="eventsDesc"
|
name="content"
|
||||||
labelCol={{ span: 3 }}
|
labelCol={{ span: 3 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
|
|
@ -135,7 +150,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="费用预估(元)"
|
label="费用预估(元)"
|
||||||
name="eventsDesc"
|
name="costEstimate"
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
@ -151,6 +166,8 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
uploadUrl={apiurl.sbwh.whfabz.uploadUrl}
|
||||||
|
downloadUrl={apiurl.sbwh.whfabz.downloadUrl}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
files={record?.files}
|
files={record?.files}
|
||||||
setFileIds={setFileIds}
|
setFileIds={setFileIds}
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,15 @@ const Page = () => {
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
||||||
{ title: '项目名称', key: 'name', dataIndex: 'name', width: 150, ellipsis: true },
|
{ title: '项目名称', key: 'projectName', dataIndex: 'projectName', width: 150, ellipsis: true },
|
||||||
{ title: '项目地点', key: 'adress', dataIndex: 'adress', width: 200, ellipsis: true },
|
{ title: '项目地点', key: 'projectAddr', dataIndex: 'projectAddr', width: 200, ellipsis: true },
|
||||||
{
|
{
|
||||||
title: '维护类型', key: 'type', dataIndex: 'type', width: 140,
|
title: '维护类型', key: 'maintainType', dataIndex: 'maintainType', width: 140,
|
||||||
render: (value) => <span>{types[value]}</span>,
|
render: (value) => <span>{types[value]}</span>,
|
||||||
},
|
},
|
||||||
{ title: '编制人', key: 'type', dataIndex: 'type', width: 140,},
|
{ title: '编制人', key: 'createUserName', dataIndex: 'createUserName', width: 140},
|
||||||
{
|
{
|
||||||
title: '编制时间', key: 'eventsDate', dataIndex: 'eventsDate', width: 140,
|
title: '编制时间', key: 'createTime', dataIndex: 'createTime', width: 140,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
||||||
|
|
@ -51,7 +51,7 @@ const Page = () => {
|
||||||
} else if (type === 'view') {
|
} else if (type === 'view') {
|
||||||
refModal.current.showView(params);
|
refModal.current.showView(params);
|
||||||
} else if (type === 'del') {
|
} else if (type === 'del') {
|
||||||
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
|
refModal.current.onDeleteGet(apiurl.sbwh.whfabz.delete + `/${params.id}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,15 +22,15 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dateSo;
|
let dateTimeRangeSo;
|
||||||
if (values.tm) {
|
if (values.tm) {
|
||||||
dateSo = {
|
dateTimeRangeSo = {
|
||||||
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
||||||
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete values.tm
|
delete values.tm
|
||||||
setSearchVal({...values, dateSo});
|
setSearchVal({...values, dateTimeRangeSo});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -38,10 +38,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
<>
|
<>
|
||||||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||||||
<Form.Item label="项目名称" name="name">
|
<Form.Item label="项目名称" name="projectName">
|
||||||
<Input allowClear style={{width:'150px'}}/>
|
<Input allowClear style={{width:'150px'}}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="维护类型" name="type">
|
<Form.Item label="维护类型" name="maintainType">
|
||||||
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="编制时间" name="tm">
|
<Form.Item label="编制时间" name="tm">
|
||||||
|
|
|
||||||
|
|
@ -29,15 +29,20 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [fileIds, setFileIds] = useState()
|
const [fileIds, setFileIds] = useState()
|
||||||
const onfinish = (values) => {
|
const onfinish = (values) => {
|
||||||
values.eventsDate = values.eventsDate?moment(values.eventsDate).format("YYYY-MM-DD 00:00:00"):''
|
const userId = localStorage.getItem('userId')
|
||||||
|
const userName = localStorage.getItem('userName')
|
||||||
|
values.createUserId = userId;
|
||||||
|
values.createUserName = userName;
|
||||||
|
values.startTime =values.tm? moment(values.tm[0]).format("YYYY-MM-DD 00:00:00") :'';
|
||||||
|
values.endTime = values.tm?moment(values.tm[1]).format("YYYY-MM-DD 00:00:00") :'';
|
||||||
if (mode === 'edit') {
|
if (mode === 'edit') {
|
||||||
values.files = fileIds;
|
values.files = fileIds;
|
||||||
values.id = record.id;
|
values.id = record.id;
|
||||||
onEdit(apiurl.rcgl.gcdsj.edit,values)
|
onEdit(apiurl.sbwh.whxmys.edit,values)
|
||||||
}
|
}
|
||||||
if (mode === 'save') {
|
if (mode === 'save') {
|
||||||
values.files = fileIds
|
values.files = fileIds
|
||||||
onSave(apiurl.rcgl.gcdsj.save,values)
|
onSave(apiurl.sbwh.whxmys.save,values)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,6 +138,8 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
uploadUrl={apiurl.sbwh.whxmys.uploadUrl}
|
||||||
|
downloadUrl={apiurl.sbwh.whxmys.downloadUrl}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
files={record?.files}
|
files={record?.files}
|
||||||
setFileIds={setFileIds}
|
setFileIds={setFileIds}
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,17 @@ const Page = () => {
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
||||||
{ title: '项目名称', key: 'name', dataIndex: 'name', width: 150, ellipsis: true },
|
{ title: '项目名称', key: 'projectName', dataIndex: 'projectName', width: 150, ellipsis: true },
|
||||||
{ title: '验收时间', key: 'adress', dataIndex: 'adress', width: 200, ellipsis: true },
|
|
||||||
{ title: '记录人', key: 'type', dataIndex: 'type', width: 140,},
|
|
||||||
{
|
{
|
||||||
title: '记录时间', key: 'eventsDate', dataIndex: 'eventsDate', width: 140,
|
title: '验收时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true,
|
||||||
|
render: (v, r) => <span>{r.startTime || '-'}至{r.endTime || '-'}</span>
|
||||||
|
},
|
||||||
|
{ title: '记录人', key: 'createUserName', dataIndex: 'createUserName', width: 140,},
|
||||||
|
{
|
||||||
|
title: '记录时间', key: 'createTime', dataIndex: 'createTime', width: 140,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
title: '操作', key: 'createTime', width: 200, fixed: 'right',align: 'center',
|
||||||
render: (value, row, index) => (
|
render: (value, row, index) => (
|
||||||
<CrudOpRender_text
|
<CrudOpRender_text
|
||||||
edit={ true }
|
edit={ true }
|
||||||
|
|
@ -47,13 +50,13 @@ const Page = () => {
|
||||||
} else if (type === 'view') {
|
} else if (type === 'view') {
|
||||||
refModal.current.showView(params);
|
refModal.current.showView(params);
|
||||||
} else if (type === 'del') {
|
} else if (type === 'del') {
|
||||||
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
|
refModal.current.onDeleteGet(apiurl.sbwh.whxmys.delete + `/${params.id}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.whfabz.page).find_noCode);
|
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.whxmys.page).find_noCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 处理成功的回调
|
* @description 处理成功的回调
|
||||||
|
|
|
||||||
|
|
@ -22,15 +22,15 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const onFinish = (values) => {
|
const onFinish = (values) => {
|
||||||
let dateSo;
|
let dateTimeRangeSo;
|
||||||
if (values.tm) {
|
if (values.tm) {
|
||||||
dateSo = {
|
dateTimeRangeSo = {
|
||||||
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
||||||
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete values.tm
|
delete values.tm
|
||||||
setSearchVal({...values, dateSo});
|
setSearchVal({...values, dateTimeRangeSo});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
<>
|
<>
|
||||||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||||||
<Form.Item label="项目名称" name="name">
|
<Form.Item label="项目名称" name="projectName">
|
||||||
<Input allowClear style={{width:'150px'}}/>
|
<Input allowClear style={{width:'150px'}}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="记录时间" name="tm">
|
<Form.Item label="记录时间" name="tm">
|
||||||
|
|
|
||||||
|
|
@ -116,11 +116,11 @@ const Page = () => {
|
||||||
exportFile1={exportExcel}
|
exportFile1={exportExcel}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
<div className="ant-card-body" style={{ padding: "20px 0 0 0", display: 'flex', columnGap: 10 }}>
|
<div className="ant-card-body" style={{ padding: "20px 0 0 0", display: 'flex', columnGap: 10,overflow:'hidden' }}>
|
||||||
<div style={{ width: 800 }}>
|
<div style={{ width: 800 }}>
|
||||||
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width, y: "calc( 100vh - 400px )" }} />
|
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width, y: "calc( 100vh - 400px )" }} />
|
||||||
</div>
|
</div>
|
||||||
<div style={{ flex: 1,height:"calc( 100vh - 400px )" }} >
|
<div style={{ width: 750,height:570 }} >
|
||||||
<ReactEcharts
|
<ReactEcharts
|
||||||
option={pxOptions || {}}
|
option={pxOptions || {}}
|
||||||
style={{ width: "100%", height: '100%' }}
|
style={{ width: "100%", height: '100%' }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue