Skip to content

Commit

Permalink
chore: backup
Browse files Browse the repository at this point in the history
  • Loading branch information
rayadaschn committed Nov 2, 2023
1 parent e82266d commit 014ecd1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ antd 🔥 + 🐣 unocss + 🤺 ahooks 的问卷调查
- 新增功能:提供 Mock 数据,测试数据支持独立部署;
- 尝试 Vite + autoImport 在 React18 中的使用;
- 增加快捷键

「目标」

- [x] 首页
- [x] 登录页
- [x] 编辑页
- [ ] 统计页ing
3 changes: 2 additions & 1 deletion src/pages/NotFound/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { Button, Result } from 'antd'

const NotFound: React.FC = () => {
const nav = useNavigate()
const goIndex = () => nav(MANAGE_INDEX_PATHNAME)
return (
<>
<Result
status="404"
title="404"
subTitle="抱歉,您访问的页面不存在"
extra={
<Button type="primary" onClick={() => nav(MANAGE_INDEX_PATHNAME)}>
<Button type="primary" onClick={goIndex}>
返回首页
</Button>
}
Expand Down
13 changes: 13 additions & 0 deletions src/pages/question/stat/components/StatLoading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { FC } from 'react'
import { Spin } from 'antd'

/** 加载状态 */
const StatLoading: FC = () => {
return (
<div className="mt-15 text-center">
<Spin />
</div>
)
}

export default StatLoading
21 changes: 8 additions & 13 deletions src/pages/question/stat/index.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
import React, { FC } from 'react'
import { useGetPageInfo, useLoadQuestionData } from '@/hooks'
import { Spin } from 'antd'
import StatLoading from './components/StatLoading'
import StatUnPubulished from './components/StatUnPubulished'

const Stat: FC = () => {
const { loading, questionData } = useLoadQuestionData()
const { isPubulished } = useGetPageInfo()
const { title, isPubulished } = useGetPageInfo()

if (loading) {
return (
<div className="mt-15 text-center">
<Spin />
</div>
)
}
// 修改标题
useTitle(`问卷调查 - ${title}`)

if (isPubulished) {
return <StatUnPubulished />
}
if (loading) return <StatLoading />

if (isPubulished) return <StatUnPubulished />

return (
<div>
<p>Stat 统计调查</p>
<p>Stat</p>
<p>{JSON.stringify(questionData)}</p>
</div>
)
Expand Down

0 comments on commit 014ecd1

Please sign in to comment.