mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
perf: 签到记录窗口添加打开签到机器人
This commit is contained in:
parent
0f41172468
commit
9b12a829d2
@ -16,6 +16,10 @@
|
||||
</TimelineItem>
|
||||
</Timeline>
|
||||
<div class="setting-checkin-button" @click="calendarShow=true">{{ $L('查看更多签到数据') }}</div>
|
||||
<div class="setting-checkin-button" @click="openBot">
|
||||
{{ $L('打开签到机器人') }}
|
||||
<Loading v-if="openBotIng"/>
|
||||
</div>
|
||||
|
||||
<Divider orientation="left">{{ $L('签到设置') }}</Divider>
|
||||
<div class="setting-checkin-row">
|
||||
@ -82,6 +86,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loadIng: 0,
|
||||
openBotIng: 0,
|
||||
|
||||
formData: [],
|
||||
faceimgs: [],
|
||||
@ -209,7 +214,7 @@ export default {
|
||||
|
||||
latelySection(section) {
|
||||
return section.map(item => {
|
||||
return `${item[0]} - ${item[1] || 'None'}`
|
||||
return `${item[0]} - ${item[1] || 'none'}`
|
||||
}).join('<br/>')
|
||||
},
|
||||
|
||||
@ -238,6 +243,29 @@ export default {
|
||||
}).finally(_ => {
|
||||
this.calendarLoading--;
|
||||
})
|
||||
},
|
||||
|
||||
async openBot() {
|
||||
this.openBotIng++;
|
||||
try {
|
||||
const {data} = await this.$store.dispatch("call", {
|
||||
url: 'users/search',
|
||||
data: {
|
||||
keys: {
|
||||
key: 'check-in@bot.system',
|
||||
bot: 1,
|
||||
}
|
||||
},
|
||||
})
|
||||
if (data.length === 0) {
|
||||
throw new Error('机器人暂未开启');
|
||||
}
|
||||
await this.$store.dispatch("openDialogUserid", data[0].userid)
|
||||
} catch (error) {
|
||||
$A.modalError(error.msg || '机器人暂未开启');
|
||||
} finally {
|
||||
this.openBotIng--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,12 +252,20 @@
|
||||
overflow: auto;
|
||||
}
|
||||
.setting-checkin-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding-bottom: 4px;
|
||||
cursor: pointer;
|
||||
color: #2b85e4;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
> svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
&.submit {
|
||||
position: absolute;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user