mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-23 06:32:27 +08:00
Merge pull request #133 from aqi-lu/feat/aqi
feat(function): add 菜单权限添加删除
This commit is contained in:
@@ -115,6 +115,7 @@
|
|||||||
>保存修改</n-button
|
>保存修改</n-button
|
||||||
>
|
>
|
||||||
<n-button @click="handleReset">重置</n-button>
|
<n-button @click="handleReset">重置</n-button>
|
||||||
|
<n-button @click="handleDel">删除</n-button>
|
||||||
</n-space>
|
</n-space>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-form>
|
</n-form>
|
||||||
@@ -126,7 +127,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, unref, reactive, onMounted, computed } from 'vue';
|
import { ref, unref, reactive, onMounted, computed } from 'vue';
|
||||||
import { useMessage } from 'naive-ui';
|
import { useDialog, useMessage } from 'naive-ui';
|
||||||
import { DownOutlined, AlignLeftOutlined, SearchOutlined, FormOutlined } from '@vicons/antd';
|
import { DownOutlined, AlignLeftOutlined, SearchOutlined, FormOutlined } from '@vicons/antd';
|
||||||
import { getMenuList } from '@/api/system/menu';
|
import { getMenuList } from '@/api/system/menu';
|
||||||
import { getTreeItem } from '@/utils';
|
import { getTreeItem } from '@/utils';
|
||||||
@@ -148,6 +149,7 @@
|
|||||||
const formRef: any = ref(null);
|
const formRef: any = ref(null);
|
||||||
const createDrawerRef = ref();
|
const createDrawerRef = ref();
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
|
const dialog = useDialog();
|
||||||
|
|
||||||
let treeItemKey = ref([]);
|
let treeItemKey = ref([]);
|
||||||
|
|
||||||
@@ -212,6 +214,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDel() {
|
||||||
|
dialog.info({
|
||||||
|
title: '提示',
|
||||||
|
content: `您确定想删除此权限吗?`,
|
||||||
|
positiveText: '确定',
|
||||||
|
negativeText: '取消',
|
||||||
|
onPositiveClick: () => {
|
||||||
|
message.success('删除成功');
|
||||||
|
},
|
||||||
|
onNegativeClick: () => {
|
||||||
|
message.error('已取消');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function handleReset() {
|
function handleReset() {
|
||||||
const treeItem = getTreeItem(unref(treeData), treeItemKey.value[0]);
|
const treeItem = getTreeItem(unref(treeData), treeItemKey.value[0]);
|
||||||
Object.assign(formParams, treeItem);
|
Object.assign(formParams, treeItem);
|
||||||
|
|||||||
Reference in New Issue
Block a user