首页隐藏子计划,计划列表子计划设备管理

This commit is contained in:
sjl
2025-07-22 14:56:58 +08:00
parent f81503091d
commit 1f37cc567c
11 changed files with 204 additions and 95 deletions

View File

@@ -88,7 +88,7 @@ export namespace Device {
coefficientTime?: number;//系数校准耗时
formalCheckTime?: number;//正式检测耗时
boundPlanName?: string;
boundPlanName?: string| null;
assign?: number;////是否分配给检测人员 0否 1是
monitorList: Monitor.ResPqMon[] ;
}

View File

@@ -28,7 +28,7 @@ export namespace Plan {
reportTemplateVersion:string;
dataRule:string;//数据处理原则
standardDevIdList:string[];
standardDevIds:string[];
standardDevMap:Map<string,number>;//标准设备
testItems:string[];//测试项
Check_By?:string;//计划检测人

View File

@@ -100,6 +100,11 @@ export const updateSubPlanName = (params:Plan.ReqPlan) => {
return http.get(`/adPlan/updateSubPlanName?planId=${params.id}&name=${params.name}`)
}
//子计划绑定/解绑标准设备
export const subPlanBindStandardDevList = (params:Plan.ReqPlan) => {
return http.post(`/adPlan/updateBindStandardDev`, params)
}
//子计划绑定/解绑被检设备
export const subPlanBindDev = (params:Plan.ReqPlan) => {
return http.post(`/adPlan/updateBindDev`, params)

View File

@@ -17,7 +17,7 @@
</el-select>
</el-form-item>
</el-form> -->
<!-- <el-button @click="logConnections">打印当前配对</el-button> -->
<el-button @click="logConnections">打印当前配对</el-button>
<VueFlow
:nodes="nodes"
:edges="edges"
@@ -350,8 +350,7 @@ const open = async () => {
'4': 1, // 标准设备2 → 1个通道
}
const yPosition = ref(25)
const yPosition2 = ref(25)
const createNodes = () => {
const newNodes: any[] = []
@@ -365,6 +364,9 @@ const createNodes = () => {
const outputChannelX = 800
const standardWidth = 950
const yPosition = ref(25)
const yPosition2 = ref(25)
// 添加被检通道
Object.entries(channelCounts).forEach(([deviceId, count]) => {
for (let i = 1; i <= count; i++) {

View File

@@ -523,11 +523,11 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
prop: 'devType',
label: '设备类型',
minWidth: 100,
render: (scope) => {
// 查找设备类型名称
const name = devTypeOptions.value.find(option => option.id === scope.row.devType)
return <span>{name?.name}</span>
},
// render: (scope) => {
// // 查找设备类型名称
// const name = devTypeOptions.value.find(option => option.id === scope.row.devType)
// return <span>{name?.name}</span>
// },
},
{
prop: 'devChns',

View File

@@ -80,7 +80,8 @@ const defaultChecked = ref<string[]>([]) // 明确类型为 number[]
const tree = ref(false)//确保左侧树高凉只执行一次
const getTreeData = (val: any) => {
defaultChecked.value = [];
data.value = val;
// 遍历 val 的每个 children过滤掉 pid !== '0'
data.value = val
for (let item of data.value) {
if (item.children.length > 0) {

View File

@@ -300,7 +300,8 @@ const getPieData = async (id: string) => {
const reportStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
if (id) {
const boundPqDevList = ref<Device.ResPqDev[]>([])//根据检测计划id查询出所有已绑定的设备
const plan = findPlanById(planList.value?.data || [], id)
const plan = findPlanById(planList.value, id)
console.log('所选计划:',plan)
planName.value = '所选计划:' + plan.name
select_Plan.value = plan
@@ -493,22 +494,30 @@ const initPlan = async () => {
dataRule: '',
testItemNameStr:'',
testItems: [],
standardDevIdList:[],
standardDevIds:[],
standardDevMap: new Map<string, number>(),
}
planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]>
planList.value = planList.value.data.map((item: any) => {
if (item.children) {
item.children = item.children.filter(child => child.pid === '0');
}
return item;
});
}
onBeforeMount(async () => {
await initPlan()
for (let i = 0; i < planList.value.data.length; i++) {
if (Array.isArray(planList.value.data[i].children) && planList.value.data[i].children.length > 0) {
currentId.value = planList.value.data[i].children[0].id; // 直接赋值第一个 children 的 id
console.log(planList.value)
for (let i = 0; i < planList.value.length; i++) {
if (Array.isArray(planList.value[i].children) && planList.value[i].children.length > 0) {
currentId.value = planList.value[i].children[0].id; // 直接赋值第一个 children 的 id
break; // 确保只执行一次
}
}
console.log('planList.valuecurrentId.value', currentId.value)
// if (planList.value.data[0].children[0]) {
// currentId.value = planList.value.data[0].children[0].id
// console.log('currentId.value',planList.value.data[0])
@@ -517,8 +526,7 @@ onBeforeMount(async () => {
if (chartsInfoRef.value) {
resizeObserver.observe(chartsInfoRef.value)
}
getTree(planList.value.data)
getTree(planList.value)
getPieData(currentId.value)
})
@@ -532,7 +540,7 @@ const handleBatchGenerate = async () => {
// console.log('批量生成按钮被点击了');
// 在这里添加其他逻辑,比如显示对话框、更新状态等
await initPlan()
treeRef.value.clickTableToTree(planList.value.data,currentId.value)
treeRef.value.clickTableToTree(planList.value,currentId.value)
getPieData(currentId.value)
if (form.value.activeTabs === 0)//设备检测

View File

@@ -8,6 +8,7 @@
:title="title"
:width="width"
:modal="false"
@close="handleClose"
>
<div
class="table-box"
@@ -42,13 +43,13 @@
<el-button type="primary" :icon="CirclePlus" @click="addTab('edit')" v-if="isTabPlanFather">
编辑子计划
</el-button>
<el-button type="primary" :icon="Upload" >
<!-- <el-button type="primary" :icon="Upload" >
导出检测方案
</el-button>
<el-button type="primary" :icon="Download" >
导入检测结果
</el-button>
<el-button type="danger" :icon="Delete" plain :disabled="!scope.isSelected">
</el-button> -->
<el-button type="danger" :icon="Delete" plain :disabled="!scope.isSelected" v-if="isTabPlanFather" @click="subBatchRemove(scope.selectedListIds)">
批量移除
</el-button>
<el-dropdown trigger="hover" placement="right-start" :disabled="!scope.isSelected">
@@ -85,16 +86,16 @@
</el-dropdown>
</template>
<!-- 表格操作 -->
<template #operation="">
<el-button type="primary" link :icon="Delete" v-if="!isTabPlanFather">删除</el-button>
<el-button type="primary" link :icon="Delete" v-if="isTabPlanFather">移除</el-button>
<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" @click="subHandleRemove(scope.row)">移除</el-button>
</template>
</ProTable>
</div>
</el-dialog>
<!-- 向计划导入/导出设备对话框 -->
<PlanPopup :refresh-table='proTable?.getTableList' ref='planPopup' @update:tab="addNewChildTab"/>
<DevTransfer ref='devTransfer' />
<DevTransfer ref='devTransfer' @update:table="addNewChildTab"/>
</template>
<script setup lang="tsx">
import { ElMessage, ElMessageBox, TabPaneName } from 'element-plus'
@@ -104,10 +105,12 @@ import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入
import { Plan } from '@/api/plan/interface'
import {useModeStore } from '@/stores/modules/mode'; // 引入模式 store
import { ColumnProps, ProTableInstance, SearchRenderScope } from '@/components/ProTable/interface'
import {getDevListByPlanId ,subPlanBindDev} from '@/api/plan/plan'
import {getDevListByPlanId ,subPlanBindDev,deletePlan} from '@/api/plan/plan'
import { Device } from '@/api/device/interface/device'
import { useDictStore } from '@/stores/modules/dict'
import DevTransfer from '@/views/plan/planList/components/devTransfer.vue'
import { useHandleData } from '@/hooks/useHandleData'
const dictStore = useDictStore()
const planFormContent = ref<Plan.ReqPlan>()
@@ -124,25 +127,28 @@ const planTitle = ref('')
const editableTabsValue = ref('0')
const isTabPlanFather = ref(true)
const planId = ref('')
const planTabDevList = ref<any[]>([])
const patternId = ref('')
const getTableList = async (params: any) => {
if (!planFormContent.value) {
return Promise.resolve({ data: [], total: 0 });
}
let newParams = JSON.parse(JSON.stringify(params));
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id
newParams.pattern = patternId
newParams.pattern = patternId.value
if(!isTabPlanFather.value)
newParams.planId = planFormContent.value.id
else
newParams.planId = planId.value
newParams.planIdList = [newParams.planId];
proTable.value?.clearSelection()
return getDevListByPlanId(newParams);
planTabDevList.value = await getDevListByPlanId(newParams);
return planTabDevList.value;
}
const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
{ type: 'selection', fixed: 'left', width: 70 },
{ type: 'selection', fixed: 'left', width: 70,selectable: (row) => row.checkState == 0 },
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
{
prop: 'name',
@@ -222,7 +228,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
prop: 'boundPlanName',
label: '子计划',
minWidth: 150,
isShow: isTabPlanFather.value,
render: (scope) => {
console.log('boundPlanName', isTabPlanFather.value)
const value = scope.row.boundPlanName;
@@ -248,7 +254,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
)
},
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 100 },
{ prop: 'operation', label: '操作', fixed: 'right', width: 100},
])
@@ -280,11 +286,16 @@ const editableTabs = computed(() => {
const unbindDevice = (row: any) => {
if(row.state == '/')
return
ElMessageBox.confirm(`确定将设备 ${row.name} 从子计划中解绑吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
if(row.checkState != 0){
ElMessage.warning(`当前设备已检,无法解除绑定!`);
return
}
await subPlanBindDev({'planId': row.planId, 'devIds': [row.id] ,'bindFlag': 0}) //解绑 0 绑定 1
// 👇 更新数据(例如清空 state 字段)
row.state = '/'
@@ -319,6 +330,20 @@ const addNewChildTab = async () => {
const distribute = (childPlan: Plan.ResPlan, scope: any) => {
// 获取当前选中的设备对象
const selectedDevices = planTabDevList.value.data.records.filter((dev: { id: any }) =>
scope.selectedListIds.includes(dev.id)
);
// 找出不符合条件的设备
const invalidDevices = selectedDevices.filter(
(dev: { checkState: number; assign: number }) => dev.checkState !== 0 || dev.assign === 1
);
if (invalidDevices.length > 0) {
const names = invalidDevices.map((dev: { name: any }) => dev.name).join('、');
ElMessage.warning(`以下设备不可分配:${names}`);
proTable.value?.clearSelection()
return;
}
ElMessageBox.confirm(`确定将以下被检设备分配给 ${childPlan.name} 吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -337,53 +362,45 @@ const allotStandardDev = (childPlan: Plan.ResPlan) => {
}
// 删除 tab 方法
const removeTab = (targetName: TabPaneName) => {
// 👇 添加 ElMessageBox 确认删除
ElMessageBox.confirm('确定要删除该计划吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
const tabs = editableTabs.value
let activeName = editableTabsValue.value
const removeTab = async (targetName: TabPaneName) => {
// 找到匹配的 tab
const tab = editableTabs.value.find(item => item.name === targetName);
const tabTitle = tab?.title || '未知计划'; // 获取 tab 的标题,若不存在则默认为 '未知计划'
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
const nextTab = tabs[index + 1] || tabs[index - 1]
if (nextTab) {
activeName = nextTab.name
}
}
})
}
editableTabsValue.value = activeName
editableTabs.value = tabs.filter((tab) => tab.name !== targetName)
// 可选:删除后提示成功
ElMessage.success('删除成功')
}).catch(() => {
})
await useHandleData(deletePlan, { id: [targetName], pattern: patternId.value }, `删除【${tabTitle}】检测计划`);
await props.refreshTable!()//刷新检测计划列表
}
// 弹窗打开方法
const open = async (textTitle: string,data: Plan.ReqPlan) => {
const open = async (textTitle: string,data: Plan.ReqPlan,pattern: string) => {
dialogVisible.value = true
title.value = textTitle
planTitle.value = data.name
planId.value = data.id
planFormContent.value = data
editableTabsValue.value = planFormContent.value.id//默认tab第一个
proTable.value?.getTableList()
isTabPlanFather.value = false//子计划页面按钮默认展示主计划的
patternId.value = pattern
console.log('弹窗打开方法',planFormContent.value)
}
const handleTabClick = (tab:any) => {
if(tab.props.closable){
columns.forEach(item => {//隐藏子计划名称
if (item.prop === 'boundPlanName') {
item.isShow = false;
}
});
isTabPlanFather.value = true
}else{
columns.forEach(item => {
if (item.prop === 'boundPlanName') {
item.isShow = true;
}
});
isTabPlanFather.value = false
}
planId.value = tab.props.name
@@ -418,7 +435,59 @@ const findItemById = (data: any[], id: string): any => {
return null; // 未找到匹配项
};
//子计划下移除被检设备
const subHandleRemove = async (row: any) => {
ElMessageBox.confirm(`确定要移除计划【${row.name}】吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
if(row.checkState != 0){
ElMessage.warning(`当前设备已检,无法移除!`);
return
}
await subPlanBindDev({'planId': row.planId, 'devIds': [row.id] ,'bindFlag': 0}) //解绑 0 绑定 1
ElMessage.success('移除成功');
proTable.value?.getTableList(); // 刷新当前表格
}).catch(() => {
// 用户取消操作
});
}
// 子计划下批量移除被检设备
const subBatchRemove = async (selectedListIds: string[]) => {
const selectedDevices = planTabDevList.value.data.records.filter((dev: { id: any }) =>
selectedListIds.includes(dev.id)
);
const invalidDevices = selectedDevices.filter(
(dev: { checkState: number }) => dev.checkState !== 0
);
if (invalidDevices.length > 0) {
const names = invalidDevices.map((dev: { name: any }) => dev.name).join('、');
ElMessage.warning(`以下设备不可移除(已检):${names}`);
proTable.value?.clearSelection();
return;
}
try {
await ElMessageBox.confirm(`确定要批量移除选中的 ${selectedListIds.length} 个设备吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
});
await subPlanBindDev({ planId: planId.value, devIds: selectedListIds, bindFlag: 0 });
ElMessage.success('批量移除成功');
proTable.value?.getTableList(); // 刷新表格
} catch (error) {
// 用户取消或接口异常
console.error('批量移除失败:', error);
}
};
defineExpose({ open,handleTableDataUpdate })

View File

@@ -1,13 +1,13 @@
<template>
<!-- 权限信息弹出框 -->
<el-dialog title="设备绑定" v-model='dialogVisible' @close="close" v-bind="dialogBig" width="600" draggable>
<el-dialog title="标准设备绑定" v-model='dialogVisible' @close="close" v-bind="dialogBig" width="600" draggable>
<div>
<el-transfer v-model="value"
filterable
:filter-method="filterMethod"
filter-placeholder="请输入内容搜索"
:data="allData"
:titles="['未绑定设备', '已绑定设备']">
:titles="['未绑定标准设备', '已绑定标准设备']">
<template #default="{ option }">
<el-tooltip :content="option.tips" placement="top" :show-after=1000>
<span>{{ option.label }}</span>
@@ -31,13 +31,13 @@
import { computed, ref } from 'vue'
import type { StandardDevice } from '@/api/device/interface/standardDevice'
import { dialogBig } from '@/utils/elementBind'
import { getBoundStandardDevList,getUnboundStandardDevList } from '@/api/plan/plan.ts'
import { getBoundStandardDevList,getUnboundStandardDevList,subPlanBindStandardDevList } from '@/api/plan/plan.ts'
import { type Plan } from '@/api/plan/interface'
import { ElMessage } from 'element-plus'
const unboundStandardDevList=ref<StandardDevice.ResPqStandardDevice[]>([])//指定模式下所有未绑定的标准设备
const boundStandardDevList=ref<StandardDevice.ResPqStandardDevice[]>([])//根据检测计划id查询出所有已绑定的标准设备
const dialogVisible = ref(false)
const planData = ref<Plan.ResPlan | null>(null) // 新增状态管理
const planData = ref<Plan.ReqPlan | null>(null) // 新增状态管理
const value = ref<string[]>([])
const generateData = () => {
@@ -62,7 +62,7 @@ const filterMethod = (query: string, item: { label?: string }) => {
}
// 打开弹窗,可能是新增,也可能是编辑
const open = async (data: Plan.ResPlan) => {
const open = async (data: Plan.ReqPlan) => {
dialogVisible.value = true
planData.value = data
console.log('planData.value',planData.value)
@@ -71,14 +71,23 @@ const filterMethod = (query: string, item: { label?: string }) => {
const standardDevList_Result2 = await getBoundStandardDevList(data);
boundStandardDevList.value = standardDevList_Result2.data as StandardDevice.ResPqStandardDevice[];
value.value = boundStandardDevList.value.map((i: { id: { toString: () => any } }) => i.id.toString());
}
const close = () => {
dialogVisible.value = false
}
const emit = defineEmits(['update:table'])
const save = async () => {
if (planData.value) {
planData.value.planId = planData.value.id
planData.value.devIds = value.value
await subPlanBindStandardDevList(planData.value)
emit('update:table')
ElMessage.success({ message: `标准设备绑定保存成功!` })
}
dialogVisible.value = false

View File

@@ -8,13 +8,14 @@
<el-form-item label="名称" prop="name" :label-width="110" >
<el-input v-model="formContent.name" placeholder="请输入名称" autocomplete="off" maxlength="32" show-word-limit/>
</el-form-item>
<el-form-item label='标准设备' prop='standardDevIdList' :label-width='110' v-if="selectByMode && planType == 0" >
<el-select v-model="formContent.standardDevIdList" multiple collapse-tags :max-collapse-tags="2" :disabled="planType != 0" placeholder="请选择标准设备" clearable>
<el-form-item label='标准设备' prop='standardDevIds' :label-width='110' v-if="selectByMode && planType == 0" >
<el-select v-model="formContent.standardDevIds" multiple collapse-tags :max-collapse-tags="2" :disabled="planType != 0" placeholder="请选择标准设备" clearable>
<el-option
v-for="option in pqStandardDevArray"
:key="option.value"
:label="option.label"
:value="option.value"
:disabled="subPlanBindStandardDev.includes(option.label)"
/>
</el-select>
</el-form-item>
@@ -113,7 +114,7 @@
:filter-method="filterMethod"
filter-placeholder="请输入内容搜索"
:data="allData"
:titles="['未绑定设备', '已绑定设备']">
:titles="['未绑定被检设备', '已绑定被检设备']">
<template #default="{ option }">
<span>{{ option.label }}</span>
</template>
@@ -179,7 +180,7 @@
const allData = computed(() => generateData())
const isSelectDisabled = ref(false)
const planType = ref<number>(0)
const subPlanBindStandardDev = ref<any>([])//哪些标准设备已经被子计划绑定
const generateData = () => {
const unboundData = unboundPqDevList.value.map((i: Device.ResPqDev) => ({
@@ -230,7 +231,7 @@ const filterMethod = (query: string, item: { label?: string }) => {
dataRule:'',
standardDevNameStr:'',
testItemNameStr:'',
standardDevIdList:[],
standardDevIds:[],
standardDevMap:new Map<string, number>(),
testItems:[],
Check_By:'',
@@ -269,7 +270,7 @@ const filterMethod = (query: string, item: { label?: string }) => {
reportTemplateVersion:'',
dataRule:'',
standardDevNameStr:'',
standardDevIdList:[],
standardDevIds:[],
standardDevMap:new Map<string, number>(),
testItemNameStr:'',
testItems:[],
@@ -297,7 +298,7 @@ const baseRules: Record<string, Array<FormItemRule>> = {
scriptId: [{ required: true, message: '检测脚本必选!', trigger: 'change' }],
errorSysId: [{ required: true, message: '误差体系必选!', trigger: 'change' }],
dataRule: [{ required: true, message: '数据处理原则必选!', trigger: 'change' }],
standardDevIdList: [{ required: true, message: '标准设备必选!', trigger: 'change' }],
standardDevIds: [{ required: true, message: '标准设备必选!', trigger: 'change' }],
testItems: [{ required: true, message: '测试项必选!', trigger: 'change' }],
};
@@ -344,7 +345,7 @@ const rules = computed(() => {
formContent.fatherPlanId = formContent.id;
formContent.id = '';
formContent.devIds = []
formContent.standardDevIdList = []
formContent.standardDevIds = []
formContent.standardDevMap = new Map<string, number>();
await addPlan(formContent)
emit('update:tab')
@@ -355,6 +356,7 @@ const rules = computed(() => {
console.log('更新子计划',formContent)
}
else{
formContent.sourceIds = null
await updatePlan(formContent)
}
@@ -375,7 +377,7 @@ const rules = computed(() => {
formContent.dataRule = patternItem2.id;
}
if( mode.value === '比对式'){
formContent.sourceIds = null;
formContent.sourceIds = null
await addPlan(formContent);
}else{
await addPlan({...formContent,'sourceIds':[formContent.sourceIds],'datasourceIds':[formContent.datasourceIds]});
@@ -407,6 +409,7 @@ const open = async (sign: string, data: Plan.ReqPlan,currentMode: string,plan:nu
titleType.value = sign
isSelectDisabled.value = false
planType.value = plan
console.log('planType.value',planType.value)
//比对式测试项下拉框
if(mode.value == '比对式'){
const dictCode = 'Script_Error';
@@ -511,6 +514,19 @@ const open = async (sign: string, data: Plan.ReqPlan,currentMode: string,plan:nu
// 比对式下这两个接口不需要
pqSource_Result = { data: [] };
PqScript_Result = { data: [] };
//编辑时把标准设备map赋值给数组
formContent.standardDevIds = Object.keys(formContent.standardDevMap)
//哪些标准设备已经被子计划绑定
subPlanBindStandardDev.value = Object.entries(formContent.standardDevMap)
.filter(([key, value]) => value === 1)
.map(([key]) => {
const matched = pqStandardDev_Result.data?.find(
(item: StandardDevice.ResPqStandardDevice) => item.id === key
);
return matched ? matched.name : key;
});
} else {
const commonResults = await Promise.all([
getTestSourceList(data),
@@ -622,12 +638,11 @@ function pqToArray() {
}))
const sourceArray5 = Array.isArray(pqStandardDevList.value) ? pqStandardDevList.value : []
console.log('5',sourceArray5)
pqStandardDevArray.value = sourceArray5.map(item => ({
label: item.name,
value: item.id
}))
console.log('25',pqStandardDevArray.value)
}

View File

@@ -53,10 +53,9 @@
<!-- 查看检测源 -->
<TestSourcePopup :refresh-table='proTable?.getTableList' ref="testSourcePopup"/>
<ImportExcel ref='planImportExcel' />
<ImportExcel ref='planImportExcel'/>
<ChildrenPlan :refresh-table='refreshTable' ref='childrenPlanView' :width='viewWidth' :height='viewHeight'></ChildrenPlan>
</template>
<script setup lang='tsx' name='useProTable'>
@@ -108,6 +107,8 @@ const currentPage = ref(1)
const pageSize = ref(10)
const currentPageData = ref<any[]>([])//当前页的数据
const patternId = ref('')
onMounted(async () => {
refreshTable()
@@ -200,6 +201,7 @@ function buildTree(flatList: any[]): any[] {
return tree;
}
const handleSizeChange = (size: number) => {
pageSize.value = size
updateCurrentPageData()
@@ -472,9 +474,7 @@ const importClick = () => {
}
// 点击导出按钮
const exportClick = () => {
ElMessageBox.confirm('确认导出检测计划?', '温馨提示', { type: 'warning' }).then(() =>{
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
useDownload(exportPlan,'检测计划导出数据', {...proTable.value?.searchParam,patternId:patternId}, false,'.xlsx')
})
}
@@ -500,7 +500,7 @@ const handleDelete = async (params: Plan.ReqPlanParams) => {
}
const openChildrenPlan = (row: Partial<Plan.ReqPlan> = {}) => {
childrenPlanView.value.open("检测计划详情",row)
childrenPlanView.value.open("检测计划详情",row,patternId.value)
}