Files
superlink/static/js/config.js
T

142 lines
11 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* config.js - 全局配置
*/
var BASE_URL = '/api/';
var PAGE_SIZE = 20;
/** 系统版本号(logo旁展示):修改代码后运行 tools/bump_version.php 自动递增 */
var APP_VERSION = 'v1.0.43';
/** 页脚版权/备案信息(在 config.js 中修改) */
var FOOTER_TEXT = '© 2026 SuperLink 管理系统 版权所有 | 备案号:请替换为真实备案号';
/**
* 扁平化图标库(单色 SVG,随文字颜色 currentColor)
* key -> SVG 字符串;菜单/占位图等统一从这里取,不用彩色 emoji
*/
var ICONS = {
dashboard: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>',
preliminary: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><rect x="8" y="2" width="8" height="4" rx="1"/><line x1="9" y1="12" x2="15" y2="12"/><line x1="9" y1="16" x2="15" y2="16"/></svg>',
data: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/></svg>',
company: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="2" width="16" height="20" rx="1"/><path d="M9 22v-4h6v4"/><line x1="8" y1="6" x2="10" y2="6"/><line x1="14" y1="6" x2="16" y2="6"/><line x1="8" y1="10" x2="10" y2="10"/><line x1="14" y1="10" x2="16" y2="10"/><line x1="8" y1="14" x2="10" y2="14"/><line x1="14" y1="14" x2="16" y2="14"/></svg>',
person: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>',
media: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polygon points="10 8 16 12 10 16 10 8"/></svg>',
need: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>',
marketing: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>',
channel: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',
document: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>',
system: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',
log: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>',
users: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>',
role: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"/></svg>',
menu: '<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>'
};
/** 菜单标识 -> 权限显示信息(角色权限标签等用) */
var MENU_MAP = {
'dashboard': { name: '综合概览', icon: 'dashboard', url: 'dashboard.html' },
'preliminary': { name: '碎片处理', icon: 'preliminary', url: 'fragment.html' },
'company': { name: '企业数据', icon: 'company', url: 'company.html' },
'person': { name: '人员数据', icon: 'person', url: 'person.html' },
'need': { name: '需求转盘', icon: 'need', url: 'need.html' },
'marketing': { name: '精准营销', icon: 'marketing', url: 'edm.html' },
'media_resources': { name: '媒体资源', icon: 'media', url: 'media_resources.html' },
'media_opinion': { name: '舆情监测', icon: 'media', url: 'media_opinion.html' },
'media_promo': { name: '推广服务', icon: 'media', url: 'media_promo.html' },
'competitor_analysis': { name: '竞品分析', icon: 'role', url: 'competitor_analysis.html' },
'competitor_data': { name: '竞品资料', icon: 'role', url: 'competitor_data.html' },
'channel': { name: '渠道管理', icon: 'channel', url: 'channel.html' },
'document': { name: '文件管理', icon: 'document', url: 'document.html' },
'system': { name: '权限管理', icon: 'system', url: 'user.html' },
'log': { name: '操作日志', icon: 'log', url: 'log.html' }
};
/**
* 左侧导航菜单分组结构(一级/二级)
* - 一级项:直接渲染菜单链接;分组项:children 为二级菜单(二级不显示图标)
* - 子项 key 为其权限标识,多个子项可共用一个权限(如营销服务三个子页)
*/
var MENU_GROUPS = [
{ key: 'dashboard', name: '综合概览', icon: 'dashboard', url: 'dashboard.html' },
{ key: 'preliminary', name: '碎片处理', icon: 'preliminary', url: 'fragment.html' },
{
key: 'data', name: '数据管理', icon: 'data', children: [
{ key: 'company', name: '企业数据', icon: 'company', url: 'company.html' },
{ key: 'person', name: '人员数据', icon: 'person', url: 'person.html' }
]
},
{
key: 'marketing', name: '精准营销', icon: 'marketing', children: [
{ key: 'marketing', name: 'EDM', icon: 'marketing', url: 'edm.html' },
{ key: 'marketing', name: '数据定制', icon: 'marketing', url: 'data_custom.html' },
{ key: 'need', name: '需求转盘', icon: 'need', url: 'need.html' }
]
},
{
key: 'media_mgmt', name: '媒体管理', icon: 'media', children: [
{ key: 'media_resources', name: '媒体资源', icon: 'media', url: 'media_resources.html' },
{ key: 'media_opinion', name: '舆情监测', icon: 'media', url: 'media_opinion.html' },
{ key: 'media_promo', name: '推广服务', icon: 'media', url: 'media_promo.html' }
]
},
{
key: 'competitor', name: '竞品管理', icon: 'role', children: [
{ key: 'competitor_analysis', name: '竞品分析', icon: 'role', url: 'competitor_analysis.html' },
{ key: 'competitor_data', name: '竞品资料', icon: 'role', url: 'competitor_data.html' }
]
},
{ key: 'channel', name: '渠道管理', icon: 'channel', url: 'channel.html' },
{
key: 'system', name: '权限管理', icon: 'system', children: [
{ key: 'system', name: '用户管理', icon: 'users', url: 'user.html' },
{ key: 'system', name: '角色管理', icon: 'role', url: 'role.html' }
]
},
{ key: 'log', name: '操作日志', icon: 'log', url: 'log.html' }
];
/**
* 国家/地区 中文 -> 英文(世界地图 ECharts world.js 匹配用)
*/
var CN_TO_EN = {
'中国': 'China', '中国大陆': 'China', '中国香港': 'China', '香港': 'China',
'中国澳门': 'China', '澳门': 'China', '中国台湾': 'China', '台湾': 'China',
'美国': 'United States', '日本': 'Japan', '韩国': 'South Korea', '朝鲜': 'North Korea',
'英国': 'United Kingdom', '法国': 'France', '德国': 'Germany', '意大利': 'Italy',
'西班牙': 'Spain', '葡萄牙': 'Portugal', '荷兰': 'Netherlands', '比利时': 'Belgium',
'瑞士': 'Switzerland', '瑞典': 'Sweden', '挪威': 'Norway', '芬兰': 'Finland',
'丹麦': 'Denmark', '波兰': 'Poland', '俄罗斯': 'Russia', '乌克兰': 'Ukraine',
'土耳其': 'Turkey', '希腊': 'Greece', '奥地利': 'Austria', '爱尔兰': 'Ireland',
'捷克': 'Czech Republic', '匈牙利': 'Hungary', '罗马尼亚': 'Romania', '保加利亚': 'Bulgaria',
'加拿大': 'Canada', '墨西哥': 'Mexico', '巴西': 'Brazil', '阿根廷': 'Argentina',
'智利': 'Chile', '秘鲁': 'Peru', '哥伦比亚': 'Colombia', '委内瑞拉': 'Venezuela',
'印度': 'India', '巴基斯坦': 'Pakistan', '印度尼西亚': 'Indonesia', '马来西亚': 'Malaysia',
'新加坡': 'Singapore', '泰国': 'Thailand', '越南': 'Vietnam', '菲律宾': 'Philippines',
'缅甸': 'Myanmar', '孟加拉国': 'Bangladesh', '斯里兰卡': 'Sri Lanka', '尼泊尔': 'Nepal',
'沙特阿拉伯': 'Saudi Arabia', '阿联酋': 'United Arab Emirates', '卡塔尔': 'Qatar',
'以色列': 'Israel', '伊朗': 'Iran', '伊拉克': 'Iraq', '哈萨克斯坦': 'Kazakhstan',
'澳大利亚': 'Australia', '新西兰': 'New Zealand', '南非': 'South Africa',
'埃及': 'Egypt', '尼日利亚': 'Nigeria', '肯尼亚': 'Kenya', '摩洛哥': 'Morocco',
'阿尔及利亚': 'Algeria', '埃塞俄比亚': 'Ethiopia', '蒙古': 'Mongolia',
'古巴': 'Cuba', '巴拿马': 'Panama', '乌拉圭': 'Uruguay', '厄瓜多尔': 'Ecuador'
};
/** 角色权限可勾选的菜单列表(角色管理弹窗用) */
var PERMISSION_OPTIONS = [
{ key: 'dashboard', name: '综合概览' },
{ key: 'preliminary', name: '碎片处理' },
{ key: 'company', name: '企业数据' },
{ key: 'person', name: '人员数据' },
{ key: 'need', name: '需求转盘' },
{ key: 'marketing', name: '精准营销' },
{ key: 'media_resources', name: '媒体资源' },
{ key: 'media_opinion', name: '舆情监测' },
{ key: 'media_promo', name: '推广服务' },
{ key: 'competitor_analysis', name: '竞品分析' },
{ key: 'competitor_data', name: '竞品资料' },
{ key: 'channel', name: '渠道管理' },
{ key: 'document', name: '文件管理' },
{ key: 'system', name: '权限管理' },
{ key: 'log', name: '操作日志' }
];