Commit 3208a148 by zhuxiaomei

生成的加载

parent 53b0f40f
...@@ -101,13 +101,24 @@ export default { ...@@ -101,13 +101,24 @@ export default {
this.$toast.loading({ this.$toast.loading({
duration: 0, duration: 0,
message: '随机生成中...', message: '随机生成中...',
loadingType: 'spinner',
forbidClick: true, forbidClick: true,
}); });
let result = await samplingPlan.generateSampler({count: this.count, planId: this.planId}) let result = await samplingPlan.generateSampler({count: this.count, planId: this.planId})
if (result) { if (result) {
let second = 3;
const timer = setInterval(() => {
second--;
if (second) {
//
} else {
clearInterval(timer);
// 手动清除 Toast
this.$toast('生成成功!') this.$toast('生成成功!')
this.userList = result this.userList = result
} }
}, 1000);
}
} else { } else {
this.$toast("请输入随机数量") this.$toast("请输入随机数量")
} }
...@@ -150,13 +161,24 @@ export default { ...@@ -150,13 +161,24 @@ export default {
this.$toast.loading({ this.$toast.loading({
duration: 0, duration: 0,
message: '随机生成中...', message: '随机生成中...',
loadingType: 'spinner',
forbidClick: true, forbidClick: true,
}); });
let result = await samplingPlan.generatePlace({count: this.locCount, planId: this.planId}) let result = await samplingPlan.generatePlace({count: this.locCount, planId: this.planId})
if (result) { if (result) {
let second = 3;
const timer = setInterval(() => {
second--;
if (second) {
//
} else {
clearInterval(timer);
// 手动清除 Toast
this.$toast('生成成功!') this.$toast('生成成功!')
this.locList = result this.locList = result
} }
}, 1000);
}
} else { } else {
this.$toast("请输入随机数量") this.$toast("请输入随机数量")
} }
......
...@@ -97,14 +97,24 @@ export default { ...@@ -97,14 +97,24 @@ export default {
this.$toast.loading({ this.$toast.loading({
duration: 0, duration: 0,
message: '随机生成中...', message: '随机生成中...',
loadingType: 'spinner',
forbidClick: true, forbidClick: true,
}); });
let result = await samplingPlan.generateSampler({count: this.count, planId: this.planId}) let result = await samplingPlan.generateSampler({count: this.count, planId: this.planId})
if (result) { if (result) {
// this.$toast.clear(); let second = 3;
const timer = setInterval(() => {
second--;
if (second) {
//
} else {
clearInterval(timer);
// 手动清除 Toast
this.$toast('生成成功!') this.$toast('生成成功!')
this.userList = result this.userList = result
} }
}, 1000);
}
} else { } else {
this.$toast("请输入随机数量") this.$toast("请输入随机数量")
} }
...@@ -147,14 +157,24 @@ export default { ...@@ -147,14 +157,24 @@ export default {
this.$toast.loading({ this.$toast.loading({
duration: 0, duration: 0,
message: '随机生成中...', message: '随机生成中...',
loadingType: 'spinner',
forbidClick: true, forbidClick: true,
}); });
let result = await samplingPlan.generatePlace({count: this.locCount, planId: this.planId}) let result = await samplingPlan.generatePlace({count: this.locCount, planId: this.planId})
if (result) { if (result) {
// this.$toast.clear(); let second = 3;
const timer = setInterval(() => {
second--;
if (second) {
//
} else {
clearInterval(timer);
// 手动清除 Toast
this.$toast('生成成功!') this.$toast('生成成功!')
this.locList = result this.locList = result
} }
}, 1000);
}
} else { } else {
this.$toast("请输入随机数量") this.$toast("请输入随机数量")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment