Browse Source

feat: 设备数据侧边设备点位收缩功能

main
betaqi 2 days ago
parent
commit
60dba85268
  1. 27
      src/views/stationData/component/pointCheckbox.vue
  2. 11
      src/views/stationData/topology/components/detailDrawer.vue
  3. 13
      src/views/stationData/transfer/components/deviceDrawer.vue

27
src/views/stationData/component/pointCheckbox.vue

@ -1,16 +1,21 @@
<template> <template>
<div class="w-320 h-full" v-loading="loadingPoints" element-loading-text="数据加载中..."> <div class="w-320 flex h-full" v-loading="loadingPoints" element-loading-text="数据加载中...">
<template v-if="!pointList.length"> <div class="flex-1">
<el-empty></el-empty> <template v-if="!pointList.length">
</template> <el-empty></el-empty>
<el-scrollbar class="scroll" v-else> </template>
<el-checkbox-group v-model="checkPointList" class="point-checks" @change="changePoints"> <el-scrollbar class="scroll" v-else>
<template v-for="(item, index) in pointList" :key="index"> <el-checkbox-group v-model="checkPointList" class="point-checks" @change="changePoints">
<el-checkbox :label="item.label" :value="item"/> <template v-for="(item, index) in pointList" :key="index">
</template> <el-checkbox :label="item.label" :value="item"/>
</el-checkbox-group> </template>
</el-scrollbar> </el-checkbox-group>
</el-scrollbar>
</div>
<el-divider direction="vertical" style="height: 100%;"/>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">

11
src/views/stationData/topology/components/detailDrawer.vue

@ -4,14 +4,15 @@
v-model="isShowDrawer" v-model="isShowDrawer"
:title="title" :title="title"
direction="rtl" direction="rtl"
size="90%" size="100%"
modal-class="model-dev-opn" modal-class="model-dev-opn"
:before-close="handleBeforeClose" :before-close="handleBeforeClose"
@opened="onDrawerOpened"> @opened="onDrawerOpened">
<main class="wh-full flex"> <main class="wh-full flex">
<EdfsWrap title="点位选择" <EdfsWrap title="点位选择"
class="p-r-4 h-full w-340 border-r-1 border-solid border-r-#e4e7ed"> isCollapse :collapsed="collapsed" @collapse="onCollapse"
:style="{width: `${collapsed ? 0 : 340}px`}">
<el-select <el-select
v-if="currentGroup?.customNode" v-if="currentGroup?.customNode"
v-model="selectValue" v-model="selectValue"
@ -109,6 +110,7 @@ async function open(device: IDevice & {
}, group: IPointGroupOV) { }, group: IPointGroupOV) {
curDevice.value = device curDevice.value = device
currentGroup.value = group currentGroup.value = group
onCollapse(false)
if ( if (
currentGroup.value.customNode && currentGroup.value.customNode &&
currentGroup.value.brother && currentGroup.value.brother &&
@ -215,6 +217,7 @@ async function loadChardData() {
return return
} }
clearData() clearData()
onCollapse(true)
const limit = chartLimit.value const limit = chartLimit.value
const offset = chartOffset.value const offset = chartOffset.value
const options: any = { const options: any = {
@ -389,6 +392,10 @@ const disabledDate = (time: any) => {
} }
const getBeforeMonth = dayjs().startOf('month').subtract(1, 'month').startOf('month').toDate() const getBeforeMonth = dayjs().startOf('month').subtract(1, 'month').startOf('month').toDate()
const collapsed = ref(false)
function onCollapse(value?:boolean) {
collapsed.value = value ?? !collapsed.value
}
defineExpose({ defineExpose({
open, open,

13
src/views/stationData/transfer/components/deviceDrawer.vue

@ -1,10 +1,11 @@
<template> <template>
<div class="fault-rule-drawer"> <div class="fault-rule-drawer">
<el-drawer v-model="isShowDrawer" :title="title" direction="rtl" size="90%" <el-drawer v-model="isShowDrawer" :title="title" direction="rtl" size="100%"
modal-class="model-dev-opn" modal-class="model-dev-opn"
:before-close="handleBeforeClose" @opened="onDrawerOpened"> :before-close="handleBeforeClose" @opened="onDrawerOpened">
<main class="wh-full flex"> <main class="wh-full flex">
<EdfsWrap title="点位组" class="p-r-4 h-full border-r-1 border-solid border-r-#e4e7ed"> <EdfsWrap title="点位组" isCollapse :collapsed="collapsed" @collapse="onCollapse"
:style="{width: `${collapsed ? 0 : 600}px`}">
<PointGroupTree <PointGroupTree
v-if="isShowDrawer" v-if="isShowDrawer"
:data="pointGroup" :data="pointGroup"
@ -100,6 +101,7 @@ const curDevice = ref<IOfflineDevice | IOnlineDevice>()
async function open(device: IOfflineDevice | IOnlineDevice) { async function open(device: IOfflineDevice | IOnlineDevice) {
curDevice.value = device curDevice.value = device
onCollapse(false)
await loadPointGroup() await loadPointGroup()
.then(async () => { .then(async () => {
await loadDeviceDetails() await loadDeviceDetails()
@ -187,6 +189,7 @@ async function loadChardData() {
message.error('请选择点位') message.error('请选择点位')
return return
} }
onCollapse(true)
clearData() clearData()
const limit = chartLimit.value const limit = chartLimit.value
const offset = chartOffset.value const offset = chartOffset.value
@ -396,6 +399,12 @@ const disabledDate = (time: any) => {
} }
} }
const collapsed = ref(false)
function onCollapse(value?:boolean) {
collapsed.value = value ?? !collapsed.value
}
const getBeforeMonth = dayjs().startOf('month').subtract(1, 'month').startOf('month').toDate() const getBeforeMonth = dayjs().startOf('month').subtract(1, 'month').startOf('month').toDate()
defineExpose({ defineExpose({
open, open,

Loading…
Cancel
Save