shaogen1995 1 yıl önce
ebeveyn
işleme
59b33f9075

+ 1 - 1
src/pages/A1Project/A1Add/index.tsx

@@ -333,7 +333,7 @@ function A1Add({ pageType, closeFu, addFu, editFu }: Props) {
             <Form.Item label="项目金额" name="amount">
               <InputNumber
                 style={{ width: 300 }}
-                addonAfter="¥"
+                addonBefore="¥"
                 maxLength={10}
                 placeholder="请输入数字,最多10位"
               />

+ 14 - 1
src/pages/A1Project/A1Inner/A1IupFile/index.module.scss

@@ -9,10 +9,23 @@
       width: 1000px !important;
     }
 
+
+    .A1OtopBtn {
+      position: absolute;
+      top: 15px;
+      right: 24px;
+      z-index: 10;
+      display: flex;
+
+      &>div {
+        margin-left: 15px;
+      }
+    }
+
     .A1OMain {
       padding: 15px 40px 0;
       margin-top: 10px;
-      border-top: 1px solid #999999;
+      // border-top: 1px solid #999999;
       position: relative;
       height: 500px;
       overflow-y: auto;

+ 22 - 1
src/pages/A1Project/A1Inner/A1IupFile/index.tsx

@@ -34,6 +34,11 @@ const { Dragger } = Upload;
 //   resName:string
 // };
 
+const A1OtopBtnArr = [
+  { id: 1, name: "上传文件夹" },
+  { id: 2, name: "上传文件" },
+];
+
 type props = {
   myUrl: string;
   upFileFu: () => void;
@@ -51,6 +56,9 @@ function A1IupFile({
   projectId,
   typeData,
 }: props) {
+  // 文件夹和文件的选择
+  const [isFiles, setIsFiles] = useState(1);
+
   const [modal, contextHolder] = Modal.useModal();
 
   const [fileList, setFileList] = useState<UploadFile[]>([]);
@@ -151,7 +159,7 @@ function A1IupFile({
       token: getTokenFu(),
     },
     // 支持上传文件夹
-    directory: true,
+    directory: isFiles === 1,
     fileList,
     //不要前面的图标
     // iconRender: () => false,
@@ -303,6 +311,19 @@ function A1IupFile({
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
     >
+      <div className="A1OtopBtn">
+        {A1OtopBtnArr.map((v) => (
+          <div key={v.id}>
+            <Button
+              onClick={() => setIsFiles(v.id)}
+              type={v.id === isFiles ? "primary" : "default"}
+            >
+              {v.name}
+            </Button>
+          </div>
+        ))}
+      </div>
+
       <div className="A1OMain">
         <Dragger {...FileProps}>
           <p className="ant-upload-drag-icon">

+ 12 - 1
src/pages/A1Project/A1Outer/A1OupFile/index.module.scss

@@ -9,10 +9,21 @@
       width: 800px !important;
     }
 
+    .A1OtopBtn{
+      position: absolute;
+      top: 15px;
+      right: 24px;
+      z-index: 10;
+      display: flex;
+      &>div{
+        margin-left: 15px;
+      }
+    }
+
     .A1OMain {
       padding: 15px 40px 0;
       margin-top: 10px;
-      border-top: 1px solid #999999;
+      // border-top: 1px solid #999999;
       position: relative;
       height: 500px;
       overflow-y: auto;

+ 22 - 1
src/pages/A1Project/A1Outer/A1OupFile/index.tsx

@@ -23,6 +23,11 @@ import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
 
 const { Dragger } = Upload;
 
+const A1OtopBtnArr = [
+  { id: 1, name: "上传文件夹" },
+  { id: 2, name: "上传文件" },
+];
+
 type props = {
   myUrl: string;
   fromData: any;
@@ -32,6 +37,9 @@ type props = {
 };
 
 function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
+  // 文件夹和文件的选择
+  const [isFiles, setIsFiles] = useState(1);
+
   const [modal, contextHolder] = Modal.useModal();
 
   const [fileList, setFileList] = useState<UploadFile[]>([]);
@@ -46,7 +54,7 @@ function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
       token: getTokenFu(),
     },
     // 支持上传文件夹
-    directory: true,
+    directory: isFiles === 1,
     data: fromData,
     fileList,
     //不要前面的图标
@@ -177,6 +185,19 @@ function A1OupFile({ myUrl, fromData, nowLoc, closeFu, upFileFu }: props) {
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
     >
+      <div className="A1OtopBtn">
+        {A1OtopBtnArr.map((v) => (
+          <div key={v.id}>
+            <Button
+              onClick={() => setIsFiles(v.id)}
+              type={v.id === isFiles ? "primary" : "default"}
+            >
+              {v.name}
+            </Button>
+          </div>
+        ))}
+      </div>
+
       <div className="A1OMain">
         <Dragger {...FileProps}>
           <p className="ant-upload-drag-icon">