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 6fbaef2bf..cb7511087 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 + } + }); } } @@ -208,22 +208,49 @@ export async function loadMenu(): Promise { ] }, { - id: id(), title: '培训管理', redirect: '/mgr/sz/pxgl/pxjhgl', + id: id(), title: '水政执法', redirect: '/mgr/sz/szzf/ajdj', children: [ { - id: id(), title: '培训计划管理', path: '/mgr/sz/pxgl/pxjhgl', + id: id(), title: '案件登记', path: '/mgr/sz/szzf/ajdj', }, { - id: id(), title: '培训记录管理', path: '/mgr/sz/pxgl/pxjlgl', + id: id(), title: '案件统计', path: '/mgr/sz/szzf/ajtj', }, + { + id: id(), title: '处理依据', path: '/mgr/sz/szzf/clyj', + } ] - } + }, + { + id: id(), title: '监督考核', redirect: '/mgr/sz/jdkh/khtj', + children: [ + { + id: id(), title: '考核统计', path: '/mgr/sz/jdkh/khtj', + }, + { + id: id(), title: '考核任务管理', path: '/mgr/sz/jdkh/khrwgl', + }, + { + id: id(), title: '考核问题整改', path: '/mgr/sz/jdkh/khwtzg', + }, + { + id: id(), title: '考核指标管理', path: '/mgr/sz/jdkh/khzbgl', + }, + { + id: id(), title: '考核模板管理', path: '/mgr/sz/jdkh/khmbgl', + } + ] + }, + { id: id(), title: '法律法规', path: '/mgr/sz/flfg' }, + { id: id(), title: '制度管理', path: '/mgr/sz/zdgl' }, + ] - }, - { id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb', + }, + { + 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: [ @@ -232,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: '抢险物料', @@ -246,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', @@ -302,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', @@ -310,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' }, ] }, { @@ -333,18 +362,21 @@ 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' }, ] }, @@ -366,7 +398,7 @@ export async function loadMenu(): Promise { ] }, - + // { id: id(), title: '基本情况', path: '/mgr/home', icon: 'jbqk' }, // { // id: id(), @@ -410,14 +442,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' }, - + // ] // }, // { @@ -430,10 +462,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' }, - + // ] // }, - + // ], // }, // { @@ -452,7 +484,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/service/apiurl.js b/src/service/apiurl.js index f2c47fe8c..924eccbc2 100644 --- a/src/service/apiurl.js +++ b/src/service/apiurl.js @@ -5,6 +5,7 @@ const pubapi_old = 'https://owrsvr.cloudowr.cn/svr' const pubapi = 'https://owrsvr.cloudowr.cn/pubapi' const zdkapi = 'https://slt-sh.chutianyun.gov.cn:8002' //中电科的市级平台 const service_fxdd = '/gunshiApp/tsg' +const service_xyt = '/gunshiApp/tsg'//登陆先用小玉潭 const service_shzh = '/shzh' const apiurl = { pxjh: { @@ -30,10 +31,10 @@ const apiurl = { setMenu: service_fxdd + '/visitMenuLog/insert', setPassword: service_fxdd + '/user/updateSecretKey', xytlogin: { - login: service_fxdd + '/login', - info: service_fxdd + '/getInfo', - router: service_fxdd + '/getRouters', - role: service_fxdd + '/system/menu/list' + login: service_xyt + '/login', + info: service_xyt + '/getInfo', + router: service_xyt + '/getRouters', + role: service_xyt + '/system/menu/list' }, // 基本情况 @@ -910,7 +911,155 @@ const apiurl = { weatherasin: service_fxdd + '/weather/basin', // 24小时流域统计 weatherArea: service_fxdd + '/weather/area', // 24小时区域统计 short: service_fxdd + '/weather/short/level ' // 短临预报量级统计 + }, + + + + //檀树岗 + // 全要素 + dataResourcesCenter: { + projectAndWater: { + shuikuBasicinfo: { + detail: service_fxdd + "/attResBase/list", + update: service_fxdd + "/attResBase/update", + getFile:service_fxdd + "/attResBase/file/get" + }, + kr: { + list: service_fxdd + "/stZvarlB/list", + save: service_fxdd + "/stZvarlB/insert", + update: service_fxdd + "/stZvarlB/update", + delete: service_fxdd + "/stZvarlB/del" + }, + xl: { + list: service_fxdd + "/stZqrlB/list", + save: service_fxdd + "/stZqrlB/insert", + update: service_fxdd + "/stZqrlB/update", + delete: service_fxdd + "/stZqrlB/del" + }, + mangerUnit: { + list: service_fxdd + "/resMangUnit/list", + update:service_fxdd + "/resMangUnit/update" + }, + zrtx: { + list: service_fxdd + "/resSafePersonB/list", + save: service_fxdd + "/resSafePersonB/insert", + update: service_fxdd + "/resSafePersonB/update", + delete:service_fxdd + "/resSafePersonB/del" + }, + monthLl: { + page: service_fxdd + "/resMonthEcoFlow/list", + update:service_fxdd + "/resMonthEcoFlow/updates" + }, + fxya: { + page: service_fxdd + "/resPlanB/list", + update: service_fxdd + "/resPlanB/update", + save: service_fxdd + "/resPlanB/insert", + delete:service_fxdd + "/resPlanB/del", + getFile:service_fxdd + "/resPlanB/file/get" + }, + sjtz: { + list: service_fxdd + "/attResBase/fileList", + upload: service_fxdd + "/attResBase/updateFile", + delete: service_fxdd + "/attResBase/del", + }, + projectPic: { + list: service_fxdd + "/resProjectImg/list", + save: service_fxdd + "/resProjectImg/insert", + delete:service_fxdd + "/resProjectImg/del" + }, + yhd: { + page: service_fxdd + '/attSpillwayBase/page', + save:service_fxdd + '/attSpillwayBase/insert', + update: service_fxdd + '/attSpillwayBase/update', + delete:service_fxdd + "/attSpillwayBase/del" + }, + db: { + page: service_fxdd + '/attDamBase/page', + save:service_fxdd + '/attDamBase/insert', + update: service_fxdd + '/attDamBase/update', + delete: service_fxdd + "/attDamBase/del", + getFile:service_fxdd + "/attDamBase/get" + }, + zf: { + page: service_fxdd + '/attGateValve/page', + save:service_fxdd + '/attGateValve/insert', + update: service_fxdd + '/attGateValve/update', + delete: service_fxdd + "/attGateValve/del", + getFile:service_fxdd + "/attGateValve/get" + + }, + lsy: { + page: service_fxdd + '/attMeaWeir/page', + save:service_fxdd + '/attMeaWeir/insert', + update: service_fxdd + '/attMeaWeir/update', + delete: service_fxdd + "/attMeaWeir/del", + list:service_fxdd+"/stAddvcdD/tree" + } + }, + basicData: { + jczd: { + page: service_fxdd + "/stStbprpB/page", + save: service_fxdd + "/stStbprpB/insert", + update: service_fxdd + "/stStbprpB/update", + delete: service_fxdd + "/stStbprpB/del" + }, + dmgl: { + page: service_fxdd + "/attDamProfile/page", + update: service_fxdd + "/attDamProfile/update", + save: service_fxdd + "/attDamProfile/insert", + delete: service_fxdd + "/attDamProfile/del", + getFile: service_fxdd + "/attDamProfile/file/get" + }, + sysbgl: { + page: service_fxdd + "/osmoticPressDevice/page", + update: service_fxdd + "/osmoticPressDevice/update", + save: service_fxdd + "/osmoticPressDevice/insert", + delete: service_fxdd + "/osmoticPressDevice/del", + list:service_fxdd + "/osmoticPressDevice/list" + }, + slsbgl: { + page: service_fxdd + "/osmoticFlowDevice/page", + update: service_fxdd + "/osmoticFlowDevice/update", + save: service_fxdd + "/osmoticFlowDevice/insert", + delete: service_fxdd + "/osmoticFlowDevice/del", + list:service_fxdd + "/osmoticFlowDevice/list" + }, + sjzd: { + page: service_fxdd + "/sysDictB/page", + update: service_fxdd + "/sysDictB/update", + save: service_fxdd + "/sysDictB/insert", + delete: service_fxdd + "/sysDictB/del", + }, + spjbxx: { + page: service_fxdd + "/attCctvBase/page", + update: service_fxdd + "/attCctvBase/update", + save: service_fxdd + "/attCctvBase/insert", + delete: service_fxdd + "/attCctvBase/del", + tree: service_fxdd + "/cctvBMenu/tree", + saveTree: service_fxdd + "/cctvBMenu/insert", + editTree: service_fxdd + "/cctvBMenu/update", + deleteTree: service_fxdd + "/cctvBMenu/del" + } + }, + dygxb: { + zfysxt: { + page: service_fxdd + "/gateValveCctvRel/page", + save: service_fxdd + "/gateValveCctvRel/insert", + update: service_fxdd + "/gateValveCctvRel/update", + delete: service_fxdd + "/gateValveCctvRel/del", + zflist: service_fxdd + "/attGateValve/list", + splist:service_fxdd + "/attCctvBase/list" + } + } + }, + + // 全周期 + gcdsj:{ + qzqda:{ + list:service_fxdd + '/projectEvents/doc/page' + } } + } export default apiurl diff --git a/src/views/AppRouters.tsx b/src/views/AppRouters.tsx index d66c09ad7..637da7a11 100644 --- a/src/views/AppRouters.tsx +++ b/src/views/AppRouters.tsx @@ -89,7 +89,7 @@ import Gcdsj from './sq/qzq/gcdsj' import Sksq from './sq/qth/sksq' import Hdsq from './sq/qth/hdsq' import Ssyq from './sq/qth/ssyq' - +import Qzqda from './sq/qzq/qzqda' // import Zcdjxx from './sq/qys/' // import Zcdjxx from './sq/qfg/zcdjxx' // import Zcdjxx from './sq/qfg/zcdjxx' @@ -100,6 +100,12 @@ import Zzjgck from './sz/zzjgck' import Zrrgl from './sz/zrrgl' import Pxjhgl from './sz/pxjhgl' import Pxjlgl from './sz/pxjlgl' +import Flfg from './sz/flfg' +import Zdgl from './sz/zdgl' +import Ajdj from './sz/szzf/ajdj' +import Ajtj from './sz/szzf/ajtj' +import Clyj from './sz/szzf/clyj' + const HomePage = lazy(() => import('./Home')) @@ -242,12 +248,20 @@ const AppRouters: React.FC = () => { { path: 'sq/qys/kqys', element: }, { path: 'sq/qys/xyys', element: }, { path: 'sq/qys/gcys', element: }, - { path: 'sq/qzq/Gcdsj', element: }, + { path: 'sq/qzq/gcdsj', element: }, + { path: 'sq/qys/qzqda', element: }, + // 四制-组织机构查看 { path: 'sz/gltx/zzjgck', element: }, { path: 'sz/gltx/zrrgl', element: }, { path: 'sz/pxgl/pxjhgl', element: }, { path: 'sz/pxgl/pxjlgl', 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/gcys/projectBasicInfo/index.js b/src/views/sq/qys/gcys/projectBasicInfo/index.js index e72367acd..7cd1e069e 100644 --- a/src/views/sq/qys/gcys/projectBasicInfo/index.js +++ b/src/views/sq/qys/gcys/projectBasicInfo/index.js @@ -45,7 +45,9 @@ export default function ProjectBasciInfo() { const getData = async () => { try { + const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.detail) + // debugger; if (res.code == 200) { form.setFieldsValue(res.data[0]) setData(res.data[0]) diff --git a/src/views/sq/qys/kqys/index.js b/src/views/sq/qys/kqys/index.js index 7f11d3563..03526a7a4 100644 --- a/src/views/sq/qys/kqys/index.js +++ b/src/views/sq/qys/kqys/index.js @@ -4,27 +4,72 @@ 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 { useState } from "react" -const list=[ - {name:'水库地理位置图',key:1,img:qys1}, - {name:'水库平面布置图',key:2,img:qys2}, - {name:'主坝平面布置图',key:3,img:qys3}, - {name:'副坝平面布置图',key:4,img:qys4}, +import stylesCss from './index.module.less' + +import { Rnd } from "react-rnd" +import { useState, useEffect } from "react" +const list = [ + { name: '水库地理位置图', key: 1, img: qys1 }, + { name: '水库平面布置图', key: 2, img: qys2 }, + { name: '主坝平面布置图', key: 3, img: qys3 }, + { name: '副坝平面布置图', key: 4, img: qys4 }, ] const Page = () => { - const [url,setUrl] = useState(qys1) - const tabClick =(item)=>{ + const [url, setUrl] = useState(qys1) + const tabClick = (item) => { setUrl(item.img) } + useEffect(() => { + let scale = 1 + const img = document.getElementById("img"); + const fun = (e) => { + console.log(1111) + // 大于0:滚轮向上滚动 小于0:滚轮向下滚动 + if (e.wheelDelta > 0) { + scale += 0.05; + img.style.transform = `scale(${scale})`; + } else { + if (scale == 1) { + img.style.left = 0 + "px"; + img.style.top = 0 + "px"; + } + // 缩放值大于1时,可以缩小,反之亦然 + if (scale > 1) { + scale -= 0.05; + img.style.transform = `scale(${scale})`; + } + } + } + img.addEventListener("wheel", fun) + + // getSyData() + // getSlData() + // getWyData() + // getDmData() + return () => { + img.removeEventListener("wheel", fun) + } + + }, []) return (
-
- {list.map(item=>
tabClick(item)}>{item.name}
)} +
+ {list.map(item =>
tabClick(item)}>{item.name}
)}
-
- + +
+ + +
+
) } diff --git a/src/views/sq/qys/kqys/index.less b/src/views/sq/qys/kqys/index.less deleted file mode 100644 index 1b2a0c4ee..000000000 --- a/src/views/sq/qys/kqys/index.less +++ /dev/null @@ -1,47 +0,0 @@ -.tabCheck{ - border-width: 0px; - width: 125px; - height: 36px; - background: inherit; - background-color: rgba(215, 223, 235, 1); - box-sizing: border-box; - border-width: 1px; - border-style: solid; - border-color: rgba(228, 231, 237, 1); - border-radius: 10px; - border-bottom-right-radius: 0px; - border-bottom-left-radius: 0px; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - font-size: 14px; - color: #303133; - margin: 10px 0; - text-align: center; - line-height: 36px; - -} -.active{ - width: 125px; - height: 36px; - background: inherit; - background-color: rgba(255, 255, 255, 1); - box-sizing: border-box; - border-width: 1px; - border-style: solid; - border-color: rgba(228, 231, 237, 1); - border-bottom: 0px; - border-radius: 10px; - border-bottom-right-radius: 0px; - border-bottom-left-radius: 0px; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - font-size: 14px; - color: #303133; - margin: 10px 0; - text-align: center; - line-height: 36px; - - -} \ No newline at end of file diff --git a/src/views/sq/qys/kqys/index.module.less b/src/views/sq/qys/kqys/index.module.less new file mode 100644 index 000000000..c3d7533ca --- /dev/null +++ b/src/views/sq/qys/kqys/index.module.less @@ -0,0 +1,54 @@ +.tabCheck{ + width: 120px; + height: 40px; + line-height: 40px; + margin-right: 5px; + border-radius: 10px 10px 0 0; + background: #D7DFEB; + border: 1px solid rgba(228, 231, 237, 1); + text-align: center; + font-size: 14px; + font-weight: 500; + color: #333; + cursor: pointer; + + +} +.active{ + width: 120px; + height: 40px; + line-height: 40px; + margin-right: 5px; + border-radius: 10px 10px 0 0; + background: #D7DFEB; + border: 1px solid rgba(228, 231, 237, 1); + text-align: center; + font-size: 14px; + font-weight: 500; + color: #333; + cursor: pointer; + + color: #409EFF; + background: #ffffff; + + +} + +// .fxdd_hsybjs_toolbar_item{ +// width: 120px; +// height: 40px; +// line-height: 40px; +// margin-right: 5px; +// border-radius: 10px 10px 0 0; +// background: #D7DFEB; +// border: 1px solid rgba(228, 231, 237, 1); +// text-align: center; +// font-size: 14px; +// font-weight: 500; +// color: #333; +// cursor: pointer; +// } +// .hsybjs_checked{ +// color: #409EFF; +// background: #ffffff; +// } \ No newline at end of file diff --git a/src/views/sq/qys/xyys/index.js b/src/views/sq/qys/xyys/index.js index 43c04f9d3..12a5bbaa7 100644 --- a/src/views/sq/qys/xyys/index.js +++ b/src/views/sq/qys/xyys/index.js @@ -6,7 +6,7 @@ import './index.less' const Page = () => { return (
-
+
保护对象
@@ -16,7 +16,7 @@ const Page = () => {
-
+
转移路线示意图
diff --git a/src/views/sq/qzq/gcdsj/toolbar.js b/src/views/sq/qzq/gcdsj/toolbar.js index 8cead5b04..e8f1fd24d 100644 --- a/src/views/sq/qzq/gcdsj/toolbar.js +++ b/src/views/sq/qzq/gcdsj/toolbar.js @@ -44,7 +44,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => { { - (onSave && addBtn) ? + (onSave) ? diff --git a/src/views/sq/qzq/qzqda/index.js b/src/views/sq/qzq/qzqda/index.js new file mode 100644 index 000000000..e314c5d7a --- /dev/null +++ b/src/views/sq/qzq/qzqda/index.js @@ -0,0 +1,153 @@ +import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react'; +import BasicCrudModal from '../../../../components/crud/BasicCrudModal'; +import { Table, Card, Modal, Form, Input, Button, Row,Col, Timeline, message, Tabs,Image } from 'antd'; +import {FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons'; +import { useSelector } from 'react-redux'; +import ToolBar from './toolbar'; +import apiurl from '../../../../service/apiurl'; +import usePageTable from '../../../../components/crud/usePageTable2'; +import { createCrudService } from '../../../../components/crud/_'; +import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender'; +import './index.less' + +const url = "http://223.75.53.141:9102/test.by-lyf.tmp" +const Page = () => { + const role = useSelector(state => state.auth.role); + const editBtn = role?.rule?.find(item => item.menuName == "编辑"); + const viewBtn = role?.rule?.find(item => item.menuName == "查看"); + const delBtn = role?.rule?.find(item => item.menuName == "删除"); + const refModal = useRef(); + const [searchVal, setSearchVal] = useState(false) + const [isFetch, setIsFetch] = useState(false) + + const command = (type) => (params) => { + if (type === 'save') { + refModal.current.showSave(); + } else if (type === 'edit') { + refModal.current.showEdit({ ...params }); + } else if (type === 'view') { + refModal.current.showView(params); + } else if (type === 'del') { + refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`); + } + } + + const download = (params) => { + let downloadLink = document.createElement("a"); + downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`; + downloadLink.download = `${params.fileName}`; + downloadLink.style.display = "none"; + // 将链接添加到页面中 + document.body.appendChild(downloadLink); + + // 模拟点击事件,开始下载 + downloadLink.click(); + } + + const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.gcdsj.qzqda.list).find_noCode); + + + +const viewPdf = (params) => { +// setIframeSrc(params) +// setPdfViewOPen(true) +} + useEffect(()=>{ + const params = { + search: { + ...searchVal, + } + }; + search(params) + }, [searchVal]) + + + return ( + <> +
+
+ + + +
+
+ + {tableProps.dataSource?.map((item, index) => ( + +
+ {item.eventsDate} +
+ {item.eventsDesc} +
+ 附件: + + { + item.files?.length > 0 && item.files?.map(file => { + return ( + +
+
+ {file.fileName?.indexOf('.docx') > -1 ? +
{ download(file.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.fileName?.indexOf('.pdf') > -1 ? +
{ viewPdf(file?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.fileName?.indexOf('.zip') > -1 ? +
{ download(file?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.fileName?.indexOf('.xlsx') > -1 ? +
{ download(file?.fileId) }} + style={{ cursor: 'pointer' }} + > + +
+ : + + } + {file.fileName} +
+
+ + ) + }) + } +
+
+
+
+
+ ))} +
+
+
+
+
+ + + ); +} + +export default Page; diff --git a/src/views/sq/qzq/qzqda/index.less b/src/views/sq/qzq/qzqda/index.less new file mode 100644 index 000000000..a578e119b --- /dev/null +++ b/src/views/sq/qzq/qzqda/index.less @@ -0,0 +1,34 @@ +.basic-info{ + position: relative; + font-size: 16px; + margin-bottom: 20px; + padding:5px 25px; + border-bottom: 1px solid #eee; + &::before{ + position: absolute; + top:8px; + left:0; + content: ""; + display: block; + width: 5px; + height: 20px; + background-color: #0079fe; + } +} +.time-line{ + width: 50%; + margin-left: 6%; + margin-top: 1%; + .time-line-item{ + display: flex; + // align-items: center; + column-gap: 20px; + .item-right{ + flex:1; + display: flex; + flex-direction: column; + justify-content: space-between; + height: 70px; + } + } +} \ No newline at end of file diff --git a/src/views/sq/qzq/qzqda/toolbar.js b/src/views/sq/qzq/qzqda/toolbar.js new file mode 100644 index 000000000..3205c0ba2 --- /dev/null +++ b/src/views/sq/qzq/qzqda/toolbar.js @@ -0,0 +1,55 @@ +import React, { useEffect, useState } from 'react'; +import { Form, Input, Button, DatePicker } from 'antd'; + +import moment from 'moment'; +const { RangePicker } = DatePicker; +const ToolBar = ({ setSearchVal, onSave, storeData, role }) => { + const addBtn = role?.rule?.find(item => item.menuName == "新增"); + const searchBtn = role?.rule?.find(item => item.menuName == "查询"); + const [form] = Form.useForm(); + + const onFinish = (values) => { + let dataSo; + if (values.tm) { + dataSo = { + start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'), + end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss') + } + } + delete values.tm + setSearchVal({ ...values, dataSo }); + } + + + return ( + <> +
+
+ + + + + + + {searchBtn ? + + : null} + + + + + + + +
+
+ + ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/views/sz/flfg/form.js b/src/views/sz/flfg/form.js new file mode 100644 index 000000000..097d8536a --- /dev/null +++ b/src/views/sz/flfg/form.js @@ -0,0 +1,308 @@ +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 NormalSelect from '../../../components/Form/NormalSelect'; + +// import "./index.less" +import moment from 'moment'; +const { RangePicker } = DatePicker +const { Dragger } = Upload; +const url = "http://223.75.53.141:9102/test.by-lyf.tmp" + +const 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) + }} + > +