添加前置绑定监测点功能
This commit is contained in:
@@ -150,3 +150,10 @@ export function getList(data: any) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//查询前置-进程-设备-设备树
|
||||||
|
export function nodeDeviceTree() {
|
||||||
|
return createAxios({
|
||||||
|
url: '/device-boot/nodeDevice/nodeDeviceTree',
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ const handlerYAxis = () => {
|
|||||||
color: '#000',
|
color: '#000',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
formatter: function (value) {
|
formatter: function (value) {
|
||||||
return value.toFixed(0) // 格式化显示为一位小数
|
return parseFloat(value.toFixed(1)) // 格式化显示为一位小数
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
|
|||||||
31
src/views/pqs/business/terminal/FrontManagement/bind.vue
Normal file
31
src/views/pqs/business/terminal/FrontManagement/bind.vue
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog draggable width="600px" v-model="dialogVisible" :title="title">
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { reactive } from 'vue'
|
||||||
|
import { update, add } from '@/api/user-boot/function'
|
||||||
|
import { nodeDeviceTree } from '@/api/device-boot/Business'
|
||||||
|
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('绑定监测点')
|
||||||
|
const open = () => {
|
||||||
|
nodeDeviceTree().then(res => {
|
||||||
|
})
|
||||||
|
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
const submit = async () => {
|
||||||
|
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
@@ -1,15 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
|
<div class="default">
|
||||||
|
<div style="flex: 1">
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="前置等级">
|
<el-form-item label="前置等级">
|
||||||
<el-select v-model="tableStore.table.params.nodeGrade" clearable placeholder="请选择前置等级">
|
<el-select
|
||||||
<el-option v-for="item in fontdveoption" :key="item.id" :label="item.name" :value="item.id" />
|
v-model="tableStore.table.params.nodeGrade"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择前置等级"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in fontdveoption"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择状态">
|
<el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择状态">
|
||||||
<el-option v-for="item in statusoption" :key="item.id" :label="item.name" :value="item.id" />
|
<el-option
|
||||||
|
v-for="item in statusoption"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -17,7 +33,33 @@
|
|||||||
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增</el-button>
|
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef"></Table>
|
<Table
|
||||||
|
ref="tableRef"
|
||||||
|
:row-config="{ isCurrent: true, isHover: true }"
|
||||||
|
@current-change="currentChangeEvent"
|
||||||
|
></Table>
|
||||||
|
</div>
|
||||||
|
<div class="pd10" style="width: 400px">
|
||||||
|
<el-tree
|
||||||
|
style="max-width: 600px"
|
||||||
|
:data="dataSource"
|
||||||
|
node-key="id"
|
||||||
|
default-expand-all
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
>
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<div class="custom-tree-node">
|
||||||
|
<span>{{ node.label }}</span>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" link>Append</el-button>
|
||||||
|
<el-button style="margin-left: 4px" type="danger" link>删除</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
draggable
|
draggable
|
||||||
:title="dialogTitle"
|
:title="dialogTitle"
|
||||||
@@ -84,15 +126,20 @@
|
|||||||
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 绑定监测点 -->
|
||||||
|
<Bind ref="bindRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide, reactive, nextTick } from 'vue'
|
import { ref, onMounted, provide, reactive, nextTick } from 'vue'
|
||||||
import { addNode, delNode, updateNode } from '@/api/device-boot/Business.ts'
|
import { addNode, delNode, updateNode, nodeDeviceTree } from '@/api/device-boot/Business'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { ElButton } from 'element-plus'
|
||||||
|
import type Node from 'element-plus/es/components/tree/src/model/node'
|
||||||
|
import Bind from './bind.vue'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'BusinessAdministrator/TerminalManagement/FrontManagement'
|
name: 'BusinessAdministrator/TerminalManagement/FrontManagement'
|
||||||
})
|
})
|
||||||
@@ -106,8 +153,8 @@ const statusoption: any = ref([
|
|||||||
{ id: 0, name: '未启用' },
|
{ id: 0, name: '未启用' },
|
||||||
{ id: 1, name: '启用' }
|
{ id: 1, name: '启用' }
|
||||||
])
|
])
|
||||||
|
const bindRef = ref()
|
||||||
|
const tableRef = ref()
|
||||||
const ruleFormRef = ref()
|
const ruleFormRef = ref()
|
||||||
|
|
||||||
const formData: any = ref({
|
const formData: any = ref({
|
||||||
@@ -228,8 +275,21 @@ const tableStore = new TableStore({
|
|||||||
delete tableStore.table.params[key]
|
delete tableStore.table.params[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
tableRef.value.getRef().setCurrentRow(tableStore.table.data[0])
|
||||||
|
currentChangeEvent()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 点击行
|
||||||
|
const currentChangeEvent = () => {
|
||||||
|
nodeDeviceTree().then(res => {})
|
||||||
|
const row = tableRef.value.getRef().getCurrentRecord()
|
||||||
|
console.log('🚀 ~ currentChangeEvent ~ row:', row)
|
||||||
|
}
|
||||||
|
|
||||||
|
const bind = () => {}
|
||||||
|
|
||||||
tableStore.table.params.orderBy = 'desc'
|
tableStore.table.params.orderBy = 'desc'
|
||||||
tableStore.table.params.nodeGrade = ''
|
tableStore.table.params.nodeGrade = ''
|
||||||
tableStore.table.params.searchState = ''
|
tableStore.table.params.searchState = ''
|
||||||
@@ -279,7 +339,36 @@ onMounted(() => {
|
|||||||
tableStore.index()
|
tableStore.index()
|
||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
|
const dataSource = ref([
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
label: 'Level one 2',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
label: 'Level two 2-1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
label: 'Level two 2-2'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
label: 'Level one 3',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
id: 7,
|
||||||
|
label: 'Level two 3-1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 8,
|
||||||
|
label: 'Level two 3-2'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
])
|
||||||
const addMenu = () => {}
|
const addMenu = () => {}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -308,4 +397,19 @@ const addMenu = () => {}
|
|||||||
height: 140px;
|
height: 140px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
:deep(.default) {
|
||||||
|
display: flex;
|
||||||
|
.row--current {
|
||||||
|
background-color: var(--el-color-primary-light-8) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.custom-tree-node {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 14px;
|
||||||
|
padding-right: 8px;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="电网标志">
|
<el-form-item label="电网标志">
|
||||||
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
||||||
<el-option v-for="item in sign" :key="item.id" :label="item.label" :value="item.id" />
|
<el-option v-for="item in sign" :key="item.id" :label="item.name" :value="item.algoDescribe" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -265,10 +265,8 @@ const options = dictData.getBasicData('Pollution_Statis', [
|
|||||||
'Plt',
|
'Plt',
|
||||||
'Freq_Dev'
|
'Freq_Dev'
|
||||||
])
|
])
|
||||||
const sign = ref([
|
const sign = dictData.getBasicData('power_flag')
|
||||||
{ label: '电网侧', id: '0' },
|
console.log('🚀 ~ sign:', sign)
|
||||||
{ label: '用户侧', id: '1' }
|
|
||||||
])
|
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/harmonic-boot/PollutionSubstation/deptSubstationRelations',
|
url: '/harmonic-boot/PollutionSubstation/deptSubstationRelations',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -282,7 +280,7 @@ provide('tableStore', tableStore)
|
|||||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
tableStore.table.params.statisticalType = options[0]
|
tableStore.table.params.statisticalType = options[0]
|
||||||
tableStore.table.params.monitorFlag = 2
|
tableStore.table.params.monitorFlag = 2
|
||||||
tableStore.table.params.powerFlag = '2'
|
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||||
tableStore.table.params.reportFlag = 3
|
tableStore.table.params.reportFlag = 3
|
||||||
tableStore.table.params.serverName = 'event-boot'
|
tableStore.table.params.serverName = 'event-boot'
|
||||||
const handleTabChange = (val: any) => {
|
const handleTabChange = (val: any) => {
|
||||||
|
|||||||
@@ -162,3 +162,8 @@ const addRole = () => {
|
|||||||
popupRef.value.open('新增角色')
|
popupRef.value.open('新增角色')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.row--current) {
|
||||||
|
background-color: var(--el-color-primary-light-8) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user