From 6bf92751fe8dfa0624285268968a1fd7a8a7e7e5 Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Tue, 20 Oct 2020 14:39:49 +0800
Subject: [PATCH] 修改默认人员头像

---
 src/components/oa/basicConfig/UserManage.jsx |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/src/components/oa/basicConfig/UserManage.jsx b/src/components/oa/basicConfig/UserManage.jsx
index 8f49e23..7ed59ee 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) => {
@@ -90,7 +90,7 @@
   renderColumns = () => {
     let obj = this;
     return [
-      { title: '头像', className: "txt-c", dataIndex: 'avatar', key: 'avatar', render: (text, record) => text ? <img style={{ height: 23, width: 25 }} src={text} /> : <Icon type="user-delete" style={{ fontSize: 20 }} /> },
+      { title: '头像', className: "txt-c", dataIndex: 'avatar', key: 'avatar', render: (text, record) => text ? <img style={{ height: 23, width: 25 }} src={text} /> : <Icon type="user" style={{ fontSize: 20 }} /> },
       { title: '姓名', className: "txt-c", dataIndex: 'trueName', key: 'trueName' },
       { title: '身份证', className: "txt-c", dataIndex: 'idcard', key: 'idcard' },
       { title: '邮箱', className: "txt-c", dataIndex: 'email', key: 'email' },
@@ -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("删除成功")

--
Gitblit v1.8.0