Prechádzať zdrojové kódy

项目id和项目密码在vuex里取

zhangyu 5 rokov pred
rodič
commit
c8a9e11895
24 zmenil súbory, kde vykonal 125 pridanie a 56 odobranie
  1. 5 1
      src/components/business_space/dialogs/addDialog/businessDialog.vue
  2. 4 1
      src/components/business_space/dialogs/list/guaranteeDialog.vue
  3. 5 2
      src/components/business_space/dialogs/list/insurerDialog.vue
  4. 5 2
      src/components/business_space/dialogs/list/maintainerDialog.vue
  5. 5 1
      src/components/business_space/dialogs/list/paramDetails.vue
  6. 5 2
      src/components/business_space/dialogs/list/supplierDialog.vue
  7. 7 3
      src/components/business_space/dialogs/list/supplyDialog.vue
  8. 10 6
      src/components/business_space/dialogs/list/systemType.vue
  9. 6 2
      src/components/business_space/lib/floorCascader.vue
  10. 6 2
      src/components/data_admin/buildFamily.vue
  11. 5 1
      src/components/dialogHanson/addDevice.vue
  12. 5 1
      src/components/dialogs/addDialog/businessDialog.vue
  13. 3 6
      src/components/dialogs/addDialog/dialogAssets.vue
  14. 3 3
      src/components/dialogs/addDialog/dialogSystem.vue
  15. 8 4
      src/components/dialogs/detailsDialog.vue
  16. 6 2
      src/components/dialogs/facilityDialog.vue
  17. 8 4
      src/components/dialogs/influenceDialog.vue
  18. 1 1
      src/components/dialogs/list/guaranteeDialog.vue
  19. 5 2
      src/components/dialogs/list/insurerDialog.vue
  20. 5 2
      src/components/dialogs/list/maintainerDialog.vue
  21. 5 1
      src/components/dialogs/list/paramDetails.vue
  22. 5 2
      src/components/dialogs/list/supplierDialog.vue
  23. 2 2
      src/components/dialogs/list/systemType.vue
  24. 6 3
      src/components/ledger/addDialog/dialogDevice.vue

+ 5 - 1
src/components/business_space/dialogs/addDialog/businessDialog.vue

@@ -68,6 +68,7 @@
 import myCascader from "@/components/business_space/lib/cascaders/assets";
 // import hansonTable from "@/components/business_space/dialogHanson/addDevice";
 import { getSpaceHeader } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 import tools from "@/utils/tools";
 import qrcode from "@/components/business_space/lib/qrcode";
 import firm from "@/components/business_space/dialogs/list/firm";
