Browse Source

增加邮箱格式检查

Pchen. 10 months ago
parent
commit
9cc34f153b
1 changed files with 16 additions and 2 deletions
  1. 16 2
      src/pages/lepao/accountList/index.vue

+ 16 - 2
src/pages/lepao/accountList/index.vue

@@ -36,6 +36,14 @@
         </template>
 
         <template #columns>
+          <a-table-column title="" :width="60" data-index="user_avatar" tooltip>
+            <template #cell="{ record }">
+              <a-avatar>
+                <img :alt="record.name ?? ''"
+                  :src="record.user_avatar" />
+              </a-avatar>
+            </template>
+          </a-table-column>
           <a-table-column title="学号" :width="120" data-index="student_num" ellipsis tooltip :filterable="{
             filter: (value, record) => (record.student_num ?? '').includes(value),
             slotName: 'name-filter',
@@ -117,7 +125,7 @@
               <a-tag color="red" v-else>关闭</a-tag>
             </template>
           </a-table-column>
-          <a-table-column title="自动乐跑时段" :width="100" ellipsis tooltip>
+          <a-table-column title="自动乐跑时段" :width="120" ellipsis tooltip>
             <template #cell="{ record }">
               {{ autoTimeLabel(record.auto_time) }}
             </template>
@@ -210,7 +218,7 @@ import { Modal, Notification, Message } from '@arco-design/web-vue'
 import { IconSearch } from '@arco-design/web-vue/es/icon'
 import userCard from './components/userCard.vue'
 
-const area = ["兰花湖校区跑区", "主校区北跑区", "主校区南跑区", "江北校区跑区"]
+const area = ["兰花湖校区跑区", "主校区北跑区", "主校区南跑区"]
 const distance = [
   { label: '女生(1.6~2Km)', value: [1.60, 2.00] },
   { label: '男生(2.0~2.4Km)', value: [2.00, 2.40] }
@@ -304,6 +312,12 @@ const handleBeforeOk = async (done) => {
       return false
     }
 
+    const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
+    if(!emailRegex.test(email)) {
+      Message.error('请检查邮箱格式是否正确')
+      return false
+    }
+
     let data = {
       ...form,
       min_distance: form.distance[0],