Browse Source

UPDATE:更新至summer

wjj 3 years ago
parent
commit
27867ceffd

+ 27 - 0
src/pages/bugs/components/BugTreeGraph/index.jsx

@@ -0,0 +1,27 @@
+import { Col, Image, Spin } from 'antd';
+import React, { useEffect, useState } from 'react';
+import { connect } from 'umi';
+import styles from './index.less';
+import { timeToString } from '@/utils/common';
+import {
+  DislikeOutlined, LeftOutlined,
+  LikeOutlined, RightOutlined,
+} from '@ant-design/icons';
+import { recurrent, severity, bug_categories } from '@/pages/edit/components/Step2/const';
+
+const BugTreeGraph = (props) => {
+  const { dispatch,reportCommonInfo,treeGraph } = props;
+
+  return (
+    // detail && detail.id ?
+    //    : <Spin />
+    <div className={styles.treeGraph}>
+      graph
+    </div>
+  );
+};
+
+export default connect(({ allBugs, editReport }) => ({
+  treeGraph: allBugs.treeGraph,
+  reportCommonInfo: editReport.reportCommonInfo,
+}))(BugTreeGraph);

+ 5 - 0
src/pages/bugs/components/BugTreeGraph/index.less

@@ -0,0 +1,5 @@
+@import '~antd/es/style/themes/default.less';
+
+.treeGraph {
+
+}

+ 2 - 1
src/pages/bugs/index.jsx

@@ -8,6 +8,7 @@ const { Option } = Select;
 import BugTreeList from './components/BugTreeList';
 import BugSingleList from './components/BugSingleList';
 import BugDetailModal from './components/BugDetailModal';
+import BugTreeGraph from './components/BugTreeGraph';
 
 import {
   ApartmentOutlined,
@@ -155,7 +156,7 @@ const AllBugs = (props) => {
 
           </Col>
           <Col span={8}>
-            这里是树状图
+            <BugTreeGraph/>
           </Col>
           <Col span={8}>
             <div className={styles.bugDetail}>

+ 18 - 2
src/pages/bugs/model.js

@@ -1,7 +1,8 @@
 import {
   getReportReview,
   getTreeList,
-  getSingleList
+  getSingleList,
+  getTreeGraph
 } from './service';
 
 const Model = {
@@ -10,7 +11,8 @@ const Model = {
     reportReview:{},
     bugTreeList:[],
     bugSingleList:[],
-    bugItemDetail:{}
+    bugItemDetail:{},
+    treeGraph:{}
   },
   effects: {
     //todo:获取bug总数,点赞、点踩总数
@@ -43,6 +45,17 @@ const Model = {
         payload: res,
       });
     },
+
+    //todo:获取bug树状图
+    * getTreeGraph({ payload }, { call, put }) {
+      const {id} = payload;
+      let res = yield call(getTreeGraph, id);
+      console.log(res);
+      yield put({
+        type: 'saveTreeGraph',
+        payload: res,
+      });
+    },
   },
   reducers: {
     saveReportReview(state, { payload }) {
@@ -57,6 +70,9 @@ const Model = {
     saveBugItemDetail(state, { payload }) {
       return { ...state, bugItemDetail: payload };
     },
+    saveTreeGraph(state, { payload }) {
+      return { ...state, treeGraph: payload };
+    },
   }
 };
 export default Model;

+ 10 - 0
src/pages/bugs/service.js

@@ -36,3 +36,13 @@ export async function getSingleList(case_take_id,start,count,page) {
     }
   });
 }
+
+//todo:获取树状图
+export async function getTreeGraph(id) {
+  return request('/api/history/getPath', {
+    method: 'get',
+    params: {
+      id
+    }
+  });
+}