flx:修改集团配置

This commit is contained in:
X_Rian 2024-09-05 14:36:24 +08:00
parent 9bbc233b8b
commit 617db35f2c
2 changed files with 83 additions and 63 deletions

View File

@ -31,7 +31,7 @@
moduleIcon: 'tabIcon-index-active',
plugin: 'projectEnd',
appShow: 1,
isShow: true
isShow: false
},{
appName: '发起审批',
moduleIcon2: 'submit-n',
@ -52,7 +52,7 @@
moduleIcon: 'tabIcon-my2-active',
plugin: 'my',
appShow: 1,
isShow: true
isShow: false
}],
userInfo: {
accountType: 1
@ -71,10 +71,11 @@
methods: {
getModuleList() {
var that = this
const projectSn = uni.getStorageSync('projectDetail') ? JSON.parse(uni.getStorageSync('projectDetail')).projectSn : uni.getStorageSync('projectDetail');
this.sendRequest({
url: "xmgl/baseModule/getModuleAndMenuList",
data: {
projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn,
projectSn: projectSn,
moduleType: 7,
userId: JSON.parse(uni.getStorageSync('userInfo')).userId,
},
@ -83,6 +84,7 @@
if (result.success) {
that.haveModuleList = result.result.moduleList
that.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
console.log(that.userInfo.accountType)
if (that.userInfo.accountType == 5 || that.userInfo.accountType == 6 || that
.userInfo
.accountType == 10) {
@ -97,19 +99,24 @@
that.tabList[2].isShow = true
that.tabList[3].isShow = true
}
that.tabList[1].isShow = true
that.tabList[4].isShow = true
} else if (that.COMPANY == 'sanjiang') {
that.tabList.push({
appName: '首页总览',
moduleIcon2: 'sjjt_syzl',
moduleIcon: 'sjjt_syzl-tab',
plugin: 'projectManage',
appShow: 1
appShow: 1,
isShow: true,
}, {
appName: '我的',
moduleIcon2: 'tabIcon-my',
moduleIcon: 'tabIcon-my-select',
plugin: 'my',
appShow: 1
appShow: 1,
isShow: true,
})
} else if (that.userInfo.accountType == 11) {
//
@ -118,20 +125,27 @@
moduleIcon2: 'sjjt_syzl',
moduleIcon: 'sjjt_syzl-tab',
plugin: 'supplierHome',
appShow: 1
appShow: 1,
isShow: true,
}, {
appName: '我的',
moduleIcon2: 'tabIcon-my',
moduleIcon: 'tabIcon-my-select',
plugin: 'supplierMy',
appShow: 1
appShow: 1,
isShow: true,
})
} else {
try {
console.log(1111, that.userInfo.menuAuthority.moduleList)
var moduleList = that.userInfo.menuAuthority.moduleList
for (let i = 0; i < moduleList.length; i++) {
if (moduleList[i].moduleType == 1) {
that.tabList.push(moduleList[i])
console.log(moduleList[i])
that.tabList.push({
...moduleList[i],
isShow: true,
})
}
}
} catch (e) {
@ -142,7 +156,8 @@
moduleIcon2: 'tabIcon-my',
moduleIcon: 'tabIcon-my-select',
plugin: 'my',
appShow: 1
appShow: 1,
isShow: true,
})
}

View File

@ -246,7 +246,7 @@
} else {
this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail'))
this.loadWeather()
this.getAllModule()
this.getAllModule(userInfo.menuAuthority.moduleList)
}
closeBle()
.then((res) => {
@ -835,7 +835,7 @@
},
getAllModule(arr) {
console.log('获取的模块', arr)
const find = arr.find(item => item.plugin == "emergencyDisposal");
const find = arr ? arr.find(item => item.plugin == "emergencyDisposal") : "";
if (find) {
uni.setStorageSync('moduleInfo', JSON.stringify(find))
}
@ -875,61 +875,66 @@
}
})
} else {
that.list = arr.map(item => {
item.operation = true;
return item;
});
if (arr) {
that.list = arr.map(item => {
item.operation = true;
return item;
});
} 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) => {
console.log(element, index, "=========")
all[index].operation = false
arr.forEach((element2) => {
if (element2.moduleId == element.moduleId) {
all[index].operation = true
all[index].menuList = element2.menuList
}
})
})
that.list = all
// this.list=newAppShow
//
console.log('用户列表', that.list)
// that.list.push({
// operation:true,
// appName: "",
// appShow: 1,
// bigModuleIcon: "log_active2",
// disableModuleIcon: null,
// labelName: "",
// labelSortNum: "7",
// menuList: null,
// moduleDesc: "",
// moduleEquipment: 0,
// moduleIcon: "log_active",
// moduleIcon2: "log",
// moduleId: "41",
// moduleName: "",
// modulePath: "",
// moduleType: 2,
// plugin: "constructionLog",
// styleType: 1
// });
}
})
}
console.log(that.list, "list============")
/*
this.sendRequest({
url: 'xmgl/baseModule/list',
data: {
moduleType: 2,
styleType: this.styType
},
method: 'POST',
success(res) {
var all = res.result;
all.forEach((element, index) => {
console.log(element,index,"=========")
all[index].operation = false
arr.forEach((element2) => {
if (element2.moduleId == element.moduleId) {
all[index].operation = true
all[index].menuList = element2.menuList
}
})
})
that.list = all
// this.list=newAppShow
//
console.log('用户列表', that.list)
// that.list.push({
// operation:true,
// appName: "",
// appShow: 1,
// bigModuleIcon: "log_active2",
// disableModuleIcon: null,
// labelName: "",
// labelSortNum: "7",
// menuList: null,
// moduleDesc: "",
// moduleEquipment: 0,
// moduleIcon: "log_active",
// moduleIcon2: "log",
// moduleId: "41",
// moduleName: "",
// modulePath: "",
// moduleType: 2,
// plugin: "constructionLog",
// styleType: 1
// });
}
})
*/
}
}
}