From 06189f227cbfb9e549a702d4d7020ed54f75ef56 Mon Sep 17 00:00:00 2001 From: meixinpu <3217486878@qq.com> Date: Mon, 20 Mar 2023 01:23:42 +0800 Subject: [PATCH] 3.4.v --- src/components/MyLayout.tsx | 26 ++- src/mock/Login.js | 2 +- src/views/DataStatistics/DataProfile.tsx | 2 +- src/views/DataStatistics/ResidentAge.tsx | 11 -- .../DataStatistics/ResidentEducation.tsx | 11 -- src/views/DataStatistics/ResidentLabel.tsx | 11 -- src/views/DataStatistics/ResidentSex.tsx | 11 -- src/views/DataStatistics/datapro/Allcart.tsx | 83 ++++---- src/views/Login/login.tsx | 4 +- src/views/WorkBench/WorkBench.tsx | 9 +- src/views/WorkBench/work/list.tsx | 76 +++++--- src/views/WorkBench/work/speed.tsx | 184 +++++++++--------- 12 files changed, 219 insertions(+), 211 deletions(-) delete mode 100644 src/views/DataStatistics/ResidentAge.tsx delete mode 100644 src/views/DataStatistics/ResidentEducation.tsx delete mode 100644 src/views/DataStatistics/ResidentLabel.tsx delete mode 100644 src/views/DataStatistics/ResidentSex.tsx diff --git a/src/components/MyLayout.tsx b/src/components/MyLayout.tsx index 50be3d5..f414d1c 100644 --- a/src/components/MyLayout.tsx +++ b/src/components/MyLayout.tsx @@ -1,3 +1,4 @@ +import { DownOutlined } from '@ant-design/icons'; import React, { Suspense, useState } from 'react'; import { @@ -12,7 +13,7 @@ import { MenuUnfoldOutlined, } from '@ant-design/icons'; import type { MenuProps } from 'antd'; -import { Breadcrumb, Layout, Menu, theme } from 'antd'; +import { Breadcrumb, Layout, Menu, theme, Dropdown, Space } from 'antd'; // 导入logo import logo from "../assets/logo.jpg" import { Outlet, useNavigate } from 'react-router-dom'; @@ -35,7 +36,7 @@ function getItem( } as MenuItem; } -const items: MenuItem[] = [ +const items1: MenuItem[] = [ getItem('工作台', '/MyLayout/WorkBench', ), getItem('签约管理', 'sub1', , [ getItem('待处理签约', '/MyLayout/PendingContract'), @@ -79,12 +80,19 @@ const MyLayout: React.FC = () => { // console.log(item); push(item.key) } + const items: MenuProps['items'] = [ + { + label:

{push('/Login')}}>退出登录

