|
|
|
@ -156,7 +156,8 @@
|
|
|
|
v-model="row.teacherScoreDraft"
|
|
|
|
v-model="row.teacherScoreDraft"
|
|
|
|
:min="0"
|
|
|
|
:min="0"
|
|
|
|
:max="100"
|
|
|
|
:max="100"
|
|
|
|
:precision="2"
|
|
|
|
:precision="0"
|
|
|
|
|
|
|
|
:step="1"
|
|
|
|
:controls="false"
|
|
|
|
:controls="false"
|
|
|
|
placeholder="0-100"
|
|
|
|
placeholder="0-100"
|
|
|
|
:aria-label="`给${row.taskName}评分`"
|
|
|
|
:aria-label="`给${row.taskName}评分`"
|
|
|
|
@ -167,6 +168,13 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
|
|
|
v-show="taskDetailTotal > 0"
|
|
|
|
|
|
|
|
:total="taskDetailTotal"
|
|
|
|
|
|
|
|
v-model:page="taskDetailPagination.index"
|
|
|
|
|
|
|
|
v-model:limit="taskDetailPagination.size"
|
|
|
|
|
|
|
|
@pagination="getClassScoreDetail"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -189,6 +197,9 @@ const scoreParams = ref({
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const scoreDetailsStart = ref(false);
|
|
|
|
const scoreDetailsStart = ref(false);
|
|
|
|
const tableData = ref([]);
|
|
|
|
const tableData = ref([]);
|
|
|
|
|
|
|
|
const taskDetailRows = ref([]);
|
|
|
|
|
|
|
|
const taskDetailTotal = ref(0);
|
|
|
|
|
|
|
|
const taskDetailPagination = ref({ index: 1, size: 10 });
|
|
|
|
const scoreDetailStudent = ref({
|
|
|
|
const scoreDetailStudent = ref({
|
|
|
|
name: "",
|
|
|
|
name: "",
|
|
|
|
aiTotalScore: null,
|
|
|
|
aiTotalScore: null,
|
|
|
|
@ -227,6 +238,12 @@ const formatScore = (score) => {
|
|
|
|
const formatTeacherScore = (score) => score === null || score === undefined || score === ""
|
|
|
|
const formatTeacherScore = (score) => score === null || score === undefined || score === ""
|
|
|
|
? "待评阅"
|
|
|
|
? "待评阅"
|
|
|
|
: formatScore(score);
|
|
|
|
: formatScore(score);
|
|
|
|
|
|
|
|
const normalizeTaskScoreRow = (row) => ({
|
|
|
|
|
|
|
|
...row,
|
|
|
|
|
|
|
|
teacherScoreDraft: row.teacherScore === null || row.teacherScore === undefined
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: Number(row.teacherScore),
|
|
|
|
|
|
|
|
});
|
|
|
|
const weightFields = ["foundationWeight", "marketInsightWeight", "planningDesignWeight", "developmentValidationWeight", "launchOperationWeight", "comprehensiveTrainingWeight"];
|
|
|
|
const weightFields = ["foundationWeight", "marketInsightWeight", "planningDesignWeight", "developmentValidationWeight", "launchOperationWeight", "comprehensiveTrainingWeight"];
|
|
|
|
const rules = Object.fromEntries(weightFields.map((field) => [field, [
|
|
|
|
const rules = Object.fromEntries(weightFields.map((field) => [field, [
|
|
|
|
{ required: true, message: "请输入权重", trigger: "blur" },
|
|
|
|
{ required: true, message: "请输入权重", trigger: "blur" },
|
|
|
|
@ -320,26 +337,42 @@ const exportExcel = () => {
|
|
|
|
URL.revokeObjectURL(url);
|
|
|
|
URL.revokeObjectURL(url);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const refreshScoreDetail = () => {
|
|
|
|
|
|
|
|
if (!scoreDetailStudent.value.userId || !scoreParams.value.classId) {
|
|
|
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return indexApi.getScoreDetail({
|
|
|
|
|
|
|
|
userId: scoreDetailStudent.value.userId,
|
|
|
|
|
|
|
|
classId: scoreParams.value.classId,
|
|
|
|
|
|
|
|
...taskDetailPagination.value,
|
|
|
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
|
|
|
const responseData = res.data || [];
|
|
|
|
|
|
|
|
if (Array.isArray(responseData)) {
|
|
|
|
|
|
|
|
taskDetailRows.value = responseData.map(normalizeTaskScoreRow);
|
|
|
|
|
|
|
|
taskDetailTotal.value = taskDetailRows.value.length;
|
|
|
|
|
|
|
|
const start = (taskDetailPagination.value.index - 1) * taskDetailPagination.value.size;
|
|
|
|
|
|
|
|
tableData.value = taskDetailRows.value.slice(start, start + taskDetailPagination.value.size);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
tableData.value = (responseData.list || []).map(normalizeTaskScoreRow);
|
|
|
|
|
|
|
|
taskDetailTotal.value = Number(responseData.total) || tableData.value.length;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
const getClassScoreDetail = (row) => {
|
|
|
|
const getClassScoreDetail = (row) => {
|
|
|
|
if (!scoreParams.value.classId) {
|
|
|
|
if (row?.userId) {
|
|
|
|
|
|
|
|
taskDetailPagination.value.index = 1;
|
|
|
|
|
|
|
|
scoreDetailStudent.value = {
|
|
|
|
|
|
|
|
userId: row.userId,
|
|
|
|
|
|
|
|
name: row.name,
|
|
|
|
|
|
|
|
aiTotalScore: row.score,
|
|
|
|
|
|
|
|
teacherScore: row.teacherScore,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!scoreParams.value.classId || !scoreDetailStudent.value.userId) {
|
|
|
|
proxy.$modal.msgWarning("请选择教学班后再查看成绩详情");
|
|
|
|
proxy.$modal.msgWarning("请选择教学班后再查看成绩详情");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scoreDetailStudent.value = {
|
|
|
|
refreshScoreDetail().then(() => (scoreDetailsStart.value = true));
|
|
|
|
userId: row.userId,
|
|
|
|
|
|
|
|
name: row.name,
|
|
|
|
|
|
|
|
aiTotalScore: row.score,
|
|
|
|
|
|
|
|
teacherScore: row.teacherScore,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
indexApi.getScoreDetail({ userId: row.userId, classId: scoreParams.value.classId }).then((res) => {
|
|
|
|
|
|
|
|
tableData.value = (res.data || []).map((item) => ({
|
|
|
|
|
|
|
|
...item,
|
|
|
|
|
|
|
|
teacherScoreDraft: item.teacherScore === null || item.teacherScore === undefined
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: Number(item.teacherScore),
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
scoreDetailsStart.value = true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const canScoreTask = (row) => Boolean(row.submitted) || row.progressStatus === "COMPLETED";
|
|
|
|
const canScoreTask = (row) => Boolean(row.submitted) || row.progressStatus === "COMPLETED";
|
|
|
|
const saveTaskTeacherScore = (row) => {
|
|
|
|
const saveTaskTeacherScore = (row) => {
|
|
|
|
@ -348,8 +381,8 @@ const saveTaskTeacherScore = (row) => {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const score = Number(row.teacherScoreDraft);
|
|
|
|
const score = Number(row.teacherScoreDraft);
|
|
|
|
if (!Number.isFinite(score) || score < 0 || score > 100) {
|
|
|
|
if (!Number.isInteger(score) || score < 0 || score > 100) {
|
|
|
|
proxy.$message.error("教师评分必须为0至100之间的数值");
|
|
|
|
proxy.$message.error("教师评分必须为0至100之间的整数");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
savingTaskId.value = row.taskId;
|
|
|
|
savingTaskId.value = row.taskId;
|
|
|
|
@ -360,8 +393,9 @@ const saveTaskTeacherScore = (row) => {
|
|
|
|
teacherScore: score,
|
|
|
|
teacherScore: score,
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
row.teacherScore = score;
|
|
|
|
row.teacherScore = score;
|
|
|
|
|
|
|
|
row.teacherScoreDraft = score;
|
|
|
|
proxy.$message.success("任务评分保存成功");
|
|
|
|
proxy.$message.success("任务评分保存成功");
|
|
|
|
return getList();
|
|
|
|
return Promise.all([refreshScoreDetail(), getList()]);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
const latest = workingCapitalList.value.find((item) => item.userId === scoreDetailStudent.value.userId);
|
|
|
|
const latest = workingCapitalList.value.find((item) => item.userId === scoreDetailStudent.value.userId);
|
|
|
|
if (latest) {
|
|
|
|
if (latest) {
|
|
|
|
|