mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 签到记录窗口添加打开签到机器人
This commit is contained in:
parent
0f41172468
commit
9b12a829d2
@ -16,6 +16,10 @@
|
|||||||
</TimelineItem>
|
</TimelineItem>
|
||||||
</Timeline>
|
</Timeline>
|
||||||
<div class="setting-checkin-button" @click="calendarShow=true">{{ $L('查看更多签到数据') }}</div>
|
<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>
|
<Divider orientation="left">{{ $L('签到设置') }}</Divider>
|
||||||
<div class="setting-checkin-row">
|
<div class="setting-checkin-row">
|
||||||
@ -82,6 +86,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loadIng: 0,
|
loadIng: 0,
|
||||||
|
openBotIng: 0,
|
||||||
|
|
||||||
formData: [],
|
formData: [],
|
||||||
faceimgs: [],
|
faceimgs: [],
|
||||||
@ -209,7 +214,7 @@ export default {
|
|||||||
|
|
||||||
latelySection(section) {
|
latelySection(section) {
|
||||||
return section.map(item => {
|
return section.map(item => {
|
||||||
return `${item[0]} - ${item[1] || 'None'}`
|
return `${item[0]} - ${item[1] || 'none'}`
|
||||||
}).join('<br/>')
|
}).join('<br/>')
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -238,6 +243,29 @@ export default {
|
|||||||
}).finally(_ => {
|
}).finally(_ => {
|
||||||
this.calendarLoading--;
|
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;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
.setting-checkin-button {
|
.setting-checkin-button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
padding-bottom: 4px;
|
padding-bottom: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #2b85e4;
|
color: #2b85e4;
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
> svg {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.submit {
|
&.submit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user