فهرست منبع

首页调整,加过滤搜索组件

wolyshaw 4 سال پیش
والد
کامیت
445095f194

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
src/components/filter-search/icon.svg


+ 49 - 0
src/components/filter-search/index.vue

@@ -0,0 +1,49 @@
+<template>
+  <div class="filter-search" v-if="$route.query.search">
+    <img src="./icon.svg"/>
+    <span>{{desc}}</span>
+    <i class="el-icon-circle-close" @click="close"/>
+  </div>
+</template>
+<script>
+export default {
+  name: 'filter-search',
+  props: {
+    desc: {
+      type: String,
+      default: '已筛选部分数据'
+    }
+  },
+  methods: {
+    close() {
+      this.$router.replace({
+        query: {
+          ...this.$route.query,
+          search: undefined,
+        }
+      })
+      this.$emit('reload')
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .filter-search{
+    font-size: 14px;
+    margin-left: 10px;
+    display: flex;
+    align-items: center;
+    cursor: pointer;
+    color: #e6a23c;
+    >img{
+      width: 20px;
+      height: auto;
+    }
+    >span{
+      margin: 0 6px
+    }
+    >i{
+      font-size: 16px;
+    }
+  }
+</style>

+ 2 - 0
src/components/install.js

@@ -16,6 +16,7 @@ import tabRouter from '@/components/tab-router'
 import empty from '@/components/empty'
 import autoHeight from '@/components/auto-height'
 import auth from '@/components/Auth'
+import filterSearch from '@/components/filter-search'
 
 export default {
   install(Vue) {
@@ -32,5 +33,6 @@ export default {
     Vue.component(empty.name, empty)
     Vue.component(autoHeight.name, autoHeight)
     Vue.component(auth.name, auth)
+    Vue.component(filterSearch.name, filterSearch)
   }
 }

+ 32 - 7
src/views/main/abnormal/index.vue

@@ -28,7 +28,7 @@
       >
         <el-tag
           :effect="activeKey === item.type ? 'dark' : 'plain'"
-          @click="activeKey = item.type"
+          @click="changeTag(item.type)"
         >{{item.name}}</el-tag>
       </el-badge>
     </div>
@@ -40,7 +40,18 @@
       :key="index"
       :data="item.map(title => ({name: title.desc, num: title.num}))"
     >
-      <el-button type="text">立即处理<i class="el-icon-d-arrow-right"/></el-button>
+      <el-button
+        type="text"
+        v-if="item[0].url && item[0].result"
+        @click="$router.push({
+          path: item[0].url,
+          query: {
+            ...$route.query,
+            ...item[0].query,
+            [item[0].resultKey]: (item[0].result || []).join(',')
+          }
+        })" :disabled="!item[0].result.length"
+      >立即处理<i class="el-icon-d-arrow-right"/></el-button>
     </title-item>
   </div>
 </template>
@@ -55,7 +66,6 @@ export default {
   },
   data() {
     return {
-      activeKey: '',
       search: {
         organIds: []
       },
@@ -64,11 +74,18 @@ export default {
     }
   },
   computed: {
+    activeKey() {
+      let key = ''
+      const { tag } = this.$route.query
+      if (tag) {
+        key = tag
+      } else if (this.tags[0]) {
+        key = this.tags[0].type
+      }
+      return key
+    },
     tags() {
       const tags = this.list.map(item => ({name: item.desc, type: item.errorType}))
-      if (tags.length && !this.activeKey) {
-        this.activeKey = tags[0].type
-      }
       return tags
     },
     activeList() {
@@ -81,6 +98,14 @@ export default {
     this.$store.dispatch('setBranchs')
   },
   methods: {
+    changeTag(type) {
+      this.$router.replace({
+        query: {
+          ...this.$route.query,
+          tag: type
+        }
+      })
+    },
     formatData(data) {
       const list = {}
       for (const item of data) {
@@ -92,7 +117,7 @@ export default {
         list[key].push(
           {
             ...item,
-            isError: row.isError
+            ...row,
           }
         )
       }

+ 52 - 8
src/views/main/constant.js

@@ -27,38 +27,82 @@ export const descs = {
 export const errorType = {
   MUSIC_PATROL_ITEM: {
     isError: false,
+    url: '/business/teamDetail',
+    resultKey: 'search',
   },
   HIGH_CLASS_STUDENT_LESS_THAN_THREE: {
     isError: true,
+    url: '/business/teamDetail',
+    resultKey: 'search',
   },
   STUDENT_NOT_PAYMENT: {
     isError: true,
+    url: '/business/teamDetail',
+    resultKey: 'search',
   },
   STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP: {
-    isError: true
+    isError: true,
+    url: '/business/teamDetail',
+    resultKey: 'search',
   },
   WAIT_CREATE_PAYMENT_CALENDER: {
-    isError: true
+    isError: true,
+    url: '/business/teamDetail',
+    resultKey: 'search',
   },
   COURSE_TRUANT_STUDENT_NUM: {
-    isError: true
+    isError: true,
+    url: '/business/teamDetail',
+    resultKey: 'search',
   },
   COURSE_LEAVE_STUDENT_NUM: {
     isError: true,
-    parent: 'COURSE_TRUANT_STUDENT_NUM'
+    url: '/business/teamDetail',
+    resultKey: 'search',
   },
   TEACHER_EXCEPTION_ATTENDANCE: {
-    isError: true
+    isError: true,
+    url: '/operateManager/recodeList',
+    resultKey: 'search',
   },
   TEACHER_NOT_A_CLASS: {
     isError: true,
-    parent: 'TEACHER_EXCEPTION_ATTENDANCE'
+    url: '/operateManager/recodeList',
+    resultKey: 'search',
   },
   TEACHER_LEAVE: {
-    isError: false
+    isError: false,
+    url: '/journal/journal',
+    resultKey: 'search',
+    query: {
+      tabrouter: 'LEAVE'
+    }
   },
   TEACHER_EXPECT_SALARY_BE_LOW: {
-    isError: false
+    isError: false,
+    url: '/operateManager/operationalList',
+    resultKey: 'search',
+  },
+  INSPECTION_ITEM: {
+    isError: true,
+    url: '/main/main',
+    resultKey: 'search',
+    query: {
+      tabrouter: 'teamSchedule'
+    }
+  },
+  INSPECTION_ITEM_PLAN: {
+    isError: true,
+    url: '/business/musicInspection',
+    resultKey: 'search',
+  },
+  STUDENT_VISIT: {
+    isError: true,
+    url: '/main/main',
+    resultKey: 'search',
+    query: {
+      tabrouter: 'teamSchedule'
+    }
   },
 }
 

+ 7 - 0
src/views/main/index.vue

@@ -39,6 +39,13 @@ export default {
     ScheduleBranch,
     reminders,
   },
+  watch: {
+    '$route.query'(newValue, oldValue) {
+      if (newValue.tabrouter !== oldValue.tabrouter) {
+        this.$forceUpdate()
+      }
+    }
+  },
 }
 </script>
 <style lang="scss" scope>

+ 1 - 1
src/views/main/reminders/index.vue

@@ -31,7 +31,7 @@
         query: {
           search: (item.result || []).join(',')
         }
-      })" type="text">立即处理<i class="el-icon-d-arrow-right"/></el-button>
+      })" :disabled="item.result ?  !item.result.length : !item.result" type="text">立即处理<i class="el-icon-d-arrow-right"/></el-button>
     </title-item>
   </div>
 </template>

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است