Update Room.vue

main
wangqiujuan0808 2024-03-26 09:59:08 +08:00
parent 1e6a4c3fd5
commit d0b56134f2
1 changed files with 40 additions and 25 deletions

View File

@ -73,25 +73,31 @@
<span class="name name3">空调信息</span>
<div class="flex-center bar">
<div>盘管类型</div>
<el-radio-group v-model="current_room_info.type1">
<el-radio-group v-model="current_room_info.fcu_info.fcu_type">
<el-radio :value="item.value" :key="item.value" v-for="(item, index) in radioGroup1">{{
item.label
}}</el-radio>
</el-radio-group>
<el-radio-group v-model="current_room_info.type2">
<el-radio-group v-model="current_room_info.fcu_info.pipe_type">
<el-radio :value="item.value" :key="item.value" v-for="(item, index) in radioGroup2">{{
item.label
}}</el-radio>
</el-radio-group>
<el-radio-group v-model="current_room_info.type3">
<el-radio-group v-model="current_room_info.fcu_info.valve_type">
<el-radio :value="item.value" :key="item.value" v-for="(item, index) in radioGroup3">{{
item.label
}}</el-radio>
</el-radio-group>
<div>
<p>风机盘管数量</p>
<p>
<el-input-number v-model="current_room_info.fcu_info.fcu_count" :min="1" :max="100"></el-input-number>
</p>
</div>
<div>
<p>温控器数量</p>
<p>
<el-input-number v-model="current_room_info.num1" :min="1" :max="100"></el-input-number>
<el-input-number v-model="current_room_info.fcu_info.thermostat_count" :min="1" :max="100"></el-input-number>
</p>
</div>
</div>
@ -100,7 +106,7 @@
<span class="name name4">面板信息</span>
<div class="flex-center bar">
<div>面板类型</div>
<el-radio-group v-model="current_room_info.type4">
<el-radio-group v-model="current_room_info.panel_info.panel_type">
<el-radio :value="item.value" :key="item.value" v-for="(item, index) in radioGroup4">{{
item.label
}}</el-radio>
@ -108,13 +114,13 @@
<div>
<p>面板数量</p>
<p>
<el-input-number v-model="current_room_info.mbnum" :min="1" :max="100"></el-input-number>
<el-input-number v-model="current_room_info.panel_info.panel_count" :min="1" :max="100"></el-input-number>
</p>
</div>
<div>
<p>按钮数量</p>
<p>
<el-input-number v-model="current_room_info.btnnum" :min="1" :max="100"></el-input-number>
<el-input-number v-model="current_room_info.panel_info.panel_button_count" :min="1" :max="100"></el-input-number>
</p>
</div>
</div>
@ -123,7 +129,7 @@
<span class="name name5">窗帘信息</span>
<div class="flex-center bar">
<div>窗帘类型</div>
<el-radio-group v-model="current_room_info.type5">
<el-radio-group v-model="current_room_info.curtain_info.curtain_type">
<el-radio :value="item.value" :key="item.value" v-for="(item, index) in radioGroup5">{{
item.label
}}</el-radio>
@ -131,13 +137,13 @@
<div>
<p>窗帘数量</p>
<p>
<el-input-number v-model="current_room_info.chlnum" :min="1" :max="100"></el-input-number>
<el-input-number v-model="current_room_info.curtain_info.curtain_count" :min="1" :max="100"></el-input-number>
</p>
</div>
<div>
<p>窗纱数量</p>
<p>
<el-input-number v-model="current_room_info.chshnum" :min="1" :max="100"></el-input-number>
<el-input-number v-model="current_room_info.curtain_info.sheer_curtain_count" :min="1" :max="100"></el-input-number>
</p>
</div>
</div>
@ -149,13 +155,13 @@
<div v-for="(item, i) in otherArr" :key="item.label">
<p>{{ item.label }}</p>
<p>
<el-input-number v-model="current_room_info['otherNum' + item.value]" :min="1"
<el-input-number v-model="current_room_info.other[item.key]" :min="1"
:max="100"></el-input-number>
</p>
</div>
</div>
<el-checkbox-group v-model="current_room_info.checkone" class="rules-label">
<el-checkbox-group v-model="current_room_info.other.Housekeeping" class="rules-label">
<el-checkbox v-for="(item, i) in checkList" :label="item.label" :key="item.value"
:value="item.value">
{{ item.label }}
@ -177,7 +183,7 @@
</template>
<script setup>
import { Delete } from '@element-plus/icons-vue'
import { onMounted, reactive } from 'vue'
import { onMounted, reactive,ref } from 'vue'
import { Plus } from '@element-plus/icons-vue'
import myApi from "@/api/myApi.js";
import { useRoute, useRouter } from 'vue-router'
@ -198,34 +204,37 @@ const project = reactive({
const current_room_info = reactive({
room_name: '',
room_count: 1,
light_info: {
light_info: {//
switching_circuit: 0,
dimming_10v: 0,
dimming_leading_edge: 0,
dimming_trailing_edge: 0,
DALI: 0,
},
fcu_info: {
fcu_info: {//
fcu_type: 0,
pipe_type: 0,
valve_type: 0,
fcu_count: 0,
thermostat_count: 0,
},
panel_info: {
panel_info: {//
panel_type: 0,
panel_count: 0,
panel_button_count: 0,
},
curtain_info: {
curtain_info: {//
curtain_type: 0,
curtain_count: 0,
sheer_curtain_count: 0,
},
other: {
DND: false,
MUR: false,
SOS: false,
other: {//
PIR: 1,
PIR2: 1,
Gate: 1,
Window: 1,
doorbell: 1,
Housekeeping: ['DND', 'MUR'],
},
desc: ''
})
@ -241,7 +250,7 @@ const get_project = async () => {
if (res.code === 0) {
project.name = res.data.name;
project.description = res.data.description;
if (Array.isArray(res.data.content)) {
if (res.data.content && Array.isArray(res.data.content) && res.data.content.length > 0) {
project.content = res.data.content;
} else {
add_room();
@ -287,6 +296,7 @@ const save_room = async () => {
action: 1021,
data: project
}
debugger;
const res = await myApi.getProjects(param);
console.log(res);
if (res.code === 0) {
@ -340,18 +350,23 @@ const lightArr = reactive([{
const otherArr = reactive([{
label: '红外',
value: 0,
key: 'PIR'
}, {
label: '双鉴红外',
value: 1,
key: 'PIR2'
}, {
label: '门磁',
value: 2,
key: 'Gate'
}, {
label: '窗磁',
value: 3,
key: 'Window'
}, {
label: '门铃',
value: 4,
key: 'doorbell'
}])
const radioGroup1 = reactive([{
label: '普通三速风机',
@ -396,13 +411,13 @@ const radioGroup5 = reactive([{
}])
const checkList = reactive([{
label: 'DND',
value: 0,
value: 'DND',
}, {
label: 'MUR',
value: 1,
value: 'MUR',
}, {
label: 'SOS',
value: 2,
value: 'SOS',
}])
</script>
<style lang="scss" scoped>