From 909e611a0ac4d72333f75c53b2cd69062ff9c903 Mon Sep 17 00:00:00 2001 From: yangys <y_ys79@sina.com> Date: 星期六, 13 一月 2024 22:59:23 +0800 Subject: [PATCH] 修改api里的错误 --- src/store/modules/app.js | 61 +++++------------------------- 1 files changed, 10 insertions(+), 51 deletions(-) diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 7c9f5da..00f7b83 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -1,61 +1,20 @@ +/* + * @Date: 2019-11-26 00:59:58 + * @LastEditors: Sneed + * @LastEditTime: 2024-01-07 22:57:26 + * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/store/modules/app.js + */ import Cookies from 'js-cookie' - +import { getPlanList} from '@/api/MdcApi' const app = { state: { - sidebar: { - opened: !+Cookies.get('sidebarStatus'), - withoutAnimation: false - }, - device: 'desktop', - mainHeight: 0, - mainWidth: 0 + }, mutations: { - TOGGLE_SIDEBAR: state => { - if (state.sidebar.opened) { - Cookies.set('sidebarStatus', 1) - } else { - Cookies.set('sidebarStatus', 0) - } - state.sidebar.opened = !state.sidebar.opened - state.sidebar.withoutAnimation = false - // 宸︿晶鑿滃崟鏍忓搴﹀彉鍖栧悗 閲嶆柊璁$畻鍙充晶鍐呭鍖哄煙瀹藉害 - let dif = 0 - if (state.device === 'desktop') { - dif = state.sidebar.opened ? 180 : 36 - } else { - dif = 0 - } - state.mainWidth = window.innerWidth - dif - }, - CLOSE_SIDEBAR: (state, withoutAnimation) => { - Cookies.set('sidebarStatus', 1) - state.sidebar.opened = false - state.sidebar.withoutAnimation = withoutAnimation - }, - TOGGLE_DEVICE: (state, device) => { - state.device = device - state.mainHeight = window.innerHeight - 50 - // 椤甸潰灏哄鍙樺寲鍚庯紙椤甸潰鍒濆鍖栨椂锛� 璁$畻鍙充晶鍐呭鍖哄煙瀹藉害 - let dif = 0 - if (state.device === 'desktop') { - dif = state.sidebar.opened ? 180 : 36 - } else { - dif = 0 - } - state.mainWidth = window.innerWidth - dif - } + }, actions: { - ToggleSideBar: ({ commit }) => { - commit('TOGGLE_SIDEBAR') - }, - CloseSideBar({ commit }, { withoutAnimation }) { - commit('CLOSE_SIDEBAR', withoutAnimation) - }, - ToggleDevice({ commit }, device) { - commit('TOGGLE_DEVICE', device) - } + } } -- Gitblit v1.9.3