diff --git a/web/client/src/sections/metadataManagement/containers/databasesTable.js b/web/client/src/sections/metadataManagement/containers/databasesTable.js index beac381..db40d2e 100644 --- a/web/client/src/sections/metadataManagement/containers/databasesTable.js +++ b/web/client/src/sections/metadataManagement/containers/databasesTable.js @@ -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 onView(record)}>查看 - onEdit(record)}>编辑 - confirmDelete(record.id)} - > 删除 - {record.type === '表' ? marking(record.id)}>打标 : null} - {user.role == '系统管理员' ? '' : record.type === '表' ? resourceApplicationsRecords.length === 0 ? + {user.role == '数据消费者' ? null : + <> + onEdit(record)}>编辑 + confirmDelete(record.id)} + > 删除 + {record.type === '表' ? marking(record.id)}>打标 : null} + + } + + {user.role !== '数据消费者' ? null : record.type === '表' ? resourceApplicationsRecords.length === 0 ? applyResources(record)}>申请资源 : 申请资源 : null} @@ -252,27 +257,33 @@ const DatabaseTable = (props) => { } } return -
- + { + tableDataCount == 0 ? : + selectedRowKeys && selectedRowKeys.length ? + + : handleExport(true)} okText="确定" cancelText="取消"> + + } - }) - }}>新建 - { - tableDataCount == 0 ? : - selectedRowKeys && selectedRowKeys.length ? - - : handleExport(true)} okText="确定" cancelText="取消"> - - - } - - setKeywords(e.target.value || '')} /> -
+ } + + + setKeywords(e.target.value || '')} /> + + + { let resourceApplicationsRecords = metadataResourceApplications.filter(ra => ra.applyBy == user.id && ra.resourceName === record.name); return - onEdit(record)}>编辑 - confirmDelete(record)} - > 删除 - marking(record.id)}>打标 + {user.role == '数据消费者' ? null : + <> + onEdit(record)}>编辑 + confirmDelete(record)} + >删除 + marking(record.id)}>打标 + + } + {user.role == '系统管理员' ? '' : resourceApplicationsRecords.length === 0 ? applyResources(record)}>申请资源 : 申请资源} @@ -298,27 +303,34 @@ const FilesTable = (props) => { } } return -
- - { - tableDataCount == 0 ? : - selectedRowKeys && selectedRowKeys.length ? - - : handleExport(true)} okText="确定" cancelText="取消"> - - - } - - setKeywords(e.target.value || '')} /> -
+ +
+ {user.role == '数据消费者' ? null : <> + + { + tableDataCount == 0 ? : + selectedRowKeys && selectedRowKeys.length ? + + : handleExport(true)} okText="确定" cancelText="取消"> + + + }} + + + setKeywords(e.target.value || '')} /> + + + + +
{ - + }}>新建资源目录} { let resourceApplicationsRecords = metadataResourceApplications.filter(ra => ra.applyBy == user.id && ra.resourceName === record.name); return - onEdit(record)}>编辑 - confirmDelete(record.id)} - > 删除 - marking(record.id)}>打标 + {user.role == '数据消费者' ? null : + <> + onEdit(record)}>编辑 + confirmDelete(record.id)} + > 删除 + marking(record.id)}>打标 + + } + {user.role == '系统管理员' ? '' : resourceApplicationsRecords.length === 0 ? applyResources(record)}>申请资源 : 申请资源} @@ -180,19 +185,24 @@ const RestapisTable = (props) => { } } return -
- - - setKeywords(e.target.value || '')} /> -
+ +
+ {user.role == '数据消费者' ? null : <> } + + + setKeywords(e.target.value || '')} /> + + + +