1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import modularLoading from '@views/newWorkBench/template/modularLoading.vue';
- import noPermission from '@views/newWorkBench/template/noPermission.vue';
- import { mapState } from 'vuex';
- export default {
- components: {
- //默认加载
- modularLoading,
- noPermission
- },
- data() {
- return {
- loadding: true,
- defaultModel: {
- permissUrl: "",
- titleName: ""
- },
- permisStatus: false
- }
- },
- computed: {
- //全局社区
- ...mapState(['homeCommunityAll']),
- // 定义模块显示隐藏
- permissionFiltering() {
- let arr = this.$store.getters['getMenuList'] || [];
- if (arr.length !== 0) {
- setTimeout(() => {
- this.loadding = false;
- }, 700)
- this.permissionStr(arr)
- return this.permisStatus;
- } else {
- return this.permisStatus;
- }
- }
- },
- watch: {
- //全局社区接口调用
- homeCommunityAll(val) {
- try {
- this.mixins_query.communityId = val;
- this.getData();
- } catch {
- }
- }
- },
- methods: {
- // 需要什么权限才能查看
- filterFuntion(arr, nameTitle, linkPaths) {
- arr.map((item) => {
- if (item.name == nameTitle && item.linkPath == linkPaths) {
- this.permisStatus = true
- } else if (!!item.children) {
- this.filterFuntion(item.children, nameTitle, linkPaths);
- }
- });
- },
- permissionStr(arr) {
- const { permissUrl, titleName } = this.defaultModel;
- if (!!permissUrl && !!titleName) {
- return this.filterFuntion(arr, titleName, permissUrl);
- }
- },
- }
- }
|