材料站权限控制
|
|
@ -25,11 +25,17 @@
|
|||
class="item"
|
||||
v-for="(item, index) in isUsingList"
|
||||
:key="index"
|
||||
v-show="item.isShow"
|
||||
@click="jumpUrl(item.path)"
|
||||
>
|
||||
<image class="item-icon" :src="`../../../static/home/${item.src}.png`" mode="" />
|
||||
<!-- <div class="item-name">{{ item.name }}</div> -->
|
||||
<div class="item-name">{{ item.name }}</div>
|
||||
</div>
|
||||
<view
|
||||
v-if="isUsingList.every((item) => !item.isShow)"
|
||||
style="text-align: center; margin-top: 25px; width: 100%"
|
||||
>暂无权限</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -46,6 +52,8 @@ import {
|
|||
getBmTeamList,
|
||||
} from '@/services/materialsStation'
|
||||
import { useMemberStore } from '@/stores'
|
||||
|
||||
const urlPermissions = ref([])
|
||||
const memberStore = useMemberStore()
|
||||
const userInfo = ref({})
|
||||
const isTeamLeader = ref(false)
|
||||
|
|
@ -56,15 +64,15 @@ const todayDatas = reactive({
|
|||
oneMonthNum: '', // 一个月
|
||||
})
|
||||
const isUsingList = ref([
|
||||
{ path: 'toolsLease', name: '领料', src: 'lease1', isShow: true },
|
||||
{ path: 'toolsOut', name: '出库', src: 'outStore1', isShow: true },
|
||||
{ path: 'toolsBack', name: '退料', src: 'back1', isShow: true },
|
||||
{ path: 'toolsLedger', name: '台账', src: 'ledger1', isShow: true },
|
||||
{ path: 'teamLeaseRecord', name: '领料记录', src: 'teamLease1', isShow: true },
|
||||
{ path: 'teamBackRecord', name: '退料记录', src: 'teamBack1', isShow: true },
|
||||
{ path: 'teamStore', name: '班组库存', src: 'teamStore1', isShow: true },
|
||||
{ path: 'teamWarning', name: '班组预警', src: 'teamWarning1', isShow: true },
|
||||
{ path: 'authorizeSignature', name: '项目部授权', src: 'authorizeSignature1', isShow: true },
|
||||
{ path: 'toolsLease', name: '班组预领申请', src: 'lease', isShow: true },
|
||||
{ path: 'toolsOut', name: '材料站出库', src: 'outStore', isShow: true },
|
||||
{ path: 'toolsBack', name: '退料', src: 'back', isShow: true },
|
||||
{ path: 'toolsLedger', name: '台账', src: 'ledger', isShow: true },
|
||||
{ path: 'teamLeaseRecord', name: '班组领料记录', src: 'teamLease', isShow: true },
|
||||
{ path: 'teamBackRecord', name: '班组退料记录', src: 'teamBack', isShow: true },
|
||||
{ path: 'teamStore', name: '班组库存', src: 'teamStore', isShow: true },
|
||||
{ path: 'teamWarning', name: '班组预警', src: 'teamWarning', isShow: true },
|
||||
{ path: 'authorizeSignature', name: '项目部授权', src: 'authorizeSignature', isShow: true },
|
||||
])
|
||||
|
||||
let statusBarHeight = ref('50px')
|
||||
|
|
@ -183,7 +191,14 @@ const getTeamList = async () => {
|
|||
// 页面显示时获取数据
|
||||
onShow(async () => {
|
||||
userInfo.value = memberStore.userInfo || {}
|
||||
urlPermissions.value = uni.getStorageSync('urlPermissions')
|
||||
// console.log('🚀 ~ onShow ~ userInfo.value:', userInfo.value)
|
||||
isUsingList.value.forEach((item) => {
|
||||
// 查找item.path 是否 在 urlPermissions.value 中 是 item.isShow = true 否则 item.isShow = false
|
||||
item.isShow = urlPermissions.value.includes(item.path)
|
||||
})
|
||||
console.log('isUsingList.value:', isUsingList.value.every((item) => !item.isShow))
|
||||
if (isUsingList.value.every((item) => !item.isShow)) return
|
||||
getToolsLedgerDetailsList()
|
||||
getUserInfoByUserName()
|
||||
// await Promise.all([getUserInfoByUserName(), projectInfoList()])
|
||||
|
|
@ -301,7 +316,7 @@ onShow(async () => {
|
|||
}
|
||||
}
|
||||
.item-name {
|
||||
margin-top: -50rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 23rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { http } from '@/utils/http'
|
|||
* 登录方法 - 调试使用 - 产线环境需注释
|
||||
*/
|
||||
export const appLoginAPI = (data) => {
|
||||
// return false
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/auth/login',
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |