From 136c938340a328b86c926b5bcb44c0ff892183e0 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Thu, 8 Jun 2023 15:21:32 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E6=9C=80=E6=96=B0=E5=85=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../containers/databasesTable.js | 67 ++++++++++-------- .../containers/filesTable.js | 68 +++++++++++-------- .../containers/latestMetadata.js | 4 +- .../containers/restapisTable.js | 50 ++++++++------ 4 files changed, 111 insertions(+), 78 deletions(-) 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 || '')} /> + + + +