From 4e5a851484010764e8fddc6f2b88f4d17c9cd6cf Mon Sep 17 00:00:00 2001 From: herman94 Date: Mon, 11 Jul 2022 11:45:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=E5=88=86?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 2 +- src/forge/Main/Detail.js | 13 ++++++- src/forge/Main/DetailAdaptor.js | 1 + src/forge/Main/sub/DetailBanner.jsx | 11 +++++- src/forge/Quality/index.js | 53 +++++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 src/forge/Quality/index.js diff --git a/src/App.js b/src/App.js index cd7f5b14..588892d7 100644 --- a/src/App.js +++ b/src/App.js @@ -285,8 +285,8 @@ class App extends Component { this.gettablogourlnull(); }); }; - render() { + console.log('props',this.props); const { pathType, pathName } = this.state; return ( diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 1d53b193..18da4d8c 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -71,6 +71,12 @@ const MergeIndexDetail = Loadable({ loading: Loading, }) +//合并请求 +const QualityAnalyse = Loadable({ + loader: () => import('../Quality/index'), + loading: Loading, +}) + const CreateMerge = Loadable({ loader: () => import('../Merge/CreateMerge'), loading: Loading, @@ -770,10 +776,15 @@ class Detail extends Component { } > {/* 动态 */} - () } + > */} + () + } > {/* 代码Index */} { + console.log('props',props) return ( {}) } - +console.log('路径名称',pathname,owner,projectsId,state,history); return(
setVisible(false)} name={projectDetail && projectDetail.name} onSuccess={onSuccess}/> @@ -150,6 +150,15 @@ function DetailBanner({ history,list , owner , projectsId ,showNotification , ur } + { + item.menu_name === "sonar" && +
  • + + + 质量分析 + +
  • + } { item.menu_name === "settings" && platform &&
  • diff --git a/src/forge/Quality/index.js b/src/forge/Quality/index.js new file mode 100644 index 00000000..085f351a --- /dev/null +++ b/src/forge/Quality/index.js @@ -0,0 +1,53 @@ +import React, { Component, useEffect, useState } from "react"; +import axios from "axios"; + +function Quality(props){ + const { projectsId , owner } = props.match.params; + const [sonarList,setSonarList] = useState({}) //问题列表分析 + const [detection,setDetection] = useState('') //是否检测 + const [taskId,setTaskId] = useState('') //任务ID + + useEffect(()=>{ + getTask() + },[]) + + const getTask = () => { + + axios.get(`/${owner}/${projectsId}/sonar_tasks.json`) + .then(({data:{data,message,status}}) => { + if(status===-1){ + getTaskData() + } + if(status === 0){ + setSonarList(data) + getTaskDetail(data.task_id) + setTaskId() + } + }).catch(function (error) { + console.log(error); + + }); + } + + const getTaskData = (task_id) => { + axios.post(`/${owner}/${projectsId}/sonar_tasks/type_detail.json?task_id=${task_id}`) + .then(result => { + console.log('请求的结果',result); + }).catch(function (error) { + console.log(error); + }); + } + + const getTaskDetail = () => { + + } + return ( + +
    + 1231321 + +
    +
    + ); +} +export default Quality;