Browse Source

✨ feat: 增加乐跑记录时间选择

Pchen. 4 months ago
parent
commit
f72ad55b43

+ 15 - 3
src/pages/admin/lepaoRecords/lepaoRecords.vue

@@ -24,6 +24,12 @@
                   <a-input v-model="queryData.email" placeholder="请输入通知邮箱" allow-clear />
                   <a-input v-model="queryData.email" placeholder="请输入通知邮箱" allow-clear />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
+              <a-col :span="12">
+                <a-form-item field="queryTime" label="乐跑时间">
+                  <a-range-picker v-model="queryData.queryTime" show-time format="YYYY-MM-DD HH:mm" value-format="x"
+                    @ok="getRecords()" />
+                </a-form-item>
+              </a-col>
             </a-row>
             </a-row>
           </a-form>
           </a-form>
         </a-col>
         </a-col>
@@ -146,10 +152,11 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { ref, reactive, h } from 'vue'
+import { ref, reactive, onMounted, h } from 'vue'
 import { adminLepaoRecords } from '@/api/lepao'
 import { adminLepaoRecords } from '@/api/lepao'
 import { Notification } from '@arco-design/web-vue'
 import { Notification } from '@arco-design/web-vue'
 import { IconSearch } from '@arco-design/web-vue/es/icon'
 import { IconSearch } from '@arco-design/web-vue/es/icon'
+import { getSemesterTimestamps } from '@/utils/util'
 
 
 const data = ref([])
 const data = ref([])
 const loading = ref(false)
 const loading = ref(false)
@@ -157,7 +164,8 @@ const loading = ref(false)
 const queryData = reactive({
 const queryData = reactive({
   name: '',
   name: '',
   lepao_account: '',
   lepao_account: '',
-  email: ''
+  email: '',
+  queryTime: []
 })
 })
 
 
 const pagination = reactive({
 const pagination = reactive({
@@ -177,6 +185,7 @@ const reset = () => {
   queryData.lepao_account = ''
   queryData.lepao_account = ''
   queryData.email = ''
   queryData.email = ''
   queryData.area = ''
   queryData.area = ''
+  queryData.queryTime = getSemesterTimestamps()
   getRecords()
   getRecords()
 }
 }
 
 
@@ -238,7 +247,10 @@ function formatSecondsToMinSec(totalSeconds) {
   return `${minutes}分${seconds.toString().padStart(2, '0')}秒`;
   return `${minutes}分${seconds.toString().padStart(2, '0')}秒`;
 }
 }
 
 
-getRecords()
+onMounted(() => {
+  queryData.queryTime = getSemesterTimestamps()
+  getRecords()
+})
 </script>
 </script>
 
 
 <style scoped lang="less">
 <style scoped lang="less">

+ 20 - 5
src/pages/lepao/lepaoRecords/index.vue

@@ -24,6 +24,12 @@
                   <a-input v-model="queryData.email" placeholder="请输入通知邮箱" allow-clear />
                   <a-input v-model="queryData.email" placeholder="请输入通知邮箱" allow-clear />
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
+              <a-col :span="12">
+                <a-form-item field="queryTime" label="乐跑时间">
+                  <a-range-picker v-model="queryData.queryTime" show-time format="YYYY-MM-DD HH:mm" value-format="x"
+                    @ok="getRecords()" />
+                </a-form-item>
+              </a-col>
             </a-row>
             </a-row>
           </a-form>
           </a-form>
         </a-col>
         </a-col>
@@ -148,14 +154,15 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { ref, reactive, h } from 'vue'
+import { ref, reactive, onMounted, h } from 'vue'
 import { lepaoRecords } from '@/api/lepao'
 import { lepaoRecords } from '@/api/lepao'
 import { Notification } from '@arco-design/web-vue'
 import { Notification } from '@arco-design/web-vue'
 import { IconSearch } from '@arco-design/web-vue/es/icon'
 import { IconSearch } from '@arco-design/web-vue/es/icon'
 import { useUserStore } from '@/store/modules/user'
 import { useUserStore } from '@/store/modules/user'
 import { useRoute } from 'vue-router'
 import { useRoute } from 'vue-router'
-import { getNotice } from '@/utils/util'
+import { getNotice, getSemesterTimestamps } from '@/utils/util'
 
 
+console.log(getSemesterTimestamps())
 const notice = ref('')
 const notice = ref('')
 
 
 const GetNotice = async () => {
 const GetNotice = async () => {
@@ -178,7 +185,8 @@ getuser()
 const queryData = reactive({
 const queryData = reactive({
   name: '',
   name: '',
   lepao_account: '',
   lepao_account: '',
-  email: ''
+  email: '',
+  queryTime: []
 })
 })
 
 
 const pagination = reactive({
 const pagination = reactive({
@@ -198,6 +206,7 @@ const reset = () => {
   queryData.lepao_account = ''
   queryData.lepao_account = ''
   queryData.email = ''
   queryData.email = ''
   queryData.area = ''
   queryData.area = ''
+  queryData.queryTime = getSemesterTimestamps()
   getRecords()
   getRecords()
 }
 }
 
 
@@ -209,6 +218,7 @@ const getRecords = async () => {
       pagesize: pagination.pagesize,
       pagesize: pagination.pagesize,
       current: pagination.current
       current: pagination.current
     }
     }
+    console.log(reqData)
     const res = await lepaoRecords(reqData)
     const res = await lepaoRecords(reqData)
     if (!res || res.code !== 0)
     if (!res || res.code !== 0)
       return Notification.error({
       return Notification.error({
@@ -259,8 +269,13 @@ function formatSecondsToMinSec(totalSeconds) {
   return `${minutes}分${seconds.toString().padStart(2, '0')}秒`;
   return `${minutes}分${seconds.toString().padStart(2, '0')}秒`;
 }
 }
 
 
-getRecords()
-GetNotice()
+
+
+onMounted(() => {
+  queryData.queryTime = getSemesterTimestamps()
+  getRecords()
+  GetNotice()
+})
 </script>
 </script>
 
 
 <style scoped lang="less">
 <style scoped lang="less">