Browse Source

fix:电梯系统/照明系统 代码规范

temp
chenpingsen 2 months ago
parent
commit
a9e6998430
  1. 68
      hx-ai-intelligent/src/view/equipmentControl/liftSystem/index.vue
  2. 171
      hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftInfo.vue
  3. 450
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue
  4. 239
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue
  5. 891
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
  6. 329
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue
  7. 330
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue

68
hx-ai-intelligent/src/view/equipmentControl/liftSystem/index.vue

@ -1,53 +1,47 @@
<template> <template>
<div class="map-box"> <div class="map-box">
<div class="map"> <div class="map">
<liftInfo></liftInfo> <liftInfo />
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import liftInfo from './liftInfo.vue' import liftInfo from './liftInfo.vue';
// //
import { message } from 'ant-design-vue';
// =========================================================== // ===========================================================
onMounted(() => { onMounted(() => {});
})
// tab ========================================================
//
const dataSource = ref([]);
// tab ========================================================
//
const dataSource = ref([]);
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.map-box { .map-box {
// //
// - - - // - - -
--on: #0DFFA4; --on: #0dffa4;
// //
--off: #BFCDE2; --off: #bfcde2;
// - // -
--pause: #FFBC46; --pause: #ffbc46;
// - // -
--stop: #F36163; --stop: #f36163;
// //
--fault: #FF7636; --fault: #ff7636;
// //
--unknown: #A742FF; --unknown: #a742ff;
width: 100%; width: 100%;
height: 100%; height: 100%;
.map { .map {
width: 1280px; width: 1280px;
height: 720px; height: 720px;
background-image: url(../image/bg.jpg); background-image: url(../image/bg.jpg);
}
} }
}
</style> </style>

171
hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftInfo.vue

@ -10,7 +10,7 @@
<div class="item-box"> <div class="item-box">
<div class="icon"> <div class="icon">
<div class="icon-item"> <div class="icon-item">
<img src="../image/liftState/lift-normal.svg" alt=""> <img src="../image/liftState/lift-normal.svg" alt="" />
</div> </div>
</div> </div>
</div> </div>
@ -21,7 +21,7 @@
<div class="item-box"> <div class="item-box">
<div class="icon"> <div class="icon">
<div class="icon-item"> <div class="icon-item">
<img src="../image/liftState/lift-normal.svg" alt=""> <img src="../image/liftState/lift-normal.svg" alt="" />
</div> </div>
</div> </div>
</div> </div>
@ -32,7 +32,7 @@
<div class="item-box"> <div class="item-box">
<div class="icon"> <div class="icon">
<div class="icon-item"> <div class="icon-item">
<img src="../image/liftState/lift-normal.svg" alt=""> <img src="../image/liftState/lift-normal.svg" alt="" />
</div> </div>
</div> </div>
</div> </div>
@ -43,109 +43,104 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
// //
// =========================================================== // ===========================================================
onMounted(() => { onMounted(() => {});
})
// tab ========================================================
//
const runState = ref('1');
//
const liftState = ref('2');
// tab ========================================================
//
const runState = ref('1');
//
const liftState = ref('2');
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
// //
.info-box { .info-box {
// //
--text: rgb(20, 255, 255); --text: rgb(20, 255, 255);
width: 240px; width: 240px;
height: 130px; height: 130px;
display: flex;
gap: 5px;
flex-direction: column;
background: rgb(17, 44, 86, 0.9);
border-radius: 8px;
box-sizing: border-box;
padding: 8px;
border: 3px solid var(--text);
//
.box-title {
height: auto;
color: var(--text);
//
.dot {
display: inline-block;
width: 2px;
height: 16px;
vertical-align: middle;
background: var(--text);
}
//
span {
padding-left: 8px;
}
}
//
.box-inner {
flex: 1;
display: flex; display: flex;
padding: 0 10px; gap: 5px;
// 3 flex-direction: column;
.item { background: rgb(17, 44, 86, 0.9);
border-radius: 8px;
box-sizing: border-box;
padding: 8px;
border: 3px solid var(--text);
//
.box-title {
height: auto;
color: var(--text);
//
.dot {
display: inline-block;
width: 2px;
height: 16px;
vertical-align: middle;
background: var(--text);
}
//
span {
padding-left: 8px;
}
}
//
.box-inner {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; padding: 0 10px;
// // 3
.item-box { .item {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; flex-direction: column;
justify-content: center; //
// border: 1px solid red; .item-box {
.icon { flex: 1;
width: 55px; display: flex;
height: 55px; align-items: center;
background-image: url(../image/box.svg); justify-content: center;
background-size: 130% 130%;
background-repeat: no-repeat;
background-position: left -8px top -8px;
// border: 1px solid red; // border: 1px solid red;
position: relative; .icon {
.icon-item { width: 55px;
position: absolute; height: 55px;
width: 20px; background-image: url(../image/box.svg);
height: 20px; background-size: 130% 130%;
left: 0; background-repeat: no-repeat;
right: 0; background-position: left -8px top -8px;
bottom: 0; // border: 1px solid red;
top: 0; position: relative;
margin: auto; .icon-item {
img { position: absolute;
width: 100%; width: 20px;
height: 100%; height: 20px;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
img {
width: 100%;
height: 100%;
}
} }
} }
} }
} .item-text {
.item-text { height: 20px;
height: 20px; text-align: center;
text-align: center; font-size: 12px;
font-size: 12px; color: white;
color: white; user-select: none;
user-select: none; }
} }
} }
} }
}
</style> </style>

450
hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue

