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