|
@@ -20,21 +20,6 @@
|
|
|
<el-rate v-model="e.cog"></el-rate>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- <div
|
|
|
- v-if="scoTitList.length > 2"
|
|
|
- style="color:#4188FC;cursor: pointer;width: 30%;"
|
|
|
- @click="allList"
|
|
|
- >
|
|
|
- <div>
|
|
|
- <span style="margin-right:5px;">{{
|
|
|
- !showAll ? "全部" : "折叠"
|
|
|
- }}</span>
|
|
|
- <i
|
|
|
- :class="!showAll ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
|
|
|
- ></i>
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
</div>
|
|
|
<div style="width:100%;display:flex;justify-content: flex-end;">
|
|
|
<el-button size="mini" @click="reset">重置</el-button>
|
|
@@ -76,6 +61,10 @@ export default {
|
|
|
total: 0
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
+ beforeDestroy() {
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
computed: {
|
|
|
totalScore() {
|
|
|
let a = 0;
|
|
@@ -89,20 +78,13 @@ export default {
|
|
|
val2: this.wIndex,
|
|
|
val3: data
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
return data;
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- refreshKey(newV, old) {
|
|
|
- this.getData();
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
mounted() {
|
|
|
this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
|
|
|
- // console.log("scoCon", this.scoCon);
|
|
|
- // console.log("scoTit", this.scoTit);
|
|
|
-
|
|
|
this.getData();
|
|
|
},
|
|
|
|
|
@@ -125,9 +107,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // console.log("this.task", this.task);
|
|
|
- // console.log("data2", data2);
|
|
|
-
|
|
|
let data = JSON.parse(data2.rate);
|
|
|
|
|
|
this.scoTitList.forEach((e, index) => {
|
|
@@ -138,6 +117,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ console.log("this.scoTitList", this.scoTitList);
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
@@ -146,35 +127,40 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
reset() {
|
|
|
- let data = this.scoTitList.map(e => {
|
|
|
- return e.value + ":" + e.cog;
|
|
|
+ console.log("this.scoTitList", this.scoTitList);
|
|
|
+ this.scoTitList.forEach(e => {
|
|
|
+ e.cog = 0;
|
|
|
});
|
|
|
- // console.log("data", data);
|
|
|
- const processedData = {};
|
|
|
+ // let data = this.scoTitList.map(e => {
|
|
|
+ // return e.value + ":" + e.cog;
|
|
|
+ // });
|
|
|
+ // // console.log("data", data);
|
|
|
+ // const processedData = {};
|
|
|
|
|
|
- data.forEach(item => {
|
|
|
- const [key, value] = item.split(":");
|
|
|
- processedData[key] = 0;
|
|
|
- });
|
|
|
- processedData.content = "";
|
|
|
- // return console.log(processedData);
|
|
|
- let params = {
|
|
|
- cid: this.id,
|
|
|
- s: this.stage,
|
|
|
- t: this.task,
|
|
|
- rate: JSON.stringify(processedData),
|
|
|
- uid: this.stUid
|
|
|
- };
|
|
|
- // return console.log(params);
|
|
|
- this.ajax
|
|
|
- .get(this.$store.state.api + "updateWorksEva", params)
|
|
|
- .then(res => {
|
|
|
- this.getData();
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- this.$message.error("重置失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
+ // data.forEach(item => {
|
|
|
+ // const [key, value] = item.split(":");
|
|
|
+ // processedData[key] = 0;
|
|
|
+ // });
|
|
|
+ // processedData.content = "";
|
|
|
+ // this.scoTitList = processedData
|
|
|
+ // // return console.log(processedData);
|
|
|
+ // let params = {
|
|
|
+ // cid: this.id,
|
|
|
+ // s: this.stage,
|
|
|
+ // t: this.task,
|
|
|
+ // rate: JSON.stringify(processedData),
|
|
|
+ // uid: this.stUid
|
|
|
+ // };
|
|
|
+ // // return console.log(params);
|
|
|
+ // this.ajax
|
|
|
+ // .get(this.$store.state.api + "updateWorksEva", params)
|
|
|
+ // .then(res => {
|
|
|
+ // this.getData();
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // this.$message.error("重置失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
},
|
|
|
// 老师提交评分
|
|
|
submit() {
|