|
@@ -1,3 +1,4 @@
|
|
|
+/* eslint-disable space-before-function-paren */
|
|
|
import React, { useEffect, useState } from 'react'
|
|
|
import Container, { ContainerBody } from 'components/Container'
|
|
|
import Helmet from 'react-helmet'
|
|
@@ -28,7 +29,9 @@ import ScheduleFormModal from 'containers/DataGovernanceQualityAudit/components/
|
|
|
// import header from 'containers/Display/Editor/Header'
|
|
|
import { RouteComponentProps, withRouter } from 'react-router-dom'
|
|
|
|
|
|
-function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
+function DataGovernanceQualityAudit(
|
|
|
+ props: RouteComponentProps<{ projectId: string }>
|
|
|
+) {
|
|
|
const { history, match } = props
|
|
|
|
|
|
const [tableLoading, setTableLoading] = useState(false)
|
|
@@ -49,7 +52,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
|
|
|
const [scVisible, setScVisible] = useState(false)
|
|
|
const [scLoading, setSCLoading] = useState(false)
|
|
|
- const [scForm, setSCForm] = useState<IClassification>({})
|
|
|
+ const [scForm] = useState<IClassification>({})
|
|
|
|
|
|
const tableColumns: Array<ColumnProps<IQualityTask>> = [
|
|
|
{
|
|
@@ -76,21 +79,24 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
>
|
|
|
编辑
|
|
|
</a>
|
|
|
- <Divider type='vertical' />
|
|
|
+ <Divider type="vertical" />
|
|
|
<Dropdown
|
|
|
overlay={
|
|
|
<Menu>
|
|
|
<Menu.Item
|
|
|
- key='00'
|
|
|
+ key="00"
|
|
|
onClick={() => {
|
|
|
// eslint-disable-next-line react/prop-types
|
|
|
- history.push(`/project/${match.params.projectId}/dataGovernance/auditAnalysiss?systemId=${data.pId}&starTime=${data.startTime}&endTime=${data.endTime}`)
|
|
|
+ history.push(
|
|
|
+ // eslint-disable-next-line react/prop-types
|
|
|
+ `/project/${match.params.projectId}/dataGovernance/auditAnalysiss?systemId=${data.pId}&starTime=${data.startTime}&endTime=${data.endTime}&taskId=${data.id}`
|
|
|
+ )
|
|
|
}}
|
|
|
>
|
|
|
稽查历史
|
|
|
</Menu.Item>
|
|
|
<Menu.Item
|
|
|
- key='0'
|
|
|
+ key="0"
|
|
|
onClick={() => {
|
|
|
setQtForm(data)
|
|
|
setScVisible(true)
|
|
@@ -98,19 +104,19 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
>
|
|
|
设置调度
|
|
|
</Menu.Item>
|
|
|
- <Menu.Item key='1'>
|
|
|
+ <Menu.Item key="1">
|
|
|
<Popconfirm
|
|
|
- title='确定立即稽查吗?'
|
|
|
- placement='bottom'
|
|
|
+ title="确定立即稽查吗?"
|
|
|
+ placement="bottom"
|
|
|
onConfirm={() => handleSetDispatchRightNow(data)}
|
|
|
>
|
|
|
<a>立即稽查</a>
|
|
|
</Popconfirm>
|
|
|
</Menu.Item>
|
|
|
- <Menu.Item key='3'>
|
|
|
+ <Menu.Item key="3">
|
|
|
<Popconfirm
|
|
|
- title='确定删除?'
|
|
|
- placement='bottom'
|
|
|
+ title="确定删除?"
|
|
|
+ placement="bottom"
|
|
|
onConfirm={() => handleDeleteTask(data.id)}
|
|
|
>
|
|
|
<a>删除</a>
|
|
@@ -121,7 +127,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
>
|
|
|
<a>
|
|
|
{' '}
|
|
|
- 更多 <Icon type='down' />
|
|
|
+ 更多 <Icon type="down" />
|
|
|
</a>
|
|
|
</Dropdown>
|
|
|
</>
|
|
@@ -134,10 +140,10 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
setCfVisible(true)
|
|
|
}
|
|
|
|
|
|
- const handleDeleteTreeItem = async(c: IClassification) => {
|
|
|
+ const handleDeleteTreeItem = async (c: IClassification) => {
|
|
|
try {
|
|
|
setTreeLoading(true)
|
|
|
- const data = await request(`${api.deleteAuditClassification}${c.id}`, {
|
|
|
+ const data = await request(`${api.deleteDataRules}${c.id}`, {
|
|
|
method: 'DELETE'
|
|
|
})
|
|
|
// @ts-ignore
|
|
@@ -169,19 +175,19 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
setSelectedKey(c.id)
|
|
|
}}
|
|
|
>
|
|
|
- <Icon type='file' />
|
|
|
+ <Icon type="file" />
|
|
|
{c.name}
|
|
|
</span>
|
|
|
<Dropdown
|
|
|
overlay={() => (
|
|
|
<Menu>
|
|
|
- <Menu.Item key='0' onClick={() => handleEditTreeItem(c)}>
|
|
|
+ <Menu.Item key="0" onClick={() => handleEditTreeItem(c)}>
|
|
|
编辑
|
|
|
</Menu.Item>
|
|
|
- <Menu.Item key='1'>
|
|
|
+ <Menu.Item key="1">
|
|
|
<Popconfirm
|
|
|
- title='确定删除?'
|
|
|
- placement='bottom'
|
|
|
+ title="确定删除?"
|
|
|
+ placement="bottom"
|
|
|
onConfirm={() => handleDeleteTreeItem(c)}
|
|
|
>
|
|
|
<a>删除</a>
|
|
@@ -191,14 +197,14 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
)}
|
|
|
trigger={['click']}
|
|
|
>
|
|
|
- <Icon type='more' />
|
|
|
+ <Icon type="more" />
|
|
|
</Dropdown>
|
|
|
</div>
|
|
|
))}
|
|
|
</>
|
|
|
)
|
|
|
|
|
|
- const handleSetDispatchRightNow = async(data: IQualityTask) => {
|
|
|
+ const handleSetDispatchRightNow = async (data: IQualityTask) => {
|
|
|
try {
|
|
|
setTableLoading(true)
|
|
|
const result = await request(`${api.setDispatchRightNow}${data.id}`, {
|
|
@@ -217,7 +223,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const handleDispatch = async(form) => {
|
|
|
+ const handleDispatch = async (form) => {
|
|
|
try {
|
|
|
setSCLoading(true)
|
|
|
const result = await request(`${api.setDispatch}${qtForm.id}`, {
|
|
@@ -237,7 +243,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
})
|
|
|
// @ts-ignore
|
|
|
if (result.header.code === 200) {
|
|
|
- setScVisible(false);
|
|
|
+ setScVisible(false)
|
|
|
message.success({ content: '设置调度成功' })
|
|
|
queryQualityTasks()
|
|
|
}
|
|
@@ -246,7 +252,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const queryClassifications = async() => {
|
|
|
+ const queryClassifications = async () => {
|
|
|
try {
|
|
|
setTreeLoading(true)
|
|
|
const data = await request(api.getAuditClassification, { method: 'GET' })
|
|
@@ -259,7 +265,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const queryQualityTasks = async() => {
|
|
|
+ const queryQualityTasks = async () => {
|
|
|
try {
|
|
|
setTableLoading(true)
|
|
|
const data = await request(`${api.getQualityTask}?pId=${selectedKey}`, {
|
|
@@ -272,7 +278,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const handleSaveCfForm = async(form: IClassification) => {
|
|
|
+ const handleSaveCfForm = async (form: IClassification) => {
|
|
|
try {
|
|
|
setCfLoading(true)
|
|
|
const url = cfForm.id
|
|
@@ -292,7 +298,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const handleSaveQtForm = async(view) => {
|
|
|
+ const handleSaveQtForm = async (view) => {
|
|
|
try {
|
|
|
setQtLoading(true)
|
|
|
const url = qtForm?.id
|
|
@@ -312,7 +318,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const handleDeleteTask = async(id: number) => {
|
|
|
+ const handleDeleteTask = async (id: number) => {
|
|
|
try {
|
|
|
setTableLoading(true)
|
|
|
const data = await request(`${api.deleteQualityTask}${id}`, {
|
|
@@ -336,11 +342,12 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
if (selectedKey) {
|
|
|
queryQualityTasks()
|
|
|
}
|
|
|
+ // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
}, [selectedKey])
|
|
|
|
|
|
return (
|
|
|
<Container>
|
|
|
- <Helmet title='质量稽核' />
|
|
|
+ <Helmet title="质量稽核" />
|
|
|
<ContainerBody>
|
|
|
<Box>
|
|
|
<Box.Header>
|
|
@@ -358,7 +365,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
setCfVisible(true)
|
|
|
}}
|
|
|
>
|
|
|
- <Icon type='plus' />
|
|
|
+ <Icon type="plus" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className={styles.treeContent}>
|
|
@@ -371,8 +378,8 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
<div style={{ flex: 1 }}>
|
|
|
<div style={{ padding: '0 0 20px' }}>
|
|
|
<Button
|
|
|
- type='primary'
|
|
|
- icon='plus'
|
|
|
+ type="primary"
|
|
|
+ icon="plus"
|
|
|
onClick={() => {
|
|
|
setQtVisible(true)
|
|
|
setQtForm(null)
|
|
@@ -384,7 +391,7 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
<Table
|
|
|
style={{ flex: 1 }}
|
|
|
bordered
|
|
|
- rowKey='id'
|
|
|
+ rowKey="id"
|
|
|
loading={tableLoading}
|
|
|
dataSource={qualityTasks}
|
|
|
columns={tableColumns}
|
|
@@ -410,7 +417,10 @@ function DataGovernanceQualityAudit(props: RouteComponentProps) {
|
|
|
formView={qtForm}
|
|
|
onSave={handleSaveQtForm}
|
|
|
loading={qtLoading}
|
|
|
- onCancel={() => setQtVisible(false)}
|
|
|
+ onCancel={() => {
|
|
|
+ setQtVisible(false)
|
|
|
+ setQtForm(null)
|
|
|
+ }}
|
|
|
/>
|
|
|
<ScheduleFormModal
|
|
|
visible={scVisible}
|