工作台输入框禁用状态,开始按钮禁用状态

This commit is contained in:
2025-04-17 22:36:14 +08:00
parent 91ee2dd7cb
commit 666e27246f
4 changed files with 35 additions and 17 deletions

Binary file not shown.

BIN
dist.zip Normal file

Binary file not shown.

View File

@@ -86,7 +86,7 @@ export function postAxios({ url, data }) {
}).catch(err => {
if (err.message == "Network Error") {
// alert("网络错误,请检查网络连接")
ElMessage.error('网络连接错误');
// ElMessage.error('网络连接错误');
reject('网络连接错误')
} else {

View File

@@ -8,9 +8,9 @@
<div>可邀请: <span>{{ hostData.canInvitationCount }}</span></div>
</div>
<div class="center-line" style="padding-top: 15vh;">
<!-- <div class="center-line" style="padding-top: 15vh;">
<el-button class="open-login" type="primary" @click="openTK">开启tk</el-button>
</div>
</div> -->
<div>
@@ -20,20 +20,20 @@
<div class="from-input-item-title center-justify">
公会账号
</div>
<el-input :disabled="!(isTk && tkData[index].code == 0)" v-model="tkData[index].account"
placeholder="请输入登录账号" clearable />
<el-input :disabled="!(tkData[index].code == 0 && !isLogin[index])"
v-model="tkData[index].account" placeholder="请输入登录账号" clearable />
</div>
<div class="from-input-item">
<div class="from-input-item-title center-justify">
公会密码
</div>
<el-input :disabled="!(isTk && tkData[index].code == 0)" v-model="tkData[index].password"
type="password" placeholder="请输入登录密码" show-password />
<el-input :disabled="!(tkData[index].code == 0 && !isLogin[index])"
v-model="tkData[index].password" type="password" placeholder="请输入登录密码" show-password />
</div>
<el-button class="open-login" style="margin-left: 60px;"
:disabled="!(isTk && tkData[index].code == 0)" type="primary"
:disabled="!(tkData[index].code == 0 && !isLogin[index])" type="primary"
@click="loginTK(index)">登录tk</el-button>
<div v-if="tkData[index].code == 0" class="loginState"></div>
<div v-if="tkData[index].code == 1" class="loginState" style="background-color: green;"></div>
@@ -135,8 +135,9 @@ let hostData = ref({
});
//是否开启tk
let isTk = ref(true);
// let isTk = ref(true);
//账号是否登陆中
let isLogin = ref([false, false]);
//设置状态轮询定时器
let statusTimer = ref(null);
let statusTimerCopy = ref(null);
@@ -176,7 +177,7 @@ let pyData = ref({
});
//按钮提交状态
let submitting = ref(true);
let submitting = ref(false);
onMounted(() => {
//从缓存获取数据
@@ -225,6 +226,20 @@ const submit = () => {
// ElMessage.error('请输入账号密码');
// return;
// }
if (((Number(pyData.value.gold.min) > Number(pyData.value.gold.max)) || (Number(pyData.value.fans.min) > Number(pyData.value.fans.max)))) {
ElMessage.error('请输入正确的区间值');
return;
}
if ((Number(pyData.value.gold.max) <= 0 || Number(pyData.value.fans.max <= 0)) || pyData.value.gold.max == '' || pyData.value.fans.max == '') {
ElMessage.error('请输入正确的区间值');
return;
}
if (Number(pyData.value.frequency.hour) <= 0 || Number(pyData.value.frequency.day <= 0) || pyData.value.frequency.hour == '' || pyData.value.frequency.day == '') {
ElMessage.error('请输入正确的频率区间值');
return;
}
ElMessageBox.confirm(
'确认开始爬取数据?',
'开始',
@@ -312,10 +327,12 @@ const loginTK = (index) => {
index: index
})
if (index == 0) {
isLogin.value[1] = true;
statusTimer = setInterval(() => {
getloginStatus();
}, 2000)
} else if (index == 1) {
isLogin.value[0] = true;
statusTimerCopy = setInterval(() => {
getloginStatusCopy();
}, 2000)
@@ -324,12 +341,12 @@ const loginTK = (index) => {
}
const openTK = () => {
isTk.value = true;
console.log(isTk.value)
loginTikTok();
// const openTK = () => {
// isTk.value = true;
// console.log(isTk.value)
// loginTikTok();
}
// }
function getloginStatus() {
backStageloginStatus().then((res) => {
@@ -340,6 +357,7 @@ function getloginStatus() {
clearInterval(statusTimer);
statusTimer = null;
submitting.value = false
isLogin.value[1] = false;
}
})
}
@@ -352,7 +370,7 @@ function getloginStatusCopy() {
clearInterval(statusTimer);
statusTimer = null;
submitting.value = false
isLogin.value[0] = false;
}
})
}