优化限制爬取数量
This commit is contained in:
@@ -34,7 +34,7 @@ export default {
|
||||
setCoinsNum: '设置金币数量',
|
||||
setFansNum: '设置粉丝数量',
|
||||
setQuery: '后台查询频率',
|
||||
setNum: '期望可邀请主播数量',
|
||||
setNum: ' 期望可邀请主播数量',
|
||||
minCoinsNum: '最小金币数量',
|
||||
maxCoinsNum: '最大金币数量',
|
||||
minFansNum: '最小粉丝数量',
|
||||
|
||||
@@ -112,10 +112,15 @@
|
||||
<el-col :span="6">
|
||||
<div class="input-group">
|
||||
<label>{{ $t('workbenchesSetup.setNum') }}</label>
|
||||
<label style="color: #00000070; font-size: 15px;">(到达数量后停止爬取)</label>
|
||||
<el-button type="primary" @click="isLimit = true"
|
||||
:disabled="!pyData.isStart">设置爬取数量</el-button>
|
||||
<el-button type="info" @click="isLimit = false"
|
||||
:disabled="!pyData.isStart">不限爬取数量</el-button>
|
||||
<!-- <el-input type='number' v-model="pyData.frequency.hour" @input="handleInputHour" -->
|
||||
<div class="center-justify" style="height: 100% ;">
|
||||
<div v-if="isLimit" class="center-justify">
|
||||
<el-input type='number' v-model="hostNum" :placeholder="$t('workbenchesSetup.num')"
|
||||
style="width: 100% ; margin-bottom: 70px;" :disabled="!pyData.isStart">
|
||||
style="width: 100% ;" :disabled="!pyData.isStart">
|
||||
<template #append>{{ $t('workbenchesSetup.num') }}</template>
|
||||
</el-input>
|
||||
</div>
|
||||
@@ -217,8 +222,12 @@ let pyData = ref({
|
||||
tenantId: getUser().tenantId,
|
||||
userId: getUser().userId,
|
||||
});
|
||||
|
||||
//是否限制查询数量
|
||||
let isLimit = ref(false);
|
||||
//需要查询的主播数
|
||||
let hostNum = ref(0);
|
||||
|
||||
//按钮提交状态
|
||||
let submitting = ref(true);
|
||||
|
||||
@@ -299,11 +308,15 @@ const submit = () => {
|
||||
ElMessage.error('请输入正确的频率区间值');
|
||||
return;
|
||||
}
|
||||
if (hostNum.value <= 0) {
|
||||
ElMessage.error('请输入正确的可邀请数量');
|
||||
return;
|
||||
//是否限制爬取数量
|
||||
if (isLimit.value) {
|
||||
if (hostNum.value <= 0) {
|
||||
ElMessage.error('请输入正确的可邀请数量');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ElMessageBox.confirm(
|
||||
'确认开始爬取数据?',
|
||||
'开始',
|
||||
@@ -335,10 +348,13 @@ const submit = () => {
|
||||
getHostTimer.value = setInterval(() => {
|
||||
fetchDataCount().then((res) => {
|
||||
hostData.value = JSON.parse(res);
|
||||
if (hostData.value.canInvitationCount >= hostNum.value) {
|
||||
unsubmit();
|
||||
alert('爬取完毕')
|
||||
if (isLimit.value) {
|
||||
if (hostData.value.canInvitationCount >= hostNum.value) {
|
||||
unsubmit();
|
||||
alert('爬取完毕')
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}, 1000);
|
||||
getNumTimer.value = setInterval(() => {
|
||||
|
||||
Reference in New Issue
Block a user