|
@@ -10,6 +10,7 @@
|
|
|
import { BasicForm, useForm } from '/@/components/Form/index';
|
|
|
import { adapt } from '/@/utils/adapt'
|
|
|
import { formSchema, } from './data'
|
|
|
+ import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
interface Menu {
|
|
|
id: string|number
|
|
@@ -20,7 +21,7 @@
|
|
|
|
|
|
|
|
|
setup(_, { emit }) {
|
|
|
-
|
|
|
+ const { notification } = useMessage();
|
|
|
const menu = reactive<Menu>({
|
|
|
id: ''
|
|
|
})
|
|
@@ -62,6 +63,14 @@
|
|
|
if (menu.id) {
|
|
|
info.id = menu.id
|
|
|
}
|
|
|
+ if(info.id === info.parent) {
|
|
|
+ notification.error({
|
|
|
+ message: '错误!',
|
|
|
+ description: "不能选择当前菜单作为上级菜单!",
|
|
|
+ duration: 3,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
const data = {}
|
|
|
for(let key in info){
|
|
|
if (info[key]) {
|