|
|
@ -67,6 +67,7 @@ |
|
|
|
:data="tableObjectRef.tableList" |
|
|
|
:allList="allList" |
|
|
|
:countScopeType="countScopeType" |
|
|
|
:key="updateKey" |
|
|
|
> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase |
|
|
@ -138,7 +139,7 @@ const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' |
|
|
|
|
|
|
|
const updateKey = ref(0); |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
// 标签参数 |
|
|
@ -447,6 +448,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
emit('detailOpenForm', row) |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
@ -455,6 +457,10 @@ const buttonTableClick = async (val, row) => { |
|
|
|
/** 添加/修改操作 */ |
|
|
|
const formRef = ref() |
|
|
|
const openForm = async (type: string, row?: number) => { |
|
|
|
console.log(row) |
|
|
|
if(props.fromeWhere=='countPlan'){ |
|
|
|
|
|
|
|
} |
|
|
|
formRef.value.open(type, row, masterParmas.value) |
|
|
|
} |
|
|
|
// form 提交 |
|
|
@ -472,7 +478,8 @@ const submitForm = async (formType, data) => { |
|
|
|
} |
|
|
|
formRef.value.dialogVisible = false |
|
|
|
// 刷新当前列表 |
|
|
|
getList() |
|
|
|
await getList() |
|
|
|
updateKey.value += 1; |
|
|
|
} finally { |
|
|
|
formRef.value.formLoading = false |
|
|
|
} |
|
|
@ -483,7 +490,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
emit('searchTableSuccessDetail', formField, searchField, val, formRef) |
|
|
|
} |
|
|
|
// 传递给父类 |
|
|
|
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs','selectChangeDetail']) |
|
|
|
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs','selectChangeDetail','detailOpenForm']) |
|
|
|
/** 删除按钮操作 */ |
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
try { |
|
|
@ -494,10 +501,11 @@ const handleDelete = async (id: number) => { |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
updateKey.value += 1; |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
// 筛选提交 |
|
|
|
const searchFormClick = (searchData) => { |
|
|
|
const searchFormClick =async (searchData) => { |
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: props.apiPage // 分页接口 |
|
|
|
}) |
|
|
@ -512,7 +520,8 @@ const searchFormClick = (searchData) => { |
|
|
|
tableMethodsRef.value = tableMethods |
|
|
|
tableObjectRef.value.tableList = [] |
|
|
|
const { getList } = tableMethods |
|
|
|
getList() |
|
|
|
await getList() |
|
|
|
updateKey.value += 1; |
|
|
|
// tableObjectRef.value.params = { |
|
|
|
// isSearch: true, |
|
|
|
// filters: searchData.filters |
|
|
|