2024-05-21 15:42:18 +08:00
|
|
|
|
<!---试运行列表-->
|
|
|
|
|
|
<template>
|
2024-05-27 20:13:28 +08:00
|
|
|
|
<div class="default-main">
|
2024-05-22 17:47:47 +08:00
|
|
|
|
<TableHeader area datePicker ref='TableHeaderRef'>
|
|
|
|
|
|
|
|
|
|
|
|
<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>-->
|
2024-05-22 09:19:52 +08:00
|
|
|
|
</div>
|
2024-05-21 15:42:18 +08:00
|
|
|
|
</template>
|
2024-05-22 17:47:47 +08:00
|
|
|
|
<script setup lang='ts'>
|
2024-05-21 15:42:18 +08:00
|
|
|
|
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'
|
2024-05-22 17:47:47 +08:00
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
|
import { addRunTest } from '@/api/supervision-boot/lineRunTest'
|
2024-05-24 09:39:54 +08:00
|
|
|
|
import { formatDate } from '@/utils/formatTime'
|
2024-05-21 15:42:18 +08:00
|
|
|
|
|
|
|
|
|
|
const dictData = useDictData()
|
|
|
|
|
|
const { push } = useRouter()
|
|
|
|
|
|
|
|
|
|
|
|
const TableHeaderRef = ref()
|
|
|
|
|
|
const tableRef = ref()
|
|
|
|
|
|
|
|
|
|
|
|
const tableStore = new TableStore({
|
|
|
|
|
|
url: '/supervision-boot/tempLinedebug/pageHasDebug',
|
|
|
|
|
|
method: 'POST',
|
|
|
|
|
|
column: [
|
2024-05-22 17:47:47 +08:00
|
|
|
|
{ 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 },
|
2024-05-22 09:19:52 +08:00
|
|
|
|
{
|
|
|
|
|
|
field: 'testRunState',
|
|
|
|
|
|
title: '试运行状态',
|
|
|
|
|
|
minWidth: 100,
|
|
|
|
|
|
render: 'tag',
|
|
|
|
|
|
custom: {
|
|
|
|
|
|
0: 'primary',
|
|
|
|
|
|
2: 'success',
|
|
|
|
|
|
3: 'danger',
|
|
|
|
|
|
1: 'warning'
|
|
|
|
|
|
},
|
|
|
|
|
|
replaceValue: {
|
|
|
|
|
|
0: '待试运行',
|
|
|
|
|
|
1: '试运行中',
|
|
|
|
|
|
2: '试运行成功',
|
|
|
|
|
|
3: '试运行失败',
|
2024-05-22 17:47:47 +08:00
|
|
|
|
null: '待试运行'
|
2024-05-22 09:19:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2024-05-22 17:47:47 +08:00
|
|
|
|
{ field: 'testRunTime', title: '试运行时间范围', minWidth: 260 },
|
2024-05-21 15:42:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
field: 'status',
|
|
|
|
|
|
title: '审核状态',
|
|
|
|
|
|
minWidth: 100,
|
|
|
|
|
|
render: 'tag',
|
|
|
|
|
|
custom: {
|
|
|
|
|
|
1: 'primary',
|
|
|
|
|
|
2: 'success',
|
|
|
|
|
|
3: 'danger',
|
|
|
|
|
|
4: 'warning'
|
|
|
|
|
|
},
|
|
|
|
|
|
replaceValue: {
|
|
|
|
|
|
1: '审批中',
|
|
|
|
|
|
2: '审批通过',
|
|
|
|
|
|
3: '审批不通过',
|
|
|
|
|
|
4: '已取消',
|
2024-05-22 17:47:47 +08:00
|
|
|
|
null: '/',
|
|
|
|
|
|
9: '/'
|
2024-05-21 15:42:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '操作',
|
2024-05-22 17:47:47 +08:00
|
|
|
|
minWidth: 170,
|
2024-05-21 15:42:18 +08:00
|
|
|
|
fixed: 'right',
|
|
|
|
|
|
render: 'buttons',
|
|
|
|
|
|
buttons: [
|
|
|
|
|
|
{
|
2024-05-22 09:19:52 +08:00
|
|
|
|
|
2024-05-21 15:42:18 +08:00
|
|
|
|
name: 'productSetting',
|
|
|
|
|
|
title: '流程详情',
|
|
|
|
|
|
type: 'primary',
|
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
|
click: row => {
|
|
|
|
|
|
handleAudit(row.processInstanceId)
|
|
|
|
|
|
},
|
|
|
|
|
|
disabled: row => {
|
2024-05-22 17:47:47 +08:00
|
|
|
|
return row.testRunState != 2
|
2024-05-21 15:42:18 +08:00
|
|
|
|
}
|
2024-05-22 17:47:47 +08:00
|
|
|
|
}
|
2024-05-22 09:19:52 +08:00
|
|
|
|
|
2024-05-21 15:42:18 +08:00
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
beforeSearchFun: () => {
|
|
|
|
|
|
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
|
|
|
|
|
|
tableStore.table.params.statveList = [2]
|
|
|
|
|
|
// tableStore.table.params.relationUserName = tableStore.table.params.userName
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
tableStore.index()
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2024-05-22 17:47:47 +08:00
|
|
|
|
|
2024-05-21 15:42:18 +08:00
|
|
|
|
/** 处理审批按钮 */
|
|
|
|
|
|
const handleAudit = (instanceId: any) => {
|
|
|
|
|
|
push({
|
|
|
|
|
|
name: 'BpmProcessInstanceDetail',
|
|
|
|
|
|
query: {
|
|
|
|
|
|
id: instanceId
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-05-22 09:19:52 +08:00
|
|
|
|
//试运行
|
2024-05-22 17:47:47 +08:00
|
|
|
|
let monitorIds: any = []
|
2024-05-22 19:53:25 +08:00
|
|
|
|
|
2024-05-22 09:19:52 +08:00
|
|
|
|
const startRunTest = () => {
|
2024-05-22 19:53:25 +08:00
|
|
|
|
let flag = true
|
2024-05-22 17:47:47 +08:00
|
|
|
|
if (tableStore.table.selection.length === 0) {
|
|
|
|
|
|
return ElMessage({
|
|
|
|
|
|
message: '请至少选择一个监测点进行试运行',
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-22 09:19:52 +08:00
|
|
|
|
tableStore.table.selection.forEach(item => {
|
2024-05-22 17:47:47 +08:00
|
|
|
|
if (item.testRunState != 0) {
|
|
|
|
|
|
flag = false
|
2024-05-22 09:19:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (item.testRunState == 0) {
|
|
|
|
|
|
monitorIds.push(item.id)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-05-22 17:47:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!flag) {
|
|
|
|
|
|
return ElMessage({
|
|
|
|
|
|
message: '请选择未试运行的监测点进行试运行',
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
})
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ElMessageBox.confirm('是否确认执行72小时监测点试运行?', '试运行', {
|
|
|
|
|
|
confirmButtonText: '确 认',
|
|
|
|
|
|
cancelButtonText: '取 消'
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
runTestSubmit()
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(() => console.info('操作取消'))
|
|
|
|
|
|
|
2024-05-21 15:42:18 +08:00
|
|
|
|
}
|
2024-05-22 17:47:47 +08:00
|
|
|
|
|
|
|
|
|
|
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)
|
2024-05-24 09:39:54 +08:00
|
|
|
|
const startString = formatDate(start, 'YYYY-MM-DD') // 转换为 YYYY-MM-DD 格式
|
|
|
|
|
|
const endString = formatDate(end,'YYYY-MM-DD')
|
2024-05-22 17:47:47 +08:00
|
|
|
|
const data = {
|
|
|
|
|
|
startTime: startString,
|
|
|
|
|
|
endTime: endString,
|
|
|
|
|
|
lineIds: monitorIds
|
|
|
|
|
|
}
|
|
|
|
|
|
addRunTest(data).then((res: any) => {
|
|
|
|
|
|
if (res.code === 'A0000') {
|
2024-05-22 19:53:25 +08:00
|
|
|
|
ElMessage({
|
2024-05-22 17:47:47 +08:00
|
|
|
|
message: '发起试运行成功',
|
|
|
|
|
|
type: 'success'
|
|
|
|
|
|
})
|
2024-05-22 19:53:25 +08:00
|
|
|
|
tableStore.index()
|
2024-05-22 17:47:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-21 15:42:18 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
2024-05-22 17:47:47 +08:00
|
|
|
|
<style scoped lang='scss'>
|
2024-05-21 15:42:18 +08:00
|
|
|
|
|
2024-05-22 09:19:52 +08:00
|
|
|
|
</style>
|