Explorar o código

:recycle: Refactoring code.优化方法名
:children_crossing: Improving user experience / usability.优化设置项开关体验

lishangbu %!s(int64=5) %!d(string=hai) anos
pai
achega
b16879ef35

+ 14 - 14
src/const/setting/index.js

@@ -1,37 +1,37 @@
 const dicData = [{
-  label: '开启',
-  value: 'true'
-}, {
   label: '关闭',
   value: 'false'
+},{
+  label: '开启',
+  value: 'true'
 }]
 export const list = [{
   key: 'showTag',
-  commit: 'SET_SHOWTAG'
+  commit: 'SET_SHOW_TAG'
 }, {
   key: 'showTheme',
-  commit: 'SET_SHOWTHEME'
+  commit: 'SET_SHOW_THEME'
 }, {
   key: 'showColor',
-  commit: 'SET_SHOWCOLOR'
+  commit: 'SET_SHOW_COLOR'
 }, {
   key: 'showLock',
-  commit: 'SET_SHOWLOCK'
+  commit: 'SET_SHOW_LOCK'
 }, {
   key: 'showDebug',
-  commit: 'SET_SHOWDEBUG'
+  commit: 'SET_SHOW_DEBUG'
 }, {
-  key: 'showFullScren',
-  commit: 'SET_SHOWFULLSCREN'
+  key: 'showFullScreen',
+  commit: 'SET_SHOW_FULL_SCREEN'
 }, {
   key: 'showCollapse',
-  commit: 'SET_SHOWCOLLAPSE'
+  commit: 'SET_SHOW_COLLAPSE'
 }, {
   key: 'showSearch',
-  commit: 'SET_SHOWSEARCH'
+  commit: 'SET_SHOW_SEARCH'
 }, {
   key: 'showMenu',
-  commit: 'SET_SHOWMENU'
+  commit: 'SET_SHOW_MENU'
 }]
 export const option = (safe) => {
   const _safe = safe
@@ -76,7 +76,7 @@ export const option = (safe) => {
       }
     }, {
       label: '全屏',
-      prop: 'showFullScren',
+      prop: 'showFullScreen',
       type: 'switch',
       span: 24,
       dicData: dicData,

+ 6 - 6
src/page/index/top/index.vue

@@ -55,13 +55,13 @@
         </div>
       </el-tooltip>
       <el-tooltip
-        v-if="showFullScren"
-        :content="isFullScren?'退出全屏':'全屏'"
+        v-if="showFullScreen"
+        :content="isFullScreen?'退出全屏':'全屏'"
         effect="dark"
         placement="bottom">
         <div class="top-bar__item">
           <i
-            :class="isFullScren?'icon-zuixiaohua':'icon-quanpingzuidahua'"
+            :class="isFullScreen?'icon-zuixiaohua':'icon-quanpingzuidahua'"
             @click="handleScreen"/>
         </div>
       </el-tooltip>
@@ -129,14 +129,14 @@ export default {
       showDebug: state => state.common.showDebug,
       showTheme: state => state.common.showTheme,
       showLock: state => state.common.showLock,
-      showFullScren: state => state.common.showFullScren,
+      showFullScreen: state => state.common.showFullScreen,
       showCollapse: state => state.common.showCollapse,
       showMenu: state => state.common.showMenu,
       showColor: state => state.common.showColor
     }),
     ...mapGetters([
       'userInfo',
-      'isFullScren',
+      'isFullScreen',
       'tagWel',
       'tagList',
       'isCollapse',
@@ -159,7 +159,7 @@ export default {
       this.$store.commit('SET_COLLAPSE')
     },
     setScreen() {
-      this.$store.commit('SET_FULLSCREN')
+      this.$store.commit('SET_FULLSCREEN')
     },
     logout() {
       this.$confirm('是否退出系统, 是否继续?', '提示', {

+ 1 - 1
src/page/index/top/top-setting.vue

@@ -45,7 +45,7 @@ export default {
       showDebug: state => state.common.showDebug,
       showLock: state => state.common.showLock,
       showColor: state => state.common.showColor,
-      showFullScren: state => state.common.showFullScren,
+      showFullScreen: state => state.common.showFullScreen,
       showCollapse: state => state.common.showCollapse,
       showSearch: state => state.common.showSearch,
       showMenu: state => state.common.showMenu,

+ 1 - 1
src/store/getters.js

@@ -9,7 +9,7 @@ const getters = {
   keyCollapse: (state, getters) => getters.screen > 1 ? getters.isCollapse : false,
   screen: state => state.common.screen,
   isLock: state => state.common.isLock,
-  isFullScren: state => state.common.isFullScren,
+  isFullScreen: state => state.common.isFullScreen,
   lockPasswd: state => state.common.lockPasswd,
   tagList: state => state.tags.tagList,
   tagWel: state => state.tags.tagWel,

+ 16 - 16
src/store/modules/common.js

@@ -5,7 +5,7 @@ const common = {
 
   state: {
     isCollapse: false,
-    isFullScren: false,
+    isFullScreen: false,
     isShade: false,
     screen: -1,
     isLock: getStore({ name: 'isLock' }) || false,
@@ -14,7 +14,7 @@ const common = {
     showCollapse: getStore({ name: 'showCollapse' }),
     showSearch: getStore({ name: 'showSearch' }),
     showLock: getStore({ name: 'showLock' }),
-    showFullScren: getStore({ name: 'showFullScren' }),
+    showFullScreen: getStore({ name: 'showFullScreen' }),
     showTheme: getStore({ name: 'showTheme' }),
     showColor: getStore({ name: 'showColor' }),
     showMenu: getStore({ name: 'showMenu' }),
@@ -31,66 +31,66 @@ const common = {
     SET_COLLAPSE: (state) => {
       state.isCollapse = !state.isCollapse
     },
-    SET_FULLSCREN: (state) => {
-      state.isFullScren = !state.isFullScren
+    SET_FULLSCREEN: (state) => {
+      state.isFullScreen = !state.isFullScreen
     },
-    SET_SHOWCOLLAPSE: (state, active) => {
+    SET_SHOW_COLLAPSE: (state, active) => {
       state.showCollapse = active
       setStore({
         name: 'showCollapse',
         content: state.showCollapse
       })
     },
-    SET_SHOWTAG: (state, active) => {
+    SET_SHOW_TAG: (state, active) => {
       state.showTag = active
       setStore({
         name: 'showTag',
         content: state.showTag
       })
     },
-    SET_SHOWMENU: (state, active) => {
+    SET_SHOW_MENU: (state, active) => {
       state.showMenu = active
       setStore({
         name: 'showMenu',
         content: state.showMenu
       })
     },
-    SET_SHOWLOCK: (state, active) => {
+    SET_SHOW_LOCK: (state, active) => {
       state.showLock = active
       setStore({
         name: 'showLock',
         content: state.showLock
       })
     },
-    SET_SHOWSEARCH: (state, active) => {
+    SET_SHOW_SEARCH: (state, active) => {
       state.showSearch = active
       setStore({
         name: 'showSearch',
         content: state.showSearch
       })
     },
-    SET_SHOWFULLSCREN: (state, active) => {
-      state.showFullScren = active
+    SET_SHOW_FULL_SCREEN: (state, active) => {
+      state.showFullScreen = active
       setStore({
-        name: 'showFullScren',
-        content: state.showFullScren
+        name: 'showFullScreen',
+        content: state.showFullScreen
       })
     },
-    SET_SHOWDEBUG: (state, active) => {
+    SET_SHOW_DEBUG: (state, active) => {
       state.showDebug = active
       setStore({
         name: 'showDebug',
         content: state.showDebug
       })
     },
-    SET_SHOWTHEME: (state, active) => {
+    SET_SHOW_THEME: (state, active) => {
       state.showTheme = active
       setStore({
         name: 'showTheme',
         content: state.showTheme
       })
     },
-    SET_SHOWCOLOR: (state, active) => {
+    SET_SHOW_COLOR: (state, active) => {
       state.showColor = active
       setStore({
         name: 'showColor',