|
|
@@ -190,7 +190,7 @@
|
|
|
<a-input v-model="form.student_num" placeholder="账号所有者学号,填写错误将无法登录" />
|
|
|
</a-form-item>
|
|
|
<a-form-item field="email" label="通知邮箱">
|
|
|
- <a-input v-model="form.email" placeholder="用于接收乐跑失败、登录失效的通知" />
|
|
|
+ <a-auto-complete :data="email" @search="handleSearch" v-model="form.email" placeholder="用于接收乐跑失败、登录失效的通知" />
|
|
|
</a-form-item>
|
|
|
<a-form-item field="area" label="乐跑跑区">
|
|
|
<a-select v-model="form.area" placeholder="请选择乐跑跑区" default-value="">
|
|
|
@@ -227,13 +227,41 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, reactive, h } from 'vue'
|
|
|
-import { useUserStore } from '@/store/modules/user'
|
|
|
import { accountList, deleteAccount, addAccount, changeAutoRun, singleRun } from '@/api/lepao'
|
|
|
import { Modal, Notification, Message } from '@arco-design/web-vue'
|
|
|
import { IconSearch } from '@arco-design/web-vue/es/icon'
|
|
|
import userCard from '@/components/userCard/userCard.vue'
|
|
|
import { isElectron } from '@/utils/electron'
|
|
|
|
|
|
+const email = ref([])
|
|
|
+const handleSearch = (value) => {
|
|
|
+ const emailSuffix = ["qq.com", "ctbu.edu.cn"]
|
|
|
+ const input = (value || "").trim()
|
|
|
+
|
|
|
+ if (!input) {
|
|
|
+ email.value = []
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 没有输入 @,直接拼接所有后缀
|
|
|
+ if (!input.includes("@")) {
|
|
|
+ email.value = emailSuffix.map(suffix => `${input}@${suffix}`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 输入了 @ 但结尾是 @,拼接所有后缀
|
|
|
+ if (input.endsWith("@")) {
|
|
|
+ email.value = emailSuffix.map(suffix => `${input}${suffix}`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 输入了 @ 且有部分后缀,智能匹配
|
|
|
+ const [prefix, suffixPart] = input.split("@")
|
|
|
+ email.value = emailSuffix
|
|
|
+ .filter(suffix => suffix.startsWith(suffixPart))
|
|
|
+ .map(suffix => `${prefix}@${suffix}`)
|
|
|
+}
|
|
|
+
|
|
|
const area = ["兰花湖校区跑区", "主校区北跑区", "主校区南跑区"]
|
|
|
const distance = [
|
|
|
{ label: '女生(1.6~2Km)', value: [1.60, 2.00] },
|
|
|
@@ -254,13 +282,6 @@ const autoTimeLabel = (val) => {
|
|
|
const data = ref([])
|
|
|
const loading = ref(false)
|
|
|
|
|
|
-const email = ref('')
|
|
|
-const getuser = async () => {
|
|
|
- const userStore = useUserStore()
|
|
|
- let userInfo = await userStore.getInfo()
|
|
|
- email.value = userInfo.email
|
|
|
-}
|
|
|
-
|
|
|
const visible = ref(false)
|
|
|
const ok_loading = ref(false)
|
|
|
const form = reactive({
|
|
|
@@ -439,7 +460,6 @@ const stramptoTime = (time) => {
|
|
|
}
|
|
|
|
|
|
getAccounts()
|
|
|
-getuser()
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|