From afd6c22ddcc7e387bb735ebd000921ceaecf3b01 Mon Sep 17 00:00:00 2001
From: wangqiujuan0808 <578331299@qq.com>
Date: Tue, 26 Mar 2024 10:41:49 +0800
Subject: [PATCH] Update Room.vue
---
src/views/Room.vue | 76 ++++++++++++++++++++++++++++++++++++++--------
1 file changed, 63 insertions(+), 13 deletions(-)
diff --git a/src/views/Room.vue b/src/views/Room.vue
index d474eaa..a66d69f 100644
--- a/src/views/Room.vue
+++ b/src/views/Room.vue
@@ -15,9 +15,9 @@
- {{ item.room_name }}
- {{ item.room_count }}
+ :class="{ 'selectDiv': item.base_info.room_name === current_room_info.base_info.room_name }">
+ {{ item.base_info.room_name }}
+ {{ item.base_info.room_count }}
@@ -28,11 +28,11 @@
@@ -174,7 +174,7 @@
备注
@@ -201,9 +201,13 @@ const project = reactive({
content: [],
});
-const current_room_info = reactive({
- room_name: '',
- room_count: 1,
+const addData = reactive({
+ base_info: {
+ room_name: '',
+ room_count: 1,
+ desc: ''
+ },
+
light_info: {// 灯光信息
switching_circuit: 0,
dimming_10v: 0,
@@ -236,7 +240,51 @@ const current_room_info = reactive({
doorbell: 1,
Housekeeping: ['DND', 'MUR'],
},
- desc: ''
+
+})
+
+
+
+const current_room_info = reactive({
+ base_info: {
+ room_name: '',
+ room_count: 1,
+ desc: ''
+ },
+
+ light_info: {// 灯光信息
+ switching_circuit: 0,
+ dimming_10v: 0,
+ dimming_leading_edge: 0,
+ dimming_trailing_edge: 0,
+ DALI: 0,
+ },
+ fcu_info: {// 盘管信息
+ fcu_type: 0,
+ pipe_type: 0,
+ valve_type: 0,
+ fcu_count: 0,
+ thermostat_count: 0,
+ },
+ panel_info: {// 面板信息
+ panel_type: 0,
+ panel_count: 0,
+ panel_button_count: 0,
+ },
+ curtain_info: {// 窗帘信息
+ curtain_type: 0,
+ curtain_count: 0,
+ sheer_curtain_count: 0,
+ },
+ other: {// 其他信息
+ PIR: 1,
+ PIR2: 1,
+ Gate: 1,
+ Window: 1,
+ doorbell: 1,
+ Housekeeping: ['DND', 'MUR'],
+ },
+
})
const get_project = async () => {
@@ -269,7 +317,7 @@ const delet_room = (item) => {
return;
}
project.content = project.content.filter(ele => {
- return ele.room_name !== item.room_name;
+ return ele.base_info.room_name !== item.base_info.room_name;
})
save_room();
}
@@ -279,15 +327,17 @@ onMounted(() => {
const select_room = (item) => {
for (const key in item) {
+ console.log(key);
current_room_info[key] = item[key];
+
}
}
const add_room = () => {
if (!Array.isArray(project.content)) {
project.content = []
}
- let target = JSON.parse(JSON.stringify(current_room_info));
- target.room_name = "房型" + generateShortUUID();
+ let target = JSON.parse(JSON.stringify(addData));
+ target.base_info.room_name = "房型" + generateShortUUID();
project.content.push(target);
}