Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
supervise-wecom
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 7151765d
authored
May 28, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
chron: 项目基础优化 与 vant2 组件库的 主题定制
1 parent
23a36dcd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
18 deletions
babel.config.js
eslint.config.js
package.json
pnpm-lock.yaml
src/assets/css/vant-theme.less
src/main.js
src/mixins/reportTrackFunMixin.js
src/router/routes.js
src/store/modules/app.js
vue.config.js
babel.config.js
View file @
7151765
// 获取 VUE_APP_ENV 非 NODE_ENV,测试环境依然 console
// 获取 VUE_APP_ENV 非 NODE_ENV,测试环境依然 console
const
IS_PROD
=
[
'production'
,
'prod'
].
includes
(
process
.
env
.
VUE_APP_ENV
)
const
IS_PROD
=
[
"production"
,
"prod"
].
includes
(
process
.
env
.
VUE_APP_ENV
);
const
plugins
=
[
const
plugins
=
[
[
[
'import'
,
"import"
,
{
{
libraryName
:
'vant'
,
libraryName
:
"vant"
,
libraryDirectory
:
'es'
,
libraryDirectory
:
"es"
,
style
:
true
style
:
name
=>
`
${
name
}
/style/less`
,
},
},
'vant'
"vant"
,
]
],
]
]
;
// 去除 console.log
// 去除 console.log
if
(
IS_PROD
)
{
if
(
IS_PROD
)
{
plugins
.
push
(
'transform-remove-console'
)
plugins
.
push
(
"transform-remove-console"
);
}
}
module
.
exports
=
{
module
.
exports
=
{
presets
:
[[
'@vue/cli-plugin-babel/preset'
,
{
useBuiltIns
:
'usage'
,
corejs
:
3
}]],
presets
:
[[
"@vue/cli-plugin-babel/preset"
,
{
useBuiltIns
:
"usage"
,
corejs
:
3
}]],
plugins
plugins
,
}
}
;
eslint.config.js
View file @
7151765
...
@@ -99,9 +99,8 @@ export default antfu({
...
@@ -99,9 +99,8 @@ export default antfu({
order
:
[
order
:
[
"DEFINITION"
,
// is
"DEFINITION"
,
// is
"LIST_RENDERING"
,
// v-for
"LIST_RENDERING"
,
// v-for
"UNIQUE"
,
// ref key
"CONDITIONALS"
,
// v-if v-else-if v-else v-show v-cloak
"CONDITIONALS"
,
// v-if v-else-if v-else v-show v-cloak
"UNIQUE"
,
// ref key
"RENDER_MODIFIERS"
,
// v-once v-pre
"RENDER_MODIFIERS"
,
// v-once v-pre
"GLOBAL"
,
// id
"GLOBAL"
,
// id
"SLOT"
,
// v-slot slot
"SLOT"
,
// v-slot slot
...
...
package.json
View file @
7151765
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
"babel-plugin-transform-remove-console"
:
"^6.9.4"
,
"babel-plugin-transform-remove-console"
:
"^6.9.4"
,
"eslint"
:
"^9.39.2"
,
"eslint"
:
"^9.39.2"
,
"eslint-plugin-format"
:
"^1.2.0"
,
"eslint-plugin-format"
:
"^1.2.0"
,
"less"
:
"^4.6.4"
,
"less-loader"
:
"^7.3.0"
,
"postcss-px-to-viewport"
:
"^1.1.1"
,
"postcss-px-to-viewport"
:
"^1.1.1"
,
"sass"
:
"^1.99.0"
,
"sass"
:
"^1.99.0"
,
"sass-loader"
:
"^8.0.2"
,
"sass-loader"
:
"^8.0.2"
,
...
...
pnpm-lock.yaml
View file @
7151765
This diff is collapsed.
Click to expand it.
src/assets/css/vant-theme.less
0 → 100644
View file @
7151765
@primary-color: var(--themeColor, #3975c6);
@tabs-default-color: @primary-color;
src/main.js
View file @
7151765
...
@@ -13,7 +13,7 @@ import store from "./store";
...
@@ -13,7 +13,7 @@ import store from "./store";
import
{
bus
,
store
as
local
,
tools
,
util
}
from
"./utils"
;
import
{
bus
,
store
as
local
,
tools
,
util
}
from
"./utils"
;
import
"@/assets/css/index.scss"
;
import
"@/assets/css/index.scss"
;
import
"./utils/util"
;
import
"./utils/util"
;
import
"components"
;
import
"
@/
components"
;
// import mixin from './mixins/index'
// import mixin from './mixins/index'
vant
(
Vue
);
vant
(
Vue
);
Vue
.
prototype
.
api
=
ssoApi
;
Vue
.
prototype
.
api
=
ssoApi
;
...
...
src/mixins/reportTrackFunMixin.js
View file @
7151765
import
{
util
}
from
"utils"
;
import
{
util
}
from
"
@/
utils"
;
import
api
from
"../api/baseApi"
;
import
api
from
"../api/baseApi"
;
export
default
{
export
default
{
...
...
src/router/routes.js
View file @
7151765
...
@@ -22,7 +22,7 @@ Object.keys(pages).map((parent) => {
...
@@ -22,7 +22,7 @@ Object.keys(pages).map((parent) => {
if
(
meta
&&
meta
.
keepAlive
)
if
(
meta
&&
meta
.
keepAlive
)
keepAlives
.
push
(
name
);
keepAlives
.
push
(
name
);
const
route
=
{
const
route
=
{
component
:
resolve
=>
require
([
`views/
${
childrenPath
}
.vue`
],
resolve
),
component
:
resolve
=>
require
([
`
@/
views/
${
childrenPath
}
.vue`
],
resolve
),
path
,
path
,
name
,
name
,
meta
,
meta
,
...
...
src/store/modules/app.js
View file @
7151765
import
{
Http
}
from
"glsx-common"
;
import
{
Http
}
from
"glsx-common"
;
import
{
util
}
from
"utils"
;
import
{
Notify
}
from
"vant"
;
import
{
Notify
}
from
"vant"
;
import
{
ssoApi
}
from
"@/api"
;
import
{
ssoApi
}
from
"@/api"
;
import
reportTrackFunMixin
from
"@/mixins/reportTrackFunMixin"
;
import
reportTrackFunMixin
from
"@/mixins/reportTrackFunMixin"
;
import
{
util
}
from
"@/utils"
;
const
state
=
{
const
state
=
{
showWindow
:
false
,
showWindow
:
false
,
...
...
vue.config.js
View file @
7151765
...
@@ -65,6 +65,14 @@ module.exports = {
...
@@ -65,6 +65,14 @@ module.exports = {
extract
:
IS_PROD
,
extract
:
IS_PROD
,
sourceMap
:
false
,
sourceMap
:
false
,
loaderOptions
:
{
loaderOptions
:
{
less
:
{
lessOptions
:
{
modifyVars
:
{
// 直接覆盖变量
hack
:
`true; @import "
${
path
.
resolve
(
__dirname
,
"./src/assets/css/vant-theme.less"
)}
";`
,
},
},
},
scss
:
{
scss
:
{
// 向全局sass样式传入共享的全局变量, $src可以配置图片cdn前缀
// 向全局sass样式传入共享的全局变量, $src可以配置图片cdn前缀
// 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders
// 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders
...
@@ -125,6 +133,12 @@ module.exports = {
...
@@ -125,6 +133,12 @@ module.exports = {
// 别名 alias
// 别名 alias
config
.
resolve
.
alias
config
.
resolve
.
alias
.
set
(
"@"
,
resolve
(
"src"
));
.
set
(
"@"
,
resolve
(
"src"
));
// .set('assets', resolve('src/assets'))
// .set('api', resolve('src/api'))
// .set('views', resolve('src/views'))
// .set('components', resolve('src/components'))
// .set('plugins', resolve('src/components'))
// .set('utils', resolve('src/utils'))
/**
/**
* 设置保留空格
* 设置保留空格
*/
*/
...
...
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