Commit d21a7c03 by zhaochengxiang

资产搜索

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