Browse Source

Merge branch 'dev' of http://192.168.1.41:3000/outaozhen/cldV2react into dev

outaozhen 4 years atrás
parent
commit
264a93424f
32 changed files with 289 additions and 403 deletions
  1. 5 2
      .eslintrc.js
  2. 5 28
      src/app.tsx
  3. 2 2
      src/components/ModalStore/index.tsx
  4. 0 5
      src/components/ModalStore/src/CreateProvider.tsx
  5. 0 12
      src/components/RightContent/Book/components/UserList/index.tsx
  6. 1 1
      src/components/RightContent/NoticeIcon/index.tsx
  7. 0 33
      src/components/RightContent/index.tsx
  8. 2 3
      src/models/refresh.js
  9. 7 10
      src/pages/Customer/Business/components/BusinessDetail/Form.jsx
  10. 2 2
      src/pages/Customer/Business/components/BusinessDetail/TabList.jsx
  11. 7 4
      src/pages/Customer/Business/components/BusinessDetail/index.jsx
  12. 1 6
      src/pages/Customer/Company/components/CompanyDetail/LowerList.jsx
  13. 2 18
      src/pages/Customer/Company/components/CompanyDetail/SyncClient.jsx
  14. 3 3
      src/pages/Customer/Company/components/CompanyDetail/TabList.jsx
  15. 11 17
      src/pages/Hr/Employee/components/ChangeSupervisor/index.jsx
  16. 5 3
      src/pages/Hr/Employee/components/EmployeeDetail/Form.jsx
  17. 1 6
      src/pages/Hr/Employee/components/EmployeeDetail/TabList.jsx
  18. 11 4
      src/pages/Hr/Employee/components/EmployeeDetail/index.jsx
  19. 73 74
      src/pages/Hr/Notification/components/AddMessage.jsx
  20. 39 0
      src/pages/Hr/Notification/components/MessageDetail.jsx
  21. 0 37
      src/pages/Hr/Notification/components/MessageDrawer.jsx
  22. 1 1
      src/pages/Hr/Notification/index.jsx
  23. 2 2
      src/pages/Product/Cloud/components/Detail/Form.jsx
  24. 33 35
      src/pages/Product/Cloud/components/Detail/TabList.jsx
  25. 5 3
      src/pages/Product/Cloud/components/Detail/UpgradeModal.jsx
  26. 22 23
      src/pages/Product/Cloud/components/Detail/index.jsx
  27. 12 20
      src/pages/Product/Lock/LockStore/components/ChangeClient/index.jsx
  28. 5 6
      src/pages/Product/Lock/LockStore/components/LockDetail/Form.jsx
  29. 1 6
      src/pages/Product/Lock/LockStore/components/LockDetail/LowerList.jsx
  30. 16 20
      src/pages/Product/Lock/LockStore/components/LockDetail/OpreateLock.jsx
  31. 4 12
      src/pages/Product/Lock/LockStore/components/LockDetail/TabList.jsx
  32. 11 5
      src/pages/Product/Lock/LockStore/components/LockDetail/index.jsx

+ 5 - 2
.eslintrc.js

@@ -1,6 +1,4 @@
-// eslint-disable-next-line no-undef
 module.exports = {
-  // eslint-disable-next-line no-undef
   extends: [require.resolve('@umijs/fabric/dist/eslint')],
   globals: {
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
@@ -33,5 +31,10 @@ module.exports = {
       }
     ],
     '@typescript-eslint/no-unused-expressions': 0
+  },
+  settings: {
+    react: {
+      version: 'detect'
+    }
   }
 }

+ 5 - 28
src/app.tsx

