Merge pull request #133 from aqi-lu/feat/aqi

feat(function): add 菜单权限添加删除
This commit is contained in:
Ah jung
2022-06-06 08:46:33 +08:00
committed by GitHub

View File

@@ -115,6 +115,7 @@
>保存修改</n-button
>
<n-button @click="handleReset">重置</n-button>
<n-button @click="handleDel">删除</n-button>
</n-space>
</n-form-item>
</n-form>
@@ -126,7 +127,7 @@
</template>
<script lang="ts" setup>
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 { getMenuList } from '@/api/system/menu';
import { getTreeItem } from '@/utils';
@@ -148,6 +149,7 @@
const formRef: any = ref(null);
const createDrawerRef = ref();
const message = useMessage();
const dialog = useDialog();
let treeItemKey = ref([]);
@@ -212,6 +214,21 @@
}
}
function handleDel() {
dialog.info({
title: '提示',
content: `您确定想删除此权限吗?`,
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
message.success('删除成功');
},
onNegativeClick: () => {
message.error('已取消');
},
});
}
function handleReset() {
const treeItem = getTreeItem(unref(treeData), treeItemKey.value[0]);
Object.assign(formParams, treeItem);