import { Button, HStack, VStack, Box, Table, Thead, Tr, Td, Th, Tbody, Tooltip, } from "@hope-ui/solid" import { useT, useRouter, useFetch } from "~/hooks" import { createSignal, For } from "solid-js" import { getPermissionList, Permission } from "~/utils/api" import { handleResp } from "~/utils" import { DeletePopover } from "../common/DeletePopover" import { UserPermissions } from "~/types" const Permissions = (props: { permission: Permission }) => { const t = useT() const color = (can: boolean) => `$${can ? "success" : "danger"}9` return ( {(item, i) => ( > i()) & 1) === 1)} > )} ) } const Config = () => { const t = useT() const { to } = useRouter() const [permissions, setPermissions] = createSignal([]) const [loading, getPermissions] = useFetch(() => getPermissionList()) const refresh = async () => { const resp = await getPermissions() handleResp(resp, (data) => { setPermissions(data.content) }) } refresh() return ( {(title) => } {(permission) => ( )}
{t(`permissions.config.${title}`)} {t("global.operations")}
{permission.name} {permission.description} { // TODO: 实现删除权限的功能 }} />
) } export default Config