import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ state: { isShowLoading: false, // 全局 loading // 左侧菜单栏数据 menuItems: [{ text: '充电桩管理', type: 'ios-paper', children: [ { type: 'ios-grid', name: 'msg', text: '文档', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 hidden: true, }, { type: 'ios-grid', name: 'charging_station', text: '站点管理', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 // hidden: true, }, { size: 18, // icon大小 type: 'md-arrow-forward', // icon类型 name: 'charging_pile', text: '充电桩管理', // url: 'https://www.baidu.com', // isExternal: true, // 外链 跳到一个外部的 URL 页面 }, { size: 18, text: '电价管理', name: 'charging_price', type: 'ios-paper', }, { size: 18, text: '故障运维', name: 'charging_fault', type: 'ios-paper', }, ], }, { size: 18, // icon大小 type: 'md-home', // icon类型 text: '客户中心', // 文本内容 children: [ { type: 'ios-grid', name: 'corporate_client', text: '企业客户', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 // hidden: true, }, { size: 18, // icon大小 type: 'md-arrow-forward', // icon类型 name: 'wx_user', text: '用户管理', // url: 'https://www.baidu.com', // isExternal: true, // 外链 跳到一个外部的 URL 页面 }, // { // size: 18, // text: '钱包账户', // type: 'ios-paper', // }, { size: 18, text: '车辆管理', name: 'user_car', type: 'ios-paper', }, ], }, { size: 18, // icon大小 type: 'ios-egg-outline', // icon类型 text: '运营中心', // 点击侧边栏跳到一个单独的路由页面,需要提前在 router.js 定义 children: [ { type: 'ios-grid', name: 'activity', text: '活动发布', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 // hidden: true, }, { size: 18, // icon大小 type: 'md-arrow-forward', // icon类型 name: 'coupon', text: '优惠券', // url: 'https://www.baidu.com', // isExternal: true, // 外链 跳到一个外部的 URL 页面 }, { size: 18, text: '会员', name: 'user_vip', type: 'ios-paper', }, { size: 18, text: '发票管理', name: 'invoice', type: 'ios-paper', }, ], }, { size: 18, // icon大小 type: 'md-arrow-forward', // icon类型 text: '订单管理', // url: 'https://www.baidu.com', // isExternal: true, // 外链 跳到一个外部的 URL 页面 children: [ { type: 'ios-grid', name: 'charge_order', text: '充电订单', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 // hidden: true, }, { size: 18, // icon大小 type: 'md-arrow-forward', // icon类型 name: 'recharge_order', text: '充值订单', // url: 'https://www.baidu.com', // isExternal: true, // 外链 跳到一个外部的 URL 页面 }, { size: 18, text: '充电退款订单', name: 'refund_order', type: 'ios-paper', }, { size: 18, text: '订单统计', name: 'order_total', type: 'ios-paper', }, ], }, { text: '数据中心', type: 'ios-paper', children: [ { type: 'ios-grid', name: 'yunying_reports', text: '运营报表', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 // hidden: true, }, { size: 18, // icon大小 type: 'md-arrow-forward', // icon类型 name: 'caiwu_reports', text: '财务报表', }, { size: 18, text: '运维报表', name: 'yunwei_reports', type: 'ios-paper', }, ], }, { text: '系统设置', type: 'ios-paper', children: [ { type: 'ios-grid', name: 'system', text: '参数设置', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 // hidden: true, }, { size: 18, // icon大小 type: 'md-arrow-forward', // icon类型 name: 'admin', text: '系统用户', }, { size: 18, text: '权限管理', name: 'auth', type: 'ios-paper', }, { size: 18, text: '日志管理', name: 'log', type: 'ios-paper', }, ], }, { text: '报表分析', type: 'ios-paper', children: [ { type: 'ios-grid', name: 'rate', text: '充电桩使用率', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 // hidden: true, }, { type: 'ios-grid', name: 'backup_and_repair', text: '数据备份与修复', // hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面 // hidden: true, }, { size: 18, // icon大小 type: 'md-arrow-forward', // icon类型 name: 'activation', text: '用户活跃度', }, { size: 18, text: '收入分析', name: 'income_analysis', type: 'ios-paper', }, ], }, ], }, mutations: { setMenus(state, items) { state.menuItems = [...items] }, setLoading(state, isShowLoading) { state.isShowLoading = isShowLoading }, }, }) export default store