fix: BUG修改

This commit is contained in:
kun 2024-05-28 20:01:14 +08:00
parent 0047487dce
commit 1fba2d9c88
22 changed files with 42 additions and 28 deletions

16
main.js
View File

@ -305,8 +305,8 @@ Vue.prototype.sendRequest = function(param) {
}
});
}
// 判断权限的函数
Vue.prototype.checkPermission = function(permission) {
// 判断按钮权限的函数
Vue.prototype.checkBtnPermission = function(permission) {
var permissions = JSON.parse(uni.getStorageSync("userInfo")).menuAuthority.menuList;
// var permissions = store.state.userInfo.menuAuthority.menuList;
permissions = permissions.filter(
@ -321,6 +321,18 @@ Vue.prototype.checkPermission = function(permission) {
)
return index != -1 ? true : false;
}
Vue.prototype.checkMenuPermission = function(permission) {
var permissions = JSON.parse(uni.getStorageSync("userInfo")).menuAuthority.menuList;
// var permissions = store.state.userInfo.menuAuthority.menuList;
permissions = permissions.filter(
(x) => x.path == permission.menuPath
)[0];
if (!permissions) {
return false;
} else {
return true;
}
}
const app = new Vue({
...App
})

View File

@ -83,7 +83,7 @@
}
},
onLoad() {
this.btnAuth = this.checkPermission({key: 'ai_disposition', menuPath: '/project/aiAnalysis/warningList'})
this.btnAuth = this.checkBtnPermission({key: 'ai_disposition', menuPath: '/project/aiAnalysis/warningList'})
},
onShow(){
this.systemInfo = uni.getStorageSync('systemInfo')

View File

@ -144,7 +144,7 @@
}
},
onLoad(option) {
this.btnAuth = this.checkPermission({key: 'dealPush_push', menuPath: '/project/aiAnalysis/dealPushManage'})
this.btnAuth = this.checkBtnPermission({key: 'dealPush_push', menuPath: '/project/aiAnalysis/dealPushManage'})
this.alarmItem = JSON.parse(decodeURIComponent(option.item));
console.log('alarmItem', this.alarmItem)
},

View File

@ -119,7 +119,7 @@
}
},
onLoad(options) {
this.btnAuth = this.checkPermission({key: 'selfInspect_scanCheck', menuPath: '/project/inspecPoint/selfInspect'})
this.btnAuth = this.checkBtnPermission({key: 'selfInspect_scanCheck', menuPath: '/project/inspecPoint/selfInspect'})
this.info = JSON.parse(options.info);
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;

View File

@ -189,7 +189,7 @@
</view>
</view>
</view>
<image v-if="type !== 'supplier' && checkPermission({key: 'clgl_blackWhiteList', menuPath: '/project/carManage/carManage'})" v-show="tabIndex==1" src="/static/addImg.png" class="addImg"
<image v-if="type !== 'supplier' && checkBtnPermission({key: 'clgl_blackWhiteList', menuPath: '/project/carManage/carManage'})" v-show="tabIndex==1" src="/static/addImg.png" class="addImg"
@click="goAdd('')"></image>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>

View File

@ -157,7 +157,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({key: 'wdgc_add', menuPath: '/project/dangerousBigProject/parameter'})
this.btnAuth = this.checkBtnPermission({key: 'wdgc_add', menuPath: '/project/dangerousBigProject/parameter'})
this.detailId = val.id
// if(val.)
// this.initData()

View File

@ -236,11 +236,11 @@
},
onLoad(options) {
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'emergencyDisposal_add',
menuPath: '/project/emergencyDisposal/emergencyDisposal'
})
this.btnEditAuth = this.checkPermission({
this.btnEditAuth = this.checkBtnPermission({
key: 'emergencyDisposal_edit',
menuPath: '/project/emergencyDisposal/emergencyDisposal'
})

View File

@ -226,11 +226,11 @@
}
},
onLoad(option) {
this.btnEditAuth = this.checkPermission({
this.btnEditAuth = this.checkBtnPermission({
key: 'inspectionLedger_edit',
menuPath: '/project/quality/inspectionLedger'
})
this.btnDeleteAuth = this.checkPermission({
this.btnDeleteAuth = this.checkBtnPermission({
key: 'inspectionLedger_delete',
menuPath: '/project/quality/inspectionLedger'
})

View File

@ -159,7 +159,7 @@
}
},
onLoad() {
this.btnAuth = this.checkPermission({key: 'inspectionLedger_add', menuPath: '/project/quality/inspectionLedger'})
this.btnAuth = this.checkBtnPermission({key: 'inspectionLedger_add', menuPath: '/project/quality/inspectionLedger'})
},
mounted() {
this.getTime()

View File

@ -226,11 +226,11 @@
}
},
onLoad(option) {
this.btnEditAuth = this.checkPermission({
this.btnEditAuth = this.checkBtnPermission({
key: 'inspectionLedger_edit',
menuPath: '/project/safeSame/inspectionLedger'
})
this.btnDeleteAuth = this.checkPermission({
this.btnDeleteAuth = this.checkBtnPermission({
key: 'inspectionLedger_delete',
menuPath: '/project/safeSame/inspectionLedger'
})

View File

@ -180,7 +180,7 @@
}
},
onLoad() {
this.btnAuth = this.checkPermission({key: 'inspectionLedger_add', menuPath: '/project/safeSame/inspectionLedger'})
this.btnAuth = this.checkBtnPermission({key: 'inspectionLedger_add', menuPath: '/project/safeSame/inspectionLedger'})
},
mounted() {
this.getTime()

View File

@ -238,7 +238,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'blindPlugWork_add',
menuPath: '/project/specialWork/blindPlugWork'
})

View File

@ -190,7 +190,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'fireWork_add',
menuPath: '/project/specialWork/fireWork'
})

View File

@ -202,7 +202,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'startBuildingWork_add',
menuPath: '/project/specialWork/startBuildingWork'
})

View File

@ -201,7 +201,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'towerOverWork_add',
menuPath: '/project/specialWork/towerOverWork'
})

View File

@ -201,7 +201,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'riggingOutWork_add',
menuPath: '/project/specialWork/riggingOutWork'
})

View File

@ -278,7 +278,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'confinedSpaceWork_add',
menuPath: '/project/specialWork/confinedSpaceWork'
})

View File

@ -210,7 +210,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'disconnectionWork_add',
menuPath: '/project/specialWork/disconnectionWork'
})

View File

@ -222,7 +222,7 @@
},200)
},
onLoad(val){
this.btnAuth = this.checkPermission({
this.btnAuth = this.checkBtnPermission({
key: 'temporaryPowerWork_add',
menuPath: '/project/specialWork/temporaryPowerWork'
})

View File

@ -58,7 +58,7 @@
}
},
onLoad(options) {
this.btnAuth = this.checkPermission({key: 'trainPlan_add', menuPath: '/project/examSystem2/trainPlan'})
this.btnAuth = this.checkBtnPermission({key: 'trainPlan_add', menuPath: '/project/examSystem2/trainPlan'})
this.projectSn = JSON.parse(uni.getStorageSync("userInfo")).sn
this.getDataList();
},

View File

@ -68,7 +68,7 @@
this.getDetails()
},
onLoad(vai) {
this.btnAuth = this.checkPermission({key: 'trainPlan_add', menuPath: '/project/labor/visitRecord'})
this.btnAuth = this.checkBtnPermission({key: 'trainPlan_add', menuPath: '/project/labor/visitRecord'})
this.id = vai.itemS
},
onReachBottom() {

View File

@ -73,12 +73,12 @@
</view>
</view>
<view class="btn-box" v-if="isPass && ![2,3].includes(itemFrom.auditType)">
<view class="btn-box">
<view class="btn-box" v-if="btnEditAuth">
<view class="cancle-btn" @click="isPass = false">驳回</view>
<view class="pass-btn" @click="passAudit">通过</view>
</view>
</view>
<view class="addProgess" v-if="!isPass && ![2,3].includes(itemFrom.auditType)" @click="submitAudit">
<view class="addProgess" v-if="btnEditAuth && !isPass && ![2,3].includes(itemFrom.auditType)" @click="submitAudit">
提交
</view>
</view>
@ -95,10 +95,12 @@
isPass: true,
form: {
feedbackContent: ''
}
},
btnEditAuth: true
}
},
onLoad(option) {
this.btnEditAuth = this.checkBtnPermission({key: 'jdsp_edit', menuPath: '/project/progressManagementAg/progressApproval'})
this.itemFrom = JSON.parse(option.obj);
if (this.itemFrom) {
this.filterItemForm();