Browse Source

🚀

master
wangxiang 2 years ago
parent
commit
fb72ae7ee9
  1. 13
      src/components/Table/src/components/TableAction.vue
  2. 39
      src/views/system/user/index.vue

13
src/components/Table/src/components/TableAction.vue

@ -25,14 +25,14 @@
> >
<slot name="more"/> <slot name="more"/>
<a-button v-if="!$slots.more" type="link" size="small"> <a-button v-if="!$slots.more" type="link" size="small">
<MoreOutlined class="icon-more"/> 更多<Icon icon="mdi-light:chevron-down"/>
</a-button> </a-button>
</Dropdown> </Dropdown>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, PropType, computed, toRaw, unref } from 'vue'; import { defineComponent, PropType, computed, toRaw, unref } from 'vue';
import { MoreOutlined } from '@ant-design/icons-vue';
import { Divider, Tooltip, TooltipProps } from 'ant-design-vue'; import { Divider, Tooltip, TooltipProps } from 'ant-design-vue';
import Icon from '/@/components/Icon/index'; import Icon from '/@/components/Icon/index';
import { ActionItem, TableActionType } from '/@/components/Table'; import { ActionItem, TableActionType } from '/@/components/Table';
@ -47,7 +47,7 @@
export default defineComponent({ export default defineComponent({
name: 'TableAction', name: 'TableAction',
components: { Icon, PopConfirmButton, Divider, Dropdown, MoreOutlined, Tooltip }, components: { Icon, PopConfirmButton, Divider, Dropdown, Tooltip },
props: { props: {
actions: { actions: {
type: Array as PropType<ActionItem[]>, type: Array as PropType<ActionItem[]>,
@ -148,3 +148,10 @@
}, },
}); });
</script> </script>
<style lang="less">
@prefix-cls: ~'@{namespace}-basic-table-action';
.@{prefix-cls} {
height: 22px;
}
</style>

39
src/views/system/user/index.vue

@ -26,7 +26,22 @@
>删除用户</a-button> >删除用户</a-button>
</template> </template>
<template #action="{ record }"> <template #action="{ record }">
<TableAction :actions="[ <TableAction
:actions="[
{
label: '编辑',
icon: 'fa6-regular:pen-to-square',
auth: ['user_edit'],
onClick: handleEdit.bind(null, record)
},
{
label: '删除',
icon: 'ant-design:delete-outlined',
color: 'error',
auth: ['user_del'],
onClick: handleDel.bind(null, record)
}]"
:dropDownActions="[
{ {
label: '加入黑名单', label: '加入黑名单',
icon: 'fa6-regular:pen-to-square', icon: 'fa6-regular:pen-to-square',
@ -47,19 +62,6 @@
icon: 'fa6-brands:battle-net', icon: 'fa6-brands:battle-net',
auth: ['user_reset'], auth: ['user_reset'],
onClick: handleResetPassword.bind(null, record), onClick: handleResetPassword.bind(null, record),
},
{
label: '编辑',
icon: 'fa6-regular:pen-to-square',
auth: ['user_edit'],
onClick: handleEdit.bind(null, record)
},
{
label: '删除',
icon: 'ant-design:delete-outlined',
color: 'error',
auth: ['user_del'],
onClick: handleDel.bind(null, record)
}]" }]"
/> />
</template> </template>
@ -90,6 +92,7 @@
import {addPushUserManage} from '/@/api/platform/common/controller/pushUserManage'; import {addPushUserManage} from '/@/api/platform/common/controller/pushUserManage';
import {useUserStore} from '/@/store/modules/user'; import {useUserStore} from '/@/store/modules/user';
import {addPushPassList} from '/@/api/platform/common/controller/pushPassList'; import {addPushPassList} from '/@/api/platform/common/controller/pushPassList';
import { MoreOutlined } from '@ant-design/icons-vue';
const userStore = useUserStore(); const userStore = useUserStore();
const userInfoStore = userStore.getUserInfo; const userInfoStore = userStore.getUserInfo;
@ -110,7 +113,8 @@
DeptTree, DeptTree,
TableAction, TableAction,
UserModal, UserModal,
ResetPwdModal ResetPwdModal,
MoreOutlined
}, },
setup() { setup() {
@ -147,7 +151,7 @@
showIndexColumn: false, showIndexColumn: false,
searchInfo: state.searchInfo, searchInfo: state.searchInfo,
actionColumn: { actionColumn: {
width: 550, width: 240,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' },
@ -274,7 +278,8 @@
handleSelectionChange, handleSelectionChange,
handleRefreshTable, handleRefreshTable,
handleSelect, handleSelect,
handleResetPassword handleResetPassword,
MoreOutlined
}; };
} }
}); });

Loading…
Cancel
Save