|
|
@@ -260,6 +260,7 @@
|
|
|
<template #content>
|
|
|
<a-doption @click="editAccount(record)"><icon-edit /> 编辑账号</a-doption>
|
|
|
<!-- <a-doption @click="faceRecoRef.openModal(record)"><icon-video-camera /> 人脸采集</a-doption> -->
|
|
|
+ <a-doption @click="bindBotRef.openModal(record)"><icon-robot-add /> 绑定智能机器人</a-doption>
|
|
|
<a-doption @click="SingleRun(record)"><icon-play-circle /> 开始单次乐跑</a-doption>
|
|
|
<a-doption @click="ChangeAutoRun(record)"><icon-translate /> {{ record.auto_run ? '关闭' :
|
|
|
'开启' }}自动乐跑</a-doption>
|
|
|
@@ -280,7 +281,14 @@
|
|
|
<a-form-item field="student_num" label="学号">
|
|
|
<a-input v-model="form.student_num" placeholder="账号所有者学号,填写错误将无法登录" allow-clear />
|
|
|
</a-form-item>
|
|
|
- <a-form-item field="email" label="通知邮箱">
|
|
|
+ <a-form-item field="notice_type" label="通知类型">
|
|
|
+ <a-radio-group v-model="form.notice_type">
|
|
|
+ <a-radio value="email">邮件</a-radio>
|
|
|
+ <a-radio value="bot">智能机器人</a-radio>
|
|
|
+ <a-radio value="none">无通知</a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item field="email" label="通知邮箱" v-if="form.notice_type === 'email'">
|
|
|
<a-auto-complete :data="email" @search="handleSearch" v-model="form.email" placeholder="用于接收乐跑失败、登录失效的通知"
|
|
|
allow-clear />
|
|
|
</a-form-item>
|
|
|
@@ -318,6 +326,7 @@
|
|
|
</a-modal>
|
|
|
|
|
|
<faceModal :faceInfo="faceInfo" ref="faceRecoRef" />
|
|
|
+ <bindBot ref="bindBotRef" />
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -328,6 +337,7 @@ import { IconSearch } from '@arco-design/web-vue/es/icon'
|
|
|
import userCard from '@/components/userCard/userCard.vue'
|
|
|
import { isElectron } from '@/utils/electron'
|
|
|
import faceModal from '@/components/FaceModal/faceModal.vue'
|
|
|
+import bindBot from '@/components/BindBot/bindBot.vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import { getNotice, getSemesterTimestamps } from '@/utils/util'
|
|
|
|
|
|
@@ -336,6 +346,7 @@ const notice = ref('')
|
|
|
const email = ref([])
|
|
|
const faceInfo = ref({})
|
|
|
const faceRecoRef = ref(null)
|
|
|
+const bindBotRef = ref(null)
|
|
|
|
|
|
const queryDataForm = reactive({
|
|
|
area: '',
|
|
|
@@ -482,6 +493,7 @@ const form = reactive({
|
|
|
area: '',
|
|
|
auto_time: -1,
|
|
|
auto_run: 1,
|
|
|
+ notice_type: 'email',
|
|
|
target_count: 30,
|
|
|
auto_day: [0, 1, 2, 3, 4, 5, 6],
|
|
|
notes: ''
|
|
|
@@ -520,6 +532,7 @@ const editAccount = (item) => {
|
|
|
form.auto_time = item.auto_time
|
|
|
form.auto_run = item.auto_run
|
|
|
form.target_count = item.target_count
|
|
|
+ form.notice_type = item.notice_type || 'email'
|
|
|
form.auto_day = item.auto_day
|
|
|
form.notes = item.notes
|
|
|
} else {
|
|
|
@@ -530,6 +543,7 @@ const editAccount = (item) => {
|
|
|
form.auto_time = -1
|
|
|
form.target_count = 30
|
|
|
form.auto_day = [0, 1, 2, 3, 4, 5, 6]
|
|
|
+ form.notice_type = 'email'
|
|
|
form.area = ''
|
|
|
form.notes = ''
|
|
|
}
|
|
|
@@ -539,8 +553,8 @@ const editAccount = (item) => {
|
|
|
const handleBeforeOk = async (done) => {
|
|
|
try {
|
|
|
ok_loading.value = true
|
|
|
- const { student_num, email } = form
|
|
|
- if (!student_num || !email) {
|
|
|
+ const { student_num, email, notice_type } = form
|
|
|
+ if (!student_num || (!email && notice_type === 'email')) {
|
|
|
Message.error('请填写完整的账号信息')
|
|
|
return false
|
|
|
}
|
|
|
@@ -552,7 +566,7 @@ const handleBeforeOk = async (done) => {
|
|
|
}
|
|
|
|
|
|
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
|
|
|
- if (!emailRegex.test(email)) {
|
|
|
+ if (notice_type === 'email' && !emailRegex.test(email)) {
|
|
|
Message.error('请检查邮箱格式是否正确')
|
|
|
return false
|
|
|
}
|
|
|
@@ -571,8 +585,12 @@ const handleBeforeOk = async (done) => {
|
|
|
}
|
|
|
|
|
|
Message.success('保存成功!')
|
|
|
+ if (form.notice_type === 'bot' && res.data) {
|
|
|
+ bindBotRef.value.openModal(res.data)
|
|
|
+ }
|
|
|
done()
|
|
|
getAccountsAsync()
|
|
|
+
|
|
|
} catch (error) {
|
|
|
Notification.error({
|
|
|
title: '保存乐跑账号失败!',
|