style:添加路径图的loading

This commit is contained in:
lixg
2022-11-07 18:25:47 +08:00
parent 3c116c185a
commit 0e93785409
3 changed files with 25 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
function formatNumber(n) {
n = n.toString();
return n[1] ? n : "0" + n;
@@ -161,8 +162,12 @@ function autoComma(number) {
return 0;
}
}
const commonData={
timeout:50
}
export {
toDate,
getWeek,
autoComma,
commonData,
}

View File

@@ -443,7 +443,7 @@ textarea {
.aeLoading {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.05);
background: rgba(0, 0, 0, 0.2);
display: flex;
align-items: center;
justify-content: center;

View File

@@ -226,22 +226,8 @@
<button class="samtn btn2" @click="createLearnPath">确定</button>
</div>
</div>
<div
style="
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
position:absolute;
z-index: 100;
left:0;
top:0;
"
v-if="true"
>
<a-spin :spinning="true" />
<div class="aeLoading" :style="{display:lpLoading?'flex':'none'}">
<a-spin :spinning="lpLoading" tip="添加中..." />
</div>
</div>
@@ -604,7 +590,7 @@ import QueryRight from "../../components/drawers/QueryRight";
import ManageRight from "../../components/drawers/ManageRight";
import * as api from "../../api/index1";
import { message } from "ant-design-vue";
import { toDate } from "../../api/method";
import { toDate,commonData } from "../../api/method";
import { storage } from "../../api/storage";
export default {
name: "learningPath",
@@ -734,6 +720,8 @@ export default {
routeStudentsNum: 0,
recallPathId: null, //撤回路径id
stopPathId: null, //停用路径id
lpLoading:false,
});
const selectProjectName = (value, index) => {
@@ -1300,7 +1288,7 @@ export default {
// message.destroy();
// return message.warning("请选择归属组织");
// }
// state.createLoading = true;
state.lpLoading = true;
let obj = {
name: state.pathName,
picUrl: "",
@@ -1310,19 +1298,19 @@ export default {
api
.createLearnPath(obj)
.then((res) => {
console.log("创建成功", res);
message.destroy();
message.success("创建成功");
router.push("/leveladd");
// setTimeout(() => {
// console.log("创建成功", res);
// message.destroy();
// message.success("创建成功");
// // state.createLoading = false;
// state.currentPage = 1;
// router.push("/leveladd");
// // getLearnPath();
// }, 1000);
// console.log("创建成功", res);
// message.destroy();
// message.success("创建成功");
// router.push("/leveladd");
setTimeout(() => {
console.log("创建成功", res);
message.destroy();
message.success("创建成功");
state.lpLoading = false;
state.currentPage = 1;
router.push("/leveladd");
// getLearnPath();
}, commonData.timeout);
})
.catch((err) => {
console.log("创建失败", err);