From 8fa7d6fa68f262709c6c8bf1fbe92c5162907a32 Mon Sep 17 00:00:00 2001 From: wang_yp <357754663@qq.com> Date: Sat, 19 Apr 2025 13:21:25 +0800 Subject: [PATCH] fix(check) --- src/components/layout/layout.tsx | 1 - src/components/layout/layout_config.tsx | 5 ++++- src/pages/city/history/config.tsx | 2 +- src/pages/sku/cat/config.tsx | 11 +++++++++++ src/pages/sku/cat/index.tsx | 16 ++++++++++++---- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/components/layout/layout.tsx b/src/components/layout/layout.tsx index b4877cd..30ae213 100644 --- a/src/components/layout/layout.tsx +++ b/src/components/layout/layout.tsx @@ -8,7 +8,6 @@ import { Breadcrumb, Layout, Menu, - MenuProps, theme, Image, } from "antd"; diff --git a/src/components/layout/layout_config.tsx b/src/components/layout/layout_config.tsx index 56909a7..84b3601 100644 --- a/src/components/layout/layout_config.tsx +++ b/src/components/layout/layout_config.tsx @@ -24,7 +24,10 @@ export const items: ItemType[] = [ label: `城市管理`, icon: , children: [ - { key: "/city/list", label: `城市管理` }, + { + key: "/city/list", + label: `城市管理`, + }, { key: "/city/hum", label: `人文管理` }, { key: "/city/history", label: `历史底蕴` }, { key: "/city/food", label: `地方美食` }, diff --git a/src/pages/city/history/config.tsx b/src/pages/city/history/config.tsx index 8e5892b..3615b44 100644 --- a/src/pages/city/history/config.tsx +++ b/src/pages/city/history/config.tsx @@ -41,7 +41,7 @@ export const formConfig = [ label: "内容", name: "content", value: "", - rules: [{ required: true, message: "城市不能为空" }], + rules: [{ required: true, message: "内容不能为空" }], }, ]; diff --git a/src/pages/sku/cat/config.tsx b/src/pages/sku/cat/config.tsx index 75d2da9..6e43a0d 100644 --- a/src/pages/sku/cat/config.tsx +++ b/src/pages/sku/cat/config.tsx @@ -1,5 +1,6 @@ import { FormType } from "@/components/form/interface"; import { UserDataType } from "@/model/userModel"; +import { CityConfig } from "@/service/config"; import { ColumnsType } from "antd/lib/table"; export const formConfig = [ { @@ -9,9 +10,19 @@ export const formConfig = [ value: "", 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, label: "描述", + rules: [{ required: true, message: "描述不能为空" }], name: "remark", value: "", }, diff --git a/src/pages/sku/cat/index.tsx b/src/pages/sku/cat/index.tsx index f1719df..e026c7d 100644 --- a/src/pages/sku/cat/index.tsx +++ b/src/pages/sku/cat/index.tsx @@ -18,12 +18,16 @@ const SkuCat = (props: Store) => { skuCatStore.getlist(); }, [skuCatStore]); + const addHandler = () => { + setIsModalOpen(true); + setId(null); + setRecord(null); + }; + return (
- + { formRef={formRef} colProps={25} onFinish={() => { - skuCatStore.add(formRef.current?.getFieldsValue()) + if (userId) { + skuCatStore.putItem(record.identity,formRef.current?.getFieldsValue()); + } else { + skuCatStore.add(formRef.current?.getFieldsValue()); + } setIsModalOpen(false); }} createCallback={() => {