干扰源常态化管理页面

This commit is contained in:
cdf
2024-05-22 17:47:47 +08:00
parent b391b54838
commit a37cda3263
4 changed files with 223 additions and 32 deletions

View File

@@ -0,0 +1,27 @@
import createAxios from '@/utils/request'
/**
* 发起监测点试运行
*/
export const addRunTest = (data: any) => {
return createAxios({
url: '/supervision-boot/supervisionTempLineRunTest/add',
method: 'POST',
data: data
})
}
export const getRunTestById = (id: string) => {
return createAxios({
url: '/supervision-boot/supervisionTempLineRunTest/getRunTestById?id=' + id,
method: 'get',
})
}

View File

@@ -460,7 +460,6 @@ const confirmForm = () => {
close() close()
getInfo() getInfo()
} }
}) })
} }
defineExpose({ open }) defineExpose({ open })

View File

@@ -0,0 +1,76 @@
<template>
<div class="default-main">
<el-descriptions :column="2" border>
<el-descriptions-item label="监测点名称">
{{ detailData.lineName }}
</el-descriptions-item>
<el-descriptions-item label="接入母线">
{{ detailData.connectedBus}}
</el-descriptions-item>
<el-descriptions-item label="终端编号">
{{ detailData.monitoringTerminalCode }}
</el-descriptions-item>
<el-descriptions-item label="终端名称">
{{ detailData.monitoringTerminalName}}
</el-descriptions-item>
<el-descriptions-item label="变电站">
{{ detailData.powerSubstationName }}
</el-descriptions-item>
<el-descriptions-item label="调试原因">
{{ detailData.reason}}
</el-descriptions-item>
<el-descriptions-item label="监测点在线率">
{{ detailData.onlineRate*100+"%" }}
</el-descriptions-item>
<el-descriptions-item label="监测点数据完整性">
{{ detailData.integrityRate*100+"%"}}
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, reactive } from 'vue'
import { useRoute } from 'vue-router'
import { propTypes } from '@/utils/propTypes'
import { getMointorPointTempLinedebugDetail } from '@/api/supervision-boot/jointDebugList/index'
import { getRunTestById } from '@/api/supervision-boot/lineRunTest'
defineOptions({ name: 'BpmUserReportDetail' })
const { query } = useRoute() // 查询参数
const props = defineProps({
id: propTypes.string.def(undefined)
})
const detailLoading = ref(false) // 表单的加载中
const detailData = ref<any>({}) // 详情数据
const queryId = query.id as unknown as string // 从 URL 传递过来的 id 编号
/** 获得数据 */
const getInfo = async () => {
detailLoading.value = true
try {
await getRunTestById(props.id).then(res => {
detailData.value = res.data
})
} finally {
detailLoading.value = false
}
}
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗
/** 初始化 **/
onMounted(() => {
getInfo()
})
</script>
<style lang="scss">
.default-main {
height: calc(100vh - 100px);
overflow: auto;
}
::v-deep.el-icon svg {
margin: 5px !important;
position: absolute !important;
top: 20px !important;
}
</style>

View File

