Browse Source

'接口替换及代码梳理'

zhangyu 4 years ago
parent
commit
2002a04af2

+ 2 - 1
src/api/scan/httpUtil.js

@@ -47,7 +47,8 @@ function downFile(blob, fileName) {
 }
 export default {
   getJson: function(url, data, success, failed, err) {
-    let ProjectId = localStorage.getItem("projectId")
+    // let ProjectId = localStorage.getItem("projectId")
+    let ProjectId = "Pj1101050029"
     let userName = storage.get("user_name")
     let vm = this;
     fetch({ url: url, method: 'get', params: data, headers: {'ProjectId': ProjectId, 'Comming': 'adm' ,'Account': userName}}).then((response) => {

+ 14 - 17
src/components/ledger/handsontables/device.vue

@@ -138,13 +138,13 @@
   import {
     BeatchQueryParam,
     deleteEquip,
-    getDataDictionary,
     getEquipBelongs,
     getEquipTableCon,
-    queryEquip,
     queryUpdate,
     updateEquip,
   } from '@/api/scan/request'
+  import { queryEquip } from '@/api/object/equip'
+  import { getDataDictionary } from '@/api/dict'
 
   import tools from '@/utils/scan/tools'
   import handsonUtils from '@/utils/hasontableUtils'
@@ -380,19 +380,14 @@
             this.changeCader()
             if (this.mess.deviceId) {
                 let params = {
-                    data: {
-                        Orders: 'sort asc, InfoPointName desc',
-                        PageNumber: 1,
-                        PageSize: 1000,
-                    },
-                    type: this.mess.deviceId,
+                    type: this.mess.deviceId
                 }
                 getDataDictionary(params, (res) => {
-                  this.tableHeader = res.Content
+                  this.tableHeader = res.content
                   console.log(this.tableHeader)
                   this.tableHeader.forEach((item) => {
-                    if (item.Path) {
-                      this.inputMap[item.Path] = item
+                    if (item.path) {
+                      this.inputMap[item.path] = item
                     }
                   })
                   this.getTableData()
@@ -414,12 +409,12 @@
       getTableData() {
         this.loading = true
         //type存在发送请求
-        if (!!this.mess.deviceId) {
+        if (this.mess.deviceId) {
           let param = {
-            PageSize: this.page.size,
-            Orders: 'createTime desc,EquipID desc,EquipLocalID desc,EquipLocalName desc',
-            PageNumber: this.page.currentPage,
-            Filters: `category='${this.mess.deviceId}'`,
+            pageSize: this.page.size,
+            orders: 'createTime desc,id desc,localId desc,localName desc',
+            pageNumber: this.page.currentPage,
+            filters: `classCode='${this.mess.deviceId}'`,
           }
 
           if (this.mess.buildId == 'noKnow') {
@@ -433,7 +428,9 @@
           } else if (this.mess.floorId && this.mess.floorId != 'all') {
             param.Filters += `;floorId='${this.mess.floorId}'`
           }
-          getEquipTableCon(param, (res) => {
+        //   getEquipTableCon(param, (res) => {
+          queryEquip(param, (res) => {
+              debugger
             this.loading = false
             this.showParts = res.Message == '1' ? true : false // 判断是否显示包含的部件列
             this.tableData = res.Content.map((item) => {

+ 16 - 13
src/components/ledger/lib/linkassets.vue

@@ -31,7 +31,10 @@
 </template>
 <script>
 
-import { floorQuery, buildingQuery, queryDictionaryHead, zoneQuery, TypePartsDie } from '@/api/scan/request'
+import { zoneQuery, TypePartsDie } from '@/api/scan/request'
+import { queryPhysicsAllType } from '@/api/dict'
+import { buildingQuery } from '@/api/object/build'
+import { floorQuery } from '@/api/object/floor'
 
 import { mapGetters } from "vuex"
 export default {
@@ -116,7 +119,7 @@ export default {
         })
       })
       Promise.all([promise1, promise2]).then(values => {
-        let builData = values[0].Content, floorData = values[1].Content
+        let builData = values[0].content, floorData = values[1].content
         data = builData.map(build => {
           return {
             value: build.id,
@@ -162,24 +165,24 @@ export default {
     //获取空间分区数据
     getSpaceData() {
       let params = {
-        Filters: "parentId = 'Space'",
-        PageNumber: 1,
-        PageSize: 1000,
-        Projection: ["Code", "Name"]
+        type: "space"
       }
-      queryDictionaryHead(params, res => {
-        this.zoneList = res.Content.filter(item => {
-          if (item.Code != 'Ispace') {
+      queryPhysicsAllType(params, res => {
+        this.zoneList = res.content.filter(item => {
+          if (item.name !== item.aliasName) {
+            item.name = `${item.name}(${item.aliasName})`
+          }
+          if (item.code != 'Ispace') {
             return item
           }
         })
         this.zoneList.unshift({
-          Name: '全部',
-          Code: 'all'
+          name: '全部',
+          code: 'all'
         })
         this.zoneList.push({
-          Name: '不在任何业务空间内',
-          Code: 'noKnow'
+          name: '不在任何业务空间内',
+          code: 'noKnow'
         })
       })
     },