From 09065383c1483c7f2e1da4d6ecd9b7a974040c86 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Sun, 25 Apr 2021 17:38:47 +0800
Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E7=A7=BB=E9=A1=B9=E7=9B=AE-=E5=89=8D?=
=?UTF-8?q?=E7=AB=AF=E9=A1=B5=E9=9D=A2=E5=B7=B2=E7=94=BB=E5=AE=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Component/EAccount.scss | 4 +-
src/forge/Divert/DivertModal.jsx | 96 +++++++++++++++++++++++++++++++
src/forge/Divert/Index.scss | 12 ++++
src/forge/Notice/Index.jsx | 58 +++++++++++++++++++
src/forge/Notice/Index.scss | 36 ++++++++++++
src/forge/Notice/Notify.jsx | 64 +++++++++++++++++++++
src/forge/Notice/UndoEvent.jsx | 81 ++++++++++++++++++++++++++
src/forge/Settings/Setting.js | 31 +++++++++-
src/forge/users/Infos.js | 60 ++++++++++---------
src/forge/users/undo_events.js | 16 ------
10 files changed, 411 insertions(+), 47 deletions(-)
create mode 100644 src/forge/Divert/DivertModal.jsx
create mode 100644 src/forge/Divert/Index.scss
create mode 100644 src/forge/Notice/Index.jsx
create mode 100644 src/forge/Notice/Index.scss
create mode 100644 src/forge/Notice/Notify.jsx
create mode 100644 src/forge/Notice/UndoEvent.jsx
delete mode 100644 src/forge/users/undo_events.js
diff --git a/src/forge/Component/EAccount.scss b/src/forge/Component/EAccount.scss
index 6f0bb97f..4bcd6b91 100644
--- a/src/forge/Component/EAccount.scss
+++ b/src/forge/Component/EAccount.scss
@@ -1,8 +1,8 @@
.ant-modal-mask{
- z-index: 10000;
+ z-index: 1001;
}
.ant-modal-wrap{
- z-index: 10001;
+ z-index: 1002;
.ant-form-explain{
position: absolute;
}
diff --git a/src/forge/Divert/DivertModal.jsx b/src/forge/Divert/DivertModal.jsx
new file mode 100644
index 00000000..914f92f2
--- /dev/null
+++ b/src/forge/Divert/DivertModal.jsx
@@ -0,0 +1,96 @@
+import React ,{ forwardRef, useEffect, useState } from 'react';
+import { Modal , Form , Input , Radio , Select } from 'antd';
+import './Index.scss';
+
+const { Option } = Select;
+function DivertModal({form , visible , onSuccess , onCancel}){
+ const { getFieldDecorator, validateFields , setFieldsValue } = form;
+ const [ cate , setCate ] = useState(0);
+
+ useEffect(()=>{
+ setFieldsValue({goal:cate})
+ },[])
+
+ function onOk(){
+ validateFields((error,values)=>{
+ if(!error){
+ onSuccess();
+ }
+ })
+
+ }
+ function changeType(e){
+ setCate(e.target.value);
+ }
+ const layout = {
+ labelCol: { span: 5 },
+ wrapperCol: { span: 18 },
+ };
+ return(
+
+
+ {
+ cate === 0 ?
+
+ - 转移需对方确认接受,转移成功后你将被移出仓库,其他已有成员权限不变
+ - 转移成功后,仓库的地址将变更至目标用户的命名空间下
+ - 已有成员如需继续操作仓库,需更新本地仓库的remote,使之指向新的地址
+
+ :
+
+ - 仓库仅可以转移到您已经加入的组织中,不可以转移到未加入的组织中
+ - 涉及到仓库改名操作,请提前做好仓库备份并且在转移后对本地仓库的remote进行修改
+ - 转移仓库到组织后,你和组织创建者/管理员同时拥有对该仓库的管理操作
+
+ }
+
+ {getFieldDecorator("goal",{
+ rules:[]
+ })(
+
+ 个人
+ 组织
+
+ )}
+
+
+ {getFieldDecorator("username",{
+ rules:[{required:true,message:"请输入目标用户名"}]
+ })(
+
+ )}
+
+
+ {getFieldDecorator("identitfy",
+ {rules:[{required:true,message:"请输入目标组织"}]}
+ )(
+
+ )}
+
+
+ {getFieldDecorator("username",
+ {rules:[{required:true,message:"请输入仓库标识"}]}
+ )(
+
+ )}
+
+
+
+
+ )
+}
+export default Form.create()(forwardRef(DivertModal));
\ No newline at end of file
diff --git a/src/forge/Divert/Index.scss b/src/forge/Divert/Index.scss
new file mode 100644
index 00000000..0a39e4e2
--- /dev/null
+++ b/src/forge/Divert/Index.scss
@@ -0,0 +1,12 @@
+.diverModal{
+ .descUl{
+ background-color: #fffae6;
+ border-radius: 4px;
+ padding:10px 15px;
+ color: #efc16b;
+ border:1px solid #efc16b;
+ }
+ .ant-form-item-required::before{
+ content: "";
+ }
+}
\ No newline at end of file
diff --git a/src/forge/Notice/Index.jsx b/src/forge/Notice/Index.jsx
new file mode 100644
index 00000000..8135c72f
--- /dev/null
+++ b/src/forge/Notice/Index.jsx
@@ -0,0 +1,58 @@
+import React, { useEffect, useState } from "react";
+import { Menu } from 'antd';
+import { Link } from 'react-router-dom';
+import './Index.scss';
+
+import Loadable from "react-loadable";
+import Loading from "../../Loading";
+import { Route, Switch } from "react-router-dom";
+
+const Notify = Loadable({
+ loader: () => import("./Notify"),
+ loading: Loading,
+});
+const UndoEvent = Loadable({
+ loader: () => import("./UndoEvent"),
+ loading: Loading,
+});
+function Index(props){
+ const username = props.match.params.username;
+ const pathname = props.history.location.pathname;
+ const [ menu , setMenu ] = useState("notify");
+
+ useEffect(()=>{
+ if(pathname && username){
+ if(pathname === `/users/${username}/notice`){
+ setMenu("notify");
+ }
+ if(pathname === `/users/${username}/notice/undo`){
+ setMenu("undo");
+ }
+ }
+ },[pathname])
+
+
+ return (
+
+
+
+ {
+ return ;
+ }}
+ >
+ {
+ return ;
+ }}
+ >
+
+
+ );
+}
+export default Index;
diff --git a/src/forge/Notice/Index.scss b/src/forge/Notice/Index.scss
new file mode 100644
index 00000000..ccce3398
--- /dev/null
+++ b/src/forge/Notice/Index.scss
@@ -0,0 +1,36 @@
+.noticeMenu{
+ .ant-menu-item{
+ font-size: 16px;
+ padding:0px;
+ margin:0px 20px!important;
+ height: 54px;
+ line-height: 54px;
+ }
+}
+.notifyList{
+ padding:0px 20px;
+ min-height: 400px;
+ li{
+ display: flex;
+ border-bottom: 1px solid #eee;
+ padding:20px 0px;
+ .notifyImg{
+ width: 48px;
+ height: 48px;
+ border-radius: 50%;
+ margin-right: 15px;
+ }
+ .notifyFlex{
+ flex:1;
+ p{
+ margin:0px;
+ }
+ .notifyInfos{
+ margin-bottom: 8px;
+ }
+ }
+ &:last-child{
+ border-bottom: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/forge/Notice/Notify.jsx b/src/forge/Notice/Notify.jsx
new file mode 100644
index 00000000..2b5b71dc
--- /dev/null
+++ b/src/forge/Notice/Notify.jsx
@@ -0,0 +1,64 @@
+import React, { useEffect, useState } from "react";
+import Nodata from '../Nodata';
+import { Skeleton , Pagination } from 'antd';
+import { Link } from 'react-router-dom';
+import { getImageUrl } from 'educoder';
+
+let l= [
+ {
+ name:"创新使者",image_url:"system/lets/letter_avatars/2/D/169_162_140/120.png",
+ type:"moving",time:"几分钟前",login:"innov"
+ },
+ {
+ name:"创新使者",image_url:"system/lets/letter_avatars/2/D/169_162_140/120.png",
+ type:"moving",time:"几分钟前",login:"innov"
+ }
+]
+const limit = 15;
+function Notify(props){
+ const [ list , setList ] = useState(undefined);
+ const [ page , setPage ] = useState(1);
+ const [ total , setTotal ] = useState(0);
+
+ useEffect(()=>{
+ setList(l);
+ },[])
+
+ return(
+
+ {
+ list && list.length > 0 ?
+
+
+ {
+ list.map((i,k)=>{
+ return(
+ -
+
+
+
+ {i.name}
+ {i.time}
+
+
正在将仓库转移给【某某某】
+
+
+ )
+ })
+ }
+
+
+ :
+
+ }
+ {list && list.length === 0 &&
}
+ {
+ total > limit &&
+
+ }
+
+ )
+}
+export default Notify;
\ No newline at end of file
diff --git a/src/forge/Notice/UndoEvent.jsx b/src/forge/Notice/UndoEvent.jsx
new file mode 100644
index 00000000..9bb7b972
--- /dev/null
+++ b/src/forge/Notice/UndoEvent.jsx
@@ -0,0 +1,81 @@
+import React, { useEffect, useState } from "react";
+import Nodata from '../Nodata';
+import { FlexAJ } from '../Component/layout';
+import { Skeleton , Pagination } from 'antd';
+import { Link } from 'react-router-dom';
+import { getImageUrl } from 'educoder';
+
+let l= [
+ {
+ name:"创新使者",image_url:"system/lets/letter_avatars/2/D/169_162_140/120.png",
+ type:"moving",time:"几分钟前",login:"innov"
+ },
+ {
+ name:"创新使者",image_url:"system/lets/letter_avatars/2/D/169_162_140/120.png",
+ type:"moving",time:"几分钟前",login:"innov"
+ }
+]
+const limit = 15;
+function UndoEvent(props){
+ const [ list , setList ] = useState(undefined);
+ const [ page , setPage ] = useState(1);
+ const [ total , setTotal ] = useState(0);
+
+ useEffect(()=>{
+ setList(l);
+ },[])
+
+ // 接受
+ function acceptDivert(){
+
+ }
+
+ // 拒绝
+ function revertDivert(){
+
+ }
+
+ return(
+
+ {
+ list && list.length > 0 ?
+
+
+ {
+ list.map((i,k)=>{
+ return(
+ -
+
+
+
+ {i.name}
+ {i.time}
+
+
+ 请求将仓库转移给【用户名】,是否接受?
+
+ 接受
+ 拒绝
+
+
+
+
+ )
+ })
+ }
+
+
+ :
+
+ }
+ {list && list.length === 0 &&
}
+ {
+ total > limit &&
+
+ }
+
+ )
+}
+export default UndoEvent;
\ No newline at end of file
diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js
index a85e159b..e266ae05 100644
--- a/src/forge/Settings/Setting.js
+++ b/src/forge/Settings/Setting.js
@@ -2,6 +2,7 @@ import React, { Component } from "react";
import { Form, Input, Checkbox, Select , Spin } from "antd";
import Title from '../Component/Title';
import {WhiteBack} from '../Component/layout';
+import DivertModal from '../Divert/DivertModal';
import axios from "axios";
import "./setting.scss";
const { TextArea } = Input;
@@ -25,7 +26,8 @@ class Setting extends Component {
LanguageList: undefined,
private_check: undefined,
loading:true,
- project_units:['home',"activity","code"]
+ project_units:['home',"activity","code"],
+ divertVisible:false
};
}
@@ -186,12 +188,28 @@ class Setting extends Component {
});
};
+ // 转移仓库
+ DivertProject=()=>{
+ this.setState({
+ divertVisible:true
+ })
+ }
+ // 取消仓库转移
+ CancelDivertProject=()=>{
+
+ }
+ // 确定转移仓库
+ onSuccess=()=>{
+
+ }
+
render() {
const { getFieldDecorator } = this.props.form;
- const { CategoryList, LanguageList, private_check ,loading } = this.state;
+ const { CategoryList, LanguageList, private_check ,loading , divertVisible } = this.state;
return (
+
{this.setState({divertVisible:false})}}/>
基本设置
@@ -282,6 +300,15 @@ class Setting extends Component {
危险操作区
+
+
+
转移仓库
+
+ 将此仓库转移给其他用户或组织
+
+
+
转移
+
删除本仓库
diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js
index e3febfce..f9cd60ad 100644
--- a/src/forge/users/Infos.js
+++ b/src/forge/users/Infos.js
@@ -41,8 +41,8 @@ const FanUser = Loadable({
loading: Loading,
})
-const UndoEvents = Loadable({
- loader: () => import("./undo_events"),
+const Notice = Loadable({
+ loader: () => import("../Notice/Index"),
loading: Loading,
})
class Infos extends Component {
@@ -116,9 +116,10 @@ class Infos extends Component {
undo_link = () => {
const {user} = this.state
this.setState({
- route_type: undefined
+ route_type: undefined,
+ project_type:"notice"
})
- this.props.history.push(`/users/${user && user.login}/undo_events`)
+ this.props.history.push(`/users/${user && user.login}/notice`)
}
route_link = (type) => {
@@ -130,7 +131,8 @@ class Infos extends Component {
organize_link = () => {
const {user} = this.state
this.setState({
- route_type: undefined
+ route_type: undefined,
+ project_type:"organizes"
})
this.props.history.push(`/users/${user && user.login}/organizes`)
}
@@ -211,21 +213,23 @@ class Infos extends Component {
- {/* {current_user && user && current_user.id === user.id && (
+ {current_user && user && current_user.id === user.id && (
-
this.undo_link()}>
-
-
- 待办事项
-
-
- {user.undo_events}
-
-
+
+ this.undo_link()}>
+
+
+ 待办事项
+
+
+ {user.undo_events}
+
+
+
- )} */}
+ )}
@@ -289,15 +293,17 @@ class Infos extends Component {
-
this.organize_link()} >
-
-
- 组织
-
-
- {user && user.user_org_count}
-
-
+
-
+
this.organize_link()} >
+
+
+ 组织
+
+
+ {user && user.user_org_count}
+
+
+
@@ -312,9 +318,9 @@ class Infos extends Component {
}}
>
{
- return ;
+ return ;
}}
>
-
-
待办事项
-
-
-
- );
- }
-}
-export default UndoEvents;