02272305
This commit is contained in:
parent
f352a55c02
commit
52fa9a031a
|
@ -20,6 +20,7 @@ import { useTusUpload } from "@web/src/hooks/useTusUpload";
|
|||
import { useNavigate } from "react-router-dom";
|
||||
import { useAuth } from "@web/src/providers/auth-provider";
|
||||
import { MIND_OPTIONS } from "./constant";
|
||||
import { SaveOutlined } from "@ant-design/icons";
|
||||
export default function MindEditor({ id }: { id?: string }) {
|
||||
//containerRef 容器ref instance 实例
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
@ -170,7 +171,7 @@ export default function MindEditor({ id }: { id?: string }) {
|
|||
|
||||
return (
|
||||
<div className="grid grid-cols-1 flex-col w-[90vw] my-5 h-[80vh] border rounded-lg mx-auto">
|
||||
{canEdit && taxonomies && (
|
||||
{taxonomies && (
|
||||
<Form form={form} className=" bg-white p-4 ">
|
||||
<div className="flex items-center justify-between gap-4">
|
||||
<div className="flex items-center gap-4">
|
||||
|
@ -181,6 +182,7 @@ export default function MindEditor({ id }: { id?: string }) {
|
|||
// rules={[{ required: true }]}
|
||||
noStyle>
|
||||
<TermSelect
|
||||
disabled={!canEdit}
|
||||
className=" w-48"
|
||||
placeholder={`请选择${tax.name}`}
|
||||
taxonomyId={tax.id}
|
||||
|
@ -192,19 +194,21 @@ export default function MindEditor({ id }: { id?: string }) {
|
|||
name="deptIds"
|
||||
noStyle>
|
||||
<DepartmentSelect
|
||||
disabled={!canEdit}
|
||||
className="w-96"
|
||||
placeholder="请选择制作单位"
|
||||
multiple
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
<Button
|
||||
{canEdit && <Button
|
||||
ghost
|
||||
type="primary"
|
||||
icon={<SaveOutlined></SaveOutlined>}
|
||||
onSubmit={(e) => e.preventDefault()}
|
||||
onClick={handleSave}>
|
||||
{id ? "更新" : "保存"}
|
||||
</Button>
|
||||
</Button>}
|
||||
</div>
|
||||
</Form>
|
||||
)}
|
||||
|
|
|
@ -70,7 +70,9 @@ export const routes: CustomRouteObject[] = [
|
|||
},
|
||||
{
|
||||
path: "editor/:id?",
|
||||
element: <PathEditorPage></PathEditorPage>,
|
||||
element: <WithAuth>
|
||||
<PathEditorPage></PathEditorPage>
|
||||
</WithAuth>,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue