脚本管理支持新增文件

This commit is contained in:
hanhh
2021-09-19 21:23:03 +08:00
parent 646443deb5
commit 0baf0d23ae
9 changed files with 234 additions and 54 deletions
+5 -1
View File
@@ -41,7 +41,7 @@ function getFilterData(keyword: string, data: any) {
const Log = ({ headerStyle, isPhone, theme }: any) => {
const [title, setTitle] = useState('请选择日志文件');
const [value, setValue] = useState('请选择日志文件');
const [select, setSelect] = useState();
const [select, setSelect] = useState<any>();
const [data, setData] = useState<any[]>([]);
const [filterData, setFilterData] = useState<any[]>([]);
const [loading, setLoading] = useState(false);
@@ -84,6 +84,9 @@ const Log = ({ headerStyle, isPhone, theme }: any) => {
};
const onSelect = (value: any, node: any) => {
if (node.key === select || !value) {
return;
}
setValue('加载中...');
setSelect(value);
setTitle(node.parent || node.value);
@@ -147,6 +150,7 @@ const Log = ({ headerStyle, isPhone, theme }: any) => {
treeData={filterData}
showIcon={true}
height={height}
selectedKeys={[select]}
showLine={{ showLeafIcon: true }}
onSelect={onTreeSelect}
></Tree>