chore: remove unused files flagged by react-doctor

Deleted modules with no remaining references:
- app/person/dashboard/components/Icon.tsx
- components/label/hooks/useAuth.ts
- components/layout/components/icons/custom.tsx
- components/tree-select/index.tsx

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
zhangheng
2026-06-05 11:18:46 +08:00
parent 1aa75ef58e
commit 0908af2e96
4 changed files with 0 additions and 484 deletions

View File

@@ -1,115 +0,0 @@
"use client"
import { usePermissionStore } from "@/components/label/store/auth"
import { usePathname } from "next/navigation"
interface PermissionItem {
[x: string]: [boolean, null, string]
}
type PermissionMap = {
[x: string]: PermissionItem
}
const mappingList: { [x: string]: [string, string] } = {
"/person/dashboard": ["task", "view"],
"/person/report": ["daily_work", "self_view"],
"/person/workload": ["workload", "self_view"],
}
export const headerBarCheckItems = (data: PermissionMap) => {
const projectTitle = [
["daily_work", "self_view"],
["label_schema", "view"],
["project", "view"],
["task", "view"],
] as const
let projectVisible = false
projectTitle.forEach(([prop, subProp]) => {
if (data[prop] && data[prop][subProp] && data[prop][subProp][0]) {
projectVisible = true
}
})
const staffTitle = [
["daily_work", "team_view"],
["user", "view"],
["user", "group_view"],
] as const
let staffVisible = false
staffTitle.forEach(([prop, subProp]) => {
if (data[prop] && data[prop][subProp] && data[prop][subProp][0]) {
staffVisible = true
}
})
return [projectVisible, staffVisible]
}
const useAuth = () => {
const pathname = usePathname()
const detailInfo = usePermissionStore((s) => s.detailInfo)
const permission = detailInfo?.permissions as PermissionMap | undefined
const roleName: string[] = detailInfo?.role_name ?? []
return {
hasPermission: () => {
if (
[
"/",
"/login",
"/management",
"/management/person/dashboard",
"/management/team",
].includes(pathname)
) {
return true
}
if (!permission) return false
if (mappingList[pathname]) {
const [prop, subProp] = mappingList[pathname]
return (
!!permission[prop] &&
!!permission[prop][subProp] &&
!!permission[prop][subProp][0]
)
}
return false
},
// path 跳转是否可见
canNv: (path: string, type = "view") => {
if (!permission) return false
if (mappingList[path]) {
const [prop] = mappingList[path]
return (
!!permission[prop] &&
!!permission[prop][type] &&
!!permission[prop][type][0]
)
}
return false
},
// 当前页面是否可见某个操作
isShow: (type = "view") => {
if (!permission) return false
if (mappingList[pathname]) {
const [prop] = mappingList[pathname]
return (
!!permission[prop] &&
!!permission[prop][type] &&
!!permission[prop][type][0]
)
}
return false
},
checkRole: (name: string) => {
if (!name) return false
return roleName.includes(name)
},
}
}
export default useAuth

View File

