From b4cb2b8ddfb5fab9ca57eb0c3719ea238ab5251d Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 21 Jun 2023 13:52:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AE=89=E5=85=A8=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataQuality/containers/documentLibrary.js | 3 - .../dataQuality/containers/qualityMonitor.js | 101 +++++++++++++++--- .../dataQuality/containers/ruleLibrary.js | 8 -- .../src/sections/dataQuality/nav-item.js | 3 +- .../sections/safetySpecification/nav-item.js | 2 +- 5 files changed, 90 insertions(+), 27 deletions(-) diff --git a/web/client/src/sections/dataQuality/containers/documentLibrary.js b/web/client/src/sections/dataQuality/containers/documentLibrary.js index 8688693..35fd4c4 100644 --- a/web/client/src/sections/dataQuality/containers/documentLibrary.js +++ b/web/client/src/sections/dataQuality/containers/documentLibrary.js @@ -16,13 +16,10 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) { const { dataQuality } = actions const [checkAll, setCheckAll] = useState(false) - const [query, setQuery] = useState({ page: 0, limit: 10 }); const [folderData, setFolderData] = useState([]); const [fileData, setFileData] = useState([]) const [groupModal, setGroupModal] = useState(false) const [fileModal, setFileModal] = useState(false) - const [editData, setEditData] = useState({}) - const [column, setColumn] = useState([]) const [parent, setParent] = useState(null) const [keywords, setKeywords] = useState() const [breadcrumbData, setBreadcrumbData] = useState([{ name: '根目录', parent: null }]) diff --git a/web/client/src/sections/dataQuality/containers/qualityMonitor.js b/web/client/src/sections/dataQuality/containers/qualityMonitor.js index c4078ae..e58f133 100644 --- a/web/client/src/sections/dataQuality/containers/qualityMonitor.js +++ b/web/client/src/sections/dataQuality/containers/qualityMonitor.js @@ -1,42 +1,115 @@ import React, { useEffect, useState } from 'react' import { connect } from 'react-redux'; import moment from 'moment'; -import ApproveModal from '../components/groupModal'; +import ReactECharts from 'echarts-for-react'; import { Tabs, Form, Input, DatePicker, Button, Table, Select } from 'antd'; -import { v1 } from 'uuid'; + function MyApplication ({ loading, clientHeight, actions, dispatch, user }) { - const { resourceConsumption } = actions + const { dataQuality } = actions const [query, setQuery] = useState({ page: 0, limit: 10 }); const [proTableList, setProTableList] = useState({ rows: [], count: 0 }); - const [formData, setFormData] = useState({}) + const [bistribution, setBistribution] = useState({}) useEffect(() => { resourceData() }, []) - let resourceData = (params) => { - // let data = params || query - // dispatch(resourceConsumption.getApproveList({ applyById: user?.id, ...formData, ...data, })).then(res => { - // if (res.success) { - // setProTableList(res.payload.data) - // } - // }) + let resourceData = () => { + dispatch(dataQuality.getBusinessRules({})).then(res => { + if (res.success) { + let data = res.payload.data?.rows + setBistribution({ + ordinary: data?.filter(c => c.problemLevel == '一般')?.length || 0, + significance: data?.filter(c => c.problemLevel == '重要')?.length || 0, + seriousness: data?.filter(c => c.problemLevel == '严重')?.length || 0, + count: res.payload.data?.count + }) + + } + }) + } + + + const option = { + title: { + text: '规则分部情况', + subtext: '', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c} ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'right', + data: ['一般', '重要', '严重'] + }, + series: [ + { + name: '分布情况', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: [ + { value: bistribution?.ordinary, name: '一般' }, + { value: bistribution?.significance, name: '重要' }, + { value: bistribution?.seriousness, name: '严重' }, + ], + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + + const [count, setCount] = useState(0); + + function onChartReady (echarts) { + console.log('echarts is ready', echarts); } + function onChartClick (param, echarts) { + console.log(param, echarts); + setCount(count + 1); + }; - + function onChartLegendselectchanged (param, echarts) { + console.log(param, echarts); + }; + return
+
+
业务规则情况
+
+
+
+ 业务规则个数:{bistribution?.count || 0}
+ +
+
- return <> - +
} function mapStateToProps (state) { const { global, auth, resourceCatalog } = state; diff --git a/web/client/src/sections/dataQuality/containers/ruleLibrary.js b/web/client/src/sections/dataQuality/containers/ruleLibrary.js index f838340..d53c408 100644 --- a/web/client/src/sections/dataQuality/containers/ruleLibrary.js +++ b/web/client/src/sections/dataQuality/containers/ruleLibrary.js @@ -15,15 +15,9 @@ import RuleModal from '../components/ruleModal'; function RuleLibrary ({ loading, clientHeight, actions, dispatch, }) { const { dataQuality } = actions - const [checkAll, setCheckAll] = useState(false) const [query, setQuery] = useState({ page: 0, limit: 10 }); - const [folderData, setFolderData] = useState([]); - const [fileData, setFileData] = useState([]) const [ruleModal, setRuleModal] = useState(false) - const [fileModal, setFileModal] = useState(false) const [editData, setEditData] = useState({}) - const [column, setColumn] = useState([]) - const [parent, setParent] = useState(null) const [keyword, setKeyword] = useState() const [tableList, setTableList] = useState({ rows: [], count: 0 }); const [treeList, setTreeLista] = useState([]) @@ -92,8 +86,6 @@ function RuleLibrary ({ loading, clientHeight, actions, dispatch, }) { } }) }} - // okText="Yes" - // cancelText="No" > diff --git a/web/client/src/sections/dataQuality/nav-item.js b/web/client/src/sections/dataQuality/nav-item.js index c174b5e..81e4a5d 100644 --- a/web/client/src/sections/dataQuality/nav-item.js +++ b/web/client/src/sections/dataQuality/nav-item.js @@ -6,7 +6,8 @@ const SubMenu = Menu.SubMenu; export function getNavItem (user) { return ( - } title='数据质量'> + user?.role == '系统管理员' && } title='数据质量'> + 标准文档库 diff --git a/web/client/src/sections/safetySpecification/nav-item.js b/web/client/src/sections/safetySpecification/nav-item.js index f9897d2..f19424e 100644 --- a/web/client/src/sections/safetySpecification/nav-item.js +++ b/web/client/src/sections/safetySpecification/nav-item.js @@ -6,7 +6,7 @@ const SubMenu = Menu.SubMenu; export function getNavItem (user) { return ( - } title='数据安全规范'> + user?.role == '系统管理员' && } title='数据安全规范'> 数据安全规范库