Explorar o código

fix: 注册码和升级文件优化

outaozhen %!s(int64=5) %!d(string=hai) anos
pai
achega
67e5219332

+ 2 - 2
src/pages/Product/Lock/Lockstore/components/CopyauthorizeStr/index.jsx

@@ -3,10 +3,10 @@ import { Card, message, Tooltip } from 'antd'
 import { Copy } from '@icon-park/react'
 import { CopyToClipboard } from 'react-copy-to-clipboard'
 import styles from '@/pages/Product/Lock/LockStore/components/ChangeClient/index.less'
-import { isNullOrUnDef } from '@/utils/is'
+import { isEmpty, isNullOrUnDef } from '@/utils/is'
 
 const CopyAuthorizeStr = ({ authorizeStr }) => {
-  if (isNullOrUnDef(authorizeStr)) return null
+  if (isNullOrUnDef(authorizeStr) || isEmpty(authorizeStr)) return null
   return (
     <div className={styles.companyInput}>
       <Card size="small">

+ 3 - 2
src/pages/Product/Lock/Lockstore/components/DownUpdateFile/index.jsx

@@ -2,9 +2,10 @@ import React from 'react'
 import { Card, Tooltip } from 'antd'
 import { Download } from '@icon-park/react'
 import styles from '@/pages/Product/Lock/LockStore/components/ChangeClient/index.less'
+import { isEmpty, isNullOrUnDef } from '@/utils/is'
 
-const DownUpdateFile = props => {
-  const { updateFile } = props.dataSource
+const DownUpdateFile = ({ updateFile }) => {
+  if (isNullOrUnDef(updateFile) || isEmpty(updateFile)) return null
   const handleDownExcel = () => {
     const oa = document.createElement('a')
     oa.href = `http://cld.smartcost.com.cn/${updateFile}`

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

@@ -23,9 +23,6 @@ const LockForm = props => {
     clientId: longle.clientId,
     actionPayload: ChangeCompMap.LONGLE.key
   }
-  const downUpdateFile = {
-    updateFile: longle.updateFile
-  }
   const handleCompanyClick = () => {
     toggleDrawer()
     setDrawerProps({
@@ -98,7 +95,7 @@ const LockForm = props => {
         <Divider style={{ margin: '12px 0' }} />
         <Col span={6}>升级文件</Col>
         <Col span={18}>
-          <DownUpdateFile dataSource={downUpdateFile} />
+          <DownUpdateFile updateFile={longle.updateFile} />
         </Col>
       </Row>
     </div>