From b4288708a5bf6eef494f4788ee71beb90f7615ae Mon Sep 17 00:00:00 2001 From: wang_yp <357754663@qq.com> Date: Mon, 4 Aug 2025 16:14:39 +0800 Subject: [PATCH] fix(icc public login) --- src/components/form/form.less | 24 ++++++++++++++++++++++++ src/components/form/interface.ts | 10 ++++++---- src/components/form/simple_form.tsx | 10 ++++++---- src/pages/user/user.less | 20 +++++++++++++------- src/pages/user/user.tsx | 28 ++++++++++++++++++++++++---- src/pages/user/user_config.tsx | 28 ++++++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 19 deletions(-) create mode 100644 src/components/form/form.less diff --git a/src/components/form/form.less b/src/components/form/form.less new file mode 100644 index 0000000..612b08f --- /dev/null +++ b/src/components/form/form.less @@ -0,0 +1,24 @@ +.form_style1 { + display: grid; + grid-template-columns: repeat(1, 1fr); + gap: 10px; +} + +.form_style2 { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 10px; +} + + +.form_style3 { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 10px; +} + +.form_style4 { + display: flex; + flex-wrap: wrap; + gap: 10px; +} diff --git a/src/components/form/interface.ts b/src/components/form/interface.ts index 157cbc2..ce49ef1 100644 --- a/src/components/form/interface.ts +++ b/src/components/form/interface.ts @@ -44,6 +44,8 @@ export interface SimpleFormData { createCallback?: Function children?: React.ReactElement childrenPosi?: boolean + rowStyle?: string, + showLable?: boolean, } @@ -63,13 +65,13 @@ export interface UploadFileProps { onChange?: (value: Array) => void; maxCount?: number; id?: string; - } - - export interface UploadFileEx extends UploadFile { +} + +export interface UploadFileEx extends UploadFile { systemImageId?: number; bannerName?: string; file_name?: string; file_url?: string; redictUrl?: string; id?: number; - } \ No newline at end of file +} \ No newline at end of file diff --git a/src/components/form/simple_form.tsx b/src/components/form/simple_form.tsx index 913ddc8..2bc85f7 100644 --- a/src/components/form/simple_form.tsx +++ b/src/components/form/simple_form.tsx @@ -5,6 +5,7 @@ import { FormSelect } from "./select"; import AliUpload from "../ali_upload"; import MyEditor from "../edittor"; import MapFrom from "../map/MapFrom"; +import "./form.less" // import VideoSelect from "../video_select"; const { TextArea } = Input; const SimpleForm = (props: SimpleFormData) => { @@ -22,26 +23,27 @@ const SimpleForm = (props: SimpleFormData) => {
- {props.childrenPosi ? null : props.children ?? props.children} {props.formDatas.map((v) => { switch (v.type) { case FormType.input: return ( - + ); case FormType.inputNumber: @@ -195,7 +197,7 @@ const SimpleForm = (props: SimpleFormData) => { ); } })} - {props.childrenPosi ? props.children ?? props.children : null} + { props.children ?? props.children}
); }; diff --git a/src/pages/user/user.less b/src/pages/user/user.less index 4a4054f..1c89216 100644 --- a/src/pages/user/user.less +++ b/src/pages/user/user.less @@ -1,8 +1,14 @@ -.contentBox{ - overflow-y: auto; +.contentBox { + overflow-y: auto; + height: 100%; + .searchBox { + display: flex; + align-items: start; + justify-content: space-between; + } + + .tableName { height: 100%; - .tableName{ - height: 100%; - overflow-y: auto; - } -} \ No newline at end of file + overflow-y: auto; + } +} diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index 7da4f6b..5139b25 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -4,7 +4,7 @@ import BTable from "@/components/b_table"; import { useEffect, useState } from "react"; import { Store } from "antd/lib/form/interface"; import React from "react"; -import { columns, defaultConfig } from "./user_config"; +import { columns, defaultConfig, searchConfig } from "./user_config"; import "./user.less"; import SimpleForm from "@/components/form/simple_form"; @@ -12,6 +12,7 @@ const User = (props: Store) => { const { usrStore } = props; const [isModalOpen, setIsModalOpen] = useState(false); const formRef = React.useRef(null); + const searchFormRef = React.useRef(null); const [userId, setId] = useState(null); const [record, setRecord] = useState(null); @@ -23,9 +24,28 @@ const User = (props: Store) => { return (
- +
+ + { }} + formDatas={searchConfig as any} > + <> + + + + +
= [ dataIndex: "tel", }, ]; + + +export const searchConfig = [ + { + type: FormType.input, + label: "用户名", + name: "user_name", + value: "", + }, + { + type: FormType.input, + label: "身份证", + name: "id_card", + value: "", + }, + { + type: FormType.input, + label: "联系电话", + name: "tel", + value: "", + }, + { + type: FormType.input, + label: "邮箱", + name: "email", + value: "", + }, +]; \ No newline at end of file