store.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import mutations from './mutations'
  4. import actions from './action'
  5. import getters from './getters'
  6. // import { ctx } from '@/config/config.js';
  7. Vue.use(Vuex);
  8. const state = {
  9. // ctx: process.env.NODE_ENV === 'production' ? ('/' + ctx) : '',
  10. ctx: '',
  11. // 登录token
  12. token: null,
  13. // 面包屑
  14. breadcrumb: [],
  15. // 请求地址
  16. ajaxCtx: '',
  17. // 图片基础路径
  18. imgBaseUrl: '',
  19. // 文件基础路径
  20. fileBaseUrl: '',
  21. // 上传文件路径
  22. fileUploadUrl: '',
  23. // 下载文件路径
  24. fileDownloadUrl: '',
  25. // 从表页面返回的当前页面值
  26. currentStates: {},
  27. // 仓库编码
  28. storageattr: '',
  29. // 内控标准-成分、材质、公差、探伤-判断是否存在未保存的数据,1:存在、0:不存在
  30. nkHaveChild: '',
  31. // 内控标准-成分、材质、公差、探伤页面观察此属性的变化,如果为'1'则检验自身页面中是否存在未保存数据
  32. // 存在则将nkHaveChild赋值为'1',反之赋值为'0'
  33. nkDoCheck: '',
  34. jfHaveChild: '',
  35. jfDoCheck: '',
  36. // apollo
  37. apolloUser: [],
  38. apolloOrg: [],
  39. pageShow: true
  40. };
  41. export default new Vuex.Store({
  42. state,
  43. getters,
  44. actions,
  45. mutations
  46. });