From 35c7b464096abadc1fbd8ff4c7e87c838e159723 Mon Sep 17 00:00:00 2001 From: lishenfeng Date: Thu, 13 Feb 2025 17:56:55 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E6=B5=8B=E7=AB=99=E5=AF=BC=E6=8A=A5?= =?UTF-8?q?=E7=8E=87=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 2 +- src/components/Crud/_.js | 22 +++- src/components/Crud/usePageTable.js | 2 +- src/config/index.js | 4 +- src/models/apiurl.js | 1 + src/models/session/index.js | 173 ++++++++++++++-------------- src/routes.js | 2 + src/views/Ptjs/Czdbl/dblOption.js | 14 +-- src/views/Ptjs/Czdbl/index.js | 72 ++++++++---- src/views/Ptjs/Czdbl/qsOption.js | 67 +++++++++-- src/views/Ptjs/Zysy/form.js | 59 ++++++++++ src/views/Ptjs/Zysy/index.js | 87 ++++++++++++++ src/views/Ptjs/Zysy/toolbar.js | 41 +++++++ 13 files changed, 415 insertions(+), 131 deletions(-) create mode 100644 src/views/Ptjs/Zysy/form.js create mode 100644 src/views/Ptjs/Zysy/index.js create mode 100644 src/views/Ptjs/Zysy/toolbar.js diff --git a/public/index.html b/public/index.html index 97b2f57..4616cd6 100644 --- a/public/index.html +++ b/public/index.html @@ -24,7 +24,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - 复核系统 + 平台监视 diff --git a/src/components/Crud/_.js b/src/components/Crud/_.js index 0d71f43..7640795 100644 --- a/src/components/Crud/_.js +++ b/src/components/Crud/_.js @@ -25,7 +25,7 @@ export async function findPage1(url, params = {}, type = 'post') { const myParams = { pageNumber, pageSize, - adcd:user.adcd, + adcd:user?.adcd, ...search } const result = type == 'post'?await httppost(url, myParams):await httpget(url, myParams); @@ -39,6 +39,26 @@ export async function findPage1(url, params = {}, type = 'post') { return {list: [], totalRow: 0}; } +export async function findPage2(url, params = {}, type = 'post') { + const user = JSON.parse(sessionStorage.getItem('user')) + const {pageNumber, pageSize, sort, search} = params; + const myParams = { + pageNumber, + pageSize, + adcd:user?.adcd, + ...search + } + const result = type == 'post'?await httppost(url, params):await httpget(url, params); + if (result && result.data) { + const {data} = result; + return { + list: data.records??data, + totalRow: data.total + }; + } + return {list: [], totalRow: 0}; +} + export async function xyt_paginate_noCode(url, params = {}) { const {pageNumber, pageSize, ...ret} = params; const pam = { diff --git a/src/components/Crud/usePageTable.js b/src/components/Crud/usePageTable.js index 0000f40..d801c24 100644 --- a/src/components/Crud/usePageTable.js +++ b/src/components/Crud/usePageTable.js @@ -23,7 +23,7 @@ const usePageTable = (service,service2, { defaultParams, defaultPageSize, defaul // return () => { abort.current = true; } // }, []); - const search = async(opt) => { + const search = async (opt) => { opt = opt || {}; setState(s => ({ ...s, loading: true })); const pageParams = { diff --git a/src/config/index.js b/src/config/index.js index 0b75c0f..7050fd8 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -1,6 +1,6 @@ const config = { - title: '湖北省山洪灾害数据复核系统', - shorttitle: '湖北省山洪灾害数据复核系统', + title: '湖北省山洪防治灾害', + shorttitle: '湖北省山洪防治灾害', }; export default config; \ No newline at end of file diff --git a/src/models/apiurl.js b/src/models/apiurl.js index 57f5e11..b0cad56 100644 --- a/src/models/apiurl.js +++ b/src/models/apiurl.js @@ -23,6 +23,7 @@ const jsapi = { ptjs: { czrz: shengUrlPro + '/prod-api/baseplat-system/operlog/hb/list', czdbl: guishiPro + '/monitor/summary', + resource:guishiPro + '/resource/page', treeList:shengUrlPro + "/prod-api/baseplat-basic/hb/village/getChild/" }, diff --git a/src/models/session/index.js b/src/models/session/index.js index ce88c74..b8ee523 100644 --- a/src/models/session/index.js +++ b/src/models/session/index.js @@ -181,99 +181,100 @@ const session = { //根据权限判断应该展示哪些菜单 const myMenu = [ // { id: 100, path: "/home", parent_id: -1, name: "首页", type: 0, order: 1 }, - { - id: 201, redirect: "/xzqh/xzqhbg", parent_id: -1, name: "行政区划", type: 1, order: 1, children: [ - { id: 202, path: "/xzqh/xzqhbg", parent_id: 500, name: "行政区划变更", type: 0, order: 1,disadlevel:[0,1] }, - { id: 203, path: "/xzqh/yhjmwh", parent_id: 500, name: "沿河居民维护", type: 0, order: 1, }, - { id: 204, path: "/xzqh/xzqhcx", parent_id: 500, name: "行政区划查询", type: 0, order: 1, }, - ] - }, - { - id: 301, redirect: "/yagl/yabg", parent_id: -1, name: "预案管理", type: 1, order: 1, children: [ - { id: 302, path: "/yagl/yabg", parent_id: 500, name: "预案变更", type: 0, order: 1 }, - { id: 303, path: "/yagl/yatjcx", parent_id: 500, name: "预案查询", type: 0, order: 1 }, - { id: 304, path: "/yagl/yatjtj", parent_id: 500, name: "预案统计", type: 0, order: 1 }, - ] - }, - { - id: 401, redirect: "/fyzrr/zrrbg", parent_id: -1, name: "防御责任人", type: 1, order: 1, children: [ - { id: 402, path: "/fyzrr/zrrbg", parent_id: 500, name: "防御责任人变更", type: 0, order: 1,disadlevel:[0,1] }, - { id: 403, path: "/fyzrr/zrrcx", parent_id: 500, name: "防御责任人查询", type: 0, order: 1, }, - ] - }, - { - id: 501, redirect: "/jczd/zdbg", parent_id: -1, name: "监测站点", type: 1, order: 1, children: [ - { id: 502, path: "/jczd/zdbg", parent_id: 500, name: "自动监测站点变更", type: 0, order: 1,disadlevel:[0,1] }, - { id: 503, path: "/jczd/zdsp", parent_id: 500, name: "自动监测站点复核审批", type: 0, order: 1,disadlevel:[0,2,3,4,5] }, - { id: 504, path: "/jczd/zdcx", parent_id: 500, name: "自动监测站点查询", type: 0, order: 1 }, - ] - }, - { - id: 601, redirect: "/wxq/wxqbg", parent_id: -1, name: "危险区", type: 1, order: 1, children: [ - { id: 602, path: "/wxq/wxqbg", parent_id: 500, name: "危险区变更", type: 0, order: 1,disadlevel:[0,1] }, - { id: 603, path: "/wxq/wxqsp", parent_id: 500, name: "危险区复核审批", type: 0, order: 1,disadlevel:[0,2,3,4,5] }, - { id: 604, path: "/wxq/wxqcx", parent_id: 500, name: "危险区查询", type: 0, order: 1 }, + // { + // id: 201, redirect: "/xzqh/xzqhbg", parent_id: -1, name: "行政区划", type: 1, order: 1, children: [ + // { id: 202, path: "/xzqh/xzqhbg", parent_id: 500, name: "行政区划变更", type: 0, order: 1,disadlevel:[0,1] }, + // { id: 203, path: "/xzqh/yhjmwh", parent_id: 500, name: "沿河居民维护", type: 0, order: 1, }, + // { id: 204, path: "/xzqh/xzqhcx", parent_id: 500, name: "行政区划查询", type: 0, order: 1, }, + // ] + // }, + // { + // id: 301, redirect: "/yagl/yabg", parent_id: -1, name: "预案管理", type: 1, order: 1, children: [ + // { id: 302, path: "/yagl/yabg", parent_id: 500, name: "预案变更", type: 0, order: 1 }, + // { id: 303, path: "/yagl/yatjcx", parent_id: 500, name: "预案查询", type: 0, order: 1 }, + // { id: 304, path: "/yagl/yatjtj", parent_id: 500, name: "预案统计", type: 0, order: 1 }, + // ] + // }, + // { + // id: 401, redirect: "/fyzrr/zrrbg", parent_id: -1, name: "防御责任人", type: 1, order: 1, children: [ + // { id: 402, path: "/fyzrr/zrrbg", parent_id: 500, name: "防御责任人变更", type: 0, order: 1,disadlevel:[0,1] }, + // { id: 403, path: "/fyzrr/zrrcx", parent_id: 500, name: "防御责任人查询", type: 0, order: 1, }, + // ] + // }, + // { + // id: 501, redirect: "/jczd/zdbg", parent_id: -1, name: "监测站点", type: 1, order: 1, children: [ + // { id: 502, path: "/jczd/zdbg", parent_id: 500, name: "自动监测站点变更", type: 0, order: 1,disadlevel:[0,1] }, + // { id: 503, path: "/jczd/zdsp", parent_id: 500, name: "自动监测站点复核审批", type: 0, order: 1,disadlevel:[0,2,3,4,5] }, + // { id: 504, path: "/jczd/zdcx", parent_id: 500, name: "自动监测站点查询", type: 0, order: 1 }, + // ] + // }, + // { + // id: 601, redirect: "/wxq/wxqbg", parent_id: -1, name: "危险区", type: 1, order: 1, children: [ + // { id: 602, path: "/wxq/wxqbg", parent_id: 500, name: "危险区变更", type: 0, order: 1,disadlevel:[0,1] }, + // { id: 603, path: "/wxq/wxqsp", parent_id: 500, name: "危险区复核审批", type: 0, order: 1,disadlevel:[0,2,3,4,5] }, + // { id: 604, path: "/wxq/wxqcx", parent_id: 500, name: "危险区查询", type: 0, order: 1 }, - ] - }, - { - id: 701, redirect: "/fzc/fzccx", parent_id: -1, name: "防治村", type: 1, order: 1, children: [ - { id: 702, path: "/fzc/fzccx", parent_id: 500, name: "防治村查询", type: 0, order: 1 }, - ] - }, + // ] + // }, + // { + // id: 701, redirect: "/fzc/fzccx", parent_id: -1, name: "防治村", type: 1, order: 1, children: [ + // { id: 702, path: "/fzc/fzccx", parent_id: 500, name: "防治村查询", type: 0, order: 1 }, + // ] + // }, - { - id: 801, redirect: "/Yjyz/Bg", parent_id: -1, name: "预警阈值", type: 1, order: 1, children: [ - { id: 802, path: "/Yjyz/Bg", parent_id: 500, name: "预警阈值变更", type: 0, order: 1,disadlevel:[0,1] }, - { id: 803, path: "/Yjyz/Sp", parent_id: 500, name: "预警阈值复核审批", type: 0, order: 1,disadlevel:[0,2,3,4,5] }, - { id: 804, path: "/Yjyz/Cx", parent_id: 500, name: "预警阈值查询", type: 0, order: 1 }, - ] - }, - { - id: 901, redirect: "/Yjgx/Bg", parent_id: -1, name: "预警关系", type: 1, order: 1, children: [ - { id: 902, path: "/Yjgx/Bg", parent_id: 500, name: "预警对象与测站关系变更", type: 0, order: 1,disadlevel:[0,1] }, - { id: 904, path: "/Yjgx/Sp", parent_id: 500, name: "预警对象与测站关系变更审批", type: 0, order: 1 ,disadlevel:[0,2,3,4,5]}, - { id: 903, path: "/Yjgx/Cx", parent_id: 500, name: "预警对象与测站关系查询", type: 0, order: 1 }, - ] - }, - { - id: 101, redirect: "/Xly/Bg", parent_id: -1, name: "小流域", type: 1, order: 1, children: [ - { id: 102, path: "/Xly/Bg", parent_id: 500, name: "小流域变更", type: 0, order: 1, }, - { id: 103, path: "/Xly/Bdgx", parent_id: 500, name: "小流域与行政区关系变更", type: 0, order: 1 ,}, - { id: 104, path: "/Xly/Cgbb", parent_id: 500, name: "成果报表", type: 0, order: 1 , children:[ - { id: 105, path: "/Xly/Cgbb/Fzdx", parent_id: 500, name: "防治对象", type: 0, order: 1 }, - { id: 106, path: "/Xly/Cgbb/Dccg2", parent_id: 500, name: "跨沟调查成果", type: 0, order: 1 }, - { id: 107, path: "/Xly/Cgbb/Dccg3", parent_id: 500, name: "沟滩占地情况", type: 0, order: 1 }, - // { id: 108, path: "/Xly/Cgbb/Dccg4", parent_id: 500, name: "外洪顶托集镇及村落", type: 0, order: 1 }, - { id: 109, path: "/Xly/Cgbb/Dccg5", parent_id: 500, name: "重点关注对象", type: 0, order: 1 }, - { id: 110, path: "/Xly/Cgbb/Fwjg", parent_id: 500, name: "房屋结构", type: 0, order: 1 }, - { id: 111, path: "/Xly/Cgbb/Wxdj", parent_id: 500, name: "危险地建", type: 0, order: 1 }, - { id: 112, path: "/Xly/Cgbb/Yhd", parent_id: 500, name: "隐患点名录", type: 0, order: 1 }, - { id: 113, path: "/Xly/Cgbb/Hsxc", parent_id: 500, name: "历史山洪灾害现场", type: 0, order: 1 }, - { id: 114, path: "/Xly/Cgbb/RelativeFzdx", parent_id: 500, name: "防治对象关联站点", type: 0, order: 1 }, - { id: 115, path: "/Xly/Cgbb/Hjm", parent_id: 500, name: "后河小流域横断面", type: 0, order: 1 }, - { id: 116, path: "/Xly/Cgbb/Zjm", parent_id: 500, name: "后河小流域纵断面", type: 0, order: 1 }, - { id: 117, path: "/Xly/Cgbb/Wjsc", parent_id: 500, name: "文件上传", type: 0, order: 1 }, - ]}, - ] - }, - { - id: 111, redirect: "/fhrz/xzqh", parent_id: -1, name: "复核日志", type: 1, order: 1, children: [ - { id: 112, path: "/fhrz/xzqh", parent_id: 500, name: "行政区划", type: 0, order: 1 }, - { id: 113, path: "/fhrz/yhjm", parent_id: 500, name: "沿河居民户", type: 0, order: 1 }, - { id: 114, path: "/fhrz/yuan", parent_id: 500, name: "预案", type: 0, order: 1 }, - { id: 115, path: "/fhrz/fyzrr", parent_id: 500, name: "防御责任人", type: 0, order: 1 }, - { id: 116, path: "/fhrz/jczd", parent_id: 500, name: "监测站点", type: 0, order: 1 }, - { id: 117, path: "/fhrz/wxq", parent_id: 500, name: "危险区", type: 0, order: 1 }, - { id: 118, path: "/fhrz/yjyz", parent_id: 500, name: "预警阈值", type: 0, order: 1 }, - { id: 119, path: "/fhrz/yjgx", parent_id: 500, name: "预警关系", type: 0, order: 1 }, - ] - }, + // { + // id: 801, redirect: "/Yjyz/Bg", parent_id: -1, name: "预警阈值", type: 1, order: 1, children: [ + // { id: 802, path: "/Yjyz/Bg", parent_id: 500, name: "预警阈值变更", type: 0, order: 1,disadlevel:[0,1] }, + // { id: 803, path: "/Yjyz/Sp", parent_id: 500, name: "预警阈值复核审批", type: 0, order: 1,disadlevel:[0,2,3,4,5] }, + // { id: 804, path: "/Yjyz/Cx", parent_id: 500, name: "预警阈值查询", type: 0, order: 1 }, + // ] + // }, + // { + // id: 901, redirect: "/Yjgx/Bg", parent_id: -1, name: "预警关系", type: 1, order: 1, children: [ + // { id: 902, path: "/Yjgx/Bg", parent_id: 500, name: "预警对象与测站关系变更", type: 0, order: 1,disadlevel:[0,1] }, + // { id: 904, path: "/Yjgx/Sp", parent_id: 500, name: "预警对象与测站关系变更审批", type: 0, order: 1 ,disadlevel:[0,2,3,4,5]}, + // { id: 903, path: "/Yjgx/Cx", parent_id: 500, name: "预警对象与测站关系查询", type: 0, order: 1 }, + // ] + // }, + // { + // id: 101, redirect: "/Xly/Bg", parent_id: -1, name: "小流域", type: 1, order: 1, children: [ + // { id: 102, path: "/Xly/Bg", parent_id: 500, name: "小流域变更", type: 0, order: 1, }, + // { id: 103, path: "/Xly/Bdgx", parent_id: 500, name: "小流域与行政区关系变更", type: 0, order: 1 ,}, + // { id: 104, path: "/Xly/Cgbb", parent_id: 500, name: "成果报表", type: 0, order: 1 , children:[ + // { id: 105, path: "/Xly/Cgbb/Fzdx", parent_id: 500, name: "防治对象", type: 0, order: 1 }, + // { id: 106, path: "/Xly/Cgbb/Dccg2", parent_id: 500, name: "跨沟调查成果", type: 0, order: 1 }, + // { id: 107, path: "/Xly/Cgbb/Dccg3", parent_id: 500, name: "沟滩占地情况", type: 0, order: 1 }, + // // { id: 108, path: "/Xly/Cgbb/Dccg4", parent_id: 500, name: "外洪顶托集镇及村落", type: 0, order: 1 }, + // { id: 109, path: "/Xly/Cgbb/Dccg5", parent_id: 500, name: "重点关注对象", type: 0, order: 1 }, + // { id: 110, path: "/Xly/Cgbb/Fwjg", parent_id: 500, name: "房屋结构", type: 0, order: 1 }, + // { id: 111, path: "/Xly/Cgbb/Wxdj", parent_id: 500, name: "危险地建", type: 0, order: 1 }, + // { id: 112, path: "/Xly/Cgbb/Yhd", parent_id: 500, name: "隐患点名录", type: 0, order: 1 }, + // { id: 113, path: "/Xly/Cgbb/Hsxc", parent_id: 500, name: "历史山洪灾害现场", type: 0, order: 1 }, + // { id: 114, path: "/Xly/Cgbb/RelativeFzdx", parent_id: 500, name: "防治对象关联站点", type: 0, order: 1 }, + // { id: 115, path: "/Xly/Cgbb/Hjm", parent_id: 500, name: "后河小流域横断面", type: 0, order: 1 }, + // { id: 116, path: "/Xly/Cgbb/Zjm", parent_id: 500, name: "后河小流域纵断面", type: 0, order: 1 }, + // { id: 117, path: "/Xly/Cgbb/Wjsc", parent_id: 500, name: "文件上传", type: 0, order: 1 }, + // ]}, + // ] + // }, + // { + // id: 111, redirect: "/fhrz/xzqh", parent_id: -1, name: "复核日志", type: 1, order: 1, children: [ + // { id: 112, path: "/fhrz/xzqh", parent_id: 500, name: "行政区划", type: 0, order: 1 }, + // { id: 113, path: "/fhrz/yhjm", parent_id: 500, name: "沿河居民户", type: 0, order: 1 }, + // { id: 114, path: "/fhrz/yuan", parent_id: 500, name: "预案", type: 0, order: 1 }, + // { id: 115, path: "/fhrz/fyzrr", parent_id: 500, name: "防御责任人", type: 0, order: 1 }, + // { id: 116, path: "/fhrz/jczd", parent_id: 500, name: "监测站点", type: 0, order: 1 }, + // { id: 117, path: "/fhrz/wxq", parent_id: 500, name: "危险区", type: 0, order: 1 }, + // { id: 118, path: "/fhrz/yjyz", parent_id: 500, name: "预警阈值", type: 0, order: 1 }, + // { id: 119, path: "/fhrz/yjgx", parent_id: 500, name: "预警关系", type: 0, order: 1 }, + // ] + // }, { id:121, redirect: "/ptjs/czrz", parent_id: -1, name: "平台监视", type: 1, order: 1, children: [ { id: 402, path: "/ptjs/czrz", parent_id: 500, name: "操作日志", type: 0, order: 1}, { id: 403, path: "/ptjs/czdbl", parent_id: 500, name: "测站到报率", type: 0, order: 1}, + { id: 404, path: "/ptjs/zysy", parent_id: 500, name: "资源使用", type: 0, order: 1}, ] }, diff --git a/src/routes.js b/src/routes.js index 979af53..fe55fe3 100644 --- a/src/routes.js +++ b/src/routes.js @@ -44,6 +44,8 @@ const routes = [ // 测站到报率 { path: '/ptjs/czdbl', exact: true, component: lazy(() => import('./views/Ptjs/Czdbl')) }, + // 资源使用 + { path: '/ptjs/zysy', exact: true, component: lazy(() => import('./views/Ptjs/Zysy')) }, //监测站点 { path: '/jczd/zdbg', exact: true, component: lazy(() => import('./views/Jczd/Bg')) }, { path: '/jczd/zdsp', exact: true, component: lazy(() => import('./views/Jczd/Sp')) }, diff --git a/src/views/Ptjs/Czdbl/dblOption.js b/src/views/Ptjs/Czdbl/dblOption.js index afaebab..b234666 100644 --- a/src/views/Ptjs/Czdbl/dblOption.js +++ b/src/views/Ptjs/Czdbl/dblOption.js @@ -28,13 +28,13 @@ export default function dblOption(sellist,selday) { } return { - title: { - text: '日到报率详情', - textStyle: { - fontSize: 16 - }, - left: 'center' - }, + // title: { + // text: '日到报率详情', + // textStyle: { + // fontSize: 16 + // }, + // left: 'center' + // }, color: ['#1fbcd2', '#a23746'], tooltip: { formatter: '{b}, {c}%' diff --git a/src/views/Ptjs/Czdbl/index.js b/src/views/Ptjs/Czdbl/index.js index f9a9997..6717a23 100644 --- a/src/views/Ptjs/Czdbl/index.js +++ b/src/views/Ptjs/Czdbl/index.js @@ -3,7 +3,8 @@ import { Card, message, Table, Space, Button, Spin, Tree } from 'antd'; import ToolBar from './toolbar.js'; import ToolBottom from './toolBottom.js'; import apiurl from '../../../models/apiurl' -import { xyt_httpget2 } from "../../../utils/request" +import { xyt_httpget2, httpPostFile } from "../../../utils/request"; +import { exportFile } from '../../../utils/tools' import { resJson } from './res.js'; import ReactEcharts from 'echarts-for-react'; import qsOption from './qsOption.js' @@ -24,11 +25,11 @@ export default function Czrz() { const [subTableData, setSubTableData] = useState([]) const qsoptions = useMemo(() => { if (dayArr.length > 0 && selectedObject) { - return qsOption(dayArr, selectedObject, hbobj) + return qsOption(dayArr, selectedObject, hbobj, adcdList) } else { return {} } - }, [dayArr, selectedObject, hbobj]) + }, [dayArr, selectedObject, hbobj, adcdList]) const dblOptions = useMemo(() => { if (subTableData.length > 0 && SearchBottom) { @@ -52,7 +53,7 @@ export default function Czrz() { title: '行政区划', dataIndex: 'adnm', key: 'adnm', - width: 100, + width: 120, align: "center", }, { @@ -431,7 +432,6 @@ export default function Czrz() { } // 子表格数据 - const filterSondata = (selectedObj, type, adlist, selday) => { const sellist = []; if (selectedObj && type != 'province') { @@ -470,6 +470,14 @@ export default function Czrz() { setSubTableData(sellist) } + // 下载测站离线表 + const download = () => { + // httpPostFile(apiurl.service.yjgx.downLoad, params).then((res) => { + // if (res) { + // exportFile('测站离线表.xlsx', res.data) + // } + // }) + } useEffect(() => { if (searchVal) { const params = { @@ -492,6 +500,7 @@ export default function Czrz() { return item } }) + if (!selectObj) return selectObj.isBl = selectObj?.adcd.substring(4) != '00000000' ? true : false const type = selectObj?.adcd == '420000000000' ? 'province' : 'city' // const type = 'province'; @@ -521,22 +530,27 @@ export default function Czrz() { -
+
-
+
- 测站到报率 + 测站到报率
-
+
+ {!loading && + <> +
到报率变化趋势
+
日到报率详情
+ }
{ !loading ? <> -
+
- {!loading &&
- -
} + {!loading && + <> +
+ +
+ }
{ !loading ? <> -
+
-
+
+
+ 下载测站离线表
+
+ : } diff --git a/src/views/Ptjs/Czdbl/qsOption.js b/src/views/Ptjs/Czdbl/qsOption.js index 4aab4c4..a7f9c57 100644 --- a/src/views/Ptjs/Czdbl/qsOption.js +++ b/src/views/Ptjs/Czdbl/qsOption.js @@ -1,6 +1,9 @@ import moment from "moment" -export default function qsOption(timeList, listObj, hbobj) { +export default function qsOption(timeList, listObj, hbobj, list) { + if (listObj.adcd == '429000000000') { + listObj.adnm ='神农架' + } const chartTimeList = JSON.parse(JSON.stringify(timeList)); let itemStyle = { normal: { @@ -30,11 +33,33 @@ export default function qsOption(timeList, listObj, hbobj) { itemStyle: itemStyle, data: [] } + + let addSerise1 = { + name: "", + type: 'line', + itemStyle: itemStyle, + data: [] + } // 湖北省 for (let d = chartTimeList.length - 1; d > -1; d--) { let yval = parseFloat((hbobj[chartTimeList[d]]?.rate * 100).toFixed(2)); hbSeriseData.push(yval); } + + if (listObj.isBl) { + const dd = listObj.adcd.substring(0,4) + '00000000' + const cityAdcd = list.find(item => item.adcd == dd); + for (let d = chartTimeList.length - 1; d > -1; d--){ + let yval = parseFloat((cityAdcd[chartTimeList[d]]?.rate * 100).toFixed(2)); + addSerise1.name = cityAdcd?.adnm; + addSerise1.data.push(yval); + } + + if (addSerise1.name && cityAdcd.adnm!= '湖北省') { + totalSerise.push(addSerise1) + legendName.push(addSerise1.name); + } + } // 市 for (let d = chartTimeList.length - 1; d > -1; d--) { let yval = parseFloat((listObj[chartTimeList[d]]?.rate * 100).toFixed(2)); @@ -44,7 +69,7 @@ export default function qsOption(timeList, listObj, hbobj) { if (yval < minY) { minY = yval; } - minY = Math.ceil(minY) - 5; + minY = Math.ceil(minY) - 3; minY = minY < 0 ? 0 : minY; } @@ -52,7 +77,6 @@ export default function qsOption(timeList, listObj, hbobj) { totalSerise.push(addSerise) legendName.push(addSerise.name); } - chartTimeList.sort(function (o1, o2) { if (moment(o1).isBefore(moment(o2))) { return -1; @@ -64,23 +88,42 @@ export default function qsOption(timeList, listObj, hbobj) { chartTimeList[idx] = str.substring(5, 10); }); +console.log("miny",minY); return { - title: { - text: '到报率变化趋势', - textStyle: { - fontSize: 16 - }, - left: 'center' - }, + // title: { + // text: '到报率变化趋势', + // top:-10, + // textStyle: { + // fontSize: 16 + // }, + // left: 'center' + // }, tooltip: { trigger: 'axis', - formatter: '{a}, {b}, {c}%' + // formatter: '{a}, {b}, {c}%' + formatter: function (params) { + if (params.length > 0) { + var result = params[0].name + "
"; + params.forEach(function (item) { + if (item.value) { + result += + item.marker + + " " + + item.seriesName + + " : " + + item.value + + "%
"; + } + }); + return result; + } + } }, legend: { data: legendName, - top:30 + top:10 }, toolbox: { show: true, diff --git a/src/views/Ptjs/Zysy/form.js b/src/views/Ptjs/Zysy/form.js new file mode 100644 index 0000000..603d17b --- /dev/null +++ b/src/views/Ptjs/Zysy/form.js @@ -0,0 +1,59 @@ +import React, { useEffect, useState } from 'react'; +import { Form, Descriptions, Input, Row, Col, message, Select, Switch } from 'antd'; + + +const ModalForm = ({ mode, record }) => { + const [form] = Form.useForm(); + const businessType = { + 0: "其它", + 1: "新增", + 2: "修改", + 3: "删除", + 4: "授权", + 5: "导出", + 6: "导入", + 7: "强退", + 8: "生成代码", + 9: "清空数据", + } + const operatorStatus = { + 0: '正常', + 1: '异常' + } + + return ( + <> + + + {record?.title}/{businessType[record?.businessType]} + + + {record?.operUrl} + + + {record?.operName}/{record?.operIp}/ + + + {record?.requestMethod} + + + {record?.method} + + + {record?.operParam} + + + {record?.jsonResult} + + + {operatorStatus[record?.status]} + + + {record?.operTime} + + + + ); +} + +export default ModalForm; diff --git a/src/views/Ptjs/Zysy/index.js b/src/views/Ptjs/Zysy/index.js new file mode 100644 index 0000000..8098c5e --- /dev/null +++ b/src/views/Ptjs/Zysy/index.js @@ -0,0 +1,87 @@ +import React, { useEffect, useState, useMemo, useRef } from 'react'; +import { Card, message, Table, Space, Button } from 'antd'; +import ToolBar from './toolbar.js'; +import usePageTable from '../../../components/Crud/usePageTable.js' +import apiurl from '../../../models/apiurl' +import { findPage2 } from '../../../components/Crud/_.js' +import BasicCrudModal from '../../../components/Crud/BasicCrudModal.js'; +import ModalForm from './form.js'; +export default function Zysy() { + const refModal = useRef(); + const columns = [ + { + title: '序号', + dataIndex: 'inx', + key: 'inx', + width: 80, + align: "center", + render: (text, record, index) => { + return {index + 1} + } + }, + { + title: 'cpu(%)', + dataIndex: 'cpu', + key: 'cpu', + width: 120, + align: "center", + }, + { + title: '磁盘(%)', + dataIndex: 'disk', + key: 'disk', + width: 120, + align: "center", + }, + { + title: '内存(%)', + dataIndex: 'memory', + key: 'memory', + width: 120, + align: "center", + }, + { + title: '时间', + dataIndex: 'tm', + key: 'tm', + width: 120, + align: "center", + }, + ] + const [searchVal, setSearchVal] = useState({}) + const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]); + + const { tableProps, search, refresh } = usePageTable((params) => findPage2(apiurl.ptjs.resource, params)) + useEffect(() => { + if (searchVal) { + const params = { + ...searchVal + }; + search(params) + } + }, [searchVal]) + + return ( +
+
+ + +
+ + + + + ) +} diff --git a/src/views/Ptjs/Zysy/toolbar.js b/src/views/Ptjs/Zysy/toolbar.js new file mode 100644 index 0000000..2fd043a --- /dev/null +++ b/src/views/Ptjs/Zysy/toolbar.js @@ -0,0 +1,41 @@ +import React, { useEffect,useState } from 'react'; +import { Form, Input, Button, DatePicker } from 'antd'; +import NormalSelect from '../../../components/Form/NormalSelect'; +import dayjs from 'dayjs'; +const { RangePicker } = DatePicker; + +const ToolBar = ({ setToolVal }) => { + const [form] = Form.useForm(); + const onFinish = (values) => { + if (values.operTime) { + values.stm = values.operTime[0] ? dayjs(values.operTime[0]).format('YYYY-MM-DD 00:00:00') : ""; + values.etm = values.operTime[1] ? dayjs(values.operTime[1]).format('YYYY-MM-DD 00:00:00') : ""; + delete values.operTime + } + setToolVal(values); + } + + return ( +
+
+ + + + + + + + + + + + +
+ ); +} + +export default ToolBar; \ No newline at end of file