Explorar el Código

修改项目接口

Renxy hace 1 año
padre
commit
268df583cd
Se han modificado 2 ficheros con 15 adiciones y 26 borrados
  1. 11 23
      src/pages/Cad/components/CreateModal.js
  2. 4 3
      src/pages/Cad/index.js

+ 11 - 23
src/pages/Cad/components/CreateModal.js

@@ -24,7 +24,7 @@ const advance = {
 };
 const formItemValues = [
   {
-    name: '是否PID图平面图',
+    name: '是否PID图平面图',
     id: 'DDSelectField_b8169258-d569-442e-a7b0-e2bd171aaac2',
     type: 'DDSelectField',
     value: [],
@@ -85,27 +85,6 @@ const CreateModal = ({
     },
   );
 
-  // function dwgUpload() {
-  //   let uploadDwg = document.getElementById('uploadDwg');
-  //   uploadDwg.click();
-  // }
-
-  // function uploadDwg(event) {
-  //   const selectedFile = event.target.files[0];
-  //   if (selectedFile) {
-  //     setUpLoading(true);
-  //     ZwCloud2D.ZwDataProcessor.uploadDwg(selectedFile).then((res) => {
-  //       if (res.code == 200) {
-  //         const oldPath = form.getFieldValue('cad_path');
-  //         const cad_path = oldPath
-  //           ? oldPath + ',' + res.data.path
-  //           : res.data.path;
-  //         form.setFieldsValue({ cad_path });
-  //       }
-  //       setUpLoading(false);
-  //     });
-  //   }
-  // }
   const UploadProps = {
     action: `https://cad.greentech.com.cn/sdk/doc/upload`,
     multiple: true,
@@ -171,7 +150,16 @@ const CreateModal = ({
               label="所属项目:"
               rules={[{ required: true }]}
             >
-              <Select options={projectList} />
+              <Select
+                showSearch
+                allowClear
+                options={projectList}
+                filterOption={(input, option) =>
+                  (option?.label ?? '')
+                    .toLowerCase()
+                    .includes(input.toLowerCase())
+                }
+              />
             </Form.Item>
             <Form.Item
               name="dir_id"

+ 4 - 3
src/pages/Cad/index.js

@@ -12,6 +12,7 @@ import CreateModal from './components/CreateModal';
 import { createAduit } from '@/services/boom';
 import CreateChildrenModal from './components/CreateChildrenModal';
 import { queryCreateCadVer } from '../../services/cad';
+import { queryApprovalProject } from '@/services/contract';
 
 const CadDemo = () => {
   let navigate = useNavigate();
@@ -100,10 +101,10 @@ const CadDemo = () => {
     },
   ];
 
-  const { data: projectList } = useRequest(queryProject, {
+  const { data: projectList } = useRequest(queryApprovalProject, {
     formatResult: (res) => {
-      return res?.data?.list?.map((item) => {
-        return { label: item.Name, value: item.ID };
+      return res?.data?.map((item) => {
+        return { label: item.project_name, value: item.project_full_code };
       });
     },
   });