Commit 2aa7ad81 by zhaochengxiang

调整

parent 3211035b
import React,{ useState, useEffect, useRef, useMemo } from "react"; import React,{ useState, useEffect, useRef, useMemo } from "react";
import { Button, Pagination, Space, Modal, Input, Table, Tooltip, Checkbox, Typography, Dropdown, Menu } from "antd"; import { Button, Pagination, Space, Modal, Input, Table, Tooltip, Checkbox, Typography, Dropdown, Menu, Select } from "antd";
import classNames from 'classnames'; import classNames from 'classnames';
import { Resizable } from 'react-resizable'; import { Resizable } from 'react-resizable';
import ResizeObserver from 'rc-resize-observer'; import ResizeObserver from 'rc-resize-observer';
...@@ -959,47 +959,88 @@ const AssetTable = (props) => { ...@@ -959,47 +959,88 @@ const AssetTable = (props) => {
} }
} }
return( const ResourceHead = (
<div className={classes}> <React.Fragment>
<div <Space>
className='flex p-common' <Button onClick={onFilterElementClick}>可见列设置</Button>
style={{ </Space>
alignItems: 'center', <Space>
justifyContent: 'space-between', <Select
onChange={(value) => {
}} }}
style={{ width: 140 }}
> >
<Space size={15}> <Select.Option value='current'>
{ 当前目录
//栏目和自定义目录 不允许新增资产 </Select.Option>
(reference===AssetManageReference && nodeLevel!==1 && nodeType!=='custom') && <PermissionButton <Select.Option value='currentRecursive'>
defaultPermission={canAdd} 当前及子孙目录
onClick={addAsset} </Select.Option>
<Select.Option value='fullSearch'>
全部数据
</Select.Option>
</Select>
<Search
placeholder="请输入资产要素值"
allowClear
onSearch={onSearchInputChange}
enterButton
style={{ width: inputWidth }}
/>
<Tooltip title={fullScreen?'取消全屏':'全屏'}>
<Button onClick={onFullScreenClick} icon={fullScreen?<CancelFullScreenSvg style={{ width: 20, height: 20 }} />:<FullScreenSvg style={{ width: 20, height: 20 }} />} type='text'></Button>
</Tooltip>
</Space>
</React.Fragment>
)
const AssetHead = (
<React.Fragment>
<Space>
<Button onClick={onFilterElementClick}>可见列设置</Button>
</Space>
<Space>
<Select
onChange={(value) => {
}}
style={{ width: 140 }}
> >
新增 <Select.Option value='current'>
</PermissionButton> 当前目录
} </Select.Option>
{ <Select.Option value='currentRecursive'>
(compact && reference===AssetManageReference) ? <Dropdown overlay={moreMenu} placement="bottomCenter"> 当前及子孙目录
<Button>其他操作</Button> </Select.Option>
</Dropdown> : <React.Fragment> <Select.Option value='fullSearch'>
{ 全部数据
(reference===AssetManageReference && nodeType!=='custom') && <PermissionButton defaultPermission={canImport} onClick={importAsset}>导入</PermissionButton> </Select.Option>
} </Select>
{ <Search
(reference===AssetManageReference || reference===AssetRecycleReference) && <React.Fragment> placeholder="请输入资产要素值"
<PermissionButton defaultPermission={canExport} onClick={exportAsset} >导出</PermissionButton> allowClear
{ onSearch={onSearchInputChange}
(reference === AssetManageReference) && <PermissionButton enterButton
defaultPermission={canChangeDir} style={{ width: inputWidth }}
tip={(checkedKeys||[]).length===0?'请先选择资产':''} />
onClick={onBatchCatalogChangeBtnClick} <Tooltip title={fullScreen?'取消全屏':'全屏'}>
disabled={(checkedKeys||[]).length===0} <Button onClick={onFullScreenClick} icon={fullScreen?<CancelFullScreenSvg style={{ width: 20, height: 20 }} />:<FullScreenSvg style={{ width: 20, height: 20 }} />} type='text'></Button>
</Tooltip>
</Space>
</React.Fragment>
)
const RecycleHead = (
<React.Fragment>
<Space>
<PermissionButton
defaultPermission={canExport}
onClick={exportAsset}
> >
变更目录 导出
</PermissionButton> </PermissionButton>
} <PermissionButton
{
(reference === AssetRecycleReference) && <PermissionButton
onClick={onBatchCatalogChangeBtnClick} onClick={onBatchCatalogChangeBtnClick}
disabled={(checkedKeys||[]).length===0} disabled={(checkedKeys||[]).length===0}
permissionKey='loadDataAsset' permissionKey='loadDataAsset'
...@@ -1008,9 +1049,6 @@ const AssetTable = (props) => { ...@@ -1008,9 +1049,6 @@ const AssetTable = (props) => {
> >
挂载 挂载
</PermissionButton> </PermissionButton>
}
{
(reference===AssetRecycleReference) &&
<PermissionButton <PermissionButton
onClick={recoveryAssets} onClick={recoveryAssets}
disabled={(checkedKeys||[]).length===0} disabled={(checkedKeys||[]).length===0}
...@@ -1020,10 +1058,6 @@ const AssetTable = (props) => { ...@@ -1020,10 +1058,6 @@ const AssetTable = (props) => {
> >
恢复 恢复
</PermissionButton> </PermissionButton>
}
{
//自定义目录下的资产不允许删除
(nodeType!=='custom') &&
<PermissionButton <PermissionButton
defaultPermission={canDelete} defaultPermission={canDelete}
tip={(checkedKeys||[]).length===0?'请先选择资产':''} tip={(checkedKeys||[]).length===0?'请先选择资产':''}
...@@ -1032,20 +1066,9 @@ const AssetTable = (props) => { ...@@ -1032,20 +1066,9 @@ const AssetTable = (props) => {
> >
删除 删除
</PermissionButton> </PermissionButton>
}
</React.Fragment>
}
<Button onClick={onFilterElementClick}>可见列设置</Button> <Button onClick={onFilterElementClick}>可见列设置</Button>
</React.Fragment>
}
{
(reference!==AssetRecycleReference && isSzseEnv) && <Checkbox onChange={onRecursiveChange} checked={!recursive}>仅显示当前目录</Checkbox>
}
</Space> </Space>
<Space> <Space>
{
(reference!==AssetRecycleReference) && <Checkbox onChange={onFullSearchChange} checked={fullSearch}>全部数据</Checkbox>
}
<Search <Search
placeholder="请输入资产要素值" placeholder="请输入资产要素值"
allowClear allowClear
...@@ -1053,12 +1076,28 @@ const AssetTable = (props) => { ...@@ -1053,12 +1076,28 @@ const AssetTable = (props) => {
enterButton enterButton
style={{ width: inputWidth }} style={{ width: inputWidth }}
/> />
</Space>
</React.Fragment>
)
return(
<div className={classes}>
<div
className='flex p-common'
style={{
alignItems: 'center',
justifyContent: 'space-between',
}}
>
{ {
(reference!==AssetRecycleReference) && <Tooltip title={fullScreen?'取消全屏':'全屏'}> reference === ResourceBrowseReference && ResourceHead
<Button onClick={onFullScreenClick} icon={fullScreen?<CancelFullScreenSvg style={{ width: 20, height: 20 }} />:<FullScreenSvg style={{ width: 20, height: 20 }} />} type='text'></Button> }
</Tooltip> {
reference === AssetBrowseReference && AssetHead
}
{
reference === AssetRecycleReference && RecycleHead
} }
</Space>
</div> </div>
<div <div
className='px-common' className='px-common'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment