Browse Source

fix:群控系统>控制面板的样式和逻辑修改

temp
chenpingsen 4 months ago
parent
commit
cce83ee700
  1. 1
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/dialogStyle.less
  2. 22
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/index.less
  3. 14
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/index.vue
  4. 24
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs1.less
  5. 565
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs1.vue
  6. 1
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less
  7. 22
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less
  8. 24
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue
  9. 5
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/lightPosition.ts
  10. 24
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.less
  11. 582
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue

1
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/dialogStyle.less

@ -39,7 +39,6 @@
.journal { .journal {
padding: 1% 3%; padding: 1% 3%;
width: 100%; width: 100%;
height: 150px;
background-color: rgba(0, 0, 0); background-color: rgba(0, 0, 0);
border-radius: 12px; border-radius: 12px;
border: 2px solid transparent; border: 2px solid transparent;

22
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/index.less

@ -16,26 +16,30 @@
perspective-origin: 850px -160px; perspective-origin: 850px -160px;
// 左上角区域切换功能 // 左上角区域切换功能
.btn-box { .btn-box {
width: 120px; width: 100px;
position: sticky; position: sticky;
top: 10px; top: 15px;
left: 10px; margin-left: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.btn-item { .btn-item {
cursor: pointer; cursor: pointer;
width: 100%; width: 100%;
height: 40px; height: 35px;
border-radius: 4px; border-radius: 4px;
background: rgba(39, 120, 255, 1); // background: rgba(39, 120, 255, 1);
background: rgb(7, 72, 116);
border: 1px solid rgba(51, 199, 255, 1); border: 1px solid rgba(51, 199, 255, 1);
box-shadow: 0px 10px 15px rgba(0, 54, 136, 0.3); box-shadow: 0px 10px 15px rgba(0, 54, 136, 0.3);
font-size: 18px; font-size: 16px;
color: white; color: white;
} }
.btnActive {
background: rgba(39, 120, 255, 1);
}
.btn-item:hover { .btn-item:hover {
color: black; color: white;
} }
} }
// 大区分区 // 大区分区
@ -129,6 +133,9 @@
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
}
.drawer-item {
position: relative;
// 抽屉关闭按钮 // 抽屉关闭按钮
.drawer-box-out { .drawer-box-out {
width: 30px; width: 30px;
@ -145,5 +152,4 @@
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
} }

14
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/index.vue

@ -7,7 +7,7 @@
v-for="(item, index) in floorData" v-for="(item, index) in floorData"
:key="index" :key="index"
class="btn-item" class="btn-item"
:style="{ color: item.dataCode == thisFloor ? 'black' : 'white' }" :class="{ btnActive: item.dataCode == thisFloor }"
@click="changeFloor(item.childList, item.dataCode)" @click="changeFloor(item.childList, item.dataCode)"
>{{ item.name }}</button >{{ item.name }}</button
> >
@ -36,14 +36,6 @@
:visible="item.visible" /> :visible="item.visible" />
</div> </div>
</div> </div>
<!-- 右侧抽屉的触发按钮 -->
<div class="drawer-box-in" v-if="!visible" @click="toggleDrawer">
<double-left-outlined class="drawer-icon" style="color: white" />
</div>
<!-- 左侧抽屉的关闭按钮 -->
<div class="drawer-box-out" v-if="visible" @click="toggleDrawer">
<double-right-outlined class="drawer-icon" style="color: white" />
</div>
<!-- 右侧抽屉 --> <!-- 右侧抽屉 -->
<a-drawer <a-drawer
v-model:visible="visible" v-model:visible="visible"
@ -56,6 +48,10 @@
id="drawer" id="drawer"
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }"> :maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<div class="drawer-box-out" @click="toggleDrawer">
<double-left-outlined v-if="!visible" class="drawer-icon" style="color: white" />
<double-right-outlined v-else class="drawer-icon" style="color: white" />
</div>
<a-tab-pane key="1" tab="控制面板"> <a-tab-pane key="1" tab="控制面板">
<tabs1 <tabs1
ref="tabs1Ref" ref="tabs1Ref"

24
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs1.less

@ -392,12 +392,22 @@
.zmhlbtn { .zmhlbtn {
position: relative; position: relative;
} overflow: hidden;
.btn-back {
// 禁用图标 position: absolute;
.anticon-stop { width: 50px;
position: absolute; height: 50px;
right: 3px; right: -25px;
bottom: 3px; bottom: -30px;
transform: rotate(45deg);
background: orange;
// 禁用图标
.anticon-stop {
transform: rotate(-45deg) scale(0.9);
position: absolute;
left: 3px;
top: 15px;
}
}
} }
} }

565
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs1.vue

