app权限配置

This commit is contained in:
hongchao 2025-07-05 18:06:52 +08:00
parent 47891b122f
commit cac2be25b5
3 changed files with 114 additions and 31 deletions

View File

@ -1,6 +1,6 @@
<template>
<view class="content">
<view class="new-purchase">
<view class="new-purchase" v-if="newInfoListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">业务办理</div>
@ -9,7 +9,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in newInfoList"
v-for="(item, index) in newInfoListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
@ -18,7 +18,7 @@
</view>
</view>
<view class="new-purchase">
<view class="new-purchase" v-if="newPurchaseListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">电子档案</div>
@ -27,7 +27,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in newPurchaseList"
v-for="(item, index) in newPurchaseListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
@ -36,7 +36,7 @@
</view>
</view>
<view class="new-purchase">
<view class="new-purchase" v-if="pickingListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">检验预警</div>
@ -45,7 +45,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in pickingList"
v-for="(item, index) in pickingListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
@ -54,7 +54,7 @@
</view>
</view>
<view class="new-purchase">
<view class="new-purchase" v-if="integratedQueryListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">综合查询</div>
@ -63,7 +63,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in integratedQueryList"
v-for="(item, index) in integratedQueryListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
@ -75,14 +75,13 @@
</template>
<script setup>
import { ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { ref,computed } from 'vue'
import { onShow,onLoad } from '@dcloudio/uni-app'
const urlPermissions = ref([])
onShow((options) => {
urlPermissions.value = uni.getStorageSync('urlPermissions')
console.log('yyyyyyy', urlPermissions.value)
})
//
@ -104,6 +103,16 @@ const newInfoList = ref([
},
])
// 使 newInfoList
const newInfoListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return newInfoList.value;
}
return newInfoList.value.filter(item => urlPermissions.value.includes(item.url))
})
//
const newPurchaseList = ref([
{
@ -113,6 +122,16 @@ const newPurchaseList = ref([
},
])
// 使 newInfoList
const newPurchaseListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return newPurchaseList.value;
}
return newPurchaseList.value.filter(item => urlPermissions.value.includes(item.url))
})
//
const pickingList = ref([
{
@ -122,6 +141,16 @@ const pickingList = ref([
},
])
// 使 newInfoList
const pickingListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return pickingList.value;
}
return pickingList.value.filter(item => urlPermissions.value.includes(item.url))
})
//
const integratedQueryList = ref([
{
@ -156,6 +185,15 @@ const integratedQueryList = ref([
},
])
// 使 newInfoList
const integratedQueryListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return integratedQueryList.value;
}
return integratedQueryList.value.filter(item => urlPermissions.value.includes(item.url))
})
const onNavigateTo = (url) => {
uni.navigateTo({ url })
}

View File

@ -1,6 +1,6 @@
<template>
<view class="content">
<view class="new-purchase">
<view class="new-purchase" v-if="newInfoListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">设备信息管理</div>
@ -9,7 +9,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in newInfoList"
v-for="(item, index) in newInfoListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text style="white-space: nowrap;font-size: 26rpx;">
@ -18,7 +18,7 @@
</view>
</view>
<view class="new-purchase">
<view class="new-purchase" v-if="newPurchaseListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">业务信息管理</div>
@ -27,7 +27,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in newPurchaseList"
v-for="(item, index) in newPurchaseListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text style="white-space: nowrap;font-size: 26rpx;">
@ -36,7 +36,7 @@
</view>
</view>
<view class="new-purchase">
<view class="new-purchase" v-if="pickingListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">标准箱管理</div>
@ -45,7 +45,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in pickingList"
v-for="(item, index) in pickingListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text style="white-space: nowrap;font-size: 26rpx;">
@ -54,7 +54,7 @@
</view>
</view>
<view class="new-purchase">
<view class="new-purchase" v-if="partListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">库存查询</div>
@ -63,7 +63,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in partList"
v-for="(item, index) in partListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
@ -72,7 +72,7 @@
</view>
</view>
<view class="new-purchase">
<view class="new-purchase" v-if="deviceListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">机具查询</div>
@ -81,7 +81,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in deviceList"
v-for="(item, index) in deviceListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text style="white-space: nowrap;font-size: 26rpx;">
@ -131,6 +131,10 @@ const newInfoList = ref([
// 使 newInfoList
const newInfoListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return newInfoList.value;
}
return newInfoList.value.filter(item => urlPermissions.value.includes(item.url))
})
//
@ -164,6 +168,10 @@ const newPurchaseList = ref([
// 使 newInfoList
const newPurchaseListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return newPurchaseList.value;
}
return newPurchaseList.value.filter(item => urlPermissions.value.includes(item.url))
})
@ -198,6 +206,10 @@ const pickingList = ref([
// 使 newInfoList
const pickingListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return pickingList.value;
}
return pickingList.value.filter(item => urlPermissions.value.includes(item.url))
})
@ -217,6 +229,10 @@ const partList = ref([
// 使 newInfoList
const partListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return partList.value;
}
return partList.value.filter(item => urlPermissions.value.includes(item.url))
})
@ -231,6 +247,10 @@ const deviceList = ref([
// 使 newInfoList
const deviceListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return deviceList.value;
}
return deviceList.value.filter(item => urlPermissions.value.includes(item.url))
})

