Browse Source

Merge remote-tracking branch 'origin/master'

onlyh 3 years ago
parent
commit
84a53560c1

+ 1 - 0
public/index.html

@@ -11,6 +11,7 @@
     <meta http-equiv="Pragma" content="no-cache"/>
     <meta http-equiv="Expires" content="0"/>
     <title><%= htmlWebpackPlugin.options.title %></title>
+    <script src="<%= BASE_URL %>systemConf.js"></script>
 </head>
 <body>
 <noscript>

+ 13 - 0
public/systemConf.js

@@ -0,0 +1,13 @@
+/**
+ * @author 张宇
+ * @description 项目配置文件
+ *
+ */
+
+ var __systemConf = {
+    // 平面图跳转地址
+    planJumpUrl: "http://192.168.64.18:9989/persagyPlan/home",
+    // 拓扑图跳转地址
+    topoJumpUrl: "http://192.168.64.18:9989/persagyTopo/home",
+}
+window.__systemConf = __systemConf

+ 7 - 0
src/store/modules/user.ts

@@ -16,6 +16,7 @@ export interface IUserState {
     userId: string;
     group: string;
     projectId: string;
+    projectName: string;
     projects: any[];
     avatar: string;
     introduction: string;
@@ -30,6 +31,7 @@ class User extends VuexModule implements IUserState {
     public userId = "06328a53c69a41bb8f5bb1a552c6e8d6";
     public group = "WD";// 集团
     public projectId = "Pj4403070003";// 深圳龙岗万达广场
+    public projectName = "深圳龙岗万达广场";// 深圳龙岗万达广场
     public projects: any[] = [{
         id: "Pj4403070003",
         name: "深圳龙岗万达广场"
@@ -59,6 +61,11 @@ class User extends VuexModule implements IUserState {
     }
 
     @Mutation
+    private SET_PROJECTNAME(projectName: string) {
+        this.projectName = projectName;
+    }
+
+    @Mutation
     private SET_PROJECTS(projects: any[]) {
         this.projects = projects;
     }

+ 28 - 5
src/views/scene/plane/index.vue

@@ -1,12 +1,35 @@
 <template>
-    <div>平面图</div>
+    <div></div>
 </template>
 
-<script>
-export default {
-    name: "平面图"
+<script lang="ts">
+import { Vue, Component } from "vue-property-decorator";
+import { UserModule } from "@/store/modules/user";
+
+// 平面图跳转地址
+// @ts-ignore
+const planJumpUrl = window.__systemConf.planJumpUrl;
+
+@Component({
+    name: "system",
+    components: {},
+})
+export default class extends Vue {
+    // 项目id
+    private get projectId(): string {
+        return UserModule.projectId;
+    }
+
+    // 项目名称
+    private get projectName(): string {
+        return UserModule.projectName;
+    }
+
+    created() {
+        window.open(`${planJumpUrl}?projectId=${this.projectId}&projectName=${this.projectName}`);
+    }
 }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 </style>

+ 28 - 5
src/views/scene/system/index.vue

@@ -1,12 +1,35 @@
 <template>
-    <div>系统</div>
+    <div></div>
 </template>
 
-<script>
-export default {
-    name: "index"
+<script lang="ts">
+import { Vue, Component } from "vue-property-decorator";
+import { UserModule } from "@/store/modules/user";
+
+// 系统图跳转地址
+// @ts-ignore
+const topoJumpUrl = window.__systemConf.topoJumpUrl;
+
+@Component({
+    name: "system",
+    components: {},
+})
+export default class extends Vue {
+    // 项目id
+    private get projectId(): string {
+        return UserModule.projectId;
+    }
+
+    // 项目名称
+    private get projectName(): string {
+        return UserModule.projectName;
+    }
+
+    created() {
+        window.open(`${topoJumpUrl}?projectId=${this.projectId}&projectName=${this.projectName}`);
+    }
 }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 </style>