|
@@ -2,17 +2,41 @@
|
|
|
<div v-loading="isloading">
|
|
|
<div style="background: #fff; padding: 10px 0; height: 100%">
|
|
|
<div class="sd_person_button">
|
|
|
- <span @click="setType(2)" :class="{ active: type == 2 }">个人项目评价</span>
|
|
|
- <span @click="setType(1)" :class="{ active: type == 1 }">课程目标设置</span>
|
|
|
+ <span @click="setType(2)" :class="{ active: type == 2 }"
|
|
|
+ >个人项目评价</span
|
|
|
+ >
|
|
|
+ <span @click="setType(1)" :class="{ active: type == 1 }"
|
|
|
+ >课程目标设置</span
|
|
|
+ >
|
|
|
<!-- <span @click="setType(3)" :class="{ active: type == 3 }">其他项目</span> -->
|
|
|
</div>
|
|
|
<div style="display: flex; width: 100%; height: calc(100% - 50px)">
|
|
|
- <div id="person_canvas1" class="echart" v-show="type == 1"
|
|
|
- style="width: 100%; height: 100%;display: flex;align-items: center;justify-content: center;">
|
|
|
+ <div
|
|
|
+ id="person_canvas1"
|
|
|
+ class="echart"
|
|
|
+ v-show="type == 1"
|
|
|
+ style="
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ "
|
|
|
+ >
|
|
|
<span v-if="!eJson">暂无数据</span>
|
|
|
</div>
|
|
|
- <div id="person_canvas2" class="echart" v-show="type == 2"
|
|
|
- style="width: 100%; height: 100%;display: flex;align-items: center;justify-content: center;">
|
|
|
+ <div
|
|
|
+ id="person_canvas2"
|
|
|
+ class="echart"
|
|
|
+ v-show="type == 2"
|
|
|
+ style="
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ "
|
|
|
+ >
|
|
|
<!-- <div class="box2" v-show="work.length ? true : false">
|
|
|
<div v-for="(item,index) in work" :key="index" class="target_box">
|
|
|
<div class="target_task">
|
|
@@ -34,8 +58,6 @@
|
|
|
</div>
|
|
|
<span v-show="!work.length ? true : false">暂无数据</span> -->
|
|
|
<span v-show="!randarJson.length ? true : false">暂无数据</span>
|
|
|
-
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -43,8 +65,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-
|
|
|
-
|
|
|
export default {
|
|
|
props: ["userid", "courseid"],
|
|
|
data() {
|
|
@@ -77,7 +97,7 @@ export default {
|
|
|
},
|
|
|
label: {
|
|
|
show: true,
|
|
|
- fontSize: 10
|
|
|
+ fontSize: 10,
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -109,7 +129,7 @@ export default {
|
|
|
data: ["阶段1", "阶段2", "阶段3", "阶段4", "阶段5"],
|
|
|
},
|
|
|
legend: {
|
|
|
- show: false
|
|
|
+ show: false,
|
|
|
},
|
|
|
series: [
|
|
|
{
|
|
@@ -361,7 +381,7 @@ export default {
|
|
|
}
|
|
|
i++;
|
|
|
}
|
|
|
- this.option2.series.data = _array
|
|
|
+ this.option2.series.data = _array;
|
|
|
// 初始化雷达图
|
|
|
this.chartObj2 = chartObj2;
|
|
|
this.chartObj2.setOption(this.option2);
|
|
@@ -393,19 +413,19 @@ export default {
|
|
|
//劳动课程
|
|
|
this.$el.querySelector("#person_canvas2")
|
|
|
);
|
|
|
- let radarOption = JSON.parse(JSON.stringify(this.radarOption))
|
|
|
+ let radarOption = JSON.parse(JSON.stringify(this.radarOption));
|
|
|
for (var i = 0; i < this.randarJson.length; i++) {
|
|
|
radarOption.radar.indicator.push({
|
|
|
name: this.randarJson[i].target,
|
|
|
max: 5,
|
|
|
});
|
|
|
- radarOption.series[0].data[0].value.push((this.randarJson[i].value / this.randarJson[i].count).toFixed(1));
|
|
|
+ radarOption.series[0].data[0].value.push(
|
|
|
+ (this.randarJson[i].value / this.randarJson[i].count).toFixed(1)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
-
|
|
|
this.chartObj3 = chartObj3;
|
|
|
this.chartObj3.setOption(radarOption);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// var _work = []
|
|
@@ -423,8 +443,6 @@ export default {
|
|
|
// this.work = _work;
|
|
|
// console.log(_work);
|
|
|
// this.$forceUpdate();
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
let _this = this;
|
|
@@ -436,7 +454,6 @@ export default {
|
|
|
|
|
|
if (_this.chartObj2) {
|
|
|
_this.chartObj2.resize();
|
|
|
-
|
|
|
}
|
|
|
if (_this.chartObj3) {
|
|
|
_this.chartObj3.resize();
|
|
@@ -457,7 +474,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getInfo() {
|
|
|
- this.isloading = true
|
|
|
+ this.isloading = true;
|
|
|
let params = {
|
|
|
uid: this.userid,
|
|
|
cid: this.courseid,
|
|
@@ -468,21 +485,34 @@ export default {
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "getUserInfo", params)
|
|
|
.then((res) => {
|
|
|
- this.isloading = false
|
|
|
+ this.isloading = false;
|
|
|
let chapters = JSON.parse(res.data[2][0].chapters);
|
|
|
var tool = 0;
|
|
|
- let workJson = []
|
|
|
+ let workJson = [];
|
|
|
let _pWork = res.data[3];
|
|
|
let _allWork = res.data[4];
|
|
|
let _allComment = res.data[5];
|
|
|
- let _isWorks = res.data[6];
|
|
|
- var randarJson = []
|
|
|
- var randarAarray = []
|
|
|
+ var b = res.data[6].reduce((result, item) => {
|
|
|
+ const key = item.stage + "-" + item.task;
|
|
|
+ if (!result[key]) {
|
|
|
+ result[key] = item;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }, {});
|
|
|
+
|
|
|
+ // 将结果转换为数组形式
|
|
|
+ b = Object.values(b);
|
|
|
+ let _isWorks = b;
|
|
|
+ let workEvalist = res.data[7];
|
|
|
+ var randarJson = [];
|
|
|
+ var randarAarray = [];
|
|
|
|
|
|
- this.eJson = res.data[2][0].content ? JSON.parse(res.data[2][0].content) : "";
|
|
|
+ this.eJson = res.data[2][0].content
|
|
|
+ ? JSON.parse(res.data[2][0].content)
|
|
|
+ : "";
|
|
|
|
|
|
for (var i = 0; i < chapters.length; i++) {
|
|
|
- workJson[i] = { tool: 0, ptool: 0, work: 0, ishuo: 0, isCan: 0 }
|
|
|
+ workJson[i] = { tool: 0, ptool: 0, work: 0, ishuo: 0, isCan: 0 };
|
|
|
for (
|
|
|
var j = 0;
|
|
|
j < chapters[i].chapterInfo[0].taskJson.length;
|
|
@@ -501,23 +531,21 @@ export default {
|
|
|
) != -1
|
|
|
) {
|
|
|
tool++;
|
|
|
- workJson[i].tool++
|
|
|
+ workJson[i].tool++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
for (var k = 0; k < _pWork.length; k++) {
|
|
|
if (_pWork[k].stage == i) {
|
|
|
- workJson[i].ptool++
|
|
|
+ workJson[i].ptool++;
|
|
|
}
|
|
|
}
|
|
|
for (var k = 0; k < _allComment.length; k++) {
|
|
|
if (_allComment[k].stage == i) {
|
|
|
- workJson[i].ishuo++
|
|
|
+ workJson[i].ishuo++;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
this.userinfo = res.data[0][0];
|
|
|
this.ccount = tool;
|
|
@@ -528,133 +556,84 @@ export default {
|
|
|
|
|
|
for (var i = 0; i < workJson.length; i++) {
|
|
|
if (workJson[i].ptool > workJson[i].tool) {
|
|
|
- workJson[i].work = 5
|
|
|
+ workJson[i].work = 5;
|
|
|
} else if (workJson[i].tool === 0) {
|
|
|
- workJson[i].work = 5
|
|
|
+ workJson[i].work = 5;
|
|
|
} else {
|
|
|
- workJson[i].work = Math.round(workJson[i].ptool / workJson[i].tool * 100 / 20)
|
|
|
+ workJson[i].work = Math.round(
|
|
|
+ ((workJson[i].ptool / workJson[i].tool) * 100) / 20
|
|
|
+ );
|
|
|
}
|
|
|
if (workJson[i].ptool) {
|
|
|
- workJson[i].isCan = 1
|
|
|
+ workJson[i].isCan = 1;
|
|
|
}
|
|
|
}
|
|
|
- this.workJson = workJson
|
|
|
+ this.workJson = workJson;
|
|
|
|
|
|
this.setChart();
|
|
|
- let _workW = []
|
|
|
+ let _workW = [];
|
|
|
for (var i = 0; i < _isWorks.length; i++) {
|
|
|
- if (chapters[_isWorks[i].stage].chapterInfo[0].taskJson[_isWorks[i].task].eList && chapters[_isWorks[i].stage].chapterInfo[0].taskJson[_isWorks[i].task].eList.length) {
|
|
|
- _workW.push({ stage: _isWorks[i].stage, task: _isWorks[i].task, rate: JSON.parse(_isWorks[i].rate), elist: chapters[_isWorks[i].stage].chapterInfo[0].taskJson[_isWorks[i].task].eList })
|
|
|
+ for (var k = 0; k < workEvalist.length; k++) {
|
|
|
+ if (
|
|
|
+ chapters[_isWorks[i].stage].chapterInfo[0].taskJson[
|
|
|
+ _isWorks[i].task
|
|
|
+ ].eList &&
|
|
|
+ chapters[_isWorks[i].stage].chapterInfo[0].taskJson[
|
|
|
+ _isWorks[i].task
|
|
|
+ ].eList.length
|
|
|
+ ) {
|
|
|
+ if (
|
|
|
+ _isWorks[i].stage == workEvalist[k].stage &&
|
|
|
+ _isWorks[i].task == workEvalist[k].task
|
|
|
+ ) {
|
|
|
+ _workW.push({
|
|
|
+ stage: _isWorks[i].stage,
|
|
|
+ task: _isWorks[i].task,
|
|
|
+ rate: JSON.parse(workEvalist[k].rate),
|
|
|
+ elist:
|
|
|
+ chapters[_isWorks[i].stage].chapterInfo[0].taskJson[
|
|
|
+ _isWorks[i].task
|
|
|
+ ].eList,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- // else {
|
|
|
- // let elist = [
|
|
|
- // {
|
|
|
- // "value": "意识能力",
|
|
|
- // "score": 5,
|
|
|
- // "target": [
|
|
|
- // {
|
|
|
- // "name": "意识能力1",
|
|
|
- // "per": 0.5
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "name": "意识能力2",
|
|
|
- // "per": 0.5
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "value": "科学探究能力",
|
|
|
- // "score": 5,
|
|
|
- // "target": [
|
|
|
- // {
|
|
|
- // "name": "科学探究能力1",
|
|
|
- // "per": 0.5
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "name": "科学探究能力2",
|
|
|
- // "per": 0.5
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "value": "实践创新能力",
|
|
|
- // "score": 5,
|
|
|
- // "target": [
|
|
|
- // {
|
|
|
- // "name": "实践创新能力1",
|
|
|
- // "per": 0.5
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "name": "实践创新能力2",
|
|
|
- // "per": 0.5
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "value": "学习反思能力",
|
|
|
- // "score": 5,
|
|
|
- // "target": [
|
|
|
- // {
|
|
|
- // "name": "学习反思能力1",
|
|
|
- // "per": 0.5
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "name": "学习反思能力2",
|
|
|
- // "per": 0.5
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "value": "工程思维能力",
|
|
|
- // "score": 5,
|
|
|
- // "target": [
|
|
|
- // {
|
|
|
- // "name": "工程思维能力1",
|
|
|
- // "per": 0.5
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "name": "工程思维能力2",
|
|
|
- // "per": 0.5
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // _workW.push({ stage: _isWorks[i].stage, task: _isWorks[i].task, rate: JSON.parse(_isWorks[i].rate), elist: elist })
|
|
|
- // }
|
|
|
}
|
|
|
for (var i = 0; i < _workW.length; i++) {
|
|
|
- _workW[i].work = []
|
|
|
+ _workW[i].work = [];
|
|
|
for (var j = 0; j < _workW[i].elist.length; j++) {
|
|
|
if (_workW[i].elist[j].target) {
|
|
|
if (randarAarray.indexOf(_workW[i].elist[j].target) == -1) {
|
|
|
- randarAarray.push(_workW[i].elist[j].target)
|
|
|
+ randarAarray.push(_workW[i].elist[j].target);
|
|
|
}
|
|
|
}
|
|
|
- // for (var k = 0; k < _workW[i].elist[j].target.length; k++) {
|
|
|
- // _workW[i].elist[j].target[k].count = _workW[i].rate[_workW[i].elist[j].value] * _workW[i].elist[j].target[k].per
|
|
|
- // }
|
|
|
- _workW[i].work.push({ name: _workW[i].elist[j].value, target: _workW[i].elist[j].target })
|
|
|
- _workW[i].work[_workW[i].work.length - 1][_workW[i].elist[j].value] = _workW[i].rate[_workW[i].elist[j].value]
|
|
|
- _workW[i].work[_workW[i].work.length - 1].value = _workW[i].rate[_workW[i].elist[j].value]
|
|
|
+ _workW[i].work.push({
|
|
|
+ name: _workW[i].elist[j].value,
|
|
|
+ target: _workW[i].elist[j].target,
|
|
|
+ });
|
|
|
+ _workW[i].work[_workW[i].work.length - 1][
|
|
|
+ _workW[i].elist[j].value
|
|
|
+ ] = _workW[i].rate[_workW[i].elist[j].value];
|
|
|
+ _workW[i].work[_workW[i].work.length - 1].value =
|
|
|
+ _workW[i].rate[_workW[i].elist[j].value];
|
|
|
}
|
|
|
}
|
|
|
for (var k = 0; k < randarAarray.length; k++) {
|
|
|
- randarJson.push({ target: randarAarray[k], count: 0, value: 0 })
|
|
|
+ randarJson.push({ target: randarAarray[k], count: 0, value: 0 });
|
|
|
for (var i = 0; i < _workW.length; i++) {
|
|
|
for (var j = 0; j < _workW[i].work.length; j++) {
|
|
|
if (_workW[i].work[j].target == randarAarray[k]) {
|
|
|
- randarJson[k].count++
|
|
|
- randarJson[k].value += _workW[i].work[j].value
|
|
|
+ randarJson[k].count++;
|
|
|
+ randarJson[k].value += _workW[i].work[j].value;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this.workW = _workW
|
|
|
- this.randarJson = randarJson
|
|
|
-
|
|
|
+ this.workW = _workW;
|
|
|
+ this.randarJson = randarJson;
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- this.isloading = false
|
|
|
+ this.isloading = false;
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
@@ -662,21 +641,20 @@ export default {
|
|
|
this.type = type;
|
|
|
if (this.chartObj2) {
|
|
|
this.chartObj2.dispose();
|
|
|
-
|
|
|
}
|
|
|
if (this.chartObj3) {
|
|
|
this.chartObj3.dispose();
|
|
|
-
|
|
|
}
|
|
|
this.getInfo();
|
|
|
},
|
|
|
- color16() {//十六进制颜色随机
|
|
|
+ color16() {
|
|
|
+ //十六进制颜色随机
|
|
|
var r = Math.floor(Math.random() * 256);
|
|
|
var g = Math.floor(Math.random() * 256);
|
|
|
var b = Math.floor(Math.random() * 256);
|
|
|
- var color = '#' + r.toString(16) + g.toString(16) + b.toString(16);
|
|
|
+ var color = "#" + r.toString(16) + g.toString(16) + b.toString(16);
|
|
|
return color;
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
userid(newValue, oldValue) {
|
|
@@ -709,7 +687,6 @@ export default {
|
|
|
color: rgb(30, 146, 255);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
.target_box {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -717,7 +694,7 @@ export default {
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
|
|
|
-.target_box+.target_box {
|
|
|
+.target_box + .target_box {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
|