被检设备监测点

This commit is contained in:
sjl
2025-07-22 16:12:08 +08:00
parent 1f37cc567c
commit bccb4b1f17
4 changed files with 8 additions and 5 deletions

View File

@@ -213,6 +213,7 @@ import MonitorTable from '@/views/machine/device/components/monitorTab.vue';
import {useAppSceneStore} from "@/stores/modules/mode"; import {useAppSceneStore} from "@/stores/modules/mode";
import { generateUUID } from '@/utils' import { generateUUID } from '@/utils'
import { Monitor } from '@/api/device/interface/monitor' import { Monitor } from '@/api/device/interface/monitor'
import { el } from 'element-plus/es/locale'
const AppSceneStore = useAppSceneStore() const AppSceneStore = useAppSceneStore()
@@ -458,6 +459,8 @@ const getParameter = (data: Monitor.ResPqMon[]) => {
.map(String) // 恢复为字符串用于保存 .map(String) // 恢复为字符串用于保存
.join(','); .join(',');
} }
}else{
formContent.inspectChannel = null;
} }

View File

@@ -175,7 +175,6 @@ const resetFormContent = () => {
const isNameDuplicate = monitorTable.value.some( const isNameDuplicate = monitorTable.value.some(
item => item.name === formContent.value.name && item.id !== formContent.value.id item => item.name === formContent.value.name && item.id !== formContent.value.id
) )
if (isNameDuplicate) { if (isNameDuplicate) {
ElMessage.error({ message: '监测点名称已存在,请重新输入!' }) ElMessage.error({ message: '监测点名称已存在,请重新输入!' })
return return
@@ -186,7 +185,7 @@ const resetFormContent = () => {
formContent.value.id = generateUUID().replaceAll("-","") formContent.value.id = generateUUID().replaceAll("-","")
} }
emit('get-parameter', formContent.value) emit('get-parameter', formContent.value)
ElMessage.success({ message: `${dialogTitle.value}成功!` }) //ElMessage.success({ message: `${dialogTitle.value}成功!` })
close() close()
} }
}) })

View File

@@ -104,6 +104,7 @@ const columns = reactive<ColumnProps<Monitor.ResPqMon>[]>([
const emit = defineEmits(['get-parameter']) const emit = defineEmits(['get-parameter'])
const getParameter = (data: Monitor.ResPqMon) => { const getParameter = (data: Monitor.ResPqMon) => {
console.log('data', data)
if (title_Type.value === 'edit') { if (title_Type.value === 'edit') {
// 编辑:替换已有的数据 // 编辑:替换已有的数据
const index = tableData.value.findIndex(item => item.id === data.id) const index = tableData.value.findIndex(item => item.id === data.id)
@@ -119,7 +120,6 @@ const getParameter = (data: Monitor.ResPqMon) => {
tableData.value = [...tableData.value, data] tableData.value = [...tableData.value, data]
} }
emit('get-parameter', tableData.value) emit('get-parameter', tableData.value)
} }
@@ -152,7 +152,7 @@ const getParameter = (data: Monitor.ResPqMon) => {
}).then(async () => { }).then(async () => {
tableData.value = tableData.value.filter(item => !ids.includes(item.id)); tableData.value = tableData.value.filter(item => !ids.includes(item.id));
proTable.value?.clearSelection() proTable.value?.clearSelection()
emit('get-parameter', tableData.value)
ElMessage({ ElMessage({
type: "success", type: "success",
message: `批量删除监测点成功!` message: `批量删除监测点成功!`
@@ -170,6 +170,7 @@ const handleDelete = (id: string) => {
}).then(async () => { }).then(async () => {
tableData.value = tableData.value.filter(item => item.id !== id) tableData.value = tableData.value.filter(item => item.id !== id)
proTable.value?.clearSelection() proTable.value?.clearSelection()
emit('get-parameter', tableData.value)
ElMessage({ ElMessage({
type: "success", type: "success",
message: `删除监测点成功!` message: `删除监测点成功!`