@@ -1,23 +1,48 @@
<!---试运行列表--> <!---试运行列表-->
<template> <template>
<div> <div>
<TableHeader area datePicker ref="TableHeaderRef"> <TableHeader area datePicker ref='TableHeaderRef'>
<template #operation> <template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="startRunTest">试运行</el-button> <el-button icon='el-icon-Plus' type='primary' @click='startRunTest'>试运行</el-button>
</template> </template>
</TableHeader> </TableHeader>
<Table ref="tableRef" /> <Table ref='tableRef' />
<!-- <el-dialog
v-model='timeDialog'
width='500px'
append-to-body
destroy-on-close>
<div class='block'>
<span class="demonstration">试运行时间</span>
<el-date-picker
:popper-append-to-body="false"
:v-model="dateValue"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
<div class='block' style='text-align: center'>
<el-button type='primary' style='margin-top: 50px' @click='runTestSubmit'>确认</el-button>
</div>
</el-dialog>-->
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang='ts'>
import { ref, onMounted, provide, nextTick } from 'vue' import { ref, onMounted, provide, nextTick } from 'vue'
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 { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData' import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { addRunTest } from '@/api/supervision-boot/lineRunTest'
const dictData = useDictData() const dictData = useDictData()
@@ -30,13 +55,13 @@ const tableStore = new TableStore({
url: '/supervision-boot/tempLinedebug/pageHasDebug', url: '/supervision-boot/tempLinedebug/pageHasDebug',
method: 'POST', method: 'POST',
column: [ column: [
{ title: '', type: 'checkbox', width: 80 }, { title: '', type: 'checkbox', width: 40 },
{ field: 'lineName', title: '监测点名称', minWidth: 170 }, { field: 'lineName', title: '监测点名称', minWidth: 160 },
{ field: 'connectedBus', title: '接入母线', minWidth: 170 }, { field: 'connectedBus', title: '接入母线', minWidth: 160 },
{ field: 'monitoringTerminalCode', title: '终端编号', minWidth: 170 }, { field: 'monitoringTerminalCode', title: '终端编号', minWidth: 140 },
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 }, { field: 'monitoringTerminalName', title: '终端名称', minWidth: 140 },
{ field: 'powerSubstationName', title: '变电站', minWidth: 170 }, { field: 'powerSubstationName', title: '变电站', minWidth: 160 },
{ field: 'reason', title: '调试原因', minWidth: 170 }, { field: 'reason', title: '调试原因', minWidth: 160 },
{ {
field: 'testRunState', field: 'testRunState',
title: '试运行状态', title: '试运行状态',
@@ -56,6 +81,7 @@ const tableStore = new TableStore({
null: '待试运行' null: '待试运行'
} }
}, },
{ field: 'testRunTime', title: '试运行时间范围', minWidth: 260 },
{ {
field: 'status', field: 'status',
title: '审核状态', title: '审核状态',
@@ -72,12 +98,13 @@ const tableStore = new TableStore({
2: '审批通过', 2: '审批通过',
3: '审批不通过', 3: '审批不通过',
4: '已取消', 4: '已取消',
null:'/' null: '/',
9: '/'
} }
}, },
{ {
title: '操作', title: '操作',
minWidth: 200, minWidth: 170,
fixed: 'right', fixed: 'right',
render: 'buttons', render: 'buttons',
buttons: [ buttons: [
@@ -92,9 +119,9 @@ const tableStore = new TableStore({
handleAudit(row.processInstanceId) handleAudit(row.processInstanceId)
}, },
disabled: row => { disabled: row => {
return !row.processInstanceId; return row.testRunState != 2
}
} }
},
] ]
} }
@@ -108,7 +135,6 @@ const tableStore = new TableStore({
}) })
provide('tableStore', tableStore) provide('tableStore', tableStore)
@@ -116,6 +142,9 @@ onMounted(() => {
tableStore.index() tableStore.index()
}) })
const dateValue = ref([])
/** 处理审批按钮 */ /** 处理审批按钮 */
const handleAudit = (instanceId: any) => { const handleAudit = (instanceId: any) => {
push({ push({
@@ -126,24 +155,84 @@ const handleAudit = (instanceId: any) => {
}) })
} }
//试运行 //试运行
const startRunTest = () => {
let monitorIds: any = [] let monitorIds: any = []
tableStore.table.selection.forEach(item => { let flag = true
if(item.testRunState != 0){ const startRunTest = () => {
if (tableStore.table.selection.length === 0) {
return ElMessage({ return ElMessage({
message: '请选择未试运行的监测点进行试运行', message: '请至少选择一个监测点进行试运行',
type: 'warning' type: 'warning'
}) })
return false; return false
} }
tableStore.table.selection.forEach(item => {
if (item.testRunState != 0) {
flag = false
}
if (item.testRunState == 0) { if (item.testRunState == 0) {
monitorIds.push(item.id) monitorIds.push(item.id)
} }
}) })
if (!flag) {
return ElMessage({
message: '请选择未试运行的监测点进行试运行',
type: 'warning'
})
return
} }
ElMessageBox.confirm('是否确认执行72小时监测点试运行', '试运行', {
confirmButtonText: '确 认',
cancelButtonText: '取 消'
}).then(() => {
runTestSubmit()
})
.catch(() => console.info('操作取消'))
}
const runTestSubmit = () => {
const start = new Date()
start.setDate(start.getDate() + 1)
start.setHours(0, 0, 0)
const end = new Date()
end.setDate(end.getDate() + 3)
end.setHours(23, 59, 59)
const startString = formatTime(start) // 转换为 YYYY-MM-DD HH:mm:ss 格式
const endString = formatTime(end)
const data = {
startTime: startString,
endTime: endString,
lineIds: monitorIds
}
addRunTest(data).then((res: any) => {
if (res.code === 'A0000') {
return ElMessage({
message: '发起试运行成功',
type: 'success'
})
}
})
}
const formatTime = (date:any) => {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始所以需要+1
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds;
}
</script> </script>
<style scoped lang="scss"> <style scoped lang='scss'>
</style> </style>