App.vue 5.1 KB

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