View File

@ -1,6 +1,6 @@
<template>
<view class="content">
<view class="new-purchase" >
<view class="new-purchase" v-if="newInfoListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">信息采集</div>
@ -9,7 +9,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in newInfoList"
v-for="(item, index) in newInfoListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
@ -18,7 +18,7 @@
</view>
</view>
<view class="new-purchase" >
<view class="new-purchase" v-if="newPurchaseListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">新购管理</div>
@ -27,7 +27,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in newPurchaseList"
v-for="(item, index) in newPurchaseListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
@ -36,7 +36,7 @@
</view>
</view>
<view class="new-purchase" >
<view class="new-purchase" v-if="pickingListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title" >仓储管理</div>
@ -45,7 +45,7 @@
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in pickingList"
v-for="(item, index) in pickingListTwo"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
@ -54,7 +54,7 @@
</view>
</view>
<view class="new-purchase" >
<view class="new-purchase" v-if="repairListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">修试管理</div>
@ -72,7 +72,7 @@
</view>
</view>
<view class="new-purchase" >
<view class="new-purchase" v-if="partListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">配件管理</div>
@ -90,7 +90,7 @@
</view>
</view>
<view class="new-purchase" >
<view class="new-purchase" v-if="boxListTwo.length>0">
<div class="title-text">
<div></div>
<div class="purchase-title">标准箱管理</div>
@ -135,6 +135,7 @@ import { onShow,onLoad } from '@dcloudio/uni-app'
const urlPermissions = ref([])
onShow((options) => {
urlPermissions.value = uni.getStorageSync('urlPermissions')
console.log("yyyyyyy",urlPermissions.value)
})
@ -170,6 +171,10 @@ const newInfoList = ref([
// 使 newInfoList
const newInfoListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return newInfoList.value;
}
return newInfoList.value.filter(item => urlPermissions.value.includes(item.url))
})
@ -196,6 +201,10 @@ const newPurchaseList = ref([
// 使 newInfoList
const newPurchaseListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return newPurchaseList.value;
}
return newPurchaseList.value.filter(item => urlPermissions.value.includes(item.url))
})
@ -235,6 +244,10 @@ const pickingList = ref([
// 使 newInfoList
const pickingListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return pickingList.value;
}
return pickingList.value.filter(item => urlPermissions.value.includes(item.url))
})
@ -264,6 +277,10 @@ const partList = ref([
// 使 newInfoList
const partListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return partList.value;
}
return partList.value.filter(item => urlPermissions.value.includes(item.url))
})
@ -303,6 +320,10 @@ const repairList = ref([
// 使 newInfoList
const repairListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return repairList.value;
}
return repairList.value.filter(item => urlPermissions.value.includes(item.url))
})
@ -336,6 +357,10 @@ const boxList = ref([
// 使 newInfoList
const boxListTwo = computed(() => {
//
if (urlPermissions.value.includes("*:*:*")) {
return boxList.value;
}
return boxList.value.filter(item => urlPermissions.value.includes(item.url))
})