Commit fda651dc by 李伟康

提交

1 parent 725e3966
......@@ -58,6 +58,9 @@ module.exports = {
clew: {
path: '/dj-scrm-wx-work-attachment-clew/#/'
},
assistance: {
path: '/dj-scrm-wx-work-attachment-assistance/#/'
},
psd: {
path: '/dj-scrm-wx-work-attachment-psd/#/'
}
......@@ -67,8 +70,10 @@ module.exports = {
{
label: '喜报早报记录',
menuUrl: encodeURIComponent('chat/paper@psd|https://img01.glsx.com.cn/weapp/resource/scrm-mobile/main/paper.png'),
// corpIds: [],
corpIds: ['ww7d1c6fb5709cc884', 'wwa55ffac1225eb25e'],
parentLabel: '工作台',
parentIndex: 0
}
],
......
......@@ -49,40 +49,55 @@ export default {
},
activated () {
ssoApi.getPermission().then(data => {
const { entmicroId } = this.getLocalStorage('dj_scrm_userInfo')
if (data && data.length) {
let [merchantProTreeResponses] = data[0].products[0].merchantProTreeResponses
if (merchantProTreeResponses) {
let list = merchantProTreeResponses.children
if (list && list.length) {
list.map(e => {
if (e.children) {
specialMenuList.map(m => {
if (e.label == m.parentLabel && m.corpIds.includes(entmicroId)) e.children.push(m)
})
e.children.map(i => {
let [url, item] = decodeURIComponent(i.menuUrl).split('@')
let [target, icon] = item.split('|')
let [link, query] = url.split('?')
i.icon = icon
i.link = link
i.target = target
i.query = query
})
}
})
this.list = list
}
}
let list = merchantProTreeResponses.children || []
this.setMenuData(list)
} else this.setMenuData()
}
this.flag = true
})
},
mounted () {
mounted () {
// setInterval(() => {
// window.location.reload()
// }, 60e3)
},
methods: {
setMenuData (list = []) {
const { entmicroId } = this.getLocalStorage('dj_scrm_userInfo')
this.setSpecialMenuList(list)
list.map(e => {
specialMenuList.map(m => {
if (e.label == m.parentLabel && m.corpIds.includes(entmicroId)) e.children.push(m)
})
if (e.children) e.children.map(i => {
let [url, item] = decodeURIComponent(i.menuUrl).split('@')
let [target, icon] = item.split('|')
let [link, query] = url.split('?')
i.icon = icon
i.link = link
i.target = target
i.query = query
})
})
this.list = list
},
setSpecialMenuList (list) {
const { entmicroId } = this.getLocalStorage('dj_scrm_userInfo')
const titleItems = list.map(e => e.label) || []
specialMenuList.map(m => {
if (m.corpIds.includes(entmicroId) && !titleItems.includes(m.parentLabel)) {
titleItems.push(m.parentLabel)
list.splice(m.parentIndex, 0, {
label: m.parentLabel,
children: []
})
}
})
return list
},
jump (e) {
let sessionId = this.getSessionId()
let { corpId } = this.getLocalStorage('dj_scrm_corpId')
......@@ -90,7 +105,8 @@ export default {
let { path } = subsystemInfo[target]
let url = `${path}${link}?sessionId=${sessionId}&corpId=${corpId}`
if (query) url = `${url}&${query}`
window.location.href = url
console.log(url)
// window.location.href = url
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!