liyongli 1 anno fa
parent
commit
23620f2638
1 ha cambiato i file con 20 aggiunte e 8 eliminazioni
  1. 20 8
      src/view/finance/index.vue

+ 20 - 8
src/view/finance/index.vue

@@ -11,7 +11,7 @@
       placeholder="请输入搜索关键词"
     />
     <van-tabs :color="theme" :background="background">
-      <van-tab :title="i" v-for="(v, i) in orilist" :key="i">
+      <van-tab :title="_sort[i]" v-for="(v, i) in orilist" :key="i">
         <van-row gutter="8">
           <van-col
             span="12"
@@ -148,7 +148,8 @@ const showPaihang = ref(false);
 const showLogin = ref(false);
 
 const rankList = ref({});
-const orilist = ref({});
+const orilist = ref([]);
+const _sort = ['党建引领', '金融知识', '风险防范', '金融服务', '优秀宣讲员'];
 
 const ids = ref({});
 const codePhoen = ref(0);
@@ -171,13 +172,14 @@ const getList = call => {
     operateId,
   }).then(r => {
     const array = r || [];
-    const obj = {};
+    const obj = [];
     const ids_list = [];
     for (let i = 0; i < array.length; i++) {
       const v = array[i];
       v.noShow = false;
-      if (obj[v.type]) obj[v.type].push(v);
-      else obj[v.type] = [v];
+      const num = getIndex(v.type);
+      if (obj[num]) obj[num].push(v);
+      else obj[num] = [v];
 
       ids_list[v.phone] = {
         select: false,
@@ -192,6 +194,17 @@ const getList = call => {
 };
 getList();
 
+const getIndex = key => {
+  const sort_list = {
+    党建引领: 0,
+    金融知识: 1,
+    风险防范: 2,
+    金融服务: 3,
+    优秀宣讲员: 4,
+  };
+  return sort_list[key] || 0;
+};
+
 const getRankList = Call => {
   getEnrollRank({
     operateId,
@@ -213,9 +226,8 @@ watch(search, res => {
   if (time) clearTimeout(time);
   time = setTimeout(() => {
     const rex = res ? new RegExp(res) : /[.\n]*/;
-    for (const key in orilist.value) {
-      if (!Object.hasOwnProperty.call(orilist.value, key)) continue;
-      const v = orilist.value[key];
+    for (let o = 0; o < orilist.value.length; o++) {
+      const v = orilist.value[o];
       for (let i = 0; i < v.length; i++) {
         const vv = v[i];
         vv.noShow = !rex.test(vv.name) && !rex.test(vv.university);