@ -1,243 +1,266 @@
<template> <template>
<a-spin :spinning="isLoading"> <!-- 空调区域 -->
<!-- 照明区域 --> <div>
<div> <div class="light-area">
<div class="light-area"> <div class="light-area-tab"></div>
<div class="light-area-tab"></div> <span class="light-area-text">空调区域</span>
<span class="light-area-text">空调区域</span>
</div>
<!-- 照明区域按钮部分 -->
<div class="area">
<template v-if="!showAllButtonsArea">
<button
v-for="(button, index) in limitedButtons1"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtonsArea = true" class="openzm"><down-outlined /> 展开</span>
</div>
</template>
<template v-else>
<button
v-for="(button, index) in props.treeData"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtonsArea = false" class="openzm"><up-outlined /> 回缩</span>
</div>
</template>
</div>
</div> </div>
<!-- 空调分组部分 --> <!-- 空调区域按钮部分 -->
<div> <div class="area">
<div class="circuit-area"> <template v-if="!showAllButtonsArea">
<div class="circuit-tab"></div> <button
<span class="circuit-text">空调分组</span> v-for="(button, index) in limitedButtons1"
<div class="btn2"> :key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtonsArea = true" class="openzm"><down-outlined /> 展开</span>
</div>
</template>
<template v-else>
<button
v-for="(button, index) in props.treeData"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtonsArea = false" class="openzm"><up-outlined /> 回缩</span>
</div>
</template>
</div>
</div>
<!-- 空调分组部分 -->
<div>
<div class="circuit-area">
<div class="circuit-tab"></div>
<span class="circuit-text">空调分组</span>
<div class="btn2">
<a-badge :offset="[-10, 2]" :count="lockList.length">
<button <button
class="openPlan" class="openPlan"
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }" :class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }"
@click="togglePlan2"> @click="togglePlan2">
{{ isPlanEnabled2 ? '启用开关' : '禁用开关' }} {{ isPlanEnabled2 ? '启用开关' : '禁用开关' }}
</button> </button>
<a-switch </a-badge>
v-model:checked="selectAllCheckbox" <a-switch
:disabled="singleSelection" v-model:checked="selectAllCheckbox"
:class="{ :disabled="singleSelection"
'blue-background': selectAllCheckbox, :class="{
'grey-background': !selectAllCheckbox, 'blue-background': selectAllCheckbox,
}" 'grey-background': !selectAllCheckbox,
@change="toggleAllSelection" /> }"
<button class="allBtn">全选</button> @change="toggleAllSelection" />
<button class="both" @click="selectAll"> <button class="allBtn">全选</button>
{{ singleSelection ? '多选' : '单选' }} <button class="both" @click="selectAll">
</button> {{ singleSelection ? '多选' : '单选' }}
</div> </button>
</div>
<div class="btnArea">
<template v-if="!showAllButtons">
<button
v-for="(button, index) in limitedButtons2"
:key="index"
:class="{ btn: true, selected: button.selected }"
class="zmhlbtn"
@click="changeLine(button)">
<stop-outlined v-if="button.ctrlStatus" />
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtons = true" class="openzm"><down-outlined /> 展开</span>
</div>
</template>
<template v-else>
<button
v-for="(button, index) in buttons2"
:key="index"
:class="{ btn: true, selected: button.selected }"
class="zmhlbtn"
@click="changeLine(button)">
<stop-outlined v-if="button.ctrlStatus" />
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtons = false" class="openzm"><up-outlined /> 回缩</span>
</div>
</template>
</div> </div>
</div> </div>
<!-- 控制模式部分 --> <div class="btnArea">
<div v-show="thisButton2.dataCode"> <template v-if="!showAllButtons">
<div class="control-area">
<div class="control-tab"></div>
<span class="control-text">控制模式</span>
</div>
<!-- 控制模式按钮部分 -->
<div class="control-mode-btn-area">
<button <button
v-for="(button3, index) in thisButton2.childList" v-for="(button, index) in limitedButtons2"
:key="index" :key="index"
class="btn" :class="{ btn: true, selected: button.selected }"
:class="{ selected: button3.selectAble }" class="zmhlbtn"
@click="selectButton3(button3)"> @click="changeLine(button)">
{{ button3.name }} <div v-if="button.lockStatus" class="btn-back">
<stop-outlined />
</div>
{{ button.name }}
</button> </button>
</div> <div style="margin-top: 10px">
</div> <span @click="showAllButtons = true" class="openzm"><down-outlined /> 展开</span>
<!-- 控制场景部分 --> </div>
<div v-show="thisButton2.dataCode"> </template>
<div class="control-scene-area"> <template v-else>
<div class="control-scene-tab"></div>
<span class="control-scene-text">启动模式</span>
<div v-if="!singleSelection" style="flex: 1; color: red; text-align: right"
>多选模式下会修改当前选中的所有回路</div
>
</div>
<!-- 控制场景按钮部分 -->
<div class="control-scene-btn-area">
<button <button
v-for="(button4, index) in thisButton3.childList" v-for="(button, index) in buttons2"
:key="index" :key="index"
:class="{ btn: true, selected: button4.executeStatus.value != 0 }" :class="{ btn: true, selected: button.selected }"
@click="selectButton4(button4)"> class="zmhlbtn"
{{ button4.name }} @click="changeLine(button)">
<div v-if="button.lockStatus" class="btn-back">
<stop-outlined />
</div>
{{ button.name }}
</button> </button>
</div> <div style="margin-top: 10px">
<span @click="showAllButtons = false" class="openzm"><up-outlined /> 回缩</span>
</div>
</template>
</div> </div>
<!-- 底部按钮区 --> </div>
<div class="bottom"> <!-- 控制模式部分 -->
<a-badge :offset="[-10, 2]" :count="changeList.length"> <div v-show="thisButton2.dataCode">
<a-popconfirm <div class="control-area">
title="刷新将会取消已作出的修改" <div class="control-tab"></div>
ok-text="确定" <span class="control-text">控制模式</span>
cancel-text="取消" </div>
@confirm="refresh(false)" <!-- 控制模式按钮部分 -->
@cancel="changeCancel"> <div class="control-mode-btn-area">
<button class="flushed">刷新</button> <button
</a-popconfirm> v-for="(button3, index) in thisButton2.childList"
</a-badge> :key="index"
class="btn"
<a-spin :spinning="buttonLoading"> :class="{ selected: button3.selectAble }"
<button class="execute" @click="showModal">执行</button> @click="selectButton3(button3)">
</a-spin> {{ button3.name }}
</button>
</div>
</div>
<!-- 控制场景部分 -->
<div v-show="thisButton2.dataCode">
<div class="control-scene-area">
<div class="control-scene-tab"></div>
<span class="control-scene-text">启动模式</span>
<div v-if="!singleSelection" style="flex: 1; color: red; text-align: right"
>多选模式下会修改当前选中的所有回路</div
>
</div> </div>
<!-- 控制场景按钮部分 -->
<div class="control-scene-btn-area">
<button
v-for="(button4, index) in thisButton3.childList"
:key="index"
:class="{ btn: true, selected: button4.executeStatus.value != 0 }"
@click="selectButton4(button4)">
{{ button4.name }}
</button>
</div>
</div>
<!-- 底部按钮区 -->
<div class="bottom">
<a-badge :offset="[-10, 2]" :count="changeList.length">
<a-popconfirm
title="刷新将会取消已作出的修改"
ok-text="确定"
cancel-text="取消"
@confirm="refresh(false)"
@cancel="changeCancel">
<button class="flushed">刷新</button>
</a-popconfirm>
</a-badge>
<button class="execute" @click="showModal">执行</button>
</div>
<!-- 点击执行时的弹出框 --> <!-- 点击执行时的弹出框 -->
<div class="out-dialog" v-if="executeVisible"> <div class="out-dialog" v-if="executeVisible">
<div class="content"> <div class="content">
<div> <div>
<div class="div-operation"></div> <div class="div-operation"></div>
<span class="text-operation">变更内容 </span> <span class="text-operation">变更内容 </span>
</div> </div>
<div class="j-box" v-for="item in diffList" :key="item.id"> <div class="j-box" v-for="item in diffList" :key="item.id">
<div class="journal" style="margin-top: 20px"> <div class="journal" style="margin-top: 20px">
<div class="imgText"> <div class="imgText">
<div class="zjzm"> <div class="zjzm">
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp; <img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span <span
class="title-text" class="title-text"
style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)"
>{{ item.regionName + ' > ' + item.deviceGroupName }}</span >{{ item.regionName + ' > ' + item.deviceGroupName }}</span
> >
</div>
<a-popconfirm
title="此操作将会撤销修改"
ok-text="确定"
cancel-text="取消"
@confirm="delBtn(item)"
@cancel="changeCancel">
<button class="cxbtn">撤销</button>
</a-popconfirm>
</div>
<div class="btn-box">
<div class="btn-item">
<div class="left">控制模式</div>
<div class="right">
<span>手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>自动</span>
</div> </div>
<a-popconfirm
title="此操作将会撤销修改"
ok-text="确定"
cancel-text="取消"
@confirm="delBtn(item)"
@cancel="changeCancel">
<button class="cxbtn">撤销</button>
</a-popconfirm>
</div> </div>
<div class="btn-box"> <div class="btn-item">
<div class="btn-item"> <div class="left"> 亮度 </div>
<div class="left">控制模式</div> <div class="right">
<div class="right"> <!-- 数字0也会被判为false故只判断undefined null -->
<span>手动</span> <span>{{
<img src="/asset/image/bulbLogo/22406.png" alt="" /> item?.stateBefore?.brightness != undefined ? item.stateBefore.brightness : '--'
<span>自动</span> }}</span>
</div> <img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>{{
item?.stateAfter?.brightness != undefined ? item.stateAfter.brightness : '--'
}}</span>
</div> </div>
<div class="btn-item"> </div>
<div class="left"> 亮度 </div> <div class="btn-item">
<div class="right"> <div class="left"> 控制场景 </div>
<!-- 数字0也会被判为false故只判断undefined null --> <div class="right">
<span>{{ <span>{{
item?.stateBefore?.brightness != undefined ? item.stateBefore.brightness : '--' item?.stateBefore?.scene?.label ? item.stateBefore.scene.label : '--'
}}</span> }}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>{{ <span>{{
item?.stateAfter?.brightness != undefined ? item.stateAfter.brightness : '--' item?.stateAfter?.scene?.label ? item.stateAfter.scene.label : '--'
}}</span> }}</span>
</div>
</div> </div>
<div class="btn-item"> </div>
<div class="left"> 控制场景 </div> <div class="btn-item">
<div class="right"> <div class="left"> 色温 </div>
<span>{{ <div class="right">
item?.stateBefore?.scene?.label ? item.stateBefore.scene.label : '--' <span>{{
}}</span> item?.stateBefore?.color != undefined ? item.stateBefore.color : '--'
<img src="/asset/image/bulbLogo/22406.png" alt="" /> }}</span>
<span>{{ <img src="/asset/image/bulbLogo/22406.png" alt="" />
item?.stateAfter?.scene?.label ? item.stateAfter.scene.label : '--' <span>
}}</span> {{ item?.stateAfter?.color != undefined ? item.stateAfter.color : '--' }}
</div> </span>
</div> </div>
<div class="btn-item"> </div>
<div class="left"> 色温 </div> <div class="btn-item">
<div class="right"> <div class="left"> 启用状态 </div>
<span>{{ <div class="right">
item?.stateBefore?.color != undefined ? item.stateBefore.color : '--' <span>{{
}}</span> item?.stateBefore?.lockStatus != undefined
<img src="/asset/image/bulbLogo/22406.png" alt="" /> ? item.stateBefore.lockStatus
<span> ? '禁用'
{{ item?.stateAfter?.color != undefined ? item.stateAfter.color : '--' }} : '启用'
</span> : '--'
</div> }}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>
{{
item?.stateAfter?.lockStatus != undefined
? item.stateAfter.lockStatus
? '禁用'
: '启用'
: '--'
}}
</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%; height: 60px"></div>
<div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button>
<a-popconfirm
title="此操作将提交以上修改内容"
ok-text="确定"
cancel-text="取消"
@confirm="submitChangeList"
@cancel="changeCancel">
<button class="execute">执行</button>
</a-popconfirm>
</div>
</div> </div>
</a-spin> <div style="width: 100%; height: 60px"></div>
<div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button>
<a-popconfirm
title="此操作将提交以上修改内容"
ok-text="确定"
cancel-text="取消"
@confirm="submitChangeList"
@cancel="changeCancel">
<button class="execute">执行</button>
</a-popconfirm>
</div>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -304,48 +327,67 @@
emit('changeArea', button.id); emit('changeArea', button.id);
// - // -
resetMode(); resetMode();
// -
handleButton.value = '';
}; };
// 8 // 8
const limitedButtons1 = computed(() => props.treeData.slice(0, 8)); const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
// ====================================================================== // ======================================================================
// id
const handleButton = ref('');
// / // /
const isPlanEnabled2 = ref(true); const isPlanEnabled2 = ref(false);
//
const lockList = ref<any>([]);
// / // /
const togglePlan2 = () => { const togglePlan2 = () => {
// // 线
if (handleButton.value == '') { let valid = buttons2.value.filter((item: any) => {
return message.info('请选择空调分组'); return item.selected;
} });
// // 线
const btn: any = buttons2.value.find((button: any) => button.id === handleButton.value); if (valid.length == 0) {
let panel = +!btn.ctrlStatus; return message.info('请先选择线路');
isLoading.value = true; // 线
http } else {
.get(lightingManage.setDisable, { //
deviceGroup: btn.dataCode, isPlanEnabled2.value = !isPlanEnabled2.value;
panel, //
projectId: state.projectId, let after = +isPlanEnabled2.value;
siteId: state.siteId, // 线
}) valid.forEach((item: any) => {
.then((res) => { //
if (res.msg === 'success') { if (item.lockStatus == after) {
// - - - loading return;
isPlanEnabled2.value = !isPlanEnabled2.value; }
btn.ctrlStatus = panel; //
isLoading.value = false; const same = lockList.value.find((v: any) => {
return v.deviceGroup == item.dataCode;
});
//
if (same) {
//
if (same.before == after) {
lockList.value.forEach((v1: any, index: number) => {
if (same.deviceGroup == v1.deviceGroup) {
lockList.value.splice(index, 1);
}
});
// true false
}
//
} else { } else {
isLoading.value = false; lockList.value.push({
deviceGroup: item.dataCode,
deviceGroupName: item.name,
region: item.treePid,
regionName: '',
before: item.lockStatus,
lockStatus: after,
});
} }
}) //
.catch(() => { item.lockStatus = after;
isLoading.value = false;
}); });
}
}; };
// //
@ -399,8 +441,6 @@
}); });
// //
const changeLine = (button: any) => { const changeLine = (button: any) => {
// ID/
handleButton.value = button.id;
// / // /
if (button.ctrlStatus) { if (button.ctrlStatus) {
isPlanEnabled2.value = true; isPlanEnabled2.value = true;
@ -449,7 +489,7 @@
console.log(thisButton2, 'button'); console.log(thisButton2, 'button');
}; };
// //
const buttons2 = ref([]); const buttons2 = ref([]);
// //
const showAllButtons = ref(false); const showAllButtons = ref(false);
@ -612,9 +652,6 @@
// ====================================================================== // ======================================================================
const isLoading = ref(false);
// loading
const buttonLoading = ref(false);
// //
const refresh = (reload = false) => { const refresh = (reload = false) => {
// //
@ -631,6 +668,12 @@
}); });
} }
changeList.value = []; changeList.value = [];
if (!reload) {
lockList.value.forEach((item: any) => {
resetLockList(item);
});
}
lockList.value = [];
// //
let data = props.treeData[0]; let data = props.treeData[0];
// //
@ -640,6 +683,18 @@
// 线 // 线
resetMode(); resetMode();
}; };
// /
const resetLockList = (item: any) => {
props.treeData.find((v: any) => {
if (item.region == v.dataCode) {
v.childList.find((v1: any) => {
if (item.deviceGroup == v1.dataCode) {
v1.lockStatus = item.before;
}
});
}
});
};
// //
const resetChangeList = (item: any) => { const resetChangeList = (item: any) => {
props.treeData.find((v: any) => { props.treeData.find((v: any) => {
@ -675,11 +730,10 @@
if (!changeList.value.length) { if (!changeList.value.length) {
return message.info('未产生任何修改'); return message.info('未产生任何修改');
} }
buttonLoading.value = true;
http http
.post(airConditionControl.getChangeList, { .post(airConditionControl.getChangeList, {
sceneList: changeList.value, sceneList: changeList.value,
lockList: [], lockList: lockList.value,
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
}) })
@ -690,11 +744,8 @@
} else { } else {
message.warning('获取修改内容失败'); message.warning('获取修改内容失败');
} }
buttonLoading.value = false;
}) })
.catch(() => { .catch(() => {});
buttonLoading.value = false;
});
}; };
// //
const changeCancel = () => {}; const changeCancel = () => {};
@ -714,17 +765,19 @@
obj.scene = obj.stateAfter.scene.value; obj.scene = obj.stateAfter.scene.value;
obj.before = obj.stateBefore.scene.value; obj.before = obj.stateBefore.scene.value;
resetChangeList(obj); resetChangeList(obj);
resetLockList(obj);
// changeList diffList () // changeList diffList ()
changeList.value = changeList.value.filter((item: any) => { changeList.value = changeList.value.filter((item: any) => {
return item.deviceGroup !== obj.deviceGroup; return item.deviceGroup !== obj.deviceGroup;
}); });
lockList.value = lockList.value.filter((item: any) => {
return item.deviceGroup !== obj.deviceGroup;
});
diffList.value = diffList.value.filter((item: any) => { diffList.value = diffList.value.filter((item: any) => {
return item.deviceGroup !== obj.deviceGroup; return item.deviceGroup !== obj.deviceGroup;
}); });
console.log(changeList, 'changeList');
console.log(diffList, 'diffList');
// //
if (changeList.value.length == 0) { if (changeList.value.length == 0 && lockList.value.length == 0) {
executeVisible.value = false; executeVisible.value = false;
} }
}; };
@ -733,7 +786,7 @@
http http
.post(airConditionControl.submitChangeList, { .post(airConditionControl.submitChangeList, {
sceneList: changeList.value, sceneList: changeList.value,
lockList: [], lockList: lockList.value,
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
}) })