@@ -69,17 +69,11 @@ export const layout = ({ initialState, setInitialState }) => {
 
   return {
     logo,
-    // menu: {
-    //   params: {
-    //     userId: initialState?.currentUser?.staffId
-    //   },
-    //   request: (_, defaultMenuData) => {
-    //     console.log('defaultMenuData', defaultMenuData)
-
-    //     return defaultMenuData
-    //   }
-    // },
-    rightContentRender: () => <RightContent />,
+    rightContentRender: () => (
+      <ModalStore>
+        <RightContent />
+      </ModalStore>
+    ),
     disableContentMargin: false,
     waterMarkProps: {
       content: initialState?.currentUser?.username
@@ -92,25 +86,8 @@ export const layout = ({ initialState, setInitialState }) => {
         location.pathname !== loginPath &&
           tryChangeWorkStatus(initialState?.currentUser?.staffId, location.pathname)
       }
-
-      // if (
-      //   initialState?.currentUser?.staffId &&
-      //   location.pathname !== loginPath &&
-      //   PERMISSION_NEED_PATH.includes(location.pathname) &&
-      //   !initialState?.permData
-      // ) {
-      //   const permData = await initialState.fetchPermData()
-      //   permData && setInitialState({ ...initialState, permData })
-      // }
     },
     childrenRender: children => <ModalStore>{children}</ModalStore>,
-    // links: [
-    //   <div className="ant-menu-title-content">
-    //     <AddressBook theme="outline" className="anticon" />
-    //     <span className="ant-pro-menu-item-title">通讯录</span>
-    //   </div>
-    // ],
-    // menuHeaderRender: false,
     ...initialState?.settings,
     breakpoint: false,
     onCollapse

+ 2 - 2
src/components/ModalStore/index.tsx

@@ -18,7 +18,7 @@ import LockDetail from '@/pages/Product/Lock/LockStore/components/LockDetail'
 import ConnectClient from '@/pages/Customer/Client/components/ConnectClient'
 import ReceiveLock from '@/pages/Product/Lock/LockStore/components/ReceiveLock'
 import CustomPerm from '@/pages/Customer/Company/components/CustomPerm'
-import MessageDrawer from '@/pages/Hr/Notification/components/MessageDrawer'
+import MessageDetail from '@/pages/Hr/Notification/components/MessageDetail'
 import CloudDetail from '@/pages/Product/Cloud/components/Detail'
 import PersonalDetail from '@/pages/Product/Road/Personal/components/Detail'
 import EnterpriseDetail from '@/pages/Product/Road/Enterprise/components/Detail'
@@ -41,7 +41,7 @@ const modalMap = {
   M_OPREATE_LOCK: OpreateLock, // 操作锁库弹窗
   M_RECEIVE_LOCK: ReceiveLock, // 接受锁库弹窗
   M_CUSTOM_PERM: CustomPerm, // 自定义数据权限弹窗
-  D_NOTICE_DETAIL: MessageDrawer, // 通知详情
+  D_NOTICE_DETAIL: MessageDetail, // 通知详情
   D_CLOUD_DETAIL: CloudDetail, // 云版详情
   D_PERSONAL_DETAIL: PersonalDetail, // 大司空2.0个人版详情
   D_ENTERPRISE_DETAIL: EnterpriseDetail // 大司空2.0企业版详情

+ 0 - 5
src/components/ModalStore/src/CreateProvider.tsx

@@ -80,8 +80,6 @@ const ModalStore: React.FC<ModalStoreProps> = props => {
   }
 
   function push(key: string, compState: any) {
-    console.log(compState)
-
     // eslint-disable-next-line no-param-reassign
     key = compState?.dataId ? `${key}@${compState?.dataId}` : key
     const { visiblePropName, onClosePropName, destroyOnClose } = getModalConfig(key)
@@ -110,8 +108,6 @@ const ModalStore: React.FC<ModalStoreProps> = props => {
         ...defaultProps,
         key
       }
-      // console.log(key)
-
       const nextModals = prevModals.slice()
 
       const index = nextModals.findIndex(item => item.key === key)
@@ -172,7 +168,6 @@ const ModalStore: React.FC<ModalStoreProps> = props => {
       return {
         ...item,
         maskStyle: { opacity: 0, animation: 'none' } as CSSProperties
-        // style: { transform: `translateX(-${(len - currentIdx) * 10}px)` }
       }
     }
     return item

+ 0 - 12
src/components/RightContent/Book/components/UserList/index.tsx

@@ -21,17 +21,6 @@ const UesrList: React.FC<UserListProps> = ({ onlineList }) => {
   const t = useRef()
   const [visible, setVisible] = useState(false)
   const intl = useIntl()
-  // const arr = []
-  // for (let i = 0; i < 100; i++) {
-  //   arr.push({
-  //     avatar: '/global/img/avtra',
-  //     department: '',
-  //     id: 'McjlQdO0O0Oi',
-  //     username: '杨卫东',
-  //     workStatus: 'menu.customer.client',
-  //     wsKey: '杨卫东'
-  //   })
-  // }
   const handleOnScroll = () => {
     if (!ref.current?.classList?.contains('scrolling')) {
       ref.current?.classList?.add('scrolling')
@@ -42,7 +31,6 @@ const UesrList: React.FC<UserListProps> = ({ onlineList }) => {
     }, 450)
   }
 
-  // const { run: tryHandleScroll } = useDebounceFn(handleOnScroll, { wait: 2500 })
   return (
     <>
       <span className="absolute top-70 left-[-0.75rem]" onClick={() => setVisible(!visible)}>

+ 1 - 1
src/components/RightContent/NoticeIcon/index.tsx

@@ -107,7 +107,7 @@ const NoticeIconView = () => {
         currentUser: { ...currentUser, unreadCount: currentUser.unreadCount - 1 }
       })
     }
-    dispatchModal('D_NOTICE_DETAIL', { item })
+    dispatchModal('D_NOTICE_DETAIL', { item, zIndex: 1051 })
   }
 
   const clearReadState = async (title: string, key: string) => {

+ 0 - 33
src/components/RightContent/index.tsx

@@ -30,40 +30,7 @@ const GlobalHeaderRight: React.FC = () => {
   }
   return (
     <Space className={className}>
-      {/* <HeaderSearch
-        className={`${styles.action} ${styles.search}`}
-        placeholder="站内搜索"
-        defaultValue="umi ui"
-        options={[
-          { label: <a href="https://umijs.org/zh/guide/umi-ui.html">umi ui</a>, value: 'umi ui' },
-          {
-            label: <a href="next.ant.design">Ant Design</a>,
-            value: 'Ant Design',
-          },
-          {
-            label: <a href="https://protable.ant.design/">Pro Table</a>,
-            value: 'Pro Table',
-          },
-          {
-            label: <a href="https://prolayout.ant.design/">Pro Layout</a>,
-            value: 'Pro Layout',
-          },
-        ]}
-        onSearch={value => {
-          console.log('input', value);
-        }}
-      /> */}
-      {/* <span
-        className={styles.action}
-        onClick={() => {
-          window.open('https://pro.ant.design/docs/getting-started');
-        }}
-      >
-        <QuestionCircleOutlined />
-      </span> */}
-      {/* {!isMobile() && <Book />} */}
       <Book />
-
       <Notify />
       <Avatar />
       {REACT_APP_ENV && REACT_APP_ENV !== 'prod' && (

+ 2 - 3
src/models/refresh.js

@@ -3,13 +3,12 @@ import { isObject, isUnDef } from '@/utils/is'
 export default {
   namespace: 'refresh',
   state: {
-    contactList: false,
     client: false,
     company: false,
     software: false,
     department: false,
-    staffList: false,
-    business: false,
+    staff: false, // 部门与员工
+    business: false, // 商机
     cloud: false,
     personal: false
   },

+ 7 - 10
src/pages/Customer/Business/components/BusinessDetail/Form.jsx

@@ -8,7 +8,7 @@ import ChangeCompanyInput, {
 import Step from './Step/index'
 
 const Form = props => {
-  const { business, groupStatus, updateKey, isOwner } = props
+  const { updatePayload, business, groupStatus, isOwner } = props
 
   const isEnd = useMemo(() => {
     return groupStatus.findIndex(item => item.endProcess && item.selected) !== -1
@@ -19,16 +19,9 @@ const Form = props => {
     customerId: business.customerId,
     targetName: business.name,
     dataId: business.id,
-    actionPayload: ChangeCompMap.BUSINESS.key,
     title: ChangeCompMap.BUSINESS.title
   }
 
-  // const changeStaffOpt = {
-  //   responsibleId: business.responsibleId,
-  //   dataId: business.id,
-  //   actionPayload: ChangeCompMap.BUSINESS.key,
-  //   text: business.responsible
-  // }
   const columns = [
     {
       dataIndex: 'name',
@@ -40,7 +33,11 @@ const Form = props => {
       label: '单位名称',
       editCellType: 'custom',
       customCell: (
-        <ChangeCompanyInput dataSource={changeCopInputData} editable={!isOwner ? false : !isEnd} />
+        <ChangeCompanyInput
+          actionPayload={updatePayload}
+          dataSource={changeCopInputData}
+          editable={!isOwner ? false : !isEnd}
+        />
       ),
       span: 24
     },
@@ -94,7 +91,7 @@ const Form = props => {
         dataSource={business}
         columns={columns}
         tartgetUrl="/business/update"
-        type={updateKey}
+        type={updatePayload}
         editable={!isOwner ? false : !isEnd}
       />
     </div>

+ 2 - 2
src/pages/Customer/Business/components/BusinessDetail/TabList.jsx

@@ -50,7 +50,7 @@ const ContanctTabList = ({ businessId, clientList, isOwner }) => {
       message.success('新增成功')
       dispatch({
         type: 'refresh/commitAction',
-        payload: ChangeCompMap.BUSINESS.key
+        payload: { main: ChangeCompMap.BUSINESS.key, target: businessId }
       })
     }
   }
@@ -61,7 +61,7 @@ const ContanctTabList = ({ businessId, clientList, isOwner }) => {
   const refreshClient = () => {
     dispatch({
       type: 'refresh/commitAction',
-      payload: ChangeCompMap.BUSINESS.key
+      payload: { main: ChangeCompMap.BUSINESS.key, target: businessId }
     })
   }
 

+ 7 - 4
src/pages/Customer/Business/components/BusinessDetail/index.jsx

@@ -18,10 +18,10 @@ const Detail = props => {
     dispatch,
     updateKey = 'business',
     refresh,
-    dataId = '',
+    dataId,
     orderIds = []
   } = props
-  const shouldUpdate = refresh[updateKey] || false
+  const shouldUpdate = refresh[dataId ?? updateKey] || false
   const [state, setState] = useState({
     loading: false,
     business: {},
@@ -46,7 +46,10 @@ const Detail = props => {
       if (shouldUpdate) {
         dispatch({
           type: 'refresh/commitAction',
-          payload: 'business'
+          payload: {
+            main: updateKey,
+            target: dataId
+          }
         })
       }
       setState({
@@ -107,7 +110,7 @@ const Detail = props => {
                   isOwner={isOwner}
                   business={state.business}
                   groupStatus={state.groupStatus}
-                  updateKey={updateKey}
+                  updatePayload={{ main: updateKey, target: dataId }}
                 />
               </div>
             </Col>

+ 1 - 6
src/pages/Customer/Company/components/CompanyDetail/LowerList.jsx

@@ -53,12 +53,7 @@ const CompanyLowerList = props => {
                 renderItem={item => (
                   <List.Item>
                     <a>@{item.operatorName}</a> {item.content}
-                    <List.Item.Meta
-                      // avatar=
-                      // title=
-                      // description={ dayjsFormat(item.createTime, 'YYYY-MM-DD')}
-                      description={dayjsFormat(item.createTime)}
-                    />
+                    <List.Item.Meta description={dayjsFormat(item.createTime)} />
                   </List.Item>
                 )}
               />

+ 2 - 18
src/pages/Customer/Company/components/CompanyDetail/SyncClient.jsx

@@ -8,7 +8,7 @@ import { Table } from '@arco-design/web-react'
 import '@arco-design/web-react/dist/css/arco.css'
 import styles from './index.less'
 
-const SyncClient = ({ customer, client }) => {
+const SyncClient = ({ customer, client, actionPayload }) => {
   const dispatch = useDispatch()
   const [state, setState] = useState({
     visible: false,
@@ -20,11 +20,10 @@ const SyncClient = ({ customer, client }) => {
   const refreshCompany = () => {
     dispatch({
       type: 'refresh/commitAction',
-      payload: 'company'
+      payload: actionPayload
     })
   }
 
-  // eslint-disable-next-line consistent-return
   const handleOnConfirm = async () => {
     const { checkValues, selectedKeys } = state
     if (!checkValues?.length) {
@@ -80,7 +79,6 @@ const SyncClient = ({ customer, client }) => {
     {
       dataIndex: 'stay',
       title: '参考住宿',
-      // width: '15%',
       ellipsis: true
     }
   ]
@@ -97,8 +95,6 @@ const SyncClient = ({ customer, client }) => {
       >
         <Copy theme="two-tone" fill={['#333', '#886ab5']} />
         <span className="ml-1">同步地址信息</span>
-        {/* <div className="flex items-center justify-center">
-        </div> */}
       </Button>
       <Modal
         width="70%"
@@ -160,18 +156,6 @@ const SyncClient = ({ customer, client }) => {
             }}
           />
         </div>
-        {/* <Table
-          rowKey="id"
-          size="small"
-          columns={columns}
-          dataSource={client}
-          bordered
-          scroll={{ y: 400 }}
-          pagination={false}
-          rowSelection={{
-            onChange: selectedRowKeys => setState({ ...state, selectedKeys: selectedRowKeys })
-          }}
-        /> */}
       </Modal>
     </>
   )

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

@@ -304,7 +304,7 @@ const CompanyTabList = ({
       // 刷新数据
       dispatch({
         type: 'refresh/commitAction',
-        payload: 'company'
+        payload: updatePayload
       })
     }
   }
@@ -317,7 +317,7 @@ const CompanyTabList = ({
       message.success(msg)
       dispatch({
         type: 'refresh/commitAction',
-        payload: 'company'
+        payload: updatePayload
       })
       initData()
     }
@@ -391,7 +391,7 @@ const CompanyTabList = ({
           客户
         </Button>
         <AddRecord onConfirm={handleAddCustomerService} />
-        <SyncClient customer={customer} client={client.client} />
+        <SyncClient actionPayload={updatePayload} customer={customer} client={client.client} />
       </div>
     </div>
   )

+ 11 - 17
src/pages/Hr/Employee/components/ChangeSupervisor/index.jsx

@@ -1,6 +1,6 @@
 import React from 'react'
 import { Switch, LinkInterrupt, LinkOne } from '@icon-park/react'
-import { Card, Tooltip } from 'antd'
+import { Card, Modal, Tooltip } from 'antd'
 import consts from '@/basic/consts'
 import { useDispatch } from 'dva'
 import styles from './index.less'
@@ -18,26 +18,22 @@ const ChangeSupervisor = props => {
   const dispatch = useDispatch()
   const dispatchModal = useModal()
   const {
-    dataSource: {
-      staffId,
-      clientId,
-      staffName,
-      targetName,
-      actionPayload = ChangeCompMap.STAFF.key,
-      title = '员工'
+    dataSource: { staffId, clientId, staffName, targetName, title = '员工' },
+    actionPayload = {
+      main: ChangeCompMap.STAFF.key
     }
   } = props
   const refreshStaff = () => {
     dispatch({
       type: 'refresh/commitAction',
-      payload: 'stafflist'
+      payload: actionPayload
     })
   }
   const handleConnectStaff = () => {
     dispatchModal('M_CONNECT_CLIENT', {
       onSelect: refreshStaff,
       id: clientId,
-      postUrl: actionPayload
+      preUrl: actionPayload.main
     })
   }
   const notValueRender = (
@@ -48,9 +44,9 @@ const ChangeSupervisor = props => {
   )
 
   const removeSupervisor = () => {
-    setModalProps({
+    Modal.confirm({
       title: '确认移除',
-      children: (
+      content: (
         <p>
           为{title}
           <span className="mr-3px ml-3px font-600">{targetName}</span>移除
@@ -58,13 +54,11 @@ const ChangeSupervisor = props => {
         </p>
       ),
       onOk: async () => {
-        await apiChangeSupervisor(actionPayload, { id: clientId, dataId: '0' })
+        // dataId - '0' - 移除上司
+        await apiChangeSupervisor(actionPayload.main, { id: clientId, dataId: '0' })
         refreshStaff()
-        toggleModal()
-      },
-      onCancel: () => toggleModal()
+      }
     })
-    toggleModal()
   }
   const normalValueRender = (
     <Card size="small">

+ 5 - 3
src/pages/Hr/Employee/components/EmployeeDetail/Form.jsx

@@ -4,7 +4,7 @@ import EditableForm from '@/components/EditableForm'
 import ChangeSupervisor from '@/pages/Hr/Employee/components/ChangeSupervisor'
 
 const EmployeeForm = props => {
-  const { staff } = props
+  const { staff, actionPayload } = props
   const changeCopInputData = {
     staffName: staff.supervisorName,
     staffId: staff.id,
@@ -33,7 +33,9 @@ const EmployeeForm = props => {
       dataIndex: 'supervisorName',
       label: '部门上司',
       editCellType: 'custom',
-      customCell: <ChangeSupervisor dataSource={changeCopInputData} />,
+      customCell: (
+        <ChangeSupervisor actionPayload={actionPayload} dataSource={changeCopInputData} />
+      ),
       span: 24
     },
     {
@@ -270,7 +272,7 @@ const EmployeeForm = props => {
       <EditableForm
         columns={columns}
         dataSource={staff}
-        type="employee"
+        type={actionPayload}
         tartgetUrl="/staff/change/department"
       />
     </div>

+ 1 - 6
src/pages/Hr/Employee/components/EmployeeDetail/TabList.jsx

@@ -17,12 +17,7 @@ const EmployeeTabList = props => {
                 renderItem={item => (
                   <List.Item>
                     <a>@{item.operatorName}</a> {item.content}
-                    <List.Item.Meta
-                      // avatar=
-                      // title=
-                      // description={ dayjsFormat(item.createTime, 'YYYY-MM-DD')}
-                      description={dayjsFormat(item.createTime)}
-                    />
+                    <List.Item.Meta description={dayjsFormat(item.createTime)} />
                   </List.Item>
                 )}
               />

+ 11 - 4
src/pages/Hr/Employee/components/EmployeeDetail/index.jsx

@@ -8,7 +8,8 @@ import EmployeeTabList from './TabList.jsx'
 import { apiStaffDetail } from '@/services/staff'
 
 const EmployeeDetail = props => {
-  const { visible, onClose, dispatch, shouldUpdate, dataId = '' } = props
+  const { visible, onClose, dispatch, refresh, updateKey = 'staff', dataId } = props
+  const shouldUpdate = refresh?.[dataId ?? updateKey] || false
   const [state, setState] = useState({
     loading: false,
     staff: {},
@@ -24,7 +25,10 @@ const EmployeeDetail = props => {
       if (shouldUpdate) {
         dispatch({
           type: 'refresh/commitAction',
-          payload: 'stafflist'
+          payload: {
+            main: updateKey,
+            target: dataId
+          }
         })
       }
       setState({ ...state, staff, log, loading: false })
@@ -42,7 +46,10 @@ const EmployeeDetail = props => {
         <Row>
           <Col span={12} className="sheet-box-left">
             <div className="sheet-left-panel pr-4">
-              <EmployeeForm staff={state.staff} />
+              <EmployeeForm
+                staff={state.staff}
+                actionPayload={{ main: updateKey, target: dataId }}
+              />
             </div>
           </Col>
           <Col span={12} className="sheet-box-right">
@@ -56,5 +63,5 @@ const EmployeeDetail = props => {
 }
 
 export default connect(({ refresh }) => ({
-  shouldUpdate: refresh.stafflist
+  refresh
 }))(EmployeeDetail)

+ 73 - 74
src/pages/Hr/Notification/components/AddMessage.jsx

@@ -44,81 +44,80 @@ const AddMessage = props => {
     return newValues
   }
   return (
-    <div>
-      <ModalForm
-        isKeyPressSubmit={false}
-        key="modalForm"
-        formRef={formRef}
-        trigger={
-          <Button type="primary">
-            <Plus className="mr-1" />
-            新建通知
-          </Button>
+    <ModalForm
+      isKeyPressSubmit={false}
+      formRef={formRef}
+      trigger={
+        <Button type="primary">
+          <Plus className="mr-1" />
+          新建通知
+        </Button>
+      }
+      initialValues={{ msgType: 'notification', refresh: 0 }}
+      onFinish={async values => {
+        try {
+          const nValues = handleFormValues(values)
+          await onConfirm(nValues)
+          formRef.current?.resetFields()
+          message.success('添加成功')
+          return true
+        } catch (error) {
+          return false
         }
-        initialValues={{ msgType: 'notification', refresh: 0 }}
-        onFinish={async values => {
-          try {
-            const nValues = handleFormValues(values)
-            await onConfirm(nValues)
-            formRef.current?.resetFields()
-            message.success('添加成功')
-            return true
-          } catch (error) {
-            return false
-          }
-        }}>
-        <ProFormText
-          name="title"
-          label="标题"
-          placeholder="请输入标题"
-          rules={[{ required: true, message: '请输入标题' }]}
-        />
-        <Form.Item
-          label="内容"
-          name="content"
-          rules={[{ required: true, message: '请输入通知内容' }]}>
-          <RighEditor />
-        </Form.Item>
-        <ProFormRadio.Group
-          label="类型"
-          name="msgType"
-          required
-          options={[
-            { label: '通知', value: msgTypeEnum.NotificationOne }
-            // { label: '消息', value: msgTypeEnum.Message }
-          ]}
-        />
-        <ProFormDependency name={['msgType']}>
-          {({ msgType }) =>
-            msgType === msgTypeEnum.NotificationOne ? (
-              <ProFormSelect
-                name="media"
-                label="通知类型"
-                rules={[{ required: true, message: '请选择类型' }]}
-                options={[
-                  { label: '版本更新', value: mediaType.VersionUpdate },
-                  { label: '节假通知', value: mediaType.HolidayNotice }
-                ]}
-              />
-            ) : null
-          }
-        </ProFormDependency>
-        <ProFormDependency name={['msgType', 'media']}>
-          {({ msgType, media }) =>
-            msgType === msgTypeEnum.NotificationOne && media === mediaType.VersionUpdate ? (
-              <ProFormRadio.Group
-                name="refresh"
-                rules={[{ required: true, message: '请选择刷新机制' }]}
-                options={[
-                  { label: '手动刷新', value: 0 },
-                  { label: '强制刷新', value: 1 }
-                ]}
-              />
-            ) : null
-          }
-        </ProFormDependency>
-      </ModalForm>
-    </div>
+      }}
+    >
+      <ProFormText
+        name="title"
+        label="标题"
+        placeholder="请输入标题"
+        rules={[{ required: true, message: '请输入标题' }]}
+      />
+      <Form.Item
+        label="内容"
+        name="content"
+        rules={[{ required: true, message: '请输入通知内容' }]}
+      >
+        <RighEditor />
+      </Form.Item>
+      <ProFormRadio.Group
+        label="类型"
+        name="msgType"
+        required
+        options={[
+          { label: '通知', value: msgTypeEnum.NotificationOne }
+          // { label: '消息', value: msgTypeEnum.Message }
+        ]}
+      />
+      <ProFormDependency name={['msgType']}>
+        {({ msgType }) =>
+          msgType === msgTypeEnum.NotificationOne ? (
+            <ProFormSelect
+              name="media"
+              label="通知类型"
+              rules={[{ required: true, message: '请选择类型' }]}
+              options={[
+                { label: '版本更新', value: mediaType.VersionUpdate },
+                { label: '节假通知', value: mediaType.HolidayNotice }
+              ]}
+            />
+          ) : null
+        }
+      </ProFormDependency>
+      <ProFormDependency name={['msgType', 'media']}>
+        {({ msgType, media }) =>
+          msgType === msgTypeEnum.NotificationOne && media === mediaType.VersionUpdate ? (
+            <ProFormRadio.Group
+              name="refresh"
+              rules={[{ required: true, message: '请选择刷新机制' }]}
+              options={[
+                { label: '手动刷新', value: 0 },
+                { label: '强制刷新', value: 1 }
+              ]}
+            />
+          ) : null
+        }
+      </ProFormDependency>
+    </ModalForm>
   )
 }
 

+ 39 - 0
src/pages/Hr/Notification/components/MessageDetail.jsx

@@ -0,0 +1,39 @@
+import MarkDown from 'react-markdown'
+import styles from '@/pages/Hr/Notification/index.less'
+import { Drawer, Tag, Typography } from 'antd'
+import { useIntl } from 'umi'
+import 'vditor/src/assets/scss/index.scss'
+
+const MessageDetail = props => {
+  const { item: { id, title, createTime, content, msgType } = {}, ...otherProps } = props
+  const intl = useIntl()
+  if (!id) return null
+  return (
+    <Drawer {...otherProps} className="zh-drawer">
+      <div className="px-5 vditor-reset h-full">
+        <div className="max-h-20vh">
+          <span className="pt-5 block">
+            <Tag color="purple">
+              {intl.formatMessage({ id: `component.globalHeader.${msgType}` })}
+            </Tag>
+          </span>
+          <h1 className={['text-xl pr-6 mt-3', styles.NotificationCont].join(' ')}>{title}</h1>
+          <span className="text-hex-aaa">{createTime}</span>
+          <div className="w-22 h-[1px] bg-hex-ddd mt-3 mb-5 " />
+        </div>
+        <div
+          className={[
+            'overflow-y-auto max-h-80vh py-3 px-4 bg-hex-f9f9f9 rounded-md boxShadow',
+            styles.NotificationCont
+          ].join(' ')}
+        >
+          <Typography.Paragraph>
+            <MarkDown>{content}</MarkDown>
+          </Typography.Paragraph>
+        </div>
+      </div>
+    </Drawer>
+  )
+}
+
+export default MessageDetail

+ 0 - 37
src/pages/Hr/Notification/components/MessageDrawer.jsx

@@ -1,37 +0,0 @@
-import MarkDown from 'react-markdown'
-import styles from '@/pages/Hr/Notification/index.less'
-import { Tag, Typography } from 'antd'
-import { useIntl } from 'umi'
-import 'vditor/src/assets/scss/index.scss'
-
-const MessageDrawer = props => {
-  const {
-    item: { title, createTime, content, msgType }
-  } = props
-  const intl = useIntl()
-  return (
-    <div className="px-5 vditor-reset h-full">
-      <div className="max-h-20vh">
-        <span className="pt-5 block">
-          <Tag color="purple">
-            {intl.formatMessage({ id: `component.globalHeader.${msgType}` })}
-          </Tag>
-        </span>
-        <h1 className={['text-xl pr-6 mt-3', styles.NotificationCont].join(' ')}>{title}</h1>
-        <span className="text-hex-aaa">{createTime}</span>
-        <div className="w-22 h-[1px] bg-hex-ddd mt-3 mb-5 " />
-      </div>
-      <div
-        className={[
-          'overflow-y-auto max-h-80vh py-3 px-4 bg-hex-f9f9f9 rounded-md boxShadow',
-          styles.NotificationCont
-        ].join(' ')}>
-        <Typography.Paragraph>
-          <MarkDown>{content}</MarkDown>
-        </Typography.Paragraph>
-      </div>
-    </div>
-  )
-}
-
-export default MessageDrawer

+ 1 - 1
src/pages/Hr/Notification/index.jsx

@@ -112,7 +112,7 @@ const Notification = () => {
                       <Tag color="purple">
                         {intl.formatMessage({ id: `component.globalHeader.${item.msgType}` })}
                       </Tag>{' '}
-                      '发布范围',
+                      &apos;发布范围&apos;,
                       <span className="ml-2">全公司</span>
                     </div>
                   }

+ 2 - 2
src/pages/Product/Cloud/components/Detail/Form.jsx

@@ -3,7 +3,7 @@ import { Row, Col } from 'antd'
 import EditableForm from '@/components/EditableForm'
 
 const RoadpricingForm = props => {
-  const { cloudUser, updateKey, projectType } = props
+  const { cloudUser, actionPayload, projectType } = props
   const titleEnum = {
     1: '养护云造价',
     2: '大司空',
@@ -90,7 +90,7 @@ const RoadpricingForm = props => {
         dataSource={cloudUser}
         columns={columns}
         tartgetUrl="/cloud/update"
-        type={updateKey}
+        type={actionPayload}
       />
     </div>
   )

+ 33 - 35
src/pages/Product/Cloud/components/Detail/TabList.jsx

@@ -17,7 +17,8 @@ const RoadpricingTabList = props => {
     compilationList,
     cloudUser: { online_list = [], mobile, username },
     projectType,
-    ssoId
+    ssoId,
+    actionPayload = { main: 'cloud' }
   } = props
   const isUpgradeEnum = {
     true: '已升级',
@@ -56,7 +57,7 @@ const RoadpricingTabList = props => {
       // 刷新数据
       dispatch({
         type: 'refresh/commitAction',
-        payload: 'cloud'
+        payload: actionPayload
       })
     }
   }
@@ -100,37 +101,35 @@ const RoadpricingTabList = props => {
                 ...setRoadPricingUpgrade,
                 visible: true,
                 type: titleType.GIVE,
-                // eslint-disable-next-line no-underscore-dangle
                 compilationId: record._id,
                 compilationName: record.name,
                 lockTypeEnum: lockTypeEnum.GIVE,
                 upgradeTypeEnum: upgradeTypeEnum.UPGRADE
               })
-            }>
+            }
+          >
             赠送
           </Button>
           {record.lock === 1 ? (
-            <>
-              <Button
-                type="primary"
-                ghost
-                size="small"
-                className="m-2px"
-                onClick={() =>
-                  setRoadPricingUpgrade({
-                    ...setRoadPricingUpgrade,
-                    visible: true,
-                    type: titleType.SALE,
-                    // eslint-disable-next-line no-underscore-dangle
-                    compilationId: record._id,
-                    compilationName: record.name,
-                    lockTypeEnum: lockTypeEnum.SALE,
-                    upgradeTypeEnum: upgradeTypeEnum.UPGRADE
-                  })
-                }>
-                销售
-              </Button>
-            </>
+            <Button
+              type="primary"
+              ghost
+              size="small"
+              className="m-2px"
+              onClick={() =>
+                setRoadPricingUpgrade({
+                  ...setRoadPricingUpgrade,
+                  visible: true,
+                  type: titleType.SALE,
+                  compilationId: record._id,
+                  compilationName: record.name,
+                  lockTypeEnum: lockTypeEnum.SALE,
+                  upgradeTypeEnum: upgradeTypeEnum.UPGRADE
+                })
+              }
+            >
+              销售
+            </Button>
           ) : null}
           {record.isUpgrade ? (
             <>
@@ -144,13 +143,13 @@ const RoadpricingTabList = props => {
                     ...setRoadPricingUpgrade,
                     visible: true,
                     type: titleType.DEMOTION,
-                    // eslint-disable-next-line no-underscore-dangle
                     compilationId: record._id,
                     compilationName: record.name,
                     compilationListName: record.name,
                     upgradeTypeEnum: upgradeTypeEnum.DEMOTION
                   })
-                }>
+                }
+              >
                 降级
               </Button>
               <Button
@@ -164,14 +163,14 @@ const RoadpricingTabList = props => {
                     visible: true,
                     type: titleType.DEADLINE,
                     deadline: record.deadline,
-                    // eslint-disable-next-line no-underscore-dangle
                     compilationId: record._id,
                     compilationName: record.name,
                     compilationListName: record.name,
                     lockTypeEnum: record.lock,
                     upgradeTypeEnum: upgradeTypeEnum.DEADLINE
                   })
-                }>
+                }
+              >
                 限期
               </Button>
             </>
@@ -187,13 +186,13 @@ const RoadpricingTabList = props => {
                     ...setRoadPricingUpgrade,
                     visible: true,
                     type: titleType.LEND,
-                    // eslint-disable-next-line no-underscore-dangle
                     compilationId: record._id,
                     compilationName: record.name,
                     lockTypeEnum: lockTypeEnum.LEND,
                     upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                   })
-                }>
+                }
+              >
                 借出
               </Button>
               <Button
@@ -206,13 +205,13 @@ const RoadpricingTabList = props => {
                     ...setRoadPricingUpgrade,
                     visible: true,
                     type: titleType.SALE,
-                    // eslint-disable-next-line no-underscore-dangle
                     compilationId: record._id,
                     compilationName: record.name,
                     lockTypeEnum: lockTypeEnum.SALE,
                     upgradeTypeEnum: upgradeTypeEnum.UPGRADE
                   })
-                }>
+                }
+              >
                 销售
               </Button>
             </>
@@ -244,7 +243,6 @@ const RoadpricingTabList = props => {
                 columns={columns}
                 search={false}
                 toolBarRender={false}
-                // eslint-disable-next-line no-underscore-dangle
                 rowKey={record => record._id}
                 dataSource={compilationList}
                 pagination={false}
@@ -258,7 +256,6 @@ const RoadpricingTabList = props => {
                 columns={columnOnline}
                 search={false}
                 toolBarRender={false}
-                // eslint-disable-next-line no-underscore-dangle
                 rowKey={record => record._id}
                 dataSource={online_list}
                 pagination={false}
@@ -272,6 +269,7 @@ const RoadpricingTabList = props => {
         loading={roadPricingUpgrade.loading}
         visible={roadPricingUpgrade.visible}
         type={roadPricingUpgrade.type}
+        actionPayload={actionPayload}
         onCancel={() => setRoadPricingUpgrade({ ...roadPricingUpgrade, visible: false })}
         projectType={projectType}
         ssoId={ssoId}

+ 5 - 3
src/pages/Product/Cloud/components/Detail/UpgradeModal.jsx

@@ -48,7 +48,8 @@ const UpgradeModal = props => {
     lock,
     upgradeType,
     cloudUser,
-    deadline
+    deadline,
+    actionPayload
   } = props
   const [form] = Form.useForm()
   const dispatch = useDispatch()
@@ -85,7 +86,7 @@ const UpgradeModal = props => {
       form.resetFields()
       dispatch({
         type: 'refresh/commitAction',
-        payload: 'cloud'
+        payload: actionPayload
       })
     })
   }
@@ -101,7 +102,8 @@ const UpgradeModal = props => {
         onCancel()
         form?.resetFields()
       }}
-      onOk={handleonOk}>
+      onOk={handleonOk}
+    >
       {type === lockTypeEnum.GIVE || type === lockTypeEnum.LEND || type === lockTypeEnum.SALE ? (
         <div className="mb-6">
           <p className="pb-3">

+ 22 - 23
src/pages/Product/Cloud/components/Detail/index.jsx

@@ -17,16 +17,19 @@ const CloudDetail = props => {
     updateKey = 'cloud',
     refresh,
     visible,
-    dataId = '',
+    dataId,
     projectType,
     ...resetDrawerProps
   } = props
   const dispatchModal = useModal()
-  const shouldUpdate = refresh?.[updateKey] || false
-  const refreshClient = () => {
+  const shouldUpdate = refresh?.[dataId ?? updateKey] || false
+  const refreshDetail = () => {
     dispatch({
       type: 'refresh/commitAction',
-      payload: 'cloud'
+      payload: {
+        main: updateKey,
+        target: dataId
+      }
     })
   }
   const [state, setState] = useState({
@@ -45,17 +48,14 @@ const CloudDetail = props => {
     } = await apiRoadpricingDetail({ ssoId: id, projectType })
     if (code === consts.RET_CODE.SUCCESS) {
       if (shouldUpdate) {
-        dispatch({
-          type: 'refresh/commitAction',
-          payload: updateKey
-        })
+        refreshDetail()
       }
       setState({ ...state, cloudUser, compilationList, log, serviceLog, client, loading: false })
     }
   }
   const handleConnectClient = () => {
     dispatchModal('M_CONNECT_CLIENT', {
-      onSelect: refreshClient,
+      onSelect: refreshDetail,
       dataId: state.cloudUser.ssoId,
       preUrl: 'RoadPricing',
       showFooter: false,
@@ -65,7 +65,6 @@ const CloudDetail = props => {
   // 移除cld客户
   const pricingUnLinkClient = clientId => {
     Modal.confirm({
-      zIndex: 1002,
       title: '确认移除',
       onOk: async () => {
         const { code = -1 } = await apiRoadPricingUnLinkClient({
@@ -76,7 +75,10 @@ const CloudDetail = props => {
         if (code === consts.RET_CODE.SUCCESS) {
           dispatch({
             type: 'refresh/commitAction',
-            payload: updateKey
+            payload: {
+              main: updateKey,
+              target: dataId
+            }
           })
         }
       }
@@ -97,7 +99,11 @@ const CloudDetail = props => {
           <Row>
             <Col span={9} className="sheet-box-left">
               <div className="sheet-left-panel pr-4">
-                <Form cloudUser={state.cloudUser} updateKey={updateKey} projectType={projectType} />
+                <Form
+                  cloudUser={state.cloudUser}
+                  actionPayload={{ main: updateKey, target: dataId }}
+                  projectType={projectType}
+                />
                 {state.cloudUser.cld?.clientId ? (
                   <>
                     <div className="mt-4">
@@ -110,9 +116,8 @@ const CloudDetail = props => {
                           type="primary"
                           ghost
                           size="small"
-                          onClick={() => {
-                            pricingUnLinkClient(state.cloudUser.cld?.clientId)
-                          }}>
+                          onClick={() => pricingUnLinkClient(state.cloudUser.cld?.clientId)}
+                        >
                           <LinkInterrupt size="14" />
                           <span className="ml-5px">移除CLD客户</span>
                         </Button>
@@ -129,15 +134,9 @@ const CloudDetail = props => {
                 )}
               </div>
             </Col>
-            <Col
-              span={15}
-              // sm={{ span: 24 }}
-              // md={{ span: 24 }}
-              // lg={{ span: 15 }}
-              // xl={{ span: 15 }}
-              flex={{ flexDirection: 'column' }}
-              className="sheet-box-right">
+            <Col span={15} flex={{ flexDirection: 'column' }} className="sheet-box-right">
               <TabList
+                actionPayload={{ main: updateKey, target: dataId }}
                 compilationList={state.compilationList}
                 cloudUser={state.cloudUser}
                 projectType={projectType}

+ 12 - 20
src/pages/Product/Lock/LockStore/components/ChangeClient/index.jsx

@@ -8,7 +8,8 @@ import styles from './index.less'
 import { useModal } from '@/components/ModalStore'
 
 const ChangeClient = ({
-  dataSource: { clientName = '', longleId, clientId, actionPayload }
+  actionPayload,
+  dataSource: { clientName = '', longleId, clientId }
 } = {}) => {
   const dispatchModal = useModal()
   const dispatch = useDispatch()
@@ -21,18 +22,16 @@ const ChangeClient = ({
     })
   }
 
+  const openConnectClientModal = () =>
+    dispatchModal('M_CONNECT_CLIENT', {
+      onSelect: refreshClient,
+      dataId: longleId,
+      preUrl: actionPayload.main,
+      showFooter: false
+    })
+
   const notValueRender = (
-    <div
-      onClick={() =>
-        dispatchModal('M_CONNECT_CLIENT', {
-          onSelect: refreshClient,
-          dataId: longleId,
-          preUrl: actionPayload,
-          showFooter: false
-        })
-      }
-      className={styles.notCompanyContent}
-    >
+    <div onClick={openConnectClientModal} className={styles.notCompanyContent}>
       <LinkOne size="14" />
       <span className="ml-5px">关联客户</span>
     </div>
@@ -53,14 +52,7 @@ const ChangeClient = ({
             placement="right"
             title="更换客户"
             className="ml-5px"
-            onClick={() =>
-              dispatchModal('M_CONNECT_CLIENT', {
-                onSelect: refreshClient,
-                dataId: longleId,
-                preUrl: actionPayload,
-                showFooter: false
-              })
-            }
+            onClick={openConnectClientModal}
           >
             <span className={styles.switchIcon}>
               <Switch />

+ 5 - 6
src/pages/Product/Lock/LockStore/components/LockDetail/Form.jsx

@@ -10,12 +10,11 @@ import ChangeCompanyInput, {
 } from '@/pages/Customer/Company/components/ChangeCompany'
 
 const LockForm = props => {
-  const { longle } = props
+  const { longle, actionPayload } = props
   const changeClientInputData = {
     clientName: longle.client,
     longleId: longle.id,
-    clientId: longle.clientId,
-    actionPayload: ChangeCompMap.SOFTWARE.key
+    clientId: longle.clientId
   }
 
   const changeCompanyInputData = {
@@ -23,7 +22,6 @@ const LockForm = props => {
     dataId: longle.id,
     customerName: longle.customerName,
     targetName: longle.keyNum,
-    actionPayload: ChangeCompMap.SOFTWARE.key,
     title: '软件锁'
   }
 
@@ -122,6 +120,7 @@ const LockForm = props => {
         <Col span={6}>单位名称</Col>
         <Col span={18}>
           <ChangeCompanyInput
+            actionPayload={actionPayload}
             dataSource={changeCompanyInputData}
             showRemoveIcon={false}
             showConnectIcon={false}
@@ -130,7 +129,7 @@ const LockForm = props => {
         <Divider style={{ margin: '12px 0' }} />
         <Col span={6}>客户</Col>
         <Col span={18}>
-          <ChangeClient dataSource={changeClientInputData} />
+          <ChangeClient actionPayload={actionPayload} dataSource={changeClientInputData} />
         </Col>
         <Divider style={{ margin: '12px 0' }} />
         <Col span={6}>注册码</Col>
@@ -140,7 +139,7 @@ const LockForm = props => {
         <Col span={6} />
         <Col span={18}>
           <small>
-            使用方法:复制以上注册码,打开软件帮助菜单/产品注册/下一步/下一步/选择"手工输入注册码"。将注册码不分段不空格复制粘贴到"注册码"栏内确定即可。
+            使用方法:复制以上注册码,打开软件帮助菜单/产品注册/下一步/下一步/选择&quot;手工输入注册码&quot;。将注册码不分段不空格复制粘贴到&quot;注册码&quot;栏内确定即可。
           </small>
         </Col>
         <Divider style={{ margin: '12px 0' }} />

+ 1 - 6
src/pages/Product/Lock/LockStore/components/LockDetail/LowerList.jsx

@@ -18,12 +18,7 @@ const LockLowerList = props => {
                 renderItem={item => (
                   <List.Item>
                     <a>@{item.operatorName}</a> {item.content}
-                    <List.Item.Meta
-                      // avatar=
-                      // title=
-                      // description={ dayjsFormat(item.createTime, 'YYYY-MM-DD')}
-                      description={dayjsFormat(item.createTime)}
-                    />
+                    <List.Item.Meta description={dayjsFormat(item.createTime)} />
                   </List.Item>
                 )}
               />

+ 16 - 20
src/pages/Product/Lock/LockStore/components/LockDetail/OpreateLock.jsx

@@ -150,20 +150,21 @@ const OpreateLock = props => {
   const handleonOk = () => {
     form.validateFields().then(async values => {
       if (type === lockTypeEnum.RECEIVE) {
-        const { code = -1 } = await apiReceiveLock({
-          longleId
-        })
+        const { code = -1 } = await apiReceiveLock({ longleId })
         if (code === consts.RET_CODE.SUCCESS) {
           message.success('接收成功')
           resetModalProps.onCancel()
+          dispatch({
+            type: 'refresh/commitAction',
+            payload: {
+              main: 'software',
+              target: longleId
+            }
+          })
         }
       } else {
         onConfirm({ ...values, preserveStatus: type })
       }
-      dispatch({
-        type: 'refresh/commitAction',
-        payload: 'software'
-      })
     })
   }
 
@@ -194,7 +195,10 @@ const OpreateLock = props => {
       message.success('新增成功')
       dispatch({
         type: 'refresh/commitAction',
-        payload: 'software'
+        payload: {
+          main: 'software',
+          target: longleId
+        }
       })
       onCancel()
     }
@@ -211,7 +215,10 @@ const OpreateLock = props => {
       message.success('新增成功')
       dispatch({
         type: 'refresh/commitAction',
-        payload: 'software'
+        payload: {
+          main: 'software',
+          target: longleId
+        }
       })
       onCancel()
     }
@@ -373,17 +380,6 @@ const OpreateLock = props => {
             </Form.Item>
           </>
         ) : null}
-
-        {/* {type === lockTypeEnum.RECEIVE ? (
-          <>
-            <p>
-              确认接收锁 <b>{keyNum}</b>
-            </p>
-            <Form.Item name="longleId" hidden>
-              <Input />
-            </Form.Item>
-          </>
-        ) : null} */}
       </Form>
     </Modal>
   )

+ 4 - 12
src/pages/Product/Lock/LockStore/components/LockDetail/TabList.jsx

@@ -14,7 +14,7 @@ const LockTabList = props => {
     longle: { id: longleId, keyNum, status, stockStatus, sellStatus, preserveStatus } = {},
     longleLog,
     upgradeProduct,
-    updateKey
+    actionPayload
   } = props
   const hasAddPerm = useAccess()?.validatePermByType('lockstore_delete_record')
   const dispatchModal = useModal()
@@ -40,7 +40,7 @@ const LockTabList = props => {
       // 刷新数据
       dispatch({
         type: 'refresh/commitAction',
-        payload: updateKey
+        payload: actionPayload
       })
     }
   }
@@ -48,12 +48,6 @@ const LockTabList = props => {
   // 点击新软件锁详情
   const showLongleClick = newLongleId => {
     dispatchModal('D_LOCK_DETAIL', { dataId: newLongleId })
-    setTimeout(() => {
-      dispatch({
-        type: 'refresh/commitAction',
-        payload: updateKey
-      })
-    }, 0)
   }
 
   const renderNewLog = longleService => {
@@ -94,14 +88,12 @@ const LockTabList = props => {
 
   // 删除软件锁日志
   const delLonglelog = async id => {
-    const { code = -1 } = await apiDelLonglelog({
-      id
-    })
+    const { code = -1 } = await apiDelLonglelog({ id })
     if (code === consts.RET_CODE.SUCCESS) {
       message.success('删除成功')
       dispatch({
         type: 'refresh/commitAction',
-        payload: updateKey
+        payload: actionPayload
       })
     }
   }

+ 11 - 5
src/pages/Product/Lock/LockStore/components/LockDetail/index.jsx

@@ -13,13 +13,13 @@ const LockDetail = props => {
   const {
     visible,
     dispatch,
-    dataId = '',
+    dataId,
     refresh,
     orderIds = [],
     updateKey = 'software',
     ...resetDrawerProps
   } = props
-  const shouldUpdate = refresh?.[updateKey] || false
+  const shouldUpdate = refresh?.[dataId ?? updateKey] || false
   const [state, setState] = useState({
     loading: false,
     longle: {},
@@ -38,7 +38,10 @@ const LockDetail = props => {
       if (shouldUpdate) {
         dispatch({
           type: 'refresh/commitAction',
-          payload: updateKey
+          payload: {
+            main: updateKey,
+            target: dataId
+          }
         })
       }
       setState({ ...state, longle, log, longleLog, loading: false })
@@ -89,7 +92,10 @@ const LockDetail = props => {
                 </div>
               ) : null}
               <div className="sheet-left-panel pr-4">
-                <LockForm longle={state.longle} />
+                <LockForm
+                  longle={state.longle}
+                  actionPayload={{ main: updateKey, target: dataId }}
+                />
               </div>
             </Col>
             <Col span={15} className="sheet-box-right">
@@ -97,7 +103,7 @@ const LockDetail = props => {
                 longleLog={state.longleLog}
                 longle={state.longle}
                 upgradeProduct={state.longle.product?.split('+') || []}
-                updateKey={updateKey}
+                actionPayload={{ main: updateKey, target: dataId }}
               />
               <LockLowerList log={state.log} />
             </Col>