, + key: '0', + }, + + ]; // return (
家庭医生后台管理系统
- +
@@ -94,10 +102,16 @@ const MyLayout: React.FC = () => { onClick: () => setCollapsed(!collapsed), })} - - */}
{/* diff --git a/src/mock/Login.js b/src/mock/Login.js index a727391..4fd01b6 100644 --- a/src/mock/Login.js +++ b/src/mock/Login.js @@ -36,7 +36,7 @@ Mock.mock('/api/user/login', "post", (req) => { } ] }) - return { code: 200, msg: "登录成功", token: tokendata.tokenarr[0].token }; + return { code: 200, msg: "登录成功", token: tokendata.tokenarr[0].token,name:data.list.name }; } else { return { code: 500, msg: "用户名或密码错误" }; } diff --git a/src/views/DataStatistics/DataProfile.tsx b/src/views/DataStatistics/DataProfile.tsx index 0050397..413a2be 100644 --- a/src/views/DataStatistics/DataProfile.tsx +++ b/src/views/DataStatistics/DataProfile.tsx @@ -6,7 +6,7 @@ import Allcart from "./datapro/Allcart" return (

数据管理

- +
diff --git a/src/views/DataStatistics/ResidentAge.tsx b/src/views/DataStatistics/ResidentAge.tsx deleted file mode 100644 index 63ab97d..0000000 --- a/src/views/DataStatistics/ResidentAge.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -function ResidentAge(props: any) { - return ( -
-

居民年龄统计

-
- ); -} - -export default ResidentAge; \ No newline at end of file diff --git a/src/views/DataStatistics/ResidentEducation.tsx b/src/views/DataStatistics/ResidentEducation.tsx deleted file mode 100644 index 38b56cf..0000000 --- a/src/views/DataStatistics/ResidentEducation.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -function ResidentEducation(props: any) { - return ( -
-

居民学历统计

-
- ); -} - -export default ResidentEducation; \ No newline at end of file diff --git a/src/views/DataStatistics/ResidentLabel.tsx b/src/views/DataStatistics/ResidentLabel.tsx deleted file mode 100644 index 9fe3e4e..0000000 --- a/src/views/DataStatistics/ResidentLabel.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -function ResidentLabel(props: any) { - return ( -
-

居民标签统计

-
- ); -} - -export default ResidentLabel; \ No newline at end of file diff --git a/src/views/DataStatistics/ResidentSex.tsx b/src/views/DataStatistics/ResidentSex.tsx deleted file mode 100644 index 1fb3719..0000000 --- a/src/views/DataStatistics/ResidentSex.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -function ResidentSex(props: any) { - return ( -
-

居性别统计

-
- ); -} - -export default ResidentSex; \ No newline at end of file diff --git a/src/views/DataStatistics/datapro/Allcart.tsx b/src/views/DataStatistics/datapro/Allcart.tsx index 1ab1ba5..dfa2ba7 100644 --- a/src/views/DataStatistics/datapro/Allcart.tsx +++ b/src/views/DataStatistics/datapro/Allcart.tsx @@ -1,41 +1,42 @@ import { execFile } from 'child_process'; import * as echarts from 'echarts'; import { useEffect, useState } from 'react'; -import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons'; -import { Card, Col, Row, Statistic, Divider } from 'antd'; +// import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons'; +// import { Card, Col, Row, Statistic, Divider } from 'antd'; -import { PendingContractlist } from "../../../axios/apiY" -import service from '../../../axios/service'; +// import { PendingContractlist } from "../../../axios/apiY" +// import service from '../../../axios/service'; -import { Table } from 'antd'; +// import { Table } from 'antd'; import type { ColumnsType } from 'antd/es/table'; -import { Tabel_list } from '../../../axios/apiM' +// import { Tabel_list } from '../../../axios/apiM'/ type EChartsOption = echarts.EChartsOption; export default function Allcart() { - const [list, setlist] = useState([]) - const [list1, setlist1] = useState([]) - const [list2, setlist2] = useState([]) - const [list3, setlist3] = useState([]) - const [list4, setlist4] = useState([]) - const [list5, setlist5] = useState([]) - const [book6, setbook6] = useState([]) - const [book1, setbook1] = useState([]) - const [book2, setbook2] = useState([]) - const [book3, setbook3] = useState([]) - const [book4, setbook4] = useState([]) - const [book5, setbook5] = useState([]) - const [book7, setbook7] = useState([]) - const [book8, setbook8] = useState([]) - const [age, setage4] = useState([]) - const [age5, setage5] = useState([]) - const [age7, setage7] = useState([]) - const [age8, setage8] = useState([]) - const [sex, setsex] = useState([]) - const [sex1, setsex1] = useState([]) - + const [list, setlist] = useState() + const [list1, setlist1] = useState() + const [list2, setlist2] = useState() + const [list3, setlist3] = useState() + const [list4, setlist4] = useState() + const [list5, setlist5] = useState() + const [book6, setbook6] = useState() + const [book1, setbook1] = useState() + const [book2, setbook2] = useState() + const [book3, setbook3] = useState() + const [book4, setbook4] = useState() + const [book5, setbook5] = useState() + const [book7, setbook7] = useState() + const [book8, setbook8] = useState() + const [age, setage4] = useState() + const [age5, setage5] = useState() + const [age7, setage7] = useState() + const [age8, setage8] = useState() + const [sex, setsex] = useState() + const [sex1, setsex1] = useState() + var str1 = JSON.parse(localStorage.getItem('PendingContract')!) + var str = JSON.parse(localStorage.getItem('labeldata')!) useEffect(() => { - var str1 = JSON.parse(localStorage.getItem('PendingContract')!) + var { PendingContractl } = str1 console.log(PendingContractl); @@ -95,7 +96,7 @@ export default function Allcart() { }) - var str = JSON.parse(localStorage.getItem('labeldata')!) + var { labeldata } = str console.log(labeldata); let num = 0; @@ -104,7 +105,8 @@ export default function Allcart() { let num4 = 0; let num5 = 0; let num6 = 0; - + console.log(labeldata); + labeldata.forEach((item: any) => { if (item.tagname == "高血压") { setlist(num = num + 1) @@ -129,22 +131,21 @@ export default function Allcart() { } }) - }, []) + }, [str,str1]) setTimeout(() => { var chartDom = document.getElementById('main')!; var myChart = echarts.init(chartDom); var option: EChartsOption; const builderJson = { - all: 100, + all: list+list2+list3+list4+list5+list1, charts: { - - 多动症: list, - 慢病护理: list1, - 高血脂: list2, - 高血糖: list3, - 冠心病: list4, - 高血压: list5, + 多动症: list5, + 慢病护理: list4, + 高血脂: list3, + 高血糖: list2, + 冠心病: list1, + 高血压: list, } as Record, components: { 基础包1: book1, @@ -432,10 +433,10 @@ const App: React.FC = () => { marginTop: 30, boxShadow: '2px 2px 5px 2px rgb(205, 203, 203)' }}> -

本周签约概况

+ {/*

本周签约概况

record.id} /> + }} columns={columns} dataSource={data} rowKey={record => record.id} /> */} diff --git a/src/views/Login/login.tsx b/src/views/Login/login.tsx index 187437b..854069d 100644 --- a/src/views/Login/login.tsx +++ b/src/views/Login/login.tsx @@ -16,7 +16,9 @@ export default function User() { type: 'success', content: '登录成功', }); - push('/MyLayout/WorkBench') + console.log(res.data.name); + + push({ pathname: '/MyLayout/WorkBench',search:`?data=${res.data.name}`}) } else { diff --git a/src/views/WorkBench/WorkBench.tsx b/src/views/WorkBench/WorkBench.tsx index 4e4572d..890b8e3 100644 --- a/src/views/WorkBench/WorkBench.tsx +++ b/src/views/WorkBench/WorkBench.tsx @@ -1,5 +1,5 @@ import React from 'react'; - +import { useSearchParams } from 'react-router-dom'; import HomeList from './work/homelist' // import Home from "./work/homepage" import Card from './work/carts' @@ -8,11 +8,16 @@ import Card from './work/carts' import './style.css' import Speed from './work/speed' import Table from './work/table' + function WorkBench(props: any) { + var [params,setParams]=useSearchParams() + const name = params.get('data') + console.log(name); + return (
-

欢迎你{ }

+

欢迎你{name }

diff --git a/src/views/WorkBench/work/list.tsx b/src/views/WorkBench/work/list.tsx index 9ef789c..9445a4d 100644 --- a/src/views/WorkBench/work/list.tsx +++ b/src/views/WorkBench/work/list.tsx @@ -1,5 +1,10 @@ -import React from 'react'; +// import React from 'react'; import { Divider, List, Typography } from 'antd'; +import React, { Component } from 'react' +import { useNavigate } from 'react-router-dom'; + + + const data = [ { @@ -26,28 +31,47 @@ const data = [ ]; -const App: React.FC = () => ( - <> - 代办提醒
} - - bordered={false} - size='large' - dataSource={data} - renderItem={(item) => ( - - {item.num} -
- {item.text} -
- )} - /> - - -); - -export default App; \ No newline at end of file + + + +export default function list() { + const push=useNavigate() + const change = (item:any) => { + if (item.text == '待审核签约申请') { + push('/MyLayout/PendingContract') + } + else if (item.text == '待审核服务申请') { + push('/MyLayout/PendingService') + } else if (item.text == '待完成服务') { + push('/MyLayout/ServiceRecord') + } else if (item.text == '待处理续约') { + push('/MyLayout/SigningRecord') + } + } + return ( +
+ <> + 代办提醒
} + + bordered={false} + size='large' + dataSource={data} + renderItem={(item) => ( + change(item)}> + {item.num} +
+

{item.text}

+
+ )} + /> + + + + ) +} + diff --git a/src/views/WorkBench/work/speed.tsx b/src/views/WorkBench/work/speed.tsx index f9a183c..e9c1a86 100644 --- a/src/views/WorkBench/work/speed.tsx +++ b/src/views/WorkBench/work/speed.tsx @@ -1,97 +1,103 @@ import React from 'react'; import { Progress } from 'antd'; -// import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'; +import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'; import { Avatar, Card } from 'antd'; // import { Label_list } from '../../../axios/api' const { Meta } = Card; // const [data, setData] = useState([]) -const App: React.FC = () => ( - - - <> - -
-
-

高血压

- -

冠心病

- -

高血糖

- -

高血脂

- -

慢病护理

- -

多动症

- - -
- -
- - -
-

居民指标异常

-
- - } - - > - } - title="Card title" - description="This is the description" - /> - - } - - > - } - title="Card title" - description="This is the description" - /> - - } - - > - } - title="Card title" - description="This is the description" - /> - -
- -
- - -); -export default App; \ No newline at end of file + + + +export default function speed() { + + + return ( + <> + +
+
+

高血压

+ +

冠心病

+ +

高血糖

+ +

高血脂

+ +

慢病护理

+ +

多动症

+ + +
+ +
+ + +
+

居民指标异常

+
+ + } + + > + } + title="王冉" + description="高血压" + /> + + } + + > + } + title="孙秀英" + description="冠心病" + /> + + } + + + > + } + title="高霞" + description="高血糖" + + /> + +
+ +
+ + ) +} + -- Gitee