fix: 主题色修改

This commit is contained in:
shiziyuan9527 2021-03-15 11:34:51 +08:00
parent 41cfc77a3e
commit 4243cfdf7b
4 changed files with 20 additions and 4 deletions

View File

@ -62,6 +62,7 @@ export default {
this.$get('/system/theme', res => { this.$get('/system/theme', res => {
this.color = res.data ? res.data : ORIGIN_COLOR; this.color = res.data ? res.data : ORIGIN_COLOR;
setColor(this.color, this.color, this.color, this.color); setColor(this.color, this.color, this.color, this.color);
this.$store.commit('setTheme', res.data);
}) })
} }
if (localStorage.getItem("store")) { if (localStorage.getItem("store")) {

View File

@ -2,7 +2,7 @@
<div> <div>
<template> <template>
<span>{{ $t('commons.operating') }} <span>{{ $t('commons.operating') }}
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i> <i class='el-icon-setting operator-color' @click="customHeader"> </i>
</span> </span>
</template> </template>
</div> </div>
@ -21,5 +21,8 @@ export default {
</script> </script>
<style scoped> <style scoped>
.operator-color {
color: var(--count_number);
margin-left:10px;
}
</style> </style>

View File

@ -169,7 +169,7 @@ export default {
type: 'bar', type: 'bar',
itemStyle: { itemStyle: {
normal: { normal: {
color: COUNT_NUMBER color: this.$store.state.theme.theme ? this.$store.state.theme.theme : COUNT_NUMBER
} }
} }
}, },
@ -179,7 +179,7 @@ export default {
type: 'bar', type: 'bar',
itemStyle: { itemStyle: {
normal: { normal: {
color: COUNT_NUMBER_SHALLOW color: this.$store.state.theme.theme ? this.$store.state.theme.theme : COUNT_NUMBER_SHALLOW
} }
} }
}] }]

View File

@ -50,11 +50,23 @@ const IsReadOnly = {
} }
} }
const Theme = {
state: {
theme: undefined
},
mutations: {
setTheme(state, value) {
state.theme = value;
}
}
}
export default new Vuex.Store({ export default new Vuex.Store({
modules: { modules: {
api: API, api: API,
common: Common, common: Common,
switch: Switch, switch: Switch,
isReadOnly: IsReadOnly, isReadOnly: IsReadOnly,
theme: Theme
} }
}) })