Commit 2789022a by zhaochengxiang

资产管理样式调整

parent e902212a
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { SettingOutlined } from '@ant-design/icons';
import { Spin, Tooltip, Typography, Dropdown, Menu } from 'antd'; import { Spin, Tooltip, Typography, Dropdown, Menu } from 'antd';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
......
...@@ -497,7 +497,7 @@ const AssetTable = (props) => { ...@@ -497,7 +497,7 @@ const AssetTable = (props) => {
{ {
(reference===AssetManageReference) && <Button onClick={importAsset}>导入</Button> (reference===AssetManageReference) && <Button onClick={importAsset}>导入</Button>
} }
{/* { {
(reference===AssetManageReference || reference===AssetRecycleReference) && <React.Fragment> (reference===AssetManageReference || reference===AssetRecycleReference) && <React.Fragment>
<Tooltip title={(checkedKeys||[]).length===0?'请先选择资产':''}> <Tooltip title={(checkedKeys||[]).length===0?'请先选择资产':''}>
<Button onClick={exportAsset} disabled={(checkedKeys||[]).length===0} >导出</Button> <Button onClick={exportAsset} disabled={(checkedKeys||[]).length===0} >导出</Button>
...@@ -511,7 +511,7 @@ const AssetTable = (props) => { ...@@ -511,7 +511,7 @@ const AssetTable = (props) => {
</React.Fragment> </React.Fragment>
} }
<Button onClick={onFilterElementClick}>要素设置</Button> <Button onClick={onFilterElementClick}>要素设置</Button>
<Checkbox onChange={onRecursiveChange} checked={!recursive}>仅显示当前目录</Checkbox> */} <Checkbox onChange={onRecursiveChange} checked={!recursive}>仅显示当前目录</Checkbox>
</Space> </Space>
<Space> <Space>
<Input <Input
...@@ -522,7 +522,7 @@ const AssetTable = (props) => { ...@@ -522,7 +522,7 @@ const AssetTable = (props) => {
style={{ width: inputWidth }} style={{ width: inputWidth }}
/> />
<Tooltip title={fullScreen?'取消全屏':'全屏'}> <Tooltip title={fullScreen?'取消全屏':'全屏'}>
<Button onClick={onFullScreenClick} icon={<img src={fullScreen?CancelFullScreenImg:FullScreenImg} width={20} height={20} />} type='text'></Button> <Button onClick={onFullScreenClick} icon={<img src={fullScreen?CancelFullScreenImg:FullScreenImg} width={20} height={20} alt='' />} type='text'></Button>
</Tooltip> </Tooltip>
</Space> </Space>
</div> </div>
......
...@@ -525,23 +525,29 @@ const AssetTree = (props) => { ...@@ -525,23 +525,29 @@ const AssetTree = (props) => {
</Menu> </Menu>
); );
const loop = data => const loop = (data, isRootLeaf= true) =>
data.map(item => { data.map(item => {
const index = item.text.indexOf(keyword); const index = item.text.indexOf(keyword);
const beforeStr = item.text.substr(0, index); const beforeStr = item.text.substr(0, index);
const afterStr = item.text.substr(index + keyword.length); const afterStr = item.text.substr(index + keyword.length);
const title = const title =
index > -1 ? ( index > -1 ? (
<span> <span
className={isRootLeaf?'title-color': 'text-color'}
style={{ fontWeight: isRootLeaf?'bold': '' }}
>
{beforeStr} {beforeStr}
<span className="site-tree-search-value">{keyword}</span> <span className="site-tree-search-value">{keyword}</span>
{afterStr} {afterStr}
</span> </span>
) : ( ) : (
<span>{item.text}</span> <span
className={isRootLeaf?'title-color': 'text-color'}
style={{ fontWeight: isRootLeaf?'bold': '' }}
>{item.text}</span>
); );
if (item.children) { if (item.children) {
return { title, key: item.nodeId, children: loop(item.children) }; return { title, key: item.nodeId, children: loop(item.children, false) };
} }
return { return {
...@@ -560,53 +566,53 @@ const AssetTree = (props) => { ...@@ -560,53 +566,53 @@ const AssetTree = (props) => {
className={classes} className={classes}
title={ (reference===AssetBrowseReference||reference===ResourceBrowseReference || reference===AssetMountReference) ? null : ( title={ (reference===AssetBrowseReference||reference===ResourceBrowseReference || reference===AssetMountReference) ? null : (
<div <div
className='p-3' className='flex px-2'
style={{ style={{
display: 'flex', height: 60,
height: 52, alignItems: 'center',
alignItems: 'center' justifyContent: 'space-between',
}} }}
> >
<Tooltip title="新增目录"> <Tooltip title="新增目录">
<PlusOutlined onClick={addDir} style={{ fontSize:16,cursor: (currentDirType==='custom-root'||currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom')?'#bfbfbf': '' }}/> <PlusOutlined onClick={addDir} style={{ fontSize:16,cursor: (currentDirType==='custom-root'||currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom')?'#bfbfbf': '' }}/>
</Tooltip> </Tooltip>
<Tooltip title="修改目录" className='ml-2'> <Tooltip title="修改目录">
<EditOutlined onClick={editDir} style={{ fontSize:16,cursor: 'pointer' }} /> <EditOutlined onClick={editDir} style={{ fontSize:16,cursor: 'pointer' }} />
</Tooltip> </Tooltip>
<Tooltip title="刷新目录" className='ml-2'> <Tooltip title="刷新目录">
<ReloadOutlined onClick={refreshTree} style={{ fontSize:16,cursor:'pointer' }} /> <ReloadOutlined onClick={refreshTree} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip> </Tooltip>
<Tooltip title="导入目录" className='ml-2'> <Tooltip title="导入目录">
<ImportOutlined onClick={importDir} style={{ fontSize:16,cursor:(currentDirType==='custom-root'||currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom')?'#bfbfbf': '' }} /> <ImportOutlined onClick={importDir} style={{ fontSize:16,cursor:(currentDirType==='custom-root'||currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom')?'#bfbfbf': '' }} />
</Tooltip> </Tooltip>
<Dropdown overlay={exportMenu} placement="bottomLeft" className='ml-3'> <Dropdown overlay={exportMenu} placement="bottomLeft" >
<Tooltip title="导出目录"> <Tooltip title="导出目录">
<ExportOutlined style={{ fontSize:16,cursor:'pointer' }} /> <ExportOutlined style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip> </Tooltip>
</Dropdown> </Dropdown>
<Tooltip title="上移目录" className='ml-2'> <Tooltip title="上移目录">
<ArrowUpOutlined onClick={() => { moveNode(1); }} style={{ fontSize:16,cursor:'pointer' }} /> <ArrowUpOutlined onClick={() => { moveNode(1); }} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip> </Tooltip>
<Tooltip title="下移目录" className='ml-2'> <Tooltip title="下移目录">
<ArrowDownOutlined onClick={() => { moveNode(-1); }} style={{ fontSize:16,cursor:'pointer' }} /> <ArrowDownOutlined onClick={() => { moveNode(-1); }} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip> </Tooltip>
<Tooltip title="删除目录" className='ml-2'> <Tooltip title="删除目录">
<DeleteOutlined onClick={deleteDir} style={{ fontSize:16,cursor:(currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom')?'#bfbfbf': '' }} /> <DeleteOutlined onClick={deleteDir} style={{ fontSize:16,cursor:(currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom')?'#bfbfbf': '' }} />
</Tooltip> </Tooltip>
<Tooltip title="自定义目录" className='ml-2'> <Tooltip title="自定义目录">
<SettingOutlined onClick={customDir} style={{ fontSize:16,cursor:'pointer' }} /> <SettingOutlined onClick={customDir} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip> </Tooltip>
</div> </div>
)} )}
bordered={false} bordered={false}
bodyStyle={{ padding: 10 }} bodyStyle={{ padding: '24px 15px' }}
headStyle={{ padding: 0 }} headStyle={{ padding: 0 }}
style={{ width: '100%' }} style={{ width: '100%' }}
> >
<Spin spinning={loading}> <Spin spinning={loading}>
<Input <Input
value={keyword} value={keyword}
style={{ marginBottom:10 }} style={{ marginBottom: 24 }}
onChange={(e) => { onChange(e) }} onChange={(e) => { onChange(e) }}
/> />
<Tree <Tree
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
} }
.yy-tree{ .yy-tree{
height: calc(100vh - @header-height - @pm-4 - @pm-3 - 33px + 1px - 20px - 42px) !important; height: calc(100vh - @header-height - 30px - 60px - 104px) !important;
overflow: auto !important; overflow: auto !important;
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.asset-tree-read-only { .asset-tree-read-only {
.yy-tree { .yy-tree {
height: calc(100vh - @header-height - @pm-4 - 20px - 42px) !important;; height: calc(100vh - @header-height - 30px - 60px - 104px) !important;;
overflow: auto !important; overflow: auto !important;
} }
} }
......
...@@ -65,7 +65,9 @@ const AssetManage = (props) => { ...@@ -65,7 +65,9 @@ const AssetManage = (props) => {
<div className='left'> <div className='left'>
<AssetTree onSelect={onTreeSelect} onDirectoryChange={onDirectoryChange} {...props} /> <AssetTree onSelect={onTreeSelect} onDirectoryChange={onDirectoryChange} {...props} />
</div> </div>
<Separate width={15} /> {
expandTree && <Separate width={15} />
}
<div className='middle'> <div className='middle'>
<AssetDirectory id={nodeId} assetCount={assetCount} directoryChanged={directoryChanged} onElementsChange={onElementsChange} /> <AssetDirectory id={nodeId} assetCount={assetCount} directoryChanged={directoryChanged} onElementsChange={onElementsChange} />
<Separate height={15} /> <Separate height={15} />
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
} }
.tree-toggle { .tree-toggle {
left: 15px; left: 0;
} }
.middle { .middle {
......
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