123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- import {
- PageContainer,
- ProForm,
- ProFormSelect,
- ProFormText,
- ProFormFieldSet,
- ProFormDateRangePicker,
- ProFormUploadButton,
- } from "@ant-design/pro-components";
- import { useNavigate, useSearchParams } from "react-router-dom";
- import { Card, Col, Row, Space } from "antd";
- import { useEffect, useRef } from "react";
-
- export default (props) => {
- const [searchParams] = useSearchParams();
- const id = searchParams.get("id");
- const navigate = useNavigate();
-
- const formRef = useRef();
- // useEffect(() => {
- // if (id) {
- // getPostsDetail(id).then((res) => {
- // formRef.current.setFieldsValue({
- // ...res,
- // filesList: res.filesList?.map((x) => x.fileAddr)[0] || null,
- // });
- // });
- // }
- // }, [id]);
-
- // const onFinish = async (values) => {
- // console.log(values);
-
- // savePosts({
- // ...values,
- // type: 'regulation',
- // filesList: values.filesList
- // ? [
- // {
- // fileAddr: values.filesList,
- // fileName: values.filesList?.substring(
- // values.filesList?.lastIndexOf("/") + 1
- // ),
- // },
- // ]
- // : null,
- // status: Number(values.status),
- // ...(id ? { id } : {}),
- // }).then((res) => {
- // navigate(-1);
- // });
-
- // return false;
- // };
-
- return (
- <PageContainer>
- <Card>
- <ProForm
- formRef={formRef}
- layout={"horizontal"}
- labelCol={{ span: 8 }}
- wrapperCol={{ span: 12 }}
- // onFinish={onFinish}
- initialValues={{ status: 0 }}
- submitter={{
- searchConfig: {
- resetText: "返回",
- },
- onReset: () => navigate(-1),
- render: (props, doms) => {
- return (
- <Row>
- <Col span={8} offset={8}>
- <Space>{doms}</Space>
- </Col>
- </Row>
- );
- },
- }}
- >
- <ProFormFieldSet
- name="addr"
- label="登记年份"
- >
- <ProFormSelect
- width={460}
- valueEnum={{
- taiyuan: '2019',
- hangzho: '2020',
- hangzh: '2021',
- hangz: '2022',
- }}
- />
- </ProFormFieldSet>
- <ProFormText
- name="createPerson"
- label="机构名称"
- width={460}
- />
- <ProFormText
- name="createPerson"
- label="工商注册证号"
- width={460}
- />
- <ProFormText
- name="createPerson"
- label="卫生许可证号"
- width={460}
- />
- <ProFormText
- name="createPerson"
- label="机构名称"
- width={460}
- />
- <ProFormText
- name="createPerson"
- label="供应商联系人"
- width={460}
- />
- <ProFormText
- name="createPerson"
- label="联系电话"
- width={460}
- />
- <ProFormDateRangePicker
- name="timeRange"
- label="签约时间"
- width={460}
- />
- <ProFormSelect
- width={460}
- name="select-multiple"
- label="机构类别"
- valueEnum={{
- red: '生鲜蔬菜类',
- green: '米面粮油类',
- blue: '饮食类',
- reds: '饮水类',
- greens: '住宿类',
- blues: '物资代储类',
- redss: '医疗救助类',
- greenss: '油料类',
- bluess: '道路施救类',
- bluesss: '其他',
- }}
- fieldProps={{
- mode: 'multiple',
- }}
- rules={[
- { type: 'array' },
- ]}
- />
-
- <ProFormText
- name="createPerson"
- label="单日机构内膳食供应能力(人次):"
- width={460}
- />
- <ProFormText
- name="createPerson"
- label="单次机构内膳食供应能力(人):"
- width={460}
- />
- <ProFormText
- name="createPerson"
- label="单日远程膳食供应能力(人次):"
- width={460}
- />
- <ProFormText
- name="createPerson"
- label="单次远程膳食供应能力(人):"
- width={460}
- />
- <ProFormText
- name="timeRange"
- label="机构内住宿供应能力(人):"
- width={460}
- />
- <ProFormUploadButton label="机构图片" name="upload" action="upload.do" />
- </ProForm>
- </Card>
- </PageContainer>
- );
- };
|