通道配对

This commit is contained in:
sjl
2025-07-24 08:29:03 +08:00
parent bccb4b1f17
commit 6e22c01dd8
5 changed files with 235 additions and 65 deletions

View File

@@ -8,7 +8,6 @@
:title="title"
:width="width"
:modal="false"
@close="handleClose"
>
<div
class="table-box"
@@ -87,7 +86,7 @@
</template>
<!-- 表格操作 -->
<template #operation="scope">
<el-button type="primary" link :icon="Delete" v-if="!isTabPlanFather" :disabled="scope.row.checkState != 0" >删除</el-button>
<el-button type="primary" link :icon="Delete" v-if="!isTabPlanFather" :disabled="scope.row.checkState != 0" @click="handleRemove(scope.row)">删除</el-button>
<el-button type="primary" link :icon="Delete" v-if="isTabPlanFather" @click="subHandleRemove(scope.row)">移除</el-button>
</template>
</ProTable>
@@ -283,6 +282,7 @@ const editableTabs = computed(() => {
return tabs
})
//解绑被检设备
const unbindDevice = (row: any) => {
if(row.state == '/')
return
@@ -327,7 +327,7 @@ const addNewChildTab = async () => {
await props.refreshTable!()//刷新检测计划列表
}
//分配被检设备
const distribute = (childPlan: Plan.ResPlan, scope: any) => {
// 获取当前选中的设备对象
@@ -435,6 +435,26 @@ const findItemById = (data: any[], id: string): any => {
return null; // 未找到匹配项
};
//主计划下移除被检设备
const handleRemove = async (row: any) => {
ElMessageBox.confirm(`确定要移除计划【${row.name}】吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
if(row.assign != 0){
ElMessage.warning(`当前设备已被子计划绑定,无法删除!`);
return
}
console.log('shcn',planFormContent.value)
proTable.value?.getTableList(); // 刷新当前表格
}).catch(() => {
// 用户取消操作
});
}
//子计划下移除被检设备
const subHandleRemove = async (row: any) => {
ElMessageBox.confirm(`确定要移除计划【${row.name}】吗?`, '提示', {
@@ -491,15 +511,25 @@ const subBatchRemove = async (selectedListIds: string[]) => {
defineExpose({ open,handleTableDataUpdate })
const props = defineProps<{
refreshTable: (() => Promise<void>) | undefined;
width: {
type: Number,
default: 800,
},
height: {
type: Number,
default: 744,
},
}>()
interface ChildrenPlanProps {
refreshTable?: () => Promise<void>
width?: number
height?: number
}
const props = withDefaults(defineProps<ChildrenPlanProps>(), {
width: 800,
height: 744
})
// const props = defineProps<{
// refreshTable: (() => Promise<void>) | undefined;
// width: {
// type: Number,
// default: 800,
// },
// height: {
// type: Number,
// default: 744,
// },
// }>()
</script>

View File

@@ -360,7 +360,13 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
label: '标准设备',
minWidth: 250,
isShow: modeStore.currentMode == "比对式",
render: scope => {
const standardDevNameStr = scope.row.standardDevNameStr
if (!standardDevNameStr) {
return '/'
}
return standardDevNameStr
}
},
{
prop: 'testItemNameStr',
@@ -481,7 +487,17 @@ const exportClick = () => {
// 打开 drawer(新增、编辑)
const openDialog = (titleType: string, row: Partial<Plan.ReqPlan> = {}) => {
planPopup.value?.open(titleType, row,modeStore.currentMode,0)//0主计划 1子计划 2修改子计划
if(modeStore.currentMode == '比对式'){
if(row.children?.length > 0){
planPopup.value?.open(titleType, row,modeStore.currentMode,0)//0主计划 1子计划 2修改子计划
}else{
planPopup.value?.open(titleType, row,modeStore.currentMode,2)//0主计划 1子计划 2修改子计划
}
}else{
planPopup.value?.open(titleType, row,modeStore.currentMode,0)//0主计划 1子计划 2修改子计划
}
}