App.vue 5.1 KB

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