1
hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less

@ -39,7 +39,6 @@
.journal { .journal {
padding: 1% 3%; padding: 1% 3%;
width: 100%; width: 100%;
height: 150px;
background-color: rgba(0, 0, 0); background-color: rgba(0, 0, 0);
border-radius: 12px; border-radius: 12px;
border: 2px solid transparent; border: 2px solid transparent;

22
hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less

@ -16,26 +16,30 @@
perspective-origin: 850px -160px; perspective-origin: 850px -160px;
// 左上角区域切换功能 // 左上角区域切换功能
.btn-box { .btn-box {
width: 120px; width: 100px;
position: sticky; position: sticky;
top: 10px; top: 15px;
left: 10px; margin-left: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.btn-item { .btn-item {
cursor: pointer; cursor: pointer;
width: 100%; width: 100%;
height: 40px; height: 35px;
border-radius: 4px; border-radius: 4px;
background: rgba(39, 120, 255, 1); // background: rgba(39, 120, 255, 1);
background: rgb(7, 72, 116);
border: 1px solid rgba(51, 199, 255, 1); border: 1px solid rgba(51, 199, 255, 1);
box-shadow: 0px 10px 15px rgba(0, 54, 136, 0.3); box-shadow: 0px 10px 15px rgba(0, 54, 136, 0.3);
font-size: 18px; font-size: 16px;
color: white; color: white;
} }
.btnActive {
background: rgba(39, 120, 255, 1);
}
.btn-item:hover { .btn-item:hover {
color: black; color: white;
} }
} }
// 大区分区 // 大区分区
@ -129,6 +133,9 @@
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
}
.drawer-item {
position: relative;
// 抽屉关闭按钮 // 抽屉关闭按钮
.drawer-box-out { .drawer-box-out {
width: 30px; width: 30px;
@ -145,5 +152,4 @@
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
} }

24
hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue

@ -7,7 +7,7 @@
v-for="(item, index) in floorData" v-for="(item, index) in floorData"
:key="index" :key="index"
class="btn-item" class="btn-item"
:style="{ color: item.dataCode == thisFloor ? 'black' : 'white' }" :class="{ btnActive: item.dataCode == thisFloor }"
@click="changeFloor(item.childList, item.dataCode)" @click="changeFloor(item.childList, item.dataCode)"
>{{ item.name }}</button >{{ item.name }}</button
> >
@ -36,14 +36,6 @@
:visible="item.visible" /> :visible="item.visible" />
</div> </div>
</div> </div>
<!-- 右侧抽屉的触发按钮 -->
<div class="drawer-box-in" v-if="!visible" @click="toggleDrawer">
<double-left-outlined class="drawer-icon" style="color: white" />
</div>
<!-- 左侧抽屉的关闭按钮 -->
<div class="drawer-box-out" v-if="visible" @click="toggleDrawer">
<double-right-outlined class="drawer-icon" style="color: white" />
</div>
<!-- 右侧抽屉 --> <!-- 右侧抽屉 -->
<a-drawer <a-drawer
v-model:visible="visible" v-model:visible="visible"
@ -55,13 +47,17 @@
:closable="false" :closable="false"
id="drawer" id="drawer"
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }"> :maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
<div class="drawer-box-out" @click="toggleDrawer">
<double-left-outlined v-if="!visible" class="drawer-icon" style="color: white" />
<double-right-outlined v-else class="drawer-icon" style="color: white" />
</div>
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板"> <a-tab-pane key="1" tab="控制面板">
<tabs1 <tabs1
ref="tabs1Ref" ref="tabs1Ref"
@changeArea="changeArea"
@reset="reset" @reset="reset"
@reload="reload" @reload="reload"
@changeArea="changeArea"
:treeData="treeData" /> :treeData="treeData" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render> <a-tab-pane key="2" tab="计划列表" force-render>
@ -77,6 +73,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { lightPosition } from './lightPosition';
// //
import light from './light.vue'; import light from './light.vue';
import tabs1 from './tabs1.vue'; import tabs1 from './tabs1.vue';
@ -289,7 +286,12 @@
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
console.log(res); const data = res.data;
data.forEach((item: any, index: number) => {
item.styleText = lightPosition[index];
});
console.log(res.data);
// bulbs.value = data;
}); });
}; };

