App.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <div id="app">
  3. <div :id="`fengMap${id}`" class="fengMap"></div>
  4. <router-view />
  5. </div>
  6. </template>
  7. <script>
  8. import { mapGetters, mapActions, mapMutations } from "vuex";
  9. import { SFengParser } from "@saga-web/feng-map";
  10. window.fengmapData = null;
  11. export default {
  12. data() {
  13. return {
  14. view: "",
  15. scene: "",
  16. id: "2",
  17. canvasID: "",
  18. key: "23f30a832a862c58637a4aadbf50a566",
  19. appName: "万达可视化系统",
  20. mapServerURL: `http://map.wanda.cn/editor`
  21. };
  22. },
  23. mounted() {
  24. // 监听页面刷新事件
  25. window.addEventListener("unload", this.unload);
  26. // 页面加载完成后,移除session里的存储的信息
  27. window.addEventListener("load", this.load);
  28. // 请求该项目下的楼层数据
  29. this.getFengMap();
  30. },
  31. computed: {
  32. ...mapGetters(["plazaId", "fmapID", "haveFengMap"])
  33. },
  34. methods: {
  35. ...mapActions(["getfmapID"]),
  36. ...mapMutations(["SETHAVEFENGMAP"]),
  37. unload() {
  38. // const { userInfo, projectId, menuStatus,manualAutoMode } = this.$store.state;
  39. const state = this.$store.state;
  40. sessionStorage.setItem("state", JSON.stringify(state));
  41. },
  42. load() {
  43. sessionStorage.clear();
  44. },
  45. getFengMap() {
  46. if (!this.fmapID) {
  47. this.getfmapID().then(() => {
  48. this.getMap();
  49. });
  50. return;
  51. }
  52. this.getMap();
  53. },
  54. getMap() {
  55. if (!window.fengmapData) {
  56. window.fengmapData = new SFengParser(
  57. `fengMap${this.id}`,
  58. `${this.mapServerURL}/fmap/${this.fmapID}`,
  59. this.key,
  60. this.appName,
  61. null,
  62. this.mapthemeUrl
  63. );
  64. window.fengmapData.loadMap(this.fmapID, () => {
  65. // 获取主题数据
  66. window.fengmapData
  67. .loadTheme(
  68. `${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`
  69. )
  70. .then(res => {
  71. this.SETHAVEFENGMAP();
  72. });
  73. });
  74. }
  75. }
  76. }
  77. };
  78. </script>
  79. <style lang="less">
  80. body,
  81. h1,
  82. h2,
  83. h3,
  84. h4,
  85. h5,
  86. h6,
  87. hr,
  88. p,
  89. blockquote,
  90. dl,
  91. dt,
  92. dd,
  93. ul,
  94. ol,
  95. li,
  96. pre,
  97. form,
  98. fieldset,
  99. legend,
  100. button,
  101. input,
  102. textarea,
  103. th,
  104. td {
  105. margin: 0;
  106. padding: 0;
  107. }
  108. body,
  109. button,
  110. input,
  111. select,
  112. textarea {
  113. font: 12px/1.5 Arial, "Microsoft YaHei", "\65b0\5b8b\4f53";
  114. }
  115. h1,
  116. h2,
  117. h3,
  118. h4,
  119. h5,
  120. h6 {
  121. font-size: 100%;
  122. }
  123. address,
  124. cite,
  125. dfn,
  126. var,
  127. em,
  128. i,
  129. u {
  130. font-style: normal;
  131. }
  132. ol,
  133. ul {
  134. list-style: none;
  135. }
  136. a {
  137. text-decoration: none;
  138. }
  139. a:hover {
  140. text-decoration: underline;
  141. }
  142. img {
  143. border: none;
  144. vertical-align: middle;
  145. }
  146. :focus {
  147. outline: 0;
  148. }
  149. button,
  150. input,
  151. select,
  152. textarea {
  153. font-size: 100%;
  154. }
  155. table {
  156. border-collapse: collapse;
  157. border-spacing: 0;
  158. }
  159. /* 滚动条样式 */
  160. body ::-webkit-scrollbar {
  161. width: 5px;
  162. height: 8px;
  163. }
  164. body ::-webkit-scrollbar-track {
  165. background-color: rgba(0, 0, 0, 0);
  166. border-radius: 3px;
  167. }
  168. body ::-webkit-scrollbar-thumb {
  169. border-radius: 3px;
  170. background: #e6e6e6;
  171. border: 1px solid #e6e6e6;
  172. }
  173. body ::-webkit-scrollbar-thumb:vertical:hover {
  174. background: #e6e6e6;
  175. border: 1px solid #e6e6e6;
  176. }
  177. #app {
  178. //meri-design组件select的字体颜色
  179. /deep/ .p-select-fakePlaceholder {
  180. span {
  181. span {
  182. color: #606266 !important;
  183. font-size: 13px;
  184. font-weight: normal;
  185. }
  186. }
  187. }
  188. //element 分页组件背景色
  189. /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
  190. background: linear-gradient(
  191. 180deg,
  192. rgba(54, 156, 247, 1) 0%,
  193. rgba(2, 91, 170, 1) 100%
  194. );
  195. }
  196. //element button
  197. /deep/ .el-button--primary,
  198. .p-button-primary {
  199. background: linear-gradient(
  200. 180deg,
  201. rgba(54, 156, 247, 1) 0%,
  202. rgba(2, 91, 170, 1) 100%
  203. );
  204. }
  205. }
  206. .clearfix::after {
  207. content: ".";
  208. display: block;
  209. height: 0;
  210. clear: both;
  211. visibility: hidden;
  212. }
  213. .clearfix {
  214. zoom: 1;
  215. }
  216. .left {
  217. float: left;
  218. }
  219. .right {
  220. float: right;
  221. }
  222. html,
  223. body {
  224. width: 100%;
  225. height: 100%;
  226. // min-width: 1920px;
  227. // background: url('./assets/images/back.jpg') no-repeat;
  228. }
  229. #app {
  230. height: 100%;
  231. width: 100%;
  232. position: relative;
  233. .fengMap {
  234. position: fixed;
  235. width: 100px;
  236. height: 100px;
  237. z-index: -1;
  238. opacity: 0;
  239. }
  240. }
  241. // element表头背景颜色修改
  242. .core-device-report,
  243. .specification-update-record {
  244. .el-table thead th {
  245. background-color: #f8f9fa;
  246. }
  247. .el-pagination.is-background .el-pager li:not(.disabled).active {
  248. background: linear-gradient(
  249. 180deg,
  250. rgba(54, 156, 247, 1) 0%,
  251. rgba(2, 91, 170, 1) 100%
  252. );
  253. }
  254. }
  255. // 说明书更新记录 element 时间控件样式重写
  256. .specification-update-record,
  257. .core-device-report {
  258. .el-input__inner {
  259. height: 32px;
  260. line-height: 32px;
  261. }
  262. .el-date-editor .el-range__icon,
  263. .el-date-editor .el-range-separator {
  264. line-height: 26px;
  265. width: 8%;
  266. }
  267. .el-date-editor .el-range__close-icon {
  268. line-height: 26px;
  269. }
  270. }
  271. </style>