Commit d21a7c03 by zhaochengxiang

资产搜索

parent 7caeba5d
...@@ -29,7 +29,7 @@ export const routes = [ ...@@ -29,7 +29,7 @@ export const routes = [
}, },
{ {
name: 'asset-recycle', name: 'asset-recycle',
text: '资产回收站', text: '未分类资产',
} }
] ]
} }
......
import React,{ useState, useEffect } from "react"; import React,{ useState, useEffect } from "react";
import { Card, Checkbox, Button, List, Skeleton, Pagination, Space, Modal, Switch, Divider, Tooltip, Popover } from "antd"; import { Card, Checkbox, Button, List, Skeleton, Pagination, Space, Modal, Switch, Divider, Tooltip, Popover, Input } from "antd";
import { EditOutlined, ReconciliationOutlined, DeleteOutlined } from '@ant-design/icons'; import { EditOutlined, ReconciliationOutlined, DeleteOutlined } from '@ant-design/icons';
import ImportElement from './ImportElement'; import ImportElement from './ImportElement';
...@@ -31,6 +31,7 @@ const AssetTable = (props) =>{ ...@@ -31,6 +31,7 @@ const AssetTable = (props) =>{
const [ assetEditAction, setAssetEditAction ] = useState(''); const [ assetEditAction, setAssetEditAction ] = useState('');
const [ pagination, setPagination ] = useState( { pageNum: 1, pageSize: 20 } ); const [ pagination, setPagination ] = useState( { pageNum: 1, pageSize: 20 } );
const { pageNum, pageSize } = pagination; const { pageNum, pageSize } = pagination;
const [ keyword, setKeyword ] = useState('');
const [ modal, contextHolder ] = Modal.useModal(); const [ modal, contextHolder ] = Modal.useModal();
...@@ -49,7 +50,7 @@ const AssetTable = (props) =>{ ...@@ -49,7 +50,7 @@ const AssetTable = (props) =>{
getTable(); getTable();
} }
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
}, [ pagination ]) }, [ keyword, pagination ])
const changeCurrent=(page,size)=>{ const changeCurrent=(page,size)=>{
setPagination({ pageNum: page, pageSize: size }); setPagination({ pageNum: page, pageSize: size });
...@@ -63,7 +64,7 @@ const AssetTable = (props) =>{ ...@@ -63,7 +64,7 @@ const AssetTable = (props) =>{
dirId: nodeId, dirId: nodeId,
pageNum, pageNum,
pageSize, pageSize,
keyword: '' keyword: keyword
}, },
callback: data => { callback: data => {
const _assetNames = []; const _assetNames = [];
...@@ -86,6 +87,11 @@ const AssetTable = (props) =>{ ...@@ -86,6 +87,11 @@ const AssetTable = (props) =>{
}) })
} }
const onSearchInputChange = (e) => {
setKeyword(e.target.value||'');
setPagination({ ...pagination, pageNum: 1 });
}
const onRecycleClick =() => { const onRecycleClick =() => {
window.location.href = '/center-home/view/asset-recycle'; window.location.href = '/center-home/view/asset-recycle';
} }
...@@ -109,7 +115,7 @@ const AssetTable = (props) =>{ ...@@ -109,7 +115,7 @@ const AssetTable = (props) =>{
const deleteAsset = (item) =>{ const deleteAsset = (item) =>{
modal.confirm({ modal.confirm({
title: '提示', title: '提示',
content: '该资产在所有目录上唯一存在,移除后,你可以前往“资产回收站”重新挂载。', content: '该资产在所有目录上唯一存在,移除后,你可以前往“未分类资产”重新挂载。',
onOk: () => { onOk: () => {
dispatch({ dispatch({
type: 'assetmanage.unloadDataAssets', type: 'assetmanage.unloadDataAssets',
...@@ -245,8 +251,18 @@ const AssetTable = (props) =>{ ...@@ -245,8 +251,18 @@ const AssetTable = (props) =>{
bodyStyle={{ padding: '0 10px' }} bodyStyle={{ padding: '0 10px' }}
headStyle={{ padding: 10 }} headStyle={{ padding: 10 }}
title={ title={
<div className='d-flex'> <div className='d-flex' style={{ justifyContent: 'space-between' }}>
<Button style={{ marginLeft: 'auto' }} type="primary"onClick={onRecycleClick} >资产回收站</Button> <Space>
<span>资产搜索:</span>
<Input
placeholder="请输入资产要素值"
allowClear
value={keyword}
onChange={onSearchInputChange}
style={{ width: 240, marginLeft: 'auto' }}
/>
</Space>
<Button style={{ marginLeft: 'auto' }} type="primary"onClick={onRecycleClick} >未分类资产</Button>
</div> </div>
} }
> >
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
text-align: right; text-align: right;
} }
.yy-card-head-title { .yy-card-head-title {
font-weight: normal;
font-size: 14px;
padding: 0; padding: 0;
} }
.yy-list-vertical .yy-list-item-action > li { .yy-list-vertical .yy-list-item-action > li {
......
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