App.vue 5.5 KB

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