lsc 2 سال پیش
والد
کامیت
24ac42c30d

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18069 - 1
package-lock.json


+ 1 - 0
package.json

@@ -30,6 +30,7 @@
     "lamejs": "^1.2.1",
     "pdfjs-dist": "^2.5.207",
     "qs": "^6.10.1",
+    "relation-graph": "^1.1.0",
     "v-viewer": "^1.6.4",
     "vant": "^2.12.10",
     "vue": "^2.5.2",

BIN
src/assets/icon/tupu.png


+ 60 - 0
src/components/pages/components/graph.vue

@@ -0,0 +1,60 @@
+<template>
+    <div style="width: 100%; max-height: 600px; overflow: auto;padding-bottom: 10px;" class="content">
+        <div style="height:600px;position: relative;">
+            <RelationGraph ref="seeksRelationGraph" :options="graphOptions" :on-node-click="onNodeClick"
+                :on-line-click="onLineClick" />
+        </div>
+    </div>
+</template>
+
+<script>
+import RelationGraph from 'relation-graph'
+
+export default {
+    props: ['Json'],
+    components: {
+        RelationGraph,
+    },
+    data() {
+        return {
+            graphOptions: {
+                allowSwitchLineShape: true,
+                allowSwitchJunctionPoint: true,
+                defaultJunctionPoint: 'border'
+                // 这里可以参考"Graph 图谱"中的参数进行设置
+            }
+        }
+    },
+    mounted() {
+        this.showSeeksGraph()
+    },
+    watch: {
+        Json: {
+            immediate: true,
+            deep: true,
+            handler(newValue, oldValue) {
+                this.Json = newValue
+                this.showSeeksGraph()
+            }
+        }
+    },
+    methods: {
+        showSeeksGraph() {
+            const __graph_json_data = this.Json
+            // 以上数据中的node和link可以参考"Node节点"和"Link关系"中的参数进行配置 
+            this.$refs.seeksRelationGraph.setJsonData(__graph_json_data, (seeksRGGraph) => {
+                // Called when the relation-graph is completed 
+            })
+        },
+        onNodeClick(nodeObject, $event) {
+            console.log('onNodeClick:', nodeObject)
+        },
+        onLineClick(lineObject, $event) {
+            console.log('onLineClick:', lineObject)
+        }
+    }
+}
+
+</script>
+
+<style></style>

+ 22 - 3
src/components/pages/components/proMan.vue

@@ -12,8 +12,8 @@
             <!-- <div class="xtBox"><span class="tcMember" v-for="(mam, mIndex) in item2.tcMember" :key="mIndex">{{ getMan(mam) }}</span>
             </div> -->
             <el-tooltip :content="getMen(item2.tcMember)" placement="top" effect="dark">
-              <div class="xtBox"><span class="tcMember" v-for="(mam, mIndex) in item2.tcMember" :key="mIndex">{{
-                getMan(mam)
+              <div class="xtBox"><span class="tcMember" v-for="(mam, mIndex) in getMan2(item2.tcMember)" :key="mIndex">{{
+                mam
               }}</span>
               </div>
             </el-tooltip>
@@ -98,7 +98,7 @@ export default {
     },
     getMan() {
       return function (people) {
-        let _people = people
+        let _people = ''
         if (this.ManAarray2.length) {
           for (var i = 0; i < this.ManAarray2.length; i++) {
             if (this.ManAarray2[i].userid == people) {
@@ -110,6 +110,25 @@ export default {
         return _people ? _people : '无'
       }
     },
+    getMan2() {
+      return function (people) {
+        let _people = people
+        let kp = []
+        if (this.ManAarray.length) {
+          for (var k = 0; k < _people.length; k++) {
+            let person = _people[k]
+            for (var i = 0; i < this.ManAarray.length; i++) {
+              if (this.ManAarray[i].userid == person) {
+                // _people = this.ManAarray[i].name;
+                kp.push(this.ManAarray[i].name)
+                break;
+              }
+            }
+          }
+        }
+        return kp.length ? kp : ['无']
+      }
+    },
   },
   watch: {
     ManAarray: {

+ 12 - 12
src/components/pages/course.vue

@@ -14,7 +14,7 @@
       <div class="student_button">
         <!-- <el-button type="primary" class="bgColor" @click="openCourse">协同编辑</el-button> -->
         <el-button type="primary" class="bgColor" @click="goToCourse()"
-          >添加项目</el-button
+          >添加课程</el-button
         >
       </div>
     </div>
@@ -22,10 +22,10 @@
       <div class="student_head">
         <div class="choose">
           <div class="student_search">
-            <span>项目筛选</span>
+            <span>课程筛选</span>
             <el-select v-model="groupA" @change="search">
-              <el-option value="0" label="我的项目"></el-option>
-              <el-option value="1" label="他人项目"></el-option>
+              <el-option value="0" label="我的课程"></el-option>
+              <el-option value="1" label="他人课程"></el-option>
             </el-select>
           </div>
           <div
@@ -57,7 +57,7 @@
             <el-input
               v-model="courseName"
               class="student_input"
-              placeholder="请输入项目名称"
+              placeholder="请输入课程名称"
             ></el-input>
             <el-button class="course_button" @click="searchCourse"
               >查询</el-button
@@ -69,12 +69,12 @@
         <div class="course_box">
           <div class="out_box" v-for="(item, index) in course" :key="index">
             <div class="myCourse" v-if="item.isCourseType == 1 && groupA == 0">
-              我的项目
+              我的课程
             </div>
             <div class="myCourse" v-else-if="groupA == 1">
-              他人项目
+              他人课程
             </div>
-            <div class="xtCourse" v-else>协同项目</div>
+            <div class="xtCourse" v-else>协同课程</div>
             <div class="tup">
               <img
                 :src="
@@ -179,7 +179,7 @@
       </span>
     </el-dialog>
     <el-dialog
-      title="查看协同项目"
+      title="查看协同课程"
       :visible.sync="dialogVisibleCourse"
       :append-to-body="true"
       width="850px"
@@ -283,7 +283,7 @@ export default {
       courseTypeId: {},
       courseTypeSon: [],
       isChoose: 0,
-      problemCourse: null, //查看提问的项目
+      problemCourse: null, //查看提问的课程
       courseTeam: []
     };
   },
@@ -397,7 +397,7 @@ export default {
       this.dialogVisible1 = true;
     },
     onExceed() {
-      this.$message.error("项目海报仅支持上传一张,请删除后再进行上传");
+      this.$message.error("课程海报仅支持上传一张,请删除后再进行上传");
     },
     //uuid生成
     guid() {
@@ -521,7 +521,7 @@ export default {
     // },
     deleteCourse(cid) {
       // if (this.time()) {
-      this.$confirm("确定删除此项目吗?", "提示", {
+      this.$confirm("确定删除此课程吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 349 - 308
src/components/pages/student/addCourse.vue


+ 63 - 5
src/components/pages/student/courseProgress.vue

@@ -6,6 +6,10 @@
             <div class="title"><img src="../../../assets/icon/task.png" alt />任务进展甘特图</div>
             <ganChart :Json="unitJson"></ganChart>
         </div>
+        <div class="proMan">
+            <div class="title"><img src="../../../assets/icon/tupu.png" alt />图谱</div>
+            <graph :Json="graphJson"></graph>
+        </div>
         <div class="proMan" v-if="cPan == 1">
             <div class="title"><img src="../../../assets/icon/proMan.png" alt />负责人看板</div>
             <proMan :Json="unitJson" :ManAarray="ManAarray"></proMan>
@@ -16,8 +20,9 @@
 <script>
 import proMan from "../components/proMan.vue"
 import ganChart from "../components/ganChart.vue"
+import graph from "../components/graph.vue"
 export default {
-    components: { proMan, ganChart },
+    components: { proMan, ganChart, graph },
     data() {
         return {
             cid: this.$route.query.cid,
@@ -30,7 +35,8 @@ export default {
             teacherJuri2: [],
             ManAarray: [],
             checkboxList3: [],
-            courseUserid:"",
+            courseUserid: "",
+            graphJson: {}
         }
     },
     methods: {
@@ -86,15 +92,65 @@ export default {
                             }
                         }
                     }
-                    this.getTeacher();
+                    this.getTeacher(res.data[0][0]);
                 })
                 .catch((err) => {
                     console.error(err);
                 });
         },
-        getTeacher() {
+        setGraphJson(json) {
+            let chapters = JSON.parse(json.chapters)
+            let gjson = {
+                rootId: 'pid',
+                nodes: [
+                    { id: 'pid', text: '', borderWidth: -1, color: '#128cff' },
+                ],
+                lines: [
+                ]
+            }
+            gjson.nodes[0].text = json.title
+            for (var i = 0; i < chapters.length; i++) {
+                let _chapter = chapters[i]
+                gjson.nodes.push({ id: 'chap' + i, text: '阶段' + (i + 1) + '-' + _chapter.dyName, borderWidth: -1, color: '#0672e1' })
+                gjson.lines.push({ from: 'pid', to: 'chap' + i })
+                let tasks = _chapter.chapterInfo[0].taskJson
+                for (var j = 0; j < tasks.length; j++) {
+                    let _task = tasks[j]
+                    gjson.nodes.push({ id: 'task' + i + '-' + j, text: '任务' + (j + 1) + '-' + _task.task, borderWidth: -1, color: '#3c59da' })
+                    gjson.lines.push({ from: 'chap' + i, to: 'task' + i + '-' + j })
+                    if (_task.people) {
+                        let _people = '负责人-' + this.getGMan(_task.people)
+                        gjson.nodes.push({ id: 'people' + i + '-' + j, text: _people, borderWidth: -1, color: '#1f7cda' })
+                        gjson.lines.push({ from: 'task' + i + '-' + j, to: 'people' + i + '-' + j })
+                        if (_task.tcMember && _task.tcMember.length) {
+                            for (var tc = 0; tc < _task.tcMember.length; tc++) {
+                                let _tc = this.getGMan(_task.tcMember[tc])
+                                if (_tc) {
+                                    gjson.nodes.push({ id: 'tc' + i + '-' + j + '-' + tc, text: _tc, borderWidth: -1, color: '#53c5fb' })
+                                    gjson.lines.push({ from: 'people' + i + '-' + j, to: 'tc' + i + '-' + j + '-' + tc })
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            this.graphJson = gjson
+        },
+        getGMan(people) {
+            let _people = ''
+            if (this.ManAarray.length) {
+                for (var i = 0; i < this.ManAarray.length; i++) {
+                    if (this.ManAarray[i].userid == people) {
+                        _people = this.ManAarray[i].name;
+                        break;
+                    }
+                }
+            }
+            return _people ? _people : '无'
+        },
+        getTeacher(sss) {
             this.ManAarray = []
-            if(this.checkboxList3.indexOf(this.courseUserid) == -1){
+            if (this.checkboxList3.indexOf(this.courseUserid) == -1) {
                 this.checkboxList3.push(this.courseUserid)
             }
             let params = {
@@ -108,6 +164,7 @@ export default {
                 .then((res) => {
                     let teacherJuri = res.data[0];
                     this.ManAarray = teacherJuri;
+                    this.setGraphJson(sss)
                     this.setMan();
                 })
                 .catch((err) => {
@@ -142,6 +199,7 @@ export default {
     position: fixed;
     right: 20px;
     top: 15px;
+    z-index: 999;
 }
 
 .noneClass {

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است