|
|
@@ -32,7 +32,7 @@
|
|
|
<el-table-column :label="role == 'teachers'? '编辑':'写作'" width="60">
|
|
|
<template #default="scope">
|
|
|
<el-button @mouseover="handleMouse('over', scope.row.teacherId, scope.row.endDate)" @mouseleave="handleMouse('leave', scope.row.teacherId, scope.row.endDate)"
|
|
|
- color="#597d3b" circle @click="handleFunctionButton(scope.row.assignmentId)" :disabled="props.disabled || isDisabled(scope.row.teacherId, scope.row.endDate)">
|
|
|
+ color="#597d3b" circle @click="handleFunctionButton(scope.row.assignmentId)" :disabled="props.disabled || isDisabled(scope.row.teacherId, scope.row.teacherPid, scope.row.endDate)">
|
|
|
<el-icon :size="18">
|
|
|
<Edit />
|
|
|
</el-icon>
|
|
|
@@ -532,11 +532,10 @@ const openEditor = (url: string, title: string) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- const isDisabled = (teacherId: string, endDate: string) => {
|
|
|
+ const isDisabled = (teacherId: string, teacherPid: string, endDate: string) => {
|
|
|
if(props.role == 'teachers'){// 是教师且不是作业发布人则禁用
|
|
|
- if(+teacherId != store.user.id){
|
|
|
- return true
|
|
|
- }
|
|
|
+ // TODO: 需要修改,目前是错误使用,需要一对一
|
|
|
+ return !(+teacherId == store.user.id || +teacherPid == store.user.pid || +teacherId == store.user.pid || +teacherPid == store.user.id);
|
|
|
} else { // 是学生且超时则禁用
|
|
|
if(new Date() > new Date(endDate)) return true
|
|
|
}
|