| | |
| | | <template> |
| | | <view class="menu-box" @click="curMenuClick(curMenu)"> |
| | | <view v-if="imgShow"> |
| | | <u--image :src="curMenu.imgUrl" :width='curMenu.imgWidth || 54' :height='curMenu.imgHeight || 54' shape="circle"></u--image> |
| | | </view> |
| | | <view v-if="textShow" :style="{height: curMenu.numHeight ? curMenu.numHeight + 'px' : '56rpx'}"> |
| | | {{curMenu.num}} |
| | | </view> |
| | | <view :style="{height: curMenu.titleHeight ? curMenu.titleHeight + 'px' : '56rpx'}"> |
| | | {{curMenu.title}} |
| | | </view> |
| | | <view class="menu-box" @click="curMenuClick(curMenu)"> |
| | | <view v-if="imgShow"> |
| | | <u--image :src="curMenu.imgUrl" :width='curMenu.imgWidth || 40' :height='curMenu.imgHeight || 40' |
| | | shape="circle"></u--image> |
| | | </view> |
| | | <view v-if="textShow" :style="{height: curMenu.numHeight ? curMenu.numHeight + 'px' : '56rpx'}"> |
| | | {{curMenu.num}} |
| | | </view> |
| | | <view :style="{height: curMenu.titleHeight ? curMenu.titleHeight + 'px' : '56rpx'}"> |
| | | {{curMenu.title}} |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | return {} |
| | | } |
| | | }, |
| | | |
| | | |
| | | imgShow: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | |
| | | |
| | | textShow: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | }, |
| | | |
| | | |
| | | methods: { |
| | | curMenuClick(e) { |
| | | console.log('当前点击处') |
| | | |
| | | |
| | | if (e.event) { |
| | | e.event(e) |
| | | } |
| | |
| | | display: flex; |
| | | flex-direction: column; |
| | | font-size: 28rpx; |
| | | |
| | | & > view { |
| | | |
| | | &>view { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | & > view:first-child { |
| | | |
| | | &>view:first-child { |
| | | flex: 1; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | messageCount, |
| | | } from "@/api/system/message.js" |
| | | export default { |
| | | props: { |
| | | currentTab: {}, |
| | |
| | | }, |
| | | methods: { |
| | | change(e) { |
| | | this.$store.commit("SET_TABBAT_INDEX", e) |
| | | this.$emit("change", this.curTabList[e].url) |
| | | let params = { |
| | | recipient: this.userInfo.user_id, |
| | | status: 0 |
| | | } |
| | | messageCount(params).then(res => { |
| | | this.$u.func.updateTabbar(res.data) |
| | | }) |
| | | }, |
| | | |
| | | } |
| | |
| | | </view> |
| | | |
| | | <view class="main-phone-house"> |
| | | <view class="phone-box"> |
| | | <view v-if="gridDataList.length>0" class="phone-box"> |
| | | <grid-menu :gridData='item' v-for="(item, index) in gridDataList" :key='index'></grid-menu> |
| | | </view> |
| | | |
| | | <view class="house-box"> |
| | | <view v-if="hasMenu('楼盘表').length>0" class="house-box"> |
| | | <box-title :title="'楼盘表'"></box-title> |
| | | <view class="content"> |
| | | <grid-menu :gridData='item' v-for="(item, index) in houseDataList" :key='index'></grid-menu> |
| | |
| | | </view> |
| | | |
| | | <view class="main-bt pb-40"> |
| | | <view class="mt-20"> |
| | | <view v-if="liveList.length>0" class="mt-20"> |
| | | <box-title :title="'生活'"></box-title> |
| | | |
| | | <view class="mt-20 b-c-w"> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="mt-20"> |
| | | <view v-if="jobList.length>0" class="mt-20"> |
| | | <box-title :title="'工作台'"></box-title> |
| | | |
| | | <view class="mt-20 b-c-w"> |
| | |
| | | |
| | | data() { |
| | | return { |
| | | menuList: uni.getStorageSync("menu") || [], |
| | | tabList: uni.getStorageSync("tabBarList") || [], |
| | | selectBoxShow: false, |
| | | columns: [ |
| | |
| | | columnData: [], |
| | | btnList: [{ |
| | | imgUrl: '/static/img/sys.png', |
| | | title: '扫一扫' |
| | | title: '扫一扫', |
| | | imgWidth: 54, |
| | | imgHeight: 54 |
| | | }, |
| | | { |
| | | imgUrl: '/static/img/bs.png', |
| | | title: '报事' |
| | | title: '报事', |
| | | imgWidth: 54, |
| | | imgHeight: 54 |
| | | } |
| | | ], |
| | | gridDataList: [{ |
| | | title: '物业', |
| | | data: '无数据', |
| | | phone: '无' |
| | | }, |
| | | { |
| | | title: '综治网格', |
| | | data: '无数据', |
| | | phone: '无' |
| | | }, |
| | | { |
| | | title: '公安网格', |
| | | data: '无数据', |
| | | phone: '无' |
| | | } |
| | | ], |
| | | gridDataList: [], |
| | | |
| | | houseDataList: [ |
| | | { |
| | | houseDataList: [{ |
| | | title: '万达广场', |
| | | useSlot: true |
| | | }, |
| | |
| | | } |
| | | ], |
| | | |
| | | liveList: [{ |
| | | imgUrl: '/static/img/ggbs.png', |
| | | title: '公共报事', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | }, |
| | | { |
| | | imgUrl: '/static/img/bmrx.png', |
| | | title: '便民热线', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | }, |
| | | { |
| | | imgUrl: '/static/img/zhsb.png', |
| | | title: '租户上报', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | } |
| | | ], |
| | | liveList: [], |
| | | |
| | | jobList: [{ |
| | | imgUrl: '/static/img/ggbs.png', |
| | | title: '场所记录', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | }, |
| | | { |
| | | imgUrl: '/static/img/bmrx.png', |
| | | title: '场所采集', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | }, |
| | | { |
| | | imgUrl: '/static/img/zhsb.png', |
| | | title: '出租房管理', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | }, |
| | | { |
| | | imgUrl: '/static/img/zhsb.png', |
| | | title: '标签事件', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | }, |
| | | { |
| | | imgUrl: '/static/img/zhsb.png', |
| | | title: '场所维护', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | }, |
| | | { |
| | | imgUrl: '/static/img/zhsb.png', |
| | | title: '报事审核', |
| | | imgWidth: 40, |
| | | imgHeight: 40 |
| | | } |
| | | ], |
| | | jobList: [], |
| | | |
| | | taskTypeList: [{ |
| | | title: '一次性', |
| | |
| | | }, |
| | | |
| | | onShow() { |
| | | this.getMenuList() |
| | | uni.hideTabBar() |
| | | }, |
| | | |
| | | computed: { |
| | | hasMenu() { |
| | | return (name) => { |
| | | let resultArr = [] |
| | | resultArr = this.getMenu(name, this.menuList, resultArr) |
| | | if (resultArr.length > 0) { |
| | | return resultArr |
| | | } else { |
| | | return [] |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | //获取首页菜单 |
| | | getMenuList() { |
| | | console.log("当前角色菜单", this.menuList) |
| | | this.getPhoneList() |
| | | this.getLiveList() |
| | | this.getWorkbenchList() |
| | | }, |
| | | getPhoneList() { |
| | | this.gridDataList = [] |
| | | const resultArr = this.hasMenu('快捷拨号') |
| | | if (resultArr.length == 0) { |
| | | return |
| | | } |
| | | |
| | | const topMenu = resultArr[0] |
| | | |
| | | topMenu.children.forEach(menu => { |
| | | this.gridDataList.push({ |
| | | title: menu.name, |
| | | data: "无数据", |
| | | phone: "无" |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | //获取生活菜单 |
| | | getLiveList() { |
| | | this.liveList = [] |
| | | const resultArr = this.hasMenu('生活') |
| | | if (resultArr.length == 0) { |
| | | return |
| | | } |
| | | |
| | | const topMenu = resultArr[0] |
| | | |
| | | topMenu.children.forEach(menu => { |
| | | this.liveList.push({ |
| | | imgUrl: menu.source, |
| | | title: menu.name, |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | //获取工作台菜单 |
| | | getWorkbenchList() { |
| | | this.jobList = [] |
| | | const resultArr = this.hasMenu('工作台') |
| | | if (resultArr.length == 0) { |
| | | return |
| | | } |
| | | |
| | | const topMenu = resultArr[0] |
| | | |
| | | topMenu.children.forEach(menu => { |
| | | this.jobList.push({ |
| | | imgUrl: menu.source, |
| | | title: menu.name, |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | getMenu(menuName, menuList, resultArr) { |
| | | // console.log(menuList, menuName) |
| | | for (var i = 0; i < menuList.length; i++) { |
| | | if (menuList[i].name == menuName) { |
| | | resultArr.push(menuList[i]) |
| | | } else { |
| | | if (menuList[i].children && menuList[i].children.length) { |
| | | this.getMenu(menuName, menuList[i].children, resultArr); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return resultArr |
| | | |
| | | }, |
| | | |
| | | change(index) { |
| | | let url = index |
| | | this.$u.func.globalNavigator(url, "switchTab") |
| | |
| | | .content { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | |
| | | |
| | | &>view { |
| | | margin: 0 16rpx; |
| | | margin-top: 20rpx; |
| | |
| | | |
| | | select(item) { |
| | | this.selectRole = item |
| | | console.log("当前选中角色", this.selectRole) |
| | | }, |
| | | |
| | | async submit() { |
| | |
| | | |
| | | //获取角色菜单 |
| | | const res = await dynamicMenu(this.selectRole.id) |
| | | |
| | | console.log(res, "*/*/*/*/*/*") |
| | | //把菜单存入store中 |
| | | let data = res.data |
| | | const appMenu = data.filter(e => e.name == 'app')[0] |
| | | const appMenu = data.filter(e => e.name == 'app')[0].children |
| | | console.log("菜单:", appMenu) |
| | | store.commit("SET_MENU", appMenu) |
| | | |
| | |
| | | //获取角色菜单 |
| | | dynamicMenu(activeRoleId).then(res => { |
| | | let data = res.data |
| | | let appMenu = data.filter(e => e.name == 'app')[0] |
| | | let appMenu = data.filter(e => e.name == 'app')[0].children |
| | | console.log("当前角色菜单:", appMenu) |
| | | vm.$u.vuex('menu', appMenu) |
| | | store.commit('SET_MENU', appMenu) |
| | | |
| | | //跳转到首页 |
| | | uni.switchTab({ |