From ea3f591eb6c7c81affe3c672970325b0b09af5b4 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 26 Jun 2024 17:17:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=9C=A8=E5=AF=BC=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Detail.js | 25 ++++++++++++++++++++++++- src/forge/Main/list.scss | 1 + src/forge/css/index.scss | 13 +++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 07d9617ff..1baa204ef 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Spin, Tooltip } from 'antd'; +import { Spin, Tooltip , Button } from 'antd'; import { Link, Route, Switch } from 'react-router-dom'; import { withRouter } from "react-router"; import { connect } from 'react-redux'; @@ -17,6 +17,7 @@ import '../css/index.scss' import './list.scss'; import '../../modules/courses/css/Courses.css' import { ImageLayerOfCommentHOC } from "../../modules/page/layers/ImageLayerOfCommentHOC"; +import { unInstallMarketBot } from "../../softbot/api"; import Loadable from 'react-loadable'; @@ -590,6 +591,25 @@ class Detail extends Component { : "" } + // 删除仓库 + deleteProject = () => { + const { projectsId , owner } = this.props.match.params; + const { projectName } = this.state; + this.props.confirm({ + content: 该操作无法撤销!且将会一并删除相关的疑修、合并请求、工作流、里程碑、动态等数据。
是否确认删除 {owner}/{projectName}({projectsId})
, + onOk: () => { + const url = `/${owner}/${projectsId}.json`; + axios.delete(url).then((result) => { + window.scrollTo(0,0); + this.props.showNotification("仓库删除成功!"); + this.props.history.push(`/${owner}`); + }) + .catch((error) => { + console.log(error); + }); + }, + }); + }; render() { const { projectDetail, watchers_count, praises_count, @@ -732,6 +752,9 @@ class Detail extends Component { firstSync && + } diff --git a/src/forge/Main/list.scss b/src/forge/Main/list.scss index ae45f0c79..ffcc86b90 100644 --- a/src/forge/Main/list.scss +++ b/src/forge/Main/list.scss @@ -211,6 +211,7 @@ } .spincontent{ height:400px; + flex-direction: column; } .spinstyle .ant-spin-text{ margin-top:30px; diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index 715764421..0dfc98602 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -438,4 +438,17 @@ button.btngrey{ background-color:#708cff; border-color:#708cff; } +} +.red_deleteBtn{ + display: block; + height: 38px; + line-height: 36px; + border:1px solid #db2828; + border-radius: 4px; + color: #db2828!important; + padding:0px 15px; + font-size: 16px; + &:hover{ + border-color:#db2828!important; + } } \ No newline at end of file