fix: bug#10945 修复菜单管理部分bug

This commit is contained in:
jackhoo_98 2023-03-27 19:45:28 +08:00
parent 478fac0cac
commit 5f5b3e5b41
2 changed files with 5 additions and 8 deletions

View File

@ -406,12 +406,7 @@ type assetType = {
value: string; value: string;
}; };
watch(
() => form.data.icon,
() => {
basicFormRef.value?.validate();
},
);
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -95,13 +95,15 @@ 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;
}); });
} else buttons.push({ ...form.data }); } else {
buttons.push({ ...form.data });
}
const params = { const params = {
...props.menuInfo, ...props.menuInfo,
buttons, buttons,