瀏覽代碼

feat:时间筛选

ljc 1 月之前
父節點
當前提交
d9cfac94f8
共有 2 個文件被更改,包括 13 次插入17 次删除
  1. 4 7
      pages/ib/accountList.vue
  2. 9 10
      pages/ib/recording.vue

+ 4 - 7
pages/ib/accountList.vue

@@ -31,7 +31,7 @@
 
 <script setup lang="ts">
   // 账户管理
-  import { ref, nextTick } from 'vue'
+  import { ref,reactive, nextTick } from 'vue'
   import { useI18n } from 'vue-i18n'
   import { ibApi } from '@/service/ib'
   import { useFilters } from '@/composables/useFilters'
@@ -40,7 +40,7 @@
   const { t } = useI18n()
 
   const searchParams = ref({})
-  const search = ref({
+  const search = reactive({
     cId: '',
     login: '',
     platform: 'MT4',
@@ -64,17 +64,14 @@
 
   const handleSearch = (params: any) => {
     const payload = { ...params }
-    search.value = payload
+    Object.assign(search, payload)
     nextTick(() => {
       tableRef.value?.refreshTable?.()
     })
   }
 
   const handleReset = (params: any) => {
-    search.value = {
-      ...params,
-      platform: 'MT4',
-    }
+    Object.assign(search, params,{platform: 'MT4'})
     nextTick(() => {
       tableRef.value?.refreshTable?.()
     })

+ 9 - 10
pages/ib/recording.vue

@@ -112,9 +112,11 @@
   const searchParams = ref({
     types: 1,
     date: defaultDateRange,
+    startDate: defaultDateRange[0],
+    endDate: defaultDateRange[1],
   })
 
-  const search = ref({
+  const search = reactive({
     types: 1,
     startDate: defaultDateRange[0],
     endDate: defaultDateRange[1],
@@ -143,7 +145,7 @@
 
   const handleSearch = (params: any) => {
     const payload = { ...params }
-    search.value = payload
+    Object.assign(search, payload)
     nextTick(() => {
       tableRef.value?.refreshTable?.()
     })
@@ -154,10 +156,7 @@
       ...params,
       types: 1,
     }
-    search.value = {
-      ...params,
-      types: 1,
-    }
+    Object.assign(search, params,{ types: 1,})
     nextTick(() => {
       tableRef.value?.refreshTable?.()
     })
@@ -168,12 +167,12 @@
   })
   // 表格列配置 根据types 切换
   const columns = computed(() => {
-    return columnList.value[search.value.types]
+    return columnList.value[search.types]
   })
 
   const mobilePrimaryFields = computed(() => {
     return [
-      ...mobileList.value[search.value.types],
+      ...mobileList.value[search.types],
       {
         prop: 'more',
         type: 'more',
@@ -186,7 +185,7 @@
   // 接口 根据types 切换
   const listApi = computed(() => {
     let other = {}
-    switch (search.value.types) {
+    switch (search.types) {
       case 1:
         other = {
           mamType: 0,
@@ -205,7 +204,7 @@
         break
     }
 
-    return (params) => ibApi[apiList.value[search.value.types]]({ ...params, ...other })
+    return (params) => ibApi[apiList.value[search.types]]({ ...params, ...other })
   })
 
   const cancel = async (id) => {