style:修改项目列表加载

This commit is contained in:
wyx
2023-01-12 18:05:54 +08:00
parent 83f4c53ad8
commit d1b54fc5f8

View File

@@ -40,6 +40,12 @@
</button>
<button class="searchBtn" @click="resetClick">重置</button>
</div>
<div class="projectList" v-if="isLoading==true" style="display:flex;color:#909399;">
</div>
<div v-else>
{{ loading.close() }}
<div class="projectList" v-if="!projectList.length" style="display:flex;color:#909399;">
<img class="img2" style="margin-left:359px;margin-top:100px;width:148px;height:220px;"
src="../../assets/image/notask.png" />
@@ -79,6 +85,7 @@
已结束
</div>
</div>
</div>
<!-- <div
style="display: flex; justify-content: center; margin-top: 30px"
v-if="projectTotal > 10"
@@ -120,6 +127,7 @@ import { useRouter } from "vue-router";
import store from "@/store";
import { toDate } from "../../api/method";
import { ElMessage } from "element-plus";
import { ElLoading } from 'element-plus';
const projectClassify = [];
const studyProgress = [];
@@ -134,8 +142,17 @@ const endTime = ref(""); //开始时间
const dialogVisible = ref(false)
const userInfo = computed(() => store.state.userInfo);
const isLoading = ref(false);
const loading = ref(false);
//获取项目列表--------start------------------------------------
const getProject = () => {
isLoading.value = true;
loading.value = ElLoading.service({
lock: true,
text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)'
})
request(PROJECT_LIST, {
beginTime: beginTime.value,
endTime: endTime.value,
@@ -149,10 +166,13 @@ const getProject = () => {
projectList.value = res.data.rows;
projectTotal.value = Number(res.data.total);
console.log("projectTotal.value", projectTotal.value);
isLoading.value = false;
}
})
.catch((err) => {
console.log("获取失败", err);
projectList.value = [];
isLoading.value = false;
});
};
getProject();