|
@@ -0,0 +1,268 @@
|
|
|
+<template>
|
|
|
+ <div class="yui-tree-box">
|
|
|
+ <select-space></select-space>
|
|
|
+ <div class="hui-tree-content">
|
|
|
+ <div class="outdoor box-background">
|
|
|
+ <div class="outdoor-box">
|
|
|
+ <div class="outdoor-center">
|
|
|
+ <div class="bim-box" style="margin-top: 0;">
|
|
|
+ <model ref="model" type="outdoor" fileId="10000780512264"></model>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="outdoor-right color-font">
|
|
|
+ <div class="outdoor-light-all">
|
|
|
+ <div class="hui-chart-title">
|
|
|
+ 照明控制
|
|
|
+ </div>
|
|
|
+ <div class="light-box">
|
|
|
+ <span class="light-label">
|
|
|
+ 照明群控
|
|
|
+ </span>
|
|
|
+ <div class="light-operation">
|
|
|
+ <i class="iconfont huifont-zhaoming"></i>
|
|
|
+ <span class="label">{{allChecked?'全关':'全开'}}</span>
|
|
|
+ <el-switch v-model="allChecked" @change="changeAllChecked"></el-switch>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="outdoor-light">
|
|
|
+ <div class="outdoor-operation-title">
|
|
|
+ <div class="hui-chart-title">
|
|
|
+ 照明控制
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="outdoor-operation-list">
|
|
|
+ <div class="light-box">
|
|
|
+ <span class="light-label">
|
|
|
+ 独立控制
|
|
|
+ </span>
|
|
|
+ <div class="light-operation" v-if="checkList.length > 0">
|
|
|
+ <el-button size="mini" type="primary" @click="open(true)">打开</el-button>
|
|
|
+ <el-button size="mini" @click="open(false)">关闭</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-checkbox-group class="outdoor-operation-box" v-model="checkList">
|
|
|
+ <div class="outdoor-operation-item" v-for="(item,index) in itemList" :key="item.id">
|
|
|
+ <div class="outdoor-operation-box">
|
|
|
+ <el-checkbox :label="item.id">
|
|
|
+ {{item.name}}
|
|
|
+ </el-checkbox>
|
|
|
+ <span class="label color-primary" v-if="item.isOpen">打开</span>
|
|
|
+ <span class="label" v-else>关闭</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import testAlarm from '@/components/work/common/testAlarm'
|
|
|
+ import selectSpace from '@/components/work/common/selectSpace'
|
|
|
+ import model from '@/components/work/common/model'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ allChecked: false,
|
|
|
+ checkList: [],
|
|
|
+ itemList: [{
|
|
|
+ id: 1,
|
|
|
+ name: '1F',
|
|
|
+ isOpen: false,
|
|
|
+ elementId: '834601'
|
|
|
+ }, {
|
|
|
+ id: 2,
|
|
|
+ name: '2F',
|
|
|
+ isOpen: false,
|
|
|
+ elementId: '856814'
|
|
|
+ }, {
|
|
|
+ id: 3,
|
|
|
+ name: '3F',
|
|
|
+ isOpen: false,
|
|
|
+ elementId: '883538'
|
|
|
+ }, {
|
|
|
+ id: 4,
|
|
|
+ name: '外墙',
|
|
|
+ isOpen: false,
|
|
|
+ elementId: '912369'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ name() {
|
|
|
+
|
|
|
+ },
|
|
|
+ changeAllChecked(val) {
|
|
|
+ this.$refs.model.outdoor(val, this.itemList.map(node => node.elementId));
|
|
|
+ for (var i = 0; i < this.itemList.length; i++) {
|
|
|
+ this.itemList[i].isOpen = val;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ open(isOpen) {
|
|
|
+ let data = this.itemList.filter(node => this.checkList.filter(res => res === node.id).length > 0);
|
|
|
+ this.$refs.model.outdoor(isOpen, data.map(node => node.elementId));
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ data[i].isOpen = isOpen;
|
|
|
+ }
|
|
|
+ this.allChecked = this.itemList.filter(res => !res.isOpen) == 0;
|
|
|
+ this.checkList = [];
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ testAlarm,
|
|
|
+ selectSpace,
|
|
|
+ model
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .outdoor {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ padding: 20px;
|
|
|
+ overflow: auto;
|
|
|
+
|
|
|
+ .outdoor-box {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ min-width: 1100px;
|
|
|
+ min-height: 699px;
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+
|
|
|
+ .outdoor-center {
|
|
|
+ flex: 1;
|
|
|
+ width: 0;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .outdoor-right {
|
|
|
+ height: 100%;
|
|
|
+ width: 350px;
|
|
|
+ margin-left: 12px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .outdoor-title {
|
|
|
+ padding: 20px 20px 0 20px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .outdoor-light-all {
|
|
|
+ padding: 20px 10px 20px 20px;
|
|
|
+ background: rgba(0, 4, 10, 0.3);
|
|
|
+ }
|
|
|
+
|
|
|
+ .outdoor-light {
|
|
|
+ margin-top: 12px;
|
|
|
+ background: rgba(0, 4, 10, 0.3);
|
|
|
+ flex: 1;
|
|
|
+ height: 0;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .outdoor-operation-title {
|
|
|
+ padding: 20px 20px 0px 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .outdoor-operation-list {
|
|
|
+ flex: 1;
|
|
|
+ height: 0;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: 0 10px 0 20px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .outdoor-operation-box {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+
|
|
|
+ .outdoor-operation-item {
|
|
|
+ flex: 1;
|
|
|
+ margin-top: 10px;
|
|
|
+ width: 0;
|
|
|
+ min-width: 50%;
|
|
|
+ padding-right: 10px;
|
|
|
+
|
|
|
+ .outdoor-operation-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 16px;
|
|
|
+ height: 48px;
|
|
|
+ background: #1E2430;
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .label {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-checkbox {
|
|
|
+ flex: 1;
|
|
|
+ width: 0;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .light-box {
|
|
|
+ height: 68px;
|
|
|
+ background: #1E2430;
|
|
|
+ border-radius: 8px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 16px;
|
|
|
+ padding: 0 20px;
|
|
|
+ margin-right: 10px;
|
|
|
+
|
|
|
+ .huifont-zhaoming {
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .light-operation {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .label {
|
|
|
+ margin: 0 8px 0 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-switch {
|
|
|
+ .el-switch__core {
|
|
|
+ width: 24px !important;
|
|
|
+ height: 12px;
|
|
|
+ line-height: 12px;
|
|
|
+ background: rgba(255, 255, 255, 0.2);
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-switch.is-checked .el-switch__core {
|
|
|
+ background: $--color-primary;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-switch .el-switch__core::after {
|
|
|
+ width: 10px;
|
|
|
+ height: 10px;
|
|
|
+ top: 1px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-switch.is-checked .el-switch__core::after {
|
|
|
+ margin-left: -10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|