项目管理
							parent
							
								
									ab1d04c72d
								
							
						
					
					
						commit
						2f1a032818
					
				| 
						 | 
				
			
			@ -11,7 +11,7 @@
 | 
			
		|||
            <p>{{ item.name }}</p>
 | 
			
		||||
            <p>{{ item.description }}</p>
 | 
			
		||||
            <p>{{ item.content }}</p>
 | 
			
		||||
            <el-button type="primary">管理</el-button>
 | 
			
		||||
            <el-button type="primary" @click="router.push({ name: 'room', query: { project_name: item.name }})">管理</el-button>
 | 
			
		||||
            <el-button type="success" @click="openUpdateDialog(item)">编辑</el-button>
 | 
			
		||||
            <el-button type="danger"  @click="openRemove(item)">删除</el-button>
 | 
			
		||||
        </el-card>
 | 
			
		||||
| 
						 | 
				
			
			@ -57,14 +57,11 @@ import { onMounted, reactive, ref } from "vue";
 | 
			
		|||
import { Plus } from "@element-plus/icons-vue";
 | 
			
		||||
import { ElMessage,ElMessageBox } from "element-plus";
 | 
			
		||||
import myApi from "@/api/myApi.js";
 | 
			
		||||
import axios from "axios";
 | 
			
		||||
import { useRouter } from 'vue-router'
 | 
			
		||||
 | 
			
		||||
const projects = ref();
 | 
			
		||||
const router = useRouter()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
    get_projects();
 | 
			
		||||
})
 | 
			
		||||
const projects = ref([]);
 | 
			
		||||
 | 
			
		||||
