|
|
@ -10,6 +10,7 @@ |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
:routeName="routeName" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
@buttonBaseClick="buttonBaseClick" |
|
|
|
:allSchemas="allSchemasRef" |
|
|
|
/> |
|
|
|
<ContentWrap> |
|
|
@ -26,6 +27,7 @@ |
|
|
|
v-model:sort="tableObjectRef.sort" |
|
|
|
:searchTableSelectionsList="searchTableSelectionsList" |
|
|
|
:selection="true" |
|
|
|
:selectionTotal="multipleBol" |
|
|
|
:reserveSelection="true" |
|
|
|
row-key="id" |
|
|
|
/> |
|
|
@ -53,10 +55,18 @@ routeName.value = route.name |
|
|
|
const searchDialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const dialogTitle = ref('') // 弹窗的标题 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
const multipleBol = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = ref([ |
|
|
|
const HeadButttondata = ref(multipleBol.value? |
|
|
|
[ |
|
|
|
defaultButtons.defaultWhenPageBtn(null), // 选择当页 |
|
|
|
defaultButtons.defaultUnselectPageBtn(null), // 反选当页 |
|
|
|
defaultButtons.defaultDeselectAllBtn(null), // 取消全选 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
]:[ |
|
|
|
defaultButtons.defaultFilterBtn(null) // 筛选 |
|
|
|
]) |
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
@ -71,26 +81,37 @@ const searchFieldRef = ref() |
|
|
|
const typeRef = ref() |
|
|
|
const rowRef = ref() |
|
|
|
const allSchemasRef = ref() |
|
|
|
const multipleBol = ref(false) |
|
|
|
const searchConditionRef = ref() |
|
|
|
const searchTableSelectionsList = ref()//表格弹窗回显的列表 |
|
|
|
|
|
|
|
const openData = (titleName: any, tableObject:any ,allSchemas: any,multiple: any) => { |
|
|
|
dialogWidth.value = '80%' |
|
|
|
HeadButttondata.value = [ |
|
|
|
multipleBol.value = multiple |
|
|
|
HeadButttondata.value = multiple?[ |
|
|
|
defaultButtons.defaultWhenPageBtn(null), // 选择当页 |
|
|
|
defaultButtons.defaultUnselectPageBtn(null), // 反选当页 |
|
|
|
defaultButtons.defaultDeselectAllBtn(null), // 取消全选 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
]:[ |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
] |
|
|
|
dialogTitle.value = t(`ts.${titleName}`).replace('ts.','') |
|
|
|
tableObjectRef.value = tableObject |
|
|
|
searchDialogVisible.value = true |
|
|
|
multipleBol.value = multiple |
|
|
|
allSchemasRef.value = allSchemas |
|
|
|
searchSchema.value = allSchemas.searchSchema |
|
|
|
tableColumns.value = allSchemas.tableColumns |
|
|
|
} |
|
|
|
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any,isConcatDetailSchemas=false,detailSchemas: any, searchTableSelections:any) => { |
|
|
|
dialogWidth.value = '80%' |
|
|
|
HeadButttondata.value = [ |
|
|
|
multipleBol.value = multiple |
|
|
|
HeadButttondata.value = multiple?[ |
|
|
|
defaultButtons.defaultWhenPageBtn(null), // 选择当页 |
|
|
|
defaultButtons.defaultUnselectPageBtn(null), // 反选当页 |
|
|
|
defaultButtons.defaultDeselectAllBtn(null), // 取消全选 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
]: |
|
|
|
[ |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
] |
|
|
|
searchDialogVisible.value = true |
|
|
@ -108,7 +129,6 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s |
|
|
|
getPage.value = getApiPage |
|
|
|
typeRef.value = type |
|
|
|
rowRef.value = row |
|
|
|
multipleBol.value = multiple |
|
|
|
// dialogTitle.value = t('action.' + type) |
|
|
|
dialogTitle.value = t(`ts.${titleName}`).replace('ts.','') |
|
|
|
searchTableSelectionsList.value = searchTableSelections |
|
|
@ -175,6 +195,20 @@ const searchFormClick = (searchData) => { |
|
|
|
} |
|
|
|
getListRef.value() // 刷新当前列表 |
|
|
|
} |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
// 设置按钮 |
|
|
|
if (val == 'DeselectAll') { |
|
|
|
// 取消全选 |
|
|
|
searchTableRef.value.clearSelection() |
|
|
|
} else if (val == 'UnselectPage') { |
|
|
|
// 反选当页 |
|
|
|
searchTableRef.value.togglePageSelection() |
|
|
|
} else if (val == 'WhenPage') { |
|
|
|
// 选择当页 |
|
|
|
searchTableRef.value.toggleAllSelection(true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
defineExpose({ open,openData,hiddenFilterButton ,changeDialogWidth}) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|