diff --git a/src/App.tsx b/src/App.tsx index 8c77da7..28ddd3c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,8 +1,31 @@ import { inject, observer } from "mobx-react"; import "antd/dist/antd.css"; -import Home from "./pages/home/home"; -const App = (props: any) => { - return +// import Home from "./pages/home/home"; +import { Modal } from "antd"; +import { Store } from "antd/lib/form/interface"; +import { Outlet } from "react-router"; +const App = (props: Store) => { + const { usrStore } = props; + return ( + <> + + {}} + onOk={() => { + usrStore.closeLoginDilog(); + }} + onCancel={() => { + usrStore.closeLoginDilog(); + }} + > +

cascsa

+
+ + ); }; export default inject("usrStore")(observer(App)); diff --git a/src/components/ali_upload.tsx b/src/components/ali_upload.tsx index e5a4fb7..41e12d1 100644 --- a/src/components/ali_upload.tsx +++ b/src/components/ali_upload.tsx @@ -1,10 +1,7 @@ -import ossClie from "@/util/oss"; import Modal from "antd/lib/modal"; import { PlusOutlined } from "@ant-design/icons"; import Upload, { RcFile, UploadFile, UploadProps } from "antd/lib/upload"; import { useEffect, useState } from "react"; -import baseHttp from "@/service/base"; -import SystemConfig from "@/service/apiConfig/system_config"; interface UploadFileProps { imgList: Array; @@ -25,11 +22,11 @@ const getBase64 = (file: RcFile): Promise => reader.onerror = (error) => reject(error); }); -const AliUpload = (props:UploadFileProps) => { +const AliUpload = (props: UploadFileProps) => { const [previewOpen, setPreviewOpen] = useState(false); const [previewImage, setPreviewImage] = useState(""); const [previewTitle, setPreviewTitle] = useState(""); - const [fileList, setFileList] = useState([]); + const [files, setFileList] = useState([]); const handleCancel = () => setPreviewOpen(false); const handlePreview = async (file: UploadFile) => { if (!file.url && !file.preview) { @@ -47,30 +44,7 @@ const AliUpload = (props:UploadFileProps) => { }, [props.imgList]); const handleChange: UploadProps["onChange"] = ({ fileList: newFileList }) => { - let isChange: Boolean = false; - newFileList.forEach(async (item) => { - if (item.originFileObj) { - isChange = true; - await ossClie(newFileList[newFileList.length - 1].originFileObj).then( - (resUploadFileEx: UploadFileEx) => { - resUploadFileEx.uid = resUploadFileEx.name; - resUploadFileEx.bannerName = resUploadFileEx.name; - baseHttp.post( SystemConfig.AddImages, { url: resUploadFileEx.url }).then((resp)=>{ - resUploadFileEx.systemImageId = resp.data.id; - resUploadFileEx.id = resp.data.id; - resUploadFileEx.redictUrl = ""; - fileList.push(resUploadFileEx); - props.onChnage(fileList); - setFileList(fileList); - }) - } - ); - } - }); - if (!isChange) { - props.onChnage(newFileList); - setFileList(newFileList); - } + console.log(newFileList); }; const uploadButton = (
@@ -78,15 +52,17 @@ const AliUpload = (props:UploadFileProps) => {
Upload
); + return (
- {fileList.length >= 4 ? null : uploadButton} + {files.length >= 4 ? null : uploadButton} { baseHttp .get(`${v.selectUrl}/?pageSize=100&pageNum=1` ?? "", "") .then((res) => { - setList(res.data.list ?? []); + setList(res.data.record ?? []); }); }, [v.selectUrl]); return ( @@ -18,7 +18,7 @@ export const FormSelect = (v: FormDatas) => { {list?.map((v: any) => { return ( ); })} diff --git a/src/components/form/simple_form.tsx b/src/components/form/simple_form.tsx index 75779cf..7b6abe5 100644 --- a/src/components/form/simple_form.tsx +++ b/src/components/form/simple_form.tsx @@ -31,13 +31,7 @@ const SimpleForm = (props: SimpleFormData) => { switch (v.type) { case "input": return ( - + ); @@ -84,6 +78,7 @@ const SimpleForm = (props: SimpleFormData) => { { + console.log(res); form.setFieldValue(v.name, res); }} /> @@ -91,17 +86,8 @@ const SimpleForm = (props: SimpleFormData) => { ); case "textArea": return ( - -