fix: 项目资料添加模块权限

This commit is contained in:
kun 2024-06-26 19:06:21 +08:00
parent 3489576e6a
commit 14e05951be

View File

@ -10,8 +10,11 @@
<view class="userBox"> <view class="userBox">
<!-- <image class="userImg" :src="url_config + 'image/' + userInfo.avatar" v-if="userInfo.avatar"></image> <!-- <image class="userImg" :src="url_config + 'image/' + userInfo.avatar" v-if="userInfo.avatar"></image>
<image class="userImg" src="@/static/userImg.png" v-else></image> --> <image class="userImg" src="@/static/userImg.png" v-else></image> -->
<u-image :src="url_config + 'image/' + userInfo.avatar" style="width: 100rpx;height: 100rpx;border-radius: 50%;margin-right: 20rpx;" shape="circle" mode="scaleToFill"> <u-image :src="url_config + 'image/' + userInfo.avatar"
<image slot="error" style="width: 100rpx;height: 100rpx;border-radius: 50%;" src="@/static/userImg.png"></image> style="width: 100rpx;height: 100rpx;border-radius: 50%;margin-right: 20rpx;" shape="circle"
mode="scaleToFill">
<image slot="error" style="width: 100rpx;height: 100rpx;border-radius: 50%;"
src="@/static/userImg.png"></image>
</u-image> </u-image>
<text v-if="uid">{{userInfo.realName}}</text> <text v-if="uid">{{userInfo.realName}}</text>
<text v-else>{{userInfo.account}}</text> <text v-else>{{userInfo.account}}</text>
@ -23,7 +26,7 @@
</view> </view>
</view> </view>
<!-- v-if="COMPANY != 'nanchang'" --> <!-- v-if="COMPANY != 'nanchang'" -->
<view class="operateBar" @click="viewFileFn"> <view class="operateBar" @click="viewFileFn" v-if="isShowProjectDocument">
<view class="left"> <view class="left">
<image class="operateIcon" src="@/static/file.png" mode="widthFix"></image> <image class="operateIcon" src="@/static/file.png" mode="widthFix"></image>
项目资料 项目资料
@ -62,7 +65,9 @@
<script> <script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue" import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import { exitApp } from "@/utils/tool.js" import {
exitApp
} from "@/utils/tool.js"
import footers from "@/components/footers/footers.vue" import footers from "@/components/footers/footers.vue"
import footers2 from "@/components/footers/footers2.vue" import footers2 from "@/components/footers/footers2.vue"
import headers from "@/components/headers/headers.vue" import headers from "@/components/headers/headers.vue"
@ -75,6 +80,7 @@
}, },
data() { data() {
return { return {
isShowProjectDocument: false,
userInfo: { userInfo: {
accountType: 0 accountType: 0
}, },
@ -95,9 +101,20 @@
} }
}, },
onShow() { onShow() {
this.userInfo = JSON.parse(uni.getStorageSync('userInfo')) this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
this.getModuleList();
}, },
methods: { methods: {
//
getModuleList() {
let allModuleList = this.userInfo.menuAuthority.moduleList;
for (let i = 0; i < allModuleList.length; i++) {
if (allModuleList[i].modulePath == '/companyAdmin/docManage') { //
this.isShowProjectDocument = true;
break;
}
}
},
viewVersionInfo() { viewVersionInfo() {
var that = this var that = this