Browse Source

✨ feat: 增加账号更新时间选择

Pchen. 3 months ago
parent
commit
ffe1f79e5e
2 changed files with 44 additions and 21 deletions
  1. 19 9
      src/pages/admin/lepaoAccount/accountList.vue
  2. 25 12
      src/pages/lepao/accountList/index.vue

+ 19 - 9
src/pages/admin/lepaoAccount/accountList.vue

@@ -8,7 +8,7 @@
                     <a-form :model="queryData" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }"
                         label-align="left">
                         <a-row :gutter="16">
-                            <a-col :span="8">
+                            <a-col :span="6">
                                 <a-form-item field="area" label="跑区">
                                     <a-select v-model="queryData.area" placeholder="请选择乐跑跑区" default-value="">
                                         <a-option value="">所有</a-option>
@@ -18,33 +18,33 @@
                                     </a-select>
                                 </a-form-item>
                             </a-col>
-                            <a-col :span="8">
+                            <a-col :span="6">
                                 <a-form-item field="user_uuid" label="创建人UUID">
                                     <a-input v-model="queryData.user_uuid" allow-clear />
                                 </a-form-item>
                             </a-col>
-                            <a-col :span="8">
+                            <a-col :span="6">
                                 <a-form-item field="email" label="用户邮箱">
                                     <a-input v-model="queryData.email" allow-clear />
                                 </a-form-item>
                             </a-col>
-                            <a-col :span="8">
+                            <a-col :span="6">
                                 <a-form-item field="username" label="账号名称">
                                     <a-input v-model="queryData.username" allow-clear />
                                 </a-form-item>
                             </a-col>
-                            <a-col :span="8">
+                            <a-col :span="6">
                                 <a-form-item field="student_num" label="学号">
                                     <a-input v-model="queryData.student_num" allow-clear />
                                 </a-form-item>
                             </a-col>
-                            <a-col :span="8">
+                            <a-col :span="6">
                                 <a-form-item field="state" label="账号状态">
                                     <a-select v-model="queryData.state" :options="state" placeholder="请选择账号状态"
                                         :default-value="-1" />
                                 </a-form-item>
                             </a-col>
-                            <a-col :span="8">
+                            <a-col :span="6">
                                 <a-form-item field="auto_time" label="乐跑时段">
                                     <a-select v-model="queryData.auto_time" placeholder="请选择自动乐跑时段" :default-value="0">
                                         <a-option :value="0">所有时段</a-option>
@@ -54,6 +54,12 @@
                                     </a-select>
                                 </a-form-item>
                             </a-col>
+                            <a-col :span="6">
+                                <a-form-item field="queryTime" label="更新时间">
+                                    <a-range-picker v-model="queryData.queryTime" show-time format="YY-MM-DD HH:mm"
+                                        value-format="x" @ok="search()" />
+                                </a-form-item>
+                            </a-col>
                         </a-row>
                     </a-form>
                 </a-col>
@@ -83,7 +89,7 @@
                 pageSize: pagination.pagesize,
                 current: pagination.current,
                 total: pagination.total
-            }" @page-change="handlePageChange" @page-size-change="handlePageSizeChange">
+            }" @page-change="handlePageChange" @page-size-change="handlePageSizeChange" >
                 <template #create_user="{ record }">
                     <a-avatar :size="30">
                         <img :alt="record.create_user ?? ''"
@@ -218,6 +224,7 @@ import { ref, reactive, onMounted, h } from 'vue'
 import { addAccount, adminAccountList, deleteAccount, changeAutoRun, singleRun } from '@/api/lepao'
 import { Modal, Notification, Message } from '@arco-design/web-vue'
 import faceModal from '@/components/FaceModal/faceModal.vue'
