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

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

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