Commit 12121653 authored by 王蔡翾's avatar 王蔡翾
Browse files

初始化

parents
Pipeline #438 failed with stages
in 0 seconds
import * as React from "react"
import * as SelectPrimitive from "@radix-ui/react-select"
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
import { cn } from "@/lib/utils"
function Select({
...props
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
return <SelectPrimitive.Root data-slot="select" {...props} />
}
function SelectGroup({
...props
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
return <SelectPrimitive.Group data-slot="select-group" {...props} />
}
function SelectValue({
...props
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
return <SelectPrimitive.Value data-slot="select-value" {...props} />
}
function SelectTrigger({
className,
size = "default",
children,
...props
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
size?: "sm" | "default"
}) {
return (
<SelectPrimitive.Trigger
data-slot="select-trigger"
data-size={size}
className={cn(
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
>
{children}
<SelectPrimitive.Icon asChild>
<ChevronDownIcon className="size-4 opacity-50" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
)
}
function SelectContent({
className,
children,
position = "item-aligned",
align = "center",
...props
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
return (
<SelectPrimitive.Portal>
<SelectPrimitive.Content
data-slot="select-content"
className={cn(
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className
)}
position={position}
align={align}
{...props}
>
<SelectScrollUpButton />
<SelectPrimitive.Viewport
className={cn(
"p-1",
position === "popper" &&
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
)}
>
{children}
</SelectPrimitive.Viewport>
<SelectScrollDownButton />
</SelectPrimitive.Content>
</SelectPrimitive.Portal>
)
}
function SelectLabel({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
return (
<SelectPrimitive.Label
data-slot="select-label"
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
{...props}
/>
)
}
function SelectItem({
className,
children,
...props
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
return (
<SelectPrimitive.Item
data-slot="select-item"
className={cn(
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
className
)}
{...props}
>
<span
data-slot="select-item-indicator"
className="absolute right-2 flex size-3.5 items-center justify-center"
>
<SelectPrimitive.ItemIndicator>
<CheckIcon className="size-4" />
</SelectPrimitive.ItemIndicator>
</span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
</SelectPrimitive.Item>
)
}
function SelectSeparator({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
return (
<SelectPrimitive.Separator
data-slot="select-separator"
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
{...props}
/>
)
}
function SelectScrollUpButton({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
return (
<SelectPrimitive.ScrollUpButton
data-slot="select-scroll-up-button"
className={cn(
"flex cursor-default items-center justify-center py-1",
className
)}
{...props}
>
<ChevronUpIcon className="size-4" />
</SelectPrimitive.ScrollUpButton>
)
}
function SelectScrollDownButton({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
return (
<SelectPrimitive.ScrollDownButton
data-slot="select-scroll-down-button"
className={cn(
"flex cursor-default items-center justify-center py-1",
className
)}
{...props}
>
<ChevronDownIcon className="size-4" />
</SelectPrimitive.ScrollDownButton>
)
}
export {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectScrollDownButton,
SelectScrollUpButton,
SelectSeparator,
SelectTrigger,
SelectValue,
}
"use client"
import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"
import { cn } from "@/lib/utils"
function Separator({
className,
orientation = "horizontal",
decorative = true,
...props
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
return (
<SeparatorPrimitive.Root
data-slot="separator"
decorative={decorative}
orientation={orientation}
className={cn(
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
className
)}
{...props}
/>
)
}
export { Separator }
import * as React from "react"
import * as SheetPrimitive from "@radix-ui/react-dialog"
import { XIcon } from "lucide-react"
import { cn } from "@/lib/utils"
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
return <SheetPrimitive.Root data-slot="sheet" {...props} />
}
function SheetTrigger({
...props
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
}
function SheetClose({
...props
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
}
function SheetPortal({
...props
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
}
function SheetOverlay({
className,
...props
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
return (
<SheetPrimitive.Overlay
data-slot="sheet-overlay"
className={cn(
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
className
)}
{...props}
/>
)
}
function SheetContent({
className,
children,
side = "right",
...props
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
side?: "top" | "right" | "bottom" | "left"
}) {
return (
<SheetPortal>
<SheetOverlay />
<SheetPrimitive.Content
data-slot="sheet-content"
className={cn(
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
side === "right" &&
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
side === "left" &&
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
side === "top" &&
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
side === "bottom" &&
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
className
)}
{...props}
>
{children}
<SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
<XIcon className="size-4" />
<span className="sr-only">Close</span>
</SheetPrimitive.Close>
</SheetPrimitive.Content>
</SheetPortal>
)
}
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="sheet-header"
className={cn("flex flex-col gap-1.5 p-4", className)}
{...props}
/>
)
}
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="sheet-footer"
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
{...props}
/>
)
}
function SheetTitle({
className,
...props
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
return (
<SheetPrimitive.Title
data-slot="sheet-title"
className={cn("text-foreground font-semibold", className)}
{...props}
/>
)
}
function SheetDescription({
className,
...props
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
return (
<SheetPrimitive.Description
data-slot="sheet-description"
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
)
}
export {
Sheet,
SheetTrigger,
SheetClose,
SheetContent,
SheetHeader,
SheetFooter,
SheetTitle,
SheetDescription,
}
"use client"
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { PanelLeftIcon } from "lucide-react"
import { useIsMobile } from "@/hooks/use-mobile"
import { cn } from "@/lib/utils"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Separator } from "@/components/ui/separator"
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
} from "@/components/ui/sheet"
import { Skeleton } from "@/components/ui/skeleton"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip"
const SIDEBAR_COOKIE_NAME = "sidebar_state"
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
const SIDEBAR_WIDTH = "16rem"
const SIDEBAR_WIDTH_MOBILE = "18rem"
const SIDEBAR_WIDTH_ICON = "3rem"
const SIDEBAR_KEYBOARD_SHORTCUT = "b"
type SidebarContextProps = {
state: "expanded" | "collapsed"
open: boolean
setOpen: (open: boolean) => void
openMobile: boolean
setOpenMobile: (open: boolean) => void
isMobile: boolean
toggleSidebar: () => void
}
const SidebarContext = React.createContext<SidebarContextProps | null>(null)
function useSidebar() {
const context = React.useContext(SidebarContext)
if (!context) {
throw new Error("useSidebar must be used within a SidebarProvider.")
}
return context
}
function SidebarProvider({
defaultOpen = true,
open: openProp,
onOpenChange: setOpenProp,
className,
style,
children,
...props
}: React.ComponentProps<"div"> & {
defaultOpen?: boolean
open?: boolean
onOpenChange?: (open: boolean) => void
}) {
const isMobile = useIsMobile()
const [openMobile, setOpenMobile] = React.useState(false)
// This is the internal state of the sidebar.
// We use openProp and setOpenProp for control from outside the component.
const [_open, _setOpen] = React.useState(defaultOpen)
const open = openProp ?? _open
const setOpen = React.useCallback(
(value: boolean | ((value: boolean) => boolean)) => {
const openState = typeof value === "function" ? value(open) : value
if (setOpenProp) {
setOpenProp(openState)
} else {
_setOpen(openState)
}
// This sets the cookie to keep the sidebar state.
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
},
[setOpenProp, open]
)
// Helper to toggle the sidebar.
const toggleSidebar = React.useCallback(() => {
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open)
}, [isMobile, setOpen, setOpenMobile])
// Adds a keyboard shortcut to toggle the sidebar.
React.useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
if (
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
(event.metaKey || event.ctrlKey)
) {
event.preventDefault()
toggleSidebar()
}
}
window.addEventListener("keydown", handleKeyDown)
return () => window.removeEventListener("keydown", handleKeyDown)
}, [toggleSidebar])
// We add a state so that we can do data-state="expanded" or "collapsed".
// This makes it easier to style the sidebar with Tailwind classes.
const state = open ? "expanded" : "collapsed"
const contextValue = React.useMemo<SidebarContextProps>(
() => ({
state,
open,
setOpen,
isMobile,
openMobile,
setOpenMobile,
toggleSidebar,
}),
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
)
return (
<SidebarContext.Provider value={contextValue}>
<TooltipProvider delayDuration={0}>
<div
data-slot="sidebar-wrapper"
style={
{
"--sidebar-width": SIDEBAR_WIDTH,
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
...style,
} as React.CSSProperties
}
className={cn(
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
className
)}
{...props}
>
{children}
</div>
</TooltipProvider>
</SidebarContext.Provider>
)
}
function Sidebar({
side = "left",
variant = "sidebar",
collapsible = "offcanvas",
className,
children,
...props
}: React.ComponentProps<"div"> & {
side?: "left" | "right"
variant?: "sidebar" | "floating" | "inset"
collapsible?: "offcanvas" | "icon" | "none"
}) {
const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
if (collapsible === "none") {
return (
<div
data-slot="sidebar"
className={cn(
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
className
)}
{...props}
>
{children}
</div>
)
}
if (isMobile) {
return (
<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
<SheetContent
data-sidebar="sidebar"
data-slot="sidebar"
data-mobile="true"
className="bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden"
style={
{
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
} as React.CSSProperties
}
side={side}
>
<SheetHeader className="sr-only">
<SheetTitle>Sidebar</SheetTitle>
<SheetDescription>Displays the mobile sidebar.</SheetDescription>
</SheetHeader>
<div className="flex h-full w-full flex-col">{children}</div>
</SheetContent>
</Sheet>
)
}
return (
<div
className="group peer text-sidebar-foreground hidden md:block"
data-state={state}
data-collapsible={state === "collapsed" ? collapsible : ""}
data-variant={variant}
data-side={side}
data-slot="sidebar"
>
{/* This is what handles the sidebar gap on desktop */}
<div
data-slot="sidebar-gap"
className={cn(
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
"group-data-[collapsible=offcanvas]:w-0",
"group-data-[side=right]:rotate-180",
variant === "floating" || variant === "inset"
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
)}
/>
<div
data-slot="sidebar-container"
className={cn(
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
side === "left"
? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
: "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
// Adjust the padding for floating and inset variants.
variant === "floating" || variant === "inset"
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
className
)}
{...props}
>
<div
data-sidebar="sidebar"
data-slot="sidebar-inner"
className="bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm"
>
{children}
</div>
</div>
</div>
)
}
function SidebarTrigger({
className,
onClick,
...props
}: React.ComponentProps<typeof Button>) {
const { toggleSidebar } = useSidebar()
return (
<Button
data-sidebar="trigger"
data-slot="sidebar-trigger"
variant="ghost"
size="icon"
className={cn("size-7", className)}
onClick={(event) => {
onClick?.(event)
toggleSidebar()
}}
{...props}
>
<PanelLeftIcon />
<span className="sr-only">Toggle Sidebar</span>
</Button>
)
}
function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
const { toggleSidebar } = useSidebar()
return (
<button
data-sidebar="rail"
data-slot="sidebar-rail"
aria-label="Toggle Sidebar"
tabIndex={-1}
onClick={toggleSidebar}
title="Toggle Sidebar"
className={cn(
"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
className
)}
{...props}
/>
)
}
function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
return (
<main
data-slot="sidebar-inset"
className={cn(
"bg-background relative flex w-full flex-1 flex-col",
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
className
)}
{...props}
/>
)
}
function SidebarInput({
className,
...props
}: React.ComponentProps<typeof Input>) {
return (
<Input
data-slot="sidebar-input"
data-sidebar="input"
className={cn("bg-background h-8 w-full shadow-none", className)}
{...props}
/>
)
}
function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="sidebar-header"
data-sidebar="header"
className={cn("flex flex-col gap-2 p-2", className)}
{...props}
/>
)
}
function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="sidebar-footer"
data-sidebar="footer"
className={cn("flex flex-col gap-2 p-2", className)}
{...props}
/>
)
}
function SidebarSeparator({
className,
...props
}: React.ComponentProps<typeof Separator>) {
return (
<Separator
data-slot="sidebar-separator"
data-sidebar="separator"
className={cn("bg-sidebar-border mx-2 w-auto", className)}
{...props}
/>
)
}
function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="sidebar-content"
data-sidebar="content"
className={cn(
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
className
)}
{...props}
/>
)
}
function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="sidebar-group"
data-sidebar="group"
className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
{...props}
/>
)
}
function SidebarGroupLabel({
className,
asChild = false,
...props
}: React.ComponentProps<"div"> & { asChild?: boolean }) {
const Comp = asChild ? Slot : "div"
return (
<Comp
data-slot="sidebar-group-label"
data-sidebar="group-label"
className={cn(
"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
className
)}
{...props}
/>
)
}
function SidebarGroupAction({
className,
asChild = false,
...props
}: React.ComponentProps<"button"> & { asChild?: boolean }) {
const Comp = asChild ? Slot : "button"
return (
<Comp
data-slot="sidebar-group-action"
data-sidebar="group-action"
className={cn(
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
// Increases the hit area of the button on mobile.
"after:absolute after:-inset-2 md:after:hidden",
"group-data-[collapsible=icon]:hidden",
className
)}
{...props}
/>
)
}
function SidebarGroupContent({
className,
...props
}: React.ComponentProps<"div">) {
return (
<div
data-slot="sidebar-group-content"
data-sidebar="group-content"
className={cn("w-full text-sm", className)}
{...props}
/>
)
}
function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
return (
<ul
data-slot="sidebar-menu"
data-sidebar="menu"
className={cn("flex w-full min-w-0 flex-col gap-1", className)}
{...props}
/>
)
}
function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
return (
<li
data-slot="sidebar-menu-item"
data-sidebar="menu-item"
className={cn("group/menu-item relative", className)}
{...props}
/>
)
}
const sidebarMenuButtonVariants = cva(
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
{
variants: {
variant: {
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
outline:
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
},
size: {
default: "h-8 text-sm",
sm: "h-7 text-xs",
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
function SidebarMenuButton({
asChild = false,
isActive = false,
variant = "default",
size = "default",
tooltip,
className,
...props
}: React.ComponentProps<"button"> & {
asChild?: boolean
isActive?: boolean
tooltip?: string | React.ComponentProps<typeof TooltipContent>
} & VariantProps<typeof sidebarMenuButtonVariants>) {
const Comp = asChild ? Slot : "button"
const { isMobile, state } = useSidebar()
const button = (
<Comp
data-slot="sidebar-menu-button"
data-sidebar="menu-button"
data-size={size}
data-active={isActive}
className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
{...props}
/>
)
if (!tooltip) {
return button
}
if (typeof tooltip === "string") {
tooltip = {
children: tooltip,
}
}
return (
<Tooltip>
<TooltipTrigger asChild>{button}</TooltipTrigger>
<TooltipContent
side="right"
align="center"
hidden={state !== "collapsed" || isMobile}
{...tooltip}
/>
</Tooltip>
)
}
function SidebarMenuAction({
className,
asChild = false,
showOnHover = false,
...props
}: React.ComponentProps<"button"> & {
asChild?: boolean
showOnHover?: boolean
}) {
const Comp = asChild ? Slot : "button"
return (
<Comp
data-slot="sidebar-menu-action"
data-sidebar="menu-action"
className={cn(
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
// Increases the hit area of the button on mobile.
"after:absolute after:-inset-2 md:after:hidden",
"peer-data-[size=sm]/menu-button:top-1",
"peer-data-[size=default]/menu-button:top-1.5",
"peer-data-[size=lg]/menu-button:top-2.5",
"group-data-[collapsible=icon]:hidden",
showOnHover &&
"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
className
)}
{...props}
/>
)
}
function SidebarMenuBadge({
className,
...props
}: React.ComponentProps<"div">) {
return (
<div
data-slot="sidebar-menu-badge"
data-sidebar="menu-badge"
className={cn(
"text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
"peer-data-[size=sm]/menu-button:top-1",
"peer-data-[size=default]/menu-button:top-1.5",
"peer-data-[size=lg]/menu-button:top-2.5",
"group-data-[collapsible=icon]:hidden",
className
)}
{...props}
/>
)
}
function SidebarMenuSkeleton({
className,
showIcon = false,
...props
}: React.ComponentProps<"div"> & {
showIcon?: boolean
}) {
// Random width between 50 to 90%.
const width = React.useMemo(() => {
return `${Math.floor(Math.random() * 40) + 50}%`
}, [])
return (
<div
data-slot="sidebar-menu-skeleton"
data-sidebar="menu-skeleton"
className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
{...props}
>
{showIcon && (
<Skeleton
className="size-4 rounded-md"
data-sidebar="menu-skeleton-icon"
/>
)}
<Skeleton
className="h-4 max-w-(--skeleton-width) flex-1"
data-sidebar="menu-skeleton-text"
style={
{
"--skeleton-width": width,
} as React.CSSProperties
}
/>
</div>
)
}
function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
return (
<ul
data-slot="sidebar-menu-sub"
data-sidebar="menu-sub"
className={cn(
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
"group-data-[collapsible=icon]:hidden",
className
)}
{...props}
/>
)
}
function SidebarMenuSubItem({
className,
...props
}: React.ComponentProps<"li">) {
return (
<li
data-slot="sidebar-menu-sub-item"
data-sidebar="menu-sub-item"
className={cn("group/menu-sub-item relative", className)}
{...props}
/>
)
}
function SidebarMenuSubButton({
asChild = false,
size = "md",
isActive = false,
className,
...props
}: React.ComponentProps<"a"> & {
asChild?: boolean
size?: "sm" | "md"
isActive?: boolean
}) {
const Comp = asChild ? Slot : "a"
return (
<Comp
data-slot="sidebar-menu-sub-button"
data-sidebar="menu-sub-button"
data-size={size}
data-active={isActive}
className={cn(
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
size === "sm" && "text-xs",
size === "md" && "text-sm",
"group-data-[collapsible=icon]:hidden",
className
)}
{...props}
/>
)
}
export {
Sidebar,
SidebarContent,
SidebarFooter,
SidebarGroup,
SidebarGroupAction,
SidebarGroupContent,
SidebarGroupLabel,
SidebarHeader,
SidebarInput,
SidebarInset,
SidebarMenu,
SidebarMenuAction,
SidebarMenuBadge,
SidebarMenuButton,
SidebarMenuItem,
SidebarMenuSkeleton,
SidebarMenuSub,
SidebarMenuSubButton,
SidebarMenuSubItem,
SidebarProvider,
SidebarRail,
SidebarSeparator,
SidebarTrigger,
useSidebar,
}
import { cn } from "@/lib/utils"
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="skeleton"
className={cn("bg-accent animate-pulse rounded-md", className)}
{...props}
/>
)
}
export { Skeleton }
"use client"
import * as React from "react"
import * as SliderPrimitive from "@radix-ui/react-slider"
import { cn } from "@/lib/utils"
function Slider({
className,
defaultValue,
value,
min = 0,
max = 100,
...props
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
const _values = React.useMemo(
() =>
Array.isArray(value)
? value
: Array.isArray(defaultValue)
? defaultValue
: [min, max],
[value, defaultValue, min, max]
)
return (
<SliderPrimitive.Root
data-slot="slider"
defaultValue={defaultValue}
value={value}
min={min}
max={max}
className={cn(
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
className
)}
{...props}
>
<SliderPrimitive.Track
data-slot="slider-track"
className={cn(
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
)}
>
<SliderPrimitive.Range
data-slot="slider-range"
className={cn(
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
)}
/>
</SliderPrimitive.Track>
{Array.from({ length: _values.length }, (_, index) => (
<SliderPrimitive.Thumb
data-slot="slider-thumb"
key={index}
className="border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
/>
))}
</SliderPrimitive.Root>
)
}
export { Slider }
import {
CircleCheckIcon,
InfoIcon,
Loader2Icon,
OctagonXIcon,
TriangleAlertIcon,
} from "lucide-react"
import { useTheme } from "next-themes"
import { Toaster as Sonner, type ToasterProps } from "sonner"
const Toaster = ({ ...props }: ToasterProps) => {
const { theme = "system" } = useTheme()
return (
<Sonner
theme={theme as ToasterProps["theme"]}
className="toaster group"
icons={{
success: <CircleCheckIcon className="size-4" />,
info: <InfoIcon className="size-4" />,
warning: <TriangleAlertIcon className="size-4" />,
error: <OctagonXIcon className="size-4" />,
loading: <Loader2Icon className="size-4 animate-spin" />,
}}
style={
{
"--normal-bg": "var(--popover)",
"--normal-text": "var(--popover-foreground)",
"--normal-border": "var(--border)",
"--border-radius": "var(--radius)",
} as React.CSSProperties
}
{...props}
/>
)
}
export { Toaster }
import { Loader2Icon } from "lucide-react"
import { cn } from "@/lib/utils"
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
return (
<Loader2Icon
role="status"
aria-label="Loading"
className={cn("size-4 animate-spin", className)}
{...props}
/>
)
}
export { Spinner }
"use client"
import * as React from "react"
import * as SwitchPrimitive from "@radix-ui/react-switch"
import { cn } from "@/lib/utils"
function Switch({
className,
...props
}: React.ComponentProps<typeof SwitchPrimitive.Root>) {
return (
<SwitchPrimitive.Root
data-slot="switch"
className={cn(
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
className
)}
{...props}
>
<SwitchPrimitive.Thumb
data-slot="switch-thumb"
className={cn(
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitive.Root>
)
}
export { Switch }
import * as React from "react"
import { cn } from "@/lib/utils"
function Table({ className, ...props }: React.ComponentProps<"table">) {
return (
<div
data-slot="table-container"
className="relative w-full overflow-x-auto"
>
<table
data-slot="table"
className={cn("w-full caption-bottom text-sm", className)}
{...props}
/>
</div>
)
}
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
return (
<thead
data-slot="table-header"
className={cn("[&_tr]:border-b", className)}
{...props}
/>
)
}
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
return (
<tbody
data-slot="table-body"
className={cn("[&_tr:last-child]:border-0", className)}
{...props}
/>
)
}
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
return (
<tfoot
data-slot="table-footer"
className={cn(
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
className
)}
{...props}
/>
)
}
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
return (
<tr
data-slot="table-row"
className={cn(
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
className
)}
{...props}
/>
)
}
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
return (
<th
data-slot="table-head"
className={cn(
"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
className
)}
{...props}
/>
)
}
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
return (
<td
data-slot="table-cell"
className={cn(
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
className
)}
{...props}
/>
)
}
function TableCaption({
className,
...props
}: React.ComponentProps<"caption">) {
return (
<caption
data-slot="table-caption"
className={cn("text-muted-foreground mt-4 text-sm", className)}
{...props}
/>
)
}
export {
Table,
TableHeader,
TableBody,
TableFooter,
TableHead,
TableRow,
TableCell,
TableCaption,
}
"use client"
import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"
import { cn } from "@/lib/utils"
function Tabs({
className,
...props
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
return (
<TabsPrimitive.Root
data-slot="tabs"
className={cn("flex flex-col gap-2", className)}
{...props}
/>
)
}
function TabsList({
className,
...props
}: React.ComponentProps<typeof TabsPrimitive.List>) {
return (
<TabsPrimitive.List
data-slot="tabs-list"
className={cn(
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
className
)}
{...props}
/>
)
}
function TabsTrigger({
className,
...props
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
return (
<TabsPrimitive.Trigger
data-slot="tabs-trigger"
className={cn(
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
/>
)
}
function TabsContent({
className,
...props
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
return (
<TabsPrimitive.Content
data-slot="tabs-content"
className={cn("flex-1 outline-none", className)}
{...props}
/>
)
}
export { Tabs, TabsList, TabsTrigger, TabsContent }
import * as React from "react"
import { cn } from "@/lib/utils"
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
return (
<textarea
data-slot="textarea"
className={cn(
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
className
)}
{...props}
/>
)
}
export { Textarea }
import * as React from "react"
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
import { type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
import { toggleVariants } from "@/components/ui/toggle"
const ToggleGroupContext = React.createContext<
VariantProps<typeof toggleVariants> & {
spacing?: number
}
>({
size: "default",
variant: "default",
spacing: 0,
})
function ToggleGroup({
className,
variant,
size,
spacing = 0,
children,
...props
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
VariantProps<typeof toggleVariants> & {
spacing?: number
}) {
return (
<ToggleGroupPrimitive.Root
data-slot="toggle-group"
data-variant={variant}
data-size={size}
data-spacing={spacing}
style={{ "--gap": spacing } as React.CSSProperties}
className={cn(
"group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
className
)}
{...props}
>
<ToggleGroupContext.Provider value={{ variant, size, spacing }}>
{children}
</ToggleGroupContext.Provider>
</ToggleGroupPrimitive.Root>
)
}
function ToggleGroupItem({
className,
children,
variant,
size,
...props
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
VariantProps<typeof toggleVariants>) {
const context = React.useContext(ToggleGroupContext)
return (
<ToggleGroupPrimitive.Item
data-slot="toggle-group-item"
data-variant={context.variant || variant}
data-size={context.size || size}
data-spacing={context.spacing}
className={cn(
toggleVariants({
variant: context.variant || variant,
size: context.size || size,
}),
"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
"data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
className
)}
{...props}
>
{children}
</ToggleGroupPrimitive.Item>
)
}
export { ToggleGroup, ToggleGroupItem }
import * as React from "react"
import * as TogglePrimitive from "@radix-ui/react-toggle"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const toggleVariants = cva(
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
{
variants: {
variant: {
default: "bg-transparent",
outline:
"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
},
size: {
default: "h-9 px-2 min-w-9",
sm: "h-8 px-1.5 min-w-8",
lg: "h-10 px-2.5 min-w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
function Toggle({
className,
variant,
size,
...props
}: React.ComponentProps<typeof TogglePrimitive.Root> &
VariantProps<typeof toggleVariants>) {
return (
<TogglePrimitive.Root
data-slot="toggle"
className={cn(toggleVariants({ variant, size, className }))}
{...props}
/>
)
}
export { Toggle, toggleVariants }
"use client"
import * as React from "react"
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
import { cn } from "@/lib/utils"
function TooltipProvider({
delayDuration = 0,
...props
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
return (
<TooltipPrimitive.Provider
data-slot="tooltip-provider"
delayDuration={delayDuration}
{...props}
/>
)
}
function Tooltip({
...props
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
return (
<TooltipProvider>
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
</TooltipProvider>
)
}
function TooltipTrigger({
...props
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
}
function TooltipContent({
className,
sideOffset = 0,
children,
...props
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
return (
<TooltipPrimitive.Portal>
<TooltipPrimitive.Content
data-slot="tooltip-content"
sideOffset={sideOffset}
className={cn(
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
className
)}
{...props}
>
{children}
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
</TooltipPrimitive.Content>
</TooltipPrimitive.Portal>
)
}
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
import type { Project } from '../types'
// 原型演示数据:项目字段用于演示交互。其中 4 条带有真实公告来源网址,
// 其余来源链接暂未收录(界面会明确标识,不用虚构网址替代)。
export const PROJECTS: Project[] = [
{
id: 'p01',
name: '杭州临平区再生水厂深度处理设备采购项目',
region: '浙江·杭州',
keywords: ['再生水利用', '设备采购', '膜处理'],
budget: 680,
publishDate: '2026-10-16',
regDeadline: '2026-10-28',
bidDeadline: '2026-11-06',
purchaser: '杭州临平环境集团有限公司',
noticeType: '招标公告',
sourceName: '福建省公共资源交易公共服务平台',
sourceUrl: 'https://ggzy.np.gov.cn/jo/jsgc/010005/20251021/87a52bc2-bc43-42ef-970c-cdc3ad4bbfb5.html',
summary: '膜处理与加药设备为主,报名截止较近;公告要求提供同类水厂供货业绩。',
detail: '再生水厂深度处理单元设备采购,包含超滤膜组器、加药装置、在线仪表及配套安装调试,交货期 120 天,质保 2 年。',
requirements: ['具备独立法人资格', '近三年至少 1 个同类水厂设备供货业绩', '不接受联合体投标', '需提供制造商授权(代理商投标时)'],
},
{
id: 'p02',
name: '南京江北新区水厂自控系统升级改造工程',
region: '江苏·南京',
keywords: ['智慧水务', '自控系统', '工程服务'],
budget: 1250,
publishDate: '2026-10-12',
regDeadline: '2026-10-30',
bidDeadline: '2026-11-10',
purchaser: '南京江北新区水务集团',
noticeType: '招标公告',
sourceName: '中信环境招标采购电子交易平台',
sourceUrl: 'https://zcpt.citicenvirotech.com/cms/webfile/ebi_bulletin/2025-06-17/89071.html',
summary: '自控+SCADA 整体改造,金额较高预计竞争激烈;要求电子与智能化工程专业承包资质。',
detail: '对 3 座水厂的自控系统进行升级,含 PLC/SCADA 改造、水质在线监测仪表、数据接入新区水务调度平台,工期 180 天。',
requirements: ['电子与智能化工程专业承包二级及以上', '项目经理具备机电工程一级建造师', '近三年 2 个及以上水厂自控业绩', '接受联合体投标(不超过 2 家)'],
},
{
id: 'p03',
name: '苏州工业园区排水管网 AI 诊断与漏损控制平台',
region: '江苏·苏州',
keywords: ['智慧水务', '管网漏损', 'AI / 算法'],
budget: 1200,
publishDate: '2026-10-09',
regDeadline: '2026-10-24',
bidDeadline: '2026-11-03',
purchaser: '苏州工业园区清源水务有限公司',
noticeType: '招标公告',
sourceName: '中国招标与采购网',
sourceUrl: 'http://www.china-zbycg.com/agent_4721407.html',
summary: 'AI 诊断平台建设,报名 10-24 截止非常紧;需核验算法类软著与平台交付案例。',
detail: '建设排水管网 AI 诊断平台,含管网监测布点、漏损分析模型、预警调度模块及一年运营陪跑服务。',
requirements: ['具备软件能力成熟度或相关体系认证', '拥有管网或水务算法相关软件著作权', '需提供平台类项目验收案例', '接受联合体投标'],
},
{
id: 'p04',
name: '宝安区水务局智慧水务(一期)系统运维(2025-2026 年)项目',
region: '广东·深圳',
keywords: ['智慧水务', '运营服务'],
budget: null,
publishDate: '2025-04-03',
regDeadline: '2025-04-14',
bidDeadline: '2025-04-14',
purchaser: '深圳市宝安区水务局',
noticeType: '招标公告',
sourceName: '深圳公共资源交易中心',
sourceUrl: 'http://zfcg.szggzy.com:8081/gsgg/002001/002001002/002001002001/20250403/0b0aab58-5df6-41fd-9769-036c5e01d11a.html',
summary: '智慧水务系统年度运维,公告未披露预算;报名与投标同日截止,已结束,可作同类项目参考。',
detail: '智慧水务(一期)系统软硬件运维,含平台日常巡检、故障处理、数据维护与安全保障,服务期一年。',
requirements: ['不接受联合体投标', '不接受进口产品', '需在深圳政府采购智慧平台完成报名与文件下载'],
},
{
id: 'p05',
name: '海南省 2025 年水土保持遥感信息化监管及水土流失动态监测',
region: '海南·海口',
keywords: ['水质监测', '遥感监测', '信息化'],
budget: 261,
publishDate: '2025-08-27',
regDeadline: null,
bidDeadline: '2025-09-17',
purchaser: '海南省水务厅',
noticeType: '招标公告',
sourceName: '海南省政府采购智慧云平台',
sourceUrl: 'http://www.cnbiding.com.cn/news/0830754011599.html',
summary: '遥感监管与动态监测服务,预算 261 万元;接受联合体投标,已结束,可研究采购方偏好。',
detail: '开展全省水土保持遥感信息化监管与水土流失动态监测,产出监测图斑、专题数据库与年度报告。',
requirements: ['接受联合体投标', '需在海南省政府采购智慧云平台获取采购文件', '投标保证金 0 元'],
},
{
id: 'p06',
name: '龙岗区河湖长制技术咨询服务(A)',
region: '广东·深圳',
keywords: ['水环境治理', '咨询服务'],
budget: null,
publishDate: '2025-01-23',
regDeadline: null,
bidDeadline: '2025-02-10',
purchaser: '深圳市龙岗区水务局',
noticeType: '招标公告',
sourceName: '深圳公共资源交易中心',
sourceUrl: 'http://www.cnbiding.com.cn/zbyxx/083080881599.html',
summary: '河湖长制技术咨询,公告未披露预算且不接受联合体与分包;已结束。',
detail: '为龙岗区河湖长制工作提供技术咨询,含河湖健康评估、巡查技术支持与考核辅助。',
requirements: ['不接受联合体投标', '不允许分包', '不需要投标保证金'],
},
{
id: 'p07',
name: '2025 年武昌区水务监测系统建设及维护管理项目',
region: '湖北·武汉',
keywords: ['水质监测', '监测系统', '运营服务'],
budget: 49.65,
publishDate: '2025-04-07',
regDeadline: '2025-04-11',
bidDeadline: null,
purchaser: '武汉市武昌区智慧水务信息管理中心',
noticeType: '竞争性磋商',
sourceName: '中国招标与采购网',
sourceUrl: 'http://www.zbycg.com/agent_5646606.html',
summary: '监测站点设施建设与维护,预算 49.65 万元、专门面向中小微企业;已结束。',
detail: '水务监测站点设施维护与系统运行保障,合同履行至项目结束并通过验收。',
requirements: ['专门面向中小微企业采购', '不接受联合体投标', '不接受合同分包'],
},
{
id: 'p08',
name: '成都锦江流域智慧排口监测与溯源项目',
region: '四川·成都',
keywords: ['水质监测', '智慧水务', '溯源'],
budget: 540,
publishDate: '2026-10-18',
regDeadline: '2026-11-02',
bidDeadline: '2026-11-12',
purchaser: '成都市锦江区水务局',
noticeType: '招标公告',
sourceName: '中国招标与采购网',
sourceUrl: 'http://www.china-zbycg.com/agent_4661547.html',
summary: '排口监测+污染溯源,含监测设备与算法服务;要求本地化售后响应。',
detail: '对锦江流域 86 个排口建设在线监测,配套污染溯源算法模型与运维服务两年。',
requirements: ['具备环境监测或信息化相关资质', '提供 2 小时内响应的本地售后承诺', '近三年有监测类项目业绩'],
},
{
id: 'p09',
name: '青岛西海岸新区二次供水设施改造项目(三期)',
region: '山东·青岛',
keywords: ['二次供水', '设备采购', '改造工程'],
budget: 860,
publishDate: '2026-10-14',
regDeadline: '2026-10-27',
bidDeadline: '2026-11-05',
purchaser: '青岛西海岸公用事业集团水务有限公司',
noticeType: '招标公告',
sourceName: '采购与招标网',
sourceUrl: 'https://www.ztgxzb.cn/class2/216207.html',
summary: '泵房改造与设备成套供货,涉及居民小区施工协调;要求建筑机电安装资质。',
detail: '对 42 个小区二次供水泵房进行改造,含成套供水设备、远程监控与安防配套。',
requirements: ['建筑机电安装工程专业承包资质', '设备需具备涉水产品卫生许可批件', '接受联合体投标'],
},
{
id: 'p10',
name: '合肥滨湖新区污水处理厂 MBR 膜系统更换项目',
region: '安徽·合肥',
keywords: ['污水处理', 'MBR', '设备采购'],
budget: 1580,
publishDate: '2026-10-08',
regDeadline: '2026-10-22',
bidDeadline: '2026-11-04',
purchaser: '合肥滨湖新区水务投资有限公司',
noticeType: '招标公告',
sourceName: '采购与招标网',
sourceUrl: 'https://www.chinabidding.cn/zfcg/U-vlPaRHt.html',
summary: 'MBR 膜组器整体更换,报名 10-22 截止极近;膜品牌业绩与原厂授权是硬门槛。',
detail: '污水处理厂 MBR 车间膜组器及配套管件、清洗系统更换,含旧膜拆除与新膜安装调试。',
requirements: ['膜产品制造商或授权代理商投标', '近三年 MBR 膜供货业绩不少于 2 个', '不接受联合体投标'],
},
{
id: 'p11',
name: '郑州航空港区供水管网漏损治理 DMA 分区计量项目',
region: '河南·郑州',
keywords: ['供水管网', '管网漏损', '分区计量'],
budget: 730,
publishDate: '2026-10-05',
regDeadline: '2026-10-26',
bidDeadline: '2026-11-09',
purchaser: '郑州航空港水务发展有限公司',
noticeType: '招标公告',
sourceName: '济南公共资源交易中心',
sourceUrl: 'http://jnggzy.jinan.gov.cn/art/2024/2/21/art_99442_9435.html',
summary: 'DMA 分区计量建设,含流量计安装与漏损分析平台;业绩要求明确,可先核对同类案例。',
detail: '建设 DMA 分区计量体系,安装分区计量仪表 320 套,搭建漏损分析管理平台并出具治理报告。',
requirements: ['具备市政公用工程施工总承包或电子智能化资质', '近三年 DMA 或漏损治理项目业绩', '接受联合体投标'],
},
{
id: 'p12',
name: '佛山顺德区村镇污水处理设施智慧运营服务项目',
region: '广东·佛山',
keywords: ['污水处理', '运营服务', '智慧水务'],
budget: 2100,
publishDate: '2026-10-10',
regDeadline: '2026-10-31',
bidDeadline: '2026-11-13',
purchaser: '佛山市顺德区住房城乡建设和水务局',
noticeType: '招标公告',
sourceName: '中国政府采购招标网',
sourceUrl: 'http://gov-cg.cn/BidInfoDetails_bid_24603518.html',
summary: '三年期运营服务,金额大、周期长;要求运维业绩与驻场团队配置,需评估交付能力。',
detail: '对 58 座村镇污水处理设施提供三年智慧运营服务,含远程监控平台、巡检养护与出水达标保障。',
requirements: ['近三年村镇污水或类似设施运营业绩', '配置驻场运维团队(明确人数要求)', '接受联合体投标(牵头方须为运营单位)'],
},
{
id: 'p13',
name: '西安高新区智慧水务数据中台建设项目',
region: '陕西·西安',
keywords: ['智慧水务', '数据平台', '软件平台'],
budget: 950,
publishDate: '2026-09-28',
regDeadline: '2026-10-20',
bidDeadline: '2026-10-30',
purchaser: '西安高新区水务集团有限公司',
noticeType: '招标公告',
sourceName: '红河县人民政府公共资源交易',
sourceUrl: 'https://www.hhx.gov.cn/info/3551/430641.htm',
summary: '数据中台建设,报名已截止、投标 10-30 截止;可研究采购方为下次同类项目做准备。',
detail: '建设水务数据中台,整合 SCADA、营收、管网 GIS 等系统数据,提供统一数据服务与可视化应用。',
requirements: ['具备软件研发相关能力证明', '近三年数据中台或水务信息化业绩', '不接受联合体投标'],
},
{
id: 'p14',
name: '天津滨海新区污水处理厂污泥低温干化处置项目',
region: '天津·滨海',
keywords: ['污泥处理', '设备采购', '运营服务'],
budget: 1320,
publishDate: '2026-10-15',
regDeadline: '2026-10-29',
bidDeadline: '2026-11-11',
purchaser: '天津滨海新区环境建设投资有限公司',
noticeType: '招标公告',
sourceName: '中国政府采购网',
sourceUrl: 'https://www.ccgp.gov.cn/cggg/dfgg/gkzb/202504/t20250420_24470976.htm',
summary: '污泥低温干化设备+三年处置服务,技术路线与能耗指标是评审重点。',
detail: '采购污泥低温干化成套设备并提供三年处置运营服务,日处理规模 80 吨(含水率 80%→40%)。',
requirements: ['具备环保工程专业承包资质', '低温干化同类项目业绩不少于 1 个', '接受联合体投标'],
},
{
id: 'p15',
name: '长沙望城区海绵城市监测评估平台项目',
region: '湖南·长沙',
keywords: ['海绵城市', '排水防涝', '监测平台'],
budget: 420,
publishDate: '2026-10-11',
regDeadline: '2026-10-25',
bidDeadline: '2026-11-07',
purchaser: '长沙市望城区住房和城乡建设局',
noticeType: '竞争性磋商',
sourceName: '招标与采购网',
sourceUrl: 'http://www.china-bidding.com/article-28830452.html',
summary: '海绵城市监测评估,竞争性磋商方式;需准备两轮报价与方案陈述。',
detail: '建设海绵城市监测评估平台,布设监测点位 45 处,提供年度绩效评估报告。',
requirements: ['具备水文水资源或信息化相关业绩', '磋商需现场方案陈述', '接受联合体投标'],
},
{
id: 'p16',
name: '重庆两江新区排水防涝调度指挥系统项目',
region: '重庆·两江',
keywords: ['排水防涝', '智慧水务', '调度系统'],
budget: 1680,
publishDate: '2026-10-07',
regDeadline: '2026-10-23',
bidDeadline: '2026-11-06',
purchaser: '重庆两江新区市政管护中心',
noticeType: '招标公告',
sourceName: '江苏省公共资源交易网',
sourceUrl: 'http://jsggzy.jszwfw.gov.cn/jyxx/003001/003001010/20261008/683e6345-fda9-4e26-a776-fdc021dedaac.html?type=tradeInfonew_sqt',
summary: '防涝调度系统,报名 10-23 截止很近;要求模型算法与调度平台建设双重能力。',
detail: '建设排水防涝调度指挥系统,含内涝模型、泵站联调联控、应急指挥一张图与移动端应用。',
requirements: ['具备市政或信息化类项目业绩', '需具备水力模型构建能力证明', '接受联合体投标'],
},
{
id: 'p17',
name: '宁波镇海区工业园区废水处理提标改造工程',
region: '浙江·宁波',
keywords: ['工业废水', '提标改造', '工程服务'],
budget: 2600,
publishDate: '2026-09-30',
regDeadline: '2026-10-21',
bidDeadline: '2026-11-02',
purchaser: '宁波镇海工业园区管理委员会',
noticeType: '招标公告',
sourceName: '济源市公共资源交易中心',
sourceUrl: 'http://ggzyjy.jiyuan.gov.cn/jyxx/008001/008001005/20250521/79ec08cf-3764-436b-aa91-c7ee680017ff.html',
summary: '提标改造工程金额高,报名 10-21 已截止;适合作为竞对与中标价格研究样本。',
detail: '工业废水处理厂提标改造,新增深度处理工艺段,出水执行准 IV 类标准,工期 240 天。',
requirements: ['环保工程专业承包一级资质', '近三年工业废水处理工程业绩', '不接受联合体投标'],
},
{
id: 'p18',
name: '昆明滇池流域入湖河道水质自动监测站建设项目',
region: '云南·昆明',
keywords: ['水质监测', '自动监测站', '设备采购'],
budget: 640,
publishDate: '2026-10-17',
regDeadline: '2026-11-03',
bidDeadline: '2026-11-17',
purchaser: '昆明市滇池管理局',
noticeType: '招标公告',
sourceName: '机电产品采购网',
sourceUrl: 'https://sc.chinamae.com/news/b15a5f12451b4cac2341c5b73e9ba27b.html',
summary: '水质自动监测站建设,设备集成与站房配套并重;时间充裕,适合充分准备。',
detail: '新建 12 座入湖河道水质自动监测站,含九参数监测设备、站房、数据平台接入与一年运维。',
requirements: ['监测设备具备适用性检测合格报告', '近三年水质自动监测站建设业绩', '接受联合体投标'],
},
]
export function projectById(id: string): Project | undefined {
return PROJECTS.find(p => p.id === id)
}
import * as React from "react"
const MOBILE_BREAKPOINT = 768
export function useIsMobile() {
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
React.useEffect(() => {
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
const onChange = () => {
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
}
mql.addEventListener("change", onChange)
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
return () => mql.removeEventListener("change", onChange)
}, [])
return !!isMobile
}
import { useCallback, useEffect, useRef } from 'react'
// 流式输出 hook:把完整文本按字符逐步吐出,模拟 AI 生成过程
export function useStreaming() {
const timerRef = useRef<number | null>(null)
// 必须用 useCallback 固定引用:否则每次渲染都会生成新 stop,
// 使依赖 [stop] 的卸载 effect 在每次渲染时触发清理,把进行中的 trace 定时器一并清掉
const stop = useCallback(() => {
if (timerRef.current) window.clearInterval(timerRef.current)
timerRef.current = null
}, [])
useEffect(() => () => {
if (timerRef.current) window.clearInterval(timerRef.current)
}, [])
const stream = (
full: string,
onTick: (partial: string, done: boolean) => void,
speed = 12,
) => {
if (timerRef.current) window.clearInterval(timerRef.current)
let pos = 0
timerRef.current = window.setInterval(() => {
pos = Math.min(full.length, pos + 3)
onTick(full.slice(0, pos), pos >= full.length)
if (pos >= full.length && timerRef.current) {
window.clearInterval(timerRef.current)
timerRef.current = null
}
}, speed)
}
return { stream, stop }
}
// 逐条展示 Skill 调用步骤,全部完成后回调
export function runSkillTrace(
steps: string[],
onStep: (done: string[]) => void,
onComplete: () => void,
interval = 700,
): () => void {
let idx = 0
const done: string[] = []
const timer = window.setInterval(() => {
if (idx < steps.length) {
done.push(steps[idx++])
onStep([...done])
} else {
window.clearInterval(timer)
onComplete()
}
}, interval)
return () => window.clearInterval(timer)
}
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 214 32% 98%;
--foreground: 222 47% 11%;
--card: 0 0% 100%;
--card-foreground: 222 47% 11%;
--popover: 0 0% 100%;
--popover-foreground: 222 47% 11%;
--primary: 239 84% 67%;
--primary-foreground: 0 0% 100%;
--secondary: 214 32% 96%;
--secondary-foreground: 222 47% 11%;
--muted: 214 32% 96%;
--muted-foreground: 215 16% 47%;
--accent: 239 100% 97%;
--accent-foreground: 239 84% 67%;
--destructive: 347 89% 60%;
--destructive-foreground: 0 0% 98%;
--border: 220 20% 94%;
--input: 220 20% 94%;
--ring: 239 84% 67%;
--radius: 0.75rem;
--sidebar-background: 220 13% 95%;
--sidebar-foreground: 215 16% 47%;
--sidebar-primary: 239 84% 67%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 239 100% 97%;
--sidebar-accent-foreground: 239 84% 67%;
--sidebar-border: 220 20% 94%;
--sidebar-ring: 239 84% 67%;
}
}
@layer base {
* {
@apply border-border;
}
html {
@apply antialiased;
}
html, body, #root {
height: 100%;
overflow: hidden;
}
body {
@apply bg-canvas text-ink-600 font-sans;
font-feature-settings: "tnum";
}
h1, h2, h3, h4 {
@apply text-ink-900;
letter-spacing: 0.02em;
}
}
@layer utilities {
.font-num {
font-family: Manrope, "Noto Sans SC", sans-serif;
letter-spacing: -0.02em;
}
.text-brand-gradient {
background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.border-brand-gradient {
border: 1px solid transparent;
background:
linear-gradient(#fff, #fff) padding-box,
linear-gradient(135deg, #6366F1 0%, #818CF8 100%) border-box;
}
.scrollbar-thin::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
background: #E3E6EE;
border-radius: 999px;
}
}
/* ---------- Markdown 渲染 ---------- */
.md-body { font-size: 14px; line-height: 1.7; color: #475569; }
.md-body h3 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; color: #0f172a; }
.md-body h4 { font-size: 14px; font-weight: 700; margin: 10px 0 4px; color: #0f172a; }
.md-body p { margin: 6px 0; }
.md-body ul, .md-body ol { margin: 6px 0 6px 20px; }
.md-body ul { list-style: disc; }
.md-body ol { list-style: decimal; }
.md-body li { margin: 3px 0; }
.md-body strong { font-weight: 700; color: #0f172a; }
.md-body table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.md-body th, .md-body td { border: 1px solid #e8eef5; padding: 6px 8px; text-align: left; vertical-align: top; }
.md-body th { background: #EEF0FF; font-weight: 600; color: #4F46E5; }
.md-body hr { border: 0; border-top: 1px solid #e8eef5; margin: 12px 0; }
.md-body code { background: #EEF0FF; border-radius: 4px; padding: 0 4px; font-size: 13px; color: #4F46E5; }
.md-body .md-note { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); color: #92600a; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
/* 流式光标 */
.stream-caret::after {
content: "▍";
color: #6366F1;
animation: caret-blink 1.25s ease-out infinite;
}
/* 进入动画 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp 0.25s ease both; }
/* 问候条小蜜蜂:轻柔悬浮 + 微微摇摆,模拟飞行 */
@keyframes beeFloat {
0%, 100% { transform: translateY(0) rotate(-2deg); }
50% { transform: translateY(-7px) rotate(2deg); }
}
.bee-float { animation: beeFloat 2.8s ease-in-out infinite; will-change: transform; }
import type { CompanyProfile, Project, SearchBatch } from '../types'
import { defaultMatchWeights, defaultMatchDimNames } from '../types'
import { projectById } from '../data/projects'
import { conditionsText } from './store'
function fmtBudget(p: Project): string {
return p.budget === null ? '公告未披露预算' : `${p.budget} 万元`
}
function daysLeft(date: string | null): string {
if (!date) return '未披露'
const diff = Math.ceil((new Date(date).getTime() - Date.now()) / 86400000)
if (diff < 0) return `${date}(已截止)`
if (diff === 0) return `${date}(今天截止)`
return `${date}(剩余 ${diff} 天)`
}
// ---------- AI 提取每条项目最关键的参与门槛(列表直接展示,不用点开公告) ----------
export function keyRequirement(p: Project): { label: string; tone: 'block' | 'note' | 'ok' } {
const reqs = p.requirements.join(';')
if (/不接受联合体|不接受合同分包/.test(reqs)) return { label: '不接受联合体', tone: 'block' }
if (/专门面向中小微企业/.test(reqs)) return { label: '面向中小微企业', tone: 'note' }
const perf = p.requirements.find(r => /业绩/.test(r))
if (perf) {
const m = perf.match(/(\d+)\s*个/)
return { label: m ? `需 ${m[1]} 个同类业绩` : '需同类业绩', tone: 'block' }
}
const qual = p.requirements.find(r => /资质/.test(r))
if (qual) return { label: '有资质门槛', tone: 'note' }
if (/授权/.test(reqs)) return { label: '需制造商授权', tone: 'note' }
return { label: '无特殊门槛', tone: 'ok' }
}
// ---------- 整批 AI 结论:维度来自用户访谈(贴合度 > 地区 > 金额 > 时间) ----------
export interface BatchConclusion {
/** 一句话行动建议(最重要,大字号展示) */
headline: string
/** 贴合度:商务标核心就是资质 + 业绩,打分帮用户从海量结果里聚焦 */
fit: string
/** 地区:长三角内外的项目“完全是两个概念” */
region: string
/** 金额区间 */
budget: string
/** 准备时间:来不来得及做标书 */
timing: string
}
// 访谈中用户的主战场:华东长三角
const CORE_REGIONS = ['浙江', '江苏', '上海', '安徽', '杭州', '南京', '苏州', '宁波', '合肥', '无锡', '常州']
export function batchConclusion(projects: Project[], profile: CompanyProfile): BatchConclusion {
const now = Date.now()
const day = 86400000
const regDaysOf = (p: Project) => p.regDeadline ? Math.ceil((new Date(p.regDeadline).getTime() - now) / day) : null
// 时间:以“来不来得及准备标书”为口径
const urgent = projects.filter(p => { const d = regDaysOf(p); return d !== null && d >= 0 && d <= 3 })
const tight = projects.filter(p => { const d = regDaysOf(p); return d !== null && d > 3 && d <= 7 })
const ended = projects.filter(p => { const d = regDaysOf(p); return d !== null && d < 0 })
const timing = ended.length === projects.length
? '报名均已截止,可作研究样本'
: urgent.length
? `${urgent.length} 条 3 天内截止(来不及做标书慎投)${tight.length ? ` · ${tight.length} 条一周内` : ''}`
: tight.length
? `${tight.length} 条一周内截止 · 其余时间宽裕`
: '准备时间基本宽裕'
// 地区
const inRegion = projects.filter(p => CORE_REGIONS.some(r => p.region.includes(r)))
const region = inRegion.length === projects.length
? `全部在长三角内`
: `长三角 ${inRegion.length} 条 · 区域外 ${projects.length - inRegion.length} 条`
// 金额
const disclosed = projects.filter(p => p.budget !== null).map(p => p.budget as number)
const budget = disclosed.length === 0
? '均未披露预算'
: (() => {
const max = Math.max(...disclosed); const min = Math.min(...disclosed)
const hidden = projects.length - disclosed.length
return `${min.toLocaleString()}~${max.toLocaleString()} 万元${hidden ? ` · ${hidden} 条未披露` : ''}`
})()
// 贴合度:访谈确认的核心诉求——打分聚焦(先看 90+,再看 80+)
const scored = profile.completed
? projects.map(p => ({ p, m: matchScore(p, profile)! })).sort((a, b) => b.m.score - a.m.score)
: []
const high = scored.filter(x => x.m.score >= 80)
const mid = scored.filter(x => x.m.score >= 60 && x.m.score < 80)
const fit = profile.completed
? `${high.length} 条 ≥80 分${mid.length ? ` · ${mid.length} 条 60~79 分` : ''} · 最高 ${scored[0]?.m.score ?? 0} 分`
: '完善档案后生成贴合度打分'
let headline: string
if (profile.completed && scored.length) {
const top = scored[0]
const open = regDaysOf(top.p)
const timeNote = open !== null && open >= 0 ? (open <= 7 ? `,报名还剩 ${open} 天要抓紧` : ',时间来得及') : ''
headline = high.length
? `建议先评估「${top.p.name}」——贴合度 ${top.m.score} 分${timeNote};${high.length > 1 ? `另有 ${high.length - 1} 条 80 分以上` : '其余项目贴合度一般'}`
: `本批没有 80 分以上的项目,最高的「${top.p.name}」${top.m.score} 分,建议作为市场信息留存`
} else {
headline = urgent.length
? `「${urgent[0].name}」报名 3 天内截止,先确认来不来得及;完善档案后即可按贴合度打分排序优先级`
: `本批${inRegion.length ? `长三角内 ${inRegion.length} 条` : '项目已列出'},完善公司档案后即可按「资质 + 业绩贴合度」打分,从海量结果里直接锁定该看的几条`
}
return { headline, fit, region, budget, timing }
}
// ---------- 匹配度(仅在档案已完善时生成,需展示维度、权重与依据;不参与筛选排序) ----------
export interface MatchDim {
name: string
/** 权重(%) */
weight: number
/** 该维度得分 0-100 */
score: number
note: string
}
export interface MatchResult {
score: number
dims: MatchDim[]
basis: string[]
}
export function matchScore(p: Project, profile: CompanyProfile): MatchResult | null {
if (!profile.completed) return null
const dims: MatchDim[] = []
// 权重与维度名来自检索页的用户配置;合计不为 100 时按比例归一
const w = profile.matchWeights ?? defaultMatchWeights
const names = profile.matchDimNames ?? defaultMatchDimNames
const wSum = Math.max(1, w.business + w.region + w.amount + w.track)
const W = {
business: Math.round(w.business / wSum * 100),
region: Math.round(w.region / wSum * 100),
amount: Math.round(w.amount / wSum * 100),
track: Math.round(w.track / wSum * 100),
}
// 业务贴合:项目关键词与公司业务/产品/优势的重合
const profileText = [profile.mainBusiness, profile.products, profile.advantages, profile.projectTypes].join(' ')
const kwHits = p.keywords.filter(k =>
profileText.includes(k.replace(/\s|\/ /g, '')) || profileText.split(/[,,、;;\s]+/).some(wd => wd && k.includes(wd)))
dims.push({
name: names.business, weight: W.business,
score: kwHits.length > 0 ? Math.min(95, 45 + kwHits.length * 25) : 35,
note: kwHits.length > 0 ? `关键词重合:${kwHits.join('、')}` : '项目关键词与档案业务重合较少',
})
// 服务地区
const regions = profile.serviceRegions.split(/[,,、;;\s]+/).filter(Boolean)
const inRegion = regions.some(r => r !== '全国' && p.region.includes(r))
dims.push({
name: names.region, weight: W.region,
score: inRegion ? 90 : regions.includes('全国') ? 70 : 40,
note: inRegion ? `位于目标服务地区(${p.region})` : regions.includes('全国') ? '服务范围覆盖全国' : `${p.region} 不在档案服务地区内`,
})
// 金额匹配
const amountMatch = profile.amountPreference.match(/(\d+)\s*[-~至]\s*(\d+)/)
if (p.budget === null) {
dims.push({ name: names.amount, weight: W.amount, score: 50, note: '公告未披露预算,无法对照金额偏好' })
} else if (amountMatch) {
const lo = Number(amountMatch[1]); const hi = Number(amountMatch[2])
const inRange = p.budget >= lo && p.budget <= hi
dims.push({
name: names.amount, weight: W.amount, score: inRange ? 85 : 45,
note: inRange ? `预算 ${p.budget} 万元在偏好区间 ${lo}~${hi} 万元内` : `预算 ${p.budget} 万元不在偏好区间 ${lo}~${hi} 万元内`,
})
} else {
dims.push({ name: names.amount, weight: W.amount, score: 60, note: '档案未填金额偏好,按中性计' })
}
// 业绩与资质:商务标核心;材料缺失不等于不符合,标记为待核对
const needPerf = p.requirements.some(r => /业绩/.test(r))
const needQual = p.requirements.some(r => /资质/.test(r))
if (needPerf && !profile.trackRecord.trim()) {
dims.push({ name: names.track, weight: W.track, score: 30, note: '公告要求同类业绩,档案“代表业绩”未填写,无法核对(待补充,不代表不符合)' })
} else if (needQual && !profile.qualifications.trim()) {
dims.push({ name: names.track, weight: W.track, score: 35, note: '公告涉及资质要求,档案“资质与认证”未填写,无法核对(待补充,不代表不符合)' })
} else if (profile.trackRecord.trim() || profile.qualifications.trim()) {
dims.push({ name: names.track, weight: W.track, score: 75, note: '档案已填业绩/资质,硬性条款仍需以证书与合同原件逐条核对' })
} else {
dims.push({ name: names.track, weight: W.track, score: 50, note: '档案未填业绩与资质,建议补充后再评估' })
}
const score = Math.round(dims.reduce((s, d) => s + d.score * d.weight / 100, 0))
return { score, dims, basis: dims.map(d => `${d.name}:${d.note}`) }
}
// ---------- AI 时间解读:把原始日期翻译成用户视角的紧迫度判断 ----------
export interface TimeDigest {
/** 主提示,如「报名仅剩 3 天」 */
label: string
/** 次级信息,如「之后投标还剩 12 天」 */
sub: string
/** 一句话行动建议 */
hint: string
tone: 'urgent' | 'warn' | 'ok' | 'muted'
}
export function timeDigest(p: Project): TimeDigest {
const now = Date.now()
const day = 86400000
const regDays = p.regDeadline ? Math.ceil((new Date(p.regDeadline).getTime() - now) / day) : null
const bidDays = p.bidDeadline ? Math.ceil((new Date(p.bidDeadline).getTime() - now) / day) : null
// 报名窗口仍开放:以报名为主线
if (regDays !== null && regDays >= 0) {
const sub = bidDays !== null && bidDays >= 0 ? `投标截止 ${p.bidDeadline}` : '投标截止时间未披露'
if (regDays === 0) return { label: '今天报名截止', sub, hint: '今天截止,若考虑参与需立即报名', tone: 'urgent' }
if (regDays <= 3) return { label: `报名仅剩 ${regDays} 天`, sub, hint: '时间很紧,需立即决定是否报名', tone: 'urgent' }
if (regDays <= 7) return { label: `报名还剩 ${regDays} 天`, sub, hint: '时间偏紧,建议尽快准备报名材料', tone: 'warn' }
return { label: `报名还剩 ${regDays} 天`, sub, hint: '时间充裕,可从容评估是否参与', tone: 'ok' }
}
// 报名已过或未披露,看投标
if (regDays !== null && regDays < 0 && bidDays !== null && bidDays >= 0) {
return { label: '报名已截止', sub: `投标还剩 ${bidDays} 天`, hint: '报名窗口已过,可关注开标结果作研究参考', tone: 'muted' }
}
if (regDays === null && bidDays !== null && bidDays >= 0) {
if (bidDays <= 3) return { label: `投标仅剩 ${bidDays} 天`, sub: '报名截止时间未披露', hint: '投标临近,报名安排需以公告原文为准', tone: 'urgent' }
return { label: `投标还剩 ${bidDays} 天`, sub: '报名截止时间未披露', hint: '建议打开公告原文确认报名方式', tone: 'warn' }
}
if ((regDays !== null && regDays < 0) || (bidDays !== null && bidDays < 0)) {
return { label: '报名与投标均已截止', sub: `发布于 ${p.publishDate}`, hint: '项目已结束,可作采购方与竞对研究样本', tone: 'muted' }
}
return { label: '截止时间未披露', sub: `发布于 ${p.publishDate}`, hint: '公告未给出明确节点,建议查看原文确认', tone: 'muted' }
}
// ---------- 单项目 AI 分析 ----------
export function projectAnalysis(p: Project, profile: CompanyProfile): string {
const hasProfile = profile.completed
const match = matchScore(p, profile)
const parts: string[] = []
parts.push(`### 项目分析:${p.name}`)
parts.push(`**公告事实**(来源:${p.sourceName}${p.sourceUrl ? '' : ',来源链接暂未收录'})`)
parts.push(`- 采购单位:${p.purchaser}`)
parts.push(`- 地区:${p.region}|公告类型:${p.noticeType}`)
parts.push(`- 预算:${fmtBudget(p)}`)
parts.push(`- 发布日期:${p.publishDate}|报名截止:${daysLeft(p.regDeadline)}|投标截止:${daysLeft(p.bidDeadline)}`)
parts.push(`\n**项目内容**\n${p.detail}`)
parts.push(`\n**公告参与条件**\n${p.requirements.map(r => `- ${r}`).join('\n')}`)
if (hasProfile) {
parts.push(`\n**结合公司档案对照**(档案版本 v${profile.version},${profile.updatedAt})`)
if (match) {
parts.push(`- 贴合度参考:**${match.score} 分**(仅辅助参考,不用于筛选或排序)`)
parts.push(`\n**贴合度打分报告**\n\n| 维度 | 权重 | 得分 | 依据 |\n| --- | --- | --- | --- |`)
match.dims.forEach(d => parts.push(`| ${d.name} | ${d.weight}% | ${d.score} | ${d.note} |`))
const sorted = [...match.dims].sort((a, b) => b.score - a.score)
const strongest = sorted[0]
const weakest = sorted[sorted.length - 1]
const verdict = match.score >= 80
? '整体贴合度高,建议优先评估并尽快确认报名时间'
: match.score >= 60
? '具备一定贴合度,建议先核对短板维度再决定是否投入'
: '贴合度偏低,建议作为市场信息留存,暂不投入标书资源'
parts.push(`\n**综合判断**:${match.score} 分——最强项「${strongest.name}」${strongest.score} 分;主要短板「${weakest.name}」${weakest.score} 分(${weakest.note})。${verdict}。`)
// 结合公司档案的优劣势分析
const strengths = match.dims.filter(d => d.score >= 75)
const weaknessDims = match.dims.filter(d => d.score < 60)
parts.push(`\n**结合公司档案的优劣势**`)
if (strengths.length) {
parts.push(`优势:`)
strengths.forEach(d => parts.push(`- ${d.name}(${d.score} 分):${d.note}`))
}
if (weaknessDims.length) {
parts.push(`短板:`)
weaknessDims.forEach(d => parts.push(`- ${d.name}(${d.score} 分):${d.note}`))
}
if (!strengths.length && !weaknessDims.length) {
parts.push('- 各维度表现均衡,无明显长板或短板,建议按综合得分与时间安排决定优先级')
}
if (profile.advantages.trim()) {
parts.push(`- 可在标书中突出档案记载的竞争优势:${profile.advantages}`)
}
}
const reqs = p.requirements
const track = profile.trackRecord || ''
const quals = profile.qualifications || ''
const hints: string[] = []
if (reqs.some(r => r.includes('业绩')) && !track) hints.push('公告要求同类业绩,但档案中“代表业绩”尚未填写,建议补充后再判断')
if (reqs.some(r => r.includes('资质')) && !quals) hints.push('公告涉及资质要求,档案中“资质与认证”尚未填写,无法核对')
if (profile.boundaries) hints.push(`参与边界提示:${profile.boundaries}`)
if (hints.length) parts.push(hints.map(h => `- ${h}`).join('\n'))
else parts.push('- 档案信息已覆盖业绩与资质维度,建议逐条核对公告原件要求')
} else {
parts.push(`\n> **提示:公司档案未完善**,暂无法生成匹配度与针对性对照。以上为公告事实概括,不包含针对贵公司的结论。完善档案后可获得有依据的匹配建议。`)
}
parts.push(`\n**风险与未知项**`)
parts.push(`- ${p.budget === null ? '公告未披露预算,缺少价格基准,不能直接给出报价建议' : '预算不等于建议报价;缺少工程量、成本与历史成交依据时,不能直接给出可靠报价'}`)
if (p.regDeadline && new Date(p.regDeadline).getTime() - Date.now() < 5 * 86400000 && new Date(p.regDeadline).getTime() > Date.now()) {
parts.push(`- 报名截止距今不足 5 天,如考虑参与需尽快准备报名材料`)
}
parts.push(`- 评分办法、付款方式等细节需以招标文件原文为准,本次分析未覆盖`)
parts.push(`\n*是否跟进、报名或投标由你自行决定;以上为辅助分析,重要事实请核对公告原文。*`)
return parts.join('\n')
}
// ---------- 项目追问 ----------
export function projectFollowUp(p: Project, q: string, profile: CompanyProfile): string {
const lower = q.toLowerCase()
if (lower.includes('截止') || lower.includes('时间') || lower.includes('报名')) {
return `**该项目的时间节点**\n- 公告发布:${p.publishDate}\n- 报名截止:${daysLeft(p.regDeadline)}\n- 投标截止:${daysLeft(p.bidDeadline)}\n\n报名截止与投标截止需分别判断;如考虑参与,建议以公告原文时间为准并预留材料准备时间。${profile.completed && profile.bidPreparation ? `\n\n按档案中填写的投标准备周期(${profile.bidPreparation}),请核对时间是否紧张。` : ''}`
}
if (lower.includes('预算') || lower.includes('报价') || lower.includes('金额') || lower.includes('价格')) {
return `**预算口径说明**\n- 公告预算:${fmtBudget(p)}\n\n预算不等于建议报价。缺少工程量清单、成本构成与同类项目历史成交依据时,不能直接给出可靠报价。如需报价参考,可在“对话调研”中查询同类项目的历史中标价格。`
}
if (lower.includes('资质') || lower.includes('条件') || lower.includes('要求') || lower.includes('门槛')) {
const base = `**公告参与条件**\n${p.requirements.map(r => `- ${r}`).join('\n')}`
if (profile.completed) {
return `${base}\n\n**对照公司档案**:请逐条核对档案中的资质(${profile.qualifications || '未填写'})与业绩(${profile.trackRecord || '未填写'})是否满足。材料缺失不等于不符合,建议以证书原件与业绩合同为准。`
}
return `${base}\n\n公司档案未完善,暂无法做针对性对照。`
}
if (lower.includes('风险') || lower.includes('注意')) {
return `**需要关注的风险点**\n- ${p.budget === null ? '预算未披露,价格与竞争强度缺少判断依据' : '预算规模较大时通常竞争更强,建议查询采购方历史中标供应商'}\n- 评分办法、资格条款细节以招标文件原文为准\n- 注意更正公告:同一项目可能发布更正,需确认当前看到的是最新版本\n\n以上为通用提示,不构成投标决定建议。`
}
return `已收到关于「${p.name}」的问题。可以进一步问我:\n- 报名和投标截止时间\n- 公告参与条件与资质要求\n- 预算口径与报价参考\n- 风险与需要注意的事项\n\n(当前为演示环境,回答基于已获取的公告数据生成。)`
}
// ---------- 基于本次搜索提问 ----------
export function searchQaAnswer(batch: SearchBatch, q: string, profile: CompanyProfile): string {
const projects = batch.projectIds.map(id => projectById(id)).filter(Boolean) as Project[]
const total = batch.total
const scope = `本次对话基于实际执行的检索:${conditionsText(batch.conditions)},共 ${total} 条结果。`
const lower = q.toLowerCase()
if (lower.includes('截止') || lower.includes('快')) {
const withDeadline = projects
.filter(p => p.regDeadline)
.sort((a, b) => new Date(a.regDeadline!).getTime() - new Date(b.regDeadline!).getTime())
if (!withDeadline.length) return `${scope}\n\n本次结果中的项目均未披露报名截止时间。`
const urgent = withDeadline.filter(p => {
const d = (new Date(p.regDeadline!).getTime() - Date.now()) / 86400000
return d >= 0 && d <= 7
})
const lines = (urgent.length ? urgent : withDeadline.slice(0, 5)).map(p =>
`- **${p.name}**:报名截止 ${daysLeft(p.regDeadline)}(${p.region})`)
return `${scope}\n\n### 报名截止较近的项目\n${lines.join('\n')}\n\n${urgent.length ? `共 ${urgent.length} 个项目报名截止距今不足 7 天。` : '本次结果中没有 7 天内截止报名的项目,以上为截止最近的 5 个。'}时间以公告原文为准。`
}
if (lower.includes('预算') || lower.includes('金额') || lower.includes('披露')) {
const disclosed = projects.filter(p => p.budget !== null)
const hidden = projects.filter(p => p.budget === null)
const sum = disclosed.reduce((s, p) => s + (p.budget ?? 0), 0)
return `${scope}\n\n### 预算披露情况\n- 披露预算:${disclosed.length} 条,合计约 ${sum.toLocaleString()} 万元\n- 未披露预算:${hidden.length} 条(未披露不等于预算为 0)\n\n预算最高的三条:\n${disclosed.sort((a, b) => (b.budget ?? 0) - (a.budget ?? 0)).slice(0, 3).map(p => `- ${p.name}:${p.budget} 万元(${p.region})`).join('\n') || '- 无'}`
}
if (lower.includes('共同') || lower.includes('要求') || lower.includes('条件')) {
const all = projects.flatMap(p => p.requirements)
const needTrack = all.filter(r => r.includes('业绩')).length
const noJoint = all.filter(r => r.includes('不接受联合体')).length
const yesJoint = all.filter(r => r.includes('接受联合体')).length
const needQual = all.filter(r => r.includes('资质')).length
return `${scope}\n\n### 本次结果的共同要求(基于已获取公告文本统计)\n- 要求同类业绩的项目:${needTrack} 个\n- 明确要求资质的项目:${needQual} 个\n- 不接受联合体投标:${noJoint} 个|接受联合体投标:${yesJoint} 个\n\n以上统计来自公告事实字段,个别项目的具体条款(如业绩个数、资质等级)需打开原文逐条核对。材料缺失不等于不符合。`
}
if (lower.includes('比较') || lower.includes('对比') || lower.includes('推荐') || lower.includes('优先')) {
const active = projects.filter(p => p.regDeadline && new Date(p.regDeadline).getTime() > Date.now())
const rows = (active.length ? active : projects).slice(0, 5).map(p => {
const m = matchScore(p, profile)
return `| ${p.name} | ${p.region} | ${fmtBudget(p)} | ${daysLeft(p.regDeadline)} | ${m ? m.score + ' 分' : '档案未完善'} |`
})
return `${scope}\n\n### 项目比较(展示前 ${Math.min(5, rows.length)} 条,共 ${total} 条)\n| 项目 | 地区 | 预算 | 报名截止 | 匹配度参考 |\n| --- | --- | --- | --- | --- |\n${rows.join('\n')}\n\n匹配度仅作辅助参考${profile.completed ? ',依据来自公司档案与公告字段的重合' : ',完善公司档案后生成'};不用于筛选或重排结果。是否跟进由你判断。`
}
return `${scope}\n\n可以围绕本次结果继续问我,例如:\n- 哪些项目报名快截止了\n- 这些项目的预算披露情况\n- 这些项目有哪些共同要求\n- 比较一下这些项目\n\n我只基于本次实际检索的结果回答,不会修改结果列表的范围或顺序。`
}
// ---------- 对话调研 ----------
export interface ResearchResult {
markdown: string
skillTrace: string[]
title: string
}
export function researchAnswer(query: string, entry: string | null): ResearchResult {
const q = query.trim()
const isCustomer = entry === 'customer' || /公司|企业|客户|水务集团|水务局/.test(q) && !/竞争|对手/.test(q)
const isCompetitor = entry === 'competitor' || /竞争|对手|竞对/.test(q)
const isMarket = entry === 'market' || /市场|区域|地区|需求/.test(q)
// 提取一个看起来像企业名的主体用于代入回答
const subject = q.replace(/[??。,,]/g, ' ').split(/\s+/).find(w => /公司|集团|局|院/.test(w))
?? q.slice(0, 12)
if (isCompetitor) {
return {
title: q.slice(0, 18),
skillTrace: ['企业情报 Skill · company-intel:识别企业主体', '企业情报 Skill · company-intel:查询中标记录与业务重合', '招投标检索 Skill · tender-search:核对同场投标记录'],
markdown: `### 竞争对手调研:${subject}
**主体确认**:已按工商主体与公告主体双重核对,以下数据来自公开中标记录与工商信息(演示数据)。
**主营业务结构**
| 业务方向 | 收入占比(估算) | 与我方重合度 |
| --- | --- | --- |
| 智慧水务平台建设 | 约 45% | 高 |
| 供水管网漏损控制 | 约 25% | 高 |
| 水质监测设备集成 | 约 20% | 中 |
| 运营托管服务 | 约 10% | 低 |
**近一年公开中标记录(节选)**
| 时间 | 项目 | 金额 | 采购单位 |
| --- | --- | --- | --- |
| 2026-08 | 某市供水管网分区计量项目 | 860 万 | 市水务集团 |
| 2026-05 | 某区智慧水务数据平台二期 | 1,420 万 | 区住建局 |
| 2025-12 | 某污水厂自控系统改造 | 530 万 | 园区管委会 |
**判断**
- 优势在平台类大项目,客单价高,但交付周期长;漏损类项目多用分包,自有算法能力一般
- 与我方正面冲突集中在**平台建设项目**;在**漏损治理、监测设备**项目上我方交付成本和本地化响应占优
- 其华东区域客户集中,华南、西南覆盖薄弱,可作为差异化切入方向
> 以上为模拟数据演示,正式接入后每条记录可点开公告来源核对。`,
}
}
if (isMarket) {
return {
title: q.slice(0, 18),
skillTrace: ['招投标检索 Skill · tender-search:检索区域采购公告', '招投标检索 Skill · tender-search:统计中标记录与时间变化', '市场聚合分析:买方与供应商集中度'],
markdown: `### 区域市场调研:${q}
**总体判断**(演示数据):该区域智慧水务采购处于**持续放量**阶段,近 90 天公告数量环比上升约 22%,值得加大投入。
**采购热度(近 6 个月,公告条数)**
| 月份 | 公告数 | 披露预算合计 |
| --- | --- | --- |
| 2026-05 | 31 | 1.9 亿 |
| 2026-06 | 28 | 1.6 亿 |
| 2026-07 | 35 | 2.2 亿 |
| 2026-08 | 42 | 2.8 亿 |
| 2026-09 | 47 | 3.1 亿 |
| 2026-10(至今) | 39 | 2.4 亿 |
**主要买方**:市水务集团及其下属供水公司(占公告量约 40%)、区县住建/水务局(约 35%)、园区管委会(约 15%)。
**竞争格局**:高频中标企业 6 家,集中度中等;平台类项目多被两家头部企业拿走,**监测与漏损类项目中标方分散,是新进入者的主要机会口**。
**建议**
- 优先盯区县水务局发布的漏损治理与监测类项目,门槛相对低、决策链短
- 平台类项目可关注二期/三期延续采购,一期供应商未必延续
> 以上为模拟数据演示;调研结果围绕研究问题查询,不代表全量检索结果。`,
}
}
if (isCustomer) {
return {
title: q.slice(0, 18),
skillTrace: ['企业情报 Skill · company-intel:确认企业主体', '企业情报 Skill · company-intel:查询采购与中标记录', '企业情报 Skill · company-intel:梳理客户与供应商关系'],
markdown: `### 目标客户调研:${subject}
**企业主体**(演示数据):已确认工商主体与公告发布主体一致,国有控股,承担辖区供水与排水运营。
**近一年采购画像**
| 维度 | 观察 |
| --- | --- |
| 采购频率 | 年均 12–15 个公开项目,Q3–Q4 为集中采购期 |
| 偏好类型 | 管网漏损治理、二次供水改造、数据平台建设 |
| 常见预算区间 | 500 万 – 2,000 万 |
| 决策特点 | 重业绩案例,常要求 2 个以上同类项目经验 |
**近期采购记录(节选)**
| 时间 | 项目 | 金额 |
| --- | --- | --- |
| 2026-09 | 分区计量与漏损分析平台建设 | 1,180 万 |
| 2026-06 | 二次供水设施改造(二期) | 940 万 |
| 2026-03 | 水质在线监测设备采购 | 420 万 |
**切入建议**
- 该客户**连续三个项目都涉及漏损方向**,说明漏损指标考核压力大,我方漏损控制方案正中其需求
- 历史合作供应商中暂无固定平台服务商,存在替换窗口
- 建议关注其 Q4 批次采购,提前准备同类业绩材料
> 以上为模拟数据演示,正式接入后每条事实均可点开来源。`,
}
}
return {
title: q.slice(0, 18) || '自由调研',
skillTrace: ['主 AI:理解研究问题并识别对象与范围', '招投标检索 Skill · tender-search:检索相关公告', '企业情报 Skill · company-intel:补充主体背景'],
markdown: `### 调研:${q}
已围绕你的问题完成一轮公开信息检索与整理(演示数据)。
**初步发现**
- 相关公开公告与记录共检索到 20 余条,时间集中在近半年,说明该方向处于活跃期
- 涉及主体以地方水务集团、区县住建/水务部门为主,项目金额多落在 500 万 – 2,000 万区间
- 从公告条款看,**同类业绩与本地化服务能力**是被提及最多的两项门槛
**可以继续追问**
- 「这些项目里哪些报名快截止了」
- 「主要中标企业都有谁」
- 「把采购单位按地区归一下类」
回答会区分来源事实与 AI 推断;未查到的内容会明确说明,不做断言。`,
}
}
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