干扰源常态化管理页面
This commit is contained in:
27
src/api/supervision-boot/lineRunTest/index.ts
Normal file
27
src/api/supervision-boot/lineRunTest/index.ts
Normal 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',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -460,7 +460,6 @@ const confirmForm = () => {
|
||||
close()
|
||||
getInfo()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
defineExpose({ open })
|
||||
|
||||
76
src/views/pqs/supervise/testRun/components/detail.vue
Normal file
76
src/views/pqs/supervise/testRun/components/detail.vue
Normal 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>
|
||||
@@ -1,23 +1,48 @@
|
||||
<!---试运行列表-->
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader area datePicker ref="TableHeaderRef">
|
||||
<TableHeader area datePicker ref='TableHeaderRef'>
|
||||
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="startRunTest">试运行</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<template #operation>
|
||||
<el-button icon='el-icon-Plus' type='primary' @click='startRunTest'>试运行</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<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>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
<script setup lang='ts'>
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
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()
|
||||
@@ -30,13 +55,13 @@ const tableStore = new TableStore({
|
||||
url: '/supervision-boot/tempLinedebug/pageHasDebug',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '', type: 'checkbox', width: 80 },
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: 170 },
|
||||
{ field: 'connectedBus', title: '接入母线', minWidth: 170 },
|
||||
{ field: 'monitoringTerminalCode', title: '终端编号', minWidth: 170 },
|
||||
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
|
||||
{ field: 'powerSubstationName', title: '变电站', minWidth: 170 },
|
||||
{ field: 'reason', title: '调试原因', minWidth: 170 },
|
||||
{ title: '', type: 'checkbox', width: 40 },
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: 160 },
|
||||
{ field: 'connectedBus', title: '接入母线', minWidth: 160 },
|
||||
{ field: 'monitoringTerminalCode', title: '终端编号', minWidth: 140 },
|
||||
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 140 },
|
||||
{ field: 'powerSubstationName', title: '变电站', minWidth: 160 },
|
||||
{ field: 'reason', title: '调试原因', minWidth: 160 },
|
||||
{
|
||||
field: 'testRunState',
|
||||
title: '试运行状态',
|
||||
@@ -53,9 +78,10 @@ const tableStore = new TableStore({
|
||||
1: '试运行中',
|
||||
2: '试运行成功',
|
||||
3: '试运行失败',
|
||||
null:'待试运行'
|
||||
null: '待试运行'
|
||||
}
|
||||
},
|
||||
{ field: 'testRunTime', title: '试运行时间范围', minWidth: 260 },
|
||||
{
|
||||
field: 'status',
|
||||
title: '审核状态',
|
||||
@@ -72,12 +98,13 @@ const tableStore = new TableStore({
|
||||
2: '审批通过',
|
||||
3: '审批不通过',
|
||||
4: '已取消',
|
||||
null:'/'
|
||||
null: '/',
|
||||
9: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
minWidth: 200,
|
||||
minWidth: 170,
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
@@ -92,9 +119,9 @@ const tableStore = new TableStore({
|
||||
handleAudit(row.processInstanceId)
|
||||
},
|
||||
disabled: row => {
|
||||
return !row.processInstanceId;
|
||||
return row.testRunState != 2
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
@@ -108,7 +135,6 @@ const tableStore = new TableStore({
|
||||
})
|
||||
|
||||
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
|
||||
@@ -116,6 +142,9 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
const dateValue = ref([])
|
||||
|
||||
|
||||
/** 处理审批按钮 */
|
||||
const handleAudit = (instanceId: any) => {
|
||||
push({
|
||||
@@ -126,24 +155,84 @@ const handleAudit = (instanceId: any) => {
|
||||
})
|
||||
}
|
||||
//试运行
|
||||
let monitorIds: any = []
|
||||
let flag = true
|
||||
const startRunTest = () => {
|
||||
let monitorIds: any = []
|
||||
tableStore.table.selection.forEach(item => {
|
||||
if(item.testRunState != 0){
|
||||
return ElMessage({
|
||||
message: '请选择未试运行的监测点进行试运行',
|
||||
type: 'warning'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (tableStore.table.selection.length === 0) {
|
||||
return ElMessage({
|
||||
message: '请至少选择一个监测点进行试运行',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
tableStore.table.selection.forEach(item => {
|
||||
if (item.testRunState != 0) {
|
||||
flag = false
|
||||
}
|
||||
if (item.testRunState == 0) {
|
||||
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>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang='scss'>
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user