settings.js 951 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import variables from '@/assets/styles/element-variables.scss'
  2. import defaultSettings from '@/settings'
  3. const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings
  4. const state = {
  5. theme: variables.theme,
  6. showSettings: showSettings,
  7. tagsView: tagsView,
  8. fixedHeader: fixedHeader,
  9. sidebarLogo: sidebarLogo,
  10. pfdPageImgeSize: {
  11. imageWidth:2148,
  12. areaLJLWidth: 248,
  13. areaJLQWidth: 423,
  14. areaZJQWidth: 802,
  15. areaYSWidth: 520,
  16. areaTBPWidth: 282,
  17. areaRQ1Width: 520,
  18. areaLQ_RQWidth: 666,
  19. areaLQ_1Width: 666,
  20. areaLQ_2Width: 320,
  21. areaRQ2Width: 320,
  22. },
  23. }
  24. const mutations = {
  25. CHANGE_SETTING: (state, { key, value }) => {
  26. console.log("value")
  27. if (state.hasOwnProperty(key)) {
  28. state[key] = value
  29. }
  30. }
  31. }
  32. const actions = {
  33. changeSetting({ commit }, data) {
  34. commit('CHANGE_SETTING', data)
  35. }
  36. }
  37. export default {
  38. namespaced: true,
  39. state,
  40. mutations,
  41. actions
  42. }