fix: bug#10844
This commit is contained in:
parent
3f075e6f24
commit
62bd45e624
|
@ -122,7 +122,8 @@ const table = reactive({
|
|||
routeParams.id &&
|
||||
getMenuInfo_api(routeParams.id).then((resp: any) => {
|
||||
menuInfo.value = resp.result;
|
||||
table.tableData = resp.result.buttons as tableDataItem[];
|
||||
table.tableData =
|
||||
(resp.result?.buttons as tableDataItem[]) || [];
|
||||
});
|
||||
},
|
||||
clickDel: (row: tableDataItem) => {
|
||||
|
|
|
@ -95,8 +95,8 @@ const confirm = () => {
|
|||
loading.value = true;
|
||||
formRef.value &&
|
||||
formRef.value.validate().then(() => {
|
||||
const buttons = toRaw(props.menuInfo.buttons);
|
||||
const button = buttons.find((item) => item.id === form.data.id);
|
||||
const buttons = toRaw(props.menuInfo?.buttons);
|
||||
const button = buttons?.find((item) => item.id === form.data.id);
|
||||
if (button) {
|
||||
Object.entries(form.data).forEach(([key, value]) => {
|
||||
button[key] = value;
|
||||
|
@ -112,7 +112,10 @@ const confirm = () => {
|
|||
emits('confirm');
|
||||
emits('update:visible', false);
|
||||
})
|
||||
.finally(() => (loading.value = false));
|
||||
.finally(() => (loading.value = false))
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
});
|
||||
};
|
||||
const initForm = {
|
||||
|
|
Loading…
Reference in New Issue