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

View File

@ -246,7 +246,7 @@
} else { } else {
this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail')) this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail'))
this.loadWeather() this.loadWeather()
this.getAllModule() this.getAllModule(userInfo.menuAuthority.moduleList)
} }
closeBle() closeBle()
.then((res) => { .then((res) => {
@ -835,7 +835,7 @@
}, },
getAllModule(arr) { getAllModule(arr) {
console.log('获取的模块', arr) console.log('获取的模块', arr)
const find = arr.find(item => item.plugin == "emergencyDisposal"); const find = arr ? arr.find(item => item.plugin == "emergencyDisposal") : "";
if (find) { if (find) {
uni.setStorageSync('moduleInfo', JSON.stringify(find)) uni.setStorageSync('moduleInfo', JSON.stringify(find))
} }
@ -875,61 +875,66 @@
} }
}) })
} else { } else {
that.list = arr.map(item => { if (arr) {
item.operation = true; that.list = arr.map(item => {
return 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============") 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
// });
}
})
*/
} }
} }
} }