Files
admin-sjzx/src/views/pqs/supervise/testRun/index.vue

150 lines
4.0 KiB
Vue
Raw Normal View History

2024-05-21 15:42:18 +08:00
<!---试运行列表-->
<template>
2024-05-22 09:19:52 +08:00
<div>
<TableHeader area datePicker ref="TableHeaderRef">
2024-05-21 15:42:18 +08:00
<template #operation>
2024-05-22 09:19:52 +08:00
<el-button icon="el-icon-Plus" type="primary" @click="startRunTest">试运行</el-button>
2024-05-21 15:42:18 +08:00
</template>
2024-05-22 09:19:52 +08:00
</TableHeader>
<Table ref="tableRef" />
</div>
2024-05-21 15:42:18 +08:00
</template>
2024-05-22 09:19:52 +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 09:19:52 +08:00
import { ElMessage } from 'element-plus'
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 09:19:52 +08:00
{ title: '', type: 'checkbox', width: 80 },
2024-05-21 15:42:18 +08:00
{ field: 'lineName', title: '监测点名称', minWidth: 170 },
2024-05-22 09:19:52 +08:00
{ 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 },
{
field: 'testRunState',
title: '试运行状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
2: 'success',
3: 'danger',
1: 'warning'
},
replaceValue: {
0: '待试运行',
1: '试运行中',
2: '试运行成功',
3: '试运行失败',
null:'待试运行'
}
},
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: '已取消',
null:'/'
}
},
{
title: '操作',
2024-05-22 09:19:52 +08:00
minWidth: 200,
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 => {
return !row.processInstanceId;
}
},
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()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId
}
})
}
2024-05-22 09:19:52 +08:00
//试运行
const startRunTest = () => {
let monitorIds: any = []
tableStore.table.selection.forEach(item => {
if(item.testRunState != 0){
return ElMessage({
message: '请选择未试运行的监测点进行试运行',
type: 'warning'
})
return false;
}
if (item.testRunState == 0) {
monitorIds.push(item.id)
}
})
2024-05-21 15:42:18 +08:00
}
</script>
<style scoped lang="scss">
2024-05-22 09:19:52 +08:00
</style>