@ -0,0 +1,9 @@ |
|||||
|
import Vue from 'vue' |
||||
|
import SvgIcon from '@/components/SvgIcon'// svg component
|
||||
|
|
||||
|
// register globally
|
||||
|
Vue.component('SvgIcon', SvgIcon) |
||||
|
|
||||
|
const req = require.context('./svg', false, /\.svg$/) |
||||
|
const requireAll = requireContext => requireContext.keys().map(requireContext) |
||||
|
requireAll(req) |
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 790 B After Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 823 B After Width: | Height: | Size: 823 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 744 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 511 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 873 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 564 B |
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 592 B After Width: | Height: | Size: 592 B |
|
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 787 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 805 B After Width: | Height: | Size: 805 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,22 @@ |
|||||
|
# replace default config |
||||
|
|
||||
|
# multipass: true |
||||
|
# full: true |
||||
|
|
||||
|
plugins: |
||||
|
|
||||
|
# - name |
||||
|
# |
||||
|
# or: |
||||
|
# - name: false |
||||
|
# - name: true |
||||
|
# |
||||
|
# or: |
||||
|
# - name: |
||||
|
# param1: 1 |
||||
|
# param2: 2 |
||||
|
|
||||
|
- removeAttrs: |
||||
|
attrs: |
||||
|
- 'fill' |
||||
|
- 'fill-rule' |
||||
|
Before Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 646 KiB |
|
Before Width: | Height: | Size: 358 KiB |
|
Before Width: | Height: | Size: 321 KiB |
|
Before Width: | Height: | Size: 231 KiB |
|
Before Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 219 KiB |
@ -1,75 +0,0 @@ |
|||||
// cover some element-ui styles |
|
||||
.el-breadcrumb__inner, |
|
||||
.el-breadcrumb__inner a { |
|
||||
font-weight: 400 !important; |
|
||||
} |
|
||||
.el-upload { |
|
||||
input[type="file"] { |
|
||||
display: none !important; |
|
||||
} |
|
||||
} |
|
||||
.el-upload__input { |
|
||||
display: none; |
|
||||
} |
|
||||
.cell { |
|
||||
.el-tag { |
|
||||
margin-right: 0; |
|
||||
} |
|
||||
} |
|
||||
.small-padding { |
|
||||
.cell { |
|
||||
padding-left: 5px; |
|
||||
padding-right: 5px; |
|
||||
} |
|
||||
} |
|
||||
.fixed-width { |
|
||||
.el-button--mini { |
|
||||
padding: 7px 10px; |
|
||||
min-width: 60px; |
|
||||
} |
|
||||
} |
|
||||
.status-col { |
|
||||
.cell { |
|
||||
padding: 0 10px; |
|
||||
text-align: center; |
|
||||
.el-tag { |
|
||||
margin-right: 0; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// to fixed https://github.com/ElemeFE/element/issues/2461 |
|
||||
.el-dialog { |
|
||||
transform: none; |
|
||||
left: 0; |
|
||||
position: relative; |
|
||||
margin: 0 auto; |
|
||||
} |
|
||||
|
|
||||
// refine element ui upload |
|
||||
.upload-container { |
|
||||
.el-upload { |
|
||||
width: 100%; |
|
||||
.el-upload-dragger { |
|
||||
width: 100%; |
|
||||
height: 200px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// dropdown |
|
||||
.el-dropdown-menu { |
|
||||
a { |
|
||||
display: block; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// fix date-picker ui bug in filter-item |
|
||||
.el-range-editor.el-input__inner { |
|
||||
display: inline-flex !important; |
|
||||
} |
|
||||
|
|
||||
// to fix el-date-picker css style |
|
||||
.el-range-separator { |
|
||||
box-sizing: content-box; |
|
||||
} |
|
||||
@ -1,32 +0,0 @@ |
|||||
/** |
|
||||
* I think element-ui's default theme color is too light for long-term use. |
|
||||
* So I modified the default color and you can modify it to your liking. |
|
||||
**/ |
|
||||
|
|
||||
/* theme color */ |
|
||||
$--color-primary: #1890ff; |
|
||||
$--color-success: #13ce66; |
|
||||
$--color-warning: #ffba00; |
|
||||
$--color-danger: #ff4949; |
|
||||
// $--color-info: #1E1E1E; |
|
||||
|
|
||||
$--button-font-weight: 400; |
|
||||
|
|
||||
// $--color-text-regular: #1f2d3d; |
|
||||
|
|
||||
$--border-color-light: #dfe4ed; |
|
||||
$--border-color-lighter: #e6ebf5; |
|
||||
|
|
||||
$--table-border: 1px solid #dfe6ec; |
|
||||
|
|
||||
$--box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
|
||||
|
|
||||
/* icon font path, required */ |
|
||||
$--font-path: "~element-ui/lib/theme-chalk/fonts"; |
|
||||
@import "../../../../node_modules/element-ui/packages/theme-chalk/src/index"; |
|
||||
|
|
||||
// the :export directive is the magic sauce for webpack |
|
||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass |
|
||||
:export { |
|
||||
theme: $--color-primary; |
|
||||
} |
|
||||
@ -1,133 +0,0 @@ |
|||||
<template> |
|
||||
<div class="official-container"> |
|
||||
<div class="header-container"> |
|
||||
<el-row type="flex" align="middle"> |
|
||||
<el-col class="header-col" :span="3" :offset="6"> |
|
||||
<img src="@/assets/images/indexLogo.png" class="header-logo" @click="$router.push({path:'/home'})"> |
|
||||
</el-col> |
|
||||
<el-col class="header-col" :span="6" :offset="1"> |
|
||||
<el-menu :default-active="menuIndex" mode="horizontal" |
|
||||
text-color="#205BB5" |
|
||||
active-text-color="#205BB5" |
|
||||
@select="activeMenuHandle" |
|
||||
> |
|
||||
<el-menu-item v-for="(item, index) in menuRouters" :key="index" :index="item.routerPath" |
|
||||
:route="item.routerPath" class="menu-item" |
|
||||
> |
|
||||
{{ item.title }} |
|
||||
</el-menu-item> |
|
||||
</el-menu> |
|
||||
</el-col> |
|
||||
<el-col class="header-col" :span="3"> |
|
||||
<el-button v-if="isLogin" class="header-btn" @click="$router.push({path:'/home'})">控 制 台</el-button> |
|
||||
<el-button v-if="!isLogin&&this.$route.path!='/login' " class="header-btn" |
|
||||
@click="$router.push({path:'/login'})" |
|
||||
> |
|
||||
登 录 |
|
||||
</el-button> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</div> |
|
||||
<div class="main-container"> |
|
||||
<router-view /> |
|
||||
</div> |
|
||||
</div> |
|
||||
</template> |
|
||||
<script> |
|
||||
import store from '@/store/index.js' |
|
||||
import {checkIsUrl, openUrl} from '@/utils' |
|
||||
|
|
||||
export default { |
|
||||
name: 'Official', |
|
||||
data() { |
|
||||
return { |
|
||||
menuIndex: null, |
|
||||
menuRouters: [ |
|
||||
{ |
|
||||
routerPath: '/', |
|
||||
title: '首页' |
|
||||
}, |
|
||||
{ |
|
||||
routerPath: 'https://gitee.com/TDuckApp/tduck-platform/issues', |
|
||||
title: '提出建议' |
|
||||
}, |
|
||||
{ |
|
||||
routerPath: 'https://gitee.com/TDuckApp/tduck-platform?time=2', |
|
||||
title: '开源版本' |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
computed: { |
|
||||
getStore() { |
|
||||
return store |
|
||||
}, |
|
||||
isLogin() { |
|
||||
return this.getStore.getters['user/isLogin'] |
|
||||
} |
|
||||
}, |
|
||||
watch: { |
|
||||
$route(to) { |
|
||||
this.menuIndex = to.path |
|
||||
} |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.menuIndex = this.$route.path |
|
||||
}, methods: { |
|
||||
activeMenuHandle(routerPath) { |
|
||||
if (checkIsUrl(routerPath)) { |
|
||||
openUrl(routerPath) |
|
||||
} else { |
|
||||
this.menuIndex = routerPath |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
<style scoped> |
|
||||
.official-container { |
|
||||
height: 100%; |
|
||||
width: 100%; |
|
||||
margin: 0; |
|
||||
} |
|
||||
.header-container { |
|
||||
background-color: white; |
|
||||
width: 100%; |
|
||||
min-width: 960px; |
|
||||
top: 0; |
|
||||
height: 102px; |
|
||||
z-index: 100; |
|
||||
} |
|
||||
.main-container { |
|
||||
height: calc(100vh - 102px); |
|
||||
} |
|
||||
.header-container .header-col .el-menu--horizontal { |
|
||||
border: none; |
|
||||
} |
|
||||
.header-logo { |
|
||||
cursor: pointer; |
|
||||
width: 175px; |
|
||||
} |
|
||||
.menu-item { |
|
||||
line-height: 90px; |
|
||||
height: 90px; |
|
||||
font-size: 16px; |
|
||||
font-weight: 900; |
|
||||
position: relative; |
|
||||
left: 200px; |
|
||||
} |
|
||||
.header-btn { |
|
||||
margin: 35px 0 35px 20px; |
|
||||
float: right; |
|
||||
color: #205bb5; |
|
||||
border-color: #205bb5; |
|
||||
} |
|
||||
.header-btn:focus, |
|
||||
.header-btn:hover { |
|
||||
border-color: #205bb5; |
|
||||
color: #205bb5; |
|
||||
} |
|
||||
.view_container_content p { |
|
||||
color: #205bb5; |
|
||||
} |
|
||||
</style> |
|
||||
@ -1,76 +1,115 @@ |
|||||
const path = require('path') |
const path = require('path') |
||||
const terserPlugin = require('terser-webpack-plugin') |
|
||||
|
const name = process.env['VUE_APP_TITLE '] |
||||
|
|
||||
|
function resolve(dir) { |
||||
|
return path.join(__dirname, dir) |
||||
|
} |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
publicPath: '/', |
publicPath: '/', |
||||
productionSourceMap: false, |
lintOnSave: process.env.NODE_ENV === 'development', |
||||
devServer: { |
productionSourceMap: false, |
||||
disableHostCheck: true, |
devServer: { |
||||
open: true, |
disableHostCheck: true, |
||||
port: 8888, |
open: true, |
||||
// 开发环境默认开启反向代理,如果不需要请自行注释
|
port: 8888, |
||||
proxy: { |
// 开发环境默认开启反向代理,如果不需要请自行注释
|
||||
'/tduck-api': { |
proxy: { |
||||
target: 'http://localhost:8999', |
'/tduck-api': { |
||||
changeOrigin: true |
target: 'http://localhost:8999', |
||||
|
changeOrigin: true |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
configureWebpack: { |
||||
|
// provide the app's title in webpack's name field, so that
|
||||
|
// it can be accessed in index.html to inject the correct title.
|
||||
|
name: name, |
||||
|
resolve: { |
||||
|
alias: { |
||||
|
'@': resolve('src') |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
chainWebpack(config) { |
||||
|
// it can improve the speed of the first screen, it is recommended to turn on preload
|
||||
|
// it can improve the speed of the first screen, it is recommended to turn on preload
|
||||
|
config.plugin('preload').tap(() => [ |
||||
|
{ |
||||
|
rel: 'preload', |
||||
|
// to ignore runtime.js
|
||||
|
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
|
||||
|
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], |
||||
|
include: 'initial' |
||||
|
} |
||||
|
]) |
||||
|
|
||||
|
// when there are many pages, it will cause too many meaningless requests
|
||||
|
config.plugins.delete('prefetch') |
||||
|
|
||||
|
// set svg-sprite-loader
|
||||
|
config.module |
||||
|
.rule('svg') |
||||
|
.exclude.add(resolve('src/assets/icons')) |
||||
|
.end() |
||||
|
config.module |
||||
|
.rule('icons') |
||||
|
.test(/\.svg$/) |
||||
|
.include.add(resolve('src/assets/icons')) |
||||
|
.end() |
||||
|
.use('svg-sprite-loader') |
||||
|
.loader('svg-sprite-loader') |
||||
|
.options({ |
||||
|
symbolId: 'icon-[name]' |
||||
|
}) |
||||
|
.end() |
||||
|
config.plugin('html') |
||||
|
.tap(args => { |
||||
|
args[0].title = process.env.VUE_APP_TITLE |
||||
|
args[0].debugTool = process.env.VUE_APP_DEBUG_TOOL |
||||
|
return args |
||||
|
}) |
||||
|
.end() |
||||
|
|
||||
|
config |
||||
|
.when(process.env.NODE_ENV !== 'development', |
||||
|
config => { |
||||
|
config |
||||
|
.plugin('ScriptExtHtmlWebpackPlugin') |
||||
|
.after('html') |
||||
|
.use('script-ext-html-webpack-plugin', [{ |
||||
|
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||
|
inline: /runtime\..*\.js$/ |
||||
|
}]) |
||||
|
.end() |
||||
|
config |
||||
|
.optimization.splitChunks({ |
||||
|
chunks: 'all', |
||||
|
cacheGroups: { |
||||
|
libs: { |
||||
|
name: 'chunk-libs', |
||||
|
test: /[\\/]node_modules[\\/]/, |
||||
|
priority: 10, |
||||
|
chunks: 'initial' // only package third parties that are initially dependent
|
||||
|
}, |
||||
|
elementUI: { |
||||
|
name: 'chunk-elementUI', // split elementUI into a single package
|
||||
|
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
|
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
||||
|
}, |
||||
|
commons: { |
||||
|
name: 'chunk-commons', |
||||
|
test: resolve('src/components'), // can customize your rules
|
||||
|
minChunks: 3, // minimum common number
|
||||
|
priority: 5, |
||||
|
reuseExistingChunk: true |
||||
|
} |
||||
} |
} |
||||
|
}) |
||||
|
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
|
||||
|
config.optimization.runtimeChunk('single') |
||||
} |
} |
||||
}, |
) |
||||
configureWebpack: config => { |
} |
||||
config.resolve.modules = ['node_modules'] |
|
||||
config.resolve.alias = { |
|
||||
'@': path.resolve(__dirname, 'src') |
|
||||
} |
|
||||
config.optimization = { |
|
||||
minimizer: [ |
|
||||
//https://webpack.docschina.org/plugins/terser-webpack-plugin/
|
|
||||
new terserPlugin({ |
|
||||
terserOptions: { |
|
||||
compress: { |
|
||||
warnings: false, |
|
||||
drop_console: true, |
|
||||
drop_debugger: true, |
|
||||
pure_funcs: ['console.log'] |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
chainWebpack: config => { |
|
||||
const oneOfsMap = config.module.rule('scss').oneOfs.store |
|
||||
oneOfsMap.forEach(item => { |
|
||||
item.use('sass-resources-loader') |
|
||||
.loader('sass-resources-loader') |
|
||||
.options({ |
|
||||
resources: [ |
|
||||
'./src/assets/styles/resources/*.scss', |
|
||||
] |
|
||||
}) |
|
||||
.end() |
|
||||
}) |
|
||||
config.module |
|
||||
.rule('svg') |
|
||||
.exclude.add(path.join(__dirname, 'src/assets/icons')) |
|
||||
.end() |
|
||||
config.module |
|
||||
.rule('icons') |
|
||||
.test(/\.svg$/) |
|
||||
.include.add(path.join(__dirname, 'src/assets/icons')) |
|
||||
.end() |
|
||||
.use('svg-sprite-loader') |
|
||||
.loader('svg-sprite-loader') |
|
||||
.options({ |
|
||||
symbolId: 'icon-[name]' |
|
||||
}) |
|
||||
.end() |
|
||||
config.plugin('html') |
|
||||
.tap(args => { |
|
||||
args[0].title = process.env.VUE_APP_TITLE |
|
||||
args[0].debugTool = process.env.VUE_APP_DEBUG_TOOL |
|
||||
return args |
|
||||
}) |
|
||||
.end() |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||