From 8f38b4d371d0e8759985e2f4994d48b4a299d6a3 Mon Sep 17 00:00:00 2001 From: Mr Ke <kelq@hugeinfo.com.cn> Date: Tue, 20 Oct 2020 09:53:07 +0800 Subject: [PATCH] 修改查看用户详情页面为空,不能删除用户问题,解决新增用户按钮事件失效 --- src/module/huge-base/JobManage.jsx | 4 +- src/components/oa/basicConfig/UserManage.jsx | 25 ++++++++++-- src/routeDom/routeDom.jsx | 35 +++++++++-------- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/src/components/oa/basicConfig/UserManage.jsx b/src/components/oa/basicConfig/UserManage.jsx index 8f49e23..f26d5f8 100644 --- a/src/components/oa/basicConfig/UserManage.jsx +++ b/src/components/oa/basicConfig/UserManage.jsx @@ -58,12 +58,12 @@ { type: 'input', name: '手机号码', label: '手机号码', key: 'mobile' }, { type: 'input', name: '电子邮箱', label: '电子邮箱', key: 'email' }, ]} /> - <Row type="flex" gutter={20} className="margin-bottom"> + <Row type="flex" gutter={20} className="margin-bottom"> <Col> <Button type="primary">同步微信用户</Button> </Col> <Col> - <Button type="primary">新增用户</Button> + <Button type="primary" onClick={this.add}>新增用户</Button> </Col> </Row> <TableView {...tableParams} /> @@ -73,7 +73,7 @@ // 新增用户 add = () => { - this.props.history.push('/baseManage/userDetail/new/Add') + this.props.history.push('/baseManage/user/Detail/new/Add') } // 删除用户 onDel = (_text, _record) => { @@ -99,7 +99,7 @@ { title: '操作', className: "txt-c", key: 'operation', render: (text, record) => { return <div> - <Link to={{ pathname: "/baseManage/userDetail/" + record.id + '/Modify', query: { id: record.id } }}>修改</Link> + <Link to={{ pathname: "/baseManage/user/Detail/" + record.id + '/Modify', query: { id: record.id } }}>修改</Link> <Divider type="vertical" /> <a onClick={() => this.delete(record.id)}>删除</a> </div> @@ -109,9 +109,26 @@ } delete = (id) => { let _this = this; + let { formData } = _this.state; confirm({ title: <span style={{ fontSize: 19 }}>确定要删除该用户吗?</span>, onOk() { + fetch({ + url: 'api/user/delete', + params: { + ids: id + } + }).then(res => { + if (res) { + message.success("删除成功"); + _this.setState({ + formData: { + ...formData, + __key: Date.now(), + } + }) + } + }) // Fetch.userDel({ ids: id }).then(res => { // if (res.code == 0) { // message.success("删除成功") diff --git a/src/module/huge-base/JobManage.jsx b/src/module/huge-base/JobManage.jsx index dd1b5c5..cfc0f17 100644 --- a/src/module/huge-base/JobManage.jsx +++ b/src/module/huge-base/JobManage.jsx @@ -453,7 +453,7 @@ posts && posts.length > 0 ? posts.map((p, posIndex) => ( <Card.Grid style={gridStyle} hoverable={false} key={p.id}> <Row type="flex" gutter={10}> - <Col> + <Col style={{ height: 22 }}> {/* 岗位名(编辑,删除) */} <Dropdown overlay={<Menu> <Menu.Item key="1" onClick={() => this.modifyFun(p)}>编辑岗位</Menu.Item> @@ -463,7 +463,7 @@ </Dropdown> </Col> {p.userTrueName && - <Col> + <Col style={{ height: 22 }}> <Dropdown overlay={<Menu> <Menu.Item key="1" onClick={() => this.setCG({ ...p, deptIndex, posIndex })}>撤岗</Menu.Item> </Menu>} trigger={['contextMenu']}> diff --git a/src/routeDom/routeDom.jsx b/src/routeDom/routeDom.jsx index 19933e0..83a7634 100644 --- a/src/routeDom/routeDom.jsx +++ b/src/routeDom/routeDom.jsx @@ -51,7 +51,6 @@ return ( <Switch> - <Route path="/document/create/:id?" component={DocumentEdit} /> <Route path="/document/detail/:id" component={DocumentDetail} /> <Route path="/index/workbench/announcement" component={Announcement} /> @@ -69,26 +68,28 @@ { renderUser && <React.Fragment> - <Route path="/baseManage/user/Detail/:id/:flag" component={UserDetail} /> - <Route path="/baseManage/user" component={UserManage} /> - <Route path="/baseManage/group/Detail/:id/:flag" component={GroupDetail} /> - <Route path="/baseManage/group" component={GroupManage} /> - <Route path="/organizationMgt/unit" component={UnitManage} /> - <Route path="/organizationMgt/department" component={DepartmentManage} /> - <Route path="/organizationMgt/job" component={JobManage} /> - <Route path="/resourceMgt/appService/Detail/:id/:flag" component={AppServiceDetail} /> - <Route path="/resourceMgt/appService" component={AppServiceManage} /> - <Route path="/resourceMgt/modules" component={ModulesManage} /> - <Route path="/resourceMgt/function" component={FunctionManage} /> - <Route path="/organizationMgt/role/Detail/:id/:flag" component={RoleDetail} /> - <Route path="/authorityMgt/role" component={RoleManage} /> - <Route path="/authorityMgt/authority" component={AuthorityManage} /> - <Redirect from='/' to="/baseManage/user" component={UserManage} /> + <Switch> + <Route path="/baseManage/user/Detail/:id/:flag" component={UserDetail} /> + <Route path="/baseManage/user" component={UserManage} /> + <Route path="/baseManage/group/Detail/:id/:flag" component={GroupDetail} /> + <Route path="/baseManage/group" component={GroupManage} /> + <Route path="/organizationMgt/unit" component={UnitManage} /> + <Route path="/organizationMgt/department" component={DepartmentManage} /> + <Route path="/organizationMgt/job" component={JobManage} /> + <Route path="/resourceMgt/appService/Detail/:id/:flag" component={AppServiceDetail} /> + <Route path="/resourceMgt/appService" component={AppServiceManage} /> + <Route path="/resourceMgt/modules" component={ModulesManage} /> + <Route path="/resourceMgt/function" component={FunctionManage} /> + <Route path="/organizationMgt/role/Detail/:id/:flag" component={RoleDetail} /> + <Route path="/authorityMgt/role" component={RoleManage} /> + <Route path="/authorityMgt/authority" component={AuthorityManage} /> + <Redirect from='/' to="/baseManage/user" component={UserManage} /> + </Switch> </React.Fragment> } <div> - + </div> <Route path="/" component={Workbench} /> -- Gitblit v1.8.0