mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: beforeSave may not define issue
This commit is contained in:
parent
5490e48d9f
commit
a19878aaeb
1 changed files with 22 additions and 22 deletions
|
@ -93,7 +93,7 @@ function clear_error() {
|
|||
|
||||
const ok = async () => {
|
||||
clear_error()
|
||||
await props.beforeSave(data)
|
||||
await props?.beforeSave?.(data)
|
||||
props.api!.save(data.id, data).then((r: any) => {
|
||||
message.success($gettext('Save Successfully'))
|
||||
Object.assign(data, r)
|
||||
|
@ -131,13 +131,13 @@ function edit(id: any) {
|
|||
</template>
|
||||
|
||||
<std-table
|
||||
ref="table"
|
||||
v-bind="props"
|
||||
@clickEdit="edit"
|
||||
@selected="onSelect"
|
||||
:key="update"
|
||||
:get_params="get_params"
|
||||
:exportCsv="exportCsv"
|
||||
ref="table"
|
||||
v-bind="props"
|
||||
@clickEdit="edit"
|
||||
@selected="onSelect"
|
||||
:key="update"
|
||||
:get_params="get_params"
|
||||
:exportCsv="exportCsv"
|
||||
>
|
||||
<template v-slot:actions="slotProps">
|
||||
<slot name="actions" :actions="slotProps.record"/>
|
||||
|
@ -146,22 +146,22 @@ function edit(id: any) {
|
|||
</a-card>
|
||||
|
||||
<a-modal
|
||||
class="std-curd-edit-modal"
|
||||
:mask="false"
|
||||
:title="data.id ? $gettext('Modify') : $gettext('Add')"
|
||||
:visible="visible"
|
||||
:cancel-text="$gettext('Cancel')"
|
||||
:ok-text="$gettext('OK')"
|
||||
@cancel="cancel"
|
||||
@ok="ok"
|
||||
:width="600"
|
||||
destroyOnClose
|
||||
class="std-curd-edit-modal"
|
||||
:mask="false"
|
||||
:title="data.id ? $gettext('Modify') : $gettext('Add')"
|
||||
:visible="visible"
|
||||
:cancel-text="$gettext('Cancel')"
|
||||
:ok-text="$gettext('OK')"
|
||||
@cancel="cancel"
|
||||
@ok="ok"
|
||||
:width="600"
|
||||
destroyOnClose
|
||||
>
|
||||
<std-data-entry
|
||||
ref="std_data_entry"
|
||||
:data-list="editableColumns()"
|
||||
v-model:data-source="data"
|
||||
:error="error"
|
||||
ref="std_data_entry"
|
||||
:data-list="editableColumns()"
|
||||
v-model:data-source="data"
|
||||
:error="error"
|
||||
/>
|
||||
<slot name="edit" :data="data"/>
|
||||
</a-modal>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue