diff --git a/src/components/layout/layout.tsx b/src/components/layout/layout.tsx index d177083..5e77155 100644 --- a/src/components/layout/layout.tsx +++ b/src/components/layout/layout.tsx @@ -57,19 +57,24 @@ const LayOut = (props: Store) => { const [stateOpenKeys, setStateOpenKeys] = useState(['2', '23']); useEffect(() => { usrStore.getMenu().then((res) => { - const men: any = [...res]; - men.forEach(element => { - element.label = element.name; - element.key = element.router_path; - if (element.children?.length > 0) { - element.children?.forEach((i) => { - i.label = i.name; - i.key = i.router_path; - }) - } - if (element.children?.length === 0) { - element.children = null - } + const men: any = []; + res.forEach(ele => { + items.forEach((v: any) => { + if (ele.router_path === v.key) { + if (ele.children.length > 0) { + const childs: any = [] + ele.children.forEach(eles => { + v.children.forEach(vs => { + if (eles.router_path === vs.key) { + childs.push(vs) + } + }); + }); + v.children = childs + } + men.push(v) + } + }) }); setMenus(men) }) diff --git a/src/pages/source/source.tsx b/src/pages/source/source.tsx index ed2a5ba..282cbb1 100644 --- a/src/pages/source/source.tsx +++ b/src/pages/source/source.tsx @@ -23,9 +23,7 @@ const Source = (props: Store) => { const [coloums, setColumns] = useState([]); const [content, setContent] = useState([]); const [selectKey, setSelectKey] = useState>([ - "01JM4XMY2N9KN23XSZJSQQM3HY", - "01JM4XMY2N9KN23XSZJSWQHHKA", - + "01JXVJXFDM39TN9FYCM33TQ0X0", "01JXVJXFDM39TN9FYCM3A0NFVP", "01JXVJXFDM39TN9FYCM4QK3RK5", "01JXVJXFDM39TN9FYCM8J27EYY", "01JXVJXFDM39TN9FYCMAHHNPQ7" ]); const [page, setPage] = useState(1); const [editingKey, setEditingKey] = useState(""); @@ -41,7 +39,7 @@ const Source = (props: Store) => { useEffect(() => { sourceStore.getHead().then((res) => { res.forEach((element) => { - element.dataIndex = "dbs_" + element.identity.toLowerCase(); + element.dataIndex = element.identity; element.title = element.data_name; element.label = element.data_name; element.value = element.identity; @@ -75,7 +73,7 @@ const Source = (props: Store) => { setLoading(true); sourceStore.geContent(list, index, 20).then((res) => { res.forEach((element) => { - element.key = "dbs_" + element.identity; + element.key = element.identity; }); setContent(res); setLoading(false); @@ -88,7 +86,7 @@ const Source = (props: Store) => { const saveClo = () => { let list: any = []; - if(rowKeys.length===0) { + if (rowKeys.length === 0) { message.info("请选择需要导出的列"); return; } @@ -140,20 +138,6 @@ const Source = (props: Store) => { > 编辑 - {/* { - // deleteCallback(record.identity); - }} - onCancel={cancel} - okText="Yes" - cancelText="No" - > - */} - {/* */} ); }, diff --git a/src/static/qx.png b/src/static/qx.png new file mode 100644 index 0000000..49a3877 Binary files /dev/null and b/src/static/qx.png differ diff --git a/src/static/sj.png b/src/static/sj.png new file mode 100644 index 0000000..eaa754e Binary files /dev/null and b/src/static/sj.png differ diff --git a/src/static/sy.png b/src/static/sy.png new file mode 100644 index 0000000..5f7dbc7 Binary files /dev/null and b/src/static/sy.png differ diff --git a/src/static/xt.png b/src/static/xt.png new file mode 100644 index 0000000..ce1162a Binary files /dev/null and b/src/static/xt.png differ diff --git a/src/static/yh.png b/src/static/yh.png new file mode 100644 index 0000000..e479196 Binary files /dev/null and b/src/static/yh.png differ