const get_projects = async () => {
 | 
			
		||||
    const param = {
 | 
			
		||||
| 
						 | 
				
			
			@ -94,6 +91,7 @@ const add_project_info = reactive({
 | 
			
		|||
    name: "",
 | 
			
		||||
    description: "",
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const add_project = async () => {
 | 
			
		||||
    const param = {
 | 
			
		||||
        action: 101,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,17 +1,18 @@
 | 
			
		|||
<template>
 | 
			
		||||
    {{ project_name }}
 | 
			
		||||
    <div class="room-div">
 | 
			
		||||
        <el-card>
 | 
			
		||||
            <div>
 | 
			
		||||
                <el-button type="primary">项目管理</el-button>
 | 
			
		||||
                <el-button type="primary" @click="router.push('home')">项目管理</el-button>
 | 
			
		||||
                <el-button type="success">项目预览</el-button>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
                <el-button type="primary" class="add-btn" :icon="Plus" @click="addRoom">新建</el-button>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="room-list">
 | 
			
		||||
                <div v-for="(item, index) in room_data.list" :key="index" class="room-span">
 | 
			
		||||
                    <span>{{ item.name }}</span>
 | 
			
		||||
                    <span>{{ item.number }}</span>
 | 
			
		||||
                <div v-for="(item, index) in project.content" :key="index" class="room-span">
 | 
			
		||||
                    <span>{{ item.room_name }}</span>
 | 
			
		||||
                    <span>{{ item.room_count }}</span>
 | 
			
		||||
                    <el-button type="danger" :icon="Delete" circle />
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -23,11 +24,8 @@
 | 
			
		|||
                    <div class="div300">
 | 
			
		||||
                        <span>房型名称:</span>
 | 
			
		||||
                        <el-select v-model="form.roomName" placeholder="请选择">
 | 
			
		||||
                            <el-option
 | 
			
		||||
                            v-for="item in options"
 | 
			
		||||
                            :key="item.value"
 | 
			
		||||
                            :label="item.label"
 | 
			
		||||
                            :value="item.value">
 | 
			
		||||
                            <el-option v-for="item in options" :key="item.value" :label="item.label"
 | 
			
		||||
                                :value="item.value">
 | 
			
		||||
                            </el-option>
 | 
			
		||||
                        </el-select>
 | 
			
		||||
                    </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +38,7 @@
 | 
			
		|||
            <div class="div-2">
 | 
			
		||||
                <span class="name name2">灯光信息</span>
 | 
			
		||||
                <div class="flex-center bar">
 | 
			
		||||
                    <div v-for="(item,i) in lightArr" :key="item.label"> 
 | 
			
		||||
                    <div v-for="(item, i) in lightArr" :key="item.label">
 | 
			
		||||
                        <p>{{ item.label }}</p>
 | 
			
		||||
                        <p>
 | 
			
		||||
                            <el-input-number v-model="form.num100" :min="1" :max="100"></el-input-number>
 | 
			
		||||
| 
						 | 
				
			
			@ -53,13 +51,16 @@
 | 
			
		|||
                <div class="flex-center bar">
 | 
			
		||||
                    <div>盘管类型</div>
 | 
			
		||||
                    <el-radio-group v-model="form.type1">
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value" v-for="(item,index) in radioGroup1">{{item.label}}</el-radio>
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value"
 | 
			
		||||
                            v-for="(item, index) in radioGroup1">{{ item.label }}</el-radio>
 | 
			
		||||
                    </el-radio-group>
 | 
			
		||||
                    <el-radio-group v-model="form.type2">
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value" v-for="(item,index) in radioGroup2">{{item.label}}</el-radio>
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value"
 | 
			
		||||
                            v-for="(item, index) in radioGroup2">{{ item.label }}</el-radio>
 | 
			
		||||
                    </el-radio-group>
 | 
			
		||||
                    <el-radio-group v-model="form.type3">
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value" v-for="(item,index) in radioGroup3">{{item.label}}</el-radio>
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value"
 | 
			
		||||
                            v-for="(item, index) in radioGroup3">{{ item.label }}</el-radio>
 | 
			
		||||
                    </el-radio-group>
 | 
			
		||||
                    <div>
 | 
			
		||||
                        <p>温控器数量</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -74,7 +75,8 @@
 | 
			
		|||
                <div class="flex-center bar">
 | 
			
		||||
                    <div>面板类型</div>
 | 
			
		||||
                    <el-radio-group v-model="form.type4">
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value" v-for="(item,index) in radioGroup4">{{item.label}}</el-radio>
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value"
 | 
			
		||||
                            v-for="(item, index) in radioGroup4">{{ item.label }}</el-radio>
 | 
			
		||||
                    </el-radio-group>
 | 
			
		||||
                    <div>
 | 
			
		||||
                        <p>面板数量</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -95,7 +97,8 @@
 | 
			
		|||
                <div class="flex-center bar">
 | 
			
		||||
                    <div>窗帘类型</div>
 | 
			
		||||
                    <el-radio-group v-model="form.type5">
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value" v-for="(item,index) in radioGroup5">{{item.label}}</el-radio>
 | 
			
		||||
                        <el-radio :label="item.value" :key="item.value"
 | 
			
		||||
                            v-for="(item, index) in radioGroup5">{{ item.label }}</el-radio>
 | 
			
		||||
                    </el-radio-group>
 | 
			
		||||
                    <div>
 | 
			
		||||
                        <p>窗帘数量</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -115,7 +118,7 @@
 | 
			
		|||
                <span class="name name6">其他信息</span>
 | 
			
		||||
                <div class="con-div">
 | 
			
		||||
                    <div class="flex-center bar">
 | 
			
		||||
                        <div v-for="(item,i) in otherArr" :key="item.label"> 
 | 
			
		||||
                        <div v-for="(item, i) in otherArr" :key="item.label">
 | 
			
		||||
                            <p>{{ item.label }}</p>
 | 
			
		||||
                            <p>
 | 
			
		||||
                                <el-input-number v-model="form.num101" :min="1" :max="100"></el-input-number>
 | 
			
		||||
| 
						 | 
				
			
			@ -123,8 +126,9 @@
 | 
			
		|||
                        </div>
 | 
			
		||||
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <el-checkbox-group v-model="form.checkone" class="rules-label" >
 | 
			
		||||
                        <el-checkbox v-for="(item,i) in checkList" :label="item.label" :key="item.value" :value="item.value" >
 | 
			
		||||
                    <el-checkbox-group v-model="form.checkone" class="rules-label">
 | 
			
		||||
                        <el-checkbox v-for="(item, i) in checkList" :label="item.label" :key="item.value"
 | 
			
		||||
                            :value="item.value">
 | 
			
		||||
                            {{ item.label }}
 | 
			
		||||
                        </el-checkbox>
 | 
			
		||||
                    </el-checkbox-group>
 | 
			
		||||
| 
						 | 
				
			
			@ -144,9 +148,64 @@
 | 
			
		|||
</template>
 | 
			
		||||
<script setup>
 | 
			
		||||
import { Delete } from '@element-plus/icons-vue'
 | 
			
		||||
import { ref, reactive } from 'vue'
 | 
			
		||||
import { onMounted, ref, reactive } from 'vue'
 | 
			
		||||
import { usrRoomStore } from '../store/project'
 | 
			
		||||
import { Plus } from '@element-plus/icons-vue'
 | 
			
		||||
import myApi from "@/api/myApi.js";
 | 
			
		||||
import { useRoute, useRouter } from 'vue-router'
 | 
			
		||||
 | 
			
		||||
const router = useRouter()
 | 
			
		||||
const route = useRoute()
 | 
			
		||||
 | 
			
		||||
const project = reactive({
 | 
			
		||||
    name: "",
 | 
			
		||||
    description: "",
 | 
			
		||||
    content: [],
 | 
			
		||||
});
 | 
			
		||||
const get_project = async () => {
 | 
			
		||||
    const param = {
 | 
			
		||||
        action: 100,
 | 
			
		||||
        data: {
 | 
			
		||||
            name: route.query.project_name,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    const res = await myApi.getProjects(param);
 | 
			
		||||
    if (res.code === 0) {
 | 
			
		||||
        project.name = res.data.name;
 | 
			
		||||
        project.description = res.data.description;
 | 
			
		||||
        if (Array.isArray(res.data.content)) {
 | 
			
		||||
            project.content = res.data.content;
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        ElMessage({
 | 
			
		||||
            message: res.message,
 | 
			
		||||
            type: "warning",
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
    get_project();
 | 
			
		||||
    if (project.content.length ===0) {
 | 
			
		||||
        add_room();
 | 
			
		||||
    }
 | 
			
		||||
});
 | 
			
		||||
const room_info = reactive({
 | 
			
		||||
    room_name: '',
 | 
			
		||||
    room_count: 1,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
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)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const room_data = usrRoomStore();
 | 
			
		||||
const new_room = reactive({
 | 
			
		||||
| 
						 | 
				
			
			@ -157,7 +216,7 @@ const new_room = reactive({
 | 
			
		|||
const options = reactive([{
 | 
			
		||||
    label: '房型A',
 | 
			
		||||
    value: 1,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '房型B',
 | 
			
		||||
    value: 2,
 | 
			
		||||
}])
 | 
			
		||||
| 
						 | 
				
			
			@ -176,89 +235,89 @@ const form = reactive({
 | 
			
		|||
    chlnum: 0,
 | 
			
		||||
    chshnum: 0,
 | 
			
		||||
    checkone: [],
 | 
			
		||||
    desc:''
 | 
			
		||||
    desc: ''
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
const lightArr = reactive([{
 | 
			
		||||
    label: '开关回路',
 | 
			
		||||
    value: 1,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '0-10V调光',
 | 
			
		||||
    value: 2,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '前沿调光',
 | 
			
		||||
    value: 3,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '后沿调光',
 | 
			
		||||
    value: 4,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: 'DALI灯',
 | 
			
		||||
    value: 5,
 | 
			
		||||
}])
 | 
			
		||||
const otherArr = reactive([{
 | 
			
		||||
    label: '红外',
 | 
			
		||||
    value: 1,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '双鉴红外',
 | 
			
		||||
    value: 2,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '门磁',
 | 
			
		||||
    value: 3,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '窗磁',
 | 
			
		||||
    value: 4,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '门铃',
 | 
			
		||||
    value: 5,
 | 
			
		||||
}])
 | 
			
		||||
const radioGroup1 = reactive([{
 | 
			
		||||
    label: '普通三速风机',
 | 
			
		||||
    value: 1,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '直流无刷风机',
 | 
			
		||||
    value: 2,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '三方协议风机',
 | 
			
		||||
    value: 3,
 | 
			
		||||
}])
 | 
			
		||||
const radioGroup2 = reactive([{
 | 
			
		||||
    label: '两管制',
 | 
			
		||||
    value: 4,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '四管制',
 | 
			
		||||
    value: 5,
 | 
			
		||||
}])
 | 
			
		||||
const radioGroup3 = reactive([{
 | 
			
		||||
    label: '两通阀',
 | 
			
		||||
    value: 6,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '调节阀',
 | 
			
		||||
    value: 7,
 | 
			
		||||
}])
 | 
			
		||||
const radioGroup4 = reactive([{
 | 
			
		||||
    label: '普通面板(无背光)',
 | 
			
		||||
    value: 8,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '普通面板(带背光)',
 | 
			
		||||
    value: 9,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '协议面板',
 | 
			
		||||
    value: 10,
 | 
			
		||||
}])
 | 
			
		||||
const radioGroup5 = reactive([{
 | 
			
		||||
    label: '干接点电机',
 | 
			
		||||
    value: 11,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: '485电机',
 | 
			
		||||
    value: 12,
 | 
			
		||||
}])
 | 
			
		||||
const checkList = reactive([{
 | 
			
		||||
    label: 'DND',
 | 
			
		||||
    value: 11,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: 'MUR',
 | 
			
		||||
    value: 12,
 | 
			
		||||
},{
 | 
			
		||||
}, {
 | 
			
		||||
    label: 'SOS',
 | 
			
		||||
    value: 13,
 | 
			
		||||
}])
 | 
			
		||||
| 
						 | 
				
			
			@ -284,7 +343,7 @@ const check = () => {
 | 
			
		|||
        ::v-deep .el-card__body {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            flex-direction: column;
 | 
			
		||||
            height:95%;
 | 
			
		||||
            height: 95%;
 | 
			
		||||
 | 
			
		||||
            >div {
 | 
			
		||||
                margin: 10px 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -317,39 +376,47 @@ const check = () => {
 | 
			
		|||
        ::v-deep .el-card__body {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            flex-direction: column;
 | 
			
		||||
            height:95%;
 | 
			
		||||
            height: 95%;
 | 
			
		||||
            justify-content: space-between;
 | 
			
		||||
 | 
			
		||||
            >div {
 | 
			
		||||
                border: 1px solid #ddd;
 | 
			
		||||
                display: flex;
 | 
			
		||||
                border-radius: 8px;
 | 
			
		||||
 | 
			
		||||
                .name {
 | 
			
		||||
                    width: 50px;
 | 
			
		||||
                    color:#fff;
 | 
			
		||||
                    color: #fff;
 | 
			
		||||
                    font-size: 18px;
 | 
			
		||||
                    justify-content: center;
 | 
			
		||||
                    display: flex;
 | 
			
		||||
                    align-items: center;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                .name1 {
 | 
			
		||||
                    background: #de868f;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                .name2 {
 | 
			
		||||
                    background: #e99d42;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                .name3 {
 | 
			
		||||
                    background: #cba43f;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                .name4 {
 | 
			
		||||
                    background: #bfbf3d;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                .name5 {
 | 
			
		||||
                    background: #54bcbd;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                .name6 {
 | 
			
		||||
                    background: #e99d42;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                .name7 {
 | 
			
		||||
                    background: #cd42e9;
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			@ -358,27 +425,35 @@ const check = () => {
 | 
			
		|||
            .div-1 {
 | 
			
		||||
                height: 10%;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .div-2 {
 | 
			
		||||
                height: 12%;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .div-3 {
 | 
			
		||||
                height: 12%;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .div-4 {
 | 
			
		||||
                height: 12%;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .div-5 {
 | 
			
		||||
                height: 12%;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .div-6 {
 | 
			
		||||
                height: 20%;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .div-7 {
 | 
			
		||||
                height: 15%;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .el-radio-group {
 | 
			
		||||
                width: 160px !important;
 | 
			
		||||
                display: flex;
 | 
			
		||||
 | 
			
		||||
                .el-radio {
 | 
			
		||||
                    width: 100%;
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			@ -387,35 +462,43 @@ const check = () => {
 | 
			
		|||
 | 
			
		||||
        .con-div {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            justify-content:space-around;
 | 
			
		||||
            justify-content: space-around;
 | 
			
		||||
            flex-direction: column;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .con-div100 {
 | 
			
		||||
            width: 96%;
 | 
			
		||||
            height: 100%;
 | 
			
		||||
            padding: 5px;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ::v-deep .el-textarea__inner {
 | 
			
		||||
            height: 80px !important;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        p {
 | 
			
		||||
            margin: 8px;
 | 
			
		||||
        }
 | 
			
		||||
        .bar{
 | 
			
		||||
 | 
			
		||||
        .bar {
 | 
			
		||||
            width: 100%;
 | 
			
		||||
            padding: 10px;
 | 
			
		||||
 | 
			
		||||
            >div {
 | 
			
		||||
                margin-right: 10px;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .div300 {
 | 
			
		||||
            width: 300px;
 | 
			
		||||
            display: flex;
 | 
			
		||||
            align-items: center;
 | 
			
		||||
 | 
			
		||||
            span {
 | 
			
		||||
                flex-shrink: 0;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}</style>
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
| 
						 | 
				
			
			@ -15,6 +15,7 @@ export default defineConfig({
 | 
			
		|||
    proxy: {
 | 
			
		||||
      '/api': {
 | 
			
		||||
        target: 'http://api.shikicc.com:58909',
 | 
			
		||||
        // target: 'http://10.10.10.4:3000',
 | 
			
		||||
        changeOrigin: true,
 | 
			
		||||
        rewrite: path => path.replace(/^\/api/, '/api')
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue