优化项目结构

This commit is contained in:
宇阳
2024-10-12 13:16:16 +08:00
parent 798e501d8c
commit 22ae0c0843

View File

@@ -1,19 +1,22 @@
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { Form, Input, Button, Select, DatePicker, Cascader, FormProps, message } from "antd";
import TextArea from "antd/es/input/TextArea";
import { RuleObject } from "antd/es/form";
import { useNavigate } from "react-router-dom";
import "./index.scss"
import { addArticleDataAPI, editArticleDataAPI } from '@/api/Article'
import { getCateListAPI } from '@/api/Cate'
import { getTagListAPI } from '@/api/Tag'
import { Cate } from "@/types/app/cate";
import { Tag } from "@/types/app/tag";
import { Article } from "@/types/app/article";
import dayjs from 'dayjs';
import "./index.scss"
interface FieldType {
title: string,
createTime: number;
@@ -153,13 +156,3 @@ const PublishForm = ({ data, closeModel }: { data: Article, closeModel: () => vo
};
export default PublishForm;
function transCateArray(arr: Cate[]): any {
return arr.map((item: Cate) => {
if (item.children && item.children.length > 0) {
return [item.id, ...transCateArray(item.children)].flat();
} else {
return item.id;
}
});
}