diff --git a/src/index.less b/src/index.less index c58b96d87..ef3ddabd3 100644 --- a/src/index.less +++ b/src/index.less @@ -202,4 +202,10 @@ code { .ant-table-title{ padding: 0 !important; padding-right: 10px !important; +} +.flex{ + display: flex; +} +.flex-end{ + justify-content: flex-end; } \ No newline at end of file diff --git a/src/models/auth/_.ts b/src/models/auth/_.ts index c84e5b785..7b1fd9ce1 100644 --- a/src/models/auth/_.ts +++ b/src/models/auth/_.ts @@ -32,17 +32,17 @@ export function removeLoginInfo() { let keysToKeep = ["checked", "loginNamePwd"]; let keysToRemove = []; // 遍历 localStorage -for (let i = 0; i < localStorage.length; i++) { - let key: any = localStorage.key(i); - if (!keysToKeep.includes(key)) { - keysToRemove.push(key); - } + for (let i = 0; i < localStorage.length; i++) { + let key: any = localStorage.key(i); + if (!keysToKeep.includes(key)) { + keysToRemove.push(key); + } } for (let i = 0; i < keysToRemove.length; i++) { localStorage.removeItem(keysToRemove[i]); } - + /*localStorage.removeItem(USER_SESSION_KEY); localStorage.removeItem('TOKEN');*/ @@ -67,7 +67,7 @@ export function getUserFromSession(): LoginUser | null { if (obj.id && obj.tokenInfo.tokenValue) { return obj } - } catch (e) {} + } catch (e) { } return null } @@ -114,55 +114,55 @@ function idgen() { return () => `${id++}` } -const handelTreeData = (data:any,id:any)=>{ +const handelTreeData = (data: any, id: any) => { if (data.length > 0) { - data.forEach((item:any) => { - item.id = id() - item.title = item.menuName; - item.icon = item.icon; + data.forEach((item: any) => { + item.id = id() + item.title = item.menuName; + item.icon = item.icon; - if(item.menuType==='M'&&item.children && item.children.length > 0){//目录 - item.redirect = item.path; - delete item.path - handelTreeData(item.children,id); - } - if(item.menuType==='C'){//菜单 - item.rule = item.children; - delete item.children - } - }); + if (item.menuType === 'M' && item.children && item.children.length > 0) {//目录 + item.redirect = item.path; + delete item.path + handelTreeData(item.children, id); + } + if (item.menuType === 'C') {//菜单 + item.rule = item.children; + delete item.children + } + }); } } -const buildTree = (data:any, parentId:any)=> { - let tree:any = []; - data.forEach((node:any) => { - if (node.parentId === parentId) { +const buildTree = (data: any, parentId: any) => { + let tree: any = []; + data.forEach((node: any) => { + if (node.parentId === parentId) { let children = buildTree(data, node.menuId); if (children.length) { - node.children = children; + node.children = children; } tree.push(node); - } + } }); return tree; } -export function loadRole(data:any) { - const roleObj:any = {} - const handelTreeData2 = (data:any)=>{ +export function loadRole(data: any) { + const roleObj: any = {} + const handelTreeData2 = (data: any) => { if (data.length > 0) { - data.forEach((item:any) => { - if (item.children && item.children.length > 0) { - //是目录 - handelTreeData2(item.children); - }else{ - //是菜单 - roleObj[item.path] = item - } - }); + data.forEach((item: any) => { + if (item.children && item.children.length > 0) { + //是目录 + handelTreeData2(item.children); + } else { + //是菜单 + roleObj[item.path] = item + } + }); } } @@ -207,6 +207,20 @@ export async function loadMenu(): Promise { } ] }, + { + id: id(), title: '水政执法', redirect: '/mgr/sz/szzf/ajdj', + children: [ + { + id: id(), title: '案件登记', path: '/mgr/sz/szzf/ajdj', + }, + { + id: id(), title: '案件统计', path: '/mgr/sz/szzf/ajtj', + }, + { + id: id(), title: '处理依据', path: '/mgr/sz/szzf/clyj', + } + ] + }, { id: id(), title: '监督考核', redirect: '/mgr/sz/jdkh/khtj', children: [ @@ -231,11 +245,12 @@ export async function loadMenu(): Promise { { id: id(), title: '制度管理', path: '/mgr/sz/zdgl' }, ] - }, - { id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb', + }, + { + id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb', children: [ - { id: id(), title: '防洪形势', path: '/mgr/sy/fhxzfx'}, - { id: id(), title: '天气预报', path: '/mgr/fxzb/tqyb'}, + { id: id(), title: '防洪形势', path: '/mgr/sy/fhxzfx' }, + { id: id(), title: '天气预报', path: '/mgr/fxzb/tqyb' }, { id: id(), title: '洪水预报', redirect: '/mgr/fxzb/hsyb/hyybjs', children: [ @@ -244,8 +259,8 @@ export async function loadMenu(): Promise { { id: id(), title: '参数管理', path: '/mgr/fxzb/hsyb/csgl' }, ] }, - { id: id(), title: '防汛预案', path: '/mgr/sy/fxya'}, - { id: id(), title: '调度规程', path: '/mgr/sy/ddgc'}, + { id: id(), title: '防汛预案', path: '/mgr/sy/fxya' }, + { id: id(), title: '调度规程', path: '/mgr/sy/ddgc' }, { id: id(), title: '抢险物料', @@ -258,7 +273,8 @@ export async function loadMenu(): Promise { }, ], }, - { id: id(), title: '四管', redirect: '/mgr/sg/xcxj/xcrw', icon: 'fxzb', + { + id: id(), title: '四管', redirect: '/mgr/sg/xcxj/xcrw', icon: 'fxzb', children: [ { id: id(), title: '巡查巡检', redirect: '/mgr/sg/xcxj/xcrw', @@ -314,7 +330,8 @@ export async function loadMenu(): Promise { }, ], }, - { id: id(), title: '工程安全监测', redirect: '/mgr/gcaqjc/gcaqyj/bzt', icon: 'fxzb', + { + id: id(), title: '工程安全监测', redirect: '/mgr/gcaqjc/gcaqyj/bzt', icon: 'fxzb', children: [ { id: id(), title: '布置图', path: '/mgr/gcaqjc/gcaqyj/bzt', @@ -322,7 +339,7 @@ export async function loadMenu(): Promise { { id: id(), title: '工程安全分析', redirect: '/mgr/gcaqjc/gcaqfx/jrx', children: [ - { id: id(), title: '浸润线', path: '/mgr/gcaqjc/gcaqfx/jrx'}, + { id: id(), title: '浸润线', path: '/mgr/gcaqjc/gcaqfx/jrx' }, ] }, { @@ -345,31 +362,35 @@ export async function loadMenu(): Promise { }, ], }, - { id:id(),title:'四全',redirect:'/mgr/sq/qfg/zcdjxx', + { + id: id(), title: '四全', redirect: '/mgr/sq/qfg/zcdjxx', children: [ - { id: id(), title: '全覆盖', redirect: '/mgr/sq/qfg/zcdjxx', + { + id: id(), title: '全覆盖', redirect: '/mgr/sq/qfg/zcdjxx', children: [ - { id: id(), title: '注册登记信息', path: '/mgr/sq/qfg/zcdjxx'}, + { id: id(), title: '注册登记信息', path: '/mgr/sq/qfg/zcdjxx' }, ] }, - { id: id(), title: '全要素', redirect: '/mgr/sq/qys/kqys', + { + id: id(), title: '全要素', redirect: '/mgr/sq/qys/kqys', children: [ - { id: id(), title: '库区要素', path: '/mgr/sq/qys/kqys'}, - { id: id(), title: '工程要素', path: '/mgr/sq/qys/gcys'}, - { id: id(), title: '下游要素', path: '/mgr/sq/qys/xyys'}, + { id: id(), title: '库区要素', path: '/mgr/sq/qys/kqys' }, + { id: id(), title: '工程要素', path: '/mgr/sq/qys/gcys' }, + { id: id(), title: '下游要素', path: '/mgr/sq/qys/xyys' }, ] }, - { id: id(), title: '全周期', redirect: '/mgr/sq/qzq/gcdsj', + { + id: id(), title: '全周期', redirect: '/mgr/sq/qzq/gcdsj', children: [ - { id: id(), title: '工程大事记', path: '/mgr/sq/qzq/gcdsj'}, - { id: id(), title: '全周期档案', path: '/mgr/sq/qys/qzqda'}, + { id: id(), title: '工程大事记', path: '/mgr/sq/qzq/gcdsj' }, + { id: id(), title: '全周期档案', path: '/mgr/sq/qys/qzqda' }, ] }, ] }, - + // { id: id(), title: '基本情况', path: '/mgr/home', icon: 'jbqk' }, // { // id: id(), @@ -413,14 +434,14 @@ export async function loadMenu(): Promise { // children: [ // { id: id(), title: '隐患预警', path: '/mgr/gcaqjc/gcaqyj/yhyj' }, // { id: id(), title: '预警规则配置', path: '/mgr/gcaqjc/gcaqyj/yjgzpz' }, - + // ] // }, // { // id: id(), title: '工程安全分析', redirect: '/mgr/gcaqjc/gcaqfx/jrx', // children: [ // { id: id(), title: '浸润线', path: '/mgr/gcaqjc/gcaqfx/jrx' }, - + // ] // }, // { @@ -433,10 +454,10 @@ export async function loadMenu(): Promise { // { id: id(), title: '年度渗压统计表', path: '/mgr/gcaqjc/sjtjcx/ndsytjb' }, // { id: id(), title: '年度渗流统计表', path: '/mgr/gcaqjc/sjtjcx/ndsltjb' }, // { id: id(), title: '年度位移统计表', path: '/mgr/gcaqjc/sjtjcx/ndwytjb' }, - + // ] // }, - + // ], // }, // { @@ -455,7 +476,7 @@ export async function loadMenu(): Promise { // children: [ // { id: id(), title: '值班表', path: '/mgr/rcgl/zbgl/zbb' }, // { id: id(), title: '值班日志', path: '/mgr/rcgl/zbgl/zbrz' }, - + // ] // }, // { diff --git a/src/views/AppRouters.tsx b/src/views/AppRouters.tsx index 7e4897cef..0b99e53b6 100644 --- a/src/views/AppRouters.tsx +++ b/src/views/AppRouters.tsx @@ -96,7 +96,9 @@ import Qzqda from './sq/qzq/qzqda' import Zzjgck from './sz/zzjgck' import Flfg from './sz/flfg' import Zdgl from './sz/zdgl' - +import Ajdj from './sz/szzf/ajdj' +import Ajtj from './sz/szzf/ajtj' +import Clyj from './sz/szzf/clyj' const HomePage = lazy(() => import('./Home')) @@ -242,6 +244,10 @@ const AppRouters: React.FC = () => { { path: 'sz/gltx/zzjgck', element: }, { path: 'sz/flfg', element: }, { path: 'sz/zdgl', element: }, + { path: 'sz/szzf/ajdj', element: }, + { path: 'sz/szzf/ajtj', element: }, + { path: 'sz/szzf/clyj', element: }, + ], }, { path: '/login', element: }, diff --git a/src/views/sq/qys/kqys/index.js b/src/views/sq/qys/kqys/index.js index ec554edbb..26fd77857 100644 --- a/src/views/sq/qys/kqys/index.js +++ b/src/views/sq/qys/kqys/index.js @@ -4,7 +4,8 @@ import qys1 from '../../../../assets/img/qys1.png' import qys2 from '../../../../assets/img/qys2.jpg' import qys3 from '../../../../assets/img/qys3.jpg' import qys4 from '../../../../assets/img/qys4.png' -import './index.less' +import stylesCss from './index.module.less' + import { Rnd } from "react-rnd" import { useState, useEffect } from "react" const list = [ @@ -53,7 +54,7 @@ const Page = () => { return (
- {list.map(item =>
tabClick(item)}>{item.name}
)} + {list.map(item =>
tabClick(item)}>{item.name}
)}
{ + const form =useForm() + const [fileList ,setFileList] =useState() + const props = { + name: 'file', + multiple: true, + fileList: fileList, + showUploadList: false, + beforeUpload: (file, fileList) => { + // if (fileType == "pic" && + // (file.type != "image/jpeg" || file.type != "image/png" || file.type != "image/jpg")) { + // message.error('仅支持上传jpg/png/jpeg格式的图片'); + // return false; + // } else { + // return true; + // } + }, + onChange(e) { + // httpPostFile(apiUrl.service.uploadFile.uploadUrl + "?group=" + typeUpload, e).then(res => { + // setFileList([...fileList, res.data]) + // }) + } + }; + const onFinish = () =>{ + + } + return ( +
+ +
案卷存档
+ + + + + + + + + + +
+ +
案卷存档
+ + + +

+ +

+

点击或将文件拖拽到这里上传 支持扩展名:jpeg、png

+
+
+ +
+
+ + ) +} + +export default Page \ No newline at end of file diff --git a/src/views/sz/szzf/ajdj/config.js b/src/views/sz/szzf/ajdj/config.js new file mode 100644 index 000000000..9be767e89 --- /dev/null +++ b/src/views/sz/szzf/ajdj/config.js @@ -0,0 +1,243 @@ +const basicData = [ + { + label: '填报人', + key: 'name', + type: 'input', + span: 12, + disabled: true + }, + { + label: '填报时间', + key: 'name', + type: 'input', + span: 12, + disabled: true + }, + { + label: '案件编号', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '案件名称', + key: 'name', + type: 'input', + span: 12, + required: true + }, + { + label: '案件类型', + key: 'name', + type: 'Select', + span: 12 + }, + { + label: '案发地点', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '案件来源', + key: 'name', + type: 'Radio', + span: 12, + options: [ + { label: '自然人', value: 'Apple' }, + { label: '法人或其他组织', value: 'Pear' }, + { label: '待定', value: 'Orange' }, + ] + }, + { + label: '违法时间', + key: 'name', + type: 'input', + span: 24 + }, + { + label: '案件来源', + key: 'name', + type: 'input', + span: 24 + }, + { + label: '姓名', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '身份证号', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '住址', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '联系方式', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '简要案情', + key: 'name', + type: 'TextArea', + span: 24 + }, + { + label: '附件', + key: 'name', + type: 'upload', + span: 24 + }, +] + +const clqkData = [ + { + label: '处理程序', + key: 'name', + type: 'Select', + span: 12, + disabled: true + }, + { + label: '处理依据', + key: 'name', + type: 'Select', + span: 12, + disabled: true + }, + { + label: '处理措施', + key: 'name', + type: 'Select', + span: 12 + }, + { + label: '移送处理情况', + key: 'name', + type: 'Radio', + span: 24, + options: [ + { label: '移送单位', value: 'Apple' }, + { label: '不移送', value: 'Pear' }, + ], + required: true + }, + { + label: '案件执行情况', + key: 'name', + type: 'Radio', + options: [ + { label: '当事人自动履行', value: 'Apple' }, + { label: '行政强制执行', value: 'Pear' }, + ], + span: 24 + }, + { + label: '自动履行情况', + key: 'name', + type: 'TextArea', + + span: 24 + }, + { + label: '伤亡人数(人)', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '直接损失金额(万元)', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '结案情况', + key: 'name', + type: 'Select', + span: 12 + }, + { + label: '结案时间', + key: 'name', + type: 'input', + span: 12 + }, + { + label: '文件编号及名称', + key: 'name', + type: 'input', + span: 24 + }, + { + label: '督办单位类型', + key: 'name', + type: 'Select', + span: 12 + }, + { + label: '督办单位名称', + key: 'name', + type: 'input', + span: 24 + }, + { + label: '附件', + key: 'name', + type: 'upload', + span: 24 + }, +] + +const xzfy = [ + { + label: '处理程序', + key: 'name', + type: 'Select', + span: 12, + options:[ + { + label:'维护' + }, + {label:'变更'}, + {label:'撤销'}, + {label:'和解'}, + {label:'调解'}, + + ], + disabled: true + }, + { + label: '处理依据', + key: 'name', + type: 'Select', + span: 12, + disabled: true, + options:[ + { + label:'驳回原告诉讼' + }, + {label:'变更'}, + {label:'撤销'}, + {label:'确认违法'}, + {label:'确认无效'}, + {label:'其他'}, + + + ], + }, +] +export { + basicData, + clqkData, + xzfy +} \ No newline at end of file diff --git a/src/views/sz/szzf/ajdj/editTabs.js b/src/views/sz/szzf/ajdj/editTabs.js new file mode 100644 index 000000000..4a4d6f19d --- /dev/null +++ b/src/views/sz/szzf/ajdj/editTabs.js @@ -0,0 +1,50 @@ +import React, { useState } from 'react'; +import { Tabs } from 'antd'; +import BascForm from '../form/index' +import { basicData,clqkData,xzfy} from './config' +import Bajz from './bajz' +const items = [ + { + key: '1', + label: '基本情况', + }, + { + key: '2', + label: '处理情况', + }, + { + key: '3', + label: '行政复议、行政应诉情况', + }, + { + key: '4', + label: '办案宗卷', + }, + { + key: '5', + label: '历史影像及图片', + }, +]; + + +const Page = () => { + const [key , setKeys] = useState('1') + const onChange = (key) => { + console.log(key); + setKeys(key) + }; + return ( + <> + + <> + {key==1&& } + {key==2&& } + {key==3&& } + {key==4&& } + {/* {key==5&& } */} + + + ) +} + +export default Page \ No newline at end of file diff --git a/src/views/sz/szzf/ajdj/form.js b/src/views/sz/szzf/ajdj/form.js new file mode 100644 index 000000000..5f53aa620 --- /dev/null +++ b/src/views/sz/szzf/ajdj/form.js @@ -0,0 +1,305 @@ +import React, { useEffect, useState, useMemo, useRef } from 'react'; +import { Form, Button, Input, Row, Upload, Col, Table, DatePicker, InputNumber, message, Image, Modal, Typography, Select } from 'antd'; +import { DeleteOutlined, FileWordOutlined, FilePdfOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons'; +import { formItemLayout, btnItemLayout } from '../../../../components/crud/FormLayoutProps'; +import apiurl from '../../../../service/apiurl'; + +// import "./index.less" +import moment from 'moment'; +const { RangePicker } = DatePicker +const { Dragger } = Upload; +const url = "http://223.75.53.141:9102/test.by-lyf.tmp" + +const opntios=[ + {label:'宪法',value:'宪法'}, + {label:'法律',value:'法律'}, + {label:'行政法规',value:'行政法规'}, + {label:'督察法规',value:'督察法规'}, + {label:'司法解释',value:'司法解释'}, + {label:'地方性法规',value:'地方性法规'}, +] +const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => { + + const [form] = Form.useForm(); + const [fileList, setFileList] = useState([]) //上传文件列表 + const [fileIds, setFileIds] = useState([]) + const [iframeSrc, setIframeSrc] = useState('') + const [pdfViewOPen, setPdfViewOPen] = useState(false) + + const [loading, setLoading] = useState(false) + + /** + * @description 文件下载 + * @param {String} params 文件fileId + */ + const download = (params) => { + let downloadLink = document.createElement("a"); + downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`; + downloadLink.download = `${params.fileName}`; + downloadLink.style.display = "none"; + // 将链接添加到页面中 + document.body.appendChild(downloadLink); + + // 模拟点击事件,开始下载 + downloadLink.click(); + } + /** + * @description 上传图片 + * @param {string} file 上传的文件 + */ + const fileChange = (info) => { + if (info.file.status === "done") { + setLoading(false); + } + if (info.file.status === "uploading") { + setLoading(true); + } + if (info.file.status === "error") { + message.error("文件上传失败") + setLoading(false); + } + let fileIds = info.fileList.map(file => { + return file.response?.data?.fileId + }) + setFileIds(fileIds) + setFileList(info.fileList) + } + /** + * @description pdf文件预览 + * @param {String} params 文件预览url + */ + const viewPdf = (params) => { + setIframeSrc(params) + setPdfViewOPen(true) + } + + + const onfinish = (values) => { + values.eventsDate = values.eventsDate ? moment(values.eventsDate).format("YYYY-MM-DD 00:00:00") : '' + let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId })) + if (mode === 'edit') { + values.files = oldFiles; + values.id = record.id; + onEdit(apiurl.rcgl.gcdsj.edit, values) + } + if (mode === 'save') { + values.files = oldFiles + onSave(apiurl.rcgl.gcdsj.save, values) + } + } + + /** + * @description 删除上传的图片 + * @param {string} id 删除的id + */ + const deleteFile = (fileId) => { + console.log(fileId); + let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId); + setFileList(filterFile) + } + useEffect(() => { + if (mode != 'save') { + const imgFile = record?.files?.map(o => ({ + name: o.fileName, + response: { + data: { + filePath: o.filePath, + fileId: o.fileId + } + }, + })) + setFileList(imgFile) + } + }, [record, mode]) + + + + return ( + <> +
+ + + + + + + + + + + + + + + + + + + dateString} + getValueProps={(value) => ({ value: value ? moment(value) : undefined })} + rules={[ + { + required: true, + }, + ]} + > + + + + + dateString} + getValueProps={(value) => ({ value: value ? moment(value) : undefined })} + rules={[ + { + required: true, + }, + ]} + > + + + + + + + + + {mode !== "view" && + { console.log(info.dataTransfer.files); }} + fileList={fileList} + disabled={loading} + // onSuccess={handleSuccess} + > +

点击或拖拽文件到此区域上传

+

+ 支持扩展名:.doc .docx .pdf .jpg .png .ppt +

+
+ } + + { + fileList.length > 0 && fileList.map(file => { + return ( + +
+
+ {file.name.indexOf('.docx') > -1 ? +
{ download(file.response?.data?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.name.indexOf('.pdf') > -1 ? +
{ viewPdf(file.response?.data?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.name.indexOf('.zip') > -1 ? +
{ download(file.response?.data?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.name.indexOf('.xlsx') > -1 ? +
{ download(file.response?.data?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ : + + } + {file.name} +
+
deleteFile(file.response?.data?.fileId)}> + +
+
+ + ) + }) + } +
+
+ +
+ { + mode === 'view' ? null : ( + <> + + + + + ) + } +
+ { + setPdfViewOPen(false) + }} + > +