mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +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 () => {
|
const ok = async () => {
|
||||||
clear_error()
|
clear_error()
|
||||||
await props.beforeSave(data)
|
await props?.beforeSave?.(data)
|
||||||
props.api!.save(data.id, data).then((r: any) => {
|
props.api!.save(data.id, data).then((r: any) => {
|
||||||
message.success($gettext('Save Successfully'))
|
message.success($gettext('Save Successfully'))
|
||||||
Object.assign(data, r)
|
Object.assign(data, r)
|
||||||
|
@ -131,13 +131,13 @@ function edit(id: any) {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<std-table
|
<std-table
|
||||||
ref="table"
|
ref="table"
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
@clickEdit="edit"
|
@clickEdit="edit"
|
||||||
@selected="onSelect"
|
@selected="onSelect"
|
||||||
:key="update"
|
:key="update"
|
||||||
:get_params="get_params"
|
:get_params="get_params"
|
||||||
:exportCsv="exportCsv"
|
:exportCsv="exportCsv"
|
||||||
>
|
>
|
||||||
<template v-slot:actions="slotProps">
|
<template v-slot:actions="slotProps">
|
||||||
<slot name="actions" :actions="slotProps.record"/>
|
<slot name="actions" :actions="slotProps.record"/>
|
||||||
|
@ -146,22 +146,22 @@ function edit(id: any) {
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-modal
|
<a-modal
|
||||||
class="std-curd-edit-modal"
|
class="std-curd-edit-modal"
|
||||||
:mask="false"
|
:mask="false"
|
||||||
:title="data.id ? $gettext('Modify') : $gettext('Add')"
|
:title="data.id ? $gettext('Modify') : $gettext('Add')"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
:cancel-text="$gettext('Cancel')"
|
:cancel-text="$gettext('Cancel')"
|
||||||
:ok-text="$gettext('OK')"
|
:ok-text="$gettext('OK')"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@ok="ok"
|
@ok="ok"
|
||||||
:width="600"
|
:width="600"
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
>
|
>
|
||||||
<std-data-entry
|
<std-data-entry
|
||||||
ref="std_data_entry"
|
ref="std_data_entry"
|
||||||
:data-list="editableColumns()"
|
:data-list="editableColumns()"
|
||||||
v-model:data-source="data"
|
v-model:data-source="data"
|
||||||
:error="error"
|
:error="error"
|
||||||
/>
|
/>
|
||||||
<slot name="edit" :data="data"/>
|
<slot name="edit" :data="data"/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue