diff --git a/src/components/form/select.tsx b/src/components/form/select.tsx
index 096a0cc..a2001b8 100644
--- a/src/components/form/select.tsx
+++ b/src/components/form/select.tsx
@@ -1,28 +1,29 @@
import { Form, Select } from "antd";
import { FormDatas } from "./interface";
-import { useEffect, useState } from "react";
-import baseHttp from "@/service/base";
-const { Option } = Select;
+import { useState } from "react";
export const FormSelect = (v: FormDatas) => {
- const [list, setList] = useState([]);
- useEffect(() => {
- baseHttp
- .get(`${v.selectUrl}/?pageSize=100&pageNum=1` ?? "", "")
- .then((res) => {
- setList(res.data.list ?? []);
- });
- }, [v.selectUrl]);
+ const [list] = useState([
+ {
+ value: 1,
+ label: "卡片一",
+ },
+ {
+ value: 2,
+ label: "卡片二",
+ },
+ {
+ value: 3,
+ label: "卡片三",
+ },
+ {
+ value: 4,
+ label: "卡片四",
+ },
+ ]);
+
return (
-
+
);
};
diff --git a/src/components/form/simple_form.tsx b/src/components/form/simple_form.tsx
index 40c8143..03c2b33 100644
--- a/src/components/form/simple_form.tsx
+++ b/src/components/form/simple_form.tsx
@@ -1,4 +1,4 @@
-import { Checkbox, DatePicker, Form, Input, Radio } from "antd";
+import { Checkbox, DatePicker, Form, Input, Radio, Switch } from "antd";
import { useEffect } from "react";
import { SimpleFormData } from "./interface";
import { FormSelect } from "./select";
@@ -6,7 +6,6 @@ import AliUpload from "../aliUpload";
const { TextArea } = Input;
const SimpleForm = (props: SimpleFormData) => {
const [form] = Form.useForm();
- const { RangePicker } = DatePicker;
const onFinish = (values: any) => {
props.onFinish(values);
};
@@ -117,6 +116,17 @@ const SimpleForm = (props: SimpleFormData) => {
);
+ case "switch":
+ return (
+
+
+
+ );
case "Date":
return (
{
);
+
default:
return (
{
title: "活动标题",
dataIndex: "activeName",
},
- // {
- // title: "活动描述",
- // dataIndex: "desc",
- // },
- // {
- // title: "活动图片",
- // dataIndex: "activeIcon",
- // ellipsis: {
- // showTitle: false,
- // },
- // render: (address) => (
- //
- // {address}
- //
- // ),
- // },
- // {
- // title: "活动人数",
- // dataIndex: "peopleNum",
- // },
- // {
- // title: "活动地址",
- // dataIndex: "address",
- // },
{
title: "折扣",
dataIndex: "discount",
@@ -67,11 +43,6 @@ const Active = (props: Store) => {
),
},
- // {
- // title: "发起人",
- // dataIndex: "userId",
- // },
-
{
title: "操作",
dataIndex: "id",
@@ -158,6 +129,12 @@ const Active = (props: Store) => {
name: "endTime",
value: "",
},
+ {
+ type: "switch",
+ label: "是否开启",
+ name: "status",
+ value: false,
+ },
];
useEffect(() => {
diff --git a/src/pages/card/card-list.tsx b/src/pages/card/card-list.tsx
index 068e2af..c68be86 100644
--- a/src/pages/card/card-list.tsx
+++ b/src/pages/card/card-list.tsx
@@ -112,7 +112,7 @@ const CardPageList = (props) => {
type: "select",
label: "请选择卡片类型",
name: "cardType",
- value: "",
+ value: ""
},
]