Compare commits
2 Commits
747bb693ea
...
33248eec56
| Author | SHA1 | Date |
|---|---|---|
|
|
33248eec56 | |
|
|
510134cfe5 |
|
|
@ -482,7 +482,7 @@
|
|||
.ant-tree-treenode {
|
||||
padding: 4px 0 4px 0;
|
||||
span {
|
||||
height: 36px;
|
||||
// height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
|
|
@ -515,7 +515,7 @@
|
|||
.ant-tree-treenode {
|
||||
padding: 4px 0 4px 0;
|
||||
span {
|
||||
height: 36px;
|
||||
// height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,23 +4,25 @@
|
|||
<template #toolbar>
|
||||
<!-- <a-button type="primary" @click="handleCreate"> 新增角色 </a-button> -->
|
||||
<!-- <a-button type="primary" @click="handleItem"> 获取选中行 </a-button> -->
|
||||
<PermissionBtn @btnEvent="onBtnClicked"></PermissionBtn>
|
||||
<PermissionBtn @btn-event="onBtnClicked" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction :actions="[
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
icon: 'clarity:note-edit-line',
|
||||
// icon: 'ant-design:ellipsis-outlined',
|
||||
label: '查看',
|
||||
onClick: viewAccount.bind(null, record),
|
||||
},
|
||||
]" />
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<RoleModal @register="registerModal" @success="handleSuccess" />
|
||||
<ModulesModal @register="registerModulesModal" @success="handleSuccess" />
|
||||
<AccountModal @register="registerAccountModal" @success="handleSuccess" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -31,10 +33,8 @@
|
|||
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useModal } from '@/components/Modal';
|
||||
import {RoleModal} from './page';
|
||||
import {ModulesModal} from './page';
|
||||
import {AccountModal} from './page';
|
||||
import {PermissionBtn} from '@/components/PermissionBtn/index'
|
||||
import { RoleModal, ModulesModal, AccountModal } from './page';
|
||||
import { PermissionBtn } from '@/components/PermissionBtn/index';
|
||||
|
||||
import { columns, searchFormSchema } from './role.data';
|
||||
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
const [registerModal, { openModal: openRoleModal }] = useModal();
|
||||
const [registerModulesModal, { openModal: openModulesModal }] = useModal();
|
||||
const [registerAccountModal, { openModal: openAccountModal }] = useModal();
|
||||
const searchInfo = reactive < Recordable > ({});
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
|
||||
const [registerTable, { reload, getSelectRows, clearSelectedRowKeys }] = useTable({
|
||||
// 表格名称
|
||||
|
|
@ -67,7 +67,8 @@
|
|||
// 序号列
|
||||
showIndexColumn: false,
|
||||
// 勾选列
|
||||
rowSelection: {//多选框
|
||||
rowSelection: {
|
||||
//多选框
|
||||
// type: 'checkbox',
|
||||
type: 'radio',
|
||||
},
|
||||
|
|
@ -100,7 +101,7 @@
|
|||
if (rows.length == 0) {
|
||||
return createMessage.warn('请勾选一个角色进行编辑');
|
||||
}
|
||||
const record = rows[0]
|
||||
const record = rows[0];
|
||||
openRoleModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
|
|
@ -112,17 +113,17 @@
|
|||
if (rows.length == 0) {
|
||||
return createMessage.warn('请勾选一个角色进行删除');
|
||||
}
|
||||
const query = [rows[0].id]
|
||||
const query = [rows[0].id];
|
||||
createConfirm({
|
||||
iconType: 'info',
|
||||
title: '删除',
|
||||
content: '确定要删除当前角色吗',
|
||||
onOk: async () => {
|
||||
const data = await deleteRole(query);
|
||||
if(data){
|
||||
handleSuccess()
|
||||
if (data) {
|
||||
handleSuccess();
|
||||
return createMessage.success('删除成功');
|
||||
}else{
|
||||
} else {
|
||||
return createMessage.error('删除失败');
|
||||
}
|
||||
},
|
||||
|
|
@ -130,26 +131,26 @@
|
|||
}
|
||||
|
||||
function handleSuccess() {
|
||||
clearSelectedRowKeys()
|
||||
clearSelectedRowKeys();
|
||||
reload();
|
||||
}
|
||||
function onBtnClicked(domId) {
|
||||
switch (domId) {
|
||||
case 'btnAdd':
|
||||
handleCreate()
|
||||
handleCreate();
|
||||
break;
|
||||
case 'btnEdit':
|
||||
handleEdit()
|
||||
handleEdit();
|
||||
break;
|
||||
case 'btnDelete':
|
||||
handleDelete()
|
||||
handleDelete();
|
||||
break;
|
||||
case 'btnModules':
|
||||
let rows = getSelectRows();
|
||||
if (rows.length == 0) {
|
||||
return createMessage.warn('请勾选一个角色进行编辑');
|
||||
}
|
||||
const record = rows[0]
|
||||
const record = rows[0];
|
||||
openModulesModal(true, {
|
||||
record,
|
||||
});
|
||||
|
|
@ -158,4 +159,4 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue