From ca2bfceffc3a4a7116933b8e83cd643a67b2f4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E9=98=B3?= Date: Fri, 10 Jan 2025 21:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=95=B4=E4=BD=93=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Create/index.tsx | 3 ++- src/pages/CreateRecord/index.tsx | 39 +++++++++++++++++++++++--------- src/pages/Decycle/index.tsx | 2 +- src/pages/Draft/index.tsx | 2 +- src/pages/Role/index.tsx | 4 ++-- 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/src/pages/Create/index.tsx b/src/pages/Create/index.tsx index 360d257..436f981 100644 --- a/src/pages/Create/index.tsx +++ b/src/pages/Create/index.tsx @@ -11,6 +11,7 @@ import { getArticleDataAPI } from '@/api/Article' import { BiSave } from "react-icons/bi"; import { AiOutlineEdit, AiOutlineSend } from 'react-icons/ai'; +import { titleSty } from '@/styles/sty'; const CreatePage = () => { const [params] = useSearchParams() @@ -175,7 +176,7 @@ const CreatePage = () => { - + setContent(value)} /> { { key: 'upload', label: '上传图片', - onClick: () => setIsModalOpen(true) + onClick: () => { + if (imageList.length >= 4) { + message.warning('最多只能上传 4 张图片'); + return; + } + setIsModalOpen(true); + } }, { key: 'input', label: '输入链接', onClick: () => { + if (imageList.length >= 4) { + message.warning('最多只能上传 4 张图片'); + return; + } let inputUrl = ''; Modal.confirm({ title: '输入图片链接', @@ -107,18 +117,19 @@ export default () => { <> - <Card className={`${titleSty} min-h-[calc(100vh-270px)]`}> - <div className="relative flex w-[800px] mx-auto mt-[50px]"> + <Card className={`${titleSty} min-h-[calc(100vh-180px)]`}> + <div className="relative flex w-[90%] xl:w-[800px] mx-auto mt-[50px]"> <TextArea rows={10} maxLength={500} placeholder="记录此刻!" value={content} onChange={(e) => setContent(e.target.value)} - className="w-[800px] p-4 border-2 border-[#eee] dark:border-strokedark text-base rounded-md" /> + className="w-full p-4 border-2 border-[#eee] dark:border-strokedark text-base rounded-md" + /> - <div className="absolute bottom-4 left-4 flex items-end space-x-3"> - <div className="flex space-x-2 overflow-x-auto"> + <div className="absolute bottom-4 left-4 flex items-end space-x-3 max-w-[calc(100%-80px)]"> + <div className="flex space-x-2 overflow-x-auto scrollbar-hide"> {imageList.length > 0 && imageList.map((item, index) => ( <div key={index} className="group overflow-hidden relative shrink-0"> <div className="absolute top-0 -right-6 group-hover:right-0 z-10 bg-slate-600 rounded-full cursor-pointer p-1" onClick={() => handleDelImage(item)}> @@ -128,21 +139,27 @@ export default () => { <Image key={index} src={item} - width={100} - height={100} + width={80} + height={80} preview={false} - className='rounded-lg' + className='rounded-lg md:w-[100px] md:h-[100px] xs:w-20 xs:h-20 w-15 h-15 object-cover' /> </div> ))} </div> <Dropdown menu={dropdownItems} placement="top"> - <LuImagePlus className="mb-1 text-4xl text-slate-700 dark:text-white hover:text-primary dark:hover:text-primary cursor-pointer shrink-0" /> + <LuImagePlus className="mb-1 text-3xl md:text-4xl text-slate-700 dark:text-white hover:text-primary dark:hover:text-primary cursor-pointer shrink-0" /> </Dropdown> </div> - <Button type="primary" size="large" icon={<BiLogoTelegram className="text-xl" />} className="absolute bottom-4 right-4" onClick={onSubmit} /> + <Button + type="primary" + size="large" + icon={<BiLogoTelegram className="text-xl" />} + className="absolute bottom-4 right-4" + onClick={onSubmit} + /> </div> </Card> diff --git a/src/pages/Decycle/index.tsx b/src/pages/Decycle/index.tsx index a8fcc1d..a470c8c 100644 --- a/src/pages/Decycle/index.tsx +++ b/src/pages/Decycle/index.tsx @@ -146,7 +146,7 @@ export default () => { <> <Title value="回收站" /> - <Card className={`${titleSty} mt-2 min-h-[calc(100vh-270px)]`}> + <Card className={`${titleSty} mt-2 min-h-[calc(100vh-180px)]`}> <Table rowKey="id" dataSource={articleList} diff --git a/src/pages/Draft/index.tsx b/src/pages/Draft/index.tsx index 2734140..49dffe0 100644 --- a/src/pages/Draft/index.tsx +++ b/src/pages/Draft/index.tsx @@ -107,7 +107,7 @@ export default () => { <> <Title value="草稿箱" /> - <Card className={`${titleSty} mt-2 min-h-[calc(100vh-270px)]`}> + <Card className={`${titleSty} mt-2 min-h-[calc(100vh-180px)]`}> <Table rowKey="id" dataSource={articleList} diff --git a/src/pages/Role/index.tsx b/src/pages/Role/index.tsx index cff3d68..ac3c604 100644 --- a/src/pages/Role/index.tsx +++ b/src/pages/Role/index.tsx @@ -134,8 +134,8 @@ const RolePage = () => { <> <Title value="角色管理" /> - <div className='flex md:justify-between flex-col md:flex-row mx-auto mt-2'> - <Card className="w-full md:w-[40%] h-96 min-h-[calc(100vh-180px)]"> + <div className='flex md:justify-between flex-col md:flex-row mx-auto mt-2 min-h-[calc(100vh-180px)]'> + <Card className="w-full md:w-[40%] h-94"> <Form form={form} layout="vertical"