-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request !3 from 工作专用/master
- Loading branch information
Showing
21 changed files
with
177 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href="<%= BASE_URL %>logo.png"> | ||
<title>RUOYI ANT</title> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/moment.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/locale/zh-cn.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.css"/> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.js"></script> | ||
<style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style> | ||
</head> | ||
<body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
const ThemeColorReplacer = require('webpack-theme-color-replacer') | ||
const generate = require('@ant-design/colors/lib/generate').default | ||
|
||
function resolve (dir) { | ||
return path.join(__dirname, dir) | ||
} | ||
|
||
// vue.config.js | ||
module.exports = { | ||
configureWebpack: { | ||
externals: { | ||
'axios': 'axios', | ||
'vue-router': 'VueRouter', | ||
'vuex': 'Vuex', | ||
'vue': 'Vue', | ||
'moment': 'moment', | ||
'ant-design-vue': 'antd' | ||
}, | ||
plugins: [ | ||
// Ignore all locale files of moment.js | ||
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), | ||
new webpack.IgnorePlugin(/moment\\/), | ||
// 生成仅包含颜色的替换样式(主题色等) | ||
// TODO 需要增加根据环境不开启主题需求 | ||
new ThemeColorReplacer({ | ||
fileName: 'css/theme-colors.css', // TODO 需要处理的暗坑 | ||
matchColors: getAntdSerials('#1890ff'), // 主色系列 | ||
// 改变样式选择器,解决样式覆盖问题 | ||
changeSelector (selector) { | ||
switch (selector) { | ||
case '.ant-calendar-today .ant-calendar-date': | ||
return ':not(.ant-calendar-selected-date)' + selector | ||
case '.ant-btn:focus,.ant-btn:hover': | ||
return '.ant-btn:focus:not(.ant-btn-primary),.ant-btn:hover:not(.ant-btn-primary)' | ||
case '.ant-btn.active,.ant-btn:active': | ||
return '.ant-btn.active:not(.ant-btn-primary),.ant-btn:active:not(.ant-btn-primary)' | ||
case '.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover': | ||
case '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal > .ant-menu-submenu-selected,.ant-menu-horizontal > .ant-menu-submenu:hover': | ||
return '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu:hover' | ||
default : | ||
return selector | ||
} | ||
} | ||
}) | ||
] | ||
}, | ||
|
||
chainWebpack: (config) => { | ||
config.resolve.alias | ||
.set('@$', resolve('src')) | ||
|
||
const svgRule = config.module.rule('svg') | ||
svgRule.uses.clear() | ||
svgRule | ||
.oneOf('inline') | ||
.resourceQuery(/inline/) | ||
.use('vue-svg-icon-loader') | ||
.loader('vue-svg-icon-loader') | ||
.end() | ||
.end() | ||
.oneOf('external') | ||
.use('file-loader') | ||
.loader('file-loader') | ||
.options({ | ||
name: 'assets/[name].[hash:8].[ext]' | ||
}) | ||
/* svgRule.oneOf('inline') | ||
.resourceQuery(/inline/) | ||
.use('vue-svg-loader') | ||
.loader('vue-svg-loader') | ||
.end() | ||
.end() | ||
.oneOf('external') | ||
.use('file-loader') | ||
.loader('file-loader') | ||
.options({ | ||
name: 'assets/[name].[hash:8].[ext]' | ||
}) | ||
*/ | ||
}, | ||
|
||
css: { | ||
loaderOptions: { | ||
less: { | ||
modifyVars: { | ||
/* less 变量覆盖,用于自定义 ant design 主题 */ | ||
|
||
/* | ||
'primary-color': '#F5222D', | ||
'link-color': '#F5222D', | ||
'border-radius-base': '4px', | ||
*/ | ||
}, | ||
javascriptEnabled: true | ||
} | ||
} | ||
}, | ||
|
||
devServer: { | ||
// development server port 8000 | ||
port: 8000, | ||
proxy: { | ||
'/api': { | ||
// target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', | ||
target: 'https://www.easy-mock.com/mock/5ce2743c2dda2d3b1365fb1b/ruoyi-cloud', | ||
// target: 'http://myzuul.com:9527', | ||
pathRewrite: { '^/api': '' }, | ||
ws: false, | ||
changeOrigin: true | ||
} | ||
} | ||
}, | ||
|
||
// disable source map in production | ||
productionSourceMap: false, | ||
lintOnSave: undefined, | ||
// babel-loader no-ignore node_modules/* | ||
transpileDependencies: [] | ||
} | ||
|
||
function getAntdSerials (color) { | ||
// 淡化(即less的tint) | ||
const lightens = new Array(9).fill().map((t, i) => { | ||
return ThemeColorReplacer.varyColor.lighten(color, i / 10) | ||
}) | ||
const colorPalettes = generate(color) | ||
return lightens.concat(colorPalettes) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters