fix: BUG修改

This commit is contained in:
Vce 2024-04-14 22:53:26 +08:00
parent 5ffa187cf6
commit e1a107321f
2 changed files with 112 additions and 49 deletions

View File

@ -140,7 +140,7 @@
uni.setStorageSync('account', e.detail.value.account); uni.setStorageSync('account', e.detail.value.account);
uni.setStorageSync('password', e.detail.value.password); uni.setStorageSync('password', e.detail.value.password);
uni.setStorageSync('userInfo', JSON.stringify(res.result)); uni.setStorageSync('userInfo', JSON.stringify(res.result));
if (res.result.accountType == 5 || res.result.accountType == 6) { if (res.result.accountType == 5 || res.result.accountType == 6 || res.result.accountType == 10) {
if (res.result.styleType == 1) { if (res.result.styleType == 1) {
uni.redirectTo({ uni.redirectTo({
url: '/pages/projectEnd/projectIndex/projectIndex' url: '/pages/projectEnd/projectIndex/projectIndex'

View File

@ -1,7 +1,9 @@
<template> <template>
<view class="fullHeight projectIndexPage" style="background-color: white"> <view class="fullHeight projectIndexPage" style="background-color: white">
<scroll-view class="" :class="accountType == 5 || accountType == 6 ? 'smallHeight' : ''" scroll-y> <scroll-view class="" :class="accountType == 5 || accountType == 6 || accountType == 10 ? 'smallHeight' : ''"
<headers :showBack="accountType == 5 || accountType == 6 ? false : true" :themeType="'white'"> scroll-y>
<headers :showBack="accountType == 5 || accountType == 6 || accountType == 10 ? false : true"
:themeType="'white'">
<view class="headerName"> <view class="headerName">
{{ projectDetail.projectName }} {{ projectDetail.projectName }}
</view> </view>
@ -130,7 +132,7 @@
<view class="position"> 巡检点位置{{ qrCode.position }} </view> <view class="position"> 巡检点位置{{ qrCode.position }} </view>
</view> </view>
</uni-popup> </uni-popup>
<footers :activeTab="'projectEnd'" v-if="accountType == 5 || accountType == 6"></footers> <footers :activeTab="'projectEnd'" v-if="accountType == 5 || accountType == 6 || accountType == 10"></footers>
</view> </view>
</template> </template>
@ -208,6 +210,7 @@
}, },
onLoad() { onLoad() {
var userInfo = JSON.parse(uni.getStorageSync('userInfo')) var userInfo = JSON.parse(uni.getStorageSync('userInfo'))
let that = this;
console.log('userInfo===========', userInfo) console.log('userInfo===========', userInfo)
this.userInfo = userInfo this.userInfo = userInfo
this.accountType = userInfo.accountType this.accountType = userInfo.accountType
@ -217,18 +220,48 @@
console.log('上面的', arr) console.log('上面的', arr)
this.systemInfo = uni.getStorageSync('systemInfo') this.systemInfo = uni.getStorageSync('systemInfo')
this.getSystemLogoConfig() this.getSystemLogoConfig()
this.getAllModule(arr)
if (this.accountType == 5 || this.accountType == 6) { if (this.accountType == 5 || this.accountType == 6) {
this.searchsn = userInfo.sn this.searchsn = userInfo.sn
this.getProjectDetail() this.getProjectDetail()
this.getAllModule(arr)
} else if(this.accountType == 10){
this.sendRequest({
url: 'xmgl/company/getTenantOrgTreeList',
data: {
userId: userInfo.userId,
},
method: 'POST',
success(res) {
console.log(res,'777888')
if(res && res.result && res.result.length > 0){
let responseData = res.result;
that.selectedDefaultProject(responseData[0])
}
}
})
} else { } else {
this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail')) this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail'))
this.loadWeather() this.loadWeather()
this.getAllModule(arr)
} }
this.viewVersionInfo() this.viewVersionInfo()
}, },
onReady() {}, onReady() {},
methods: { methods: {
//
selectedDefaultProject(obj) {
if (obj.list && obj.list.length > 0) {
obj.list.map((item) => {
this.selectedDefaultProject(item);
});
} else {
this.searchsn = obj.sn
console.log(obj.sn,888999)
this.getProjectDetail()
this.getAllModule([])
uni.setStorageSync('userInfo',JSON.stringify({...this.userInfo,sn: obj.sn}))
}
},
viewVersionInfo() { viewVersionInfo() {
console.log('进入页面调用'); console.log('进入页面调用');
//fix //fix
@ -262,7 +295,7 @@
console.log('获取当前app应用版本号', that.versionNo); console.log('获取当前app应用版本号', that.versionNo);
console.log('获取平台版本号', res2.result.versionNo); console.log('获取平台版本号', res2.result.versionNo);
let jxjAppVersionNo = res2.result.versionNo let jxjAppVersionNo = res2.result.versionNo
if (res2.result && jxjAppVersionNo !== that.versionNo) { if (res2.result && jxjAppVersionNo !== that.versionNo) {
uni.showModal({ uni.showModal({
title: '版本更新', title: '版本更新',
@ -626,52 +659,82 @@
getAllModule(half) { getAllModule(half) {
console.log('half====', half) console.log('half====', half)
var that = this var that = this
this.sendRequest({ if (this.accountType == 10) {
url: 'xmgl/baseModule/list', this.sendRequest({
data: { url: 'xmgl/baseModule/getModuleAndMenuList',
styleType: this.styType data: {
}, projectSn: this.searchsn,
method: 'POST', userId: this.userInfo.userId,
success(res) { moduleType: 2,
var all = res.result },
all.forEach((element, index) => { method: 'POST',
all[index].operation = false success(res) {
half.forEach((element2) => { if (res.success) {
if (element2.moduleId == element.moduleId) { var all = res.result.moduleList;
all[index].operation = true console.log("all", all);
all[index].menuList = element2.menuList all.forEach((element, index) => {
} all[index].operation = false;
let newAll = all[index].menuList res.result.menuList.forEach((element2) => {
console.log(element2, 77888)
if (element2.moduleId == element.moduleId) {
all[index].operation = true;
}
});
});
console.log("all111", all);
that.list = all;
}
}
})
} else {
this.sendRequest({
url: 'xmgl/baseModule/list',
data: {
moduleType: 2,
styleType: this.styType
},
method: 'POST',
success(res) {
var all = res.result
all.forEach((element, index) => {
all[index].operation = false
half.forEach((element2) => {
if (element2.moduleId == element.moduleId) {
all[index].operation = true
all[index].menuList = element2.menuList
}
let newAll = all[index].menuList
})
}) })
})
that.list = all that.list = all
// this.list=newAppShow // this.list=newAppShow
// //
console.log('用户列表', that.list) console.log('用户列表', that.list)
// that.list.push({ // that.list.push({
// operation:true, // operation:true,
// appName: "", // appName: "",
// appShow: 1, // appShow: 1,
// bigModuleIcon: "log_active2", // bigModuleIcon: "log_active2",
// disableModuleIcon: null, // disableModuleIcon: null,
// labelName: "", // labelName: "",
// labelSortNum: "7", // labelSortNum: "7",
// menuList: null, // menuList: null,
// moduleDesc: "", // moduleDesc: "",
// moduleEquipment: 0, // moduleEquipment: 0,
// moduleIcon: "log_active", // moduleIcon: "log_active",
// moduleIcon2: "log", // moduleIcon2: "log",
// moduleId: "41", // moduleId: "41",
// moduleName: "", // moduleName: "",
// modulePath: "", // modulePath: "",
// moduleType: 2, // moduleType: 2,
// plugin: "constructionLog", // plugin: "constructionLog",
// styleType: 1 // styleType: 1
// }); // });
} }
}) })
}
} }
} }
} }