diff --git a/web/src/pages/admin/setting/SettingMenu.js b/web/src/pages/admin/setting/SettingMenu.js
index 7218b00..c2cd43d 100644
--- a/web/src/pages/admin/setting/SettingMenu.js
+++ b/web/src/pages/admin/setting/SettingMenu.js
@@ -1,6 +1,18 @@
import React from "react";
import { useNavigate } from "react-router-dom";
-import { Row, Col, Space, Button, Tabs, message } from "antd";
+import {
+ Row,
+ Col,
+ Space,
+ Button,
+ Tabs,
+ Modal,
+ Form,
+ Input,
+ InputNumber,
+ Select,
+ message,
+} from "antd";
import { PlusOutlined, MenuOutlined, NumberOutlined } from "@ant-design/icons";
import ApiClient from "../../../services/client";
import CONSTANTS from "../../../constants";
@@ -8,9 +20,12 @@ import SettingMenuTable from "./SettingMenuTable";
const SettingMenu = () => {
const [isLoading, setIsLoading] = React.useState(true);
-
+ const [isModalOpen, setIsModalOpen] = React.useState(false);
const [tabItems, setTabItems] = React.useState([]);
+ const [menuTypes, setMenuTypes] = React.useState([]);
+ const [currentTab, setCurrentTab] = React.useState("admin");
const [messageApi, contextHolder] = message.useMessage();
+ const [newForm] = Form.useForm();
const navigate = useNavigate();
React.useEffect(() => {
@@ -33,6 +48,7 @@ const SettingMenu = () => {
),
})
);
+ setMenuTypes(Object.keys(response.data?.data));
setTabItems(data);
} else if (
response.data?.code === CONSTANTS.ERRCODE.ErrAuthNoLogin ||
@@ -60,6 +76,30 @@ const SettingMenu = () => {
getAllMenus();
}, [isLoading, messageApi, navigate]);
+ const handleModalOk = async () => {
+ newForm
+ .validateFields()
+ .then((row) => {
+ ApiClient.post("/admin/setting/menu", row)
+ .then((response) => {
+ if (response.data?.code === 0) {
+ messageApi.success("新增菜单项成功");
+ setIsModalOpen(false);
+ setIsLoading(true);
+ } else {
+ messageApi.error(response.data?.message);
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ messageApi.error("新增接口失败,请稍后重试!");
+ });
+ })
+ .catch((info) => {
+ console.log("Validate Failed:", info);
+ });
+ };
+
return (
<>