作业批阅:新增空列表展示与loading加载效果 #192

Merged
baigl merged 1 commits from baigl into main 2024-09-11 14:30:32 +08:00
1 changed files with 35 additions and 21 deletions
Showing only changes of commit d7761883f2 - Show all commits

View File

@ -27,24 +27,35 @@
</div> </div>
</div> </div>
<div class="class-reserv-body"> <div class="class-reserv-body">
<task-item <!-- loading <el-skeleton :rows="5" animated />-->
v-for="(item, index) in activeDataList" <el-skeleton :rows="5" :loading="loading" animated />
v-show="tabActive === '进行中'" <div v-if="classWorkList.length > 0">
:key="index" <task-item
:item="item" v-for="(item, index) in activeDataList"
:tabactive="tabActive" v-show="tabActive === '进行中'"
@click="onClickItem(item)" :key="index"
@delete-reserv="deleteReserv(item)" :item="item"
></task-item> :tabactive="tabActive"
<task-item @click="onClickItem(item)"
v-for="(item, index) in doneDataList" @delete-reserv="deleteReserv(item)"
v-show="tabActive === '已结束'" ></task-item>
:key="index" <task-item
:item="item" v-for="(item, index) in doneDataList"
:tabactive="tabActive" v-show="tabActive === '已结束'"
@click="onClickItem(item)" :key="index"
@delete-reserv="deleteReserv(item)" :item="item"
></task-item> :tabactive="tabActive"
@click="onClickItem(item)"
@delete-reserv="deleteReserv(item)"
></task-item>
</div>
<div v-else>
<el-empty
v-show="classWorkList.length == 0 && !loading"
:description="'暂无'+tabActive+'作业数据'"
style="width: 100%; height: 400px"
></el-empty>
</div>
</div> </div>
<item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog> <item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog>
</el-container> </el-container>
@ -99,6 +110,8 @@ const changeEndDate = (val) => {
// //
const getData = () => { const getData = () => {
classWorkList.value = []
loading.value = true
// 1 // 1
getClassList() getClassList()
// 2 // 2
@ -181,6 +194,9 @@ const getClassWorkList = () => {
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0) classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
//TODO total //TODO total
total.value = response.total total.value = response.total
}else{
classWorkList.value = []
total.value = 0
} }
loading.value = false loading.value = false
}) })
@ -402,9 +418,7 @@ watch(
) )
watch(tabActive, (newVal,oldVal)=>{ watch(tabActive, (newVal,oldVal)=>{
console.log('newVal',newVal); console.log('newVal',newVal);
setTimeout(() => { getData() //
getData() //
}, 300)
}) })
</script> </script>