| | |
| | | * @description 获取语言转换信息 |
| | | */ |
| | | export function getLangTrans (config) { |
| | | if (sessionStorage.getItem('lang') !== 'zh-CN') return '' |
| | | |
| | | let langList = sessionStorage.getItem('langList') |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | |
| | | langList = sessionStorage.getItem('applangList') |
| | | } |
| | | |
| | | if (!langList) return |
| | | |
| | | let defLang = '' |
| | | if (!langList) return '' |
| | | |
| | | try { |
| | | langList = JSON.parse(langList) |
| | | defLang = langList[0] |
| | | } catch (e) { |
| | | defLang = '' |
| | | langList = '' |
| | | } |
| | | |
| | | if (!defLang) return '' |
| | | if (!langList) return '' |
| | | |
| | | langList = langList.filter(n => n !== 'zh-CN') |
| | | |
| | | if (langList.length === 0) return '' |
| | | |
| | | let sql = [] |
| | | let btn = [] |
| | |
| | | } else { |
| | | if (item.wrap && item.wrap.title) { |
| | | sql.push(item.wrap.title) |
| | | } |
| | | if (item.plot && item.plot.title) { |
| | | sql.push(item.plot.title) |
| | | } |
| | | |
| | | if (item.setting && (!item.wrap || !item.wrap.datatype || item.wrap.datatype === 'dynamic')) { |
| | |
| | | let result = [] |
| | | |
| | | langList.forEach(lan => { |
| | | if (lan === defLang) return |
| | | |
| | | list.forEach(n => { |
| | | result.push(`'${lan}',${n}`) |
| | | }) |
| | |
| | | } else { |
| | | if (item.wrap && item.wrap.title) { |
| | | item.wrap.title = replaceTitle(item.wrap.title) |
| | | } |
| | | if (item.plot && item.plot.title) { |
| | | item.plot.title = replaceTitle(item.plot.title) |
| | | } |
| | | if (item.wrap && (item.wrap.click === 'menu' || item.wrap.click === 'menus')) { |
| | | if (item.wrap.click === 'menu') { |
| | |
| | | if (item.wrap && item.wrap.title) { |
| | | item.wrap.title = replaceTitle(item.wrap.title) |
| | | } |
| | | if (item.plot && item.plot.title) { |
| | | item.plot.title = replaceTitle(item.plot.title) |
| | | } |
| | | if (item.setting && (!item.wrap || !item.wrap.datatype || item.wrap.datatype === 'dynamic')) { |
| | | if (item.setting.interType === 'system') { |
| | | item.setting.dataresource = filterSql(item.setting.dataresource) |