diff --git a/hx-ai-intelligent/src/api/IlluminationInfo.ts b/hx-ai-intelligent/src/api/IlluminationInfo.ts index f6de125..3b1d32c 100644 --- a/hx-ai-intelligent/src/api/IlluminationInfo.ts +++ b/hx-ai-intelligent/src/api/IlluminationInfo.ts @@ -17,4 +17,8 @@ export enum lightingManage { getLeftPlan = '/carbon-smart/IlluminationPlan/getPlan', // 提交穿梭框被选择的数据 submitLeftPlan = '/carbon-smart/IlluminationPlan/joinPlan', + // 删除表格中的计划 + deletePlan = '/carbon-smart/IlluminationPlan/deletePlan', + // 重启表格计划 + restartPlan = '/carbon-smart/IlluminationPlan/enable', } diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less index 4b4cf21..ae84fcd 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less @@ -1,6 +1,8 @@ // 页面容器 .lighting-box { position: relative; + width: 100%; + height: 100%; // background: linear-gradient(#badaff, #8cabeb, #7095de); // 照明设备功能总容器 .lighting-img-box { @@ -47,19 +49,19 @@ display: flex; gap: 5px; .area1 { - width: 70px; + width: 65px; background: rgba(0, 251, 91, 0.3); border: 2px solid rgb(0, 251, 91); display: flex; } .area2 { - width: 200px; + width: 100px; background: rgba(255, 165, 0, 0.3); border: 2px solid rgb(255, 165, 0); display: flex; } .area3 { - width: 120px; + width: 220px; background: rgba(255, 0, 0, 0.3); border: 2px solid rgb(255, 0, 0); display: flex; @@ -71,7 +73,7 @@ display: flex; } .area5 { - flex: 1; + flex: 210px; background: rgba(0, 251, 91, 0.3); border: 2px solid rgb(0, 251, 91); display: flex; diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue index dee6eb5..4101051 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue @@ -3,8 +3,7 @@
- - +
@@ -13,7 +12,7 @@ :class="computedClass(item.id)" @click="changeThisArea([item])" :key="index"> -
+
@@ -50,7 +49,7 @@ :maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }"> - + @@ -80,55 +79,53 @@ import { DoubleRightOutlined } from '@ant-design/icons-vue'; -// 类声明 ======================================================= - -interface items { - id: string, - -} // 初始化 ======================================================= onMounted(() => { - http.post(lightingManage.getArea, { floor: '1', siteId: '10000001' }).then(res => { + http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then(res => { const data = res.data - /** 由前端创建的,只在前端使用的变量 + floorData.value = data + /** 只在前端使用的变量 * @param id 用于判断样式和层级的前端属性 * @param selected 用于表示是否选中的前端属性 */ - data.forEach((item, index) => { - if (index == 0) { - item.selected = true - } else { - item.selected = false - } - item.id = String(index + 1) - item.children = [] - // deviceGroup后端返回了对象,此处转化为数组 - let i = 1; - for (let obj in item.deviceGroup) { - item.deviceGroup[obj].selected = false - item.deviceGroup[obj].id = String((index + 1) + '-' + i++) - item.children.push(item.deviceGroup[obj]) - } + data.forEach(floor => { + floor.childList.forEach((item, index) => { + if (index == 0) { + item.selected = true + } else { + item.selected = false + } + item.id = String(index + 1) + item.childList.forEach((v, i) => { + v.selected = false + v.id = (index + 1) + '-' + (i + 1) + }) + }) }) - treeData.value = data + treeData.value = data[0].childList }) }) // 分层业务 ===================================================== // 左上角分层切换 -const changeFloor = (area: number) => { - if (area == 1) { - console.log('1F') - } else if (area == 2) { - console.log('2F') - } +const changeFloor = (area: any) => { + // 重置数据 + reset() + // 重置视图 + changeArea(['1']) + // 切换楼层数据 + treeData.value = area + // 默认选择第一项 + treeData.value[0].selected = true } // 分区业务 ===================================================== +// 所有楼层的数据 +const floorData = ref([]) // 分区结构树 const treeData = ref([]) // 当前选中的分区id @@ -223,7 +220,7 @@ const changeThisArea = (result: any) => { const reset = () => { treeData.value.forEach(item => { item.selected = false - item.children.forEach(i => { + item.childList.forEach(i => { i.selected = false }) }) diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.less b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.less index 1f4ae69..36cc39c 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.less +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.less @@ -44,8 +44,7 @@ display: inline-block; justify-content: center; } - - .plan.enabled { + .plan { border: none; font-size: 14px; font-weight: 400; @@ -54,28 +53,20 @@ margin-left: 235px; width: 88px; height: 32px; - background: linear-gradient(180deg, rgba(103, 222, 0, 1) 0%, rgba(0, 181, 6, 1) 100%); color: white; + cursor: pointer; + } + .plan.enabled { + background: linear-gradient(180deg, rgba(103, 222, 0, 1) 0%, rgba(0, 181, 6, 1) 100%); } - .plan.disabled { - border: none; - font-size: 14px; - font-weight: 400; - border-radius: 5px; - color: white; - vertical-align: top; - margin-left: 235px; - width: 88px; - height: 32px; background-color: red; } - .plan:disabled { cursor: not-allowed; } - - .openPlan.enabled2 { + .openPlan { + cursor: pointer; border: none; font-size: 14px; font-weight: 400; @@ -84,19 +75,12 @@ vertical-align: top; width: 88px; height: 32px; + } + .openPlan.enabled2 { background: linear-gradient(180deg, rgba(103, 222, 0, 1) 0%, rgba(0, 181, 6, 1) 100%); - color: white; } .openPlan.disabled2 { - border: none; - font-size: 14px; - font-weight: 400; - border-radius: 5px; - color: white; - vertical-align: top; - width: 88px; - height: 32px; background-color: red; } @@ -135,6 +119,7 @@ color: white; border: none; border-radius: 5px; + cursor: pointer; } .btn2 { diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue index e918e2a..3882694 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue @@ -14,7 +14,7 @@