|
@@ -1,16 +1,18 @@
|
|
|
-import $http from '@/common/request.js';
|
|
|
-import config from '@/config';
|
|
|
-import store from '@/store/index.js';
|
|
|
+import $http from '@/common/request.js'
|
|
|
+import config from '@/config'
|
|
|
+import store from '@/store/index.js'
|
|
|
|
|
|
function storeUser() {
|
|
|
- return store.state.user.userInfo;
|
|
|
+ return {
|
|
|
+ tag: '20247ac1b24e82760a733485969ef7ee',
|
|
|
+ userId: '9a1ecfbacb6b4f249bf2dd3ec7793ead',
|
|
|
+ phone: '17611228068',
|
|
|
+ userName: '安小霞'
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function getProjectId() {
|
|
|
- return (
|
|
|
- store.state.company.companyConfig &&
|
|
|
- store.state.company.companyConfig.sagacareProjectId
|
|
|
- );
|
|
|
+ return 'Pj1101080259'
|
|
|
}
|
|
|
|
|
|
function commonParams() {
|
|
@@ -18,7 +20,7 @@ function commonParams() {
|
|
|
config.brsgServer.pubname
|
|
|
}&projectId=${getProjectId()}&userName=${storeUser().userName}&userPhone=${
|
|
|
storeUser().phone
|
|
|
- }&userId=${storeUser().userId}`;
|
|
|
+ }&userId=${storeUser().userId}`
|
|
|
}
|
|
|
|
|
|
// 获取地暖
|
|
@@ -29,7 +31,7 @@ function querySapceFloorHeating(params) {
|
|
|
url: `/duoduo-service/duoduoenv-service/ctrl/querySapceFloorHeating?${commonParams()}&spaceId=${params.spaceId}`,
|
|
|
errorSave: true,
|
|
|
method: 'get'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 设置设备
|
|
@@ -41,7 +43,7 @@ function setEquipeHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 获取设备
|
|
@@ -53,7 +55,7 @@ function getObjectDataEqpGroupHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify({ ...params })
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 改变场景
|
|
@@ -65,7 +67,7 @@ function switchoverSceneHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify({ ...params, projectId: getProjectId() })
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 获得空间当前会议室场景
|
|
|
function getMeetingSceneHttp(params) {
|
|
@@ -77,7 +79,7 @@ function getMeetingSceneHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'get'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 获得空间场景
|
|
|
function querySpaceSceneConfigHttp(params) {
|
|
@@ -89,7 +91,7 @@ function querySpaceSceneConfigHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'get'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 设备
|
|
@@ -102,7 +104,7 @@ function getEquipmentListHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'POST'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// set 设备
|
|
|
function setEquipmentHttp(params) {
|
|
@@ -113,7 +115,7 @@ function setEquipmentHttp(params) {
|
|
|
errorSave: true,
|
|
|
method: 'POST',
|
|
|
data: JSON.stringify({ ...params, projectId: getProjectId() })
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 详情页 面积图
|
|
@@ -126,7 +128,7 @@ function getChartListHTTP(params) {
|
|
|
params.spaceId
|
|
|
}&funcid=${params.funcid}`,
|
|
|
method: 'get'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 办公空间
|
|
|
function getSpaceAdjustList(params) {
|
|
@@ -141,7 +143,7 @@ function getSpaceAdjustList(params) {
|
|
|
...params,
|
|
|
criteria: { ...params.criteria, projectId: getProjectId() }
|
|
|
})
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 温度上下限
|
|
@@ -152,7 +154,7 @@ function getTempRangeHttp() {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'get'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 天气预报
|
|
@@ -163,7 +165,7 @@ function getWeather() {
|
|
|
url: `/duoduo-service/object-service/weather/getCurrentWeather?${commonParams()}`,
|
|
|
errorSave: true,
|
|
|
method: 'get'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 空调 - 调节文案/空调信息
|
|
|
function getFeedbackDocumentsHttp(params) {
|
|
@@ -174,7 +176,7 @@ function getFeedbackDocumentsHttp(params) {
|
|
|
errorSave: true,
|
|
|
method: 'POST',
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 空调 调节
|
|
@@ -186,7 +188,7 @@ function changeTempHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify({ ...params, projectId: getProjectId() })
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 手动控制 下发指令
|
|
@@ -198,7 +200,7 @@ function changeManualTempHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 查询空间空调信息
|
|
@@ -212,7 +214,7 @@ function querySpaceConditioners(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'GET'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// // 空调 调节
|
|
@@ -236,12 +238,12 @@ function getSetTimeHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'GET'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 更改 定制时间
|
|
|
function changeSetTimeHttp(params) {
|
|
|
- params = { ...params, projectId: getProjectId() };
|
|
|
+ params = { ...params, projectId: getProjectId() }
|
|
|
return $http({
|
|
|
serverSp: config.brsgServer.duoduoUrl,
|
|
|
url: `/server/customScene/create?${commonParams()}`,
|
|
@@ -249,7 +251,7 @@ function changeSetTimeHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 灯的状态
|
|
@@ -262,7 +264,7 @@ function getLampHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'GET'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 批量 开关灯
|
|
@@ -274,7 +276,7 @@ function setallLampHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 全部关闭 关灯 走廊的灯 晚关
|
|
@@ -286,7 +288,7 @@ function specialLightSetHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 开关失败时 定时查询灯状态
|
|
|
function getStatusHttp(params) {
|
|
@@ -297,7 +299,7 @@ function getStatusHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 插座-列表
|
|
|
function getSocketHttp(params) {
|
|
@@ -309,7 +311,7 @@ function getSocketHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'GET'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 插座-控制
|
|
|
function setSocketHttp(params) {
|
|
@@ -320,7 +322,7 @@ function setSocketHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 查询是否是过渡季
|
|
|
function getSeasonType(params) {
|
|
@@ -330,7 +332,7 @@ function getSeasonType(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'GET'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 查询所有空间设备
|
|
|
function queryEquipStatistics(params) {
|
|
@@ -340,7 +342,7 @@ function queryEquipStatistics(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
method: 'GET'
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 批量空调 调节
|
|
|
function changeAllAirHttp(params) {
|
|
@@ -352,50 +354,50 @@ function changeAllAirHttp(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 批量取消和申请加班
|
|
|
function saveBatchCustomScene(params) {
|
|
|
- let paramsArr = JSON.parse(JSON.stringify(params.historyBookList));
|
|
|
+ let paramsArr = JSON.parse(JSON.stringify(params.historyBookList))
|
|
|
paramsArr.find((item) => {
|
|
|
- item.customSceneEqType = 'ALL';
|
|
|
- if (!item.sceneEquipList) item.sceneEquipList = [];
|
|
|
- });
|
|
|
+ item.customSceneEqType = 'ALL'
|
|
|
+ if (!item.sceneEquipList) item.sceneEquipList = []
|
|
|
+ })
|
|
|
if (params.type !== 'workOff' && params.type !== 'delete') {
|
|
|
if (
|
|
|
params.newBooklist &&
|
|
|
params.newBooklist.startTime &&
|
|
|
params.newBooklist.startTime !== ''
|
|
|
) {
|
|
|
- params.newBooklist.projectId = getProjectId();
|
|
|
- params.newBooklist.sourceType = config.brsgServer.pubname;
|
|
|
- params.newBooklist.userId = storeUser().userId;
|
|
|
- params.newBooklist.userPhone = storeUser().phone;
|
|
|
- params.newBooklist.userName = storeUser().userName;
|
|
|
+ params.newBooklist.projectId = getProjectId()
|
|
|
+ params.newBooklist.sourceType = config.brsgServer.pubname
|
|
|
+ params.newBooklist.userId = storeUser().userId
|
|
|
+ params.newBooklist.userPhone = storeUser().phone
|
|
|
+ params.newBooklist.userName = storeUser().userName
|
|
|
}
|
|
|
if (paramsArr.length > 0) {
|
|
|
paramsArr.find((item) => {
|
|
|
- item.startDate = item.startDate.replace(/-/g, '');
|
|
|
- item.endDate = item.startDate;
|
|
|
- });
|
|
|
+ item.startDate = item.startDate.replace(/-/g, '')
|
|
|
+ item.endDate = item.startDate
|
|
|
+ })
|
|
|
}
|
|
|
- params.newBooklist && paramsArr.push(params.newBooklist);
|
|
|
+ params.newBooklist && paramsArr.push(params.newBooklist)
|
|
|
}
|
|
|
if (params.type === 'delete') {
|
|
|
paramsArr.find((item) => {
|
|
|
- item.startDate = item.startDate.replace(/-/g, '');
|
|
|
- item.endDate = item.startDate;
|
|
|
- item.customSceneEqType = 'ALL';
|
|
|
- item.projectId = getProjectId();
|
|
|
- item.sourceType = config.brsgServer.pubname;
|
|
|
- item.userId = storeUser().userId;
|
|
|
- item.userPhone = storeUser().phone;
|
|
|
- item.userName = storeUser().userName;
|
|
|
- });
|
|
|
+ item.startDate = item.startDate.replace(/-/g, '')
|
|
|
+ item.endDate = item.startDate
|
|
|
+ item.customSceneEqType = 'ALL'
|
|
|
+ item.projectId = getProjectId()
|
|
|
+ item.sourceType = config.brsgServer.pubname
|
|
|
+ item.userId = storeUser().userId
|
|
|
+ item.userPhone = storeUser().phone
|
|
|
+ item.userName = storeUser().userName
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
- console.log(paramsArr, 'paramsArrparamsArr');
|
|
|
+ console.log(paramsArr, 'paramsArrparamsArr')
|
|
|
return $http({
|
|
|
serverSp: config.brsgServer.duoduoUrl,
|
|
|
url: `/server/customScene/saveBatchCustomScene?${commonParams()}`,
|
|
@@ -403,7 +405,7 @@ function saveBatchCustomScene(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(paramsArr)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 查询加班记录
|
|
|
function queryCustomAndScence(params) {
|
|
@@ -415,7 +417,7 @@ function queryCustomAndScence(params) {
|
|
|
method: 'GET',
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
function changeDefaultSpace(params) {
|
|
@@ -424,7 +426,7 @@ function changeDefaultSpace(params) {
|
|
|
method: 'POST',
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 设备运行配置
|
|
|
function queryEquipmentRunConfig(params) {
|
|
@@ -434,7 +436,7 @@ function queryEquipmentRunConfig(params) {
|
|
|
method: 'GET',
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// ---权限控制---
|
|
@@ -446,7 +448,7 @@ function queryProjectConfig() {
|
|
|
method: 'GET',
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 空间控制权限
|
|
|
function queryUserControlInfo() {
|
|
@@ -456,7 +458,7 @@ function queryUserControlInfo() {
|
|
|
method: 'GET',
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
// 会议室控制权限
|
|
|
function querySpaceMeetingInfo(params) {
|
|
@@ -467,7 +469,7 @@ function querySpaceMeetingInfo(params) {
|
|
|
isNotShowErrorToast: true,
|
|
|
errorSave: true,
|
|
|
data: JSON.stringify(params)
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
export {
|
|
@@ -505,4 +507,4 @@ export {
|
|
|
querySpaceConditioners,
|
|
|
changeManualTempHttp,
|
|
|
changeDefaultSpace
|
|
|
-};
|
|
|
+}
|