Ver código fonte

fix: call create quality task api

hi-cactus! 3 anos atrás
pai
commit
9de2125bc6

+ 0 - 8
app/containers/DataGovernanceMarkRule/components/DataSubjectFormModal.tsx

@@ -59,14 +59,6 @@ export class DataSubjectFormModal extends React.PureComponent<IDataSubjectFormMo
       </Button>
     ]
 
-    console.log(
-      fromView,
-      subjects?.filter((e) => e.dictCode !== -1),
-      '---'
-    )
-
-    console.log(fromView?.pId, subject, '====')
-
     return (
       <Modal
         title={fromView ? '编辑' : '新增'}

+ 39 - 31
app/containers/DataGovernanceQualityAudit/components/MetadataModal.tsx

@@ -28,14 +28,18 @@ import classnames from 'classnames'
 import { ICatalogue, IViewBase } from 'containers/DataManagerView/types'
 import { RouteComponentWithParams } from 'utils/types'
 import { withRouter } from 'react-router-dom'
+import SubjectModal from 'containers/DataGovernanceQualityAudit/components/SubjectModal'
+import { IMetaParam } from 'containers/DataGovernanceQualityAudit/types'
 
 interface IMetadataModalProps extends RouteComponentWithParams {
   visible: boolean
+  selection: IViewBase[]
   onCancel: () => void
+  onSave: (e: IViewBase[]) => void
 }
 
 const MetadataModal = (props: IMetadataModalProps) => {
-  const { visible, onCancel, match } = props
+  const { visible, onCancel, onSave, match, selection } = props
 
   const [treeLoading, setTreeLoading] = useState(false)
   const [selectedKey, setSelectedKey] = useState<number[]>([])
@@ -43,9 +47,9 @@ const MetadataModal = (props: IMetadataModalProps) => {
 
   const [tableMetadata, setTableMetadata] = useState<IViewBase[]>([])
   const [tableLoading, setTableLoading] = useState(false)
-  const [tableRowSelection, setTableRowSelection] = useState([])
+  const [tableRowSelection, setTableRowSelection] = useState<number>()
 
-  const getCatalogues = async () => {
+  const getCatalogues = async() => {
     try {
       const { projectId } = match.params
 
@@ -62,7 +66,7 @@ const MetadataModal = (props: IMetadataModalProps) => {
     }
   }
 
-  const loadViews = async () => {
+  const loadViews = async() => {
     const { projectId } = match.params
     if (projectId && selectedKey.length > 0) {
       const parentId = Number(selectedKey[0])
@@ -80,34 +84,29 @@ const MetadataModal = (props: IMetadataModalProps) => {
     }
   }
 
-  const tableColumns: Array<ColumnProps<{}>> = [
+  const tableColumns: Array<ColumnProps<IViewBase>> = [
     {
       title: '元数据名称',
-      dataIndex: 'dictCode'
+      dataIndex: 'name'
     },
     {
       title: '元数据类型',
-      dataIndex: 'dictLabel'
+      dataIndex: ''
     },
     {
       title: '更新时间',
-      dataIndex: 'dictValue'
+      dataIndex: ''
     },
     {
       title: '创建人',
-      dataIndex: 'dictSort'
+      dataIndex: ''
     },
     {
       title: '是否关联质量',
-      dataIndex: 'isDefault'
-    },
-    {
-      title: '',
-      render: () => (
+      dataIndex: 'isDefault',
+      render: (_, data, idx) => (
         <>
-          <a>编辑</a>
-          <Divider type="vertical" />
-          <a>删除</a>
+          {data?.relationQuality ? <span>是</span> : <span>否</span>}
         </>
       )
     }
@@ -122,14 +121,12 @@ const MetadataModal = (props: IMetadataModalProps) => {
             className={classnames(styles.treeNode, {
               [styles.treeNodeSelected]: selectedKey.includes(c.id)
             })}
+            onClick={() => {
+              setSelectedKey([c.id])
+            }}
           >
-            <span
-              className={styles.treeNodeLeft}
-              onClick={() => {
-                setSelectedKey([c.id])
-              }}
-            >
-              <Icon type="file" />
+            <span className={styles.treeNodeLeft}>
+              <Icon type='file' />
               {c.name}
             </span>
           </div>
@@ -140,10 +137,19 @@ const MetadataModal = (props: IMetadataModalProps) => {
       ))}
     </>
   )
+  const handleSave = () => {
+    const s = tableMetadata?.find((t) => t.id === tableRowSelection)
+    onSave([s])
+  }
 
   useEffect(() => {
     getCatalogues()
   }, [])
+
+  useEffect(() => {
+    setTableRowSelection(selection?.map((s) => s.id)?.[0])
+  }, [selection])
+
   useEffect(() => {
     if (selectedKey.length > 0) {
       loadViews()
@@ -152,12 +158,12 @@ const MetadataModal = (props: IMetadataModalProps) => {
 
   return (
     <Modal
-      title="选择元数据"
+      title='选择元数据'
       visible={visible}
       onCancel={onCancel}
-      maskClosable={false}
+      onOk={handleSave}
       destroyOnClose
-      width="80%"
+      width='80%'
     >
       <div className={styles.treeTableContainer}>
         <div className={styles.treeContainer}>
@@ -171,20 +177,22 @@ const MetadataModal = (props: IMetadataModalProps) => {
 
         <div style={{ flex: 1 }}>
           <div style={{ padding: '0 0 20px' }}>
-            <Button type="primary" icon="plus">
+            <Button type='primary' icon='plus'>
               查询
             </Button>
           </div>
           <Table
             rowSelection={{
-              selectedRowKeys: tableRowSelection,
+              type: 'radio',
+              selectedRowKeys: [tableRowSelection],
               onChange: (selectedRowKeys) => {
-                setTableRowSelection(selectedRowKeys)
+                // @ts-ignore
+                setTableRowSelection((c) => selectedRowKeys[0])
               }
             }}
             style={{ flex: 1 }}
             bordered
-            rowKey="id"
+            rowKey='id'
             loading={tableLoading}
             dataSource={tableMetadata}
             columns={tableColumns}

+ 143 - 36
app/containers/DataGovernanceQualityAudit/components/QualityTaskFormModal.tsx

@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from 'react'
+import React, { useEffect, useMemo, useState } from 'react'
 import {
   Drawer,
   Form,
@@ -12,18 +12,23 @@ import {
   Dropdown,
   Menu,
   Popconfirm,
-  Icon
+  Icon,
+  Modal
 } from 'antd'
-import { IClassification, IQualityTask } from '../types'
+import { IClassification, IMetaParam, IQualityTask } from '../types'
 import { ColumnProps } from 'antd/lib/table'
 import MetadataModal from 'containers/DataGovernanceQualityAudit/components/MetadataModal'
+import { IViewBase } from 'containers/View/types'
+import SubjectModal from 'containers/DataGovernanceQualityAudit/components/SubjectModal'
+import { IDataSubject } from 'containers/DataGovernanceMarkRule/types'
 
 interface IQualityTaskFormModalProps {
+  pId: number
   visible: boolean
   loading: boolean
   // eslint-disable-next-line no-undef
   formView: Partial<IQualityTask>
-  onSave: (view: IClassification) => void
+  onSave: (view) => void
   onCancel: () => void
 }
 
@@ -32,59 +37,155 @@ const QualityTaskFormModal = ({
   visible,
   loading,
   onCancel,
+  pId,
   onSave
 }: IQualityTaskFormModalProps) => {
   const [metaVisible, setMetaVisible] = useState(false)
 
   const [taskName, setTaskName] = useState<IQualityTask['taskName']>()
+  // @ts-ignore
+  const [selection, setSelection] = useState<IViewBase[]>([])
 
-  const handleSave = () => {
-    const view: IQualityTaskFormModalProps['formView'] = {}
-    onSave(view)
-  }
+  const [tableData, setTableData] = useState<IMetaParam[]>([])
+
+  // const tableData = useMemo<IMetaParam[]>(() => {
+  //   return selection?.map((s) => s?.metadataConfig).reduce((c, n) => {
+  //     let next = []
+  //     try {
+  //       next = JSON.parse(n ?? '[]')
+  //     } catch (e) {
+  //       console.log(e)
+  //     }
+  //     return [...c, ...next]
+  //   }, [] as IMetaParam[])
+  // }, [selection])
+
+  const [smVisible, setSmVisible] = useState(false)
+  const [smFormView, setSmFormView] = useState<IMetaParam>()
 
-  const paramsColumns: Array<ColumnProps<IQualityTask>> = [
+  const paramsColumns: Array<ColumnProps<IMetaParam>> = [
     {
       title: '名称',
-      dataIndex: 'taskName'
+      dataIndex: 'fieldName'
     },
     {
       title: '数据类型',
-      dataIndex: 'taskName1'
+      dataIndex: 'fieldType'
     },
     {
       title: '别名',
-      dataIndex: 'taskName2'
+      dataIndex: ''
     },
     {
       title: '标准名称',
-      dataIndex: 'taskName3'
+      dataIndex: 'subjectName'
     },
     {
       title: '操作',
       render: (_, data) => (
         <>
-          <a>关联标准</a>
-          <Divider type="vertical" />
-          <a>取消关联</a>
+          <a
+            onClick={() => {
+              setSmVisible(true)
+              setSmFormView(data)
+            }}
+          >
+            关联标准
+          </a>
+          {data.fieldAlias && (
+            <>
+              <Divider type="vertical" />
+              <Popconfirm
+                title="确定删除?"
+                placement="bottom"
+                onConfirm={() => handleResetSmForm(data)}
+              >
+                <a>取消关联</a>
+              </Popconfirm>
+            </>
+          )}
         </>
       )
     }
   ]
 
+  const handleSave = () => {
+    onSave({
+      viewId: selection?.[0]?.id,
+      metadataName: selection?.[0]?.name,
+      metadataConfig: JSON.stringify(tableData),
+      pId
+    })
+  }
+
+  const handleSaveSmForm = (data: IDataSubject) => {
+    setTableData([
+      ...tableData.filter((s) => s.fieldName !== smFormView.fieldName),
+      {
+        ...smFormView,
+        fieldAlias: data.id + ''
+      }
+    ])
+    setSmVisible(false)
+  }
+  const handleResetSmForm = (data: IMetaParam) => {
+    // selection
+    setTableData([
+      ...tableData.filter((s) => s.fieldName !== data.fieldName),
+      {
+        ...data,
+        fieldAlias: ''
+      }
+    ])
+  }
+
   useEffect(() => {
     setTaskName(formView?.taskName)
+    setSelection(
+      // @ts-ignore
+      formView?.metadataName
+        ? [
+            {
+              name: formView?.metadataName,
+              metadataConfig: formView?.metadataConfig
+            }
+          ]
+        : []
+    )
   }, [formView])
 
+  useEffect(() => {
+    const d = selection
+      ?.map((s) => s?.metadataConfig)
+      .reduce((c, n) => {
+        let next = []
+        try {
+          next = JSON.parse(n || '[]')
+        } catch (e) {
+          console.log(e)
+        }
+        return [...c, ...next]
+      }, [] as IMetaParam[])
+    setTableData(d)
+  }, [selection])
+
   return (
-    <Drawer
+    <Modal
       title={null}
       visible={visible}
-      onClose={onCancel}
+      onCancel={onCancel}
       destroyOnClose
-      closable={false}
-      maskClosable={false}
       width="80%"
+      footer={
+        <>
+          <Button onClick={onCancel} style={{ marginRight: 6 }}>
+            取 消
+          </Button>
+          <Button disabled={loading} type="primary" onClick={handleSave}>
+            保 存
+          </Button>
+        </>
+      }
       // placement={'bottom'}
     >
       <div
@@ -95,14 +196,6 @@ const QualityTaskFormModal = ({
         }}
       >
         <h3>质量任务</h3>
-        <div>
-          <Button onClick={onCancel} style={{ marginRight: 6 }}>
-            取 消
-          </Button>
-          <Button disabled={loading} type="primary" onClick={handleSave}>
-            保 存
-          </Button>
-        </div>
       </div>
       <div style={{ margin: '10px 0', display: 'flex', alignItems: 'center' }}>
         <label>质量任务名称:</label>
@@ -124,23 +217,37 @@ const QualityTaskFormModal = ({
             flex: 1
           }}
         >
-          <Tag closable>Tag 2</Tag>
-          <Tag closable>Tag 2</Tag>
-          <Tag closable>Tag 2</Tag>
-          <Tag closable>Tag 2</Tag>
-          <Tag closable>Tag 2</Tag>
-          <Tag closable>Tag 2</Tag>
+          {selection.map((c, idx) => (
+            <Tag key={c.id || idx} closable onClose={() => setSelection([])}>
+              {c.name}
+            </Tag>
+          ))}
         </div>
       </div>
       <div>
         <p style={{ margin: '10px 0' }}>字段映射</p>
-        <Table columns={paramsColumns} />
+        <Table
+          columns={paramsColumns}
+          rowKey="fieldName"
+          dataSource={tableData}
+        />
       </div>
       <MetadataModal
+        selection={selection}
+        onSave={(e) => {
+          setSelection(e)
+          setMetaVisible(false)
+        }}
         visible={metaVisible}
         onCancel={() => setMetaVisible(false)}
       />
-    </Drawer>
+      <SubjectModal
+        visible={smVisible}
+        formView={smFormView}
+        onSave={handleSaveSmForm}
+        onCancel={() => setSmVisible(false)}
+      />
+    </Modal>
   )
 }
 

+ 35 - 2
app/containers/DataGovernanceQualityAudit/components/ScheduleFormModal.tsx

@@ -12,6 +12,10 @@ import {
 } from 'antd'
 import { FormComponentProps } from 'antd/lib/form'
 import { IClassification, ISchedule } from '../types'
+import {
+  ICronExpressionPartition,
+  SchedulePeriodUnit
+} from 'containers/Schedule/components/types'
 
 const FormItem = Form.Item
 
@@ -23,6 +27,35 @@ interface IScheduleFormModalProps extends FormComponentProps<ISchedule> {
   onCancel: () => void
 }
 
+const getCronExpressionByPartition = (partition: {
+  periodUnit: string
+  interval: number
+}) => {
+  const { periodUnit, interval } = partition
+  let cronExpression = ''
+  switch (periodUnit as SchedulePeriodUnit) {
+    case 'Minute':
+      cronExpression = `0 */${interval} * * * ?`
+      break
+    case 'Hour':
+      cronExpression = `0 0 */${interval} * * ?`
+      break
+    case 'Day':
+      cronExpression = `0 0 0 */${interval} * ?`
+      break
+    case 'Week':
+      cronExpression = `0 0 0 ? * ${interval}`
+      break
+    case 'Month':
+      cronExpression = `0 0 0 ${interval} * ?`
+      break
+    case 'Year':
+      cronExpression = `0 0 0 0 0 0 0/${interval}`
+      break
+  }
+  return cronExpression
+}
+
 class ScheduleFormModal extends React.PureComponent<IScheduleFormModalProps> {
   // @ts-ignore
   private formItemStyle = {
@@ -96,8 +129,8 @@ class ScheduleFormModal extends React.PureComponent<IScheduleFormModalProps> {
             )}
           </FormItem>
           <FormItem label={'调度间隔'} {...this.formItemStyle} required>
-            {getFieldDecorator<ISchedule>('name', {
-              initialValue: formView?.name,
+            {getFieldDecorator<ISchedule>('interval', {
+              initialValue: formView?.interval,
               rules: [{ required: true, message: '请输入' }]
             })(<InputNumber />)}
           </FormItem>

+ 225 - 0
app/containers/DataGovernanceQualityAudit/components/SubjectModal.tsx

@@ -0,0 +1,225 @@
+/*
+ * <<
+ * Davinci
+ * ==
+ * Copyright (C) 2016 - 2017 EDP
+ * ==
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * >>
+ */
+
+import React, { useEffect, useState } from 'react'
+import {
+  Modal,
+  Button,
+  Table,
+  Divider,
+  Icon,
+  Spin,
+  Popconfirm,
+  message
+} from 'antd'
+import { ColumnProps } from 'antd/lib/table'
+import api from 'utils/api'
+import request from 'utils/request'
+import styles from 'containers/DataManagerView/index.less'
+import classnames from 'classnames'
+import { ICatalogue, IViewBase } from 'containers/DataManagerView/types'
+import { RouteComponentWithParams } from 'utils/types'
+import { withRouter } from 'react-router-dom'
+import { IDataSubject } from 'containers/DataGovernanceMarkRule/types'
+import { IDictData } from 'containers/DataManagerDictionary/types'
+import { isNumber } from 'lodash'
+import Box from 'components/Box'
+import { IMetaParam } from 'containers/DataGovernanceQualityAudit/types'
+
+interface ISubjectModalProps extends RouteComponentWithParams {
+  visible: boolean
+  formView: IMetaParam
+  onCancel: () => void
+  onSave: (e: IDataSubject) => void
+}
+
+const SubjectModal = (props: ISubjectModalProps) => {
+  const { visible, onCancel, onSave, match } = props
+
+  const [tableLoading, setTableLoading] = useState(false)
+  const [dataSubject, setDataSubject] = useState<IDataSubject[]>([])
+
+  const [selectedSubjectsKey, setSelectedSubjectsKey] = useState<number>()
+
+  const [tableRowSelection, setTableRowSelection] = useState<number>()
+
+  const [treeLoading, setTreeLoading] = useState(false)
+  const [subjects, setSubject] = useState<IDictData[]>([
+    { dictLabel: '全部主题', dictCode: -1 }
+  ])
+
+  const tableColumns: Array<ColumnProps<IDataSubject>> = [
+    {
+      title: '标准主题',
+      dataIndex: 'standardTheme'
+    },
+    {
+      title: '标准编码',
+      dataIndex: 'standardCode'
+    },
+    {
+      title: '标准名称',
+      dataIndex: 'standardName'
+    },
+    {
+      title: '别名',
+      dataIndex: 'standardAlias'
+    },
+    {
+      title: '英文名称',
+      dataIndex: 'englishName'
+    },
+    {
+      title: '管理部门',
+      dataIndex: 'deptName'
+    },
+    {
+      title: '管理人员',
+      dataIndex: 'management'
+    }
+  ]
+
+  const querySubjects = async () => {
+    try {
+      setTreeLoading(true)
+      const data = await request(`${api.getSubjects}data_standard`, {
+        method: 'GET'
+      })
+      const defaultSubject = [{ dictLabel: '全部主题', dictCode: -1 }]
+      setSubject(
+        // @ts-ignore
+        data?.payload ? [...defaultSubject, ...data?.payload] : defaultSubject
+      )
+      setSelectedSubjectsKey(-1)
+    } finally {
+      setTreeLoading(false)
+    }
+  }
+
+  const queryDataBySelectedSubject = async () => {
+    try {
+      setTableLoading(true)
+      const data = await request(
+        `${api.getDataSubject}?pId=${
+          selectedSubjectsKey === -1 ? '' : selectedSubjectsKey
+        }`,
+        { method: 'GET' }
+      )
+      // @ts-ignore
+      setDataSubject(data?.payload ?? [])
+    } finally {
+      setTableLoading(false)
+    }
+  }
+
+  const renderTree = (catalogues: IDictData[]) => (
+    <>
+      {catalogues.map((c, idx) => (
+        <div
+          key={c.dictCode ?? idx}
+          className={classnames(styles.treeNode, {
+            [styles.treeNodeSelected]: selectedSubjectsKey === c.dictCode
+          })}
+        >
+          <span
+            className={styles.treeNodeLeft}
+            onClick={() => {
+              setSelectedSubjectsKey(c.dictCode)
+            }}
+          >
+            <Icon type="folder-open" />
+            {c.dictLabel}
+          </span>
+        </div>
+      ))}
+    </>
+  )
+
+  useEffect(() => {
+    async function query() {
+      await querySubjects()
+      // await queryDataBySelectedSubject()
+    }
+
+    query()
+  }, [])
+
+  useEffect(() => {
+    if (isNumber(selectedSubjectsKey)) {
+      queryDataBySelectedSubject()
+    }
+  }, [selectedSubjectsKey])
+
+  const handleSave = () => {
+    const s = dataSubject?.find((d) => d.id === tableRowSelection)
+    console.log(s, dataSubject, tableRowSelection, '+++')
+    onSave(s)
+  }
+
+  return (
+    <Modal
+      title="关联标准"
+      visible={visible}
+      onCancel={onCancel}
+      onOk={handleSave}
+      destroyOnClose
+      width="80%"
+    >
+      <Box>
+        <Box.Body>
+          <div className={styles.treeTableContainer}>
+            <div className={styles.treeContainer}>
+              <div className={styles.treeTitle}>
+                <h6>主题</h6>
+              </div>
+              <div className={styles.treeContent}>
+                <Spin spinning={treeLoading}>{renderTree(subjects)}</Spin>
+              </div>
+            </div>
+
+            <div style={{ flex: 1 }}>
+              <Table
+                rowSelection={{
+                  type: 'radio',
+                  selectedRowKeys: [tableRowSelection],
+                  onChange: (selectedRowKeys) => {
+                    // @ts-ignore
+                    setTableRowSelection((c) => selectedRowKeys[0])
+                  }
+                }}
+                style={{ flex: 1 }}
+                bordered
+                rowKey="id"
+                loading={tableLoading}
+                dataSource={dataSubject}
+                columns={tableColumns}
+                pagination={false}
+                // onChange={this.tableChange}
+              />
+            </div>
+          </div>
+          <br />
+        </Box.Body>
+      </Box>
+    </Modal>
+  )
+}
+
+export default withRouter(SubjectModal)

+ 28 - 8
app/containers/DataGovernanceQualityAudit/index.tsx

@@ -26,6 +26,7 @@ import ClassificationsFormModal from 'containers/DataGovernanceQualityAudit/comp
 import QualityTaskFormModal from 'containers/DataGovernanceQualityAudit/components/QualityTaskFormModal'
 import ScheduleFormModal from 'containers/DataGovernanceQualityAudit/components/ScheduleFormModal'
 import header from 'containers/Display/Editor/Header'
+import SubjectModal from 'containers/DataGovernanceQualityAudit/components/SubjectModal'
 
 export default function DataGovernanceQualityAudit() {
   const [tableLoading, setTableLoading] = useState(false)
@@ -184,19 +185,17 @@ export default function DataGovernanceQualityAudit() {
   const handleSetDispatchRightNow = async (data: IQualityTask) => {
     try {
       setTableLoading(true)
-      const result = await request(
-        `${api.setDispatchRightNow}${data.cronJobId}`,
-        {
-          method: 'PUT'
-        }
-      )
+      const result = await request(`${api.setDispatchRightNow}${data.id}`, {
+        method: 'GET'
+      })
+      console.log(result)
       // @ts-ignore
       if (result.header.code === 200) {
         message.success({ content: '立即稽核完成' })
       } else {
         // @ts-ignore
         // tslint:disable-next-line:no-unused-expression
-        result?.header?.msg && message.success({ content: result.header.msg })
+        result?.header?.msg && message.error({ content: result.header.msg })
       }
     } finally {
       setTableLoading(false)
@@ -249,6 +248,26 @@ export default function DataGovernanceQualityAudit() {
     }
   }
 
+  const handleSaveQtForm = async (view) => {
+    try {
+      setQtLoading(true)
+      const url = qtForm?.id
+        ? api.updateQualityTask + qtForm?.id
+        : api.createQualityTask
+      const result = await request(url, {
+        method: qtForm?.id ? 'PUT' : 'POST',
+        data: { ...qtForm, ...view }
+      })
+      // @ts-ignore
+      if (result?.header?.code === 200) {
+        setQtVisible(false)
+        await queryQualityTasks()
+      }
+    } finally {
+      setQtLoading(false)
+    }
+  }
+
   useEffect(() => {
     queryClassifications()
   }, [])
@@ -326,9 +345,10 @@ export default function DataGovernanceQualityAudit() {
         onCancel={() => setCfVisible(false)}
       />
       <QualityTaskFormModal
+        pId={selectedKey}
         visible={qtVisible}
         formView={qtForm}
-        onSave={handleSaveCfForm}
+        onSave={handleSaveQtForm}
         loading={qtLoading}
         onCancel={() => setQtVisible(false)}
       />

+ 12 - 1
app/containers/DataGovernanceQualityAudit/types.ts

@@ -4,7 +4,8 @@ export interface IClassification {
 }
 
 export interface IQualityTask {
-  cronJobId: 6
+  auditorCount: number
+  cronJobId: number
   endTime: string
   id: number
   metadataConfig: string
@@ -39,4 +40,14 @@ export interface ISchedule {
   endDate?: string
   // 非必须项目id
   projectId?: number
+
+  interval?: number
+}
+
+export interface IMetaParam {
+  fieldAlias: string
+  fieldName: string
+  fieldType: string
+  subjectId: string
+  subjectName: string
 }

+ 2 - 1
app/containers/DataManagerView/index.tsx

@@ -175,8 +175,8 @@ export class ViewList extends React.PureComponent<
             `?projectId=${projectId}&parentId=${parentId}`,
           { method: 'get' }
         )
-        // @ts-ignore
         this.setState({
+          // @ts-ignore
           viewList: (data.payload as unknown as IViewBase[]) ?? []
         })
       } catch (e) {
@@ -666,6 +666,7 @@ const mapDispatchToProps = (dispatch: Dispatch<ViewActionType>) => ({
   onCopyView: (view, resolve) => dispatch(ViewActions.copyView(view, resolve)),
   // @ts-ignore
   onCheckName: (data, resolve, reject) =>
+    // @ts-ignore
     dispatch(checkNameUniqueAction('view', data, resolve, reject))
 })
 

+ 4 - 0
app/containers/DataManagerView/types.ts

@@ -46,6 +46,10 @@ export interface IViewBase {
   name: string
   description: string
   sourceName: string
+  relationQuality?: boolean
+  metadataConfig?: string
+  typeName?: string
+  updateTime?: string
 }
 
 type IViewTemp = Omit<IViewBase, 'sourceName'>

+ 4 - 0
app/containers/View/types.ts

@@ -33,6 +33,10 @@ export interface IViewBase {
   name: string
   description: string
   sourceName: string
+  relationQuality?: boolean
+  metadataConfig?: string
+  typeName?: string
+  updateTime?: string
 }
 
 type IViewTemp = Omit<IViewBase, 'sourceName'>