删除作业
This commit is contained in:
parent
6e29229e95
commit
0ba717de6e
|
@ -26,3 +26,11 @@ export function saveByClassWorkArray(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除classwork 作业
|
||||
export function delClasswork(id) {
|
||||
return request({
|
||||
url: '/education/classwork/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -70,7 +70,7 @@
|
|||
</el-button>
|
||||
</div>
|
||||
<div class="item-popover-item">
|
||||
<el-button text @click="deleteTalk(item)">
|
||||
<el-button text @click="deleteHomework(item)">
|
||||
<i class="iconfont icon-shanchu"></i>
|
||||
<span>删除</span>
|
||||
</el-button>
|
||||
|
@ -142,7 +142,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
emits: { 'on-move': null, 'on-delete': null, 'on-set': null },
|
||||
emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null },
|
||||
data() {
|
||||
return {
|
||||
listenList: [],
|
||||
|
@ -228,9 +228,13 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
//布置
|
||||
// 打开布置作业窗口
|
||||
setHomeWork(item){
|
||||
this.$emit('on-set', item)
|
||||
},
|
||||
// 删除作业
|
||||
deleteHomework(item){
|
||||
this.$emit('on-delhomework', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
@on-move="onMoveSingleFile"
|
||||
@on-delete="deleteTalk"
|
||||
@on-set="openSet"
|
||||
@on-delhomework="delhomework"
|
||||
>
|
||||
<el-checkbox label="" :value="item" />
|
||||
</file-list-item>
|
||||
|
@ -106,6 +107,7 @@ import SetHomework from './container/set-homework.vue'
|
|||
import outLink from '@/utils/linkConfig'
|
||||
import { createWindow } from '@/utils/tool'
|
||||
import { uniqBy, cloneDeep } from 'lodash'
|
||||
import { delClasswork } from '@/api/teaching/classwork'
|
||||
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
||||
|
@ -340,7 +342,7 @@ export default {
|
|||
pageSize: 500
|
||||
})
|
||||
},
|
||||
//
|
||||
// 清除查询作业列表定时器
|
||||
createTimer() {
|
||||
this.timerId = setInterval(() => {
|
||||
this.getHomeWorkList()
|
||||
|
@ -408,7 +410,6 @@ export default {
|
|||
}
|
||||
// 去重
|
||||
let ary = uniqBy([...this.currentFileList, ...list], 'id')
|
||||
console.log(ary,1000)
|
||||
// 深度克隆
|
||||
this.currentFileList = cloneDeep(ary)
|
||||
})
|
||||
|
@ -418,6 +419,18 @@ export default {
|
|||
this.row = row
|
||||
this.setDialog = true
|
||||
},
|
||||
// 删除作业
|
||||
delhomework(item){
|
||||
this.isLoading = true
|
||||
delClasswork(item.id).then( async res =>{
|
||||
ElMessage.success('操作成功')
|
||||
this.isLoading = false
|
||||
await this.asyncAllFile()
|
||||
this.getHomeWorkList()
|
||||
}).catch(()=>{
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
closeHomework() {
|
||||
this.setDialog = false
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue