Browse Source

详情组件扩展操作按钮

master
陈薪名 12 months ago
parent
commit
83192f2385
  1. 18
      src/components/Detail/src/Detail.vue

18
src/components/Detail/src/Detail.vue

@ -230,6 +230,14 @@ const props = defineProps({
type: Array, type: Array,
required: false, required: false,
default: null default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
} }
}) })
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
@ -364,13 +372,14 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
} }
// //
buttondata.value = [ buttondata.value = [...[
defaultButtons.mainListEditBtn({ defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row, ['1'])
}), // }), //
defaultButtons.mainListDeleteBtn({ defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row, ['1'])
}) // })], //
...props.buttondataTable
] ]
} finally { } finally {
detailLoading.value = false detailLoading.value = false
@ -459,6 +468,8 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'delete') { } else if (val == 'delete') {
// //
handleDelete(row.id) handleDelete(row.id)
} else {
emit('tableFormButton',val, row)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
@ -497,7 +508,8 @@ const emit = defineEmits([
'searchTableSuccessDetail', 'searchTableSuccessDetail',
'changeTabs', 'changeTabs',
'selectChangeDetail', 'selectChangeDetail',
'detailOpenForm' 'detailOpenForm',
'tableFormButton'
]) ])
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {

Loading…
Cancel
Save