Update Room.vue
parent
d0b56134f2
commit
afd6c22ddc
|
@ -15,9 +15,9 @@
|
|||
</div>
|
||||
<div class="room-list">
|
||||
<div v-for="(item, index) in project.content" :key="index" class="room-span" @click="select_room(item)"
|
||||
:class="{ 'selectDiv': item.room_name === current_room_info.room_name }">
|
||||
<span>{{ item.room_name }}</span>
|
||||
<span>{{ item.room_count }}</span>
|
||||
:class="{ 'selectDiv': item.base_info.room_name === current_room_info.base_info.room_name }">
|
||||
<span>{{ item.base_info.room_name }}</span>
|
||||
<span>{{ item.base_info.room_count }}</span>
|
||||
<el-button :icon="Delete" circle @click="delet_room(item)" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -28,11 +28,11 @@
|
|||
<div class="flex-center bar">
|
||||
<div class="div300">
|
||||
<span>房型名称:</span>
|
||||
<el-input v-model="current_room_info.room_name" placeholder="请输入房型名称" />
|
||||
<el-input v-model="current_room_info.base_info.room_name" placeholder="请输入房型名称" />
|
||||
</div>
|
||||
<div class="div300">
|
||||
<span>房型数量:</span>
|
||||
<el-input-number v-model="current_room_info.room_count" :min="1" :max="1000"
|
||||
<el-input-number v-model="current_room_info.base_info.room_count" :min="1" :max="1000"
|
||||
label="描述文字"></el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -174,7 +174,7 @@
|
|||
<span class="name name7">备注</span>
|
||||
<div class="con-div100">
|
||||
<div class="flex-center bar">
|
||||
<el-input type="textarea" v-model="current_room_info.desc"></el-input>
|
||||
<el-input type="textarea" v-model="current_room_info.base_info.desc"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue