瀏覽代碼

merge master

haojianlong 5 年之前
父節點
當前提交
e1bda943f4
共有 2 個文件被更改,包括 34 次插入31 次删除
  1. 5 2
      src/api/scan/httpUtil.js
  2. 29 29
      src/api/scan/request.js

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

@@ -1,5 +1,8 @@
 import { Message } from 'element-ui';
 import fetch from './fetch'
+import storage from '@/framework/utils/storage'
+
+let ProjectId = storage.get("global_project_selected")
 
 function successResponse(vm, response, success, failed) {
     let resp = response.data;
@@ -33,7 +36,7 @@ function errorResponse(vm, response, err) {
 export default {
     getJson: function(url, data, success, failed, err) {
         let vm = this;
-        fetch({ url: url, method: 'get', params: data }).then((response) => {
+        fetch({ url: url, method: 'get', params: data, headers: {'ProjectId': ProjectId}}).then((response) => {
             successResponse(vm, response, success, failed)
         }).catch(error => {
             errorResponse(vm, error, err);
@@ -41,7 +44,7 @@ export default {
     },
     postJson: function(url, data, success, failed, err) {
         let vm = this;
-        fetch({ url: url, method: 'post', data: data }).then((response) => {
+        fetch({ url: url, method: 'post', data: data, headers: {'ProjectId': ProjectId} }).then((response) => {
             successResponse(vm, response, success, failed)
         }).catch(error => {
             errorResponse(vm, error, err);

+ 29 - 29
src/api/scan/request.js

@@ -913,105 +913,105 @@ export function createPropertyData(param) {
 
 //动态数据关联-冲突选择确认
 export function dynamicClashConfirm(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/clashconfirm?projectId=${param.projectId}`;
+    let url = `${baseUrl}/pointconfig/dynamic/clashconfirm`;
     let data = param.data;
     http.postJson(url, data, success)
 }
 
 //动态数据关联-查询数据源列表(P1&2)
 export function dynamicDataSource(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/datasource-list?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/datasource-list`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-查询设备类型列表(P1&2)
 export function dynamicDynEquipList(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/equipmenttype-list?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/equipmenttype-list`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-执行对应结果
 export function dynamicExecute(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/execute?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/execute`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-位置下拉列表(P2)
 export function dynamicLocationList(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/location-list?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/location-list`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-查询位置标签列表
 export function dynamicLocFlagList(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/locationflag-list?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/locationflag-list`;
+    let data = param;
     http.postJson(url, data, success)
 }
 
 //动态数据关联-提示信息
 export function dynamicPromptmessage(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/promptmessage?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/promptmessage`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-提示冲突
 export function dynamicPromptobjs(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/promptobjs?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/promptobjs`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-查询对应关系(P1)
 export function dynamicQuery(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/query?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/query`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-待关联实例(P2)
 export function dynamicPendingobjs(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/query-pending-objs?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/query-pending-objs`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-待关联点位(P2)
 export function dynamicPendingPoint(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/query-pending-point?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/query-pending-point`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-查点位
 export function dynamicQueryPoint(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/query-point?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/query-point`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-创建关联
 export function dynamicCreateRelation(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/relation-create?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/relation-create`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-清除关联
 export function dynamicDeleteRelation(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/relation-delete?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/relation-delete`;
+    let data = param;
     http.postJson(url, data, success);
 }
 
 //动态数据关联-查询对象类列表(P1&2)
 export function dynamicPointTypeList(param, success) {
-    let url = `${baseUrl}/pointconfig/dynamic/type-list?projectId=${param.projectId}`;
-    let data = param.data;
+    let url = `${baseUrl}/pointconfig/dynamic/type-list`;
+    let data = param;
     http.postJson(url, data, success)
 }