|
@@ -2,7 +2,7 @@
|
|
|
<div class="work-content">
|
|
|
<div class="work-space">
|
|
|
<div class="space-title">{{ spaceInfo.spaceName }} 申请延时</div>
|
|
|
- <div class="device-tip">延时期间,空间相关设备会开启</div>
|
|
|
+ <div class="tip">延时期间,空间相关设备会开启</div>
|
|
|
</div>
|
|
|
<div class="add-time" id="addTimeId">
|
|
|
<div class="date_box" v-if="dateArr && dateArr.length">
|
|
@@ -53,18 +53,66 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--预约的设备 start-->
|
|
|
- <div class="device-box">
|
|
|
- <div class="device-title">
|
|
|
- <span></span>
|
|
|
- <span></span>
|
|
|
- <span></span>
|
|
|
- </div>
|
|
|
+ <div class="device-title">
|
|
|
+ <span class="line"></span>
|
|
|
+ <span class="text">预约开启设备</span>
|
|
|
+ <span class="line"></span>
|
|
|
+ </div>
|
|
|
+ <div class="work-device">
|
|
|
+ <div class="row-title">空调</div>
|
|
|
+ <template
|
|
|
+ v-for="(item, index) in nowData.equipmentList"
|
|
|
+ :key="'eq' + index"
|
|
|
+ >
|
|
|
+ <div class="device-box" v-if="item.equipmentCategory !== 'SELTLT'">
|
|
|
+ <div class="device-row" @click="checkEquipment(item)">
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
+ <img
|
|
|
+ :src="
|
|
|
+ item.isCheck
|
|
|
+ ? parseImgUrl('ipdImages', 'check-open.svg')
|
|
|
+ : parseImgUrl('ipdImages', 'check-close.svg')
|
|
|
+ "
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="row-title">灯</div>
|
|
|
+ <template
|
|
|
+ v-for="(item, index) in nowData.equipmentList"
|
|
|
+ :key="'eq' + index"
|
|
|
+ >
|
|
|
+ <div class="device-box" v-if="item.equipmentCategory === 'SELTLT'">
|
|
|
+ <div class="device-row" @click="checkEquipment(item)">
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
+ <img
|
|
|
+ :src="
|
|
|
+ item.isCheck
|
|
|
+ ? parseImgUrl('ipdImages', 'check-open.svg')
|
|
|
+ : parseImgUrl('ipdImages', 'check-close.svg')
|
|
|
+ "
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
<div class="device-tip">
|
|
|
- *空调延时采用后付费方式,系统将根据您申请的时间产生延时费用。预约时间下您可自由开启空间下的设备。
|
|
|
- 收费标准按开机设备对应空间的面积计费,空调加时费用按50元/m2·h进行计费,照明设备延时使用不计费。
|
|
|
- 如您提前结束工作,请点击“我要离开”按钮,系统会自动调整设备关闭时间,感谢与您一同共创可持续的办公环境。
|
|
|
+ <span>计费方式:</span>
|
|
|
+ <p>
|
|
|
+ <span> * </span>
|
|
|
+ 空调延时采用后付费方式,系统将根据您申请的时间产生延时费用。预约时间下您可自由开启空间下的设备。
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ 收费标准按开机设备对应空间的面积计费,空调加时费用按50元/m2·h进行计费,照明设备延时使用不计费。
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ 如您提前结束工作,请点击“我要离开”按钮,系统会自动调整设备关闭时间,感谢与您一同共创可持续的办公环境。
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<van-loading class="temp-loading" v-if="showLoading" />
|
|
|
</div>
|
|
|
</template>
|
|
@@ -99,6 +147,7 @@ import { myTime } from "@/model/workTimeData";
|
|
|
import { propsToAttrMap } from "@vue/shared";
|
|
|
import { isTemplateElement } from "@babel/types";
|
|
|
import { saveBatchCustomScene } from "@/apis/envmonitor";
|
|
|
+import { number } from "echarts";
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: {
|
|
@@ -117,6 +166,10 @@ export default defineComponent({
|
|
|
type: Object,
|
|
|
default: () => {},
|
|
|
},
|
|
|
+ enterType: {
|
|
|
+ type: Number,
|
|
|
+ default: () => 1,
|
|
|
+ },
|
|
|
},
|
|
|
setup(props, context) {
|
|
|
const proxyGlobal: any = getCurrentInstance();
|
|
@@ -134,6 +187,7 @@ export default defineComponent({
|
|
|
const userInfo: any = getUserInfo();
|
|
|
const proxyData = reactive({
|
|
|
userInfo: userInfo,
|
|
|
+ parseImgUrl: parseImgUrl,
|
|
|
isEvent: false,
|
|
|
screenInfo: screenInfo,
|
|
|
projectId: props.projectId,
|
|
@@ -147,6 +201,7 @@ export default defineComponent({
|
|
|
startLen: 0,
|
|
|
formBtn: false,
|
|
|
showLoading: false,
|
|
|
+ enterType: props.enterType, // 1:all 2:空调 3:灯
|
|
|
setScreennWidth() {
|
|
|
let addTimeEl: any = document.querySelector("#addTimeId");
|
|
|
proxyData.screenInfo.screenWidth = addTimeEl.offsetWidth;
|
|
@@ -168,7 +223,7 @@ export default defineComponent({
|
|
|
}
|
|
|
return nowIndex;
|
|
|
},
|
|
|
- // 获取当前位置的坐标
|
|
|
+ // 获取当前位置的坐标(多端服务定制的判断规则-待开发)
|
|
|
getNowPerstion(timerArr: any) {
|
|
|
let nowIndex: any = proxyData.getNowIndex();
|
|
|
let obj: any = {
|
|
@@ -182,6 +237,10 @@ export default defineComponent({
|
|
|
let cusEndTime: any = proxyData.parseCusEndTime(
|
|
|
proxyData.nowData.cusEndTime
|
|
|
);
|
|
|
+
|
|
|
+ let spaceCustomContentList: any =
|
|
|
+ proxyData.nowData.spaceCustomContentList || [];
|
|
|
+
|
|
|
if (formatTimer >= cusStartTime && formatTimer <= cusEndTime) {
|
|
|
//在服务定制时间之间
|
|
|
timerArr.map((item: any, index: any) => {
|
|
@@ -189,6 +248,7 @@ export default defineComponent({
|
|
|
obj.nowIndex = index;
|
|
|
}
|
|
|
});
|
|
|
+ spaceCustomContentList.map((item: any) => {});
|
|
|
} else if (formatTimer < cusStartTime) {
|
|
|
timerArr.map((item: any, index: any) => {
|
|
|
if (item.formatTimer === cusStartTime) {
|
|
@@ -201,8 +261,8 @@ export default defineComponent({
|
|
|
}
|
|
|
return obj;
|
|
|
},
|
|
|
- // 设置可选时间
|
|
|
- setOptionnalTime(timerArr: any) {
|
|
|
+ // 设置当前可选择的时间可选时间
|
|
|
+ setNowBarPerstion(timerArr: any) {
|
|
|
let sliderList: any = document.querySelector("#sliderListId");
|
|
|
let slidersWrapper: any = document.querySelector("#slidersWrapperId");
|
|
|
let sliderWidth: any = slidersWrapper.getBoundingClientRect().width;
|
|
@@ -595,22 +655,26 @@ export default defineComponent({
|
|
|
proxyData.formBtn = false;
|
|
|
let nowIndex: any = proxyData.getNowIndex();
|
|
|
if (proxyData.nowData.week === "今天" && index < nowIndex) {
|
|
|
- // 过去的时间不可选择
|
|
|
- // 过去的时间不可选择
|
|
|
return;
|
|
|
}
|
|
|
- if (proxyData.nowData.cusStartTime && proxyData.nowData.cusEndTime) {
|
|
|
- let formatTimer: any = proxyData.nowTimerArr[index].formatTimer; //在服务定制时间之间
|
|
|
- let cusStartTime: any = proxyData.parseCusStartTime(
|
|
|
- proxyData.nowData.cusStartTime
|
|
|
- );
|
|
|
- let cusEndTime: any = proxyData.parseCusEndTime(
|
|
|
- proxyData.nowData.cusEndTime
|
|
|
+
|
|
|
+ let spaceCustomContentList: any =
|
|
|
+ proxyData.nowData.spaceCustomContentList || [];
|
|
|
+ let formatTimer: any = proxyData.nowTimerArr[index].formatTimer; //在服务定制时间之间
|
|
|
+ let flag: any = false;
|
|
|
+ spaceCustomContentList.map((spaceCustom: any) => {
|
|
|
+ let startTime: any = proxyData.parseCusStartTime(
|
|
|
+ spaceCustom.startTime
|
|
|
);
|
|
|
- if (formatTimer >= cusStartTime && formatTimer < cusEndTime) {
|
|
|
- return;
|
|
|
+ let endTime: any = proxyData.parseCusEndTime(spaceCustom.endTime);
|
|
|
+ if (formatTimer >= startTime && formatTimer < endTime) {
|
|
|
+ flag = true;
|
|
|
}
|
|
|
+ });
|
|
|
+ if (flag) {
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
proxyData.setOptionnalPerstion(index);
|
|
|
},
|
|
|
/**
|
|
@@ -618,21 +682,14 @@ export default defineComponent({
|
|
|
*/
|
|
|
dateArr: dateArr,
|
|
|
myTimeArr: myTimeArr,
|
|
|
- // // 服务定制开始时间转化(处理服务定制时间包含几分钟的问题)
|
|
|
- // parseCusStatTime() {},
|
|
|
- // // 服务定制结束时间转化(处理服务定制时间包含几分钟的问题)
|
|
|
- // parseCusEndTime(time: any) {
|
|
|
- // let newTime: any = "";
|
|
|
- // if (time) {
|
|
|
- // let minute: any = (time / 100) % 100;
|
|
|
- // if (minute < 30) {
|
|
|
-
|
|
|
- // } else if (minute > 30) {
|
|
|
- // } else {
|
|
|
- // newTime = time;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
+ // 格式化设备
|
|
|
+ formateEquipment() {
|
|
|
+ if (proxyData.enterType === 1) {
|
|
|
+ proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
+ item.isCheck = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
setWorkTimeList() {
|
|
|
proxyData.isUpdate = false;
|
|
|
proxyGlobal.proxy.$loadinngEnd();
|
|
@@ -641,6 +698,7 @@ export default defineComponent({
|
|
|
let nowDate: any = formatDate("YYYY-MM-DD");
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
let date: any = formatDateStr(data[i].date);
|
|
|
+
|
|
|
let cusStartTime: any = proxyData.parseCusStartTime(
|
|
|
data[i].cusStartTime
|
|
|
);
|
|
@@ -656,6 +714,7 @@ export default defineComponent({
|
|
|
let obj: any = {
|
|
|
timer: proxyData.timerArr[i],
|
|
|
isCheck: false,
|
|
|
+ isServiceTime: false,
|
|
|
formatTimer: proxyData.timerArr[i].replace(/[:]/g, "") + "00",
|
|
|
};
|
|
|
timerArr.push(obj);
|
|
@@ -695,28 +754,38 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- // 是否在固定区域时间
|
|
|
- if (cusStartTime && cusEndTime) {
|
|
|
- timerArr.map((item: any) => {
|
|
|
- if (
|
|
|
- item.formatTimer >= cusStartTime &&
|
|
|
- item.formatTimer < cusEndTime
|
|
|
- ) {
|
|
|
- item.isServiceTime = true;
|
|
|
- } else {
|
|
|
- item.isServiceTime = false;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
+ let spaceCustomContentList: any =
|
|
|
+ data[i].spaceCustomContentList || [];
|
|
|
+ spaceCustomContentList.map((spaceCustom: any) => {
|
|
|
+ let startTime: any = proxyData.parseCusStartTime(
|
|
|
+ spaceCustom.startTime
|
|
|
+ );
|
|
|
+ let endTime: any = proxyData.parseCusEndTime(spaceCustom.endTime);
|
|
|
+ // 是否在固定区域时间
|
|
|
+ if (startTime && endTime) {
|
|
|
+ // debugger
|
|
|
+ timerArr.map((item: any) => {
|
|
|
+ if (
|
|
|
+ item.formatTimer >= startTime &&
|
|
|
+ item.formatTimer < endTime
|
|
|
+ ) {
|
|
|
+ item.isServiceTime = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
proxyData.dateArr.push({
|
|
|
date: date,
|
|
|
isActive: false,
|
|
|
+ equipmentList: data[i].equipmentList,
|
|
|
oldDate: data[i].date,
|
|
|
objectId: data[i].objectId,
|
|
|
cusStartTime: data[i].cusStartTime,
|
|
|
customSceneList: customSceneList,
|
|
|
cusEndTime: data[i].cusEndTime,
|
|
|
+ spaceCustomContentList: data[i].spaceCustomContentList,
|
|
|
day: getDate(new Date(date)),
|
|
|
week: week,
|
|
|
timerArr: timerArr,
|
|
@@ -752,8 +821,9 @@ export default defineComponent({
|
|
|
proxyData.activeIndex = index;
|
|
|
proxyData.nowTimerArr = proxyData.dateArr[index].timerArr;
|
|
|
proxyData.nowData = proxyData.dateArr[index];
|
|
|
+ proxyData.formateEquipment();
|
|
|
nextTick(() => {
|
|
|
- proxyData.setOptionnalTime(proxyData.nowTimerArr);
|
|
|
+ proxyData.setNowBarPerstion(proxyData.nowTimerArr);
|
|
|
let nowIndex: any = proxyData.getNowIndex();
|
|
|
if (proxyData.nowData.week === "今天") {
|
|
|
proxyData.setPastTime(nowIndex);
|
|
@@ -778,12 +848,6 @@ export default defineComponent({
|
|
|
proxyData.setScreennWidth();
|
|
|
proxyData.sliderSwiper();
|
|
|
proxyData.endBoxSwiper();
|
|
|
- // if (!proxyData.flag) {
|
|
|
- // proxyData.setScreennWidth();
|
|
|
- // proxyData.sliderSwiper();
|
|
|
- // proxyData.endBoxSwiper();
|
|
|
- // proxyData.flag = true;
|
|
|
- // }
|
|
|
},
|
|
|
// 加班数据格式化=》后台需要的数据结构(添加加班逻辑)
|
|
|
formateAddTimer() {
|
|
@@ -888,8 +952,10 @@ export default defineComponent({
|
|
|
},
|
|
|
// 格式化加班单个数据
|
|
|
formaTimeObj(item: any, type: any, startTime: any, endTime: any) {
|
|
|
+ console.log(item);
|
|
|
let obj: any = {
|
|
|
projectId: proxyData.projectId, //类型:String 必有字段 备注:项目id
|
|
|
+ sceneEquipList: item ? item.sceneEquipList : [],
|
|
|
objectId: proxyData.nowData.objectId, //类型:String 必有字段 备注:空间id
|
|
|
sourceType: "sagacareAndtenantslink", //类型:String 必有字段 备注:sagacareAndtenantslink 来源
|
|
|
startDate: proxyData.nowData.oldDate, //类型:String 必有字段 备注://开始日期
|
|
@@ -1034,12 +1100,48 @@ export default defineComponent({
|
|
|
proxyData.formBtn = false;
|
|
|
context.emit("closeWork");
|
|
|
},
|
|
|
+ // 数组去除重复
|
|
|
+ removeDuplicateObj(arr: any) {
|
|
|
+ let obj = {};
|
|
|
+ arr = arr.reduce((newArr: any, next: any) => {
|
|
|
+ obj[next.objectId]
|
|
|
+ ? ""
|
|
|
+ : (obj[next.objectId] = true && newArr.push(next));
|
|
|
+ return newArr;
|
|
|
+ }, []);
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
+ checkEquipment(item: any) {
|
|
|
+ item.isCheck = !item.isCheck;
|
|
|
+ },
|
|
|
// 提交申请
|
|
|
addWorkTimer() {
|
|
|
let formTimerArr: any = proxyData.formateAddTimer();
|
|
|
- proxyData.saveBatchCustomScene(formTimerArr);
|
|
|
- // console.log("提交申请-----");
|
|
|
- // console.log(formTimerArr);
|
|
|
+ let sceneEquipList: any = [];
|
|
|
+ proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
+ if (item.isCheck) {
|
|
|
+ let obj: any = {
|
|
|
+ projectId: item.projectId, //类型:String 必有字段 备注:无
|
|
|
+ objectId: item.id, //类型:String 必有字段 备注:设备id
|
|
|
+ type: item.equipmentCategory,
|
|
|
+ };
|
|
|
+ sceneEquipList.push(obj);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ formTimerArr.map((item: any) => {
|
|
|
+ if (item.type == "1") {
|
|
|
+ sceneEquipList.push(item.sceneEquipList);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
|
|
|
+ formTimerArr.map((item: any) => {
|
|
|
+ if (item.type == "0" || item.type == "2") {
|
|
|
+ item.sceneEquipList = sceneEquipList;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log("提交申请-----");
|
|
|
+ console.log(formTimerArr);
|
|
|
+ // proxyData.saveBatchCustomScene(formTimerArr);
|
|
|
},
|
|
|
// 提交加班记录
|
|
|
saveBatchCustomScene(formTimerArr: any, type: any = 1) {
|
|
@@ -1057,7 +1159,6 @@ export default defineComponent({
|
|
|
} else if (type === 2) {
|
|
|
// 删除
|
|
|
proxyData.isUpdate = true;
|
|
|
- // proxyData.setWorkTimeList();
|
|
|
}
|
|
|
proxyData.formBtn = false;
|
|
|
})
|
|
@@ -1092,7 +1193,7 @@ export default defineComponent({
|
|
|
if (proxyData.isUpdate) {
|
|
|
proxyData.setWorkTimeList();
|
|
|
}
|
|
|
- // proxyData.getWorkTimeList();
|
|
|
+ proxyData.enterType = newProps.enterType;
|
|
|
});
|
|
|
onMounted(() => {
|
|
|
// 设置dom最外层的宽
|
|
@@ -1110,6 +1211,7 @@ export default defineComponent({
|
|
|
position: relative;
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
background: #fff;
|
|
|
}
|
|
|
.work-space {
|
|
@@ -1124,8 +1226,8 @@ export default defineComponent({
|
|
|
line-height: 31px;
|
|
|
color: #000000;
|
|
|
}
|
|
|
- .device-tip {
|
|
|
- padding-bottom: 36px;
|
|
|
+ .tip {
|
|
|
+ padding-bottom: 20px;
|
|
|
font-family: "Noto Sans SC";
|
|
|
font-style: normal;
|
|
|
font-weight: 400;
|
|
@@ -1146,7 +1248,7 @@ export default defineComponent({
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
width: 100%;
|
|
|
- padding-bottom: 35px;
|
|
|
+ padding-bottom: 15px;
|
|
|
|
|
|
.date-item {
|
|
|
padding-top: 20px;
|
|
@@ -1295,9 +1397,12 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
.add-time-btn {
|
|
|
- margin-top: 10px;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 5px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
display: flex;
|
|
|
- padding-top: 24px;
|
|
|
+ padding-top: 10px;
|
|
|
text-align: center;
|
|
|
|
|
|
.cancel-btn {
|
|
@@ -1331,4 +1436,81 @@ export default defineComponent({
|
|
|
color: #1f2529;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.work-device {
|
|
|
+ // padding-top: 10px;
|
|
|
+ height: 30vh;
|
|
|
+ overflow-y: auto;
|
|
|
+ .device-tip {
|
|
|
+ padding-top: 20px;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+
|
|
|
+ color: #8d9399;
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ }
|
|
|
+ p {
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.device-box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .device-row {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ width: 48%;
|
|
|
+ font-family: "PingFang SC";
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ padding: 10px;
|
|
|
+ color: #1b2129;
|
|
|
+ background: #f7f9fa;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-top: 10px;
|
|
|
+ line-height: 30px;
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.row-title {
|
|
|
+ display: block;
|
|
|
+ padding-top: 20px;
|
|
|
+ padding-bottom: 5px;
|
|
|
+}
|
|
|
+.device-title {
|
|
|
+ padding-top: 20px;
|
|
|
+ text-align: center;
|
|
|
+ // padding-bottom: 10px;
|
|
|
+ .line {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ width: 155px;
|
|
|
+ height: 0px;
|
|
|
+ border: 1px solid #e1e5eb;
|
|
|
+ }
|
|
|
+ .text {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ padding-left: 10px;
|
|
|
+ padding-right: 10px;
|
|
|
+ font-family: "PingFang SC";
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 17px;
|
|
|
+ color: #8d9399;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|