Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6598e432
authored
Aug 23, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
放弃cdn菜单css
1 parent
7404616e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
19 deletions
src/common/constants.js
src/common/helper.js
src/layout/components/NavUpdateLog.vue
src/main.js
src/store/modules/app.js
vue.config.js
src/common/constants.js
View file @
6598e43
...
...
@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-09-18 09:35:02
* @LastEditors: limin
* @LastEditTime: 2023-0
6-28 10:02:02
* @LastEditTime: 2023-0
8-23 16:33:24
* @FilePath: \scrm-base\src\common\constants.js
*/
export
default
{
...
...
@@ -25,11 +25,11 @@ export default {
CODE
:
'101'
,
MESSAGE
:
'未分配任何子菜单'
}
}
//
ICONS: (() => {
//
const iconFiles = require.context('../assets/images/icons', true, /\.png$/)
//
return iconFiles.keys().map(iconPath => iconPath.replace(/^\.\/(.*)\.\w+$/, '$1'))
//
})(),
// DEFAULT_ICON_NAME: 'dataview',
}
,
ICONS
:
(()
=>
{
const
iconFiles
=
require
.
context
(
'../assets/images/icons'
,
true
,
/
\.
png$/
)
return
iconFiles
.
keys
().
map
(
iconPath
=>
iconPath
.
replace
(
/^
\.\/(
.*
)\.\w
+$/
,
'$1'
))
})(),
DEFAULT_ICON_NAME
:
'dataview'
// SCRM_BASE_UPDATE_LOG_VERSION: 'SCRM_BASE_UPDATE_LOG_CONFIG'
}
src/common/helper.js
View file @
6598e43
...
...
@@ -7,7 +7,7 @@
* @LastEditTime: 2022-12-19 09:36:48
* @FilePath: \scrm-base\src\common\helper.js
*/
//
import constants from './constants'
import
constants
from
'./constants'
export
function
customized
(
cdn
,
{
assets
,
title
})
{
var
link
=
document
.
querySelector
(
"link[rel*='icon']"
)
||
document
.
createElement
(
'link'
)
link
.
type
=
'image/x-icon'
...
...
@@ -16,10 +16,10 @@ export function customized(cdn, { assets, title }) {
document
.
getElementsByTagName
(
'head'
)[
0
].
appendChild
(
link
)
document
.
title
=
title
}
//
export function getIcon(iconName) {
//
const { ICONS, DEFAULT_ICON_NAME } = constants
//
return ICONS.includes(iconName) && ICONS.includes(iconName + '-active') ? iconName : DEFAULT_ICON_NAME
//
}
export
function
getIcon
(
iconName
)
{
const
{
ICONS
,
DEFAULT_ICON_NAME
}
=
constants
return
ICONS
.
includes
(
iconName
)
&&
ICONS
.
includes
(
iconName
+
'-active'
)
?
iconName
:
DEFAULT_ICON_NAME
}
export
function
locationPath
()
{
return
new
Map
(
location
.
search
...
...
src/layout/components/NavUpdateLog.vue
View file @
6598e43
...
...
@@ -7,7 +7,6 @@
<
script
>
import
{
Version
}
from
'glsx-common-sdk'
import
{
helper
}
from
'@/common'
const
version
=
new
Version
({
request
:
{
baseUrl
:
'https://config-center-backend.glsx.com.cn/glsxAdmin/config'
,
...
...
@@ -27,8 +26,6 @@ export default {
methods
:
{
async
getUpdateLogCofig
()
{
this
.
v
=
await
version
.
get
({
moduleUrl
:
'scrm-sp'
,
env
:
'update'
})
const
{
cdn
}
=
this
.
$config
helper
.
createLink
(
`
${
cdn
}
/test/icons/sprite.css?v=
${
this
.
v
.
version
}
`
)
},
clickHandler
()
{
this
.
v
=
version
.
set
()
...
...
src/main.js
View file @
6598e43
...
...
@@ -9,7 +9,7 @@ import '@/common/reg-prototype.js'
import
'@/common/error-handler.js'
import
{
fetchConfig
,
config
}
from
'@/config/index'
import
'@/assets/style/index.scss'
//
import '@/assets/images/sprite/sprite.css'
import
'@/assets/images/sprite/sprite.css'
import
'./components'
import
'./filters'
import
{
Message
}
from
'./plugins/element.js'
...
...
src/store/modules/app.js
View file @
6598e43
import
{
utils
}
from
'glsx-common'
import
Layout
from
'@/views/Layout'
import
{
constants
}
from
'@/common'
import
{
constants
,
helper
}
from
'@/common'
import
router
from
'@/router'
const
app
=
{
namespaced
:
true
,
...
...
@@ -97,7 +97,7 @@ function formatData(menus, parentMenu) {
if
(
!
path
.
includes
(
'@'
))
continue
;[
entry
,
name
]
=
path
.
split
(
'@'
)
menu
.
entry
=
entry
menu
.
icon
=
name
//
helper.getIcon(name)
menu
.
icon
=
helper
.
getIcon
(
name
)
menu
.
name
=
name
menu
.
id
=
`
${
id
}
`
}
else
{
...
...
vue.config.js
View file @
6598e43
...
...
@@ -4,7 +4,7 @@ const resolve = dir => path.join(__dirname, dir)
const
SpritesmithPlugin
=
require
(
'webpack-spritesmith'
)
const
CDN_DOMAIN
=
'https://img02.glsx.com.cn/ajax/libs'
const
cdn
=
{
css
:
[
`
${
CDN_DOMAIN
}
/element-ui/2.11.1/theme-chalk/index.css`
,
'https://img02.glsx.com.cn/gl-iconfont/iconfont.css'
,
'https://img02.glsx.com.cn/weapp/resource/saas/scrm/assets/images/icons/sprite.css'
],
css
:
[
`
${
CDN_DOMAIN
}
/element-ui/2.11.1/theme-chalk/index.css`
,
'https://img02.glsx.com.cn/gl-iconfont/iconfont.css'
],
js
:
[
`
${
CDN_DOMAIN
}
/rxjs/7.3.0/rxjs.umd.min.js`
]
}
module
.
exports
=
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment