fix(icc public login)
This commit is contained in:
parent
de2c8aec07
commit
b4288708a5
|
@ -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;
|
||||||
|
}
|
|
@ -44,6 +44,8 @@ export interface SimpleFormData {
|
||||||
createCallback?: Function
|
createCallback?: Function
|
||||||
children?: React.ReactElement
|
children?: React.ReactElement
|
||||||
childrenPosi?: boolean
|
childrenPosi?: boolean
|
||||||
|
rowStyle?: string,
|
||||||
|
showLable?: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,13 +65,13 @@ export interface UploadFileProps {
|
||||||
onChange?: (value: Array<UploadFileEx>) => void;
|
onChange?: (value: Array<UploadFileEx>) => void;
|
||||||
maxCount?: number;
|
maxCount?: number;
|
||||||
id?: string;
|
id?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UploadFileEx extends UploadFile {
|
export interface UploadFileEx extends UploadFile {
|
||||||
systemImageId?: number;
|
systemImageId?: number;
|
||||||
bannerName?: string;
|
bannerName?: string;
|
||||||
file_name?: string;
|
file_name?: string;
|
||||||
file_url?: string;
|
file_url?: string;
|
||||||
redictUrl?: string;
|
redictUrl?: string;
|
||||||
id?: number;
|
id?: number;
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@ import { FormSelect } from "./select";
|
||||||
import AliUpload from "../ali_upload";
|
import AliUpload from "../ali_upload";
|
||||||
import MyEditor from "../edittor";
|
import MyEditor from "../edittor";
|
||||||
import MapFrom from "../map/MapFrom";
|
import MapFrom from "../map/MapFrom";
|
||||||
|
import "./form.less"
|
||||||
// import VideoSelect from "../video_select";
|
// import VideoSelect from "../video_select";
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
const SimpleForm = (props: SimpleFormData) => {
|
const SimpleForm = (props: SimpleFormData) => {
|
||||||
|
@ -22,26 +23,27 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
<Form
|
<Form
|
||||||
name={props.formName}
|
name={props.formName}
|
||||||
ref={props.formRef}
|
ref={props.formRef}
|
||||||
|
className={props.rowStyle}
|
||||||
autoComplete="on"
|
autoComplete="on"
|
||||||
form={form}
|
form={form}
|
||||||
|
|
||||||
labelCol={{ span: props.span ?? 4 }}
|
labelCol={{ span: props.span ?? 4 }}
|
||||||
wrapperCol={{ span: props.colProps }}
|
wrapperCol={{ span: props.colProps }}
|
||||||
layout="horizontal"
|
layout="horizontal"
|
||||||
initialValues={{ menubar: true }}
|
initialValues={{ menubar: true }}
|
||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
>
|
>
|
||||||
{props.childrenPosi ? null : props.children ?? props.children}
|
|
||||||
{props.formDatas.map((v) => {
|
{props.formDatas.map((v) => {
|
||||||
switch (v.type) {
|
switch (v.type) {
|
||||||
case FormType.input:
|
case FormType.input:
|
||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
key={v.label}
|
key={v.label}
|
||||||
label={v.label}
|
label={props.showLable ?? v.label}
|
||||||
name={v.name}
|
name={v.name}
|
||||||
rules={v.rules}
|
rules={v.rules}
|
||||||
>
|
>
|
||||||
<Input />
|
<Input placeholder={"请输入"+v.label} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
case FormType.inputNumber:
|
case FormType.inputNumber:
|
||||||
|
@ -195,7 +197,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
{props.childrenPosi ? props.children ?? props.children : null}
|
{ props.children ?? props.children}
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
.contentBox{
|
.contentBox {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
height: 100%;
|
||||||
|
.searchBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: start;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableName {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.tableName{
|
overflow-y: auto;
|
||||||
height: 100%;
|
}
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ import BTable from "@/components/b_table";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { columns, defaultConfig } from "./user_config";
|
import { columns, defaultConfig, searchConfig } from "./user_config";
|
||||||
import "./user.less";
|
import "./user.less";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ const User = (props: Store) => {
|
||||||
const { usrStore } = props;
|
const { usrStore } = props;
|
||||||
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
||||||
const formRef = React.useRef<FormInstance>(null);
|
const formRef = React.useRef<FormInstance>(null);
|
||||||
|
const searchFormRef = React.useRef<FormInstance>(null);
|
||||||
const [userId, setId] = useState<Number | null>(null);
|
const [userId, setId] = useState<Number | null>(null);
|
||||||
const [record, setRecord] = useState<any>(null);
|
const [record, setRecord] = useState<any>(null);
|
||||||
|
|
||||||
|
@ -23,9 +24,28 @@ const User = (props: Store) => {
|
||||||
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)}>
|
<div className="searchBox">
|
||||||
添加用户
|
<Button type="default" onClick={() => setIsModalOpen(true)} style={{ marginRight: "10px" }}>
|
||||||
</Button>
|
添加用户
|
||||||
|
</Button>
|
||||||
|
<SimpleForm
|
||||||
|
formRef={searchFormRef}
|
||||||
|
rowStyle="form_style4"
|
||||||
|
formName={"user_search_form"}
|
||||||
|
colProps={20}
|
||||||
|
span={8}
|
||||||
|
onFinish={() => { }}
|
||||||
|
formDatas={searchConfig as any} >
|
||||||
|
<>
|
||||||
|
<Button type="primary" onClick={() => setIsModalOpen(true)}>
|
||||||
|
搜索
|
||||||
|
</Button>
|
||||||
|
<Button type="default" onClick={() => setIsModalOpen(true)}>
|
||||||
|
重置
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
</SimpleForm>
|
||||||
|
</div>
|
||||||
<BTable
|
<BTable
|
||||||
store={usrStore}
|
store={usrStore}
|
||||||
scroll={{ x: "max-content" }}
|
scroll={{ x: "max-content" }}
|
||||||
|
|
|
@ -85,3 +85,31 @@ export const columns: ColumnsType<UserDataType> = [
|
||||||
dataIndex: "tel",
|
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: "",
|
||||||
|
},
|
||||||
|
];
|
Loading…
Reference in New Issue