+import { getSemesterTimestamps } from '@/utils/util'
 
 const faceRecoRef = ref(null)
 const queryData = reactive({
@@ -227,7 +234,8 @@ const queryData = reactive({
     email: '',
     username: '',
     state: -1,
-    auto_time: 0
+    auto_time: 0,
+    queryTime: []
 })
 
 const pagination = reactive({
@@ -363,6 +371,7 @@ const reset = () => {
     queryData.username = ''
     queryData.state = -1
     queryData.auto_time = 0
+    queryData.queryTime = getSemesterTimestamps()
     getAccounts()
 }
 
@@ -547,6 +556,7 @@ const SingleRun = async (item) => {
 }
 
 onMounted(() => {
+    queryData.queryTime = getSemesterTimestamps()
     getAccounts()
 })
 

+ 25 - 12
src/pages/lepao/accountList/index.vue

@@ -47,7 +47,7 @@
           <a-form :model="queryDataForm" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }"
             label-align="left">
             <a-row :gutter="16">
-              <a-col :span="8">
+              <a-col :span="6">
                 <a-form-item field="area" label="跑区">
                   <a-select v-model="queryDataForm.area" placeholder="请选择乐跑跑区" default-value="">
                     <a-option value="">所有跑区</a-option>
@@ -57,27 +57,27 @@
                   </a-select>
                 </a-form-item>
               </a-col>
-              <a-col :span="8">
+              <a-col :span="6">
                 <a-form-item field="email" label="邮箱">
                   <a-input v-model="queryDataForm.email" allow-clear />
                 </a-form-item>
               </a-col>
-              <a-col :span="8">
+              <a-col :span="6">
                 <a-form-item field="username" label="姓名">
                   <a-input v-model="queryDataForm.username" allow-clear />
                 </a-form-item>
               </a-col>
-              <a-col :span="8">
+              <a-col :span="6">
                 <a-form-item field="student_num" label="学号">
                   <a-input v-model="queryDataForm.student_num" allow-clear />
                 </a-form-item>
               </a-col>
-              <a-col :span="8">
+              <a-col :span="6">
                 <a-form-item field="area" label="状态">
                   <a-select v-model="queryDataForm.state" :options="state" placeholder="请选择账号状态" :default-value="-1" />
                 </a-form-item>
               </a-col>
-              <a-col :span="8">
+              <a-col :span="6">
                 <a-form-item field="auto_time" label="乐跑时段">
                   <a-select v-model="queryDataForm.auto_time" placeholder="请选择自动乐跑时段" :default-value="-1">
                     <a-option :value="0">所有时段</a-option>
@@ -87,6 +87,12 @@
                   </a-select>
                 </a-form-item>
               </a-col>
+              <a-col :span="6">
+                <a-form-item field="queryTime" label="更新时间">
+                  <a-range-picker v-model="queryDataForm.queryTime" show-time format="YY-MM-DD HH:mm" value-format="x"
+                    @ok="search()" />
+                </a-form-item>
+              </a-col>
             </a-row>
           </a-form>
         </a-col>
@@ -220,7 +226,7 @@
           </a-table-column>
           <a-table-column title="自动乐跑时段" :width="130" ellipsis tooltip>
             <template #cell="{ record }">
-              {{ record.auto_run ? autoTimeLabel(record) : '-'}}
+              {{ record.auto_run ? autoTimeLabel(record) : '-' }}
             </template>
           </a-table-column>
           <a-table-column title="学期目标" :width="88" ellipsis tooltip>
@@ -236,7 +242,7 @@
               {{ stramptoTime(record.create_time) }}
             </template>
           </a-table-column>
-          <a-table-column title="上次登录时间" :width="145" ellipsis tooltip>
+          <a-table-column title="上次更新时间" :width="145" ellipsis tooltip>
             <template #cell="{ record }">
               {{ record.update_time ? stramptoTime(record.update_time) : '待登录' }}
             </template>
@@ -323,7 +329,7 @@ import userCard from '@/components/userCard/userCard.vue'
 import { isElectron } from '@/utils/electron'
 import faceModal from '@/components/FaceModal/faceModal.vue'
 import { useRoute } from 'vue-router'
-import { getNotice } from '@/utils/util'
+import { getNotice, getSemesterTimestamps } from '@/utils/util'
 
 const notice = ref('')
 
@@ -337,7 +343,8 @@ const queryDataForm = reactive({
   email: '',
   username: '',
   state: -1,
-  auto_time: 0
+  auto_time: 0,
+  queryTime: []
 })
 const queryData = reactive({
   area: '',
@@ -345,7 +352,8 @@ const queryData = reactive({
   email: '',
   username: '',
   state: -1,
-  auto_time: 0
+  auto_time: 0,
+  queryTime: []
 })
 
 const pagination = reactive({
@@ -396,6 +404,7 @@ const search = () => {
   queryData.username = queryDataForm.username
   queryData.state = queryDataForm.state
   queryData.auto_time = queryDataForm.auto_time
+  queryData.queryTime = queryDataForm.queryTime
 
   getAccountsAsync()
 }
@@ -407,6 +416,7 @@ const reset = () => {
   queryDataForm.username = ''
   queryDataForm.state = -1
   queryDataForm.auto_time = 0
+  queryDataForm.queryTime = getSemesterTimestamps()
 
   queryData.area = ''
   queryData.student_num = ''
@@ -414,6 +424,7 @@ const reset = () => {
   queryData.username = ''
   queryData.state = -1
   queryData.auto_time = 0
+  queryData.queryTime = getSemesterTimestamps()
 
   getAccountsAsync()
 }
@@ -488,7 +499,7 @@ const download = (device) => {
   } else if (device === 'android') {
     a.href = 'https:\/\/lepao-cloud.xxoo365.top\/down.php\/3326850aa879cea586677a15af470beb.pdf'
     a.download = 'RunForge-Android操作说明.pdf'
-  } else if(device === 'page') {
+  } else if (device === 'page') {
     a.href = 'https:\/\/download.xxoo365.top'
   } else {
     return
@@ -700,6 +711,8 @@ const stopPolling = () => {
 }
 
 onMounted(async () => {
+  queryData.queryTime = getSemesterTimestamps()
+  queryDataForm.queryTime = getSemesterTimestamps()
   getAccountsAsync()
   GetNotice()
   startPolling()