|
|
@ -1,6 +1,6 @@ |
|
|
|
import React, { useEffect, useState } from 'react'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import { Spin, Table, Popconfirm, Button, Input } from 'antd'; |
|
|
|
import { Spin, Table, Popconfirm, Button, Input, Row, Col } from 'antd'; |
|
|
|
import { ButtonGroup } from '$components'; |
|
|
|
import moment from 'moment'; |
|
|
|
import FileSaver from 'file-saver'; |
|
|
@ -173,13 +173,18 @@ const DatabaseTable = (props) => { |
|
|
|
ra.applyBy == user.id && ra.resourceName === record.name); |
|
|
|
return <ButtonGroup> |
|
|
|
<a onClick={() => onView(record)}>查看</a> |
|
|
|
{user.role == '数据消费者' ? null : |
|
|
|
<> |
|
|
|
<a style={{ marginLeft: 10 }} onClick={() => onEdit(record)}>编辑</a> |
|
|
|
<Popconfirm |
|
|
|
title="是否确认删除该元数据?" |
|
|
|
onConfirm={() => confirmDelete(record.id)} |
|
|
|
> <a style={{ marginLeft: 10 }}>删除</a></Popconfirm> |
|
|
|
{record.type === '表' ? <a style={{ marginLeft: 10 }} onClick={() => marking(record.id)}>打标</a> : null} |
|
|
|
{user.role == '系统管理员' ? '' : record.type === '表' ? resourceApplicationsRecords.length === 0 ? |
|
|
|
</> |
|
|
|
} |
|
|
|
|
|
|
|
{user.role !== '数据消费者' ? null : record.type === '表' ? resourceApplicationsRecords.length === 0 ? |
|
|
|
<a style={{ marginLeft: 10 }} onClick={() => applyResources(record)}>申请资源</a> : |
|
|
|
<span style={{ marginLeft: 10, color: "#c0c0c0" }} title='已存在资源申请'>申请资源</span> : null} |
|
|
|
</ButtonGroup> |
|
|
@ -252,7 +257,9 @@ const DatabaseTable = (props) => { |
|
|
|
} |
|
|
|
} |
|
|
|
return <Spin spinning={isRequesting}> |
|
|
|
<div style={{ marginBottom: 16 }}> |
|
|
|
<Row style={{ marginBottom: 16 }}> |
|
|
|
<Col span={12}> |
|
|
|
{user.role == '数据消费者' ? null : <> |
|
|
|
<Button type='primary' onClick={() => { |
|
|
|
dispatch(metadataManagement.getMetadataModels({ modelTypes: ModelTypes.join(',') })).then(res => { |
|
|
|
if (res.success) { |
|
|
@ -269,10 +276,14 @@ const DatabaseTable = (props) => { |
|
|
|
<Button disabled={tableDataCount == 0} style={{ marginLeft: 16 }}> 导出</Button> |
|
|
|
</Popconfirm> |
|
|
|
} |
|
|
|
<Button type='primary' style={{ marginLeft: 16, float: 'right' }} onClick={onSearch}>查询</Button> |
|
|
|
<Input style={{ width: 220, float: 'right' }} placeholder="名称/代码/类型" |
|
|
|
</>} |
|
|
|
</Col> |
|
|
|
<Col span={12} style={{ display: 'flex', justifyContent: 'flex-end' }}> |
|
|
|
<Input style={{ width: 220 }} placeholder="名称/代码/类型" |
|
|
|
allowClear onPressEnter={onSearch} onChange={e => setKeywords(e.target.value || '')} /> |
|
|
|
</div > |
|
|
|
<Button type='primary' style={{ marginLeft: 16 }} onClick={onSearch}>查询</Button> |
|
|
|
</Col> |
|
|
|
</Row > |
|
|
|
<Table |
|
|
|
scroll={{ y: clientHeight - 320 }} |
|
|
|
rowKey='id' |
|
|
|