@@ -118,6 +119,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       width: "30%",
@@ -216,7 +220,7 @@ export default {
       this.main = table(10)
       getSpaceHeader({
         code: "space",
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {

+ 4 - 1
src/components/business_space/dialogs/list/guaranteeDialog.vue

@@ -84,6 +84,9 @@ export default {
       default: 0
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -130,7 +133,7 @@ export default {
         data: {
           venderId: this.id,
           insuranceNo: this.formData.name,
-          projectId: this.$route.query.projId,
+          projectId: this.projectId,
           contractFile: this.keysArr[0]
         }
       }

+ 5 - 2
src/components/business_space/dialogs/list/insurerDialog.vue

@@ -52,6 +52,7 @@
 </template>
 <script>
 import myPagination from "@/components/common/myPagination";
+import { mapGetters } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -69,6 +70,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -79,8 +83,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 5 - 2
src/components/business_space/dialogs/list/maintainerDialog.vue

@@ -51,6 +51,7 @@
 </template>
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
+import { mapGetters } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -68,6 +69,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -78,8 +82,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 5 - 1
src/components/business_space/dialogs/list/paramDetails.vue

@@ -13,6 +13,7 @@
 <script>
 
 import { getSpaceHeader } from "@/api/scan/request"
+import { mapGetters, mapActions } from "vuex"
 
 export default {
   props: {
@@ -32,6 +33,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       labelArr: []
@@ -42,7 +46,7 @@ export default {
   methods: {
     getData() {
       let param = {
-        ProjId: this.$route.query.projId,
+        ProjId: this.projectId,
         code: this.data.eqFamily
       }
       getSpaceHeader(param).then(res => {

+ 5 - 2
src/components/business_space/dialogs/list/supplierDialog.vue

@@ -51,6 +51,7 @@
 </template>
 <script>
 import myPagination from "@/components/common/myPagination";
+import { mapGetters, mapActions } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -68,6 +69,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -78,8 +82,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 7 - 3
src/components/business_space/dialogs/list/supplyDialog.vue

@@ -49,6 +49,7 @@
 </template>
 <script>
 import myPagination from "@/components/common/myPagination";
+import { mapGetters, mapActions } from "vuex";
 import { getListForSupplier } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -70,6 +71,9 @@ export default {
       default: 0
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -126,11 +130,11 @@ export default {
       if (!!this.id) {
         let param = {
           data: {
-            projectId: this.$route.query.projId,
+            projectId: this.projectId,
             venderId: this.id
           },
-          ProjId: this.$route.query.projId,
-          secret: this.$route.query.secret,
+          ProjId: this.projectId,
+          secret: this.secret,
         }
         getListForSupplier(param, res => {
           _this.$refs.ruleForm.resetFields()

+ 10 - 6
src/components/business_space/dialogs/list/systemType.vue

@@ -79,6 +79,7 @@
 </template>
 <script>
 import myPagination from "@/components/common/myPagination";
+import { mapGetters, mapActions } from "vuex";
 import { getLib, getAllbusiness, getEqCode, getRelation } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -112,6 +113,9 @@ export default {
       type: [Array]
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -202,8 +206,8 @@ export default {
 
     getData() {
       let param = param = {
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret,
+        ProjId: this.projectId,
+        secret: this.secret,
         data: {
           criteria: {
             type: ["Sy"]
@@ -232,8 +236,8 @@ export default {
     //查询id对应系统
     getRelation(table) {
       getRelation({
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret,
+        ProjId: this.projectId,
+        secret: this.secret,
         criterias: {
           criteria: {
             "to_id": this.infos,
@@ -277,9 +281,9 @@ export default {
       this.iframeSrc =
         process.env.BASE_URL +
         ":8889/#/details?perjectId=" +
-        this.$route.query.projId +
+        this.projectId +
         "&secret=" +
-        this.$route.query.secret +
+        this.secret +
         "&FmId=" +
         infos.id +
         "&type=1&code=" +

+ 6 - 2
src/components/business_space/lib/floorCascader.vue

@@ -15,6 +15,7 @@
 <script>
 
 import { getSpaceFloor } from '@/api/request'
+import { mapGetters, mapActions } from "vuex";
 
 export default {
   props: {
@@ -27,13 +28,16 @@ export default {
       default: "yes"
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       options: [
       ],
       param: {
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       },
       value: ['all']
     };

+ 6 - 2
src/components/data_admin/buildFamily.vue

@@ -76,6 +76,7 @@
 
 <script>
 import buildInput from "@/components/input";
+import { mapGetters, mapActions } from "vuex";
 import {
   getAllFamily, //获取所有设备族
   getTableHeader, //点击时后去右侧的数据
@@ -88,6 +89,9 @@ export default {
   components: {
     "build-input": buildInput
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       value: "property",
@@ -112,8 +116,8 @@ export default {
       ajaxMsg: "",
       code: '',
       letterArr: [], //出现的a-z字符
-      UserId: this.$route.query.userId, //用户id
-      ProjId: this.$route.query.projId, //项目id
+      UserId: this.userId, //用户id
+      ProjId: this.projectId, //项目id
       labelKey: [], // 右侧主体数据承接数组
       searchArr: [], // 搜索后的数据
       searchVal: "", //搜索内容

+ 5 - 1
src/components/dialogHanson/addDevice.vue

@@ -16,6 +16,7 @@
 </template>
 <script>
 import { getSpaceHeader } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 import tools from "@/utils/scan/tools";
 import qrcode from "@/components/ledger/lib/qrcode";
 import firm from "@/components/dialogs/list/firm";
@@ -38,6 +39,9 @@ export default {
     guaranteeDialog,
     uploadFilesDialog,
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     let table = function (num) {
       let main = []
@@ -85,7 +89,7 @@ export default {
     getData() {
       getSpaceHeader({
         code: this.deviceType.code,
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {

+ 5 - 1
src/components/dialogs/addDialog/businessDialog.vue

@@ -68,6 +68,7 @@
 import myCascader from "@/components/lib/cascaders/assets";
 import hansonTable from "@/components/dialogHanson/addDevice";
 import { getSpaceHeader } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 import tools from "@/utils/scan/tools";
 import qrcode from "@/components/ledger/lib/qrcode";
 import firm from "@/components/dialogs/list/firm";
@@ -118,6 +119,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       width: "30%",
@@ -216,7 +220,7 @@ export default {
       this.main = table(10)
       getSpaceHeader({
         code: "space",
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {

+ 3 - 6
src/components/dialogs/addDialog/dialogAssets.vue

@@ -97,10 +97,7 @@ import text from "@/utils/handsontable/mainText"
 import showTools from "@/utils/handsontable/notShow"
 
 import uuid from "@/utils/uuid";
-import {
-    mapGetters,
-    mapActions
-} from "vuex";
+import { mapGetters, mapActions } from "vuex";
 import { getTableHeader, createProperty, getSpaceFloor, createAssetsList } from "@/api/scan/request";
 let table = function (num) {
   let main = []
@@ -303,7 +300,7 @@ export default {
       this.main = table(1)
       getTableHeader({
         code: this.deviceType.code,
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {
@@ -367,7 +364,7 @@ export default {
           one.FamilyName = this.deviceType.facility
           one.Infos = item.infos
           one.FmId = "Pe" + uuid(32, 16)
-          one.ProjId = this.$route.query.projId
+          one.ProjId = this.projectId
           one.FmName = item.infos.EquipLocalName || ""
           one.X = 0
           one.Y = 0

+ 3 - 3
src/components/dialogs/addDialog/dialogSystem.vue

@@ -266,7 +266,7 @@ export default {
       this.main = table(1)
       getTableHeader({
         code: this.deviceType.code,
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {
@@ -328,8 +328,8 @@ export default {
     async createJson(data) {
       let param = {
         data: { criterias: data },
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       }
       console.log(param)
       this.createPost(param)

+ 8 - 4
src/components/dialogs/detailsDialog.vue

@@ -54,6 +54,7 @@ Vue.use(DropdownMenu)
 Vue.use(DropdownItem)
 
 import { delManySpace } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 import equipTable from "@/components/table/equipTable";
 import addEquip from "@/components/table/addEquip";
 
@@ -88,6 +89,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       step: 1,
@@ -110,8 +114,8 @@ export default {
       this.$nextTick(() => {
         this.$refs.myEquip.getData(list, this.activeTabType);
       });
-      let perjectId = this.$route.query.projId,
-        secret = this.$route.query.secret;
+      let perjectId = this.projectId,
+        secret = this.secret;
       this.iframeSrc =
         process.env.BASE_URL +
         ":8889/#/details?perjectId=" +
@@ -150,8 +154,8 @@ export default {
       })
         .then(() => {
           let param = {
-            ProjId: this.$route.query.projId,
-            secret: this.$route.query.secret,
+            ProjId: this.projectId,
+            secret: this.secret,
             data: {
               criteria: {
                 ids: [this.list.id]

+ 6 - 2
src/components/dialogs/facilityDialog.vue

@@ -40,6 +40,7 @@ Vue.use(DropdownMenu)
 Vue.use(DropdownItem)
 import equipTable from "@/components/table/equipTable";
 import addEquip from "@/components/table/addEquip";
+import { mapGetters, mapActions } from "vuex";
 
 export default {
   components: {
@@ -72,6 +73,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       step: 1,
@@ -80,8 +84,8 @@ export default {
       activeName: "1",
       myDia: {
         id: 'Sp11010800034c251365d66111e8bf0a15b159c8e729',
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       },
       buildMess: {},
     };

+ 8 - 4
src/components/dialogs/influenceDialog.vue

@@ -23,6 +23,7 @@
 </template>
 <script>
 import { getAllMess, deleteNotice } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 export default {
   props: {
     width: {
@@ -44,6 +45,9 @@ export default {
       default: []
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       data: null,
@@ -70,8 +74,8 @@ export default {
         data: {
           ids: ids
         },
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       };
       deleteNotice(param)
         .then(res => {
@@ -91,8 +95,8 @@ export default {
     },
     getAllMess() {
       getAllMess({
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       })
         .then(res => {
           if (res.data.Result == "success") {

+ 1 - 1
src/components/dialogs/list/guaranteeDialog.vue

@@ -133,7 +133,7 @@ export default {
         data: {
           venderId: this.id,
           insuranceNo: this.formData.name,
-          projectId: this.$route.query.projId,
+          projectId: this.projectId,
           contractFile: this.keysArr[0]
         }
       }

+ 5 - 2
src/components/dialogs/list/insurerDialog.vue

@@ -52,6 +52,7 @@
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
 import { getLib } from "@/api/scan/request"
+import { mapGetters, mapActions } from "vuex";
 import tools from "@/utils/scan/tools"
 
 export default {
@@ -68,6 +69,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -78,8 +82,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 5 - 2
src/components/dialogs/list/maintainerDialog.vue

@@ -51,6 +51,7 @@
 </template>
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
+import { mapGetters, mapActions } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -68,6 +69,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -78,8 +82,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 5 - 1
src/components/dialogs/list/paramDetails.vue

@@ -13,6 +13,7 @@
 <script>
 
 import { getSpaceHeader } from "@/api/scan/request"
+import { mapGetters, mapActions } from "vuex";
 
 export default {
   props: {
@@ -32,6 +33,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       labelArr: []
@@ -42,7 +46,7 @@ export default {
   methods: {
     getData() {
       let param = {
-        ProjId: this.$route.query.projId,
+        ProjId: this.projectId,
         code: this.data.eqFamily
       }
       getSpaceHeader(param).then(res => {

+ 5 - 2
src/components/dialogs/list/supplierDialog.vue

@@ -51,6 +51,7 @@
 </template>
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
+import { mapGetters } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -78,10 +79,12 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   created() {
     // this.getData()
   },

+ 2 - 2
src/components/dialogs/list/systemType.vue

@@ -175,9 +175,9 @@ export default {
       this.iframeSrc =
         process.env.BASE_URL +
         ":8889/#/details?perjectId=" +
-        this.$route.query.projId +
+        this.projectId +
         "&secret=" +
-        this.$route.query.secret +
+        this.secret +
         "&FmId=" +
         infos.id +
         "&type=1&code=" +

+ 6 - 3
src/components/ledger/addDialog/dialogDevice.vue

@@ -158,6 +158,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       width: "30%",
@@ -351,7 +354,7 @@ export default {
       this.main = table(1)
       getTableHeader({
         code: this.deviceType.code,
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {
@@ -448,8 +451,8 @@ export default {
       console.log(param, data)
       let pushParam = {
         data: { criterias: [] },
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       }
       let list = []
       data.map((item, index) => {