Explorar o código

fix: 应用dragModal实例

lanjianrong %!s(int64=5) %!d(string=hai) anos
pai
achega
9a58be855f

+ 1 - 1
src/components/DragmModal/index.tsx

@@ -15,7 +15,7 @@ export default class ModalDrag extends PureComponent<{ title?: string }> {
     const { title } = this.props
     return (
       <DragM updateTransform={this.updateTransform}>
-        <div>{title}</div>
+        <div className="py-16px px-24px w-full">{title}</div>
       </DragM>
     )
   }

+ 4 - 0
src/global.less

@@ -115,6 +115,10 @@ input:-webkit-autofill:active {
 .ant-skeleton-element {
   width: 100% !important;
 }
+
+.ant-modal-header {
+  padding: 0;
+}
 // 弹窗左右结构
 .sheet-box {
   overflow: hidden;

+ 1 - 1
src/pages/Customer/Business/components/AddBusiness.jsx

@@ -1,5 +1,5 @@
 import { ModalForm, ProFormDatePicker, ProFormSelect, ProFormText } from '@ant-design/pro-form'
-import ModalDrag from '@/components/DragmModal'
+import ModalDrag from '@/components/DragModal'
 import { Button, Row, Col, message } from 'antd'
 import { Plus } from '@icon-park/react'
 import React, { useRef } from 'react'

+ 1 - 2
src/pages/Customer/Client/components/AddClient/index.jsx

@@ -3,7 +3,7 @@ import { Form, Row, Col, Button } from 'antd'
 import LazyCascader from '@/components/LazyCascader'
 import { ModalForm, ProFormSelect, ProFormText } from '@ant-design/pro-form'
 import { Plus } from '@icon-park/react'
-import ModalDrag from '@/components/DragmModal'
+import ModalDrag from '@/components/DragModal'
 import { ChangeCompMap } from '@/pages/Customer/Company/components/ChangeCompany'
 
 const AddClient = props => {
@@ -22,7 +22,6 @@ const AddClient = props => {
       title={<ModalDrag title={'添加联系人'} />}
       onVisibleChange={visible => {
         if (visible) {
-          console.log('defaultValues', defaultValues)
           formRef.current?.setFieldsValue({ ...defaultValues })
         }
       }}

+ 1 - 8
src/pages/Customer/Company/components/ConnectCompany/index.less

@@ -1,8 +1,6 @@
 .modalContainer {
   width: 60vw;
   .modalHeader {
-    position: relative;
-    padding: 1.5rem;
     .inputSearch {
       width: 99%;
     }
@@ -38,11 +36,6 @@
   }
 
   .modalFooter {
-    padding: 1.5rem;
+    padding: 1rem;
   }
 }
-
-.customTree {
-  height: calc(63vh - 100px - 3rem);
-  overflow-y: auto;
-}

+ 15 - 10
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockModal.jsx

@@ -1,4 +1,5 @@
 import React, { useState, useEffect, useRef } from 'react'
+import DragModal from '@/components/DragModal'
 import { Modal, Form, Select, Input, Spin, Button, Radio } from 'antd'
 import styles from './index.less'
 import { SearchOutlined } from '@ant-design/icons'
@@ -7,7 +8,7 @@ import { queryLock } from '@/services/lock'
 import consts from '@/basic/consts'
 import { useDebounceFn } from 'ahooks'
 import { apiSoftwareAddLonglelog, apiReceiveLock } from '@/services/lock'
-import { useDispatch } from 'dva'
+import { useDispatch } from 'umi'
 
 export const lockTypeEnum = {
   RECEIVE: 2,
@@ -183,15 +184,19 @@ const LockModal = props => {
   return (
     <Modal
       title={
-        modalTitleEnum[type] ?? (
-          <Input
-            className={styles.inputSearch}
-            placeholder={placeholderEnum[type]}
-            prefix={<SearchOutlined />}
-            onChange={handleInputChange}
-            allowClear={true}
-          />
-        )
+        <DragModal
+          title={
+            modalTitleEnum[type] ?? (
+              <Input
+                className={styles.inputSearch}
+                placeholder={placeholderEnum[type]}
+                prefix={<SearchOutlined />}
+                onChange={handleInputChange}
+                allowClear={true}
+              />
+            )
+          }
+        />
       }
       visible={visible}
       confirmLoading={loading}