Merge branch 'master' into deploy

This commit is contained in:
Pan 2019-02-13 15:11:10 +08:00
commit f1ed620fc2
22 changed files with 279 additions and 138 deletions

View File

@ -44,6 +44,7 @@
"echarts": "4.1.0", "echarts": "4.1.0",
"element-ui": "2.4.11", "element-ui": "2.4.11",
"file-saver": "1.3.8", "file-saver": "1.3.8",
"fuse.js": "3.4.2",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jsonlint": "1.6.3", "jsonlint": "1.6.3",
"jszip": "3.1.5", "jszip": "3.1.5",

View File

@ -63,7 +63,7 @@ export default {
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
line-height: 50px; line-height: 50px;
margin-left: 10px; margin-left: 8px;
.no-redirect { .no-redirect {
color: #97a8be; color: #97a8be;
cursor: text; cursor: text;

View File

@ -1,21 +1,8 @@
<template> <template>
<div v-if="errorLogs.length>0"> <div v-if="errorLogs.length>0">
<el-badge :is-dot="true" style="line-height: 30px;" @click.native="dialogTableVisible=true"> <el-badge :is-dot="true" style="line-height: 25px;margin-top: -5px;" @click.native="dialogTableVisible=true">
<el-button size="small" type="danger" class="bug-btn"> <el-button style="padding: 8px 10px;" size="small" type="danger">
<svg <svg-icon icon-class="bug" />
t="1492682037685"
class="bug-svg"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="1863"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="128"
height="128">
<path
d="M969.142857 548.571429q0 14.848-10.861714 25.709714t-25.709714 10.861714l-128 0q0 97.718857-38.290286 165.705143l118.857143 119.442286q10.861714 10.861714 10.861714 25.709714t-10.861714 25.709714q-10.276571 10.861714-25.709714 10.861714t-25.709714-10.861714l-113.152-112.566857q-2.852571 2.852571-8.557714 7.424t-23.990857 16.274286-37.156571 20.845714-46.848 16.566857-55.442286 7.424l0-512-73.142857 0 0 512q-29.147429 0-58.002286-7.716571t-49.700571-18.870857-37.705143-22.272-24.868571-18.578286l-8.557714-8.009143-104.557714 118.272q-11.446857 11.995429-27.428571 11.995429-13.714286 0-24.576-9.142857-10.861714-10.276571-11.702857-25.417143t8.850286-26.587429l115.419429-129.718857q-33.133714-65.133714-33.133714-156.562286l-128 0q-14.848 0-25.709714-10.861714t-10.861714-25.709714 10.861714-25.709714 25.709714-10.861714l128 0 0-168.009143-98.852571-98.852571q-10.861714-10.861714-10.861714-25.709714t10.861714-25.709714 25.709714-10.861714 25.709714 10.861714l98.852571 98.852571 482.304 0 98.852571-98.852571q10.861714-10.861714 25.709714-10.861714t25.709714 10.861714 10.861714 25.709714-10.861714 25.709714l-98.852571 98.852571 0 168.009143 128 0q14.848 0 25.709714 10.861714t10.861714 25.709714zM694.857143 219.428571l-365.714286 0q0-75.995429 53.430857-129.426286t129.426286-53.430857 129.426286 53.430857 53.430857 129.426286z"
p-id="1864"/>
</svg>
</el-button> </el-button>
</el-badge> </el-badge>
@ -67,16 +54,6 @@ export default {
</script> </script>
<style scoped> <style scoped>
.bug-btn.el-button--small {
padding: 9px 10px;
}
.bug-svg {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
.message-title { .message-title {
font-size: 16px; font-size: 16px;
color: #333; color: #333;

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div style="padding: 0 15px;" @click="toggleClick">
<svg <svg
:class="{'is-active':isActive}" :class="{'is-active':isActive}"
class="hamburger" class="hamburger"
@ -7,7 +7,7 @@
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="64" width="64"
height="64" height="64"
@click="toggleClick"> >
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" /> <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" />
</svg> </svg>
</div> </div>
@ -32,10 +32,11 @@ export default {
<style scoped> <style scoped>
.hamburger { .hamburger {
display: inline-block; display: inline-block;
cursor: pointer; vertical-align: middle;
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
.hamburger.is-active { .hamburger.is-active {
transform: rotate(180deg); transform: rotate(180deg);
} }

View File

@ -0,0 +1,187 @@
<template>
<div :class="{'show':show}" class="header-search">
<svg-icon class-name="search-icon" icon-class="search" @click="click" />
<el-select
ref="headerSearchSelect"
v-model="search"
:remote-method="querySearch"
filterable
default-first-option
remote
placeholder="Search"
class="header-search-select"
@change="change">
<el-option v-for="item in options" :key="item.path" :value="item" :label="item.title.join(' > ')"/>
</el-select>
</div>
</template>
<script>
import Fuse from 'fuse.js'
import path from 'path'
import i18n from '@/lang'
export default {
name: 'HeaderSearch',
data() {
return {
search: '',
options: [],
searchPool: [],
show: false,
fuse: undefined
}
},
computed: {
routers() {
return this.$store.getters.permission_routers
},
lang() {
return this.$store.getters.language
}
},
watch: {
lang() {
this.searchPool = this.generateRouters(this.routers)
},
routers() {
this.searchPool = this.generateRouters(this.routers)
},
searchPool(list) {
this.initFuse(list)
},
show(value) {
if (value) {
document.body.addEventListener('click', this.close)
} else {
document.body.removeEventListener('click', this.close)
}
}
},
mounted() {
this.searchPool = this.generateRouters(this.routers)
},
methods: {
click() {
this.show = !this.show
if (this.show) {
this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus()
}
},
close() {
this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur()
this.options = []
this.show = false
},
change(val) {
this.$router.push(val.path)
this.search = ''
this.options = []
this.$nextTick(() => {
this.show = false
})
},
initFuse(list) {
this.fuse = new Fuse(list, {
shouldSort: true,
threshold: 0.4,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [{
name: 'title',
weight: 0.7
}, {
name: 'path',
weight: 0.3
}]
})
},
// Filter out the routes that can be displayed in the sidebar
// And generate the internationalized title
generateRouters(routers, basePath = '/', prefixTitle = []) {
let res = []
for (const router of routers) {
// skip hidden router
if (router.hidden) { continue }
const data = {
path: path.resolve(basePath, router.path),
title: [...prefixTitle]
}
if (router.meta && router.meta.title) {
// generate internationalized title
const i18ntitle = i18n.t(`route.${router.meta.title}`)
data.title = [...data.title, i18ntitle]
if (router.redirect !== 'noredirect') {
// only push the routes with title
// special case: need to exclude parent router without redirect
res.push(data)
}
}
// recursive child routers
if (router.children) {
const tempRouters = this.generateRouters(router.children, data.path, data.title)
if (tempRouters.length >= 1) {
res = [...res, ...tempRouters]
}
}
}
return res
},
querySearch(query) {
if (query !== '') {
this.options = this.fuse.search(query)
} else {
this.options = []
}
}
}
}
</script>
<style lang="scss" scoped>
.header-search {
font-size: 0 !important;
.search-icon {
cursor: pointer;
font-size: 18px;
vertical-align: middle;
}
.header-search-select {
font-size: 18px;
transition: width 0.2s;
width: 0;
overflow: hidden;
background: transparent;
border-radius: 0;
display: inline-block;
vertical-align: middle;
/deep/ .el-input__inner {
border-radius: 0;
border: 0;
padding-left: 0;
padding-right: 0;
box-shadow: none !important;
border-bottom: 1px solid #d9d9d9;
vertical-align: middle;
}
}
&.show {
.header-search-select {
width: 210px;
margin-left: 10px;
}
}
}
</style>

View File

@ -41,7 +41,7 @@ export default {
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.board-column { .board-column {
min-width: 300px; min-width: 300px;
min-height: 100px; min-height: 100px;
@ -81,7 +81,7 @@ export default {
line-height: 54px; line-height: 54px;
padding: 5px 10px; padding: 5px 10px;
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0px 1px 3px 0 rgba(0,0,0,0.2); box-shadow: 0px 1px 3px 0 rgba(0, 0, 0, 0.2);
} }
} }
} }

View File

@ -30,12 +30,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
.international-icon {
font-size: 20px;
cursor: pointer;
vertical-align: -5px!important;
}
</style>

View File

@ -1,29 +1,6 @@
<template> <template>
<div> <div>
<svg <svg-icon class-name="screenfull-icon" icon-class="screenfull" />
t="1508738709248"
class="screenfull-svg"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2069"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="32"
height="32"
@click="click">
<path
d="M333.493443 428.647617 428.322206 333.832158 262.572184 168.045297 366.707916 64.444754 64.09683 64.444754 63.853283 366.570793 167.283957 262.460644Z"
p-id="2070"/>
<path
d="M854.845439 760.133334 688.61037 593.95864 593.805144 688.764889 759.554142 854.56096 655.44604 958.161503 958.055079 958.161503 958.274066 656.035464Z"
p-id="2071"/>
<path
d="M688.535669 428.550403 854.31025 262.801405 957.935352 366.921787 957.935352 64.34754 655.809313 64.081481 759.919463 167.535691 593.70793 333.731874Z"
p-id="2072"/>
<path
d="M333.590658 594.033341 167.8171 759.804852 64.218604 655.67219 64.218604 958.270996 366.342596 958.502263 262.234493 855.071589 428.421466 688.86108Z"
p-id="2073"/>
</svg>
</div> </div>
</template> </template>
@ -32,20 +9,6 @@ import screenfull from 'screenfull'
export default { export default {
name: 'Screenfull', name: 'Screenfull',
props: {
width: {
type: Number,
default: 22
},
height: {
type: Number,
default: 22
},
fill: {
type: String,
default: '#48576a'
}
},
data() { data() {
return { return {
isFullscreen: false isFullscreen: false

View File

@ -53,12 +53,3 @@ export default {
} }
</script> </script>
<style scoped>
.size-icon {
font-size: 20px;
cursor: pointer;
vertical-align: -4px!important;
}
</style>

View File

@ -1,5 +1,5 @@
<template> <template>
<svg :class="svgClass" aria-hidden="true"> <svg :class="svgClass" aria-hidden="true" v-on="$listeners">
<use :xlink:href="iconName"/> <use :xlink:href="iconName"/>
</svg> </svg>
</template> </template>

View File

@ -136,7 +136,10 @@ export default {
<style> <style>
.theme-picker .el-color-picker__trigger { .theme-picker .el-color-picker__trigger {
vertical-align: middle; margin-top: 12px;
height: 26px!important;
width: 26px!important;
padding: 2px;
} }
.theme-picker-dropdown .el-color-dropdown__link-btn { .theme-picker-dropdown .el-color-dropdown__link-btn {

View File

@ -0,0 +1 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M38.47 52L52 38.462l-23.648-23.67L43.209 0H.035L0 43.137l14.757-14.865L38.47 52zm74.773 47.726L89.526 76 76 89.536l23.648 23.672L84.795 128h43.174L128 84.863l-14.757 14.863zM89.538 52l23.668-23.648L128 43.207V.038L84.866 0 99.73 14.76 76 38.472 89.538 52zM38.46 76L14.792 99.651 0 84.794v43.173l43.137.033-14.865-14.757L52 89.53 38.46 76z"/></svg>

After

Width:  |  Height:  |  Size: 421 B

1
src/icons/svg/search.svg Normal file
View File

@ -0,0 +1 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M124.884 109.812L94.256 79.166c-.357-.357-.757-.629-1.129-.914a50.366 50.366 0 0 0 8.186-27.59C101.327 22.689 78.656 0 50.67 0 22.685 0 0 22.688 0 50.663c0 27.989 22.685 50.663 50.656 50.663 10.186 0 19.643-3.03 27.6-8.201.286.385.557.771.9 1.114l30.628 30.632a10.633 10.633 0 0 0 7.543 3.129c2.728 0 5.457-1.043 7.543-3.115 4.171-4.157 4.171-10.915.014-15.073M50.671 85.338C31.557 85.338 16 69.78 16 50.663c0-19.102 15.557-34.661 34.67-34.661 19.115 0 34.657 15.559 34.657 34.675 0 19.102-15.557 34.661-34.656 34.661"/></svg>

After

Width:  |  Height:  |  Size: 600 B

View File

@ -58,6 +58,7 @@ export default {
selectExcel: 'Export Selected', selectExcel: 'Export Selected',
uploadExcel: 'Upload Excel', uploadExcel: 'Upload Excel',
zip: 'Zip', zip: 'Zip',
pdf: 'PDF',
exportZip: 'Export Zip', exportZip: 'Export Zip',
theme: 'Theme', theme: 'Theme',
clipboardDemo: 'Clipboard', clipboardDemo: 'Clipboard',

View File

@ -58,6 +58,7 @@ export default {
selectExcel: 'Export seleccionado', selectExcel: 'Export seleccionado',
uploadExcel: 'Subir Excel', uploadExcel: 'Subir Excel',
zip: 'Zip', zip: 'Zip',
pdf: 'PDF',
exportZip: 'Exportar a Zip', exportZip: 'Exportar a Zip',
theme: 'Tema', theme: 'Tema',
clipboardDemo: 'Clipboard', clipboardDemo: 'Clipboard',

View File

@ -58,6 +58,7 @@ export default {
selectExcel: 'Export Selected', selectExcel: 'Export Selected',
uploadExcel: 'Upload Excel', uploadExcel: 'Upload Excel',
zip: 'Zip', zip: 'Zip',
pdf: 'PDF',
exportZip: 'Export Zip', exportZip: 'Export Zip',
theme: '换肤', theme: '换肤',
clipboardDemo: 'Clipboard', clipboardDemo: 'Clipboard',

View File

@ -297,13 +297,12 @@ export const asyncRouterMap = [
path: '/pdf', path: '/pdf',
component: Layout, component: Layout,
redirect: '/pdf/index', redirect: '/pdf/index',
meta: { title: 'PDF', icon: 'pdf' },
children: [ children: [
{ {
path: 'index', path: 'index',
component: () => import('@/views/pdf/index'), component: () => import('@/views/pdf/index'),
name: 'PDF', name: 'PDF',
meta: { title: 'PDF' } meta: { title: 'pdf', icon: 'pdf' }
} }
] ]
}, },

View File

@ -6,24 +6,26 @@
<div class="right-menu"> <div class="right-menu">
<template v-if="device!=='mobile'"> <template v-if="device!=='mobile'">
<error-log class="errLog-container right-menu-item"/> <search class="right-menu-item" />
<error-log class="errLog-container right-menu-item hover-effect"/>
<el-tooltip :content="$t('navbar.screenfull')" effect="dark" placement="bottom"> <el-tooltip :content="$t('navbar.screenfull')" effect="dark" placement="bottom">
<screenfull class="screenfull right-menu-item"/> <screenfull class="right-menu-item hover-effect"/>
</el-tooltip> </el-tooltip>
<el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom"> <el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
<size-select class="international right-menu-item"/> <size-select class="right-menu-item hover-effect"/>
</el-tooltip> </el-tooltip>
<lang-select class="international right-menu-item"/> <lang-select class="right-menu-item hover-effect"/>
<el-tooltip :content="$t('navbar.theme')" effect="dark" placement="bottom"> <el-tooltip :content="$t('navbar.theme')" effect="dark" placement="bottom">
<theme-picker class="theme-switch right-menu-item"/> <theme-picker class="right-menu-item hover-effect"/>
</el-tooltip> </el-tooltip>
</template> </template>
<el-dropdown class="avatar-container right-menu-item" trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar"> <img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">
<i class="el-icon-caret-bottom"/> <i class="el-icon-caret-bottom"/>
@ -57,6 +59,7 @@ import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect' import SizeSelect from '@/components/SizeSelect'
import LangSelect from '@/components/LangSelect' import LangSelect from '@/components/LangSelect'
import ThemePicker from '@/components/ThemePicker' import ThemePicker from '@/components/ThemePicker'
import Search from '@/components/HeaderSearch'
export default { export default {
components: { components: {
@ -66,7 +69,8 @@ export default {
Screenfull, Screenfull,
SizeSelect, SizeSelect,
LangSelect, LangSelect,
ThemePicker ThemePicker,
Search
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
@ -92,52 +96,70 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.navbar { .navbar {
height: 50px; height: 50px;
line-height: 50px; overflow: hidden;
border-radius: 0px !important;
.hamburger-container { .hamburger-container {
line-height: 58px; line-height: 46px;
height: 50px; height: 100%;
float: left; float: left;
padding: 0 10px; cursor: pointer;
transition: background .3s;
&:hover {
background: rgba(0, 0, 0, .025)
}
} }
.breadcrumb-container{
.breadcrumb-container {
float: left; float: left;
} }
.errLog-container { .errLog-container {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
} }
.right-menu { .right-menu {
float: right; float: right;
height: 100%; height: 100%;
&:focus{ line-height: 50px;
outline: none;
&:focus {
outline: none;
} }
.right-menu-item { .right-menu-item {
display: inline-block; display: inline-block;
margin: 0 8px; padding: 0 8px;
} height: 100%;
.screenfull { font-size: 18px;
height: 20px; color: #5a5e66;
} vertical-align: text-bottom;
.international{
vertical-align: top; &.hover-effect {
} cursor: pointer;
.theme-switch { transition: background .3s;
vertical-align: 15px;
&:hover {
background: rgba(0, 0, 0, .025)
}
}
} }
.avatar-container { .avatar-container {
height: 50px;
margin-right: 30px; margin-right: 30px;
.avatar-wrapper { .avatar-wrapper {
margin-top: 5px; margin-top: 5px;
position: relative; position: relative;
.user-avatar { .user-avatar {
cursor: pointer; cursor: pointer;
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 10px; border-radius: 10px;
} }
.el-icon-caret-bottom { .el-icon-caret-bottom {
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- eslint-disable vue/require-component-is--> <!-- eslint-disable vue/require-component-is -->
<component v-bind="linkProps(to)"> <component v-bind="linkProps(to)">
<slot/> <slot/>
</component> </component>
@ -17,11 +17,8 @@ export default {
} }
}, },
methods: { methods: {
isExternalLink(routePath) {
return isExternal(routePath)
},
linkProps(url) { linkProps(url) {
if (this.isExternalLink(url)) { if (isExternal(url)) {
return { return {
is: 'a', is: 'a',
href: url, href: url,

View File

@ -14,20 +14,22 @@
<item v-if="item.meta" :icon="item.meta.icon" :title="generateTitle(item.meta.title)" /> <item v-if="item.meta" :icon="item.meta.icon" :title="generateTitle(item.meta.title)" />
</template> </template>
<template v-for="child in item.children" v-if="!child.hidden"> <template v-for="child in item.children">
<sidebar-item <template v-if="!child.hidden">
v-if="child.children&&child.children.length>0" <sidebar-item
:is-nest="true" v-if="child.children&&child.children.length>0"
:item="child" :is-nest="true"
:key="child.path" :item="child"
:base-path="resolvePath(child.path)" :key="child.path"
class="nest-menu" /> :base-path="resolvePath(child.path)"
class="nest-menu" />
<app-link v-else :to="resolvePath(child.path)" :key="child.name"> <app-link v-else :to="resolvePath(child.path)" :key="child.name">
<el-menu-item :index="resolvePath(child.path)"> <el-menu-item :index="resolvePath(child.path)">
<item v-if="child.meta" :icon="child.meta.icon" :title="generateTitle(child.meta.title)" /> <item v-if="child.meta" :icon="child.meta.icon" :title="generateTitle(child.meta.title)" />
</el-menu-item> </el-menu-item>
</app-link> </app-link>
</template>
</template> </template>
</el-submenu> </el-submenu>

View File

@ -262,8 +262,10 @@ $light_gray:#eee;
.set-language { .set-language {
color: #fff; color: #fff;
position: absolute; position: absolute;
top: 5px; top: 3px;
font-size:18px;
right: 0px; right: 0px;
cursor: pointer;
} }
} }
.show-pwd { .show-pwd {

View File

@ -46,7 +46,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="Drag" width="80"> <el-table-column align="center" label="Drag" width="80">
<template slot-scope="scope"> <template slot-scope="{}">
<svg-icon class="drag-handler" icon-class="drag"/> <svg-icon class="drag-handler" icon-class="drag"/>
</template> </template>
</el-table-column> </el-table-column>