|
@@ -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 {
|