// 初始化语言,默认为 zh-CN const DEFAULT_LOCALE = [ { loc: 'zh-CN', re: /^(zh|zh-CN|zh-Hans|zh-Hans-CN)$/ }, { loc: 'en', re: /^(en|en-[-a-zA-Z]+)$/ }, { loc: 'id', re: /^(id)$/ }, ].reduce((loc, o) => (o.re.test(navigator.language) ? o.loc : loc), 'zh-CN') // CDN 地址转换 const CDN_MAP = { // 'https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M': 'https://www.jx-linkcreate.cn/cdn', // 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M': 'https://www.jx-linkcreate.cn/cdn', // 'https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M': 'https://www.jx-linkcreate.cn/cdn', } // 框架默认样式 const DEFAULT_LAYOUT = { page: { background: 'rgb(233, 238, 243)', mType: 1, margin: 20, marginDetail: { top: 20, right: 20, bottom: 20, left: 20, }, showMargin: true, // 全屏功能使用,不在UI配置 }, headbar: { visible: false, height: 54, background: '#ffffff', menuIcon: { visible: true, size: 14, }, iconSize: 20, companyLogo: { visible: false, height: 36, }, title: '', fixedTitle: '', titleStyle: { fontFamily: '微软雅黑', color: '#454545', fontWeight: 400, fontSize: 17, letterSpacing: 1, }, subTitle: '', subTitleStyle: { fontFamily: '微软雅黑', color: '#909090', fontWeight: 400, fontSize: 12, letterSpacing: 1, }, searchBox: { visible: true, position: 'center', // left | center | right width: 350, height: 28, }, shortcut: { visible: false, marginLeft: 60, itemPadding: 20, // 每个菜单左右 padding 值,单位 px fontFamily: '微软雅黑', fontSize: 14, bold: false, textColor: '#8c8c8c', hoverTextColor: '#262626', activeTextColor: '#262626', background: { isMulti: false, c1: 'rgba(255, 255, 255, 1)', c2: 'rgba(255, 255, 255, 1)' }, // isMulti 是否使用多种颜色 hoverBackground: { isMulti: false, c1: 'rgba(236, 245, 255, 1)', c2: 'rgba(236, 245, 255, 1)', }, activeBackground: { isMulti: false, c1: 'rgba(217, 236, 255, 1)', c2: 'rgba(217, 236, 255, 1)', }, indicator: 'bottom', // none, top, bottom indicatorColor: '#3d84a8', indicatorSize: 3, dynamicNavMenu: false, menus: [], }, showWeatherIcon: true, showLayoutIcon: true, showWeibaoIcon: true, showLocaleIcon: true, showAppIcon: true, showWechatIcon: true, showHelpIcon: true, showNoticeIcon: true, showTodoIcon: true, shadow: { type: 1, h: 0, // 水平阴影长度 v: 2, // 垂直阴影长度 d: 10, // 模糊半径 e: 0, // 展开半径 c: 'rgb(0, 0, 0, 0.1)', // 阴影颜色 inset: false, }, }, navbar: { visible: false, width: 290, gap: 20, background: '#ffffff', borderRadius: 4, shadow: { type: 0, h: 0, v: 0, d: 0, e: 0, c: 'rgb(0, 0, 0, 1)', inset: false, }, textColor: '#8c8c8c', activeColor: '#262626', indicator: 'right', // none, left, right indicatorColor: '#3d84a8', indicatorSize: 3, showScrollbar: true, scrollbarColor: '#c7c7c7', folder: { lineHeight: 40, indent: 20, fontSize: 14, bold: false, hoverColor: '#262626', hoverBackground: 'rgb(236, 245, 255, 1)', activeBackground: 'rgba(0, 0, 0, 0)', }, item: { lineHeight: 40, indent: 20, fontSize: 14, bold: false, hoverColor: '#262626', hoverBackground: 'rgb(236, 245, 255, 1)', activeBackground: 'rgb(217, 236, 255, 1)', }, expandAllSize: 20, }, app: { pageCard: { borderRadius: 4, borderWidth: 0, borderColor: 'rgba(235, 238, 245, 1)', }, table: { type: 1, header: { background: 'rgb(242, 242, 242, 1)', lineSpace: 8, borderType: 0, // 0: 无边框 1: 底部 2: 四周 borderColor: 'rgb(217, 217, 217, 1)', splitColor: 'rgb(217, 217, 217, 1)', // 标题分割线颜色 fontFamily: '等线 Light', bold: true, fontSize: 14, color: '#909399', }, content: { background: 'rgb(255, 255, 255, 1)', lineSpace: 8, borderType: 0, // 0: 无边框 1: 底部 2: 四周 borderColor: 'rgb(217, 217, 217, 1)', fontFamily: '微软雅黑', bold: false, fontSize: 12, color: '#606266', hoverRowBackground: 'rgb(220, 220, 220, 1)', }, }, }, } // 嵌入到其他应用的影子应用 // hostApp 为空则初始化安装, 否则宿主 App 挂载后才会安装该应用,可以用逗号分隔多个App const SHADOW_APPS = [ { name: 'rule-engine', label: '规则引擎', devEntry: 'http://localhost:10401/', depEntry: '/_rule-engine/index.html', container: '#frame-content', activeRule: '/#/frame/rule-engine', // hostApp: 'wtau', }, { name: 'datav', label: '大屏设计器', devEntry: 'http://localhost:10402/', depEntry: '/_datav/index.html', container: '#frame-scope', activeRule: '/#/scope/datav', hostApp: 'devtools,device', }, { name: 'api-compose', label: 'API编排', devEntry: 'http://localhost:10403/', depEntry: '/_api-compose/index.html', container: '#frame-content', activeRule: '/#/frame/api-compose', // hostApp: 'wtau', }, ] ;(function() { window.$env = { TOKEN_CACHE: 'local', // local session store CDN_MAP, DEFAULT_LOCALE, DEFAULT_LAYOUT, SHADOW_APPS, } })()