@@ -1,86 +0,0 @@
import { SVGProps } from "react"
export function SystemIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}>
<path
d="M11.7284 13.9936H4.40328C4.33652 13.9924 4.2702 14.0045 4.20818 14.0293C4.14616 14.0541 4.08969 14.0909 4.04206 14.1378C3.99444 14.1846 3.95661 14.2405 3.93078 14.3021C3.90496 14.3637 3.89166 14.4299 3.89166 14.4967C3.89166 14.5636 3.90496 14.6297 3.93078 14.6914C3.95661 14.753 3.99444 14.8089 4.04206 14.8557C4.08969 14.9026 4.14616 14.9394 4.20818 14.9642C4.2702 14.989 4.33652 15.0011 4.40328 14.9999H11.7356C11.8017 15.0003 11.8672 14.9876 11.9284 14.9624C11.9896 14.9373 12.0451 14.9002 12.0919 14.8535C12.1387 14.8067 12.1757 14.751 12.2008 14.6898C12.226 14.6286 12.2387 14.563 12.2383 14.4968C12.2311 14.2235 12.0084 13.9936 11.7284 13.9936ZM14.3001 1H1.70284C1.51665 1 1.33807 1.07395 1.2063 1.20561C1.07453 1.33728 1.00033 1.5159 1 1.70227L1 12.3011C1.00029 12.4875 1.07447 12.6661 1.20624 12.7978C1.33802 12.9295 1.51662 13.0035 1.70284 13.0035H14.3001C14.4864 13.0035 14.665 12.9295 14.7967 12.7978C14.9285 12.6661 15.0027 12.4875 15.003 12.3011V1.70227C15.0026 1.5159 14.9284 1.33728 14.7967 1.20561C14.6649 1.07395 14.4863 1 14.3001 1ZM12.4325 7.62061C12.4098 7.72479 12.3593 7.82086 12.2863 7.89853C12.2133 7.97621 12.1206 8.03259 12.0181 8.06164L11.8866 8.09447C11.5312 8.19946 11.2295 8.43678 11.0436 8.75762C10.8577 9.07846 10.8016 9.45842 10.887 9.81935L10.9339 9.95098C10.9597 10.054 10.9573 10.162 10.9271 10.2638C10.8969 10.3655 10.8399 10.4573 10.7621 10.5294C10.598 10.6552 10.4243 10.7678 10.2424 10.866C10.0638 10.9708 9.87926 11.0653 9.68985 11.149C9.58837 11.1804 9.48026 11.1835 9.37715 11.158C9.27404 11.1325 9.17982 11.0793 9.10462 11.0042L9.00592 10.8989C8.73758 10.6422 8.38074 10.499 8.00961 10.499C7.63848 10.499 7.28164 10.6422 7.0133 10.8989L6.91459 11.0042C6.83727 11.0759 6.7424 11.1258 6.6396 11.1489C6.5368 11.172 6.42971 11.1675 6.32921 11.1359C6.13739 11.0574 5.95258 10.9627 5.77678 10.8529C5.595 10.7549 5.42129 10.6426 5.25731 10.5171C5.17964 10.4448 5.12278 10.353 5.0927 10.2513C5.06261 10.1495 5.0604 10.0415 5.08628 9.93863L5.1258 9.80684C5.20852 9.44598 5.15048 9.06712 4.96354 8.74764C4.7766 8.42817 4.47486 8.19219 4.11996 8.0879L3.98845 8.05507C3.78416 7.99582 3.62017 7.83119 3.57331 7.62061C3.54931 7.41519 3.53835 7.20846 3.54051 7.00166C3.535 6.79486 3.54597 6.58794 3.57331 6.38288C3.59835 6.2805 3.6498 6.18648 3.72252 6.11024C3.79523 6.034 3.88666 5.9782 3.98767 5.94841L4.12574 5.91558C4.86263 5.69827 5.29666 4.94081 5.11955 4.19039L5.08019 4.05876C5.05463 3.95571 5.057 3.8477 5.08706 3.74587C5.11712 3.64405 5.17379 3.5521 5.25121 3.47952C5.41508 3.35185 5.58878 3.23737 5.77069 3.13714C5.94903 3.03251 6.13316 2.93809 6.32218 2.85433C6.52616 2.78851 6.74966 2.84776 6.90756 2.99925L7.00612 3.10447C7.27278 3.36126 7.62806 3.5053 7.99809 3.50664C8.36813 3.50798 8.72444 3.36652 8.99295 3.11166L9.09166 3.00629C9.16791 2.93288 9.26212 2.88086 9.36482 2.85545C9.46752 2.83003 9.5751 2.83213 9.67673 2.86152C9.86856 2.94005 10.0534 3.03477 10.2292 3.14465C10.411 3.24265 10.5847 3.35494 10.7488 3.48046C10.8263 3.55298 10.8831 3.64489 10.9133 3.74671C10.9435 3.84853 10.946 3.95658 10.9206 4.05969L10.8737 4.19133C10.6896 4.93456 11.1302 5.69827 11.8668 5.91558L12.0116 5.94841C12.1137 5.97605 12.2062 6.03116 12.2793 6.10775C12.3523 6.18435 12.4029 6.2795 12.4258 6.38288C12.4531 6.58794 12.4642 6.79485 12.4587 7.00166C12.4698 7.20834 12.461 7.41561 12.4325 7.62061Z"
fill="currentColor"
/>
<path
d="M6.56703 8.2953C6.94761 8.67625 7.46378 8.89026 8.00199 8.89026C8.5402 8.89026 9.05637 8.67625 9.43694 8.2953C9.81751 7.91436 10.0313 7.39769 10.0313 6.85895C10.0313 6.32021 9.81751 5.80354 9.43694 5.42259C9.05637 5.04165 8.5402 4.82764 8.00199 4.82764C7.46378 4.82764 6.94761 5.04165 6.56703 5.42259C6.18646 5.80354 5.97266 6.32021 5.97266 6.85895C5.97266 7.39769 6.18646 7.91436 6.56703 8.2953Z"
fill="currentColor"
/>
</svg>
)
}
export const PersonalMenuIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="1927"
width="14"
height="14"
fill="currentColor"
{...props}>
<path
d="M511.976 24.429a487.618 487.618 0 0 1 487.619 487.619 487.619 487.619 0 1 1-487.619-487.62z m60.953 518.095H451.024a182.86 182.86 0 0 0-129.3 53.557 182.86 182.86 0 0 0-53.557 129.3h487.619l-0.305-10.728a182.857 182.857 0 0 0-182.552-172.129z m-60.953-304.762a121.906 121.906 0 0 0-86.199 208.104 121.9 121.9 0 0 0 172.399 0 121.905 121.905 0 0 0-86.2-208.104z"
p-id="1928"></path>
</svg>
)
export const TaskMenuIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
width="14"
height="14"
viewBox="0 0 14 14"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}>
<g clipPath="url(#clip0_16390_8144)">
<path
d="M9.97792 0.0650635H1.99082C1.15724 0.0650635 0.480469 0.741832 0.480469 1.57541V10.4126C0.480469 12.3562 2.06097 13.9347 4.00255 13.9347H11.9897C12.8232 13.9347 13.5 13.2579 13.5 12.4243V3.58715C13.5021 1.64556 11.9216 0.0650635 9.97792 0.0650635ZM7.35957 9.53156H4.10984C3.74257 9.53156 3.44546 9.23444 3.44546 8.86717C3.44546 8.4999 3.74257 8.20072 4.10984 8.20072H7.35957C7.72684 8.20072 8.02396 8.49784 8.02396 8.86717C8.02602 9.23238 7.72684 9.53156 7.35957 9.53156ZM9.87063 5.71236H4.10984C3.74257 5.71236 3.44546 5.41524 3.44546 5.04797C3.44546 4.6807 3.74257 4.38359 4.10984 4.38359H9.87063C10.2379 4.38359 10.535 4.6807 10.535 5.04797C10.535 5.41524 10.2379 5.71236 9.87063 5.71236Z"
fill="currentColor"
/>
</g>
<defs>
<clipPath id="clip0_16390_8144">
<rect width="14" height="14" fill="white" />
</clipPath>
</defs>
</svg>
)
export const AuthMenuIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
width="14"
height="14"
viewBox="0 0 14 14"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}>
<g clipPath="url(#clip0_16390_8141)">
<path
d="M12.786 1.72289L7.35971 0L1.93526 1.72289C1.73132 1.78725 1.59355 1.97702 1.59535 2.19167V9.04915C1.60621 9.09573 1.862 10.2246 2.9711 11.3177C3.82441 12.1585 5.87122 13.2392 6.76401 13.7079C6.90344 13.7813 6.96977 13.8081 7.0287 13.8402L7.29354 13.9726C7.36333 14.0101 7.48859 14.0084 7.55838 13.9726L7.82322 13.8402C8.34551 13.5844 10.7625 12.2892 11.7483 11.3177C12.8594 10.2246 13.1152 9.09573 13.1259 9.04915V2.19167C13.1294 1.97702 12.9899 1.78725 12.786 1.72289ZM7.4277 12.9099L7.42408 12.9081H7.43297C7.4295 12.9099 7.4277 12.9099 7.4277 12.9099ZM8.72114 8.9257H7.84447V10.1602C7.84447 10.4465 7.61189 10.679 7.32565 10.679C7.03941 10.679 6.80682 10.4465 6.80682 10.1602V6.97566C6.80682 6.96495 6.80863 6.95606 6.80863 6.94702C6.71382 6.91838 6.61901 6.88431 6.5242 6.8415C6.20404 6.69484 5.93031 6.43181 5.74777 6.13305C5.55815 5.82179 5.45791 5.43169 5.48836 5.06676C5.52408 4.64999 5.67436 4.28672 5.94101 3.96294C6.40256 3.40297 7.25058 3.17581 7.93039 3.42437C8.31507 3.56576 8.62814 3.80196 8.86434 4.13463C9.0719 4.4263 9.17741 4.78941 9.18646 5.14545C9.18646 5.15615 9.18827 5.16504 9.18646 5.1759C9.18646 5.18841 9.18646 5.20092 9.18465 5.21343C9.15963 6.00418 8.61578 6.75016 7.84282 6.95606V7.86664H8.71948C9.00573 7.86664 9.23831 8.09923 9.23831 8.38547V8.40687H9.24012C9.23997 8.69312 9.00739 8.9257 8.72114 8.9257Z"
fill="currentColor"
/>
<path
d="M7.95696 5.64603C7.96223 5.63713 7.96766 5.6299 7.96947 5.62809C8.0003 5.58081 8.02839 5.53179 8.05358 5.48127C8.07679 5.4151 8.09473 5.34893 8.10905 5.27914C8.11085 5.24522 8.11266 5.20935 8.11447 5.17528C8.11447 5.14122 8.11266 5.10549 8.10905 5.07158C8.09653 5.0036 8.07679 4.93562 8.05358 4.86945C8.0327 4.82734 8.01001 4.78615 7.98559 4.74599C7.98017 4.74057 7.96766 4.72278 7.94625 4.68872C7.92666 4.66716 7.90691 4.64395 7.88551 4.62435C7.86049 4.59933 7.83365 4.57431 7.80502 4.55094C7.79612 4.54567 7.78904 4.54024 7.78708 4.53843C7.73985 4.5076 7.69088 4.47952 7.64041 4.45432C7.57424 4.43111 7.50807 4.41317 7.44009 4.39885C7.3703 4.39358 7.30051 4.39358 7.23072 4.39885C7.16274 4.41137 7.09476 4.43111 7.0304 4.45432C6.98829 4.4752 6.9471 4.49789 6.90694 4.52231C6.90152 4.52773 6.88373 4.54024 6.84967 4.56165C6.82811 4.58124 6.8049 4.60099 6.7853 4.62239C6.76028 4.64741 6.73526 4.67424 6.71189 4.70288C6.70662 4.71178 6.70119 4.71901 6.69938 4.72082C6.66855 4.76805 6.64047 4.81702 6.61527 4.86749C6.59206 4.93366 6.57412 4.99983 6.5598 5.06781C6.55453 5.1376 6.55453 5.20739 6.5598 5.27718C6.57231 5.34516 6.59206 5.41314 6.61527 5.47751C6.63668 5.52046 6.65823 5.55981 6.68325 5.60096C6.68868 5.60638 6.70119 5.62417 6.7226 5.65823C6.74219 5.67979 6.76194 5.703 6.78334 5.7226C6.80836 5.74762 6.83519 5.77264 6.86383 5.79601C6.87273 5.80128 6.87996 5.80671 6.88177 5.80852C6.9282 5.83896 6.97839 5.8676 7.02844 5.89263C7.09461 5.91584 7.16078 5.93378 7.22876 5.9481C7.29855 5.95352 7.36834 5.95352 7.43813 5.9481C7.50611 5.93559 7.57409 5.91584 7.63845 5.89263C7.68141 5.87122 7.72076 5.84967 7.76191 5.82465C7.76733 5.81922 7.78512 5.80671 7.81918 5.7853C7.8424 5.76737 7.86395 5.74777 7.88355 5.72622C7.90872 5.7015 7.93374 5.67466 7.95696 5.64603Z"
fill="currentColor"
/>
</g>
<defs>
<clipPath id="clip0_16390_8141">
<rect width="14" height="14" fill="white" />
</clipPath>
</defs>
</svg>
)

View File

@@ -1 +0,0 @@
export { VirtualTreeSelect as default, VirtualTreeSelect } from "./tree"