Browse Source

fix: code format

main
xuziqiang 6 months ago
parent
commit
6a31e3199b
  1. 131
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.vue
  2. 96
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue

131
hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.vue

@ -1,8 +1,6 @@
<template>
<div class="main">
<el-button type="primary" style="margin-left: 16px" @click="drawer = true">
open
</el-button>
<el-button type="primary" style="margin-left: 16px" @click="drawer = true"> open </el-button>
<el-drawer v-model="drawer" :with-header="false">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
@ -15,8 +13,11 @@
</div>
<!-- button部分 -->
<div class="area">
<button v-for="(button, index) in buttons" :key="index"
:class="{ btn: true, selected: button === selectedButton }" @click="selectButton(button)">
<button
v-for="(button, index) in buttons"
:key="index"
:class="{ btn: true, selected: button === selectedButton }"
@click="selectButton(button)">
{{ button.label }}
</button>
</div>
@ -32,7 +33,10 @@
</div>
<!-- button部分 -->
<div class="btnarea">
<button v-for="(button2, index) in buttons2" :key="index" :class="{ btn: true, selected: button2.selected }"
<button
v-for="(button2, index) in buttons2"
:key="index"
:class="{ btn: true, selected: button2.selected }"
@click="toggleSelection(button2)">
{{ button2.label }}
</button>
@ -44,8 +48,11 @@
</div>
<!-- 控制模式按钮部分 -->
<div class="controlmodebtnarea">
<button v-for="(button3, index) in controlbutton" :key="index"
:class="{ btn: true, selected: button3 === selectedButton3 }" @click="selectButton3(button3)">
<button
v-for="(button3, index) in controlbutton"
:key="index"
:class="{ btn: true, selected: button3 === selectedButton3 }"
@click="selectButton3(button3)">
{{ button3.label }}
</button>
</div>
@ -56,8 +63,11 @@
</div>
<!-- 控制场景按钮部分 -->
<div class="controlscenebtnarea">
<button v-for="(button4, index) in controlscenebuttons" :key="index"
:class="{ btn: true, selected: button4 === selectedButton4 }" @click="selectButton4(button4)">
<button
v-for="(button4, index) in controlscenebuttons"
:key="index"
:class="{ btn: true, selected: button4 === selectedButton4 }"
@click="selectButton4(button4)">
{{ button4.label }}
</button>
</div>
@ -78,10 +88,14 @@
<button class="flushed">刷新</button>
<button class="execute">执行</button>
</div>
</el-tab-pane>
<el-tab-pane label="计划列表" name="second">
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px" row-key="id" border default-expand-all>
<el-table
:data="tableData"
style="width: 100%; margin-bottom: 20px"
row-key="id"
border
default-expand-all>
<el-table-column prop="id" label="序号" width="60" />
<el-table-column prop="date" label="执行时间" width="100" />
<el-table-column prop="planname" label="计划名称" width="90" />
@ -96,7 +110,12 @@
</div>
</el-tab-pane>
<el-tab-pane label="日志" name="third">
<el-table :data="tableData2" style="width: 100%; margin-bottom: 20px" row-key="id" border default-expand-all>
<el-table
:data="tableData2"
style="width: 100%; margin-bottom: 20px"
row-key="id"
border
default-expand-all>
<el-table-column prop="id" label="序号" />
<el-table-column prop="date" label="执行时间" />
<el-table-column prop="planname" label="操作内容" />
@ -112,19 +131,18 @@
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { Timer } from "@element-plus/icons-vue";
import { ref } from 'vue';
//
interface Button {
label: string;
selected: boolean;
}
const buttons = ref<Button[]>([
{ label: "A区", selected: false },
{ label: "B区", selected: false },
{ label: "C区", selected: false },
{ label: "D区", selected: false },
{ label: "计划启用", selected: false },
{ label: 'A区', selected: false },
{ label: 'B区', selected: false },
{ label: 'C区', selected: false },
{ label: 'D区', selected: false },
{ label: '计划启用', selected: false },
]);
const selectedButton = ref<Button | null>(null);
const selectButton = (button: Button) => {
@ -136,14 +154,14 @@ interface Button {
selected: boolean;
}
const buttons2 = ref<Button[]>([
{ label: "1区", selected: false },
{ label: "2区", selected: false },
{ label: "3区", selected: false },
{ label: "4区", selected: false },
{ label: '1区', selected: false },
{ label: '2区', selected: false },
{ label: '3区', selected: false },
{ label: '4区', selected: false },
]);
const showSelectAll = ref(false);
const bt = ref(false);
const selectionModeText = ref("批量");
const selectionModeText = ref('批量');
const toggleSelection = (button2: Button) => {
if (!showSelectAll.value) {
//
@ -159,7 +177,7 @@ const toggleSelection = (button2: Button) => {
};
const toggleSelectionMode = () => {
showSelectAll.value = !showSelectAll.value;
selectionModeText.value = showSelectAll.value ? "单选" : "批量";
selectionModeText.value = showSelectAll.value ? '单选' : '批量';
};
const selectAll = () => {
if (bt.value == false) {
@ -180,9 +198,9 @@ interface Button {
selected: boolean;
}
const controlbutton = ref<Button[]>([
{ label: "A区", selected: false },
{ label: "B区", selected: false },
{ label: "C区", selected: false },
{ label: 'A区', selected: false },
{ label: 'B区', selected: false },
{ label: 'C区', selected: false },
]);
const selectedButton3 = ref<Button | null>(null);
const selectButton3 = (button3: Button) => {
@ -194,18 +212,18 @@ interface Button {
selected: boolean;
}
const controlscenebuttons = ref<Button[]>([
{ label: "检修", selected: false },
{ label: "午休", selected: false },
{ label: "疏散", selected: false },
{ label: "客流高峰", selected: false },
{ label: '检修', selected: false },
{ label: '午休', selected: false },
{ label: '疏散', selected: false },
{ label: '客流高峰', selected: false },
]);
const selectedButton4 = ref<Button | null>(null);
const selectButton4 = (button4: Button) => {
selectedButton4.value = button4;
};
const drawer = ref(true);
import type { TabsPaneContext } from "element-plus";
const activeName = ref("first");
import type { TabsPaneContext } from 'element-plus';
const activeName = ref('first');
const handleClick = (tab: TabsPaneContext, event: Event) => {
console.log(tab, event);
};
@ -221,42 +239,42 @@ interface User {
const tableData: User[] = [
{
id: 1,
date: "2016-05-03",
planname: "劳动节",
status: "暂停中",
date: '2016-05-03',
planname: '劳动节',
status: '暂停中',
},
{
id: 2,
date: "2016-05-02",
planname: "国庆节",
status: "待执行",
date: '2016-05-02',
planname: '国庆节',
status: '待执行',
},
{
id: 3,
date: "2016-05-04",
planname: "元旦",
status: "待执行",
}
date: '2016-05-04',
planname: '元旦',
status: '待执行',
},
];
const tableData2: User[] = [
{
id: 1,
date: "2016-05-03",
planname: "计划再开",
status: "张三",
date: '2016-05-03',
planname: '计划再开',
status: '张三',
},
{
id: 2,
date: "2016-05-02",
planname: "检修模式",
status: "李四",
date: '2016-05-02',
planname: '检修模式',
status: '李四',
},
{
id: 3,
date: "2016-05-04",
planname: "设备变更",
status: "王五",
}
date: '2016-05-04',
planname: '设备变更',
status: '王五',
},
];
</script>
@ -284,7 +302,6 @@ el-tabs {
background-color: blueviolet;
}
.demo-tabs > .el-tabs__content {
padding: 32px;
color: #6b778c;
@ -562,6 +579,6 @@ el-tabs {
bottom: 0;
right: 0;
margin-bottom: 10px;
margin-right: 20px
margin-right: 20px;
}
</style>

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

@ -1,7 +1,13 @@
<template>
<a-button type="primary" @click="showDrawer">Open</a-button>
<a-drawer v-model:visible="visible" class="custom-class" width="500" style="color: red" placement="right"
:closable="false" @after-visible-change="afterVisibleChange">
<a-drawer
v-model:visible="visible"
class="custom-class"
width="500"
style="color: red"
placement="right"
:closable="false"
@after-visible-change="afterVisibleChange">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板">
<!-- 照明区域 -->
@ -12,8 +18,11 @@
</div>
<!-- button部分 -->
<div class="area">
<button v-for="(button, index) in buttons" :key="index"
:class="{ btn: true, selected: button === selectedButton }" @click="selectButton(button)">
<button
v-for="(button, index) in buttons"
:key="index"
:class="{ btn: true, selected: button === selectedButton }"
@click="selectButton(button)">
{{ button.label }}
</button>
</div>
@ -29,8 +38,11 @@
</div>
<!-- button部分 -->
<div class="btnarea">
<button v-for="(button2, index) in buttons2" :key="index"
:class="{ btn: true, selected: button2.selected }" @click="toggleSelection(button2)">
<button
v-for="(button2, index) in buttons2"
:key="index"
:class="{ btn: true, selected: button2.selected }"
@click="toggleSelection(button2)">
{{ button2.label }}
</button>
</div>
@ -41,8 +53,11 @@
</div>
<!-- 控制模式按钮部分 -->
<div class="controlmodebtnarea">
<button v-for="(button3, index) in controlbutton" :key="index"
:class="{ btn: true, selected: button3 === selectedButton3 }" @click="selectButton3(button3)">
<button
v-for="(button3, index) in controlbutton"
:key="index"
:class="{ btn: true, selected: button3 === selectedButton3 }"
@click="selectButton3(button3)">
{{ button3.label }}
</button>
</div>
@ -53,8 +68,11 @@
</div>
<!-- 控制场景按钮部分 -->
<div class="controlscenebtnarea">
<button v-for="(button4, index) in controlscenebuttons" :key="index"
:class="{ btn: true, selected: button4 === selectedButton4 }" @click="selectButton4(button4)">
<button
v-for="(button4, index) in controlscenebuttons"
:key="index"
:class="{ btn: true, selected: button4 === selectedButton4 }"
@click="selectButton4(button4)">
{{ button4.label }}
</button>
</div>
@ -75,7 +93,6 @@
<button class="flushed">刷新</button>
<button class="execute">执行</button>
</div>
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<a-table bordered :data-source="dataSource" :columns="columns" class="atable">
@ -123,11 +140,11 @@ interface Button {
selected: boolean;
}
const buttons = ref<Button[]>([
{ label: "A区", selected: false },
{ label: "B区", selected: false },
{ label: "C区", selected: false },
{ label: "D区", selected: false },
{ label: "计划启用", selected: false },
{ label: 'A区', selected: false },
{ label: 'B区', selected: false },
{ label: 'C区', selected: false },
{ label: 'D区', selected: false },
{ label: '计划启用', selected: false },
]);
const selectedButton = ref<Button | null>(null);
const selectButton = (button: Button) => {
@ -139,14 +156,14 @@ interface Button {
selected: boolean;
}
const buttons2 = ref<Button[]>([
{ label: "1区", selected: false },
{ label: "2区", selected: false },
{ label: "3区", selected: false },
{ label: "4区", selected: false },
{ label: '1区', selected: false },
{ label: '2区', selected: false },
{ label: '3区', selected: false },
{ label: '4区', selected: false },
]);
const showSelectAll = ref(false);
const bt = ref(false);
const selectionModeText = ref("批量");
const selectionModeText = ref('批量');
const toggleSelection = (button2: Button) => {
if (!showSelectAll.value) {
//
@ -162,7 +179,7 @@ const toggleSelection = (button2: Button) => {
};
const toggleSelectionMode = () => {
showSelectAll.value = !showSelectAll.value;
selectionModeText.value = showSelectAll.value ? "单选" : "批量";
selectionModeText.value = showSelectAll.value ? '单选' : '批量';
};
const selectAll = () => {
if (bt.value == false) {
@ -183,9 +200,9 @@ interface Button {
selected: boolean;
}
const controlbutton = ref<Button[]>([
{ label: "A区", selected: false },
{ label: "B区", selected: false },
{ label: "C区", selected: false },
{ label: 'A区', selected: false },
{ label: 'B区', selected: false },
{ label: 'C区', selected: false },
]);
const selectedButton3 = ref<Button | null>(null);
const selectButton3 = (button3: Button) => {
@ -197,10 +214,10 @@ interface Button {
selected: boolean;
}
const controlscenebuttons = ref<Button[]>([
{ label: "检修", selected: false },
{ label: "午休", selected: false },
{ label: "疏散", selected: false },
{ label: "客流高峰", selected: false },
{ label: '检修', selected: false },
{ label: '午休', selected: false },
{ label: '疏散', selected: false },
{ label: '客流高峰', selected: false },
]);
const selectedButton4 = ref<Button | null>(null);
const selectButton4 = (button4: Button) => {
@ -227,7 +244,7 @@ const columns = [
},
{
title: '状态',
dataIndex: 'status'
dataIndex: 'status',
},
{
title: '状态',
@ -270,8 +287,8 @@ const columns1 = [
},
{
title: '操作人',
dataIndex: 'status'
}
dataIndex: 'status',
},
];
const dataSource1: Ref<DataItem[]> = ref([
{
@ -294,15 +311,6 @@ const dataSource1: Ref<DataItem[]> = ref([
},
]);
const visible = ref(true);
const activeKey = ref('1');
const afterVisibleChange = (bool: boolean) => {
@ -360,7 +368,6 @@ const showDrawer = () => {
margin-left: 11px;
}
.area {
margin-left: -17px;
}
@ -452,7 +459,6 @@ const showDrawer = () => {
display: inline-block;
}
:deep(.el-drawer__body) {
padding-top: 75px;
height: 100%;
@ -475,8 +481,6 @@ const showDrawer = () => {
display: inline-block;
}
.lightparameterstab,
.lightparameterstext {
display: inline-block;
@ -573,7 +577,7 @@ const showDrawer = () => {
bottom: 0;
right: 0;
margin-bottom: 10px;
margin-right: 20px
margin-right: 20px;
}
.atable {

Loading…
Cancel
Save