Parcourir la source

删除darkMode黑夜模式

dev
X il y a 4 ans
Parent
révision
8f9b8d1fdc
11 fichiers modifiés avec 11 ajouts et 92 suppressions
  1. +0
    -38
      src/components/DarkModeSwitcher.vue
  2. +1
    -1
      src/components/DonutChart.vue
  3. +1
    -1
      src/components/PieChart.vue
  4. +1
    -1
      src/components/ReportDonutChart.vue
  5. +1
    -1
      src/components/ReportDonutChart1.vue
  6. +4
    -10
      src/components/ReportLineChart.vue
  7. +1
    -1
      src/components/ReportPieChart.vue
  8. +0
    -2
      src/store/index.js
  9. +0
    -34
      src/store/main.js
  10. +0
    -1
      src/store/mutation-types.js
  11. +2
    -2
      src/views/Login.vue

+ 0
- 38
src/components/DarkModeSwitcher.vue Voir le fichier

@@ -1,38 +0,0 @@
<template>
<!-- BEGIN: Dark Mode Switcher-->
<div
class="dark-mode-switcher cursor-pointer shadow-md fixed bottom-0 right-0 box dark:bg-dark-2 border rounded-full w-40 h-12 flex items-center justify-center z-50 mb-10 mr-10"
@click="switchMode"
>
<div class="mr-4 text-gray-700 dark:text-gray-300">Dark Mode</div>
<div
:class="{ 'dark-mode-switcher__toggle--active': darkMode }"
class="dark-mode-switcher__toggle border"
></div>
</div>
<!-- END: Dark Mode Switcher-->
</template>

<script>
export default {
computed: {
darkMode() {
return this.$store.state.main.darkMode;
}
},
mounted() {
this.setDarkModeClass();
},
methods: {
switchMode() {
this.$store.dispatch("main/setDarkMode", !this.darkMode);
this.setDarkModeClass();
},
setDarkModeClass() {
this.darkMode
? cash("html").addClass("dark")
: cash("html").removeClass("dark");
}
}
};
</script>

+ 1
- 1
src/components/DonutChart.vue Voir le fichier

@@ -29,7 +29,7 @@ export default {
backgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
hoverBackgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
borderWidth: 5,
borderColor: this.$store.state.main.darkMode ? "#303953" : "#fff"
borderColor: "#fff"
}
]
};


+ 1
- 1
src/components/PieChart.vue Voir le fichier

@@ -24,7 +24,7 @@ export default {
backgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
hoverBackgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
borderWidth: 5,
borderColor: this.$store.state.main.darkMode ? "#303953" : "#fff"
borderColor: "#fff"
}
]
};


+ 1
- 1
src/components/ReportDonutChart.vue Voir le fichier

@@ -29,7 +29,7 @@ export default {
backgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
hoverBackgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
borderWidth: 5,
borderColor: this.$store.state.main.darkMode ? "#303953" : "#fff"
borderColor: "#fff"
}
]
};


+ 1
- 1
src/components/ReportDonutChart1.vue Voir le fichier

@@ -29,7 +29,7 @@ export default {
backgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
hoverBackgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
borderWidth: 2,
borderColor: this.$store.state.main.darkMode ? "#303953" : "#fff"
borderColor: "#fff"
}
]
};


+ 4
- 10
src/components/ReportLineChart.vue Voir le fichier

@@ -67,9 +67,7 @@ export default {
{
ticks: {
fontSize: "12",
fontColor: this.$store.state.main.darkMode
? "#718096"
: "#777777"
fontColor: "#777777"
},
gridLines: {
display: false
@@ -80,18 +78,14 @@ export default {
{
ticks: {
fontSize: "12",
fontColor: this.$store.state.main.darkMode
? "#718096"
: "#777777",
fontColor: "#777777",
callback: function(value) {
return "$" + value;
}
},
gridLines: {
color: this.$store.state.main.darkMode ? "#718096" : "#D8D8D8",
zeroLineColor: this.$store.state.main.darkMode
? "#718096"
: "#D8D8D8",
color: "#D8D8D8",
zeroLineColor: "#D8D8D8",
borderDash: [2, 2],
zeroLineBorderDash: [2, 2],
drawBorder: false


+ 1
- 1
src/components/ReportPieChart.vue Voir le fichier

@@ -29,7 +29,7 @@ export default {
backgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
hoverBackgroundColor: ["#FF8B26", "#FFC533", "#285FD3"],
borderWidth: 5,
borderColor: this.$store.state.main.darkMode ? "#303953" : "#fff"
borderColor: "#fff"
}
]
};


+ 0
- 2
src/store/index.js Voir le fichier

@@ -1,13 +1,11 @@
import Vue from "vue";
import Vuex from "vuex";
import main from "./main";
import sideMenu from "./side-menu";

Vue.use(Vuex);

export default new Vuex.Store({
modules: {
main: main,
sideMenu: sideMenu,
}
});

+ 0
- 34
src/store/main.js Voir le fichier

@@ -1,34 +0,0 @@
import * as types from "./mutation-types";

const state = () => {
return {
darkMode: false
};
};

// getters
const getters = {
darkMode: state => state.darkMode
};

// actions
const actions = {
setDarkMode({ commit }, darkMode) {
commit(types.SET_DARK_MODE, { darkMode });
}
};

// mutations
const mutations = {
[types.SET_DARK_MODE](state, { darkMode }) {
state.darkMode = darkMode;
}
};

export default {
namespaced: true,
state,
getters,
actions,
mutations
};

+ 0
- 1
src/store/mutation-types.js Voir le fichier

@@ -1 +0,0 @@
export const SET_DARK_MODE = "SET_DARK_MODE";

+ 2
- 2
src/views/Login.vue Voir le fichier

@@ -109,8 +109,8 @@
export default {
mounted() {
cash("body")
.removeClass("app")
.addClass("login");
.removeClass('app')
.addClass('login');
}
};
</script>

Chargement…
Annuler
Enregistrer