Procházet zdrojové kódy

feat: 锁库modal title拖拽修复

lanjianrong před 5 roky
rodič
revize
dccdf0b436

+ 3 - 0
src/pages/Customer/Client/components/ClientDetail/AddRecord.jsx

@@ -10,12 +10,15 @@ const AddRecord = props => {
   const { TextArea } = Input
   const { onConfirm } = props
   const [showExtraItem, setShowExtraItem] = useState(false)
+
   const onChange = value => {
     setShowExtraItem(value)
   }
+
   const disabledDate = current => {
     return current && current < dayjs().endOf('day')
   }
+
   return (
     <ModalDragForm
       layout="vertical"

+ 3 - 3
src/pages/Customer/Company/components/CompanyDetail/Form.jsx

@@ -24,7 +24,7 @@ const CompanyForm = props => {
     }
   }, [])
 
-  const refreshClient = () => {
+  const refreshCompany = () => {
     dispatch({
       type: 'refresh/commitAction',
       payload: 'company'
@@ -113,7 +113,7 @@ const CompanyForm = props => {
             tagIds={customer.tagIds}
             tagType={TagTypeEnum.PERSONTAG}
             tagColumn={TagDataTypeEnum.COMPANY}
-            checkCallBack={refreshClient}
+            checkCallBack={refreshCompany}
             modeType={LabelModeType.column}>
             <Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
           </PersonLabel>
@@ -140,7 +140,7 @@ const CompanyForm = props => {
             tagIds={customer.tagCooperationIds}
             tagType={TagTypeEnum.TEAMTAG}
             tagColumn={TagDataTypeEnum.COMPANY}
-            checkCallBack={refreshClient}
+            checkCallBack={refreshCompany}
             modeType={LabelModeType.column}>
             <Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
           </PersonLabel>

+ 19 - 22
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockModal.jsx

@@ -1,5 +1,4 @@
 import React, { useState, useEffect, useRef } from 'react'
-import DragModal from '@/components/Modal/src/components/DragIniter'
 import { Modal, Form, Select, Input, Spin, Button, Radio } from 'antd'
 import styles from './index.less'
 import { SearchOutlined } from '@ant-design/icons'
@@ -9,6 +8,8 @@ import consts from '@/basic/consts'
 import { useDebounceFn } from 'ahooks'
 import { apiSoftwareAddLonglelog } from '@/services/lock'
 import { useDispatch, connect } from 'umi'
+import { createUid } from '@/utils/utils'
+import DragIniter from '@/components/Modal/src/components/DragIniter'
 
 export const lockTypeEnum = {
   RECEIVE: 2,
@@ -20,12 +21,12 @@ export const lockTypeEnum = {
 }
 
 const LockModal = props => {
-  const modalTitleEnum = {
-    5: '升级软件锁',
-    8: '备注信息',
-    7: '确认收回',
-    2: '确认接收'
-  }
+  // const modalTitleEnum = {
+  //   5: '升级软件锁',
+  //   8: '备注信息',
+  //   7: '确认收回',
+  //   2: '确认接收'
+  // }
   const placeholderEnum = {
     3: '搜索联系人(姓名、手机、QQ、公司名称)',
     6: '输入新锁号'
@@ -128,10 +129,6 @@ const LockModal = props => {
     initData({ status: value, page: 1, size: 10 })
   }
 
-  const handleChange = value => {
-    console.log(`Selected: ${value}`)
-  }
-
   // 关联联系人
   const connectClient = async id => {
     const { code = -1 } = await apiSoftwareAddLonglelog({
@@ -175,23 +172,24 @@ const LockModal = props => {
     }
   }
 
+  const uid = createUid(10)
   return (
     <Modal
       title={
-        <DragModal
+        <DragIniter
+          uid={uid}
           title={
-            modalTitleEnum[type] ?? (
-              <Input
-                className={styles.inputSearch}
-                placeholder={placeholderEnum[type]}
-                prefix={<SearchOutlined />}
-                onChange={handleInputChange}
-                allowClear={true}
-              />
-            )
+            <Input
+              className={styles.inputSearch}
+              placeholder={placeholderEnum[type]}
+              prefix={<SearchOutlined />}
+              onChange={handleInputChange}
+              allowClear={true}
+            />
           }
         />
       }
+      wrapClassName={`d_${uid}`}
       visible={visible}
       confirmLoading={loading}
       onCancel={onCancel}
@@ -271,7 +269,6 @@ const LockModal = props => {
                   e && !prodList?.length && (await fetchSoftProducts())
                 }}
                 options={prodList.map(item => ({ value: item.title }))}
-                onChange={handleChange}
               />
             </Form.Item>
           </>