baigl #281
|
@ -28,20 +28,20 @@
|
|||
</ul>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { homeworklist } from '@/api/teaching/classwork'
|
||||
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||
import {sessionStore, createWindow} from '@/utils/tool'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
|
||||
const user = useUserStore().user
|
||||
const toolState = useToolState();
|
||||
const loading = ref(false)
|
||||
const homeworkList = ref([])
|
||||
const itemDialogRef = ref(null)
|
||||
|
||||
// 获取作业
|
||||
const getHomework = async () => {
|
||||
|
@ -70,12 +70,11 @@ const getHomework = async () => {
|
|||
// 批改作业
|
||||
const onClickItem = (item) => {
|
||||
console.log('开启弹窗')
|
||||
itemDialogRef.value.openDialog(item)
|
||||
}
|
||||
// 批阅关闭
|
||||
const closeDialog = () => {
|
||||
console.log('关闭弹窗,查询一下作业数据,更新界面')
|
||||
getHomework()
|
||||
// itemDialogRef.value.openDialog(item)
|
||||
// 调用新窗口批改页面
|
||||
sessionStore.set('teachClassWorkItem', item)
|
||||
toolState.isTaskWin=true //设置打开批改窗口
|
||||
createWindow('open-taskwin',{url:'/teachClassTask'})
|
||||
}
|
||||
|
||||
const tagType = (time) => {
|
||||
|
@ -86,6 +85,16 @@ const tagType = (time) => {
|
|||
onMounted(() => {
|
||||
getHomework()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => [toolState.isTaskWin],
|
||||
() => {
|
||||
console.log('=监听到批改窗口是否关闭了===', toolState.isTaskWin)
|
||||
if(!toolState.isTaskWin){
|
||||
getHomework()// 更新数据
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in New Issue