fix(check)

This commit is contained in:
wang_yp 2025-04-19 13:21:25 +08:00
parent 365b87db92
commit 8fa7d6fa68
5 changed files with 28 additions and 7 deletions

View File

@ -8,7 +8,6 @@ import {
Breadcrumb, Breadcrumb,
Layout, Layout,
Menu, Menu,
MenuProps,
theme, theme,
Image, Image,
} from "antd"; } from "antd";

View File

@ -24,7 +24,10 @@ export const items: ItemType<MenuItemType>[] = [
label: `城市管理`, label: `城市管理`,
icon: <UserOutlined />, icon: <UserOutlined />,
children: [ children: [
{ key: "/city/list", label: `城市管理` }, {
key: "/city/list",
label: `城市管理`,
},
{ key: "/city/hum", label: `人文管理` }, { key: "/city/hum", label: `人文管理` },
{ key: "/city/history", label: `历史底蕴` }, { key: "/city/history", label: `历史底蕴` },
{ key: "/city/food", label: `地方美食` }, { key: "/city/food", label: `地方美食` },

View File

@ -41,7 +41,7 @@ export const formConfig = [
label: "内容", label: "内容",
name: "content", name: "content",
value: "", value: "",
rules: [{ required: true, message: "城市不能为空" }], rules: [{ required: true, message: "内容不能为空" }],
}, },
]; ];

View File

@ -1,5 +1,6 @@
import { FormType } from "@/components/form/interface"; import { FormType } from "@/components/form/interface";
import { UserDataType } from "@/model/userModel"; import { UserDataType } from "@/model/userModel";
import { CityConfig } from "@/service/config";
import { ColumnsType } from "antd/lib/table"; import { ColumnsType } from "antd/lib/table";
export const formConfig = [ export const formConfig = [
{ {
@ -9,9 +10,19 @@ export const formConfig = [
value: "", value: "",
rules: [{ required: true, message: "商品分类名称不能为空!" }], rules: [{ required: true, message: "商品分类名称不能为空!" }],
}, },
{
type: FormType.select,
label: "城市",
name: "city_identity",
selectUrl: CityConfig.LIST,
rules: [{ required: true, message: "内容不能为空" }],
key: "city_name",
value: "",
},
{ {
type: FormType.input, type: FormType.input,
label: "描述", label: "描述",
rules: [{ required: true, message: "描述不能为空" }],
name: "remark", name: "remark",
value: "", value: "",
}, },

View File

@ -18,12 +18,16 @@ const SkuCat = (props: Store) => {
skuCatStore.getlist(); skuCatStore.getlist();
}, [skuCatStore]); }, [skuCatStore]);
const addHandler = () => {
setIsModalOpen(true);
setId(null);
setRecord(null);
};
return ( return (
<div className="contentBox"> <div className="contentBox">
<Space direction="vertical" size="middle" style={{ display: "flex" }}> <Space direction="vertical" size="middle" style={{ display: "flex" }}>
<Button type="default" onClick={() => setIsModalOpen(true)}> <Button type="default" onClick={() => addHandler()}></Button>
</Button>
<BTable <BTable
store={skuCatStore} store={skuCatStore}
scroll={{ x: "max-content" }} scroll={{ x: "max-content" }}
@ -59,7 +63,11 @@ const SkuCat = (props: Store) => {
formRef={formRef} formRef={formRef}
colProps={25} colProps={25}
onFinish={() => { onFinish={() => {
skuCatStore.add(formRef.current?.getFieldsValue()) if (userId) {
skuCatStore.putItem(record.identity,formRef.current?.getFieldsValue());
} else {
skuCatStore.add(formRef.current?.getFieldsValue());
}
setIsModalOpen(false); setIsModalOpen(false);
}} }}
createCallback={() => { createCallback={() => {