From e906a05cd517c47061271dc477f5702c3fa14d61 Mon Sep 17 00:00:00 2001 From: wangqiujuan0808 <578331299@qq.com> Date: Sat, 23 Mar 2024 14:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Room.vue | 239 ++++++++++++++++++++++++--------------------- 1 file changed, 127 insertions(+), 112 deletions(-) diff --git a/src/views/Room.vue b/src/views/Room.vue index 99b81ac..5633d7a 100644 --- a/src/views/Room.vue +++ b/src/views/Room.vue @@ -4,16 +4,17 @@
项目管理 - 项目预览 + 项目预览
- 新建 + 新建
-
+
{{ item.room_name }} {{ item.room_count }} - +
@@ -23,15 +24,12 @@
房型名称: - - - - +
房型数量: - +
@@ -41,7 +39,7 @@

{{ item.label }}

- +

@@ -50,22 +48,22 @@ 空调信息
盘管类型
- - {{ item.label }} + + {{ item.label + }} - - {{ item.label }} + + {{ item.label + }} - - {{ item.label }} + + {{ item.label + }}

温控器数量

- +

@@ -74,20 +72,20 @@ 面板信息
面板类型
- - {{ item.label }} + + {{ item.label + }}

面板数量

- +

按钮数量

- +

@@ -96,20 +94,20 @@ 窗帘信息
窗帘类型
- - {{ item.label }} + + {{ item.label + }}

窗帘数量

- +

窗纱数量

- +

@@ -121,12 +119,12 @@

{{ item.label }}

- +

- + {{ item.label }} @@ -139,7 +137,7 @@ 备注
- +
@@ -162,6 +160,34 @@ const project = reactive({ description: "", content: [], }); + +const room_info = reactive({ + room_name: '', + room_count: 1, + lightInfo: 1, // 灯光信息 + type1: 0,// 盘管类型 + type2: 0, + type3: 0, + num1: 1, // 温室器数量 + type4: 0,// 面板类型 + type5: 0,// 窗帘类型 + mbnum: 0,// 面板数量 + btnnum: 0,// 按钮数量 + chlnum: 0,// 窗帘数量 + chshnum: 0,// 窗纱数量 + checkone: [0,1],// 其他信息 + desc: '', // 备注, + otherNum0: 1, + otherNum1: 1, + otherNum2: 1, + otherNum3: 1, + otherNum4: 1 + +}) + + + +var currentRoom = reactive(room_info); const get_project = async () => { const param = { action: 100, @@ -175,7 +201,10 @@ const get_project = async () => { project.description = res.data.description; if (Array.isArray(res.data.content)) { project.content = res.data.content; + } else { + add_room(); } + select_room(project.content[0]); } else { ElMessage({ message: res.message, @@ -183,153 +212,134 @@ const get_project = async () => { }); } } - +const delet_room = (item) => { + get_project(); +} onMounted(() => { get_project(); - if (project.content.length ===0) { - add_room(); - } }); -const room_info = reactive({ - room_name: '', - room_count: 1, -}) +const select_room = (item) => { + currentRoom = item; + console.log(123, currentRoom); +} const add_room = () => { if (!Array.isArray(project.content)) { project.content = [] } room_info.room_name = "房型" + (project.content.length + 1); - room_info.room_count = 1; - project.content.push(room_info) + project.content.push(room_info); + console.log(1, project.content); +} + +const saveProject = async () => { + const param = { + action: 102, + data: { + ...project, + new_name: project.name + }, + } + const res = await myApi.getProjects(param); + console.log(res); + if (res.code === 0) { + ElMessage({ + message: "更新成功", + type: "success", + }); + get_project(); + } else { + ElMessage({ + message: res.message + '[' + res.data + ']', + type: "warning", + }); + } } - - -const room_data = usrRoomStore(); -const new_room = reactive({ - name: '房型A', - number: 55, -}) - -const options = reactive([{ - label: '房型A', - value: 1, -}, { - label: '房型B', - value: 2, -}]) -const form = reactive({ - roomName: options[0].value, - num1: 1, - num100: 1, - num101: 1, - type1: 0, - type2: 0, - type3: 0, - type4: 0, - type5: 0, - mbnum: 0, - btnnum: 0, - chlnum: 0, - chshnum: 0, - checkone: [], - desc: '' -}) - const lightArr = reactive([{ label: '开关回路', - value: 1, + value: 0, }, { label: '0-10V调光', - value: 2, + value: 1, }, { label: '前沿调光', - value: 3, + value: 2, }, { label: '后沿调光', - value: 4, + value: 3, }, { label: 'DALI灯', - value: 5, + value: 4, }]) const otherArr = reactive([{ label: '红外', - value: 1, + value: 0, }, { label: '双鉴红外', - value: 2, + value: 1, }, { label: '门磁', - value: 3, + value: 2, }, { label: '窗磁', - value: 4, + value: 3, }, { label: '门铃', - value: 5, + value: 4, }]) const radioGroup1 = reactive([{ label: '普通三速风机', - value: 1, + value: 0, }, { label: '直流无刷风机', - value: 2, + value: 1, }, { label: '三方协议风机', - value: 3, + value: 2, }]) const radioGroup2 = reactive([{ label: '两管制', - value: 4, + value: 0, }, { label: '四管制', - value: 5, + value: 1, }]) const radioGroup3 = reactive([{ label: '两通阀', - value: 6, + value: 0, }, { label: '调节阀', - value: 7, + value: 1, }]) const radioGroup4 = reactive([{ label: '普通面板(无背光)', - value: 8, + value: 0, }, { label: '普通面板(带背光)', - value: 9, + value: 1, }, { label: '协议面板', value: 10, }]) const radioGroup5 = reactive([{ label: '干接点电机', - value: 11, + value: 0, }, { label: '485电机', - value: 12, + value: 1, }]) const checkList = reactive([{ label: 'DND', - value: 11, + value: 0, }, { label: 'MUR', - value: 12, + value: 1, }, { label: 'SOS', - value: 13, + value: 2, }]) -const addRoom = () => { - room_data.list.push({ - name: new_room.name, - number: new_room.number, - }); -} -const check = () => { - -} \ No newline at end of file + .selectDiv { + background: #409eff; + color: #fff; + } + +} \ No newline at end of file