diff --git a/web/app/dashboard/tickets/page.tsx b/web/app/dashboard/tickets/page.tsx index e95d089..106485b 100644 --- a/web/app/dashboard/tickets/page.tsx +++ b/web/app/dashboard/tickets/page.tsx @@ -1,6 +1,6 @@ "use client" -import { PlusIcon, RefreshCcwIcon, SearchXIcon } from "lucide-react" +import { PlusIcon, RefreshCcwIcon, SearchIcon, SearchXIcon } from "lucide-react" import { useSearchParams } from "next/navigation" import { useCallback, useEffect, useMemo, useRef, useState } from "react" import { toast } from "sonner" @@ -246,9 +246,32 @@ export default function TicketsPage() { return (
-
-

工单

-

按状态、负责人和标签快速处理轻量工单

+
+
+ {quickViews.map((view) => ( + + ))} +
-
-
- {quickViews.map((view) => ( - - ))} -
-
-
重置 + +
diff --git a/web/components/rich-text-editor.tsx b/web/components/rich-text-editor.tsx deleted file mode 100644 index 6c80874..0000000 --- a/web/components/rich-text-editor.tsx +++ /dev/null @@ -1,161 +0,0 @@ -"use client" - -import { useEffect } from "react" -import { EditorContent, useEditor } from "@tiptap/react" -import StarterKit from "@tiptap/starter-kit" -import Placeholder from "@tiptap/extension-placeholder" -import { - BoldIcon, - ItalicIcon, - ListIcon, - ListOrderedIcon, - QuoteIcon, - RedoIcon, - UndoIcon, -} from "lucide-react" - -import { Button } from "@/components/ui/button" -import { - ToggleGroup, - ToggleGroupItem, -} from "@/components/ui/toggle-group" -import { Separator } from "@/components/ui/separator" - -type RichTextEditorProps = { - content: string - onChange: (html: string) => void - placeholder?: string - disabled?: boolean -} - -export function RichTextEditor({ - content, - onChange, - placeholder = "输入内容...", - disabled = false, -}: RichTextEditorProps) { - const editor = useEditor({ - immediatelyRender: false, - extensions: [ - StarterKit.configure({ - heading: { - levels: [1, 2, 3], - }, - bulletList: { - keepMarks: true, - keepAttributes: false, - }, - orderedList: { - keepMarks: true, - keepAttributes: false, - }, - }), - Placeholder.configure({ - placeholder, - }), - ], - content, - editable: !disabled, - onUpdate: ({ editor }) => { - const html = editor.getHTML() - onChange(html) - }, - editorProps: { - attributes: { - class: - "min-h-64 max-h-96 overflow-y-auto px-4 py-3 text-sm leading-7 text-slate-900 outline-none [&_.ProseMirror-focused]:outline-none [&_p]:m-0 [&_p]:mb-2 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-3 [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:mb-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6 [&_li]:mb-1 [&_blockquote]:border-l-4 [&_blockquote]:border-muted-foreground [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-muted-foreground", - }, - }, - }) - - useEffect(() => { - if (editor && content !== editor.getHTML()) { - editor.commands.setContent(content) - } - }, [content, editor]) - - useEffect(() => { - if (editor) { - editor.setEditable(!disabled) - } - }, [disabled, editor]) - - if (!editor) { - return null - } - - return ( -
-
- - editor.chain().focus().undo().run()} - > - - - editor.chain().focus().redo().run()} - > - - - - editor.chain().focus().toggleBold().run()} - > - - - editor.chain().focus().toggleItalic().run()} - > - - - - editor.chain().focus().toggleBulletList().run()} - > - - - editor.chain().focus().toggleOrderedList().run()} - > - - - editor.chain().focus().toggleBlockquote().run()} - > - - - -
-
- -
-
- ) -}