|
@@ -0,0 +1,289 @@
|
|
|
+<template>
|
|
|
+ <div class="pb_content" style="height: auto; width: calc(100% - 40px); margin: 0 auto;background: unset;">
|
|
|
+ <div style="width:100%;padding:0;box-sizing: border-box;">
|
|
|
+ <div class="pb_head top">
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <span class="subClick" @click="
|
|
|
+ goTo(
|
|
|
+ '/test?userid=' +
|
|
|
+ userid +
|
|
|
+ '&oid=' +
|
|
|
+ oid +
|
|
|
+ '&org=' +
|
|
|
+ org +
|
|
|
+ '&role=' +
|
|
|
+ role
|
|
|
+ )
|
|
|
+ ">表单管理</span>
|
|
|
+ <!-- v-show="oid == '4c686762-1d0a-11ed-8c78-005056b86db5'" -->
|
|
|
+ <span class="subClick" @click="
|
|
|
+ goTo(
|
|
|
+ '/trainCourse?userid=' +
|
|
|
+ userid +
|
|
|
+ '&oid=' +
|
|
|
+ oid +
|
|
|
+ '&org=' +
|
|
|
+ org +
|
|
|
+ '&role=' +
|
|
|
+ role
|
|
|
+ )
|
|
|
+ ">培训管理</span>
|
|
|
+ <span class="sub_head">数据看板</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="bbox_serch"></div>
|
|
|
+ <div class="bbox" v-loading="tabLoading">
|
|
|
+ <div class="bbox_nav">
|
|
|
+ <div class="teaLis">
|
|
|
+ <div
|
|
|
+ class="teal"
|
|
|
+ @click="cutPage(2)"
|
|
|
+ :class="[pType == 2 ? 'Tbor' : '']"
|
|
|
+ >
|
|
|
+ 专任教师
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="teal"
|
|
|
+ @click="cutPage(1)"
|
|
|
+ :class="[pType == 1 ? 'Tbor' : '']"
|
|
|
+ >
|
|
|
+ 班主任
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+var OpenCC = require("opencc-js");
|
|
|
+let converter = OpenCC.Converter({
|
|
|
+ from:'hk',
|
|
|
+ to:'cn'
|
|
|
+})
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'testDataBoard',
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ userid: this.$route.query.userid, //用户id
|
|
|
+ oid: this.$route.query.oid, //学校id
|
|
|
+ org: this.$route.query.org, //组织id
|
|
|
+ pType: 2,
|
|
|
+ teacherName: '',
|
|
|
+ tabLoading: false,
|
|
|
+ tableData: [],
|
|
|
+ zongJson: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ goTo(path) {
|
|
|
+ this.$router.push(path);
|
|
|
+ },
|
|
|
+ cutPage(type){
|
|
|
+ this.pType = type
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ scoreChildren(children) {
|
|
|
+ let score = 0;
|
|
|
+ children.forEach(item => {
|
|
|
+ if (item.sco2 && parseFloat(item.sco2) > 0) {
|
|
|
+ score += parseFloat(item.sco2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return score;
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ this.tabLoading = true;
|
|
|
+ let params = [{
|
|
|
+ oid: this.oid,
|
|
|
+ org: this.org,
|
|
|
+ type: this.pType,
|
|
|
+ tname: this.teacherName
|
|
|
+ }];
|
|
|
+ // console.log(params);
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "selectTestExaminePersonData2", params)
|
|
|
+ .then(res => {
|
|
|
+ let data = res.data[0];
|
|
|
+
|
|
|
+ data.forEach(e => {
|
|
|
+ e.json = JSON.parse(e.json);
|
|
|
+ });
|
|
|
+
|
|
|
+ data.forEach(e => {
|
|
|
+ e.evaSca = 0;
|
|
|
+ e.cogSco = 0;
|
|
|
+ e.step = 0;
|
|
|
+ e.allStep = 0;
|
|
|
+
|
|
|
+ e.json.forEach(i => {
|
|
|
+ i.evaScore = 0 // 自评
|
|
|
+ i.cogScore = 0 //考核
|
|
|
+ i.score = 0 //考核
|
|
|
+ i.children.forEach(k => {
|
|
|
+ e.evaSca = e.evaSca + k.sco1 * 1;
|
|
|
+ e.cogSco = e.cogSco + k.sco2 * 1;
|
|
|
+ i.evaScore = i.evaScore + k.sco1 * 1;
|
|
|
+ i.cogScore = i.cogScore + k.sco2 * 1;
|
|
|
+ i.score = i.score + k.score * 1;
|
|
|
+ e.allStep++;
|
|
|
+ if (!!k.sco2 * 1) {
|
|
|
+ e.step++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ data.forEach(e => {
|
|
|
+ if (e.step == e.allStep) {
|
|
|
+ e.state = "已完成";
|
|
|
+ } else {
|
|
|
+ e.state = "未完成";
|
|
|
+ }
|
|
|
+ if (!e.tea) {
|
|
|
+ e.tea = "";
|
|
|
+ }
|
|
|
+ e.evaSca = e.evaSca.toFixed(0);
|
|
|
+ e.cogSco = e.cogSco.toFixed(0);
|
|
|
+ });
|
|
|
+ let _data = []
|
|
|
+ let zongJson = {}
|
|
|
+ // zongJson.count = data.length
|
|
|
+ data.forEach((e,index) => {
|
|
|
+ _data[index] = {}
|
|
|
+ _data[index].username = e.username
|
|
|
+ _data[index].evaSca = e.evaSca
|
|
|
+ _data[index].cogSco = e.cogSco
|
|
|
+ _data[index].json = []
|
|
|
+
|
|
|
+ e.json.forEach((i,iindex) => {
|
|
|
+ if(converter(i.name) == converter("科组评价") || converter(i.name) == converter("行政巡查")){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ _data[index].json[iindex] = {}
|
|
|
+ _data[index].json[iindex].name = i.name
|
|
|
+ let _evaScore = i.evaScore * (100 / i.score)
|
|
|
+ let _cogScore = i.cogScore * (100 / i.score)
|
|
|
+ _data[index].json[iindex].evaScore = _evaScore // 自评
|
|
|
+ _data[index].json[iindex].cogScore = _cogScore // 考核
|
|
|
+ zongJson[i.name] ? "" : zongJson[i.name] = {}
|
|
|
+ zongJson[i.name].evaScore ? zongJson[i.name].evaScore += _evaScore : zongJson[i.name].evaScore = _evaScore
|
|
|
+ zongJson[i.name].cogScore ? zongJson[i.name].cogScore += _cogScore : zongJson[i.name].cogScore = _cogScore
|
|
|
+ });
|
|
|
+ });
|
|
|
+ let zongArray = Object.keys(zongJson)
|
|
|
+ for(var i = 0; i < zongArray.length; i++) {
|
|
|
+ zongJson[zongArray[i]].evaScore = (zongJson[zongArray[i]].evaScore / data.length).toFixed(0)
|
|
|
+ zongJson[zongArray[i]].cogScore = (zongJson[zongArray[i]].cogScore / data.length).toFixed(0)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.tableData = _data;
|
|
|
+ console.log(this.tableData);
|
|
|
+ this.zongJson = zongJson
|
|
|
+ console.log(zongJson);
|
|
|
+
|
|
|
+ this.tabLoading = false;
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ this.tabLoading = false;
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.top {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ width: 100% !important;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin: 0px auto;
|
|
|
+ padding: 10px 0;
|
|
|
+ height: 54px;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+.subClick {
|
|
|
+ font-size: 16px;
|
|
|
+ cursor: pointer;
|
|
|
+ margin-left: 10px;
|
|
|
+ /* color: #ab582f; */
|
|
|
+ color: #409eff;
|
|
|
+}
|
|
|
+
|
|
|
+.sub_head {
|
|
|
+ position: relative;
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ padding: 0 15px;
|
|
|
+}
|
|
|
+
|
|
|
+.sub_head::after {
|
|
|
+ content: "";
|
|
|
+ width: 100%;
|
|
|
+ background: #3681FC;
|
|
|
+ height: 2px;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ bottom: -8px;
|
|
|
+}
|
|
|
+
|
|
|
+.subClick {
|
|
|
+ /* font-size: 16px; */
|
|
|
+ font-size: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ /* margin-left: 17.5px; */
|
|
|
+ /* color: #ab582f; */
|
|
|
+ /* color: #409eff; */
|
|
|
+ color: #999;
|
|
|
+ padding: 0 15px;
|
|
|
+}
|
|
|
+
|
|
|
+.subClick:hover {
|
|
|
+ color: #000;
|
|
|
+}
|
|
|
+
|
|
|
+.sub_head+.subClick,
|
|
|
+.subClick+.subClick,
|
|
|
+.subClick+.sub_head {
|
|
|
+ margin-left: 17.5px;
|
|
|
+}
|
|
|
+
|
|
|
+.bbox {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 0 5px 5px 5px;
|
|
|
+ padding: 15px 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ min-height: 900px;
|
|
|
+}
|
|
|
+
|
|
|
+.bbox_nav{
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 20px;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.teaLis {
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+.teal {
|
|
|
+ padding: 10px 20px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.Tbor {
|
|
|
+ border-bottom: 2px rgba(54, 129, 252, 1) solid;
|
|
|
+ font-weight: 600;
|
|
|
+}
|
|
|
+</style>
|