Selaa lähdekoodia

用户列表重置默认给上筛选条件

wangzhiqiang 2 kuukautta sitten
vanhempi
commit
0adc3f53c1
1 muutettua tiedostoa jossa 16 lisäystä ja 7 poistoa
  1. 16 7
      src/views/main/userModule/userList.vue

+ 16 - 7
src/views/main/userModule/userList.vue

@@ -269,6 +269,7 @@
   }
 
 
+  const firstApp = ref('')
   //渠道来源
   const getApiOptions = async() => {
     try {
@@ -294,9 +295,10 @@
 
       // 如果有应用列表,默认选第一个
       if (appsOptions.length > 0) {
-        const firstApp = appsOptions[0].value
-        dynamicFormItems.value[2].defaultVal = firstApp
-        formSearch.value.appIds = firstApp
+        // const firstApp = appsOptions[0].value
+        firstApp.value = appsOptions[0].value
+        dynamicFormItems.value[2].defaultVal = firstApp.value
+        formSearch.value.appIds = firstApp.value
       }
 
       // 获取列表数据
@@ -339,7 +341,13 @@
     formSearch.value.userId = formData.userId;
     formSearch.value.ditchId = formData.ditchId;
     formSearch.value.userStatus = formData.userStatus;
-    formSearch.value.appIds = formData.appIds;
+    if(formData.appIds) {
+      formSearch.value.appIds = formData.appIds;
+    } else {
+      // 没选应用时候默认选中第一项
+      dynamicFormItems.value[2].defaultVal = firstApp.value
+      formSearch.value.appIds = firstApp.value
+    }
     formSearch.value.registryTimeBegin = convertUTCToBeijing(formData.registryTimeBegin,false) || undefined
     formSearch.value.registryTimeEnd = convertUTCToBeijing(formData.registryTimeEnd,false) || undefined
 
@@ -352,14 +360,15 @@
       nickName: undefined,// 用户昵称
       userId: undefined,// 用户ID
       ditchId: undefined,// 渠道来源
-      userStatus: undefined,// 用户状态
+      userStatus: 1,// 用户状态
       appIds: undefined, //所属应用
-      registryTimeBegin: undefined,// 注册时间
+      registryTimeBegin: getTodayRangeLocal(),// 注册时间
       registryTimeEnd: undefined,// 注册时间
       page: 1,// 当前页码
       limit: 20,// 当前页数量(查询量)
     };
-    getList();
+    // getList();
+    settingData()
   };
 
   const selectData = ref([])