Browse Source

🚀

master
wangxiang 2 years ago
parent
commit
fb72ae7ee9
  1. 13
      src/components/Table/src/components/TableAction.vue
  2. 81
      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>

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

@ -26,41 +26,43 @@
>删除用户</a-button> >删除用户</a-button>
</template> </template>
<template #action="{ record }"> <template #action="{ record }">
<TableAction :actions="[ <TableAction
{ :actions="[
label: '加入黑名单', {
icon: 'fa6-regular:pen-to-square', label: '编辑',
onClick: handleBlacklist.bind(null, record) icon: 'fa6-regular:pen-to-square',
}, auth: ['user_edit'],
{ onClick: handleEdit.bind(null, record)
label: '加入白名单', },
icon: 'fa6-regular:pen-to-square', {
onClick: handleWhitelist.bind(null, record) label: '删除',
}, icon: 'ant-design:delete-outlined',
{ color: 'error',
label: '推送申请', auth: ['user_del'],
icon: 'fa6-regular:pen-to-square', onClick: handleDel.bind(null, record)
onClick: handlePushAdd.bind(null, record) }]"
}, :dropDownActions="[
{ {
label: '重置密码', label: '加入黑名单',
icon: 'fa6-brands:battle-net', icon: 'fa6-regular:pen-to-square',
auth: ['user_reset'], onClick: handleBlacklist.bind(null, record)
onClick: handleResetPassword.bind(null, record), },
}, {
{ label: '加入白名单',
label: '编辑', icon: 'fa6-regular:pen-to-square',
icon: 'fa6-regular:pen-to-square', onClick: handleWhitelist.bind(null, record)
auth: ['user_edit'], },
onClick: handleEdit.bind(null, record) {
}, label: '推送申请',
{ icon: 'fa6-regular:pen-to-square',
label: '删除', onClick: handlePushAdd.bind(null, record)
icon: 'ant-design:delete-outlined', },
color: 'error', {
auth: ['user_del'], label: '重置密码',
onClick: handleDel.bind(null, record) icon: 'fa6-brands:battle-net',
}]" auth: ['user_reset'],
onClick: handleResetPassword.bind(null, record),
}]"
/> />
</template> </template>
</BasicTable> </BasicTable>
@ -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