-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
202 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import mockjs from 'mockjs'; | ||
import { delay } from 'roadhog-api-doc'; | ||
|
||
const proxy = { | ||
'/todayList': { | ||
code: 0, | ||
data: { | ||
total: 4, | ||
list: [ | ||
{ | ||
key: '1', | ||
name: 'John Brown', | ||
date: 32, | ||
remark: 'New York No. 1 Lake Park', | ||
}, | ||
{ | ||
key: '2', | ||
name: 'Joe Black', | ||
date: 42, | ||
remark: 'London No. 1 Lake Park', | ||
}, | ||
{ | ||
key: '3', | ||
name: 'Jim Green', | ||
date: 32, | ||
remark: 'Sidney No. 1 Lake Park', | ||
}, | ||
{ | ||
key: '4', | ||
name: 'Jim Red', | ||
date: 32, | ||
remark: 'London No. 2 Lake Park', | ||
}, | ||
{ | ||
key: '5', | ||
name: 'Jim Red xh', | ||
date: 32, | ||
remark: 'London No. 2 Lake Park', | ||
}, | ||
{ | ||
key: '6', | ||
name: 'xim Red ', | ||
date: 32, | ||
remark: 'London No. 2 Lake Park', | ||
}, | ||
], | ||
}, | ||
}, | ||
}; | ||
|
||
export default delay(proxy, 500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
:root { | ||
--main-bg-color: #f6f7f9;; | ||
--main-color: #1d6efe; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.ScheduleIndex { | ||
display: flex; | ||
min-height: 100vh; | ||
.todaySchedule { | ||
width: 60%; | ||
// h3 { | ||
// text-align: center; | ||
// color: var(--main-color); | ||
// } | ||
} | ||
.otherSchedule { | ||
width: 40%; | ||
h3 { | ||
text-align: center; | ||
color: var(--main-color); | ||
} | ||
.outDateSchedule { | ||
height: 50%; | ||
} | ||
.tomorrowSchedule { | ||
height: 50%; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
// 大盘数据 | ||
import React, { useEffect, useState } from 'react'; | ||
// 页面组件上的 getInitialProps 静态方法,执行后将结果注入到该页面组件的 props 中 | ||
import { IGetInitialProps, history } from 'umi'; | ||
import { Card, Table } from 'antd'; | ||
import { ColumnsType } from 'antd/lib/table'; | ||
import styles from './index.less'; | ||
|
||
interface Iprops { | ||
data: { | ||
title: string; | ||
}; | ||
} | ||
const goList = () => { | ||
history.push('/dayList'); | ||
}; | ||
const data = [ | ||
{ | ||
key: '1', | ||
name: 'John Brown', | ||
date: 32, | ||
remark: 'New York No. 1 Lake Park', | ||
}, | ||
{ | ||
key: '2', | ||
name: 'Joe Black', | ||
date: 42, | ||
remark: 'London No. 1 Lake Park', | ||
}, | ||
{ | ||
key: '3', | ||
name: 'Jim Green', | ||
date: 32, | ||
remark: 'Sidney No. 1 Lake Park', | ||
}, | ||
{ | ||
key: '4', | ||
name: 'Jim Red', | ||
date: 32, | ||
remark: 'London No. 2 Lake Park', | ||
}, | ||
]; | ||
const columns: ColumnsType<object> = [ | ||
{ | ||
title: '名称', | ||
dataIndex: 'name', | ||
key: 'name', | ||
width: '20%', | ||
}, | ||
{ | ||
title: '日期', | ||
dataIndex: 'date', | ||
key: 'date', | ||
width: '20%', | ||
}, | ||
{ | ||
title: '备注', | ||
dataIndex: 'remark', | ||
key: 'remark', | ||
width: '60%', | ||
}, | ||
]; | ||
function IndexPage(props: Iprops) { | ||
// const { data } = props; | ||
// console.log(props, data); // data 没有值 | ||
return ( | ||
<div className={styles.ScheduleIndex}> | ||
<div className={styles.todaySchedule}> | ||
<Card title="今日任务"> | ||
<Table columns={columns} dataSource={data} />; | ||
</Card> | ||
</div> | ||
<div className={styles.otherSchedule}> | ||
<div className={styles.outDateSchedule}> | ||
<Card title="过期任务"> | ||
<ul></ul> | ||
</Card> | ||
</div> | ||
<div className={styles.tomorrowSchedule}> | ||
<Card title="明日任务"> | ||
<ul></ul> | ||
</Card> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
IndexPage.getInitialProps = (async (ctx) => { | ||
console.log(ctx, 1234); // 此方法没有执行 | ||
return new Promise((resolve, reject) => { | ||
setTimeout(() => { | ||
resolve({ | ||
data: { | ||
todayList: 'Hello World', | ||
outDateList: '', | ||
tomorrowList: '', | ||
}, | ||
}); | ||
}, 300); | ||
}); | ||
}) as IGetInitialProps; | ||
|
||
export default IndexPage; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.