Forráskód Böngészése

fix: 软件锁多余代码删减和添加提示

outaozhen 5 éve
szülő
commit
d3a7d128a5

+ 5 - 3
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockModal.jsx

@@ -1,5 +1,5 @@
 import React, { useState, useEffect, useRef } from 'react'
-import { Modal, Form, Select, Input, Spin, Button, Radio, Popconfirm } from 'antd'
+import { Modal, Form, Select, Input, Spin, Button, Radio, Popconfirm, message } from 'antd'
 import styles from './index.less'
 import { SearchOutlined } from '@ant-design/icons'
 import { queryClient } from '@/services/customer'
@@ -170,11 +170,12 @@ const LockModal = props => {
       longleId
     })
     if (code === consts.RET_CODE.SUCCESS) {
-      onCancel()
+      message.success('新增成功')
       dispatch({
         type: 'refresh/commitAction',
         payload: 'longle'
       })
+      onCancel()
     }
   }
 
@@ -186,11 +187,12 @@ const LockModal = props => {
       longleId
     })
     if (code === consts.RET_CODE.SUCCESS) {
-      onCancel()
+      message.success('新增成功')
       dispatch({
         type: 'refresh/commitAction',
         payload: 'longle'
       })
+      onCancel()
     }
   }
 

+ 0 - 4
src/pages/Product/Lock/Lockstore/components/LocksDetail/TabList.jsx

@@ -28,9 +28,6 @@ const LockTabList = props => {
   const { longleLog, longleId, keyNum, clientId, logStatus } = props
   const { toggleDrawer, setDrawerProps } = useModal()
   const dispatch = useDispatch()
-  const [state, setState] = useState({
-    visible: false
-  })
   const { TabPane } = Tabs
 
   const [addLonglelog, setAddLonglelog] = useState({
@@ -48,7 +45,6 @@ const LockTabList = props => {
     })
     if (code === consts.RET_CODE.SUCCESS) {
       message.success('新增成功')
-      setState({ ...state, data: values })
       // 请求完了
       setAddLonglelog({ ...addLonglelog, loading: false, visible: false })
       // 刷新数据

+ 1 - 1
src/pages/Product/Lock/Lockstore/components/LocksDetail/index.jsx

@@ -27,7 +27,7 @@ const Index = props => {
       if (shouldUpdate) {
         dispatch({
           type: 'refresh/commitAction',
-          payload: 'updateKey'
+          payload: updateKey
         })
       }
       setState({ ...state, longle, log, longleLog })