<template>
|
<div>
|
<h4 class="font-weight-bold py-3 mb-2">
|
<!-- <router-link to="/">
|
<span class="text-muted font-weight-light">统计分析 /</span>
|
</router-link> -->
|
统计分析
|
</h4>
|
<b-card>
|
<h1>这里是内容区,写的时候删掉这里</h1>
|
</b-card>
|
</div>
|
</template>
|
|
<script>
|
import { mapActions } from 'vuex'
|
import { getApplicationList } from '@/server/common.js'
|
export default {
|
name: 'application-center',
|
metaInfo: {
|
title: '首页'
|
},
|
data() {
|
return {
|
noneImg: 'this.src="' + require('@/assets/img/noneImg.png') + '"',
|
userInfo: this.$store.getters.basicUserInfo,
|
applicationList: [],
|
searchName: ''
|
}
|
},
|
computed: {
|
searchList() {
|
const searchName = this.searchName.replace(/\s/g, '').toUpperCase()
|
if (!searchName) {
|
return this.applicationList
|
}
|
let searchList = []
|
this.applicationList.map(item => {
|
if (
|
item.name.indexOf(searchName) !== -1 ||
|
item.module.indexOf(searchName) !== -1
|
) {
|
searchList.push(item)
|
}
|
})
|
return searchList
|
},
|
newList() {
|
let list = []
|
this.applicationList.map(item => {
|
if (item.state === 1) {
|
list.push(item)
|
}
|
})
|
return list
|
}
|
},
|
methods: {
|
...mapActions(['openNewWindowtab']),
|
/* 获取应用列表 */
|
async getApplicationList() {
|
let result = await getApplicationList({
|
orgId: this.userInfo.orgId,
|
userId: this.userInfo.id
|
})
|
if (result && !result.error) {
|
this.applicationList = result
|
} else if (result && result.message) {
|
this.$toast({
|
message: result.message ? result.message : '报错了',
|
type: 'error'
|
})
|
}
|
},
|
openModule(data) {
|
if (!data || data.state !== 1) {
|
// this.$toast({
|
// message: '这个系统您目前还不能使用!',
|
// type: 'error'
|
// })
|
return false
|
}
|
this.openNewWindowtab(data.url)
|
}
|
},
|
created() {
|
this.getApplicationList()
|
},
|
watch: {
|
newList(val, oldVal) {
|
if (val !== oldVal && val.length === 1) {
|
this.openNewWindowtab({ urlStr: val[0].url, isblank: true })
|
}
|
}
|
}
|
}
|
</script>
|
<style lang="scss">
|
.img-box {
|
display: inline-block;
|
width: 140px;
|
height: 140px;
|
img {
|
width: 100%;
|
}
|
}
|
.card.disabled {
|
background: transparent !important;
|
border: 0;
|
color: #a3a4a6 !important;
|
cursor: no-drop;
|
}
|
</style>
|