5
hx-ai-intelligent/src/view/equipmentControl/lightingManage/lightPosition.ts

@ -1,3 +1,6 @@
// 此文件只定义light(即俯视图小灯泡)的位置信息 // 此文件只定义light(即俯视图小灯泡)的位置信息
// 与显示状态和分组信息无关 // 与显示状态和分组信息无关
export const lightPosition = []; export const lightPosition = [
{ left: '180px', bottom: '200px' },
{ left: '180px', bottom: '230px' },
];

24
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.less

@ -413,12 +413,22 @@
.zmhlbtn { .zmhlbtn {
position: relative; position: relative;
} overflow: hidden;
.btn-back {
// 禁用图标 position: absolute;
.anticon-stop { width: 50px;
position: absolute; height: 50px;
right: 3px; right: -25px;
bottom: 3px; bottom: -30px;
transform: rotate(45deg);
background: orange;
// 禁用图标
.anticon-stop {
transform: rotate(-45deg) scale(0.9);
position: absolute;
left: 3px;
top: 15px;
}
}
} }
} }

582
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue

@ -1,243 +1,266 @@
<template> <template>
<a-spin :spinning="isLoading"> <!-- 照明区域 -->
<!-- 照明区域 --> <div>
<div> <div class="light-area">
<div class="light-area"> <div class="light-area-tab"></div>
<div class="light-area-tab"></div> <span class="light-area-text"> 照明区域 </span>
<span class="light-area-text"> 照明区域 </span>
</div>
<!-- 照明区域按钮部分 -->
<div class="area">
<template v-if="!showAllButtonsArea">
<button
v-for="(button, index) in limitedButtons1"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtonsArea = true" class="openzm"><down-outlined /> 展开</span>
</div>
</template>
<template v-else>
<button
v-for="(button, index) in props.treeData"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtonsArea = false" class="openzm"><up-outlined /> 回缩</span>
</div>
</template>
</div>
</div> </div>
<!-- 照明回路部分 --> <!-- 照明区域按钮部分 -->
<div> <div class="area">
<div class="circuit-area"> <template v-if="!showAllButtonsArea">
<div class="circuit-tab"></div> <button
<span class="circuit-text">照明回路</span> v-for="(button, index) in limitedButtons1"
<div class="btn2"> :key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtonsArea = true" class="openzm"><down-outlined /> 展开</span>
</div>
</template>
<template v-else>
<button
v-for="(button, index) in props.treeData"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtonsArea = false" class="openzm"><up-outlined /> 回缩</span>
</div>
</template>
</div>
</div>
<!-- 照明回路部分 -->
<div>
<div class="circuit-area">
<div class="circuit-tab"></div>
<span class="circuit-text">照明回路</span>
<div class="btn2">
<a-badge :offset="[-10, 2]" :count="lockList.length">
<button <button
class="openPlan" class="openPlan"
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }" :class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }"
@click="togglePlan2"> @click="togglePlan2">
{{ isPlanEnabled2 ? '启用开关' : '禁用开关' }} {{ isPlanEnabled2 ? '启用开关' : '禁用开关' }}
</button> </button>
<a-switch </a-badge>
v-model:checked="selectAllCheckbox" <a-switch
:disabled="singleSelection" v-model:checked="selectAllCheckbox"
:class="{ :disabled="singleSelection"
'blue-background': selectAllCheckbox, :class="{
'grey-background': !selectAllCheckbox, 'blue-background': selectAllCheckbox,
}" 'grey-background': !selectAllCheckbox,
@change="toggleAllSelection" /> }"
<button class="allBtn">全选</button> @change="toggleAllSelection" />
<button class="both" @click="selectAll"> <button class="allBtn">全选</button>
{{ singleSelection ? '多选' : '单选' }} <button class="both" @click="selectAll">
</button> {{ singleSelection ? '多选' : '单选' }}
</div> </button>
</div>
<div class="btnArea">
<template v-if="!showAllButtons">
<button
v-for="(button, index) in limitedButtons2"
:key="index"
:class="{ btn: true, selected: button.selected }"
class="zmhlbtn"
@click="changeLine(button)">
<stop-outlined v-if="button.ctrlStatus" />
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtons = true" class="openzm"><down-outlined /> 展开</span>
</div>
</template>
<template v-else>
<button
v-for="(button, index) in buttons2"
:key="index"
:class="{ btn: true, selected: button.selected }"
class="zmhlbtn"
@click="changeLine(button)">
<stop-outlined v-if="button.ctrlStatus" />
{{ button.name }}
</button>
<div style="margin-top: 10px">
<span @click="showAllButtons = false" class="openzm"><up-outlined /> 回缩</span>
</div>
</template>
</div> </div>
</div> </div>
<!-- 控制模式部分 --> <div class="btnArea">
<div v-show="thisButton2.dataCode"> <template v-if="!showAllButtons">
<div class="control-area">
<div class="control-tab"></div>
<span class="control-text"> 控制模式 </span>
</div>
<!-- 控制模式按钮部分 -->
<div class="control-mode-btn-area">
<button <button
v-for="(button3, index) in thisButton2.childList" v-for="(button, index) in limitedButtons2"
:key="index" :key="index"
class="btn" :class="{ btn: true, selected: button.selected }"
:class="{ selected: button3.selectAble }" class="zmhlbtn"
@click="selectButton3(button3)"> @click="changeLine(button)">
{{ button3.name }} <div v-if="button.lockStatus" class="btn-back">
<stop-outlined />
</div>
{{ button.name }}
</button> </button>
</div> <div style="margin-top: 10px">
</div> <span @click="showAllButtons = true" class="openzm"><down-outlined /> 展开</span>
<!-- 控制场景部分 --> </div>
<div v-show="thisButton2.dataCode"> </template>
<div class="control-scene-area"> <template v-else>
<div class="control-scene-tab"></div>
<span class="control-scene-text"> 控制场景 </span>
<div v-if="!singleSelection" style="flex: 1; color: red; text-align: right"
>多选模式下会修改当前选中的所有回路</div
>
</div>
<!-- 控制场景按钮部分 -->
<div class="control-scene-btn-area">
<button <button
v-for="(button4, index) in thisButton3.childList" v-for="(button, index) in buttons2"
:key="index" :key="index"
:class="{ btn: true, selected: button4.executeStatus.value != 0 }" :class="{ btn: true, selected: button.selected }"
@click="selectButton4(button4)"> class="zmhlbtn"
{{ button4.name }} @click="changeLine(button)">
<div v-if="button.lockStatus" class="btn-back">
<stop-outlined />
</div>
{{ button.name }}
</button> </button>
</div> <div style="margin-top: 10px">
<span @click="showAllButtons = false" class="openzm"><up-outlined /> 回缩</span>
</div>
</template>
</div> </div>
<!-- 底部按钮区 --> </div>
<div class="bottom"> <!-- 控制模式部分 -->
<a-badge :offset="[-10, 2]" :count="changeList.length"> <div v-show="thisButton2.dataCode">
<a-popconfirm <div class="control-area">
title="刷新将会取消已作出的修改" <div class="control-tab"></div>
ok-text="确定" <span class="control-text"> 控制模式 </span>
cancel-text="取消"
@confirm="refresh(false)"
@cancel="changeCancel">
<button class="flushed">刷新</button>
</a-popconfirm>
</a-badge>
<a-spin :spinning="buttonLoading">
<button class="execute" @click="showModal">执行</button>
</a-spin>
</div> </div>
<!-- 控制模式按钮部分 -->
<div class="control-mode-btn-area">
<button
v-for="(button3, index) in thisButton2.childList"
:key="index"
class="btn"
:class="{ selected: button3.selectAble }"
@click="selectButton3(button3)">
{{ button3.name }}
</button>
</div>
</div>
<!-- 控制场景部分 -->
<div v-show="thisButton2.dataCode">
<div class="control-scene-area">
<div class="control-scene-tab"></div>
<span class="control-scene-text"> 控制场景 </span>
<div v-if="!singleSelection" style="flex: 1; color: red; text-align: right"
>多选模式下会修改当前选中的所有回路</div
>
</div>
<!-- 控制场景按钮部分 -->
<div class="control-scene-btn-area">
<button
v-for="(button4, index) in thisButton3.childList"
:key="index"
:class="{ btn: true, selected: button4.executeStatus.value != 0 }"
@click="selectButton4(button4)">
{{ button4.name }}
</button>
</div>
</div>
<!-- 底部按钮区 -->
<div class="bottom">
<a-badge :offset="[-10, 2]" :count="changeList.length">
<a-popconfirm
title="刷新将会取消已作出的修改"
ok-text="确定"
cancel-text="取消"
@confirm="refresh(false)"
@cancel="changeCancel">
<button class="flushed">刷新</button>
</a-popconfirm>
</a-badge>
<button class="execute" @click="showModal">执行</button>
</div>
<!-- 点击执行时的弹出框 --> <!-- 点击执行时的弹出框 -->
<div class="out-dialog" v-if="executeVisible"> <div class="out-dialog" v-if="executeVisible">
<div class="content"> <div class="content">
<div> <div>
<div class="div-operation"></div> <div class="div-operation"></div>
<span class="text-operation">变更内容 </span> <span class="text-operation">变更内容 </span>
</div> </div>
<div class="j-box" v-for="(item, index) in diffList" :key="item.id"> <div class="j-box" v-for="item in diffList" :key="item.id">
<div class="journal" style="margin-top: 20px"> <div class="journal" style="margin-top: 20px">
<div class="imgText"> <div class="imgText">
<div class="zjzm"> <div class="zjzm">
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp; <img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span <span
class="title-text" class="title-text"
style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)" style="font-size: 18px; font-weight: 500; color: rgba(255, 255, 255, 1)"
>{{ item.regionName + ' > ' + item.deviceGroupName }}</span >{{ item.regionName + ' > ' + item.deviceGroupName }}</span
> >
</div> </div>
<a-popconfirm <a-popconfirm
title="此操作将会撤销修改" title="此操作将会撤销修改"
ok-text="确定" ok-text="确定"
cancel-text="取消" cancel-text="取消"
@confirm="delBtn(item)" @confirm="delBtn(item)"
@cancel="changeCancel"> @cancel="changeCancel">
<button class="cxbtn">撤销</button> <button class="cxbtn">撤销</button>
</a-popconfirm> </a-popconfirm>
</div>
<div class="btn-box">
<div class="btn-item">
<div class="left">控制模式</div>
<div class="right">
<span>手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>自动</span></div
>
</div> </div>
<div class="btn-box"> <div class="btn-item">
<div class="btn-item"> <div class="left"> 亮度 </div>
<div class="left">控制模式</div> <div class="right">
<div class="right"> <!-- 由于数字0也会被判为false故只判断undefined null -->
<span>手动</span> <span>{{
<img src="/asset/image/bulbLogo/22406.png" alt="" /> item?.stateBefore?.brightness != undefined ? item.stateBefore.brightness : '--'
<span>自动</span> }}</span>
</div> <img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>{{
item?.stateAfter?.brightness != undefined ? item.stateAfter.brightness : '--'
}}</span>
</div> </div>
<div class="btn-item"> </div>
<div class="left"> 亮度 </div> <div class="btn-item">
<div class="right"> <div class="left"> 控制场景 </div>
<!-- 由于数字0也会被判为false故只判断undefined null --> <div class="right">
<span>{{ <span>{{
item?.stateBefore?.brightness != undefined ? item.stateBefore.brightness : '--' item?.stateBefore?.scene?.label ? item.stateBefore.scene.label : '--'
}}</span> }}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>{{ <span>{{
item?.stateAfter?.brightness != undefined ? item.stateAfter.brightness : '--' item?.stateAfter?.scene?.label ? item.stateAfter.scene.label : '--'
}}</span> }}</span>
</div>
</div> </div>
<div class="btn-item"> </div>
<div class="left"> 控制场景 </div> <div class="btn-item">
<div class="right"> <div class="left"> 色温 </div>
<span>{{ <div class="right">
item?.stateBefore?.scene?.label ? item.stateBefore.scene.label : '--' <span>{{
}}</span> item?.stateBefore?.color != undefined ? item.stateBefore.color : '--'
<img src="/asset/image/bulbLogo/22406.png" alt="" /> }}</span>
<span>{{ <img src="/asset/image/bulbLogo/22406.png" alt="" />
item?.stateAfter?.scene?.label ? item.stateAfter.scene.label : '--' <span>
}}</span> {{ item?.stateAfter?.color != undefined ? item.stateAfter.color : '--' }}
</div> </span>
</div> </div>
<div class="btn-item"> </div>
<div class="left"> 色温 </div> <div class="btn-item">
<div class="right"> <div class="left"> 启用状态 </div>
<span>{{ <div class="right">
item?.stateBefore?.color != undefined ? item.stateBefore.color : '--' <span>{{
}}</span> item?.stateBefore?.lockStatus != undefined
<img src="/asset/image/bulbLogo/22406.png" alt="" /> ? item.stateBefore.lockStatus
<span> ? '禁用'
{{ item?.stateAfter?.color != undefined ? item.stateAfter.color : '--' }} : '启用'
</span> : '--'
</div> }}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>
{{
item?.stateAfter?.lockStatus != undefined
? item.stateAfter.lockStatus
? '禁用'
: '启用'
: '--'
}}
</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%; height: 60px"></div>
<div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button>
<a-popconfirm
title="此操作将提交以上修改内容"
ok-text="确定"
cancel-text="取消"
@confirm="submitChangeList"
@cancel="changeCancel">
<button class="execute">执行</button>
</a-popconfirm>
</div>
</div> </div>
</a-spin> <div style="width: 100%; height: 60px"></div>
<div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button>
<a-popconfirm
title="此操作将提交以上修改内容"
ok-text="确定"
cancel-text="取消"
@confirm="submitChangeList"
@cancel="changeCancel">
<button class="execute">执行</button>
</a-popconfirm>
</div>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -303,48 +326,67 @@
emit('changeArea', button.id); emit('changeArea', button.id);
// - // -
resetMode(); resetMode();
// -
handleButton.value = '';
}; };
// 8 // 8
const limitedButtons1 = computed(() => props.treeData.slice(0, 8)); const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
// ====================================================================== // ======================================================================
// id
const handleButton = ref('');
// / // /
const isPlanEnabled2 = ref(true); const isPlanEnabled2 = ref(false);
//
const lockList = ref<any>([]);
// / // /
const togglePlan2 = () => { const togglePlan2 = () => {
// // 线
if (handleButton.value == '') { let valid = buttons2.value.filter((item: any) => {
return message.info('请选择照明回路'); return item.selected;
} });
// // 线
const btn: any = buttons2.value.find((button: any) => button.id === handleButton.value); if (valid.length == 0) {
let panel = +!btn.ctrlStatus; return message.info('请先选择线路');
isLoading.value = true; // 线
http } else {
.get(lightingManage.setDisable, { //
deviceGroup: btn.dataCode, isPlanEnabled2.value = !isPlanEnabled2.value;
panel, //
projectId: state.projectId, let after = +isPlanEnabled2.value;
siteId: state.siteId, // 线
}) valid.forEach((item: any) => {
.then((res) => { //
if (res.msg === 'success') { if (item.lockStatus == after) {
// - - - loading return;
isPlanEnabled2.value = !isPlanEnabled2.value; }
btn.ctrlStatus = panel; //
isLoading.value = false; const same = lockList.value.find((v: any) => {
return v.deviceGroup == item.dataCode;
});
//
if (same) {
//
if (same.before == after) {
lockList.value.forEach((v1: any, index: number) => {
if (same.deviceGroup == v1.deviceGroup) {
lockList.value.splice(index, 1);
}
});
// true false
}
//
} else { } else {
isLoading.value = false; lockList.value.push({
deviceGroup: item.dataCode,
deviceGroupName: item.name,
region: item.treePid,
regionName: '',
before: item.lockStatus,
lockStatus: after,
});
} }
}) //
.catch(() => { item.lockStatus = after;
isLoading.value = false;
}); });
}
}; };
// //
@ -398,8 +440,6 @@
}); });
// //
const changeLine = (button: any) => { const changeLine = (button: any) => {
// ID/
handleButton.value = button.id;
// / // /
if (button.ctrlStatus) { if (button.ctrlStatus) {
isPlanEnabled2.value = true; isPlanEnabled2.value = true;
@ -611,9 +651,6 @@
// ====================================================================== // ======================================================================
const isLoading = ref(false);
// loading
const buttonLoading = ref(false);
// //
const refresh = (reload = false) => { const refresh = (reload = false) => {
// //
@ -630,6 +667,12 @@
}); });
} }
changeList.value = []; changeList.value = [];
if (!reload) {
lockList.value.forEach((item: any) => {
resetLockList(item);
});
}
lockList.value = [];
// //
let data = props.treeData[0]; let data = props.treeData[0];
// //
@ -638,7 +681,19 @@
buttons2.value = data.childList; buttons2.value = data.childList;
resetMode(); resetMode();
}; };
// // /
const resetLockList = (item: any) => {
props.treeData.find((v: any) => {
if (item.region == v.dataCode) {
v.childList.find((v1: any) => {
if (item.deviceGroup == v1.dataCode) {
v1.lockStatus = item.before;
}
});
}
});
};
// 线
const resetChangeList = (item: any) => { const resetChangeList = (item: any) => {
props.treeData.find((v: any) => { props.treeData.find((v: any) => {
if (item.region == v.dataCode) { if (item.region == v.dataCode) {
@ -653,7 +708,7 @@
v3.executeStatus.value = 0; v3.executeStatus.value = 0;
} }
if (!item.before) { if (!item.before) {
console.log(item, '没有这个选项'); console.log(item, '没有这个选项---');
v3.executeStatus.value = 0; v3.executeStatus.value = 0;
} }
// //
@ -670,14 +725,13 @@
}; };
// //
const showModal = () => { const showModal = () => {
if (!changeList.value.length) { if (!changeList.value.length && !lockList.value.length) {
return message.info('未产生任何修改'); return message.info('未产生任何修改');
} }
buttonLoading.value = true;
http http
.post(lightingManage.getChangeList, { .post(lightingManage.getChangeList, {
sceneList: changeList.value, sceneList: changeList.value,
lockList: [], lockList: lockList.value,
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
}) })
@ -688,11 +742,8 @@
} else { } else {
message.warning('获取修改内容失败'); message.warning('获取修改内容失败');
} }
buttonLoading.value = false;
}) })
.catch(() => { .catch(() => {});
buttonLoading.value = false;
});
}; };
// //
const changeCancel = () => {}; const changeCancel = () => {};
@ -705,24 +756,26 @@
const changeList: any = ref([]); const changeList: any = ref([]);
// //
const diffList = ref([]); const diffList = ref([]);
// //
const delBtn = (obj: any) => { const delBtn = (obj: any) => {
console.log(obj, '当前选择的修改内容'); console.log(obj, '当前选择的修改内容');
// treeData // treeData
obj.scene = obj.stateAfter.scene.value; obj.scene = obj?.stateAfter?.scene?.value;
obj.before = obj.stateBefore.scene.value; obj.before = obj?.stateBefore?.scene?.value;
resetChangeList(obj); resetChangeList(obj);
// changeList diffList () resetLockList(obj);
// changeList lockList diffList ()
changeList.value = changeList.value.filter((item: any) => { changeList.value = changeList.value.filter((item: any) => {
return item.deviceGroup !== obj.deviceGroup; return item.deviceGroup !== obj.deviceGroup;
}); });
lockList.value = lockList.value.filter((item: any) => {
return item.deviceGroup !== obj.deviceGroup;
});
diffList.value = diffList.value.filter((item: any) => { diffList.value = diffList.value.filter((item: any) => {
return item.deviceGroup !== obj.deviceGroup; return item.deviceGroup !== obj.deviceGroup;
}); });
console.log(changeList, 'changeList');
console.log(diffList, 'diffList');
// //
if (changeList.value.length == 0) { if (changeList.value.length == 0 && lockList.value.length == 0) {
executeVisible.value = false; executeVisible.value = false;
} }
}; };
@ -731,14 +784,15 @@
http http
.post(lightingManage.submitChangeList, { .post(lightingManage.submitChangeList, {
sceneList: changeList.value, sceneList: changeList.value,
lockList: [], lockList: lockList.value,
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
}) })
.then(() => { .then(() => {
emit('reload'); emit('reload');
refresh(true); refresh(true);
}); })
.catch(() => {});
}; };
// ======================================================================== // ========================================================================

Loading…
Cancel
Save