事件补召,前置调整
This commit is contained in:
@@ -49,9 +49,11 @@ export function restartProcess(data: any) {
|
||||
//更新进程号
|
||||
export function updateProcess(data:any) {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/node/updateDevProcessNo',
|
||||
url: '/cs-device-boot/node/updateDevNode',
|
||||
method: 'post',
|
||||
params: data
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import shushiboxi from '@/components/echarts/shushiboxi.vue'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
|
||||
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||
import { analyseWave } from '@/api/common'
|
||||
import { analyseWave, getFileByEventId } from '@/api/common'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
@@ -153,7 +153,7 @@ const tableStore = new TableStore({
|
||||
render: 'basicButton',
|
||||
loading: 'loading1',
|
||||
disabled: row => {
|
||||
return !row.wavePath && row.evtParamTm < 20
|
||||
return !row.wavePath
|
||||
},
|
||||
click: async row => {
|
||||
row.loading1 = true
|
||||
@@ -212,7 +212,6 @@ const tableStore = new TableStore({
|
||||
loading: 'loading2',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
// && row.evtParamTm < 20
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
@@ -235,7 +234,23 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !(!row.wavePath && row.evtParamTm < 20)
|
||||
return row.showName != '未知';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '波形补召',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Check',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.wavePath || row.showName === '未知';
|
||||
},
|
||||
click: row => {
|
||||
getFileByEventId(row.id).then(res => {
|
||||
ElMessage.success(res.message)
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
label="装置mac地址:"
|
||||
:rules="{ required: true, message: '请输入装置mac地址', trigger: 'blur' }"
|
||||
>
|
||||
<MacAddressInput v-model="busItem.mac" :disabled="!((nodeLevel == 3 && pageStatus == 3) || ((nodeLevel == 2 || (nodeLevel == 1 && pageStatus == 2)) && pageStatus == 2))"/>
|
||||
<MacAddressInput v-model="busItem.mac" :disabled="!(pageStatus == 2 && nodeLevel >= 2)"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
class="form-item"
|
||||
|
||||
@@ -499,7 +499,7 @@
|
||||
v-if="dataSet.indexOf('_event') != -1"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<Event ref="eventRef"></Event>
|
||||
<Event ref="eventRef" :deviceType="deviceType"></Event>
|
||||
</div>
|
||||
<!-- 测试项记录 -->
|
||||
<div
|
||||
|
||||
@@ -134,7 +134,7 @@ const tableStore: any = new TableStore({
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return props.deviceType === '2' || row.wavePath;
|
||||
return row.showName != '未知';
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -169,7 +169,7 @@ const tableStore: any = new TableStore({
|
||||
icon: 'el-icon-Check',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return props.deviceType != '2' || row.wavePath;
|
||||
return props.deviceType === '2' && row.wavePath || row.showName === '未知';
|
||||
},
|
||||
click: row => {
|
||||
getFileByEventId(row.id).then(res => {
|
||||
|
||||
@@ -188,20 +188,36 @@
|
||||
|
||||
<!-- 绑定进程号 -->
|
||||
<el-dialog draggable title="绑定进程号" v-model="popUps" :close-on-click-modal="false" width="400px">
|
||||
<el-select v-model="processNo" placeholder="请选择进程号" style="width: 100%">
|
||||
<el-form :model="bindProcessForm" ref="bindProcessFormRef" label-width="80px" :rules="rules2" >
|
||||
<el-form-item label="前置机" prop="nodeId">
|
||||
<el-select v-model="bindProcessForm.nodeId" placeholder="请选择前置机" style="width: 100%" clearable @change="handleNodeChange">
|
||||
<el-option
|
||||
v-for="item in dataSource"
|
||||
v-for="item in tableStore.table.data"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="进程号" prop="processNo">
|
||||
<el-select v-model="bindProcessForm.processNo" placeholder="请选择进程号" style="width: 100%" clearable>
|
||||
<el-option
|
||||
v-for="item in processOptions"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="popUps = false">取 消</el-button>
|
||||
<el-button type="primary" @click="bindTheProcess">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -231,13 +247,21 @@ const height = mainHeight(70)
|
||||
const loading = ref(false)
|
||||
const popUps = ref(false)
|
||||
const tableRef = ref()
|
||||
const processNo = ref('')
|
||||
const ruleFormRef = ref()
|
||||
|
||||
const dataSource: any = ref([])
|
||||
const defaultProps = {
|
||||
children: 'deviceInfoList',
|
||||
label: 'name'
|
||||
}
|
||||
|
||||
const bindProcessFormRef = ref()
|
||||
const bindProcessForm = ref({
|
||||
nodeId: '',
|
||||
processNo: ''
|
||||
})
|
||||
const processOptions = ref<Array<{ name: string; processNo: string }>>([])
|
||||
|
||||
const formData: any = ref({
|
||||
name: '',
|
||||
ip: '',
|
||||
@@ -256,6 +280,11 @@ const rules = reactive({
|
||||
sort: [{ required: true, message: '排序不可为空', trigger: 'blur' }],
|
||||
remark: [{ required: true, message: '描述不可为空', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const rules2 = reactive({
|
||||
nodeId: [{ required: true, message: '请选择前置机', trigger: 'change' }],
|
||||
processNo: [{ required: true, message: '请选择进程号', trigger: 'change' }]
|
||||
})
|
||||
const dialogFormVisible = ref(false)
|
||||
|
||||
const dialogTitle = ref('新增前置机')
|
||||
@@ -417,22 +446,67 @@ const treeRef = ref()
|
||||
const change = (val: any) => {
|
||||
treeRef.value!.filter(filterText.value)
|
||||
}
|
||||
|
||||
|
||||
// 修改 edit 方法
|
||||
const edit = (data: any) => {
|
||||
processNo.value = data.nodeProcess
|
||||
bindProcessForm.value.processNo = data.nodeProcess
|
||||
bindProcessForm.value.nodeId = nodeId.value // 默认选中当前节点
|
||||
processId.value = data.id
|
||||
popUps.value = true
|
||||
|
||||
// 首次加载当前前置机的进程号选项
|
||||
loadProcessOptionsForNode(nodeId.value)
|
||||
}
|
||||
|
||||
const loadProcessOptionsForNode = (nodeId: string) => {
|
||||
// 请求该前置机下的进程列表
|
||||
nodeDeviceTree({ id: nodeId }).then(res => {
|
||||
if (res.data && res.data.processDeviceList) {
|
||||
// 处理进程列表数据
|
||||
processOptions.value = res.data.processDeviceList.map(item => ({
|
||||
...item,
|
||||
name: item.processNo + '' // 保持与原逻辑一致
|
||||
}))
|
||||
} else {
|
||||
processOptions.value = []
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// 前置机切换
|
||||
const handleNodeChange = (nodeId: any) => {
|
||||
if (!nodeId) {
|
||||
processOptions.value = []
|
||||
bindProcessForm.value.processNo = ''
|
||||
return
|
||||
}
|
||||
// 清除之前选中的进程号
|
||||
bindProcessForm.value.processNo = ''
|
||||
// 加载新选中前置机的进程号选项
|
||||
loadProcessOptionsForNode(nodeId)
|
||||
}
|
||||
|
||||
|
||||
// 更新进程号
|
||||
const bindTheProcess = () => {
|
||||
bindProcessFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
updateProcess({
|
||||
id: processId.value,
|
||||
processNo: processNo.value
|
||||
processNo: bindProcessForm.value.processNo,
|
||||
nodeId: bindProcessForm.value.nodeId
|
||||
}).then((res: any) => {
|
||||
ElMessage.success('修改成功!')
|
||||
popUps.value = false
|
||||
currentChangeEvent()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
const filterNode = (value: string, data: any, node: any) => {
|
||||
if (!value) return true
|
||||
// return data.name.includes(value)
|
||||
|
||||
Reference in New Issue
Block a user