@ -1,286 +1,276 @@
<template> <template>
<div class="lighting-box"> <div class="lighting-box">
<div class="lighting-img-box"> <div class="lighting-img-box">
<!-- 左上角区域切换 --> <!-- 左上角区域切换 -->
<div class="btn-box"> <div class="btn-box">
<button v-for="item in floorData" class="btn-item" @click=changeFloor(item.childList)>{{ item.name }}</button> <button v-for="item in floorData" class="btn-item" @click="changeFloor(item.childList)">{{
item.name
}}</button>
</div>
<!-- 楼层区域 -->
<div class="area">
<div
v-for="(item, index) in treeData"
:class="computedClass(item.id)"
@click="changeThisArea([item])"
:key="index">
<div v-for="(v, i) in item.childList" :key="i" class="light-group">
<div class="group-shadow" @click.stop="changeThisArea([item, v])">
<div :class="computedClass(v.id)" class="shadow-box"></div>
</div> </div>
<!-- 楼层区域 --> </div>
<div class="area">
<div
v-for="(item, index) in treeData"
:class="computedClass(item.id)"
@click="changeThisArea([item])"
:key="index">
<div v-for="(v, i) in item.childList" :key="i" class="light-group">
<div class="group-shadow" @click.stop="changeThisArea([item, v])">
<div :class="computedClass(v.id)" class="shadow-box"></div>
</div>
</div>
</div>
</div>
<!-- 照明设备 -->
<div class="lights">
<light v-for="(item, index) in bulbs"
:key="index"
:styleObject="item.styleText"
:type="item.type"
:visible="item.visible">
</light>
</div>
</div>
<!-- 右侧抽屉的触发按钮 -->
<div class="drawer-box-in" v-if="!visible" @click="toggleDrawer">
<double-left-outlined class="drawer-icon" style="color: white" />
</div>
<!-- 左侧抽屉的关闭按钮 -->
<div class="drawer-box-out" v-if="visible" @click="toggleDrawer">
<double-right-outlined class="drawer-icon" style="color: white;" />
</div> </div>
<!-- 右侧抽屉 --> </div>
<a-drawer <!-- 照明设备 -->
v-model:visible="visible" <div class="lights">
class="drawer-item" <light
width="496" v-for="(item, index) in bulbs"
:forceRender="preload" :key="index"
placement="right" :styleObject="item.styleText"
:body-style="{ background: 'rgba(0, 0, 0)', opacity: 0.8 }" :type="item.type"
:closable="false" :visible="item.visible" />
id="drawer" </div>
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板">
<tabs1
ref="tabs1Ref"
@changeArea="changeArea"
@reset="reset"
:treeData="treeData"
></tabs1>
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<tabs2></tabs2>
</a-tab-pane>
<a-tab-pane key="3" tab="日志">
<tabs3></tabs3>
</a-tab-pane>
</a-tabs>
</a-drawer>
</div> </div>
<!-- 右侧抽屉的触发按钮 -->
<div class="drawer-box-in" v-if="!visible" @click="toggleDrawer">
<double-left-outlined class="drawer-icon" style="color: white" />
</div>
<!-- 左侧抽屉的关闭按钮 -->
<div class="drawer-box-out" v-if="visible" @click="toggleDrawer">
<double-right-outlined class="drawer-icon" style="color: white" />
</div>
<!-- 右侧抽屉 -->
<a-drawer
v-model:visible="visible"
class="drawer-item"
width="496"
:forceRender="preload"
placement="right"
:body-style="{ background: 'rgba(0, 0, 0)', opacity: 0.8 }"
:closable="false"
id="drawer"
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板">
<tabs1 ref="tabs1Ref" @changeArea="changeArea" @reset="reset" :treeData="treeData" />
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<tabs2 />
</a-tab-pane>
<a-tab-pane key="3" tab="日志">
<tabs3 />
</a-tab-pane>
</a-tabs>
</a-drawer>
</div>
</template> </template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
//
import light from './light.vue';
import tabs1 from './tabs1.vue'
import tabs2 from './tabs2.vue'
import tabs3 from './tabs3.vue'
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
// ICON
import {
DoubleLeftOutlined,
DoubleRightOutlined
} from '@ant-design/icons-vue';
<script setup lang="ts">
import { ref, onMounted } from 'vue';
//
import light from './light.vue';
import tabs1 from './tabs1.vue';
import tabs2 from './tabs2.vue';
import tabs3 from './tabs3.vue';
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
// ICON
import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons-vue';
// ======================================================= // =======================================================
onMounted(() => { onMounted(() => {
// 线 // 线
getAllArea() getAllArea();
}) });
// flagref
const preload = ref(false)
// flagref
const preload = ref(false);
// ===================================================== // =====================================================
// //
const floorData = ref([]) const floorData = ref([]);
// //
const changeFloor = (area: any) => { const changeFloor = (area: any) => {
// //
reset() reset();
// //
changeArea(['1']) changeArea(['1']);
// //
treeData.value = area treeData.value = area;
// //
treeData.value[0].selected = true treeData.value[0].selected = true;
} };
// =====================================================
// ===================================================== //
const treeData = ref([]);
// // -
const treeData = ref([]) const area = ref(['1']);
// - // 线 -
const area = ref(['1']) const bulbs = ref([
// 线 -
const bulbs = ref([
{ {
styleText: { left: '180px', bottom: '200px' }, styleText: { left: '180px', bottom: '200px' },
area: 1, area: 1,
type: 1, type: 1,
visible: true visible: true,
}, },
{ {
styleText: { left: '230px', bottom: '125px' }, styleText: { left: '230px', bottom: '125px' },
area: 1, area: 1,
type: 2, type: 2,
visible: true visible: true,
}, },
{ {
styleText: { left: '320px', bottom: '140px' }, styleText: { left: '320px', bottom: '140px' },
area: 1, area: 1,
type: 3, type: 3,
visible: true visible: true,
}, },
{ {
styleText: { left: '245px', bottom: '230px' }, styleText: { left: '245px', bottom: '230px' },
area: 1, area: 1,
type: 3, type: 3,
visible: true visible: true,
}, },
{ {
styleText: { left: '405px', bottom: '230px' }, styleText: { left: '405px', bottom: '230px' },
area: 2, area: 2,
type: 3, type: 3,
visible: true visible: true,
}, },
{ {
styleText: { left: '460px', bottom: '180px' }, styleText: { left: '460px', bottom: '180px' },
area: 2, area: 2,
type: 3, type: 3,
visible: true visible: true,
}, },
{ {
styleText: { left: '360px', bottom: '275px' }, styleText: { left: '360px', bottom: '275px' },
area: 2, area: 2,
type: 3, type: 3,
visible: true visible: true,
}, },
{ {
styleText: { left: '715px', bottom: '320px' }, styleText: { left: '715px', bottom: '320px' },
area: 3, area: 3,
type: 1, type: 1,
visible: true visible: true,
}, },
]) ]);
// 线 // 线
const changeArea = (result: any) => { const changeArea = (result: any) => {
console.log(result,'changeArea') console.log(result, 'changeArea');
// //
if (Array.isArray(result)) { if (Array.isArray(result)) {
area.value = result area.value = result;
// //
} else { } else {
area.value.length = 0 area.value.length = 0;
area.value[0] = String(result) area.value[0] = String(result);
} }
} };
// //
const changeThisArea = (result: any) => { const changeThisArea = (result: any) => {
console.log(result, 'changeThisArea') console.log(result, 'changeThisArea');
// //
reset() reset();
let level1 = result[0]; let level1 = result[0];
area.value.length = 0 area.value.length = 0;
// //
if (result.length === 1) { if (result.length === 1) {
result[0].selected = true result[0].selected = true;
area.value.push(result[0].id) area.value.push(result[0].id);
// //
tabs1Ref.value.changeArea(result[0]) tabs1Ref.value.changeArea(result[0]);
// + 线 // + 线
} else if (result.length === 2) { } else if (result.length === 2) {
// //
if (!level1) { if (!level1) {
level1 = treeData.value[0] level1 = treeData.value[0];
} }
// true // true
level1.selected = result[1].selected = true level1.selected = result[1].selected = true;
area.value.splice(0, 0, level1.id, result[1].id) area.value.splice(0, 0, level1.id, result[1].id);
// //
tabs1Ref.value.changeArea(result[0]) tabs1Ref.value.changeArea(result[0]);
tabs1Ref.value.changeLine(result[1]) tabs1Ref.value.changeLine(result[1]);
} }
} };
// //
const reset = () => { const reset = () => {
treeData.value.forEach((item: any) => { treeData.value.forEach((item: any) => {
item.selected = false item.selected = false;
item.childList.forEach((i: any) => { item.childList.forEach((i: any) => {
i.selected = false i.selected = false;
}) });
}) });
} };
// //
const computedClass = (string: string) => { const computedClass = (string: string) => {
if (area.value.indexOf(string) != -1) { if (area.value.indexOf(string) != -1) {
return `isActive area-item area${string}` return `isActive area-item area${string}`;
} else { } else {
return `area-item area${string}` return `area-item area${string}`;
} }
} };
// //
const getAllArea = () => { const getAllArea = () => {
http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then(res => { http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then((res) => {
const data = res.data const data = res.data;
floorData.value = data floorData.value = data;
/** 使 /** 使
* @param id 用于判断样式和层级的前端属性 * @param id 用于判断样式和层级的前端属性
* @param selected 用于表示是否选中的前端属性 * @param selected 用于表示是否选中的前端属性
*/ */
data.forEach((floor: any) => { data.forEach((floor: any) => {
floor.childList.forEach((item: any, index: number) => { floor.childList.forEach((item: any, index: number) => {
if (index == 0) { if (index == 0) {
item.selected = true item.selected = true;
} else { } else {
item.selected = false item.selected = false;
} }
item.id = String(index + 1) item.id = String(index + 1);
item.childList.forEach((v: any, i: number) => { item.childList.forEach((v: any, i: number) => {
v.selected = false v.selected = false;
v.id = (index + 1) + '-' + (i + 1) v.id = index + 1 + '-' + (i + 1);
}) });
}) });
}) });
// 线 1-1 // 线 1-1
treeData.value = data[0].childList treeData.value = data[0].childList;
// //
preload.value = true preload.value = true;
}) });
} };
// ===================================================== // =====================================================
// - tab // - tab
let activeKey = ref('1'); let activeKey = ref('1');
// - // -
let visible = ref(false); let visible = ref(false);
// - // -
const toggleDrawer = () => { const toggleDrawer = () => {
visible.value = !visible.value; visible.value = !visible.value;
}; };
// tab1 // tab1
const tabs1Ref = ref() const tabs1Ref = ref();
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "./index.less"; @import './index.less';
//
.isActive { //
.isActive {
border: 3px solid white !important; border: 3px solid white !important;
} }
// tab
:deep(.ant-tabs-tab-btn) { // tab
:deep(.ant-tabs-tab-btn) {
color: white; color: white;
} }
</style> </style>

