store.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. var store2 = {
  2. debug: true,
  3. state: {
  4. xzqdm: "", //当前选择的行政区代码
  5. isInitViewer: false,
  6. // 控制界面显隐,0默认隐藏,1显示
  7. ToolBarShow: false,
  8. toolBarActive: 0,
  9. toolBar: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  10. addLayer: [1, 0, 0],
  11. sceneAtttribute: [1, 0, 0, 0, 0],
  12. terrain: [1, 0, 0, 0],
  13. clip: [1, 0, 0, 0],
  14. analysis: [1, 0, 0, 0, 0],
  15. cityPlan: [1, 0, 0, 0, 0],
  16. onlineEdit: [1, 0, 0],
  17. specialEffects: [0, 0, 0], //特效
  18. hotSpots: [0, 0], //热点
  19. compass: true,
  20. // 图层管理
  21. S3MLayerManage: null,
  22. imgLayerManage: null,
  23. terrainLayerManage: null,
  24. LayerAttributeToolbar: false, //图层属性显隐
  25. LayerAttribute: [1, 0, 0, 0],
  26. selectedLayerName: null, //当前选中编辑图层name
  27. // 编辑
  28. isEdit: false,
  29. isEditZ: false,
  30. vectorlayerlist: [],
  31. modellayerlist: [],
  32. chooseLayer:[]
  33. },
  34. setisInitViewer(newValue) {
  35. this.state.isInitViewer = newValue;
  36. },
  37. setXzqdm(newValue) {
  38. this.state.xzqdm = newValue;
  39. },
  40. setVectorLayerList(newValue) {
  41. this.state.vectorlayerlist = newValue;
  42. },
  43. setLayerList(newValue) {//分层分户
  44. this.state.chooseLayer = newValue;
  45. },
  46. setModelLayerList(newValue) {
  47. this.state.modellayerlist = newValue;
  48. },
  49. setToolBarShow(newValue) {
  50. this.state.ToolBarShow = newValue;
  51. },
  52. setSpecialEffects(id, val) {
  53. this.state.specialEffects[id] = val;
  54. this.state.specialEffects = [...this.state.specialEffects];
  55. },
  56. setHotSpots(id, val) {
  57. this.state.hotSpots[id] = val;
  58. this.state.hotSpots = [...this.state.hotSpots];
  59. },
  60. setCompass(newValue) {
  61. this.state.compass = newValue;
  62. },
  63. // 设置导航工具显隐
  64. setToolBarAction(newValue) {
  65. if (typeof(newValue) != "undefined") {
  66. if (this.state.toolBarActive != newValue) {
  67. this.hideToolBar();
  68. }
  69. this.state.toolBar[newValue] = !this.state.toolBar[newValue];
  70. } else {
  71. this.hideToolBar();
  72. }
  73. this.state.toolBarActive = newValue;
  74. this.state.toolBar = [...this.state.toolBar];
  75. },
  76. hideToolBar(newValue) {
  77. this.state.toolBar = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  78. },
  79. // 设置各功能组件子组件显隐
  80. setAddLayerAction(newValue) {
  81. this.state.addLayer = newValue;
  82. },
  83. setTerrainAction(newValue) {
  84. this.state.terrain = newValue;
  85. },
  86. setSceneAtttribute(newValue) {
  87. this.state.sceneAtttribute = newValue;
  88. },
  89. setClipAction(newValue) {
  90. this.state.clip = newValue;
  91. },
  92. setAnalysisAction(newValue) {
  93. this.state.analysis = newValue;
  94. },
  95. setCityPlanAction(newValue) {
  96. this.state.cityPlan = newValue;
  97. },
  98. setOnlineEditrAction(newValue) {
  99. this.state.onlineEdit = newValue;
  100. },
  101. // 设置图层管理
  102. setS3MLayerManage(newValue) {
  103. this.state.S3MLayerManage = newValue;
  104. },
  105. setImgLayerManage(newValue) {
  106. this.state.imgLayerManage = newValue;
  107. },
  108. setTerrainLayerManage(newValue) {
  109. this.state.terrainLayerManage = newValue;
  110. },
  111. setLayerAttributeToolbal(newValue) {
  112. this.state.LayerAttributeToolbar = newValue;
  113. },
  114. setLayerAttribute(newValue) {
  115. this.state.LayerAttribute = newValue;
  116. },
  117. setSelectedLayerName(newValue) {
  118. this.state.selectedLayerName = newValue;
  119. },
  120. setIsEdit(newValue) {
  121. this.state.isEdit = newValue;
  122. },
  123. setIsEditZ(newValue) {
  124. this.state.isEditZ = newValue;
  125. },
  126. }
  127. // import store from "@/store/store.js"
  128. // sharedState: store.state
  129. // console.log(this.sharedState.message)
  130. // store.setMessageAction("dajiahao")
  131. export default store2