setting.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. /**
  11. * CRMEB cashier 收银台 业务配置
  12. * */
  13. // 请求接口地址 如果没有配置自动获取当前网址路径
  14. const VUE_APP_API_URL = process.env.VUE_APP_API_URL || `${location.origin}/cashierapi`;
  15. const VUE_APP_WS_ADMIN_URL = process.env.VUE_APP_WS_ADMIN_URL || `ws:${location.hostname}/ws`
  16. // 路由前缀
  17. const roterPre = '/cashier'
  18. import util from '@/libs/util';
  19. import setting from './setting.env';
  20. let apiUrl = VUE_APP_API_URL;
  21. let wsUrl = VUE_APP_WS_ADMIN_URL;
  22. if (setting.isAPP) {
  23. let protocol = localStorage.getItem('protocol');
  24. let host = localStorage.getItem('api-url');
  25. apiUrl = protocol +'//'+ localStorage.getItem('api-url') + '/cashierapi';
  26. wsUrl = protocol === 'https:' ? 'wss://' + host + '/ws' : 'ws://' + host + '/ws';
  27. }
  28. const Setting = {
  29. /**
  30. * 基础配置
  31. * */
  32. roterPre,
  33. // 网页标题的后缀
  34. titleSuffix: util.cookies.get('pageTitle') || 'CRMEB',
  35. // 路由模式,可选值为 history 或 hash
  36. routerMode: setting.isAPP ? 'hash' : 'history',
  37. // 页面切换时,是否显示模拟的进度条
  38. showProgressBar: false,
  39. // 接口请求地址
  40. apiBaseURL: apiUrl,
  41. //websocket地址
  42. wsSocketUrl: wsUrl,
  43. //
  44. modalDuration: 3,
  45. // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
  46. errorModalType: 'Message',
  47. // Cookies 默认保存时间,单位:天
  48. cookiesExpires: 1,
  49. /**
  50. * 多语言配置
  51. * */
  52. i18n: {
  53. // 默认语言
  54. default: 'zh-CN',
  55. // 是否根据用户电脑配置自动设置语言(仅第一次有效)
  56. auto: false
  57. },
  58. /**
  59. * 布局配置
  60. * */
  61. // 侧边菜单宽度,单位 px,不可动态修改,需与 setting.less 的 @menuSideWidth 保持一致
  62. menuSideWidth: 200,
  63. layout: {
  64. // 侧边栏风格,可选值为 dark 或 light
  65. siderTheme: 'light',
  66. // 顶栏风格,可选值为 light、dark 或 primary
  67. headerTheme: 'light',
  68. // 顶栏是否置顶,开启后会覆盖侧边栏,需开启 headerFix
  69. headerStick: true,
  70. // 是否开启多 Tabs 页签
  71. tabs: false,
  72. // 多 Tabs 页签是否显示图标,开启 tabs 时有效
  73. showTabsIcon: true,
  74. // 是否固定多 Tabs 多页签
  75. tabsFix: true,
  76. // 是否固定侧边栏
  77. siderFix: true,
  78. // 是否固定顶栏
  79. headerFix: true,
  80. // 是否在下滑时隐藏顶栏,需开启 headerFix,如果开启了 tabsFix,Tabs 也会被隐藏
  81. headerHide: false,
  82. // 是否显示顶部菜单栏
  83. // 一般来说,侧边的菜单栏足以满足大部分业务,如需动态切换侧边栏,可开启此选项启用顶部一级菜单,此时侧边栏将作为二级菜单
  84. headerMenu: false,
  85. // 侧边菜单栏是否开启手风琴模式
  86. menuAccordion: true,
  87. // 是否显示折叠侧边栏按钮,移动端下会自动强制开启
  88. showSiderCollapse: true,
  89. // 侧边菜单栏是否默认折起
  90. menuCollapse: false,
  91. // 侧边菜单折起时,是否在子菜单前显示父级菜单名称
  92. showCollapseMenuTitle: false,
  93. // 是否显示重载按钮
  94. showReload: true,
  95. // 是否显示搜索
  96. showSearch: true,
  97. // 是否显示通知
  98. showNotice: true,
  99. // 是否显示全屏
  100. showFullscreen: true,
  101. // 在手机访问时,是否在顶部显示小尺寸 logo
  102. showMobileLogo: true,
  103. // 是否显示全局面包屑,开启 headerMenu 时不可用
  104. showBreadcrumb: true,
  105. // 全局面包屑是否显示图标,开启 showBreadcrumb 时有效
  106. showBreadcrumbIcon: true,
  107. // 是否显示日志入口,开启与否,不影响日志记录,如不希望用户看到可关闭
  108. showLog: true,
  109. // 是否显示多语言
  110. showI18n: false,
  111. // 是否支持动态修改布局配置,移动端下会自动强制关闭
  112. enableSetting: true,
  113. // 退出登录时,是否二次确认
  114. logoutConfirm: true
  115. },
  116. /**
  117. * 多页 Tabs
  118. * */
  119. page: {
  120. // 默认打开的页签
  121. opened: [`${roterPre}/home`]
  122. },
  123. /**
  124. * 功能配置
  125. * */
  126. // 相同路由,不同参数间进行切换,是否强力更新
  127. sameRouteForceUpdate: false,
  128. // 是否使用动态侧边菜单
  129. dynamicSiderMenu: true
  130. };
  131. export default Setting;