Browse Source

🎈 perf: 优化若干内容

Pchen. 4 months ago
parent
commit
de426b0f0e

+ 0 - 112
src/components/FaceModal/faceModal.vue

@@ -1,112 +0,0 @@
-<template>
-    <a-modal v-model:visible="visible" title="人脸采集" hide-cancel mask-closable esc-to-close draggable width="auto">
-        <div class="container">
-            <div class="left">
-                <canvas ref="qrcodeCanvas"></canvas>
-            </div>
-            <div class="line"></div>
-            <div class="right">
-                <div class="faceCode">
-                    <div class="title">人脸采集码</div>
-                    <div class="value">{{ faceInfo.face_code }}</div>
-                </div>
-                <div>
-                    <div class="title">采集链接</div>
-                    <div class="value">
-                        <a :href="faceurl" target="_blank">{{ faceurl }}</a>
-                    </div>
-                </div>
-                <div v-if="faceInfo.face_time">
-                    <div class="title">上次采集时间</div>
-                    <div class="value">
-                       {{ stramptoTime(faceInfo.face_time) }}
-                    </div>
-                </div>
-                <div v-if="faceInfo.face_url">
-                    <div class="title">视频链接</div>
-                    <div class="value">
-                        <a :href="faceInfo.face_url" target="_blank">{{ faceInfo.face_url }}</a>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </a-modal>
-</template>
-
-<script setup>
-import { ref } from 'vue'
-import QRCode from 'qrcode'
-
-const visible = ref(false)
-const faceInfo = ref({})
-
-const qrcodeCanvas = ref(null)
-const faceurl = ref('')
-
-function openModal(record) {
-    if (!record) return
-    faceInfo.value = record
-    faceurl.value = `https://xxoo365.top/#/faceReco?code=${record.face_code}`
-
-    QRCode.toCanvas(qrcodeCanvas.value, faceurl.value, { width: 200 }, function (error) {
-        if (error) {
-            console.error(error)
-            return
-        }
-
-        // 绘制 logo
-        const ctx = qrcodeCanvas.value.getContext('2d')
-        const logo = new Image()
-        logo.src = '/logo.svg'
-        logo.onload = () => {
-            const canvasSize = qrcodeCanvas.value.width
-            const logoSize = canvasSize * 0.15 // logo 占二维码宽度的百分比
-            const x = (canvasSize - logoSize) / 2
-            const y = (canvasSize - logoSize) / 2
-            ctx.drawImage(logo, x, y, logoSize, logoSize)
-        }
-    })
-
-    visible.value = true
-}
-
-const stramptoTime = (time) => {
-    return new Date(time).toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' })
-}
-
-defineExpose({ openModal })
-</script>
-
-<style lang="less" scoped>
-.container {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    gap: 20px;
-
-    .line {
-        border: 1px solid #999;
-        height: 150px;
-    }
-
-    .right {
-        display: flex;
-        flex-direction: column;
-        gap: 15px;
-
-        .title {
-            font-family: Arial, Helvetica, sans-serif;
-            font-size: 1.2em;
-            color: #666;
-            user-select: none;
-        }
-
-        .faceCode {
-            .value {
-                font-size: 2.5em;
-                font-weight: bold;
-            }
-        }
-    }
-}
-</style>

+ 5 - 5
src/pages/lepao/accountList/index.vue

@@ -116,10 +116,10 @@
               </a-avatar>
               </a-avatar>
             </template>
             </template>
           </a-table-column>
           </a-table-column>
-          <a-table-column title="学号" :width="105" data-index="student_num" ellipsis tooltip></a-table-column>
+          <a-table-column title="学号" :width="108" data-index="student_num"></a-table-column>
           <a-table-column title="姓名" :width="100">
           <a-table-column title="姓名" :width="100">
             <template #cell="{ record }">
             <template #cell="{ record }">
-              {{ record.name ?? '请使用乐跑登录器更新账号信息' }}
+              {{ record.name ?? '-' }}
             </template>
             </template>
           </a-table-column>
           </a-table-column>
           <a-table-column title="性别" :width="70" ellipsis tooltip :filterable="{
           <a-table-column title="性别" :width="70" ellipsis tooltip :filterable="{
@@ -179,7 +179,7 @@
           </a-table-column>
           </a-table-column>
           <a-table-column title="自动乐跑时段" :width="130" ellipsis tooltip>
           <a-table-column title="自动乐跑时段" :width="130" ellipsis tooltip>
             <template #cell="{ record }">
             <template #cell="{ record }">
-              {{ autoTimeLabel(record) }}
+              {{ record.auto_run ? autoTimeLabel(record) : '-'}}
             </template>
             </template>
           </a-table-column>
           </a-table-column>
           <a-table-column title="乐跑次数" :width="88" ellipsis tooltip>
           <a-table-column title="乐跑次数" :width="88" ellipsis tooltip>
@@ -224,13 +224,13 @@
     :ok-loading="ok_loading" esc-to-close closable>
     :ok-loading="ok_loading" esc-to-close closable>
     <a-form :model="form">
     <a-form :model="form">
       <a-form-item field="student_num" label="学号">
       <a-form-item field="student_num" label="学号">
-        <a-input v-model="form.student_num" placeholder="账号所有者学号" allow-clear />
+        <a-input v-model="form.student_num" placeholder="乐跑账号" allow-clear />
       </a-form-item>
       </a-form-item>
       <a-form-item field="password" label="密码" v-if="!form.id">
       <a-form-item field="password" label="密码" v-if="!form.id">
         <a-input-password v-model="form.password" placeholder="乐跑账号密码,填写错误将无法添加账号" allow-clear />
         <a-input-password v-model="form.password" placeholder="乐跑账号密码,填写错误将无法添加账号" allow-clear />
       </a-form-item>
       </a-form-item>
       <a-form-item field="email" label="通知邮箱">
       <a-form-item field="email" label="通知邮箱">
-        <a-auto-complete :data="email" @search="handleSearch" v-model="form.email" placeholder="用于接收乐跑失败、登录失效的通知"
+        <a-auto-complete :data="email" @search="handleSearch" v-model="form.email" placeholder="用于接收乐跑成功、失败的通知"
           allow-clear />
           allow-clear />
       </a-form-item>
       </a-form-item>
       <a-form-item field="area" label="乐跑跑区">
       <a-form-item field="area" label="乐跑跑区">

+ 1 - 1
src/router/index.js

@@ -77,7 +77,7 @@ const routes = [
         component: DEFAULT_LAYOUT,
         component: DEFAULT_LAYOUT,
         meta: {
         meta: {
             title: '校园乐跑',
             title: '校园乐跑',
-            icon: 'icon-dashboard'
+            icon: 'icon-thunderbolt'
         },
         },
         children: [
         children: [
             {
             {