张延森 3 years ago
parent
commit
ead69d7a23

BIN
public/yz_logo.png View File


+ 3
- 3
src/components/TableList/TableList.jsx View File

@@ -4,7 +4,7 @@ import Styles from './style.less'
4 4
 
5 5
 const Actions = (props) => {
6 6
   const style = {
7
-    marginBottom: '1em'
7
+    padding: '1em',
8 8
   }
9 9
 
10 10
   return (
@@ -15,7 +15,7 @@ const Actions = (props) => {
15 15
 }
16 16
 
17 17
 export default (props) => {
18
-  const { actions, ...leftProps } = props
18
+  const { actionRender, ...leftProps } = props
19 19
 
20 20
   const tableProps = {
21 21
     ...leftProps,
@@ -24,7 +24,7 @@ export default (props) => {
24 24
   
25 25
   return (
26 26
     <div className={Styles['box-wrapper']}>
27
-      {actions && <Actions>{actions}</Actions>}
27
+      {typeof actionRender === 'function' && <Actions>{actionRender()}</Actions>}
28 28
       <Table {...tableProps} />
29 29
     </div>
30 30
   )

+ 6
- 1
src/pages/building/List/index.jsx View File

@@ -1,6 +1,6 @@
1 1
 import React, { useMemo, useRef, useCallback, useState } from 'react'
2 2
 // import { PageHeaderWrapper } from '@ant-design/pro-layout'
3
-import { notification, Spin } from 'antd'
3
+import { Button, notification, Spin } from 'antd'
4 4
 import QueryTable from '@/components/QueryTable'
5 5
 import request from '@/utils/request'
6 6
 import apis from '@/services/apis'
@@ -44,6 +44,10 @@ export default (props) => {
44 44
     })
45 45
   }, [page])
46 46
 
47
+  const actionRender = () => {
48
+    return <Button type="primary" icon="plus">新增</Button>
49
+  }
50
+
47 51
   return (
48 52
     // <PageHeaderWrapper>
49 53
       <Spin spinning={loading}>
@@ -53,6 +57,7 @@ export default (props) => {
53 57
           api={apis.building.getList}
54 58
           searchFields={searchFields}
55 59
           columns={tableColumns}
60
+          actionRender={actionRender}
56 61
           onPageChange={(pg) => setPage(pg)}
57 62
         />
58 63
       </Spin>

+ 3
- 3
src/pages/document.ejs View File

@@ -170,7 +170,7 @@
170 170
       <div
171 171
         style="display: flex;justify-content: center;align-items: center;flex-direction: column;min-height: 420px;height: 100%;"
172 172
       >
173
-        <img src="/pro_icon.svg" alt="logo" width="256" />
173
+        <!-- <img src="/pro_icon.svg" alt="logo" width="256" /> -->
174 174
         <div class="page-loading-warp">
175 175
           <div class="ant-spin ant-spin-lg ant-spin-spinning">
176 176
             <span class="ant-spin-dot ant-spin-dot-spin"
@@ -181,11 +181,11 @@
181 181
         </div>
182 182
         <div style="display: flex;justify-content: center;align-items: center;">
183 183
           <img
184
-            src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
184
+            src="./yz_logo.png"
185 185
             width="32"
186 186
             style="margin-right: 8px;"
187 187
           />
188
-          Ant Design
188
+          南京 云致
189 189
         </div>
190 190
       </div>
191 191
     </div>