|
|
@ -452,7 +452,6 @@ const tickedComputed = computed(() => { |
|
|
|
}); |
|
|
|
|
|
|
|
const buttonClick = async (button) => { |
|
|
|
let beforeResult = true; |
|
|
|
const context = {}; |
|
|
|
const args = { |
|
|
|
selected: firstSelectedComputed.value, |
|
|
@ -463,16 +462,29 @@ const buttonClick = async (button) => { |
|
|
|
context: context, |
|
|
|
selectedColName: props.grid.getSelectedCell()['colName'], |
|
|
|
}; |
|
|
|
if (button.enableIf && !button.enableIf(args)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
let beforeResult = true; |
|
|
|
if (button.beforeClick) { |
|
|
|
beforeResult = await button.beforeClick(args); |
|
|
|
} |
|
|
|
if (beforeResult && button.click) { |
|
|
|
await button.click({ ...args, _click: button._click }); |
|
|
|
let callAfterEditorOpen = true; |
|
|
|
const clickProps = { ...args }; |
|
|
|
if (button._click) { |
|
|
|
callAfterEditorOpen = false; |
|
|
|
clickProps['_click'] = (_args: any) => { |
|
|
|
button._click(_args || args); |
|
|
|
callAfterEditorOpen = true; |
|
|
|
}; |
|
|
|
} |
|
|
|
await button.click(clickProps); |
|
|
|
nextTick(async () => { |
|
|
|
if (button.afterClick) { |
|
|
|
await button.afterClick(args); |
|
|
|
} |
|
|
|
if (button.afterEditorOpen) { |
|
|
|
if (button.afterEditorOpen && callAfterEditorOpen) { |
|
|
|
button.afterEditorOpen(args); |
|
|
|
} |
|
|
|
}); |
|
|
|