Browse Source

数据安全规范

master
wenlele 2 years ago
parent
commit
b4cb2b8ddf
  1. 3
      web/client/src/sections/dataQuality/containers/documentLibrary.js
  2. 101
      web/client/src/sections/dataQuality/containers/qualityMonitor.js
  3. 8
      web/client/src/sections/dataQuality/containers/ruleLibrary.js
  4. 3
      web/client/src/sections/dataQuality/nav-item.js
  5. 2
      web/client/src/sections/safetySpecification/nav-item.js

3
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 }])

101
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} <br/>{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 <div style={{ width: '100%', display: 'flex', justifyContent: 'center' }}>
<div style={{ width: '80%' }}>
<div style={{ fontSize: 24, fontWeight: 600, }}>业务规则情况</div>
<div style={{ border: '1px solid #38333326', margin: '20px 0' }}></div>
<div style={{ display: 'flex' }}>
<div style={{ width: 200, h: 400, display: 'flex', alignItems: 'center', justifyContent: 'flex-end' }}>
业务规则个数<span style={{fontSize: 24, fontWeight: 600,}}>{bistribution?.count || 0} </span> </div>
<ReactECharts
option={option}
style={{ height: 400, width: 600 }}
onChartReady={onChartReady}
onEvents={{
'click': onChartClick,
'legendselectchanged': onChartLegendselectchanged
}}
/>
</div>
</div>
return <>
</>
</div>
}
function mapStateToProps (state) {
const { global, auth, resourceCatalog } = state;

8
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"
>
<Button type="link">删除</Button>
</Popconfirm>

3
web/client/src/sections/dataQuality/nav-item.js

@ -6,7 +6,8 @@ const SubMenu = Menu.SubMenu;
export function getNavItem (user) {
return (
<SubMenu key="dataQuality" icon={<CarryOutOutlined />} title='数据质量'>
user?.role == '系统管理员' && <SubMenu key="dataQuality" icon={<CarryOutOutlined />} title='数据质量'>
<Menu.Item key="documentLibrary">
<Link to="/dataQuality/documentLibrary">标准文档库</Link>
</Menu.Item>

2
web/client/src/sections/safetySpecification/nav-item.js

@ -6,7 +6,7 @@ const SubMenu = Menu.SubMenu;
export function getNavItem (user) {
return (
<SubMenu key="safetySpecification" icon={<CarryOutOutlined />} title='数据安全规范'>
user?.role == '系统管理员' && <SubMenu key="safetySpecification" icon={<CarryOutOutlined />} title='数据安全规范'>
<Menu.Item key="specificationLibrary">
<Link to="/safetySpecification/specificationLibrary">数据安全规范库</Link>
</Menu.Item>

Loading…
Cancel
Save