master
toesbieya 6 years ago
parent d79903af9d
commit 433b2c4d72
  1. 39
      vue/src/assets/styles/sidebar.scss
  2. 4
      vue/src/components/OrgTree/index.vue
  3. 4
      vue/src/components/Skeleton/index.vue
  4. 5
      vue/src/components/SvgIcon/index.vue
  5. 2
      vue/src/views/app/register.vue
  6. 16
      vue/src/views/index/components/PanelGroup/PanelGroupItem.vue
  7. 48
      vue/src/views/index/components/PanelGroup/index.vue

@ -1,3 +1,5 @@
$iconSize: 17px;
.sidebar-container { .sidebar-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -10,7 +12,7 @@
//折叠设置 //折叠设置
&.collapse-sidebar { &.collapse-sidebar {
width: 54px; width: $iconSize + 20px * 2;
.sidebar-item-content { .sidebar-item-content {
display: none; display: none;
@ -72,24 +74,8 @@
} }
} }
a {
display: inline-block;
width: 100%;
overflow: hidden;
}
.svg-icon {
margin-right: 16px;
}
.el-menu {
border: none;
height: 100%;
width: 100%;
}
.is-active > .el-submenu__title { .is-active > .el-submenu__title {
color: #fff !important; color: $--color-primary !important;
} }
// menu hover // menu hover
@ -110,15 +96,22 @@
} }
} }
.el-menu--vertical { .el-menu {
border: none;
height: 100%;
width: 100%;
.svg-icon { .svg-icon {
margin-right: 16px; margin-right: 16px;
width: $iconSize;
height: $iconSize;
} }
//侧边菜单折叠时弹出菜单的滚动条高度 a {
/*.popover-menu__wrap { display: inline-block;
max-height: 80vh; width: 100%;
}*/ overflow: hidden;
}
.popover-menu__title { .popover-menu__title {
cursor: auto; cursor: auto;

@ -177,6 +177,4 @@
} }
</script> </script>
<style lang="scss"> <style lang="scss" src="./tree.scss"></style>
@import './tree';
</style>

@ -44,6 +44,4 @@
} }
</script> </script>
<style lang="sass"> <style lang="sass" src="./QSkeleton.sass"></style>
@import "./QSkeleton.sass"
</style>

@ -1,6 +1,6 @@
<template> <template>
<div :style="styleExternalIcon" class="svg-external-icon svg-icon" v-if="isExternal" v-on="$listeners"/> <div v-if="isExternal" v-on="$listeners" class="svg-external-icon svg-icon" :style="styleExternalIcon"/>
<svg :class="className" aria-hidden="true" class="svg-icon" v-else v-on="$listeners"> <svg v-else v-on="$listeners" :class="className" class="svg-icon" aria-hidden="true">
<use :href="iconName"/> <use :href="iconName"/>
</svg> </svg>
</template> </template>
@ -41,7 +41,6 @@
.svg-icon { .svg-icon {
width: 1em; width: 1em;
height: 1em; height: 1em;
vertical-align: -0.15em;
fill: currentColor; fill: currentColor;
overflow: hidden; overflow: hidden;
} }

@ -109,5 +109,5 @@
</script> </script>
<style lang="scss"> <style lang="scss">
@import "src/assets/styles/login"; @import "~@/assets/styles/login";
</style> </style>

@ -3,8 +3,8 @@
class="card-panel" class="card-panel"
type="flex" type="flex"
justify="space-between" justify="space-between"
@mouseout.native="style='color:'+color" @mouseout.native="mouseout"
@mouseover.native="style='background:'+color" @mouseover.native="mouseover"
> >
<div class="card-panel-icon-wrapper" :style="style"> <div class="card-panel-icon-wrapper" :style="style">
<svg-icon :icon="icon" class-name="card-panel-icon"/> <svg-icon :icon="icon" class-name="card-panel-icon"/>
@ -32,10 +32,16 @@
return { return {
style: 'color:' + this.color style: 'color:' + this.color
} }
},
methods: {
mouseout() {
this.style = 'color:' + this.color
},
mouseover() {
this.style = 'background:' + this.color
}
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss" src="./PanelGroupItem.scss"></style>
@import "./PanelGroupItem.scss";
</style>

@ -1,16 +1,7 @@
<template> <template>
<el-row :gutter="40" class="panel-group"> <el-row :gutter="40" class="panel-group">
<el-col :xs="12" :sm="12" :lg="6" @click.native="jump('/system/user')"> <el-col v-for="i in list" :key="i.id" :xs="12" :sm="12" :lg="6">
<panel-group-item icon="user" :color="variables.info" :value="data.online" text="在线用户"/> <panel-group-item :ref="i.id" v-bind="i" @click.native="jump(i)"/>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" @click.native="jump('/purchase/order')">
<panel-group-item icon="shopping" :color="variables.primary" :value="data.purchase" text="今日采购额"/>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" @click.native="jump('/sell/order')">
<panel-group-item icon="sell" :color="variables.danger" :value="data.sell" text="今日销售额"/>
</el-col>
<el-col :xs="12" :sm="12" :lg="6">
<panel-group-item icon="money" :color="variables.success" :value="data.profit" text="今日毛利润"/>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
@ -19,7 +10,7 @@
import PanelGroupItem from './PanelGroupItem' import PanelGroupItem from './PanelGroupItem'
import variables from '@/assets/styles/variables.scss' import variables from '@/assets/styles/variables.scss'
import {getFourBlock} from '@/api/statistic/index' import {getFourBlock} from '@/api/statistic/index'
import {mergeObj} from "@/utils" import {isEmpty, mergeObj} from "@/utils"
import {auth} from "@/utils/auth" import {auth} from "@/utils/auth"
export default { export default {
@ -28,13 +19,19 @@
data() { data() {
return { return {
loading: false, loading: false,
variables, list: [
data: { {id: 'online', path: '/system/user', icon: 'user', color: variables.info, value: 0, text: '在线用户'},
online: 0, {
purchase: 0, id: 'purchase',
sell: 0, path: '/purchase/order',
profit: 0 icon: 'shopping',
} color: variables.primary,
value: 0,
text: '今日采购额'
},
{id: 'sell', path: '/sell/order', icon: 'sell', color: variables.danger, value: 0, text: '今日销售额'},
{id: 'profit', icon: 'money', color: variables.info, value: 0, text: '今日毛利润'},
]
} }
}, },
methods: { methods: {
@ -42,11 +39,18 @@
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
getFourBlock() getFourBlock()
.then(data => mergeObj(this.data, data)) .then(data => {
this.list.forEach(i => {
if (i.id in data) i.value = data[i.id]
})
})
.finally(() => this.loading = false) .finally(() => this.loading = false)
}, },
jump(path) { jump({id, path}) {
auth(path) && this.$router.push(path) if (!isEmpty(path) && auth(path)) {
this.$router.push(path)
this.$refs[id][0].mouseout()
}
} }
}, },
mounted() { mounted() {

Loading…
Cancel
Save