|
@@ -53,7 +53,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--预约的设备 start-->
|
|
|
- <div class="device-title">
|
|
|
+ <div class="device-title" v-if="isLight || isAir">
|
|
|
<span class="line"></span>
|
|
|
<span class="text">预约开启设备</span>
|
|
|
<span class="line"></span>
|
|
@@ -68,6 +68,7 @@
|
|
|
>
|
|
|
<div
|
|
|
class="device-row"
|
|
|
+ :style="{ width: airNum == 1 ? '98%' : '48%' }"
|
|
|
v-if="item.equipmentCategory !== 'SELTLT'"
|
|
|
@click="checkEquipment(item)"
|
|
|
>
|
|
@@ -94,10 +95,11 @@
|
|
|
>
|
|
|
<div
|
|
|
class="device-row"
|
|
|
+ :style="{ width: lightNum == 1 ? '98%' : '48%' }"
|
|
|
v-if="item.equipmentCategory === 'SELTLT'"
|
|
|
@click="checkEquipment(item)"
|
|
|
>
|
|
|
- <span>{{ item.name }}</span>
|
|
|
+ <span>{{ item.localName }}</span>
|
|
|
<img
|
|
|
:src="
|
|
|
item.isCheck
|
|
@@ -111,7 +113,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
- <div class="device-tip">
|
|
|
+ <div class="device-tip" v-if="isLight || isAir">
|
|
|
<span>计费方式:</span>
|
|
|
<p>
|
|
|
<span> * </span>
|
|
@@ -187,6 +189,10 @@ export default defineComponent({
|
|
|
type: Number,
|
|
|
default: () => 1,
|
|
|
},
|
|
|
+ deviceItem: {
|
|
|
+ type: Object,
|
|
|
+ default: () => null,
|
|
|
+ },
|
|
|
},
|
|
|
setup(props, context) {
|
|
|
const proxyGlobal: any = getCurrentInstance();
|
|
@@ -218,6 +224,7 @@ export default defineComponent({
|
|
|
startLen: 0,
|
|
|
formBtn: false,
|
|
|
showLoading: false,
|
|
|
+ deviceItem: props.deviceItem,
|
|
|
enterType: props.enterType, // 1:all 2:空调 3:灯
|
|
|
setScreennWidth() {
|
|
|
let addTimeEl: any = document.querySelector("#addTimeId");
|
|
@@ -734,40 +741,80 @@ export default defineComponent({
|
|
|
myTimeArr: myTimeArr,
|
|
|
isAir: false,
|
|
|
isLight: false,
|
|
|
+ lightNum: 0,
|
|
|
+ airNum: 0,
|
|
|
// 格式化设备
|
|
|
formateEquipment() {
|
|
|
proxyData.isLight = false;
|
|
|
proxyData.isAir = false;
|
|
|
- if (proxyData.enterType === 1) {
|
|
|
- proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
- item.isCheck = true;
|
|
|
- });
|
|
|
- } else if (proxyData.enterType === 2) {
|
|
|
- proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
- if (item.equipmentCategory !== "SELTLT") {
|
|
|
+ proxyData.lightNum = 0;
|
|
|
+ proxyData.airNum = 0;
|
|
|
+ if (
|
|
|
+ proxyData.nowData &&
|
|
|
+ proxyData.nowData.equipmentList &&
|
|
|
+ proxyData.nowData.equipmentList.length
|
|
|
+ ) {
|
|
|
+ if (proxyData.enterType === 1) {
|
|
|
+ proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
item.isCheck = true;
|
|
|
+ });
|
|
|
+ } else if (proxyData.enterType === 2) {
|
|
|
+ // 空调
|
|
|
+ if (proxyData.deviceItem && proxyData.deviceItem.id) {
|
|
|
+ proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
+ if (
|
|
|
+ item.equipmentCategory !== "SELTLT" &&
|
|
|
+ proxyData.deviceItem.id == item.id
|
|
|
+ ) {
|
|
|
+ item.isCheck = true;
|
|
|
+ } else {
|
|
|
+ item.isCheck = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
+ if (item.equipmentCategory !== "SELTLT") {
|
|
|
+ item.isCheck = true;
|
|
|
+ } else {
|
|
|
+ item.isCheck = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 灯
|
|
|
+ if (proxyData.deviceItem && proxyData.deviceItem.id) {
|
|
|
+ proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
+ if (
|
|
|
+ item.equipmentCategory === "SELTLT" &&
|
|
|
+ proxyData.deviceItem.id == item.id
|
|
|
+ ) {
|
|
|
+ item.isCheck = true;
|
|
|
+ } else {
|
|
|
+ item.isCheck = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
- item.isCheck = false;
|
|
|
+ proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
+ if (item.equipmentCategory === "SELTLT") {
|
|
|
+ item.isCheck = true;
|
|
|
+ } else {
|
|
|
+ item.isCheck = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ // 判断是否有空调和灯
|
|
|
proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
+ if (item.equipmentCategory == "SELTLT") {
|
|
|
+ proxyData.isLight = true;
|
|
|
+ proxyData.lightNum++;
|
|
|
+ }
|
|
|
if (item.equipmentCategory !== "SELTLT") {
|
|
|
- item.isCheck = false;
|
|
|
- } else {
|
|
|
- item.isCheck = true;
|
|
|
+ proxyData.isAir = true;
|
|
|
+ proxyData.airNum++;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- // 判断是否有空调和灯
|
|
|
- proxyData.nowData.equipmentList.map((item: any) => {
|
|
|
- if (item.equipmentCategory == "SELTLT") {
|
|
|
- proxyData.isLight = true;
|
|
|
- }
|
|
|
- if (item.equipmentCategory !== "SELTLT") {
|
|
|
- proxyData.isAir = true;
|
|
|
- }
|
|
|
- });
|
|
|
},
|
|
|
// 加班时间是否在所有的服务定制时间之前
|
|
|
isCusTimeBefore(spaceCustomContentList: any, time: any) {
|
|
@@ -869,13 +916,13 @@ export default defineComponent({
|
|
|
proxyData.dateArr.push({
|
|
|
date: date,
|
|
|
isActive: false,
|
|
|
- equipmentList: data[i].equipmentList,
|
|
|
+ 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,
|
|
|
+ spaceCustomContentList: data[i].spaceCustomContentList || [],
|
|
|
day: getDate(new Date(date)),
|
|
|
week: week,
|
|
|
timerArr: timerArr,
|
|
@@ -1046,7 +1093,8 @@ export default defineComponent({
|
|
|
console.log(item);
|
|
|
let obj: any = {
|
|
|
projectId: proxyData.projectId, //类型:String 必有字段 备注:项目id
|
|
|
- sceneEquipList: item ? item.sceneEquipList : [],
|
|
|
+ sceneEquipList:
|
|
|
+ item && item.sceneEquipList ? item.sceneEquipList : [],
|
|
|
objectId: proxyData.nowData.objectId, //类型:String 必有字段 备注:空间id
|
|
|
sourceType: "sagacareAndtenantslink", //类型:String 必有字段 备注:sagacareAndtenantslink 来源
|
|
|
startDate: proxyData.nowData.oldDate, //类型:String 必有字段 备注://开始日期
|
|
@@ -1227,14 +1275,16 @@ export default defineComponent({
|
|
|
} else {
|
|
|
formTimerArr.map((item: any) => {
|
|
|
if (item.type == "1") {
|
|
|
- item.sceneEquipList.map((scene: any) => {
|
|
|
- let obj: any = {
|
|
|
- projectId: scene.projectId, //类型:String 必有字段 备注:无
|
|
|
- objectId: scene.objectId, //类型:String 必有字段 备注:设备id
|
|
|
- type: scene.type,
|
|
|
- };
|
|
|
- sceneEquipList.push(obj);
|
|
|
- });
|
|
|
+ if (item.sceneEquipList && item.sceneEquipList.length) {
|
|
|
+ item.sceneEquipList.map((scene: any) => {
|
|
|
+ let obj: any = {
|
|
|
+ projectId: scene.projectId, //类型:String 必有字段 备注:无
|
|
|
+ objectId: scene.objectId, //类型:String 必有字段 备注:设备id
|
|
|
+ type: scene.type,
|
|
|
+ };
|
|
|
+ sceneEquipList.push(obj);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -1304,13 +1354,14 @@ export default defineComponent({
|
|
|
// debugger;
|
|
|
if (type === 1) {
|
|
|
// 添加
|
|
|
- context.emit("closeWork");
|
|
|
- // proxyGlobal.proxy.$loadinngEnd();
|
|
|
- proxyData.showLoading = false;
|
|
|
} else if (type === 2) {
|
|
|
// 删除
|
|
|
proxyData.isUpdate = true;
|
|
|
+ // context.emit("closeWork");
|
|
|
+ // proxyData.showLoading = false;
|
|
|
}
|
|
|
+ context.emit("closeWork");
|
|
|
+ proxyData.showLoading = false;
|
|
|
proxyData.formBtn = false;
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -1322,35 +1373,40 @@ export default defineComponent({
|
|
|
isUpdate: false, // 删除更新弹窗数据
|
|
|
triggerDelTime() {
|
|
|
let formTimeArr: any = proxyData.formateDelTimer();
|
|
|
+ console.log("需要删除的数据---");
|
|
|
+ console.log(formTimeArr);
|
|
|
if (formTimeArr && formTimeArr.length) {
|
|
|
// console.log(formTimeArr);
|
|
|
// alert("确定删除当前时间吗?");
|
|
|
+ // debugger;
|
|
|
Dialog.confirm({
|
|
|
title: "确认",
|
|
|
message: "确定删除当前时间吗?",
|
|
|
})
|
|
|
.then(() => {
|
|
|
- console.log("====");
|
|
|
- console.log(formTimeArr);
|
|
|
let sceneEquipList: any = [];
|
|
|
formTimeArr.map((item: any) => {
|
|
|
if (item.type == "1") {
|
|
|
- item.sceneEquipList.map((scene: any) => {
|
|
|
- let obj: any = {
|
|
|
- projectId: scene.projectId, //类型:String 必有字段 备注:无
|
|
|
- objectId: scene.objectId, //类型:String 必有字段 备注:设备id
|
|
|
- type: scene.type,
|
|
|
- };
|
|
|
- sceneEquipList.push(obj);
|
|
|
- });
|
|
|
+ if (item.sceneEquipList) {
|
|
|
+ item.sceneEquipList.map((scene: any) => {
|
|
|
+ let obj: any = {
|
|
|
+ projectId: scene.projectId, //类型:String 必有字段 备注:无
|
|
|
+ objectId: scene.objectId, //类型:String 必有字段 备注:设备id
|
|
|
+ type: scene.type,
|
|
|
+ };
|
|
|
+ sceneEquipList.push(obj);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
|
|
|
+
|
|
|
formTimeArr.map((item: any) => {
|
|
|
if (item.type !== "1") {
|
|
|
item.sceneEquipList = sceneEquipList;
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
proxyData.saveBatchCustomScene(formTimeArr, 2);
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -1363,8 +1419,7 @@ export default defineComponent({
|
|
|
proxyData.workkArr = newProps.workkArr;
|
|
|
proxyData.projectId = newProps.projectId;
|
|
|
proxyData.enterType = newProps.enterType;
|
|
|
- console.log("newProps.enterType==", newProps.enterType);
|
|
|
- console.log(newProps.enterType);
|
|
|
+ proxyData.deviceItem = newProps.deviceItem;
|
|
|
if (proxyData.isUpdate) {
|
|
|
proxyData.setWorkTimeList();
|
|
|
}
|
|
@@ -1390,7 +1445,7 @@ export default defineComponent({
|
|
|
}
|
|
|
.work-space {
|
|
|
width: 100%;
|
|
|
- padding-left: 10px;
|
|
|
+ // padding-left: 10px;
|
|
|
.space-title {
|
|
|
padding-bottom: 10px;
|
|
|
font-family: "Noto Sans SC";
|
|
@@ -1425,9 +1480,9 @@ export default defineComponent({
|
|
|
padding-bottom: 5px;
|
|
|
|
|
|
.date-item {
|
|
|
- padding-top: 20px;
|
|
|
+ padding-top: 10px;
|
|
|
width: 50px;
|
|
|
- height: 74px;
|
|
|
+ height: 60px;
|
|
|
box-sizing: border-box;
|
|
|
border: 1px solid #eff0f1;
|
|
|
border-radius: 16px;
|
|
@@ -1439,12 +1494,12 @@ export default defineComponent({
|
|
|
|
|
|
&:nth-child(1) {
|
|
|
font-family: "Noto Sans SC";
|
|
|
- padding-bottom: 10px;
|
|
|
+ padding-bottom: 6px;
|
|
|
font-style: normal;
|
|
|
font-weight: 400;
|
|
|
- font-size: 12px;
|
|
|
- line-height: 12px;
|
|
|
- transform: scale();
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 14px;
|
|
|
+ transform: scale(0.8);
|
|
|
text-align: center;
|
|
|
color: #8d9399;
|
|
|
}
|
|
@@ -1453,8 +1508,8 @@ export default defineComponent({
|
|
|
font-family: "Persagy";
|
|
|
font-style: normal;
|
|
|
font-weight: 700;
|
|
|
- font-size: 14px;
|
|
|
- line-height: 19px;
|
|
|
+ font-size: 16px;
|
|
|
+ // line-height: 19px;
|
|
|
text-align: center;
|
|
|
color: #000000;
|
|
|
}
|
|
@@ -1469,8 +1524,7 @@ export default defineComponent({
|
|
|
|
|
|
.sliders-list {
|
|
|
position: relative;
|
|
|
- // padding-top: 20px;
|
|
|
- margin-top: 20px;
|
|
|
+ margin-top: 5px;
|
|
|
height: 135px;
|
|
|
white-space: nowrap;
|
|
|
overflow-x: auto;
|
|
@@ -1577,7 +1631,8 @@ export default defineComponent({
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
display: flex;
|
|
|
- padding-top: 10px;
|
|
|
+ justify-content: space-between;
|
|
|
+ // padding-top: 10px;
|
|
|
text-align: center;
|
|
|
|
|
|
.cancel-btn {
|
|
@@ -1614,7 +1669,7 @@ export default defineComponent({
|
|
|
|
|
|
.work-device {
|
|
|
// padding-top: 10px;
|
|
|
- height: 27vh;
|
|
|
+ height: 36vh;
|
|
|
overflow-y: auto;
|
|
|
.device-tip {
|
|
|
padding-top: 20px;
|
|
@@ -1648,7 +1703,8 @@ export default defineComponent({
|
|
|
background: #f7f9fa;
|
|
|
border-radius: 4px;
|
|
|
margin-top: 10px;
|
|
|
- line-height: 30px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ line-height: 20px;
|
|
|
span {
|
|
|
display: inline-block;
|
|
|
font-family: "PingFang SC";
|
|
@@ -1667,7 +1723,7 @@ export default defineComponent({
|
|
|
display: block;
|
|
|
font-weight: 500;
|
|
|
font-size: 14px;
|
|
|
- line-height: 18px;
|
|
|
+ line-height: 14px;
|
|
|
color: #000000;
|
|
|
padding-top: 4px;
|
|
|
}
|