|
@@ -18,15 +18,15 @@
|
|
|
</save-form>
|
|
|
<div class="tags">
|
|
|
<el-badge
|
|
|
- :hidden="item.num === 0"
|
|
|
+ :hidden="!keyNames[item].num"
|
|
|
is-dot
|
|
|
- v-for="(item, index) in tags"
|
|
|
+ v-for="(item, index) in permissionTags"
|
|
|
:key="index"
|
|
|
>
|
|
|
<el-tag
|
|
|
- :effect="activeKey === item.type ? 'dark' : 'plain'"
|
|
|
- @click="changeTag(item.type)"
|
|
|
- >{{item.name}}</el-tag>
|
|
|
+ :effect="activeKey === item ? 'dark' : 'plain'"
|
|
|
+ @click="changeTag(item)"
|
|
|
+ >{{keyNames[item].name}}</el-tag>
|
|
|
</el-badge>
|
|
|
</div>
|
|
|
<empty desc="暂无需要处理异常" v-if="!activeList.length"/>
|
|
@@ -82,6 +82,7 @@
|
|
|
import { getIndexError } from '@/views/main/api'
|
|
|
import { createNotification } from '@/helpers/notification'
|
|
|
import { errorType } from '@/views/main/constant'
|
|
|
+import { permission } from '@/utils/directivePage'
|
|
|
import title from './title'
|
|
|
const initSearch = {
|
|
|
organId: null
|
|
@@ -96,17 +97,42 @@ export default {
|
|
|
...initSearch
|
|
|
},
|
|
|
listByType: {},
|
|
|
+ infoByType: {},
|
|
|
list: [],
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ keyNames() {
|
|
|
+ const { status } = this.$store.state.app
|
|
|
+ return {
|
|
|
+ MUSIC_PATROL: {
|
|
|
+ name: '乐团巡查',
|
|
|
+ num: status.musicPatrol || false,
|
|
|
+ },
|
|
|
+ STUDENT_INFO: {
|
|
|
+ name: '学员处理',
|
|
|
+ num: status.studentInfo || false,
|
|
|
+ },
|
|
|
+ TEACHER_INFO: {
|
|
|
+ name: '日常行政',
|
|
|
+ num: status.teacherInfo || false,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ permissionTags() {
|
|
|
+ const url = 'getIndexErrData?errorType='
|
|
|
+ const permissions = ['MUSIC_PATROL', 'STUDENT_INFO', 'TEACHER_INFO']
|
|
|
+ return permissions.filter(item => {
|
|
|
+ return this.permission(url + item)
|
|
|
+ })
|
|
|
+ },
|
|
|
activeKey() {
|
|
|
let key = ''
|
|
|
const { tag } = this.$route.query
|
|
|
if (tag) {
|
|
|
key = tag
|
|
|
- } else if (this.tags[0]) {
|
|
|
- key = this.tags[0].type
|
|
|
+ } else if (this.permissionTags[0]) {
|
|
|
+ key = this.permissionTags[0]
|
|
|
}
|
|
|
return key
|
|
|
},
|
|
@@ -124,6 +150,7 @@ export default {
|
|
|
this.$store.dispatch('setBranchs')
|
|
|
},
|
|
|
methods: {
|
|
|
+ permission,
|
|
|
changeTag(type) {
|
|
|
this.$router.replace({
|
|
|
query: {
|
|
@@ -131,6 +158,7 @@ export default {
|
|
|
tag: type
|
|
|
}
|
|
|
})
|
|
|
+ this.FetchList()
|
|
|
},
|
|
|
formatData(data) {
|
|
|
const list = {}
|
|
@@ -152,13 +180,17 @@ export default {
|
|
|
async FetchList() {
|
|
|
try {
|
|
|
const res = await getIndexError({
|
|
|
+ errorType: this.activeKey,
|
|
|
...this.search,
|
|
|
})
|
|
|
this.list = res.data.data
|
|
|
const data = {}
|
|
|
+ const info = {}
|
|
|
for (const item of this.list) {
|
|
|
+ info[item.errorType] = item
|
|
|
data[item.errorType] = this.formatData(item?.result || [])
|
|
|
}
|
|
|
+ this.infoByType = info
|
|
|
this.listByType = data
|
|
|
} catch (error) {}
|
|
|
},
|