Commit 4127ede8 authored by 涂伟's avatar 涂伟

feat: '移动菜单配置新增搜索'

parent 6c5afabb
...@@ -57,6 +57,9 @@ const MiniMenu = props => { ...@@ -57,6 +57,9 @@ const MiniMenu = props => {
const [inf, setInf] = useState({}); const [inf, setInf] = useState({});
const [checkList, setCheckList] = useState([]); const [checkList, setCheckList] = useState([]);
const [importOrExportVisible, setImportOrExportVisible] = useState(false); // 导入导出弹窗 const [importOrExportVisible, setImportOrExportVisible] = useState(false); // 导入导出弹窗
const [keywords, setKeywords] = useState('');
const { Search } = Input;
// 获取菜单树 // 获取菜单树
useEffect(() => { useEffect(() => {
...@@ -84,10 +87,19 @@ const MiniMenu = props => { ...@@ -84,10 +87,19 @@ const MiniMenu = props => {
getInfo(); getInfo();
}, [menuID]); }, [menuID]);
const onChangeSearch = e => {
setKeywords(e.target.value);
};
const onSearch = value => {
updateTrees('', value);
};
// 更新树 // 更新树
const updateTrees = e => { const updateTrees = (e,keyword) => {
getMiniAppModuleTree({ getMiniAppModuleTree({
userMode: userMode || 'super', userMode: userMode || 'super',
keyword
}) })
.then(res => { .then(res => {
// console.log(res, 'res'); // console.log(res, 'res');
...@@ -744,6 +756,17 @@ const MiniMenu = props => { ...@@ -744,6 +756,17 @@ const MiniMenu = props => {
</Tooltip> </Tooltip>
</div> </div>
</div> </div>
<Search
style={{
marginBottom: 8,
width: '98%',
marginLeft: '7px',
}}
value={keywords}
placeholder="快速搜索菜单"
onChange={onChangeSearch}
onSearch={onSearch}
/>
{treeData.length > 0 ? ( {treeData.length > 0 ? (
<div style={{ height: 'calc(100% - 35px)', overflowY: 'scroll' }}> <div style={{ height: 'calc(100% - 35px)', overflowY: 'scroll' }}>
<Tree <Tree
......
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