239
hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue

@ -1,59 +1,59 @@
<template> <template>
<a-popover color="rgba(0, 0, 0, 0.8)"> <a-popover color="rgba(0, 0, 0, 0.8)">
<template #content> <template #content>
<div class="light-tag"> <div class="light-tag">
<div class="light-tag-tit"> <div class="light-tag-tit">
<div> <div>
<img src="/asset/image//bulbLogo/21962.png" alt="" /> <img src="/asset/image//bulbLogo/21962.png" alt="" />
<span class="tag-text">{{ result.name }}</span> <span class="tag-text">{{ result.name }}</span>
</div> </div>
<button class="right-button">{{ type == 1 ? '正常' : '关闭' }}</button> <button class="right-button">{{ type == 1 ? '正常' : '关闭' }}</button>
</div>
<div class="light-tag-box">
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制模式</span>
<span class="result">自动</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">亮度</span>
<span class="result">{{ result.brightness }}</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制场景</span>
<span class="result">{{ result.automatic2 }}</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">色温</span>
<span class="result">{{ result.brightness3 }}</span>
</div>
</div>
</div>
</template>
<div class="icon-box" :style="styleObject" v-show="visible">
<img v-if="type == 1" class="icon-item" src="/asset/image/bulbLogo/22394.png" alt="">
<img v-if="type == 2" class="icon-item" src="/asset/image/bulbLogo/22396.png" alt="">
<img v-if="type == 3" class="icon-item" src="/asset/image/bulbLogo/22400.png" alt="">
</div> </div>
</a-popover> <div class="light-tag-box">
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制模式</span>
<span class="result">自动</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">亮度</span>
<span class="result">{{ result.brightness }}</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制场景</span>
<span class="result">{{ result.automatic2 }}</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">色温</span>
<span class="result">{{ result.brightness3 }}</span>
</div>
</div>
</div>
</template>
<div class="icon-box" :style="styleObject" v-show="visible">
<img v-if="type == 1" class="icon-item" src="/asset/image/bulbLogo/22394.png" alt="" />
<img v-if="type == 2" class="icon-item" src="/asset/image/bulbLogo/22396.png" alt="" />
<img v-if="type == 3" class="icon-item" src="/asset/image/bulbLogo/22400.png" alt="" />
</div>
</a-popover>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
defineProps({ defineProps({
styleObject: Object, styleObject: Object,
type: Number, type: Number,
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}); });
const result = ref({ const result = ref({
id: '1', id: '1',
name: '站厅照明 1区', name: '站厅照明 1区',
manual: '手动', manual: '手动',
@ -64,77 +64,86 @@ const result = ref({
automatic2: '舒适', automatic2: '舒适',
brightness3: '4000k', brightness3: '4000k',
brightness4: '3800k', brightness4: '3800k',
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.icon-box { .icon-box {
width: 25px; width: 25px;
height: 25px; height: 25px;
position: absolute; position: absolute;
.icon-item {
width: 25px; .icon-item {
cursor: pointer; width: 25px;
transition: all ease 0.1s; cursor: pointer;
} transition: all ease 0.1s;
.icon-item:active { }
transform: scale(1.2);
} .icon-item:active {
transform: scale(1.2);
} }
// }
.light-tag {
display: flex; //
flex-direction: column; .light-tag {
gap: 10px; display: flex;
// flex-direction: column;
.light-tag-tit { gap: 10px;
display: flex;
justify-content: space-between; //
vertical-align: middle; .light-tag-tit {
height: 30px; display: flex;
.tag-text { justify-content: space-between;
font-size: 16px; vertical-align: middle;
font-weight: 700; height: 30px;
color: white;
padding-left: 10px; .tag-text {
} font-size: 16px;
.right-button { font-weight: 700;
width: 50px; color: white;
height: 26px; padding-left: 10px;
background: rgba(57, 215, 187, 0.1); }
border: 1px solid rgba(57, 215, 187, 1);
font-size: 12px; .right-button {
color: rgba(57, 215, 187, 1); width: 50px;
} height: 26px;
} background: rgba(57, 215, 187, 0.1);
border: 1px solid rgba(57, 215, 187, 1);
font-size: 12px;
color: rgba(57, 215, 187, 1);
}
} }
// 4 }
.light-tag-box {
display: grid; // 4
grid-template-columns: 1fr 1fr; .light-tag-box {
grid-template-rows: 1fr 1fr; display: grid;
grid-gap: 10px; grid-template-columns: 1fr 1fr;
.tag-box-item { grid-template-rows: 1fr 1fr;
position: relative; grid-gap: 10px;
display: flex;
justify-content: space-between; .tag-box-item {
img { position: relative;
width: 120px; display: flex;
vertical-align: middle; justify-content: space-between;
}
.title { img {
position: absolute; width: 120px;
left: 60px; vertical-align: middle;
top: 13px; }
color: rgba(64, 255, 252, 1);
} .title {
.result { position: absolute;
line-height: 50px; left: 60px;
font-size: 16px; top: 13px;
font-weight: 700; color: rgba(64, 255, 252, 1);
color: white; }
};
} .result {
line-height: 50px;
font-size: 16px;
font-weight: 700;
color: white;
}
} }
}
</style> </style>

891
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue

@ -5,15 +5,21 @@
<div class="light-area"> <div class="light-area">
<div class="light-area-tab"></div> <div class="light-area-tab"></div>
<span class="light-area-text"> 照明区域 </span> <span class="light-area-text"> 照明区域 </span>
<button class="plan" :class="{ enabled: isPlanEnabled, disabled: !isPlanEnabled }" @click="togglePlan"> <button
class="plan"
:class="{ enabled: isPlanEnabled, disabled: !isPlanEnabled }"
@click="togglePlan">
{{ isPlanEnabled ? '计划启用' : '计划禁用' }} {{ isPlanEnabled ? '计划启用' : '计划禁用' }}
</button> </button>
</div> </div>
<!-- 照明区域按钮部分 --> <!-- 照明区域按钮部分 -->
<div class="area"> <div class="area">
<template v-if="!showAllButtonsArea"> <template v-if="!showAllButtonsArea">
<button v-for="(button, index) in limitedButtons1" :key="index" <button
:class="{ btn: true, selected: button.selected }" @click="changeArea(button)"> v-for="(button, index) in limitedButtons1"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }} {{ button.name }}
</button> </button>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
@ -21,7 +27,10 @@
</div> </div>
</template> </template>
<template v-else> <template v-else>
<button v-for="(button, index) in props.treeData" :key="index" :class="{ btn: true, selected: button.selected }" <button
v-for="(button, index) in props.treeData"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)"> @click="changeArea(button)">
{{ button.name }} {{ button.name }}
</button> </button>
@ -37,13 +46,20 @@
<div class="circuit-tab"></div> <div class="circuit-tab"></div>
<span class="circuit-text">照明回路</span> <span class="circuit-text">照明回路</span>
<div class="btn2"> <div class="btn2">
<button class="openPlan" :class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }" @click="togglePlan2"> <button
class="openPlan"
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }"
@click="togglePlan2">
{{ isPlanEnabled2 ? '启用面板' : '禁用面板' }} {{ isPlanEnabled2 ? '启用面板' : '禁用面板' }}
</button> </button>
<a-switch v-model:checked="selectAllCheckbox" :disabled="singleSelection" :class="{ <a-switch
'blue-background': selectAllCheckbox, v-model:checked="selectAllCheckbox"
'grey-background': !selectAllCheckbox, :disabled="singleSelection"
}" @change="toggleAllSelection" /> :class="{
'blue-background': selectAllCheckbox,
'grey-background': !selectAllCheckbox,
}"
@change="toggleAllSelection" />
<button class="allBtn">全选</button> <button class="allBtn">全选</button>
<button class="both" @click="selectAll"> <button class="both" @click="selectAll">
{{ singleSelection ? '多选' : '单选' }} {{ singleSelection ? '多选' : '单选' }}
@ -52,8 +68,12 @@
</div> </div>
<div class="btnArea"> <div class="btnArea">
<template v-if="!showAllButtons"> <template v-if="!showAllButtons">
<button v-for="(button, index) in limitedButtons2" :key="index" <button
:class="{ btn: true, selected: button.selected }" class="zmhlbtn" @click="changeLine(button)"> v-for="(button, index) in limitedButtons2"
:key="index"
:class="{ btn: true, selected: button.selected }"
class="zmhlbtn"
@click="changeLine(button)">
<stop-outlined v-if="button.ctrlStatus" /> <stop-outlined v-if="button.ctrlStatus" />
{{ button.name }} {{ button.name }}
</button> </button>
@ -62,8 +82,12 @@
</div> </div>
</template> </template>
<template v-else> <template v-else>
<button v-for="(button, index) in buttons2" :key="index" <button
:class="{ btn: true, selected: button.selected }" class="zmhlbtn" @click="changeLine(button)"> v-for="(button, index) in buttons2"
:key="index"
:class="{ btn: true, selected: button.selected }"
class="zmhlbtn"
@click="changeLine(button)">
<stop-outlined v-if="button.ctrlStatus" /> <stop-outlined v-if="button.ctrlStatus" />
{{ button.name }} {{ button.name }}
</button> </button>
@ -81,10 +105,13 @@
</div> </div>
<!-- 控制模式按钮部分 --> <!-- 控制模式按钮部分 -->
<div class="control-mode-btn-area" v-show="thisButton2.code"> <div class="control-mode-btn-area" v-show="thisButton2.code">
<button v-for="(button3, index) in controlMode" :key="index" <button
class="btn" v-for="(button3, index) in controlMode"
:disabled="button3.value!= 3" :key="index"
:class="{ selected: thisButton2.mode.value == button3.value }" @click="selectButton3(button3)"> class="btn"
:disabled="button3.value != 3"
:class="{ selected: thisButton2.mode.value == button3.value }"
@click="selectButton3(button3)">
{{ button3.label }} {{ button3.label }}
</button> </button>
</div> </div>
@ -97,8 +124,11 @@
</div> </div>
<!-- 控制场景按钮部分 --> <!-- 控制场景按钮部分 -->
<div class="control-scene-btn-area" v-show="thisButton2.mode.value == 3"> <div class="control-scene-btn-area" v-show="thisButton2.mode.value == 3">
<button v-for="(button4, index) in controlScene" :key="index" <button
:class="{ btn: true, selected: thisButton2.scene.value == button4.value }" @click="selectButton4(button4)"> v-for="(button4, index) in controlScene"
:key="index"
:class="{ btn: true, selected: thisButton2.scene.value == button4.value }"
@click="selectButton4(button4)">
{{ button4.label }} {{ button4.label }}
</button> </button>
</div> </div>
@ -106,12 +136,11 @@
<!-- 底部按钮区 --> <!-- 底部按钮区 -->
<div class="bottom"> <div class="bottom">
<a-popconfirm <a-popconfirm
title="刷新将会取消已作出的修改" title="刷新将会取消已作出的修改"
ok-text="确定" ok-text="确定"
cancel-text="取消" cancel-text="取消"
@confirm="changeConfirm" @confirm="changeConfirm"
@cancel="changeCancel" @cancel="changeCancel">
>
<button class="flushed">刷新</button> <button class="flushed">刷新</button>
</a-popconfirm> </a-popconfirm>
<button class="execute" @click="showModal">执行</button> <button class="execute" @click="showModal">执行</button>
@ -129,7 +158,11 @@
<div class="imgText"> <div class="imgText">
<div class="zjzm"> <div class="zjzm">
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp; <img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ item.name }}</span> <span
class="title-text"
style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)"
>{{ item.name }}</span
>
</div> </div>
<button class="cxbtn" @click="delBtn(item.id)">撤销</button> <button class="cxbtn" @click="delBtn(item.id)">撤销</button>
</div> </div>
@ -143,9 +176,7 @@
</div> </div>
</div> </div>
<div class="btn-item"> <div class="btn-item">
<div class="left"> <div class="left"> 亮度 </div>
亮度
</div>
<div class="right"> <div class="right">
<span>100lux</span> <span>100lux</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -153,9 +184,7 @@
</div> </div>
</div> </div>
<div class="btn-item"> <div class="btn-item">
<div class="left"> <div class="left"> 控制场景 </div>
控制场景
</div>
<div class="right"> <div class="right">
<span>手动</span> <span>手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -163,9 +192,7 @@
</div> </div>
</div> </div>
<div class="btn-item"> <div class="btn-item">
<div class="left"> <div class="left"> 色温 </div>
色温
</div>
<div class="right"> <div class="right">
<span>4000k</span> <span>4000k</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -176,7 +203,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%; height: 60px;"></div> <div style="width: 100%; height: 60px"></div>
<div class="button-box"> <div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button> <button class="cancel" @click="executeVisible = false">取消</button>
<button class="execute">执行</button> <button class="execute">执行</button>
@ -186,415 +213,415 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted } from 'vue'; import { ref, computed, onMounted } from 'vue';
import { import { DownOutlined, UpOutlined, StopOutlined } from '@ant-design/icons-vue';
DownOutlined, import { message } from 'ant-design-vue';
UpOutlined, //
StopOutlined, import { http } from '/nerv-lib/util/http';
} from '@ant-design/icons-vue'; import { lightingManage } from '/@/api/IlluminationInfo';
import { message } from 'ant-design-vue'; import { getAllEnum } from '/@/api/index';
//
import { http } from '/nerv-lib/util/http'; // =========================================================================
import { lightingManage } from '/@/api/IlluminationInfo';
import { getAllEnum } from '/@/api/index' onMounted(() => {
//
// ========================================================================= setArea();
//
onMounted(() => { getEnum(['IlluminationMode', 'IlluminationScene']);
//
setArea()
//
getEnum(['IlluminationMode', 'IlluminationScene'])
})
//
const getEnum = (arr: any) => {
getAllEnum({ params: arr }).then(res => {
const data = res.data
//
controlMode.value = data.IlluminationMode
//
controlScene.value = data.IlluminationScene
})
}
// 1-1 线
const setArea = () => {
const data = props.treeData[0]
buttons2.value = data.childList
}
// ===================================================================
const props = defineProps({
// >
treeData: {
type: Array,
default: []
}
});
//
/**
* @method changeArea 用于控制俯视图的选中状态
* @method reset 用于重置按钮区
*/
const emit = defineEmits(['changeArea','reset']);
// =======================================================================
//
const isPlanEnabled = ref(false);
//
const togglePlan = () => {
isPlanEnabled.value = !isPlanEnabled.value;
};
//
const showAllButtonsArea = ref(false);
// 1
const selectedButton = ref<string | undefined>('1');
//
const changeArea = (button: any) => {
//
selectedButton.value = button.id;
// 线
buttons2.value = button.childList
//
emit('reset')
//
button.selected = true
//
emit('changeArea', button.id);
// 线 -
resetMode()
// -
handleButton.value = ''
};
// 8
const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
// ======================================================================
// id
const handleButton = ref('');
// /
const isPlanEnabled2 = ref(true);
// /
const togglePlan2 = () => {
//
if (handleButton.value == '') {
return message.info('请选择照明回路');
}
//
const btn: any = buttons2.value.find((button) => button.id === handleButton.value)
let panel = +(!btn.ctrlStatus)
isLoading.value = true
http.get(lightingManage.setDisable, { deviceGroup: btn.code, panel }).then(res => {
if (res.msg === 'success') {
// - - - loading
isPlanEnabled2.value = !isPlanEnabled2.value;
btn.ctrlStatus = panel
isLoading.value = false
} else {
isLoading.value = false
}
}).catch(() => { isLoading.value = false })
};
//
let singleSelection = ref(true);
//
const selectAll = () => {
selectAllCheckbox.value = false
buttons2.value.forEach((button) => {
button.selected = false;
}); });
singleSelection.value = !singleSelection.value; //
// 线 - const getEnum = (arr: any) => {
resetMode() getAllEnum({ params: arr }).then((res) => {
// const data = res.data;
emit('changeArea', [selectedButton.value]) //
}; controlMode.value = data.IlluminationMode;
//
// controlScene.value = data.IlluminationScene;
const selectAllCheckbox = ref(false);
// switch
const toggleAllSelection = () => {
let arr = [selectedButton.value]
//
if (selectAllCheckbox.value) {
buttons2.value.forEach((item, index) => {
// 线-
if (index == 0) {
thisButton2.value = item
}
item.selected = true;
arr.push(item.id)
});
//
} else {
buttons2.value.forEach((item) => {
item.selected = false;
});
// -
resetMode()
}
emit('changeArea', arr)
};
// 线
const thisButton2 = ref({
code: '',
mode: {
value: -1
},
scene: {
value: -1
}
})
//
const changeLine = (button: any) => {
// ID/
handleButton.value = button.id
// /
if (button.ctrlStatus) {
isPlanEnabled2.value = true
} else {
isPlanEnabled2.value = false
}
//
let level1 = selectedButton.value
let level2 = button.id
// false
if (singleSelection.value) {
buttons2.value.forEach(item => {
item.selected = false;
});
button.selected = !button.selected;
emit('changeArea', [level1, level2])
} else {
//
button.selected = !button.selected;
const arr = [level1]
buttons2.value.forEach(item => {
if (item.selected) {
arr.push(item.id)
}
}); });
emit('changeArea', arr) };
} // 1-1 线
// const setArea = () => {
if (button.selected) { const data = props.treeData[0];
// buttons2.value = data.childList;
thisButton2.value = button };
} else {
// // ===================================================================
resetMode()
} const props = defineProps({
console.log(thisButton2,'button') // >
}; treeData: {
type: Array,
// default: [],
const buttons2 = ref([]); },
// });
const showAllButtons = ref(false); //
// 8 /**
const limitedButtons2 = computed(() => buttons2.value.slice(0, 8)); * @method changeArea 用于控制俯视图的选中状态
* @method reset 用于重置按钮区
// ==================================================================== */
const emit = defineEmits(['changeArea', 'reset']);
// -
const selectButton3 = (button3) => { // =======================================================================
let checked = thisButton2.value.mode
console.log(button3.value,'---', checked.value) //
// const isPlanEnabled = ref(false);
if (checked.value === button3.value) { //
return const togglePlan = () => {
} isPlanEnabled.value = !isPlanEnabled.value;
checked.value = button3.value };
};
//
// ===================================================================== const showAllButtonsArea = ref(false);
// 1
// const selectedButton = ref<string | undefined>('1');
const controlMode = ref([])
// //
const controlScene = ref([]) const changeArea = (button: any) => {
// - //
const selectedButton4 = ref(null); selectedButton.value = button.id;
// - // 线
const selectButton4 = (button4) => { buttons2.value = button.childList;
// 线 //
const data = thisButton2.value emit('reset');
// //
let before = data.scene.value button.selected = true;
// //
let after = button4.value emit('changeArea', button.id);
// // 线 -
if (before === after) { resetMode();
return // -
// handleButton.value = '';
} else { };
thisButton2.value.scene.value = after // 8
// const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
const result = changeList.value.find((item, index) => {
item.index = index // ======================================================================
return item.deviceGroup == data.code
}) // id
// const handleButton = ref('');
if (result) {
// // /
if (after == result.before) { const isPlanEnabled2 = ref(true);
changeList.value.splice(result.index, 1) // /
// after const togglePlan2 = () => {
} else { //
result.scene = after if (handleButton.value == '') {
// flag return message.info('请选择照明回路');
delete result.index
}
//
} else {
changeList.value.push({
// 线
deviceGroup: data.code,
deviceGroupName: data.name,
//
region: data.pcode,
regionName: '',
//
before: before,
//
scene: after
})
} }
console.log(changeList.value, 'changeList') //
} const btn: any = buttons2.value.find((button) => button.id === handleButton.value);
let panel = +!btn.ctrlStatus;
thisButton2.value.scene.value = after isLoading.value = true;
console.log(thisButton2,'222222') http
console.log(button4,'44444') .get(lightingManage.setDisable, { deviceGroup: btn.code, panel })
}; .then((res) => {
if (res.msg === 'success') {
// ======================================================================== // - - - loading
isPlanEnabled2.value = !isPlanEnabled2.value;
// btn.ctrlStatus = panel;
const changeList: any = ref([]) isLoading.value = false;
// } else {
const submitList = ref([]) isLoading.value = false;
const cxList = ref([ }
{ })
id: '1', .catch(() => {
name: '站厅照明 1区', isLoading.value = false;
manual: '手动', });
automatic: '自动', };
brightness: '100lux',
brightness2: '30lux', //
manual2: '手动', let singleSelection = ref(true);
automatic2: '自动', //
brightness3: '4000k', const selectAll = () => {
brightness4: '3800k', selectAllCheckbox.value = false;
}, buttons2.value.forEach((button) => {
{ button.selected = false;
id: '2', });
name: '站厅照明 2区', singleSelection.value = !singleSelection.value;
manual: '手动', // 线 -
automatic: '自动', resetMode();
brightness: '100lux', //
brightness2: '30lux', emit('changeArea', [selectedButton.value]);
manual2: '手动', };
automatic2: '自动',
brightness3: '4000k', //
brightness4: '3800k', const selectAllCheckbox = ref(false);
}, // switch
{ const toggleAllSelection = () => {
id: '3', let arr = [selectedButton.value];
name: '站厅照明 3区', //
manual: '手动', if (selectAllCheckbox.value) {
automatic: '自动', buttons2.value.forEach((item, index) => {
brightness: '100lux', // 线-
brightness2: '30lux', if (index == 0) {
manual2: '手动', thisButton2.value = item;
automatic2: '自动', }
brightness3: '4000k', item.selected = true;
brightness4: '3800k', arr.push(item.id);
}, });
]); //
//
const delBtn = () => {
cxList.value.pop();
console.log(cxList.value.length);
if (cxList.value.length === 0) {
executeVisible.value = false;
}
};
// ========================================================================
const isLoading = ref(false)
//
const refresh = () => {
//
executeVisible.value = false
//
selectedButton.value = '1';
emit('changeArea', ['1']);
emit('reset')
let data = props.treeData[0]
//
data.selected = true
buttons2.value = data.childList
selectedButton4.value = null;
resetMode()
};
//
const executeVisible = ref<boolean>(false);
const showModal = () => {
http.post(lightingManage.getChangeList, { infoList: changeList.value, projectId: 'HLlmTZp8' }).then(res => {
if (res.msg === 'success') {
isLoading.value = true
console.log(res)
} else { } else {
isLoading.value = false buttons2.value.forEach((item) => {
item.selected = false;
});
// -
resetMode();
} }
}) emit('changeArea', arr);
executeVisible.value = true; };
}; // 线
const thisButton2 = ref({
//
const changeConfirm = () => {
refresh()
}
//
const changeCancel = () => {
}
// 线
const resetMode = () => {
thisButton2.value = {
code: '', code: '',
mode: { mode: {
value: -1 value: -1,
}, },
scene: { scene: {
value: -1 value: -1,
},
});
//
const changeLine = (button: any) => {
// ID/
handleButton.value = button.id;
// /
if (button.ctrlStatus) {
isPlanEnabled2.value = true;
} else {
isPlanEnabled2.value = false;
} }
}
}
// //
defineExpose({ let level1 = selectedButton.value;
// let level2 = button.id;
changeArea, // false
// 线 if (singleSelection.value) {
changeLine buttons2.value.forEach((item) => {
}); item.selected = false;
});
button.selected = !button.selected;
emit('changeArea', [level1, level2]);
} else {
//
button.selected = !button.selected;
const arr = [level1];
buttons2.value.forEach((item) => {
if (item.selected) {
arr.push(item.id);
}
});
emit('changeArea', arr);
}
//
if (button.selected) {
//
thisButton2.value = button;
} else {
//
resetMode();
}
console.log(thisButton2, 'button');
};
//
const buttons2 = ref([]);
//
const showAllButtons = ref(false);
// 8
const limitedButtons2 = computed(() => buttons2.value.slice(0, 8));
// ====================================================================
// -
const selectButton3 = (button3) => {
let checked = thisButton2.value.mode;
console.log(button3.value, '---', checked.value);
//
if (checked.value === button3.value) {
return;
}
checked.value = button3.value;
};
// =====================================================================
//
const controlMode = ref([]);
//
const controlScene = ref([]);
// -
const selectedButton4 = ref(null);
// -
const selectButton4 = (button4) => {
// 线
const data = thisButton2.value;
//
let before = data.scene.value;
//
let after = button4.value;
//
if (before === after) {
return;
//
} else {
thisButton2.value.scene.value = after;
//
const result = changeList.value.find((item, index) => {
item.index = index;
return item.deviceGroup == data.code;
});
//
if (result) {
//
if (after == result.before) {
changeList.value.splice(result.index, 1);
// after
} else {
result.scene = after;
// flag
delete result.index;
}
//
} else {
changeList.value.push({
// 线
deviceGroup: data.code,
deviceGroupName: data.name,
//
region: data.pcode,
regionName: '',
//
before: before,
//
scene: after,
});
}
console.log(changeList.value, 'changeList');
}
thisButton2.value.scene.value = after;
console.log(thisButton2, '222222');
console.log(button4, '44444');
};
// ========================================================================
//
const changeList: any = ref([]);
//
const submitList = ref([]);
const cxList = ref([
{
id: '1',
name: '站厅照明 1区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
{
id: '2',
name: '站厅照明 2区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
{
id: '3',
name: '站厅照明 3区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
]);
//
const delBtn = () => {
cxList.value.pop();
console.log(cxList.value.length);
if (cxList.value.length === 0) {
executeVisible.value = false;
}
};
// ========================================================================
const isLoading = ref(false);
//
const refresh = () => {
//
executeVisible.value = false;
//
selectedButton.value = '1';
emit('changeArea', ['1']);
emit('reset');
let data = props.treeData[0];
//
data.selected = true;
buttons2.value = data.childList;
selectedButton4.value = null;
resetMode();
};
//
const executeVisible = ref<boolean>(false);
const showModal = () => {
http
.post(lightingManage.getChangeList, { infoList: changeList.value, projectId: 'HLlmTZp8' })
.then((res) => {
if (res.msg === 'success') {
isLoading.value = true;
console.log(res);
} else {
isLoading.value = false;
}
});
executeVisible.value = true;
};
//
const changeConfirm = () => {
refresh();
};
//
const changeCancel = () => {};
// 线
const resetMode = () => {
thisButton2.value = {
code: '',
mode: {
value: -1,
},
scene: {
value: -1,
},
};
};
//
defineExpose({
//
changeArea,
// 线
changeLine,
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "./dialogStyle.less"; @import './dialogStyle.less';
@import "./tabs1.less"; @import './tabs1.less';
</style> </style>

329
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue

@ -20,10 +20,10 @@
<td v-if="row.planStatus == '2'"> <td v-if="row.planStatus == '2'">
<button <button
style=" style="
font-size: 12px; font-size: 12px;
background: rgba(57, 215, 187, 0.1); background: rgba(57, 215, 187, 0.1);
color: rgb(57, 215, 187); color: rgb(57, 215, 187);
border: 1px solid rgb(57, 215, 187); border: 1px solid rgb(57, 215, 187);
"> ">
已执行 已执行
</button> </button>
@ -31,10 +31,10 @@
<td v-if="row.planStatus == '1'"> <td v-if="row.planStatus == '1'">
<button <button
style=" style="
font-size: 12px; font-size: 12px;
background: rgba(243, 97, 99, 0.1); background: rgba(243, 97, 99, 0.1);
border: 1px solid rgba(243, 97, 99); border: 1px solid rgba(243, 97, 99);
color: rgba(243, 97, 99); color: rgba(243, 97, 99);
"> ">
待执行 待执行
</button> </button>
@ -42,11 +42,10 @@
<td> <td>
<div class="tabReboot" @click="restartPlan(row.id)">重启</div> <div class="tabReboot" @click="restartPlan(row.id)">重启</div>
<a-popconfirm <a-popconfirm
title="此操作将永久删除该条数据" title="此操作将永久删除该条数据"
ok-text="确定" ok-text="确定"
cancel-text="取消" cancel-text="取消"
@confirm="deletePlan(row.id)" @confirm="deletePlan(row.id)">
>
<div class="tabDelete">删除</div> <div class="tabDelete">删除</div>
</a-popconfirm> </a-popconfirm>
</td> </td>
@ -70,7 +69,7 @@
@search="handleSearch" @search="handleSearch"
:listStyle="{ border: '2px solid rgba(25,74,125,1)', height: 'calc(100vh - 200px)' }" /> :listStyle="{ border: '2px solid rgba(25,74,125,1)', height: 'calc(100vh - 200px)' }" />
</div> </div>
<div style="width: 100%; height: 60px;"></div> <div style="width: 100%; height: 60px"></div>
<div class="button-box"> <div class="button-box">
<button class="cancel" @click="addVisible = false">取消</button> <button class="cancel" @click="addVisible = false">取消</button>
<button class="execute" @click="sendPlan">确定</button> <button class="execute" @click="sendPlan">确定</button>
@ -79,175 +78,171 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
// //
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo'; import { lightingManage } from '/@/api/IlluminationInfo';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
// =========================================================== // ===========================================================
onMounted(() => { onMounted(() => {
// //
getTable() getTable();
// 穿 // 穿
getLeftPlan() getLeftPlan();
}) });
// tab ======================================================== // tab ========================================================
// //
const dataSource = ref([]); const dataSource = ref([]);
// //
const getTable = () => { const getTable = () => {
http.get(lightingManage.getPlanTable, {}).then(res => { http.get(lightingManage.getPlanTable, {}).then((res) => {
dataSource.value = res.data dataSource.value = res.data;
}) });
} };
// //
const deletePlan = (id: String) => { const deletePlan = (id: String) => {
http.delete(lightingManage.deletePlan, [id]).then(() => { http.delete(lightingManage.deletePlan, [id]).then(() => {
message.success('操作成功') message.success('操作成功');
getTable() getTable();
}) });
} };
// //
const restartPlan = (id: String) => { const restartPlan = (id: String) => {
http.post(lightingManage.restartPlan, { planId: id }).then(() => { http.post(lightingManage.restartPlan, { planId: id }).then(() => {
message.success('操作成功') message.success('操作成功');
getTable() getTable();
}) });
} };
// tab ==================================================== // tab ====================================================
// //
const addVisible = ref(false); const addVisible = ref(false);
// //
const addModal = () => { const addModal = () => {
addVisible.value = true; addVisible.value = true;
}; };
// 穿 ======================================================= // 穿 =======================================================
// 穿 // 穿
const transferData = ref([]) as any; const transferData = ref([]) as any;
// 穿 // 穿
const getLeftPlan = () => { const getLeftPlan = () => {
http.get(lightingManage.getLeftPlan, {}).then(res => { http.get(lightingManage.getLeftPlan, {}).then((res) => {
let arr = [] let arr = [];
res.data.forEach((item: any) => { res.data.forEach((item: any) => {
arr.push({ arr.push({
key: item.id, key: item.id,
title: item.planName title: item.planName,
}) });
}) });
transferData.value = arr transferData.value = arr;
}) });
} };
const handleChange = (keys: string[], direction: string, moveKeys: string[]) => {
console.log(keys, direction, moveKeys);
};
const handleSearch = (dir: string, value: string) => {
console.log('search:', dir, value);
};
// 穿
const targetKeys = ref<string[]>([]);
// 穿
const sendPlan = () => {
if (targetKeys.value.length < 1) {
return message.info('没有选择任何计划');
}
http.post(lightingManage.submitLeftPlan, targetKeys.value).then(() => {
message.success('添加成功')
//
getTable()
getLeftPlan()
})
}
const filterOption = (inputValue: string, option: any) => {
return option.description.indexOf(inputValue) > -1;
};
const handleChange = (keys: string[], direction: string, moveKeys: string[]) => {
console.log(keys, direction, moveKeys);
};
const handleSearch = (dir: string, value: string) => {
console.log('search:', dir, value);
};
// 穿
const targetKeys = ref<string[]>([]);
// 穿
const sendPlan = () => {
if (targetKeys.value.length < 1) {
return message.info('没有选择任何计划');
}
http.post(lightingManage.submitLeftPlan, targetKeys.value).then(() => {
message.success('添加成功');
//
getTable();
getLeftPlan();
});
};
const filterOption = (inputValue: string, option: any) => {
return option.description.indexOf(inputValue) > -1;
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "./dialogStyle.less"; @import './dialogStyle.less';
// //
.div-add { .div-add {
height: 64px; height: 64px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
right: 0; right: 0;
margin-right: 20px; margin-right: 20px;
.add { .add {
width: 74px; width: 74px;
height: 40px; height: 40px;
opacity: 1; opacity: 1;
border-radius: 4px; border-radius: 4px;
background: rgba(67, 136, 251, 1); background: rgba(67, 136, 251, 1);
border: rgba(67, 136, 251, 1); border: rgba(67, 136, 251, 1);
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
cursor: pointer; cursor: pointer;
}
} }
} //
// .custom-table {
.custom-table { border-collapse: collapse;
border-collapse: collapse; width: 416px;
width: 416px; height: 60px;
height: 60px; color: rgba(255, 255, 255, 1);
color: rgba(255, 255, 255, 1);
}
.custom-table th,
.custom-table td {
border: 1px solid rgba(163, 192, 243, 1);
text-align: left;
padding: 8px;
text-align: center;
}
.table1 {
margin-top: 20px;
width: 100%;
border: 1px solid rgba(255, 255, 255);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
//
.tabReboot,
.tabDelete {
border: none;
display: inline-block;
background-color: rgba(0, 0, 0, 0);
font-size: 14px;
font-weight: 400;
letter-spacing: 0;
line-height: 20px;
color: rgba(67, 136, 251, 1);
cursor: pointer;
}
.tabReboot {
margin-right: 8px;
} }
.tabReboot::active { .custom-table th,
color: white !important; .custom-table td {
border: 1px solid rgba(163, 192, 243, 1);
text-align: left;
padding: 8px;
text-align: center;
} }
.tabDelete::active { .table1 {
color: white; margin-top: 20px;
width: 100%;
border: 1px solid rgba(255, 255, 255);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
//
.tabReboot,
.tabDelete {
border: none;
display: inline-block;
background-color: rgba(0, 0, 0, 0);
font-size: 14px;
font-weight: 400;
letter-spacing: 0;
line-height: 20px;
color: rgba(67, 136, 251, 1);
cursor: pointer;
}
.tabReboot {
margin-right: 8px;
}
.tabReboot::active {
color: white !important;
}
.tabDelete::active {
color: white;
}
} }
} ::v-deep(.ant-transfer) {
::v-deep(.ant-transfer) { // hover
// hover .ant-transfer-list-content-item:hover {
.ant-transfer-list-content-item:hover { background: black;
background: black; }
} }
}
</style> </style>

330
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue

@ -9,7 +9,10 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(row, index) in dataSource1" :key="index" @click="handleRowClick(row.key)" <tr
v-for="(row, index) in dataSource1"
:key="index"
@click="handleRowClick(row.key)"
:class="row.key === trIndex ? 'isTrIndex' : ''"> :class="row.key === trIndex ? 'isTrIndex' : ''">
<td>{{ row.key }}</td> <td>{{ row.key }}</td>
<td>{{ row.data }}</td> <td>{{ row.data }}</td>
@ -19,7 +22,7 @@
</tbody> </tbody>
</table> </table>
<div class="out-dialog" :class="{ 'showDialog' : logModalVisible }" v-if="logModalVisible"> <div class="out-dialog" :class="{ showDialog: logModalVisible }" v-if="logModalVisible">
<div class="content" v-if="logModalVisible"> <div class="content" v-if="logModalVisible">
<div> <div>
<div class="div-operation"></div> <div class="div-operation"></div>
@ -30,7 +33,11 @@
<div class="imgText"> <div class="imgText">
<div class="zjzm"> <div class="zjzm">
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp; <img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ item.name }}</span> <span
class="title-text"
style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)"
>{{ item.name }}</span
>
</div> </div>
</div> </div>
<div class="btn-box"> <div class="btn-box">
@ -43,9 +50,7 @@
</div> </div>
</div> </div>
<div class="btn-item"> <div class="btn-item">
<div class="left"> <div class="left"> 亮度 </div>
亮度
</div>
<div class="right"> <div class="right">
<span>100lux</span> <span>100lux</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -53,9 +58,7 @@
</div> </div>
</div> </div>
<div class="btn-item"> <div class="btn-item">
<div class="left"> <div class="left"> 控制场景 </div>
控制场景
</div>
<div class="right"> <div class="right">
<span>手动</span> <span>手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -63,9 +66,7 @@
</div> </div>
</div> </div>
<div class="btn-item"> <div class="btn-item">
<div class="left"> <div class="left"> 色温 </div>
色温
</div>
<div class="right"> <div class="right">
<span>4000k</span> <span>4000k</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -76,7 +77,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="height: 60px;"></div> <div style="height: 60px"></div>
<div class="button-box"> <div class="button-box">
<button class="cancel" @click="logModalVisible = false">取消</button> <button class="cancel" @click="logModalVisible = false">取消</button>
</div> </div>
@ -87,169 +88,164 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
// //
onMounted(() => { onMounted(() => {});
}) // ===================================================================
const props = defineProps({
// =================================================================== // >
const props = defineProps({ treeData: {
// > type: Array,
treeData: { },
type: Array });
}, const emit = defineEmits(['changeArea']);
});
const emit = defineEmits(['changeArea']); //
const dataSource1 = ref([
// {
const dataSource1 = ref([ key: '1',
{ data: '2024-05-01',
key: '1', planName: '计划再开',
data: '2024-05-01', status: '张三111',
planName: '计划再开', },
status: '张三111', {
}, key: '2',
{ data: '2024-05-01',
key: '2', planName: '检修模式',
data: '2024-05-01', status: '李四12',
planName: '检修模式', },
status: '李四12', {
}, key: '3',
{ data: '2024-05-01',
key: '3', planName: '设备变更',
data: '2024-05-01', status: '王五33',
planName: '设备变更', },
status: '王五33', ]);
}, const cxList = ref([
]); {
const cxList = ref([ id: '1',
{ name: '站厅照明 1区',
id: '1', manual: '手动',
name: '站厅照明 1区', automatic: '自动',
manual: '手动', brightness: '100lux',
automatic: '自动', brightness2: '30lux',
brightness: '100lux', manual2: '手动',
brightness2: '30lux', automatic2: '自动',
manual2: '手动', brightness3: '4000k',
automatic2: '自动', brightness4: '3800k',
brightness3: '4000k', },
brightness4: '3800k', {
}, id: '2',
{ name: '站厅照明 2区',
id: '2', manual: '手动',
name: '站厅照明 2区', automatic: '自动',
manual: '手动', brightness: '100lux',
automatic: '自动', brightness2: '30lux',
brightness: '100lux', manual2: '手动',
brightness2: '30lux', automatic2: '自动',
manual2: '手动', brightness3: '4000k',
automatic2: '自动', brightness4: '3800k',
brightness3: '4000k', },
brightness4: '3800k', {
}, id: '3',
{ name: '站厅照明 3区',
id: '3', manual: '手动',
name: '站厅照明 3区', automatic: '自动',
manual: '手动', brightness: '100lux',
automatic: '自动', brightness2: '30lux',
brightness: '100lux', manual2: '手动',
brightness2: '30lux', automatic2: '自动',
manual2: '手动', brightness3: '4000k',
automatic2: '自动', brightness4: '3800k',
brightness3: '4000k', },
brightness4: '3800k', ]);
}, let trIndex = ref('-1');
]); const logModalVisible = ref(false);
let trIndex = ref('-1'); const handleRowClick = (index: any) => {
const logModalVisible = ref(false); trIndex.value = index;
const handleRowClick = (index: any) => { if (index === trIndex.value) {
trIndex.value = index; console.log('tri');
if (index === trIndex.value) { }
console.log('tri'); //
} logModalVisible.value = true;
// };
logModalVisible.value = true;
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "./dialogStyle.less"; @import './dialogStyle.less';
// //
.div-add { .div-add {
height: 64px; height: 64px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
right: 0; right: 0;
margin-right: 20px; margin-right: 20px;
.add { .add {
width: 74px; width: 74px;
height: 40px; height: 40px;
opacity: 1; opacity: 1;
border-radius: 4px; border-radius: 4px;
background: rgba(67, 136, 251, 1); background: rgba(67, 136, 251, 1);
border: rgba(67, 136, 251, 1); border: rgba(67, 136, 251, 1);
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
cursor: pointer; cursor: pointer;
}
} }
}
//
.custom-table {
border-collapse: collapse;
width: 416px;
height: 60px;
color: rgba(255, 255, 255, 1);
}
.custom-table th, //
.custom-table td { .custom-table {
border: 1px solid rgba(163, 192, 243, 1); border-collapse: collapse;
text-align: left; width: 416px;
padding: 8px; height: 60px;
text-align: center; color: rgba(255, 255, 255, 1);
}
.table1 {
margin-top: 20px;
width: 100%;
border: 1px solid rgba(255, 255, 255);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
.tabReboot,
.tabDelete {
border: none;
background-color: rgba(0, 0, 0, 0);
font-size: 14px;
font-weight: 400;
letter-spacing: 0;
line-height: 20px;
color: rgba(67, 136, 251, 1);
} }
.tabReboot { .custom-table th,
margin-right: 8px; .custom-table td {
border: 1px solid rgba(163, 192, 243, 1);
text-align: left;
padding: 8px;
text-align: center;
} }
.isTrIndex { .table1 {
background: rgba(67, 136, 251, 1); margin-top: 20px;
width: 100%;
border: 1px solid rgba(255, 255, 255);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
.tabReboot,
.tabDelete {
border: none;
background-color: rgba(0, 0, 0, 0);
font-size: 14px;
font-weight: 400;
letter-spacing: 0;
line-height: 20px;
color: rgba(67, 136, 251, 1);
}
.tabReboot {
margin-right: 8px;
}
.isTrIndex {
background: rgba(67, 136, 251, 1);
}
} }
}
::v-deep(.ant-transfer) {
// hover ::v-deep(.ant-transfer) {
.ant-transfer-list-content-item:hover { // hover
background: black; .ant-transfer-list-content-item:hover {
background: black;
}
} }
}
</style> </style>

Loading…
Cancel
Save