From 4313849f97a185b9073a0a482c91c8b3f87d6088 Mon Sep 17 00:00:00 2001 From: meixinpu <3217486878@qq.com> Date: Sat, 18 Mar 2023 18:04:24 +0800 Subject: [PATCH] 3.18.3.v --- src/mock/Mzmock.js | 15 +- .../index.tsx | 5 + src/views/Login/login.tsx | 13 +- src/views/Resident/operate/Add.tsx | 4 +- src/views/Resident/operate/detail.tsx | 174 +++++++----------- src/views/Resident/operate/revise.tsx | 9 +- src/views/Resident/search/Form.tsx | 7 +- 7 files changed, 100 insertions(+), 127 deletions(-) diff --git a/src/mock/Mzmock.js b/src/mock/Mzmock.js index 52505a9..de4382f 100644 --- a/src/mock/Mzmock.js +++ b/src/mock/Mzmock.js @@ -43,7 +43,19 @@ if (localStorage.getItem("babledata")) { 'car|620000000000000000-620999999999999999': 1, state: "@pick(['签约中','待签约','已签约'])", states: "@pick(['高血压','冠心病','高血糖'])", - status: "@boolean" + status: "@boolean", + sex: "@pick(['男','女'])", + 'age|18-70': 1, + '现居地': "@pick(['河南省南阳市','陕西省西安市','江苏省苏州市','甘肃省兰州市'])", + jigou: "@pick(['罗西社区服务中心','天明社区服务中心','民进社区服务中心'])", + team: "@pick(['李军团队','汪小敏团队','李明团队'])", + time: "@pick(['2020/10/09 10:00','2021/3/13 7:00','2023/1/20 23:00'])", + type: "@pick(['首次签约','第二次签约'])", + doctor: "@pick(['李军','汪小敏','李明'])", + service: "@pick(['基础包1','老年人服务包','慢性病护理包','基础包2','基础包3','基础包4','儿童护理包','高级特需包'])", + money: "@pick(['120元','240元'])", + zhouqi: "@pick(['一年','两年'])", + }] }) localStorage.setItem('babledata', JSON.stringify(BableData)) @@ -51,6 +63,7 @@ if (localStorage.getItem("babledata")) { Mock.mock('/api/from/list', 'get', () => { return BableData }) + //获取用户列表 Mock.mock('/api/from/getlist', 'post', (req) => { var { key } = JSON.parse(req.body) diff --git a/src/routers/WorkBench-Resident-DataStatistics/index.tsx b/src/routers/WorkBench-Resident-DataStatistics/index.tsx index a0e00f7..d7e2002 100644 --- a/src/routers/WorkBench-Resident-DataStatistics/index.tsx +++ b/src/routers/WorkBench-Resident-DataStatistics/index.tsx @@ -12,6 +12,7 @@ const PersonalData = lazy(() => import('../../views/WorkBench/PersonalData')) const ResidentManagement = lazy(() => import('../../views/Resident/ResidentManagement')) const Addlist = lazy(() => import('../../views/Resident/operate/Add')) const Revise = lazy(() => import('../../views/Resident/operate/revise')) +const Detail =lazy(()=>import('../../views/Resident/operate/detail')) // 数据统计 @@ -46,6 +47,10 @@ export default [ path: '/MyLayout/Revise', element: }, + { + path: '/MyLayout/detail', + element: + }, diff --git a/src/views/Login/login.tsx b/src/views/Login/login.tsx index e87f9d6..808563c 100644 --- a/src/views/Login/login.tsx +++ b/src/views/Login/login.tsx @@ -6,22 +6,19 @@ import './login.scss' export default function User() { - const [messageApi, contextHolder] = message.useMessage(); const push = useNavigate(); const onFinish = (values: any) => { - console.log(values); - Login({ ...values }).then((res) => { console.log(res.data); if (res.data.code == 200) { - messageApi.open({ + message.open({ type: 'success', content: '登录成功', }); push('/MyLayout/WorkBench') } else { - messageApi.open({ + message.open({ type: 'error', content: '账户名或者密码错误', }); @@ -33,7 +30,7 @@ export default function User() { return (
- {contextHolder} +

家庭医生后台管理系统

@@ -54,14 +51,14 @@ export default function User() {

欢迎登陆

diff --git a/src/views/Resident/operate/Add.tsx b/src/views/Resident/operate/Add.tsx index 960b754..83649c6 100644 --- a/src/views/Resident/operate/Add.tsx +++ b/src/views/Resident/operate/Add.tsx @@ -72,9 +72,9 @@ function Add(props: Props) { return (
-

新增机构信息

+

新增居民信息

-

机构信息

+

居民信息

<>
(null) - const params = useParams() - console.log('params', params) + const [person, setperson] = useState() + // 传id从发请求找到对应的数据 useEffect(() => { - seekPendingContract({ id: params.value }).then(res => { - console.log(res.data.seekPendingContractlist); - form.setFieldsValue(res.data.seekPendingContractlist) + getBable_list({key:val}).then(res => { + setperson(res.data.babledata) + console.log(res.data.babledata); }) }, []) - const layout = { - wrapperCol: { span: 16 }, - }; + + const set = (val:any) => { + + console.log(React); + + push({ pathname: '/MyLayout/Revise', search: `?data=${val}` }) + } +console.log(person); - const onFinish = (values: any) => { - console.log(values); - }; return (
-

编辑签约信息

+

签约详情

+
+ {person?.state } +

居民信息

- - - - - - - - - - - - - - - - - - - -
-

签约信息

+
+
姓名:

{person?.name}

+
身份证号:

{person?.car}

+
性别:

{person?.sex}

+
年龄:

{person?.age}

+
联系电话:

{person?.phone}

+
现居地:

{person?.现居地}

+
病例:

{person?.states}

- - {params.value}         - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
- +
+
+
+

服务信息

+
+
签约编号:

{person?.key}

+
签约状态:

{person?.state}

+
签约机构:

{person?.jigou}

+
签约团队:

{person?.team}

+
签约医生:

{person?.doctor}

+
服务包:

{person?.service}

+
签约周期:

{person?.zhouqi}

+
费用:

{person?.money}

+
签约类型:

{person?.type}

+
申请时间:

{person?.time}

+
失效时间:

{person?.time}

+
服务备注:

+
+
+
+ + +
-
); } -export default Edit; \ No newline at end of file +export default Conent; \ No newline at end of file diff --git a/src/views/Resident/operate/revise.tsx b/src/views/Resident/operate/revise.tsx index 3094e7b..ecba63f 100644 --- a/src/views/Resident/operate/revise.tsx +++ b/src/views/Resident/operate/revise.tsx @@ -4,6 +4,7 @@ import { PlusOutlined } from '@ant-design/icons'; import { useLocation, useNavigate, useSearchParams } from 'react-router-dom'; import { FormInstance } from 'antd/es/form/Form'; import { getBable_list, editBable_list } from '../../../axios/apiM'; +import '../style.scss' interface Props { } @@ -67,9 +68,11 @@ function Edit(props: Props) { return (
-

编辑机构信息

-
-

机构信息

+

编辑居民信息

+
+

居民信息

<>
{ const add = () => { push('/MyLayout/Addlist') } + const get = (val: React.Key) => { + console.log(val); + + push({ pathname:'/MyLayout/detail',search:`?data=${val}`}) + } const onSearch = (value: string) => { console.log(value); @@ -120,7 +125,7 @@ const App: React.FC = () => { align: 'center', render: (_, record: any) => <> - + get(record.key)}>查看详情    set(record.key)}>编辑    del(record.id)} > 删除 -- Gitee