Commit b9dd55ed by 胡悦

修改主题色、及接口用户名称

1 parent b8ac65f0
......@@ -26,7 +26,7 @@
width="60px"
label="序号"
type='index'
:index="index=>index+(pagination.currentPage - 1) * pagination.pageSize + 1"
:index="index=>index+(pagination.pageNumber - 1) * pagination.pageSize + 1"
></el-table-column>
<el-table-column
v-for="(item, index) in tableParams.tableColumns"
......@@ -94,7 +94,7 @@
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:current-page="page.pageNumber"
:page-sizes="[10,20,30,40]"
:page-size="page.pageSize"
:total="getListApi ? total : tableTotal"
......@@ -114,7 +114,7 @@ export default {
// 页码
page: {
pageSize: 10,
currentPage: 1
pageNumber: 1
},
total: 10,
// 排序
......@@ -246,16 +246,17 @@ export default {
this.refreshTable(true, true)
},
refreshTable(clearMuti = true, resetCurrentPage = false) {
refreshTable(clearMuti = true, resetpageNumber = false) {
this.beforeSearchFn().then(res => {
// console.log(res)
// 清空多选
clearMuti && this.clearMutiSelect()
this.loading = true
resetCurrentPage && (this.page.currentPage = 1)
resetpageNumber && (this.page.pageNumber = 1)
var params = {
...this.page,
...this.searchForm
...this.searchForm,
customerNameAuth: this.$store.state.d2admin.user.info.customerName
}
if (this.sort) {
params.sortColum = this.sortColum
......@@ -263,7 +264,7 @@ export default {
}
this.getListApi(params).then(res => {
// this.pagination = {
// currentPage: res.pageNum,
// pageNumber: res.pageNum,
// pageSize: res.pageSize
// }
// this.tableParams.needUnique && (res[this.tableParams.listName].forEach((item) => {
......@@ -286,7 +287,7 @@ export default {
// 页码
handleCurrentChange(value) {
this.page.currentPage = value
this.page.pageNumber = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
}
}
......
......@@ -20,6 +20,7 @@
<img v-else src="../../assets/all.png">
</div>
<hamburger :onClick="handleToggleAside" :isActive="asideCollapse" flex-box="0" class="toggle-aside-btn"></hamburger>
<span class="header-title">{{headerTitle}}</span>
<d2-menu-header flex-box="1"/>
<!-- 顶栏右侧 -->
<div class="d2-header-right" flex-box="0">
......@@ -80,23 +81,23 @@
</div>
</div>
</template>
<script>
import d2MenuSide from './components/menu-side'
import d2MenuHeader from './components/menu-header'
import d2Tabs from './components/tabs'
import d2HeaderFullscreen from './components/header-fullscreen'
// import d2HeaderLocales from './components/header-locales'
import d2HeaderSearch from './components/header-search'
// import d2HeaderSearch from './components/header-search'
// import d2HeaderSize from './components/header-size'
import d2HeaderTheme from './components/header-theme'
// import d2HeaderTheme from './components/header-theme'
import d2HeaderUser from './components/header-user'
// import d2HeaderLog from './components/header-log'
import d2HeaderColor from './components/header-color'
// import d2HeaderColor from './components/header-color'
import hamburger from './components/hamburger'
import d2HeaderDatetime from './components/header-datetime'
import { mapState, mapGetters, mapActions } from 'vuex'
import mixinSearch from './mixins/search'
import { localRoutes } from '@/router/routes'
export default {
name: 'd2-layout-header-aside',
mixins: [
......@@ -108,12 +109,12 @@ export default {
d2Tabs,
d2HeaderFullscreen,
// d2HeaderLocales,
d2HeaderSearch,
// d2HeaderSearch,
// d2HeaderSize,
d2HeaderTheme,
// d2HeaderTheme,
d2HeaderUser,
// d2HeaderLog,
d2HeaderColor,
// d2HeaderColor,
hamburger,
d2HeaderDatetime
},
......@@ -122,10 +123,24 @@ export default {
// [侧边栏宽度] 正常状态
asideWidth: '200px',
// [侧边栏宽度] 折叠状态
asideWidthCollapse: '65px'
asideWidthCollapse: '65px',
headerTitle: ''
}
},
mounted() {
this.routerPath = []
Object.values(localRoutes).forEach((item, index) => {
this.routerPath.push(item.meta)
})
var targetItem = this.$route.matched
this.findTitle(targetItem[targetItem.length - 1].meta)
},
watch: {
'$route.matched'(val) {
var targetItem = val[val.length - 1].meta
this.headerTitle = ''
this.findTitle(targetItem)
}
},
computed: {
...mapState('d2admin', {
......@@ -157,11 +172,16 @@ export default {
*/
handleToggleAside() {
this.asideCollapseToggle()
},
findTitle(val) {
this.headerTitle = val.title + (this.headerTitle ? ' / ' : '') + this.headerTitle
if (+val.parentId !== 0) {
return this.findTitle(this.routerPath.find(item => item.authId === val.parentId))
}
}
}
}
</script>
<style lang="scss">
// 注册主题
@import '~@/assets/style/theme/register.scss';
......@@ -191,4 +211,9 @@ export default {
transform: translate3d(0,16px,0) !important;
}
}
</style>
.header-title {
line-height: 60px;
color: #606266;
margin-left: 20px;
}
</style>
\ No newline at end of file
......@@ -46,6 +46,7 @@
<script>
import { setOptions } from './lineOptions.js'
import walden from './walden'
import { getTotal, getDeviceStatistic, getUserStatistic, getAppStatistic } from '@api/index'
import notice from '@/common/notice'
export default {
......@@ -56,7 +57,7 @@ export default {
radio: '全部',
userInfo: this.$store.state.d2admin.user.info,
totalNum: {},
params: { customerName: this.$store.state.d2admin.user.info.customerName },
params: { customerNameAuth: this.$store.state.d2admin.user.info.customerName },
// 绘图
deviceECharts: '',
deviceOptions: {},
......@@ -69,9 +70,9 @@ export default {
mounted() {
this.$echarts = echarts
this.deviceECharts = this.$echarts.init(document.getElementById('deviceTrends'))
this.userECharts = this.$echarts.init(document.getElementById('userTrends'))
this.appECharts = this.$echarts.init(document.getElementById('appTrends'))
this.deviceECharts = this.$echarts.init(document.getElementById('deviceTrends'), 'walden')
this.userECharts = this.$echarts.init(document.getElementById('userTrends'), 'walden')
this.appECharts = this.$echarts.init(document.getElementById('appTrends'), 'walden')
this.getTotal()
this.drawLine(getDeviceStatistic, this.deviceOptions, this.deviceECharts, '设备激活趋势')
this.drawLine(getUserStatistic, this.userOptions, this.userECharts, '用户活跃趋势')
......@@ -86,18 +87,24 @@ export default {
},
drawLine(api, options, charts, title) {
api(this.params).then(res => {
if (res) {
let x = []
let y = []
res.map(item => {
x.push(item.time)
y.push(item.count)
})
options = setOptions({
title,
xAxisData: x,
yAxisData: y
})
charts.setOption(options)
res.map(item => {
x.push(item.time)
y.push(item.count)
})
options = setOptions({
title,
xAxisData: x,
yAxisData: y
})
charts.setOption(options)
} else {
var html = '<div style="color:#868686; font-size: 16px;text-align:center;line-height:380px;">暂无数据</div>'
charts.innerHTML = html
charts.removeAttribute('_echarts_instance_')
}
})
}
}
......
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['exports', 'echarts'], factory)
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
// CommonJS
factory(exports, require('echarts'))
} else {
// Browser globals
factory({}, root.echarts)
}
}(this, function(exports, echarts) {
var log = function(msg) {
if (typeof console !== 'undefined') {
console && console.error && console.error(msg)
}
}
if (!echarts) {
log('ECharts is not Loaded')
return
}
echarts.registerTheme('walden', {
'color': [
'#3fb1e3',
'#6be6c1',
'#626c91',
'#a0a7e6',
'#c4ebad',
'#96dee8'
],
'backgroundColor': 'rgba(252,252,252,0)',
'textStyle': {},
'title': {
'textStyle': {
'color': '#666666'
},
'subtextStyle': {
'color': '#999999'
}
},
'line': {
'itemStyle': {
'borderWidth': '2'
},
'lineStyle': {
'width': '3'
},
'symbolSize': '8',
'symbol': 'emptyCircle',
'smooth': false
},
'radar': {
'itemStyle': {
'borderWidth': '2'
},
'lineStyle': {
'width': '3'
},
'symbolSize': '8',
'symbol': 'emptyCircle',
'smooth': false
},
'bar': {
'itemStyle': {
'barBorderWidth': 0,
'barBorderColor': '#ccc'
}
},
'pie': {
'itemStyle': {
'borderWidth': 0,
'borderColor': '#ccc'
}
},
'scatter': {
'itemStyle': {
'borderWidth': 0,
'borderColor': '#ccc'
}
},
'boxplot': {
'itemStyle': {
'borderWidth': 0,
'borderColor': '#ccc'
}
},
'parallel': {
'itemStyle': {
'borderWidth': 0,
'borderColor': '#ccc'
}
},
'sankey': {
'itemStyle': {
'borderWidth': 0,
'borderColor': '#ccc'
}
},
'funnel': {
'itemStyle': {
'borderWidth': 0,
'borderColor': '#ccc'
}
},
'gauge': {
'itemStyle': {
'borderWidth': 0,
'borderColor': '#ccc'
}
},
'candlestick': {
'itemStyle': {
'color': '#e6a0d2',
'color0': 'transparent',
'borderColor': '#e6a0d2',
'borderColor0': '#3fb1e3',
'borderWidth': '2'
}
},
'graph': {
'itemStyle': {
'borderWidth': 0,
'borderColor': '#ccc'
},
'lineStyle': {
'width': '1',
'color': '#cccccc'
},
'symbolSize': '8',
'symbol': 'emptyCircle',
'smooth': false,
'color': [
'#3fb1e3',
'#6be6c1',
'#626c91',
'#a0a7e6',
'#c4ebad',
'#96dee8'
],
'label': {
'color': '#ffffff'
}
},
'map': {
'itemStyle': {
'normal': {
'areaColor': '#eeeeee',
'borderColor': '#aaaaaa',
'borderWidth': 0.5
},
'emphasis': {
'areaColor': 'rgba(63,177,227,0.25)',
'borderColor': '#3fb1e3',
'borderWidth': 1
}
},
'label': {
'normal': {
'textStyle': {
'color': '#ffffff'
}
},
'emphasis': {
'textStyle': {
'color': '#3fb1e3'
}
}
}
},
'geo': {
'itemStyle': {
'normal': {
'areaColor': '#eeeeee',
'borderColor': '#aaaaaa',
'borderWidth': 0.5
},
'emphasis': {
'areaColor': 'rgba(63,177,227,0.25)',
'borderColor': '#3fb1e3',
'borderWidth': 1
}
},
'label': {
'normal': {
'textStyle': {
'color': '#ffffff'
}
},
'emphasis': {
'textStyle': {
'color': '#3fb1e3'
}
}
}
},
'categoryAxis': {
'axisLine': {
'show': true,
'lineStyle': {
'color': '#cccccc'
}
},
'axisTick': {
'show': false,
'lineStyle': {
'color': '#333'
}
},
'axisLabel': {
'show': true,
'textStyle': {
'color': '#999999'
}
},
'splitLine': {
'show': true,
'lineStyle': {
'color': [
'#eeeeee'
]
}
},
'splitArea': {
'show': false,
'areaStyle': {
'color': [
'rgba(250,250,250,0.05)',
'rgba(200,200,200,0.02)'
]
}
}
},
'valueAxis': {
'axisLine': {
'show': true,
'lineStyle': {
'color': '#cccccc'
}
},
'axisTick': {
'show': false,
'lineStyle': {
'color': '#333'
}
},
'axisLabel': {
'show': true,
'textStyle': {
'color': '#999999'
}
},
'splitLine': {
'show': true,
'lineStyle': {
'color': [
'#eeeeee'
]
}
},
'splitArea': {
'show': false,
'areaStyle': {
'color': [
'rgba(250,250,250,0.05)',
'rgba(200,200,200,0.02)'
]
}
}
},
'logAxis': {
'axisLine': {
'show': true,
'lineStyle': {
'color': '#cccccc'
}
},
'axisTick': {
'show': false,
'lineStyle': {
'color': '#333'
}
},
'axisLabel': {
'show': true,
'textStyle': {
'color': '#999999'
}
},
'splitLine': {
'show': true,
'lineStyle': {
'color': [
'#eeeeee'
]
}
},
'splitArea': {
'show': false,
'areaStyle': {
'color': [
'rgba(250,250,250,0.05)',
'rgba(200,200,200,0.02)'
]
}
}
},
'timeAxis': {
'axisLine': {
'show': true,
'lineStyle': {
'color': '#cccccc'
}
},
'axisTick': {
'show': false,
'lineStyle': {
'color': '#333'
}
},
'axisLabel': {
'show': true,
'textStyle': {
'color': '#999999'
}
},
'splitLine': {
'show': true,
'lineStyle': {
'color': [
'#eeeeee'
]
}
},
'splitArea': {
'show': false,
'areaStyle': {
'color': [
'rgba(250,250,250,0.05)',
'rgba(200,200,200,0.02)'
]
}
}
},
'toolbox': {
'iconStyle': {
'normal': {
'borderColor': '#999999'
},
'emphasis': {
'borderColor': '#666666'
}
}
},
'legend': {
'textStyle': {
'color': '#999999'
}
},
'tooltip': {
'axisPointer': {
'lineStyle': {
'color': '#cccccc',
'width': 1
},
'crossStyle': {
'color': '#cccccc',
'width': 1
}
}
},
'timeline': {
'lineStyle': {
'color': '#626c91',
'width': 1
},
'itemStyle': {
'normal': {
'color': '#626c91',
'borderWidth': 1
},
'emphasis': {
'color': '#626c91'
}
},
'controlStyle': {
'normal': {
'color': '#626c91',
'borderColor': '#626c91',
'borderWidth': 0.5
},
'emphasis': {
'color': '#626c91',
'borderColor': '#626c91',
'borderWidth': 0.5
}
},
'checkpointStyle': {
'color': '#3fb1e3',
'borderColor': 'rgba(63,177,227,0.15)'
},
'label': {
'normal': {
'textStyle': {
'color': '#626c91'
}
},
'emphasis': {
'textStyle': {
'color': '#626c91'
}
}
}
},
'visualMap': {
'color': [
'#2a99c9',
'#afe8ff'
]
},
'dataZoom': {
'backgroundColor': 'rgba(255,255,255,0)',
'dataBackgroundColor': 'rgba(222,222,222,1)',
'fillerColor': 'rgba(114,230,212,0.25)',
'handleColor': '#cccccc',
'handleSize': '100%',
'textStyle': {
'color': '#999999'
}
},
'markPoint': {
'label': {
'color': '#ffffff'
},
'emphasis': {
'label': {
'color': '#ffffff'
}
}
}
})
}))
\ No newline at end of file
......@@ -96,6 +96,7 @@
placeholder="省/市/区"
:props="props"
clearable
style="width: 480px"
v-model="regForm.contactAddress"
></el-cascader>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!