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.color = res.data ? res.data : ORIGIN_COLOR;
setColor(this.color, this.color, this.color, this.color);
this.$store.commit('setTheme', res.data);
})
}
if (localStorage.getItem("store")) {

View File

@ -2,7 +2,7 @@
<div>
<template>
<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>
</template>
</div>
@ -21,5 +21,8 @@ export default {
</script>
<style scoped>
.operator-color {
color: var(--count_number);
margin-left:10px;
}
</style>

View File

@ -169,7 +169,7 @@ export default {
type: 'bar',
itemStyle: {
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',
itemStyle: {
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({
modules: {
api: API,
common: Common,
switch: Switch,
isReadOnly: IsReadOnly,
theme: Theme
}
})