Browse Source

解决代码合并问题

fujunwen 4 years ago
parent
commit
eb6aecca9d
4 changed files with 190 additions and 221 deletions
  1. 0 6
      package.json
  2. 127 135
      src/App.vue
  3. 31 48
      src/main.js
  4. 32 32
      src/router/index.js

+ 0 - 6
package.json

@@ -8,12 +8,6 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
-    "@mapbox/geojson-merge": "^1.1.1",
-    "@saga-web/base": "2.1.19",
-    "@saga-web/big": "1.0.40",
-    "@saga-web/draw": "2.1.94",
-    "@saga-web/feng-map": "1.0.11",
-    "@saga-web/graph": "2.1.82",
     "ant-design-vue": "^1.4.10",
     "axios": "^0.19.2",
     "core-js": "^3.4.4",

+ 127 - 135
src/App.vue

@@ -1,13 +1,13 @@
 <template>
-    <div id='app'>
-        <div :id='`fengMap${id}`' class='fengMap'></div>
-        <router-view />
-    </div>
+  <div id="app">
+    <div :id="`fengMap${id}`" class="fengMap"></div>
+    <router-view />
+  </div>
 </template>
 <script>
-import { mapGetters, mapActions, mapMutations } from 'vuex'
-import { SFengParser } from '@saga-web/feng-map'
-window.fengmapData = null
+import { mapGetters, mapActions, mapMutations } from "vuex";
+import { SFengParser } from "@saga-web/feng-map";
+window.fengmapData = null;
 export default {
   data() {
     return {
@@ -26,7 +26,7 @@ export default {
     // 页面加载完成后,移除session里的存储的信息
     window.addEventListener("load", this.load);
     // 请求该项目下的楼层数据
-    // this.getFengMap();
+    this.getFengMap();
   },
   computed: {
     ...mapGetters(["plazaId", "fmapID", "haveFengMap"])
@@ -39,50 +39,43 @@ export default {
       const state = this.$store.state;
       sessionStorage.setItem("state", JSON.stringify(state));
     },
-    mounted() {
-        // 监听页面刷新事件
-        window.addEventListener('unload', this.unload)
-        // 页面加载完成后,移除session里的存储的信息
-        window.addEventListener('load', this.load)
-        // 请求该项目下的楼层数据
-        this.getFengMap()
+
+    load() {
+      sessionStorage.clear();
     },
-    computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap'])
+    getFengMap() {
+      if (!this.fmapID) {
+        this.getfmapID().then(() => {
+          this.getMap();
+        });
+        return;
+      }
+      this.getMap();
     },
-    methods: {
-        ...mapActions(['getfmapID']),
-        ...mapMutations(['SETHAVEFENGMAP']),
-        unload() {
-            // const { userInfo, projectId, menuStatus,manualAutoMode } = this.$store.state;
-            const state = this.$store.state
-            sessionStorage.setItem('state', JSON.stringify(state))
-        },
-        load() {
-            sessionStorage.clear()
-        },
-        getFengMap() {
-            if (!this.fmapID) {
-                this.getfmapID().then(() => {
-                    this.getMap()
-                })
-                return
-            }
-            this.getMap()
-        },
-        getMap() {
-            if (!window.fengmapData) {
-                window.fengmapData = new SFengParser(`fengMap${this.id}`, `${this.mapServerURL}/fmap/${this.fmapID}`, this.key, this.appName, null, this.mapthemeUrl)
-                window.fengmapData.loadMap(this.fmapID, () => {
-                    // 获取主题数据
-                    window.fengmapData.loadTheme(`${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`).then(res => {
-                        this.SETHAVEFENGMAP()
-                    })
-                })
-            }
-        }
+    getMap() {
+      if (!window.fengmapData) {
+        window.fengmapData = new SFengParser(
+          `fengMap${this.id}`,
+          `${this.mapServerURL}/fmap/${this.fmapID}`,
+          this.key,
+          this.appName,
+          null,
+          this.mapthemeUrl
+        );
+        window.fengmapData.loadMap(this.fmapID, () => {
+          // 获取主题数据
+          window.fengmapData
+            .loadTheme(
+              `${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`
+            )
+            .then(res => {
+              this.SETHAVEFENGMAP();
+            });
+        });
+      }
     }
-}
+  }
+};
 </script>
 <style lang="less">
 body,
@@ -110,8 +103,8 @@ input,
 textarea,
 th,
 td {
-    margin: 0;
-    padding: 0;
+  margin: 0;
+  padding: 0;
 }
 
 body,
@@ -119,7 +112,7 @@ button,
 input,
 select,
 textarea {
-    font: 12px/1.5 Arial, 'Microsoft YaHei', '\65b0\5b8b\4f53';
+  font: 12px/1.5 Arial, "Microsoft YaHei", "\65b0\5b8b\4f53";
 }
 
 h1,
@@ -128,7 +121,7 @@ h3,
 h4,
 h5,
 h6 {
-    font-size: 100%;
+  font-size: 100%;
 }
 
 address,
@@ -138,161 +131,160 @@ var,
 em,
 i,
 u {
-    font-style: normal;
+  font-style: normal;
 }
 
 ol,
 ul {
-    list-style: none;
+  list-style: none;
 }
 
 a {
-    text-decoration: none;
+  text-decoration: none;
 }
 
 a:hover {
-    text-decoration: underline;
+  text-decoration: underline;
 }
 
 img {
-    border: none;
-    vertical-align: middle;
+  border: none;
+  vertical-align: middle;
 }
 
 :focus {
-    outline: 0;
+  outline: 0;
 }
 
 button,
 input,
 select,
 textarea {
-    font-size: 100%;
+  font-size: 100%;
 }
 
 table {
-    border-collapse: collapse;
-    border-spacing: 0;
+  border-collapse: collapse;
+  border-spacing: 0;
 }
 
 /* 滚动条样式 */
 
 body ::-webkit-scrollbar {
-    width: 5px;
-    height: 8px;
+  width: 5px;
+  height: 8px;
 }
 
 body ::-webkit-scrollbar-track {
-    background-color: rgba(0, 0, 0, 0);
-    border-radius: 3px;
+  background-color: rgba(0, 0, 0, 0);
+  border-radius: 3px;
 }
 
 body ::-webkit-scrollbar-thumb {
-    border-radius: 3px;
-    background: #e6e6e6;
-    border: 1px solid #e6e6e6;
+  border-radius: 3px;
+  background: #e6e6e6;
+  border: 1px solid #e6e6e6;
 }
 
 body ::-webkit-scrollbar-thumb:vertical:hover {
-    background: #e6e6e6;
-    border: 1px solid #e6e6e6;
+  background: #e6e6e6;
+  border: 1px solid #e6e6e6;
 }
 
 #app {
-    //meri-design组件select的字体颜色
-    /deep/ .p-select-fakePlaceholder {
-        span {
-            span {
-                color: #606266 !important;
-                font-size: 13px;
-                font-weight: normal;
-            }
-        }
-    }
-    //element 分页组件背景色
-    /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
-    }
-    //element button
-    /deep/ .el-button--primary,
-    .p-button-primary {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+  //meri-design组件select的字体颜色
+  /deep/ .p-select-fakePlaceholder {
+    span {
+      span {
+        color: #606266 !important;
+        font-size: 13px;
+        font-weight: normal;
+      }
     }
+  }
+  //element 分页组件背景色
+  /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
+  //element button
+  /deep/ .el-button--primary,
+  .p-button-primary {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
 }
 .clearfix::after {
-    content: '.';
-    display: block;
-    height: 0;
-    clear: both;
-    visibility: hidden;
+  content: ".";
+  display: block;
+  height: 0;
+  clear: both;
+  visibility: hidden;
 }
 .clearfix {
-    zoom: 1;
+  zoom: 1;
 }
 
 .left {
-    float: left;
+  float: left;
 }
 
 .right {
-    float: right;
+  float: right;
 }
 html,
 body {
-    width: 100%;
-    height: 100%;
-    // min-width: 1920px;
-    //   background: url('./assets/images/back.jpg') no-repeat;
+  width: 100%;
+  height: 100%;
+  // min-width: 1920px;
+  //   background: url('./assets/images/back.jpg') no-repeat;
 }
 #app {
-    height: 100%;
-    width: 100%;
-    position: relative;
-    .fengMap {
-        position: fixed;
-        width: 100px;
-        height: 100px;
-        z-index: -1;
-        opacity: 0;
-    }
+  height: 100%;
+  width: 100%;
+  position: relative;
+  .fengMap {
+    position: fixed;
+    width: 100px;
+    height: 100px;
+    z-index: -1;
+    opacity: 0;
+  }
 }
 // element表头背景颜色修改
 .core-device-report,
 .specification-update-record {
-    .el-table thead th {
-        background-color: #f8f9fa;
-    }
-    .el-pagination.is-background .el-pager li:not(.disabled).active {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
-    }
+  .el-table thead th {
+    background-color: #f8f9fa;
+  }
+  .el-pagination.is-background .el-pager li:not(.disabled).active {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
 }
 // 说明书更新记录 element 时间控件样式重写
 .specification-update-record,
-<<<<<<< HEAD
 .core-device-report {
-    .el-input__inner {
-        height: 32px;
-        line-height: 32px;
-    }
-    .el-date-editor .el-range__icon,
-    .el-date-editor .el-range-separator {
-        line-height: 26px;
-        width: 8%;
-    }
-=======
-.core-device-report{
-  .el-input__inner{
+  .el-input__inner {
     height: 32px;
     line-height: 32px;
   }
   .el-date-editor .el-range__icon,
-  .el-date-editor .el-range-separator{
+  .el-date-editor .el-range-separator {
     line-height: 26px;
     width: 8%;
   }
-  .el-date-editor .el-range__close-icon{
+  .el-date-editor .el-range__close-icon {
     line-height: 26px;
   }
->>>>>>> develop-cd
 }
-</style>
+</style>

+ 31 - 48
src/main.js

@@ -1,50 +1,33 @@
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
-    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
-    return new (P || (P = Promise))(function (resolve, reject) {
-        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
-        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
-        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
-        step((generator = generator.apply(thisArg, _arguments || [])).next());
-    });
-};
-import Vue from 'vue';
-import App from './App.vue';
-import router from './router';
-import store from './store';
-Vue.config.productionTip = false;
-import design from 'ant-design-vue';
-import 'ant-design-vue/dist/antd.css';
-Vue.use(design);
-import ElementUI from 'element-ui';
-import 'element-ui/lib/theme-chalk/index.css';
-Vue.use(ElementUI);
-import VueQuillEditor from 'vue-quill-editor';
-import 'quill/dist/quill.core.css';
-import 'quill/dist/quill.snow.css';
-import 'quill/dist/quill.bubble.css';
-Vue.use(VueQuillEditor);
-import WdEditor from '@/components/Editor';
-Vue.use(WdEditor);
-import Rotation from '@/components/Rotation';
-Vue.use(Rotation);
-import PicLarge from '@/components/PicLarge';
-Vue.use(PicLarge);
-import Legend from '@/components/Legend';
-Vue.use(Legend);
-import cookies from 'vue-cookie';
-Vue.use(cookies);
-import Pui from 'meri-design';
-import 'meri-design/dist/index.css';
-import "leaflet/dist/leaflet.css";
-Vue.use(Pui);
-//////////模拟传入参数
-const username = 'lengqiang';
-/////////////////
-// 在跳入路由之前要请求获取权限信息
-router.beforeEach((to, from, next) => __awaiter(void 0, void 0, void 0, function* () {
-    if (!store.state.isrequestAuth) {
-        yield store.dispatch('getUserInfo', username);
-        yield store.dispatch('getFloors');
+var __awaiter =
+    (this && this.__awaiter) ||
+    function(thisArg, _arguments, P, generator) {
+        function adopt(value) {
+            return value instanceof P
+                ? value
+                : new P(function(resolve) {
+                      resolve(value)
+                  })
+        }
+        return new (P || (P = Promise))(function(resolve, reject) {
+            function fulfilled(value) {
+                try {
+                    step(generator.next(value))
+                } catch (e) {
+                    reject(e)
+                }
+            }
+            function rejected(value) {
+                try {
+                    step(generator['throw'](value))
+                } catch (e) {
+                    reject(e)
+                }
+            }
+            function step(result) {
+                result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)
+            }
+            step((generator = generator.apply(thisArg, _arguments || [])).next())
+        })
     }
 import Vue from 'vue'
 import App from './App.vue'
@@ -80,4 +63,4 @@ new Vue({
     router,
     store,
     render: (h) => h(App),
-}).$mount('#app')
+}).$mount('#app')

+ 32 - 32
src/router/index.js

@@ -76,36 +76,36 @@ const router = new VueRouter({
 })
 //不需要token的路由
 const ignore = ["/404", "/legendLibrary", "/legendRules"]
-router.beforeEach(async (to, from, next) => {
-    if (!ignore.includes(to.path)) {
-        const token = query().token
-        const ssoToken = store.getters["ssoToken"]
-        if (ssoToken) {
-            store.commit("SETSSOTOKEN", ssoToken)
-            await store.dispatch("getUserInfo", router)
-            await store.dispatch("getFloors")
-            await store.dispatch("getBrand")
-            next()
-        } else if (token) {
-            store.commit("SETSSOTOKEN", token)
-            await store.dispatch("getUserInfo", router)
-            next()
-        } else {
-            let lastRoute = {
-                path: to.path,
-                params: to.params,
-                query: to.query,
-            }
-            store.commit("SETLASTROUTER", lastRoute)
-            let ssoServer = "http://oauth.wanda-dev.cn"
-            let systemcode = "CAD156",
-                signal = new Date().getTime(),
-                version = "1.0.0"
-            window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
-        }
-    } else {
-        next()
-        return
-    }
-})
+// router.beforeEach(async (to, from, next) => {
+//     if (!ignore.includes(to.path)) {
+//         const token = query().token
+//         const ssoToken = store.getters["ssoToken"]
+//         if (ssoToken) {
+//             store.commit("SETSSOTOKEN", ssoToken)
+//             await store.dispatch("getUserInfo", router)
+//             await store.dispatch("getFloors")
+//             await store.dispatch("getBrand")
+//             next()
+//         } else if (token) {
+//             store.commit("SETSSOTOKEN", token)
+//             await store.dispatch("getUserInfo", router)
+//             next()
+//         } else {
+//             let lastRoute = {
+//                 path: to.path,
+//                 params: to.params,
+//                 query: to.query,
+//             }
+//             store.commit("SETLASTROUTER", lastRoute)
+//             let ssoServer = "http://oauth.wanda-dev.cn"
+//             let systemcode = "CAD156",
+//                 signal = new Date().getTime(),
+//                 version = "1.0.0"
+//             window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
+//         }
+//     } else {
+//         next()
+//         return
+//     }
+// })
 export default router